/* StemOverflow's shared layouts, without a CSS framework or build step.
   The founder chose the palette from the warm-paper ELBO reference on 15 Sep 2026.
   branding.css now applies the founder-selected 23 October identity after these
   base colours; semantic subject/feedback accents remain defined here.
   Layout rules then follow the page: navigation, problem, coach and dialogs.
   Georgia supplies editorial headings; system fonts keep the interface fast. */
:root {
  /* Paper and charcoal provide the quiet base seen in the reference image. */
  --paper: #f5f0e4;
  --surface: #fcf9f1;
  --surface-soft: #f0ebdf;
  --sidebar: #efeade;
  --ink: #262321;
  --body-text: #4a4742;
  --muted: #6a645b;
  --line: #e0d9cd;
  --line-strong: #c8bdad;

  /* Teal is the main action colour. The darker variants keep small labels and
     ivory button text readable; the reference teal stays in decorative accents. */
  --teal: #238b9b;
  --teal-strong: #176f7b;
  --teal-hover: #125a66;
  --teal-soft: #e3edeb;
  --teal-line: #a9c9cb;
  --teal-wash: #238b9b09;
  --focus-wash: #238b9b14;
  --on-accent: #fffaf1;

  /* Blue echoes the dashed curve; ochre echoes the filled curve. The coin faces
     use these two families and H/T letters, so colour is never the only clue. */
  --blue: #3c6580;
  --blue-strong: #355b74;
  --blue-soft: #e7edf0;
  --blue-mid: #c9d8e1;
  --blue-line: #9eb5c5;
  --blue-shadow: #8ea8ba;
  --ochre: #b57631;
  --ochre-strong: #794918;
  --ochre-soft: #f3e7d5;
  --ochre-light: #f7e8d3;
  --ochre-mid: #e8c69d;
  --ochre-line: #d4ae7e;
  --ochre-shadow: #c3a079;
  --ochre-wash: #b5763108;

  /* Dusty rose gives student thoughts and solution-related feedback a separate
     visual identity, inspired by the reference's translucent energy bar. */
  --rose: #bd5068;
  --rose-strong: #944457;
  --rose-soft: #f3e3e1;
  --rose-line: #e3bdc6;

  /* Translucent charcoal replaces green-tinted shadows and modal backdrops. */
  --panel-shadow: #26232106;
  --soft-shadow: #26232114;
  --dialog-shadow: #26232129;
  --backdrop: #26232152;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 95% 5%, var(--teal-wash), transparent 48%), radial-gradient(ellipse at 5% 95%, var(--ochre-wash), transparent 48%), var(--paper); background-attachment: fixed; color: var(--ink); font: 14px/1.55 var(--sans); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: wait; opacity: .55; }
button, a, textarea, select { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--teal-strong); }
[hidden] { display: none !important; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link { position: absolute; left: 20px; top: -80px; z-index: 10; background: var(--surface); padding: 12px; }
.skip-link:focus { top: 12px; }

/* A quiet, full-height sidebar anchors the app without competing with the work. */
.sidebar { width: 220px; position: fixed; inset: 0 auto 0 0; background: var(--sidebar); border-right: 1px solid var(--line); padding: 34px 20px 20px; display: flex; flex-direction: column; }
/* branding.css owns the shared home link and discovery mark. */
.sidebar-label { color: var(--muted); font-size: 9px; letter-spacing: 1.7px; font-weight: 650; margin: 55px 13px 17px; }
.nav-item { width: 100%; display: flex; gap: 12px; align-items: center; padding: 13px; border: 0; border-radius: 8px; background: transparent; color: var(--body-text); margin-bottom: 7px; font-size: 13px; text-align: left; }
.nav-item:hover { background: var(--line); }
.nav-item.active { background: var(--teal-soft); color: var(--teal-hover); font-weight: 600; }
.active-dot { margin-left: auto; width: 5px; height: 5px; background: var(--teal); border-radius: 50%; }
.sidebar-bottom { margin-top: auto; }
.sidebar-quote { font: 22px/1.35 var(--serif); margin: 17px 12px 29px; color: var(--ink); }
.sidebar-quote em { color: var(--ochre-strong); }
.quiet { font-size: 12px; }
.preview-link { display: flex; width: 100%; align-items: center; gap: 7px; padding: 18px 12px 0; border: 0; border-top: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 10px; }
.preview-link .icon { width: 15px; margin-left: auto; }
.preview-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }

/* These circles are CSS decoration, not an image download or a learning score. */
.circle-art { width: 100px; height: 95px; margin: 20px auto 0; position: relative; }
.circle-art i { position: absolute; width: 58px; height: 58px; border: 1px solid var(--blue); border-radius: 50%; top: 8px; left: 5px; }
.circle-art i:nth-child(2) { left: 38px; top: 8px; border-color: var(--ochre); }
.circle-art i:nth-child(3) { left: 21px; top: 35px; border-color: var(--rose); }
.circle-art span { position: absolute; left: 43px; top: 36px; font-size: 18px; color: var(--teal-strong); }

/* The header gives the workspace breathing room; no fabricated streaks or points. */
.main-content { margin-left: 220px; padding: 25px 38px 20px; max-width: 1730px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 35px; }
.breadcrumb { color: var(--muted); font-size: 11px; }
.breadcrumb span { margin: 0 12px; color: var(--line); }
.mode-indicator { border: 1px solid var(--line); border-radius: 30px; padding: 6px 12px; background: var(--surface); color: var(--teal-strong); font-size: 10px; display: flex; gap: 7px; align-items: center; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.live-dot.offline { background: var(--ochre); }
.welcome-heading { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 32px; gap: 15px; }
.eyebrow { color: var(--teal-strong); font-size: 9px; font-weight: 650; letter-spacing: 1.8px; }
.welcome-heading h1 { font: 40px/1.2 var(--serif); letter-spacing: -1.5px; margin: 8px 0 9px; font-weight: 400; }
.welcome-heading h1 span { color: var(--teal); }
.welcome-heading p { font-size: 12px; color: var(--muted); margin: 0; }
.session-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.session-label .icon { width: 16px; }
.workspace-grid { display: grid; grid-template-columns: minmax(340px, .92fr) minmax(400px, 1.08fr); gap: 24px; align-items: stretch; }
.problem-panel, .coach-panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 12px var(--panel-shadow); overflow: hidden; }

/* The experiment uses real buttons. A selected coin is outlined; after the second
   selection both coins turn over. The ochre and blue faces also differ by letters. */
.problem-panel { padding: 28px 28px 0; }
.problem-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; }
.problem-number { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--teal-soft); border-radius: 7px; color: var(--teal-strong); font-size: 11px; }
.topic-pill { margin-left: auto; font-size: 9px; color: var(--ochre-strong); background: var(--ochre-soft); border-radius: 4px; padding: 3px 7px; }
.problem-panel h2 { font: 31px/1.25 var(--serif); letter-spacing: -.8px; margin: 20px 0 15px; font-weight: 400; }
.problem-copy { font-size: 13px; line-height: 1.8; color: var(--body-text); margin: 0; }
.problem-copy strong { color: var(--ink); font-weight: 550; }
.problem-question { font-size: 14px; line-height: 1.7; font-weight: 600; margin: 15px 0 22px; }
.problem-question span { color: var(--muted); font-size: 12px; font-weight: 400; }
.experiment { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; padding: 15px 19px 13px; }
.experiment-header { display: flex; align-items: center; justify-content: space-between; color: var(--teal-strong); font-size: 8px; font-weight: 650; letter-spacing: 1.4px; }
.experiment-header button { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); background: transparent; padding: 0; border: 0; }
.experiment-header .icon { width: 12px; height: 12px; }
.coin-board { display: grid; grid-template-columns: repeat(3, 58px); gap: 15px 21px; width: max-content; margin: 20px auto 18px; }
.coin { display: grid; place-items: center; width: 58px; height: 58px; padding: 5px; border-radius: 50%; color: var(--ochre-strong); border: 1px solid var(--ochre-line); background: linear-gradient(145deg, var(--ochre-light), var(--ochre-mid)); box-shadow: 0 3px 0 var(--ochre-shadow), 0 5px 6px var(--soft-shadow); transition: transform .16s ease, background .16s ease, outline .16s ease; }
.coin span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 1px solid var(--ochre-line); font: 23px/1 var(--serif); }
.coin:hover { transform: translateY(-2px); }
.coin.selected { outline: 2px solid var(--blue); outline-offset: 4px; transform: translateY(-3px); }
.coin.is-tail { background: linear-gradient(145deg, var(--blue-soft), var(--blue-mid)); color: var(--blue-strong); border-color: var(--blue-line); box-shadow: 0 3px 0 var(--blue-shadow), 0 5px 6px var(--soft-shadow); }
.coin.is-tail span { border-color: var(--blue-line); }
#board-instruction { text-align: center; color: var(--muted); font-size: 10px; margin: 0 0 13px; min-height: 16px; }
.board-summary { display: flex; align-items: center; justify-content: center; gap: 15px; border-top: 1px solid var(--line); padding-top: 11px; font-size: 9px; color: var(--muted); }
.board-summary span { display: inline-flex; gap: 5px; align-items: center; }
.board-summary b { font-weight: 500; }
#move-count { border-left: 1px solid var(--line); padding-left: 14px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.heads { background: var(--ochre); }
.legend-dot.tails { background: var(--blue); }
.thinking-note { display: flex; align-items: center; gap: 12px; padding: 18px 0 21px; color: var(--muted); }
.thinking-note .icon { width: 20px; height: 20px; }
.thinking-note p { font: italic 12px/1.65 var(--serif); margin: 0; }
.thinking-note strong { font-weight: 400; color: var(--muted); }
.problem-footer { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; letter-spacing: .2px; }

/* Only the conversation scrolls on desktop. The input stays at the bottom so a
   long dialogue never hides the place where the learner writes the next thought. */
.coach-panel { display: flex; flex-direction: column; height: 663px; }
.coach-header { display: flex; justify-content: space-between; align-items: center; padding: 21px 24px; border-bottom: 1px solid var(--line); }
.coach-identity { display: flex; align-items: center; gap: 11px; }
.coach-mark { width: 35px; height: 35px; border-radius: 11px; background: var(--teal-soft); color: var(--blue); display: grid; place-items: center; font-size: 25px; }
.coach-header h2 { font-size: 13px; margin: 0 0 3px; font-weight: 600; }
.coach-header p { font-size: 10px; margin: 0; color: var(--muted); }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-soft); }
.icon-button .icon { width: 15px; height: 15px; }
.conversation { flex: 1; min-height: 0; overflow-y: auto; padding: 27px 23px 14px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.message { display: flex; gap: 9px; margin-bottom: 25px; }
.message-avatar { width: 23px; height: 23px; color: var(--blue); font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.message-content { min-width: 0; }
.message-byline { font-size: 9px; font-weight: 550; color: var(--muted); margin: 0 0 8px; }
.message p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; margin: 0; color: var(--body-text); }
.message--user { justify-content: flex-end; margin-left: 30px; }
.message--user .message-content { background: var(--rose-soft); border: 1px solid var(--rose-line); border-radius: 11px 11px 2px 11px; padding: 12px 16px; }
.message--user .message-byline { color: var(--rose-strong); }
.message--user p { color: var(--ink); }
.message-tag { margin-left: 6px; background: var(--rose-soft); color: var(--rose-strong); padding: 2px 5px; border-radius: 3px; font-size: 8px; }
.starting-points { margin: 29px 0 0 32px; max-width: 330px; }
.starting-points > span { display: block; font-size: 8px; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 9px; }
.thought-chip { display: flex; width: 100%; justify-content: space-between; gap: 10px; padding: 11px 13px; margin-bottom: 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--muted); font-size: 10px; }
.thought-chip:hover { background: var(--teal-soft); border-color: var(--teal-line); }
.thought-chip span { color: var(--blue); }
.composer-area { padding: 0 21px 18px; }
.composer-box { position: relative; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 13px 55px 10px 13px; }
.composer-box:focus-within { border-color: var(--teal-line); box-shadow: 0 0 0 3px var(--focus-wash); }
.composer-box textarea { width: 100%; padding: 0; resize: none; min-height: 52px; max-height: 140px; background: transparent; border: 0; font-size: 12px; color: var(--ink); line-height: 1.7; outline: none; }
.composer-box textarea::placeholder { color: var(--muted); }
.send-button { position: absolute; right: 11px; bottom: 11px; width: 33px; height: 33px; border: 0; border-radius: 8px; color: var(--on-accent); background: var(--teal-strong); display: grid; place-items: center; }
.send-button:hover { background: var(--teal-hover); }
.send-button .icon { width: 17px; height: 17px; }
.composer-hint { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; margin: 7px 1px 15px; }
.coach-actions { display: flex; align-items: center; gap: 13px; }
.nudge-button { display: flex; align-items: center; gap: 5px; background: var(--ochre-soft); border: 1px solid var(--ochre-line); border-radius: 6px; font-size: 10px; padding: 7px 10px; color: var(--ochre-strong); white-space: nowrap; }
.nudge-button .icon { width: 13px; height: 13px; }
.text-button, .solution-button { border: 0; padding: 4px 0; background: transparent; font-size: 10px; color: var(--muted); }
.text-button:hover, .solution-button:hover { color: var(--teal-strong); text-decoration: underline; }
.solution-button { margin-left: auto; font-size: 9px; color: var(--muted); }
/* A quiet, readable pending message keeps long waits visible without a fake
   progress percentage. Its fixed minimum height prevents the composer jumping. */
.thinking-indicator { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 66px; font-size: 12px; color: var(--teal-strong); background: var(--teal-soft); }
.thinking-indicator[hidden] { display: none; }
.thinking-copy { display: grid; gap: 4px; min-width: 0; }
.thinking-copy > [role="status"] { font-weight: 600; }
.thinking-copy > [data-coach-wait-detail] { color: var(--muted); font-size: 11px; line-height: 1.5; }
.thinking-dots { letter-spacing: 2px; font-size: 8px; animation: breathe 1.5s ease infinite; }
@keyframes breathe { 50% { opacity: .35; } }
/* Respect users who request less motion; text updates do not require animation. */
@media (prefers-reduced-motion: reduce) { .thinking-dots { animation: none; } }
.inline-error { background: var(--rose-soft); color: var(--rose-strong); border: 1px solid var(--rose-line); padding: 12px; font-size: 12px; border-radius: 7px; }
.coach-panel > .inline-error { margin: 4px 20px 12px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 15px; margin: 17px 2px 0; font-size: 9px; color: var(--muted); }
.workspace-footer > span:first-child { display: flex; align-items: center; gap: 6px; }
.workspace-footer .icon { width: 13px; height: 13px; }

/* On shorter desktop windows, compact the surrounding furniture so the learner
   can see the coins AND the message box without first scrolling the whole page. */
@media (min-width: 951px) and (max-height: 850px) {
  .main-content { padding-top: 17px; }
  .welcome-heading { margin: 18px 0 22px; }
  .welcome-heading h1 { font-size: 34px; margin: 5px 0 7px; }
  .problem-panel { padding: 19px 23px 0; }
  .problem-panel h2 { font-size: 27px; margin: 12px 0; }
  .problem-copy { font-size: 12px; line-height: 1.7; }
  .problem-question { font-size: 13px; margin: 10px 0 14px; }
  .problem-question span { font-size: 11px; }
  .experiment { padding: 10px 17px; }
  .coin-board { grid-template-columns: repeat(3, 44px); gap: 10px 25px; margin: 14px auto 12px; }
  .coin { width: 44px; height: 44px; padding: 4px; }
  .coin span { font-size: 20px; }
  #board-instruction { margin-bottom: 9px; }
  .board-summary { padding-top: 8px; }
  /* This optional encouragement already appears in the coach. Hide its duplicate
     here so the actual problem and message box fit on a short laptop screen. */
  .thinking-note { display: none; }
  .problem-footer { padding-block: 10px; font-size: 9px; }
  .coach-panel { height: calc(100dvh - 213px); min-height: 500px; }
  .coach-header { padding: 17px 21px; }
  .conversation { padding-top: 22px; }
  .composer-area { padding-bottom: 14px; }
  .composer-hint { margin-bottom: 11px; }
  .workspace-footer { margin-top: 12px; }
}

/* Native dialogs put focus inside the opened panel and support the Escape key. */
dialog { width: min(520px, calc(100vw - 36px)); padding: 30px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); box-shadow: 0 25px 100px var(--dialog-shadow); background: var(--surface); max-height: 90vh; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; }
.dialog-heading .dialog-close { font-size: 24px; line-height: 1; color: var(--muted); border: 0; background: transparent; padding: 3px 6px; }
dialog h2 { font: 29px/1.25 var(--serif); letter-spacing: -.7px; margin: 18px 0 14px; }
dialog p { font-size: 13px; line-height: 1.8; color: var(--body-text); }
dialog label { display: block; font-size: 12px; font-weight: 600; margin: 18px 0 8px; }
dialog textarea, dialog select { width: 100%; padding: 12px; background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
dialog textarea { resize: vertical; line-height: 1.8; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.primary-button { display: inline-block; padding: 10px 16px; border: 0; border-radius: 7px; color: var(--on-accent); background: var(--teal-strong); font-size: 12px; }
.primary-button:hover { background: var(--teal-hover); }
.small-print { font-size: 11px !important; color: var(--muted) !important; }
.form-status { min-height: 20px; font-size: 11px; margin-bottom: 0; }
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 23px 0; }
.progress-grid div { background: var(--teal-soft); padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.progress-grid div:nth-child(2) { background: var(--rose-soft); border-color: var(--rose-line); }
.progress-grid strong { display: block; font: 36px var(--serif); }
.progress-grid span { font-size: 11px; color: var(--muted); }
.progress-detail { padding: 18px 0; border-block: 1px solid var(--line); }
.progress-detail > span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--teal-strong); margin-bottom: 9px; }
.progress-detail strong { font-size: 14px; font-weight: 500; }
.progress-detail p { font-size: 11px; margin-bottom: 0; }
.approach-steps { padding-left: 19px; color: var(--body-text); font-size: 13px; }
.approach-steps li { padding-left: 4px; margin-bottom: 14px; }
.approach-steps strong { color: var(--ink); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 9px; background: var(--teal-hover); color: var(--on-accent); box-shadow: 0 5px 25px var(--soft-shadow); font-size: 12px; z-index: 20; }

/* Reduce the sidebar first, then stack the two working panels on narrower devices.
   This preserves usable text and button sizes rather than shrinking the whole UI. */
@media (min-width: 1500px) { .main-content { padding: 30px 56px; } .welcome-heading { margin-bottom: 38px; } .workspace-grid { gap: 30px; } .problem-panel { padding-inline: 38px; } .coach-panel { height: 688px; } .coin-board { gap: 17px 27px; margin-block: 23px; } }
@media (max-width: 1180px) { .sidebar { width: 190px; padding-inline: 14px; } .main-content { margin-left: 190px; padding-inline: 25px; } .workspace-grid { grid-template-columns: minmax(290px, .9fr) minmax(335px, 1.1fr); gap: 18px; } .problem-panel { padding-inline: 21px; } .welcome-heading h1 { font-size: 34px; } .session-label { display: none; } .coach-actions { gap: 8px; } .composer-area { padding-inline: 16px; } .brand { font-size: 17px; } }
@media (max-width: 950px) { .sidebar { position: static; width: auto; padding: 18px 24px; flex-direction: row; align-items: center; gap: 25px; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar-label, .sidebar-bottom { display: none; } .sidebar nav { display: flex; gap: 8px; margin-left: auto; } .nav-item { width: auto; margin: 0; padding: 10px; font-size: 11px; } .nav-item .icon { width: 16px; } .active-dot { display: none; } .main-content { margin-left: 0; padding: 20px 25px; } .welcome-heading { margin-block: 23px; } }
@media (max-width: 720px) { .sidebar { padding: 15px 19px; gap: 10px; } .brand { font-size: 17px; } .brand small { font-size: 6px; } .nav-item { font-size: 0; gap: 0; padding: 9px; } .nav-item .icon { width: 19px; height: 19px; } .main-content { padding: 18px; } .topbar { gap: 10px; } .breadcrumb { font-size: 9px; } .breadcrumb span { margin-inline: 5px; } .mode-indicator { font-size: 9px; } .welcome-heading h1 { font-size: 33px; line-height: 1.2; max-width: 310px; } .welcome-heading p { font-size: 11px; max-width: 290px; line-height: 1.7; } .eyebrow { font-size: 8px; letter-spacing: 1.4px; } .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } .problem-panel { padding: 24px 23px 0; } .problem-panel h2 { font-size: 31px; } .coin-board { margin-block: 19px; gap: 13px 27px; } .coach-panel { height: 630px; } .workspace-footer { flex-direction: column; gap: 7px; align-items: center; margin-block: 20px; } .coach-actions { gap: 11px; } dialog { padding: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* A completed proof earns a clear next step inside the conversation. These cards
   reuse the approved paper/teal palette and remain readable on a narrow screen. */
.completion-card { margin: 12px 0 6px; padding: 18px; border: 1px solid var(--teal-line); background: var(--teal-soft); border-radius: 12px; }
.completion-card h3 { font: 25px/1.2 var(--serif); color: var(--ink); margin: 9px 0; }
.completion-card p { font-size: 12px; line-height: 1.7; color: var(--body-text); margin: 7px 0; }
.completion-card .completion-support { font-size: 10px; color: var(--teal-strong); }
.completion-card .next-description { border-top: 1px solid var(--teal-line); padding-top: 10px; margin-top: 12px; }
.completion-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; margin-top: 12px; }
.completion-actions .primary-button { font-size: 11px; }
.completion-actions .text-button { color: var(--teal-strong); font-size: 11px; }
/* Keep the complete next-step card within the shorter laptop conversation area. */
@media (min-width: 951px) and (max-height: 850px) {
  .completion-card { padding: 13px 16px; }
  .completion-card h3 { font-size: 23px; margin: 6px 0; }
  .completion-card .next-description { margin-top: 8px; padding-top: 7px; }
  .completion-actions { margin-top: 9px; }
}
/* Archived experiments are intentionally read-only, rather than busy loading. */
body[data-read-only="true"] .experiment button:disabled { cursor: default; opacity: .75; }
.history-banner { background: var(--ochre-soft); border: 1px solid var(--ochre-line); padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 12px; }
.history-banner a, .archive-note a { color: var(--teal-strong); text-decoration: underline; }
.archive-note { padding: 10px 24px; font-size: 12px; color: var(--muted); }
.archive-note p { white-space: pre-wrap; overflow-wrap: anywhere; }
.journey-heading { font: 21px var(--serif); margin-top: 25px; }
.journey-list { list-style: none; padding: 0; }
.journey-list li { border-top: 1px solid var(--line); }
.journey-list a { display: block; padding: 13px 0; }
.journey-list a:hover strong { color: var(--teal-strong); text-decoration: underline; }
.journey-list strong { display: block; font-size: 13px; font-weight: 600; }
.journey-list span, .journey-list small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.journey-list small { color: var(--teal-strong); }
.evidence-details { margin-top: 18px; font-size: 12px; }
.evidence-details summary { cursor: pointer; color: var(--teal-strong); }
.evidence-details blockquote { margin: 12px 0; padding-left: 12px; border-left: 2px solid var(--ochre); color: var(--body-text); overflow-wrap: anywhere; }

/* The number machine is a small piece of scratch paper, not a correctness meter.
   Both operations remain labelled in words and work by keyboard as buttons. */
.machine-experiment { text-align: center; margin: 24px 0; }
#machine-value { display: block; font: 65px/1.2 var(--serif); color: var(--blue); padding: 36px 0; overflow-wrap: anywhere; }
.machine-buttons { display: flex; justify-content: center; gap: 12px; }
.machine-buttons button { font-size: 13px; padding: 11px 17px; }
#machine-path { font-size: 12px; color: var(--body-text); line-height: 1.9; overflow-wrap: anywhere; margin-top: 24px; }
.experiment-caption { font-size: 11px; line-height: 1.7; color: var(--muted); margin: 16px 0 8px; }

/* Voice stays a small, optional part of the composer. Teal marks recording;
   the text status also tells the learner what is happening without colour. */
.voice-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.voice-button { display: inline-flex; gap: 6px; align-items: center; background: var(--teal-soft); color: var(--teal-strong); border: 1px solid var(--teal-line); border-radius: 6px; padding: 7px 10px; font-size: 11px; }
.voice-button .icon { width: 14px; height: 14px; }
.voice-toggle { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; cursor: pointer; }
.voice-toggle input { accent-color: var(--teal-strong); margin: 0; }
.voice-status { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 8px 0 0; }
.recording-display { display: flex; align-items: center; gap: 10px; padding: 16px; background: var(--teal-soft); color: var(--teal-strong); border: 1px solid var(--teal-line); border-radius: 10px; font-size: 12px; }
.recording-dot { width: 8px; height: 8px; background: var(--teal); border-radius: 50%; flex-shrink: 0; }
#voice-dialog[data-stage="recording"] .recording-dot { animation: breathe 1.5s ease infinite; }
#recording-time { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.voice-dialog-actions { flex-wrap: wrap; }
/* Quiet timestamps distinguish the conversation from the main teaching text.
   Feedback stays available without competing with the next mathematical step. */
.message-footnote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 15px; margin-top: 8px; color: var(--muted); font-size: 9px; }
.message-footnote .text-button { font-size: 9px; }
/* Extra space keeps the new toolbar from taking away the entire conversation. */
@media (min-width: 951px) and (max-height: 850px) { .coach-panel { min-height: 550px; } }

/* The problem catalogue shares the warm paper palette with the practice room.
   Plain HTML forms provide filters and selection; cards expose statements only. */
.draft-banner { padding: 12px 16px; border: 1px solid var(--ochre-line); background: var(--ochre-soft); border-radius: 10px; color: var(--body-text); font-size: 12px; line-height: 1.65; }
.draft-banner a, .catalogue-record a, .catalogue-empty a { text-decoration: underline; text-underline-offset: 3px; }
.history-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.general-experiment p { color: var(--body-text); }
.catalogue-topbar { max-width: 1420px; margin: auto; padding: 26px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); gap: 20px; }
.catalogue-topbar nav { display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); }
.catalogue-topbar [aria-current] { color: var(--teal-strong); font-weight: 700; }
.catalogue-main { max-width: 1420px; margin: auto; padding: 42px 40px 80px; }
.catalogue-heading { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 24px; }
.catalogue-heading h1 { font: 42px/1.16 var(--serif); margin: 12px 0; letter-spacing: -1.1px; }
.catalogue-heading h1 span { color: var(--teal); }
.catalogue-heading p { color: var(--muted); }
.catalogue-total { display: grid; text-align: center; min-width: 140px; padding: 20px; border: 1px solid var(--teal-line); border-radius: 18px; background: var(--teal-soft); color: var(--teal-strong); }
.catalogue-total strong { font: 42px/1 var(--serif); }
.catalogue-total span { margin-top: 9px; font-size: 12px; }
.catalogue-record { color: var(--muted); font-size: 13px; }
/* Labels remain visible above every input, including narrow-screen layouts. */
.catalogue-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 22px; margin: 28px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.catalogue-filters label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; flex: 1 1 135px; min-width: 0; }
.catalogue-filters .catalogue-search { flex: 2 1 240px; }
.catalogue-filters input, .catalogue-filters select { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: var(--paper); }
.catalogue-results-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 30px 0 18px; }
.catalogue-results-heading h2 { font: 25px var(--serif); margin: 0; white-space: nowrap; }
.catalogue-results-heading p { max-width: 620px; font-size: 12px; color: var(--muted); }
.catalogue-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.catalogue-card { display: flex; flex-direction: column; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 5px 20px var(--panel-shadow); min-width: 0; }
.catalogue-card-meta { display: flex; justify-content: space-between; align-items: center; color: var(--teal-strong); font-size: 12px; }
.catalogue-card h3 { font: 25px/1.25 var(--serif); margin: 16px 0 8px; }
.catalogue-subtitle { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.catalogue-statement { color: var(--body-text); white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 18px; }
/* Expand background knowledge only when wanted, keeping the statement prominent. */
.catalogue-background { color: var(--body-text); font-size: 13px; margin: 0 0 18px; overflow-wrap: anywhere; }
.catalogue-background summary { color: var(--teal-strong); cursor: pointer; }
.catalogue-background ul { margin: 10px 0 0; padding-left: 20px; }
.catalogue-background li + li { margin-top: 5px; }
.catalogue-progress { margin-top: auto; padding-top: 15px; color: var(--blue-strong); font-size: 12px; border-top: 1px solid var(--line); }
.catalogue-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.catalogue-empty { grid-column: 1 / -1; padding: 40px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 16px; }
@media (max-width: 760px) {
  .catalogue-topbar { padding: 20px; align-items: flex-start; flex-direction: column; }
  .catalogue-main { padding: 28px 18px 60px; }
  .catalogue-heading { align-items: flex-start; }
  .catalogue-heading h1 { font-size: 32px; }
  .catalogue-total { min-width: 94px; padding: 16px 10px; }
  .catalogue-total strong { font-size: 30px; }
  .catalogue-grid { grid-template-columns: minmax(0, 1fr); }
  .catalogue-results-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .catalogue-card { padding: 22px; }
}
/* Subject links make both circles discoverable. The active track uses our teal;
   counts describe available content, never a student's ability or progress. */
.catalogue-tracks { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 20px; }
.catalogue-tracks a { display: inline-flex; align-items: center; gap: 14px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; background: var(--paper); }
.catalogue-tracks a[aria-current="page"] { border-color: var(--teal); color: var(--teal-strong); background: var(--teal-soft); }
.catalogue-tracks a span { font-size: 12px; opacity: .8; }
/* The Informatics introduction explains the activity without naming the hidden
   solution techniques. Generous spacing keeps this readable on narrow screens. */
.track-introduction { max-width: 850px; border-left: 3px solid var(--ochre); padding: 5px 0 5px 24px; margin: 25px 0; }
.track-introduction h2 { font-family: Georgia, serif; font-size: clamp(25px, 3vw, 34px); margin: 10px 0; }
.track-introduction p { line-height: 1.7; }

/* Physics retains the shared palette. A compact row suggests ways to think;
   these are invitations, not controls or a mandatory sequence for the coach. */
.physics-introduction { border-color: var(--teal); }
.physics-route { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 24px 0; }
.physics-route span { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; }
.physics-route b { color: var(--ochre); font: 12px sans-serif; }
.physics-stage { color: var(--teal-strong); font-size: 12px; margin: -5px 0 14px; }

/* Preserve authored paragraph breaks and wrap long equations without making
   a phone page scroll sideways. SVG images scale to their available column. */
.problem-copy { white-space: pre-line; overflow-wrap: anywhere; }
.physics-diagram { margin: 24px 0; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.physics-diagram img { display: block; width: 100%; height: auto; }
.physics-diagram figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.physics-source { margin-top: 18px; color: var(--body-text); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.physics-source summary { color: var(--teal-strong); cursor: pointer; }
.physics-source ul { padding-left: 20px; }
.breadcrumb a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Algorithm evidence is four readable observations, not a percentage grade.
   Each description stays beside its dimension unless a narrow dialog needs it
   on the next line. Muted text separates evidence status from the main label. */
.reasoning-dimensions { margin: 20px 0; border-top: 1px solid var(--line); }
.reasoning-dimensions > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.reasoning-dimensions dt { font-weight: 600; color: var(--ink); }
.reasoning-dimensions dd { margin: 0; color: var(--muted); font-size: 13px; }
/* The enlarged navigation wraps on small screens instead of pushing the page
   sideways. Text labels stay visible so the two notebook icons are distinguishable. */
@media (max-width: 720px) {
  .sidebar { flex-wrap: wrap; }
  .sidebar nav { width: 100%; margin-left: 0; flex-wrap: wrap; gap: 4px; }
  .sidebar .nav-item { font-size: 10px; gap: 6px; padding: 8px; }
  .sidebar .nav-item .icon { width: 16px; height: 16px; }
}
