/* Lemma: a learning app you can touch.
   A cool off-white canvas with bright white cards; each idea is a tactile model on its own card,
   one step at a time. Ink is the action, ultramarine marks whatever is live, lemon marks what is
   being talked about. Archivo for everything; no uppercase labels, no hairline frames. */

/* ---------- type (self-hosted, SIL OFL; see fonts/README.md) */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/archivo-latin-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 400 800; font-display: swap; src: url("fonts/archivo-latin-italic.woff2") format("woff2"); }
@font-face { font-family: "Spline Sans Mono"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/spline-sans-mono-latin-normal.woff2") format("woff2"); }

:root {
  /* the canvas and the cards */
  --paper: #f4f5f7;      /* the app canvas */
  --floor: var(--paper);
  --surface: #ffffff;    /* cards, fields, bars */
  --ink: #111318;
  --body: #343844;
  --mute: #626877;
  --faint: #9ca1ad;
  --rule: #e6e8ed;
  --rule-strong: #cfd3dc;
  --plate: #f4f5f7;      /* quiet fills inside a card */
  --plate-2: #e9ebf0;
  --stage: var(--surface);
  --stage-2: var(--plate-2);
  /* ink is the action; ultramarine is the live mark (the variable names predate this world);
     lemon is attention */
  --green: #3a4ff0;
  --green-press: #2a3cd0;
  --green-soft: #e9ecff;
  --ochre: #b38a00;
  --ochre-ink: #4d3b00;
  --ochre-soft: #fff6cc;
  --lemon: #ffe46b;
  --blue: #2f45d8;
  /* feedback, always paired with an icon and words */
  --good: #137a4b;
  --good-bg: #e3f6ec;
  --bad: #c2362b;
  --bad-bg: #fde8e5;
  /* data inks: bright on a white card, each 3:1 or more; series also differ by dash, shape
     and label, never by colour alone */
  --model-0: #2563d9; --model-1: #b56f00; --model-2: #12865a; --model-3: #7a4fd6;
  --model-4: #cc3b82; --model-5: #0b86a6; --model-6: #727100; --model-7: #687087;
  /* shape, depth and type */
  --r: 12px;
  --r-lg: 22px;
  --lift: 0 1px 2px rgba(17, 19, 24, .05), 0 6px 20px rgba(17, 19, 24, .06);
  --lift-hi: 0 2px 4px rgba(17, 19, 24, .05), 0 18px 48px rgba(17, 19, 24, .10);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--sans);
  --words: var(--sans);   /* the paper's own words */
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ui: 200ms cubic-bezier(.16, 1, .3, 1);
  --bar-h: 84px;
  color-scheme: light;
}

/* ---------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) var(--paper); }
body { margin: 0; background: var(--paper); color: var(--body); font: 400 17px/1.55 var(--sans); font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--green-soft); color: var(--ink); }
input, textarea { caret-color: var(--green); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 3px solid var(--paper); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
h1, h2, h3, h4 { margin: 0 0 .45em; color: var(--ink); font-family: var(--sans); font-weight: 700; letter-spacing: -.015em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(32px, 3.6vw, 46px); }
h2 { font-size: clamp(24px, 2.4vw, 30px); }
h3 { font-size: 22px; letter-spacing: -.01em; }
h4 { font-size: 17px; letter-spacing: 0; }
p { margin: 0 0 .9em; }
a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--blue) 45%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
strong { color: var(--ink); font-weight: 700; }
em, cite { font-style: italic; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 2px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, .verb-head[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--ink); color: #fff; padding: 10px 14px; font-weight: 600; border-radius: var(--r); }
.skip:focus { left: 8px; }
.muted { color: var(--mute); }
.small { font-size: 15px; }
.mono { font-family: var(--mono); font-size: 14px; }
.lead { font-size: 19px; line-height: 1.5; color: var(--body); max-width: 60ch; }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.words { font-family: var(--words); font-style: italic; }

/* ---------- site chrome: a thin top bar and a quiet foot */
.site-head { display: flex; align-items: center; gap: 24px; max-width: 1240px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left)); border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 21px/1 var(--sans); letter-spacing: -.02em; }
.wordmark .sq, .lt-mark .sq { width: 16px; height: 16px; border-radius: 50%; background: var(--green); box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 6px var(--paper); flex-shrink: 0; font-size: 0; color: transparent; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a { font: 600 15px/1 var(--sans); text-decoration: none; color: var(--body); padding: 10px 12px; border-radius: var(--r); }
.site-nav a:hover { background: var(--plate); color: var(--ink); }
.site-nav .account-link:not([hidden]) { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; }
.avatar { width: var(--size); height: var(--size); flex: none; object-fit: cover; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-grid; place-items: center; font: 700 calc(var(--size) * .48)/1 var(--sans); }
main { max-width: 1240px; margin: 0 auto; padding: 40px max(24px, env(safe-area-inset-right)) max(72px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); outline: none; }
.site-foot { max-width: 1240px; margin: 0 auto; padding: 18px 24px 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--mute); }
.site-foot a { color: var(--mute); }

/* ---------- buttons: quiet, sentence case, one green action */
button, .btn { font: 600 16px/1 var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color var(--ui), border-color var(--ui), color var(--ui), box-shadow var(--ui); }
button:hover:not(:disabled), .btn:hover { border-color: var(--ink); }
button:active:not(:disabled), .btn:active { background: var(--plate); }
button:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; border-color: var(--rule); color: var(--faint); background: var(--paper); }
.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 1px 2px rgba(29, 35, 33, .14); }
.primary:hover:not(:disabled) { background: var(--green-press); border-color: var(--green-press); }
.primary:active:not(:disabled) { background: var(--green-press); box-shadow: none; }
.primary:disabled { background: var(--plate); border-color: var(--plate); color: var(--faint); box-shadow: none; }
.ghost { border-color: transparent; background: transparent; }
.ghost:hover:not(:disabled) { background: var(--plate); border-color: transparent; }
button.small, .btn.small { min-height: 36px; padding: 0 12px; font-size: 15px; }
.danger { color: var(--bad); }
.danger:hover:not(:disabled) { border-color: var(--bad); }
.icon-btn { min-height: 40px; width: 40px; padding: 0; border-color: transparent; background: transparent; color: var(--body); }
.icon-btn:hover:not(:disabled) { background: var(--plate); border-color: transparent; }
.icon-btn:disabled { background: transparent; border-color: transparent; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.actions .ghost:only-child { padding-left: 0; padding-right: 0; }
.actions .ghost:only-child:hover:not(:disabled) { background: transparent; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.actions .ghost:not(:first-child) { padding-left: 2px; padding-right: 2px; margin-left: 10px; }
.actions .ghost:not(:first-child):hover:not(:disabled) { background: transparent; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (max-width: 520px) { .actions .ghost:not(:first-child) { margin-left: 0; } }
.actions + .muted, .actions + .small { margin-top: 12px; }

/* ---------- inputs */
label { display: block; margin: 20px 0 6px; font: 600 15px/1.3 var(--sans); color: var(--ink); }
input[type=text], input[type=url], input[type=search], input[type=password], input[type=number], select, textarea { width: 100%; min-height: 46px; padding: 10px 13px; font: 400 17px/1.4 var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r); transition: border-color var(--ui), box-shadow var(--ui); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .85; }
input[type=file] { font: 400 16px var(--sans); color: var(--body); }
input[type=file]::file-selector-button { font: 600 15px var(--sans); padding: 10px 16px; margin-right: 14px; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--paper); color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--ink); }
textarea { resize: vertical; }
textarea.mono { font: 400 14px/1.5 var(--mono); }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }
.source-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.source-choice input { width: 20px; height: 20px; flex-shrink: 0; }
.result:has(.source-choice input:checked) { border-color: var(--green); }
.check-row { display: flex; align-items: center; gap: 10px; font: 400 16px var(--sans); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--plate); border-radius: calc(var(--r) + 3px); }
.seg { min-height: 38px; border: 0; border-radius: var(--r); background: transparent; padding: 0 16px; font-size: 15px; color: var(--body); }
.seg:hover:not(:disabled) { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.seg.active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(29, 35, 33, .16); }

/* ---------- panels, pins and notes: no frames, only grounds and hairlines */
.panel { padding: 0; margin-bottom: 40px; }
.panel.yellow { padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.plate { width: 30px; height: 30px; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-strong); font: 700 14px/1 var(--sans); font-variant-numeric: tabular-nums; }
.plate.big { width: 34px; height: 34px; font-size: 16px; }
.plate.cur { background: var(--green); color: #fff; box-shadow: none; }
.plate.done { background: var(--ink); color: #fff; box-shadow: none; }
.plate.pending { color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--rule); }
.plate.small { width: 24px; height: 24px; font-size: 12px; flex-shrink: 0; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; font: 600 13px/1 var(--sans); border-radius: 9999px; color: var(--body); background: var(--plate); white-space: nowrap; }
.tag.yellow { background: var(--ochre-soft); color: var(--ochre-ink); }
.note { padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink); }
.note p:last-child { margin: 0; }
.note.warn { padding: 14px 18px; border: 0; border-radius: var(--r-lg); background: var(--bad-bg); }
.error { background: var(--bad-bg); color: var(--ink); padding: 14px 18px; margin: 14px 0; border-radius: var(--r-lg); }
.error > p:first-child { margin: 0; color: var(--bad); font-weight: 600; }
.error details { margin-top: 8px; color: var(--body); }
.error.floating { position: fixed; right: 16px; bottom: calc(var(--bar-h) + 16px); max-width: 440px; z-index: 30; background: var(--paper); box-shadow: 0 10px 30px rgba(29, 35, 33, .16), 0 0 0 1px var(--rule); }
.error.floating button { margin-top: 10px; }
.ok { color: var(--good); font-weight: 600; }

/* ---------- home: the doorway plate */
.home-exhibit { --viz-max-h: max(240px, calc(100svh - 500px)); display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "intro stage" "verbs stage"; column-gap: clamp(28px, 4vw, 56px); min-height: min(calc(100svh - 160px), 860px); margin: 0 0 80px; }
.he-intro { grid-area: intro; padding: 12px 0 4px; }
.he-intro h1 { font-size: clamp(36px, 3.6vw, 52px); line-height: 1.05; letter-spacing: -.025em; margin-bottom: 16px; }
.he-intro .lead { font-size: 18px; line-height: 1.5; color: var(--body); margin-bottom: 26px; }
.he-verbs { grid-area: verbs; padding: 0 0 12px; }
.he-verbs .verb { transition: opacity var(--ui); }
.he-verbs .verb-mark { font-size: 11.5px; }
.he-verbs .verb.active .verb-mark { background: var(--green); color: #fff; box-shadow: none; }
.he-verbs .verb.active .verb-mark::after { content: none; }
.he-live { font-variant-numeric: tabular-nums; color: var(--ink); }
.he-live b { display: block; font-weight: 700; }
.he-skip { min-height: 34px; padding: 0 12px; font-size: 15px; }
.he-quote { margin: 4px 0 16px; }
.he-quote blockquote { margin: 0 0 6px; font: italic 400 19px/1.45 var(--words); color: var(--ink); }
.he-quote figcaption { font: 400 14px var(--sans); color: var(--mute); }
.he-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; }
.he-cta .small { color: var(--mute); }
.he-start { margin: 0 0 18px; }
.he-stage { grid-area: stage; min-width: 0; padding: 22px clamp(18px, 2.6vw, 34px) 22px; background: var(--plate); border-radius: var(--r-lg); display: flex; flex-direction: column; }
.he-stage > .muted { margin: auto; }
.he-from { margin: 0 0 4px; font: italic 400 17px/1.35 var(--words); color: var(--ink); }
.he-viz { position: relative; }
.he-stage .model-note { margin-top: 12px; }
/* From paper to lesson: a still figure by default; .is-live plays it once, on its own clock, when it comes into view. */
.paper-hall { margin: 0 0 80px; }
.hall-pin { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.hall-copy h2 { font-size: clamp(28px, 2.8vw, 38px); margin-bottom: 22px; }
.hall-steps { list-style: none; padding: 0; margin: 0; }
.hs-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); transition: opacity 300ms cubic-bezier(.16, 1, .3, 1); }
.hs-step .plate { margin-top: 2px; transition: background-color 300ms, color 300ms, box-shadow 300ms; }
.hs-step h3 { font-size: 19px; margin: 3px 0 4px; }
.hs-step p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--body); }
.hall-art { --hl: 1; --back: 0; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: clamp(18px, 3vw, 40px); align-items: center; padding: clamp(18px, 3vw, 36px); background: var(--plate); border-radius: var(--r-lg); }
.hp-paper { background: var(--paper); padding: 22px 22px 24px; border-radius: 2px; transform-origin: 50% 60%;
  transform: translateX(calc(var(--back) * -3%)) scale(calc(1 - var(--back) * .06)) rotate(calc(var(--back) * -2deg)); opacity: calc(1 - var(--back) * .55); }
.hp-title { margin: 0 0 4px; font: italic 500 17px/1.3 var(--words); color: var(--ink); text-wrap: balance; }
.hp-by { margin: 0 0 16px; font: 400 13px var(--sans); color: var(--mute); }
.hp-lines { display: grid; gap: 10px; }
.hp-line { position: relative; display: block; font: italic 400 14px/1.45 var(--words); color: var(--body); }
.hp-line.idea::after { content: ""; position: absolute; inset: -2px -4px; border-radius: 3px; background: var(--ochre-soft); box-shadow: inset 0 -2px 0 var(--ochre); transform-origin: left; transform: scaleX(var(--hl)); mix-blend-mode: multiply; z-index: -1; }
.hp-line.idea { isolation: isolate; color: var(--ink); }
.hall-cards { display: grid; gap: 14px; }
.hx-card { --t: 1; padding: 10px 0 12px; border-top: 1px solid var(--rule-strong);
  transform: translate(calc(var(--dx, 0px) * (1 - var(--t))), calc(var(--dy, 0px) * (1 - var(--t)))) scale(calc(.16 + var(--t) * .84));
  opacity: min(1, calc(var(--t) * 5)); }
.hx-top { display: flex; align-items: center; gap: 10px; }
.hx-top .plate { width: 24px; height: 24px; font-size: 12px; transition: background-color 300ms, color 300ms, box-shadow 300ms; }
.hx-title { font: 600 15px/1.2 var(--sans); color: var(--ink); }
.hx-art { display: block; width: 100%; height: 52px; margin: 8px 0; }
.hx-art rect, .hx-art .m0, .hx-art .dot { fill: var(--model-0); }
.hx-art .m1 { fill: var(--model-1); }
.hx-art .m2 { fill: var(--model-2); }
.hx-art path { fill: none; stroke-width: 3; }
.hx-art path.m0 { stroke: var(--model-0); fill: none; }
.hx-art path.dash { stroke: var(--model-7); stroke-dasharray: 4 4; stroke-width: 2; }
.hx-art .dot { stroke: var(--paper); stroke-width: 2; }
.hx-deck { position: relative; height: 18px; }
.hx-deck::before { content: ""; position: absolute; left: 2px; right: 2px; top: 7px; height: 4px; border-radius: 9999px; background: var(--rule-strong); }
.hx-thumb { position: absolute; top: 2px; left: calc(2px + (100% - 18px) * var(--at) / 100%); width: 14px; height: 14px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--model-0); }
.hall-art .hx-card:nth-child(1) .plate { background: var(--ink); color: #fff; box-shadow: none; }
.hall-art .hx-card:nth-child(2) .plate { background: var(--green); color: #fff; box-shadow: none; }
.paper-hall.is-live .hs-step:not(.now) { opacity: .42; }
.paper-hall.is-live .hs-step.done { opacity: .64; }
.paper-hall.is-live .hs-step.now .plate { background: var(--green); color: #fff; box-shadow: none; }
.paper-hall.is-live .hs-step.done .plate { background: var(--ink); color: #fff; box-shadow: none; }
.paper-hall.is-live .hx-card { will-change: transform, opacity; }
button.hall-replay { margin-top: 14px; padding-left: 0; padding-right: 4px; color: var(--mute); }
button.hall-replay:hover:not(:disabled) { background: transparent; color: var(--ink); }
.paper-hall.is-live .hall-art:not([data-step="3"]) .hx-card .plate { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }

/* ---------- gallery: finished lessons, each led by one of its own models on the plate ground */
.gallery-sec { margin: 0 0 80px; }
.gallery-page { margin-top: 8px; }
.gal-head { max-width: 760px; margin-bottom: 30px; }
.gal-head h2 { font-size: clamp(28px, 2.8vw, 38px); margin-bottom: 12px; }
.gal-head .lead { margin: 0; font-size: 18px; line-height: 1.5; color: var(--body); }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px clamp(24px, 3vw, 40px); }
.gal-item { position: relative; display: flex; flex-direction: column; min-width: 0; }
.gal-plate { --viz-max-h: none; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 10px; margin-bottom: 14px; background: var(--plate); border-radius: var(--r-lg); overflow: hidden; transition: background-color var(--ui); }
.gal-reading { padding: clamp(16px, 3vw, 32px); max-width: 36ch; }
.gal-reading > p:first-child { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.2; font-weight: 600; }
.gal-reading .small { line-height: 1.6; color: var(--body); }
.activity-lab { width: 100%; padding: 20px; }
.activity-lab h3 { font-size: 22px; margin: 0 0 12px; }
.activity-prompt, .activity-feedback { line-height: 1.5; }
.activity-board { display: grid; gap: 12px; }
.activity-card { padding: 14px; border: 1px solid var(--mute); border-radius: var(--r-lg); }
.activity-card p { margin: 0 0 10px; }
.activity-card select { width: 100%; min-height: 44px; }
.activity-card-feedback:empty { display: none; }
.activity-card-feedback { font-size: 14px; }
.activity-tools { display: grid; gap: 8px; }
.activity-tools button { white-space: normal; min-height: 44px; }
.activity-lab svg { display: block; width: 100%; max-height: 360px; overflow: visible; }
.construction-circle { fill: none; stroke: var(--blue); stroke-width: 2; opacity: .65; }
.construction-circle.second { stroke: var(--green); }
.construction-edge { stroke: var(--ink); stroke-width: 3; }
.construction-point { fill: var(--ink); }
.inheritance-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.inheritance-seed { display: grid; justify-items: center; gap: 6px; min-height: 80px; background: var(--lemon); color: var(--ink); }
.inheritance-seed.wrinkled { border: 3px dashed var(--ink); border-radius: 30% 45% 25% 40%; }
.activity-lab .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hypothetical-tag { display: inline-block; margin: 0 0 12px; padding: 6px 10px; border-radius: 8px; background: var(--ochre-soft); color: var(--ochre-ink); font-size: 14px; }
.activity-hints { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 15px; color: var(--body); }
.activity-hints:empty { display: none; }
.revisit { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--green); background: var(--green-soft); }
.worked-steps, .evidence-stages { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 22px; line-height: 1.5; }
.evidence-stages li::marker { font-weight: 700; }
.step-result { font-weight: 600; color: var(--ink); }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.compare-case { padding: 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-lg); background: var(--surface); }
.compare-case h4 { margin: 0 0 8px; font-size: 16px; }
.compare-case p { margin: 8px 0 0; line-height: 1.5; }
.compare-model { min-height: 160px; }
.compare-model .outputs { margin-top: 8px; }
.trace-diagram { max-width: 520px; margin: 12px auto 0; }
.trace-edge { stroke: var(--rule-strong); stroke-width: 1.2; }
.trace-edge.on { stroke: var(--green); stroke-width: 2; }
.trace-node { cursor: pointer; outline: none; }
.trace-node circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1; }
.trace-node.on circle { fill: var(--green-soft); stroke: var(--green); stroke-width: 2; }
.trace-node:focus-visible circle { stroke: var(--green); stroke-width: 2.5; }
.trace-node text { font: 600 4.2px var(--sans); fill: var(--ink); pointer-events: none; }
.trace-node .trace-order { font-size: 4px; fill: var(--green); }
.passage-option blockquote { margin: 0; font-size: 16px; line-height: 1.5; }
.passage-option cite { display: block; margin-top: 6px; font-size: 13px; font-style: normal; color: var(--mute); }
.construction-picture text { font: 600 5px var(--sans); fill: var(--ink); }
.construction-picture .construction-circle { stroke-width: .8; }
.construction-picture .construction-edge { stroke-width: 1.2; }
.construction-picture .latest { stroke: var(--green); opacity: 1; }
.gal-plate .viz-box, .gal-plate .viz-wrap { width: 100%; height: 100%; padding: 0; }
.gal-plate .viz { height: 100%; }
.gal-plate .legend, .gal-plate .viz-status { display: none; }
.gal-plate .viz-canvas { max-width: var(--viz-max-h); }
.gal-bars { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 14px; }
.gal-bars li { flex: 1; height: 3px; border-radius: 9999px; background: var(--tab); }
.gal-title { margin: 0 0 8px; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.gal-title a { color: var(--ink); text-decoration: none; }
.gal-title a::after { content: ""; position: absolute; inset: -6px; border-radius: calc(var(--r-lg) + 4px); }
.gal-title a:focus-visible { outline: none; }
.gal-title a:focus-visible::after { outline: 2px solid var(--green); outline-offset: 2px; }
.gal-item:hover .gal-plate { background: var(--plate-2); }
.gal-item:hover .gal-title a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gal-paper { margin: 0 0 8px; font-size: 15px; line-height: 1.4; color: var(--mute); }
.gal-paper cite { display: block; margin-bottom: 2px; font: italic 400 16px/1.35 var(--words); color: var(--body); }
.gal-meta { margin: auto 0 0; font: 600 14px/1.3 var(--sans); color: var(--mute); }
.gallery > li.muted { grid-column: 1 / -1; }
@media (max-width: 1100px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .gallery { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
@media (prefers-reduced-motion: reduce) { .gal-plate { transition: none; } }
.bring, .setup { max-width: 760px; }
.bring h2 { margin-bottom: 18px; }
.recent { max-width: 760px; margin-top: 8px; }
.recent:has(.recent-list) > a { display: inline-block; margin-top: 6px; font-weight: 600; }
.recent-list { list-style: none; padding: 0; margin: 8px 0; border-top: 1px solid var(--rule); }
.recent-list li { border-bottom: 1px solid var(--rule); }
.recent-item { width: 100%; min-height: 64px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; border: 0; border-radius: 0; padding: 12px 4px; text-align: left; white-space: normal; background: transparent; }
.recent-item:hover:not(:disabled) { background: var(--plate); }
.ri-title { font: 600 17px/1.25 var(--sans); color: var(--ink); }
.ri-meta { font: 400 14px var(--sans); color: var(--mute); }

/* first run: choosing a provider */
.provider-choice { display: grid; margin: 14px 0 6px; border-top: 1px solid var(--rule); max-width: 640px; }
.provider-option { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 10px; border-bottom: 1px solid var(--rule); cursor: pointer; font: 400 16px var(--sans); transition: background-color var(--ui); }
.provider-option:hover { background: color-mix(in srgb, var(--plate) 55%, transparent); }
.provider-option:has(input:checked) { background: var(--green-soft); }
.provider-option input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.po-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.po-name { font: 600 16px/1.3 var(--sans); color: var(--ink); }
.po-tagline { font-size: 14.5px; line-height: 1.4; color: var(--mute); }
.po-status { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; margin-top: 2px; font-weight: 600; font-size: 14px; color: var(--mute); }
.po-status.ok { color: var(--good); }
.setup-steps { list-style: none; padding: 0; margin: 22px 0 0; border-top: 1px solid var(--rule); }
.setup-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.setup-step .plate { margin-top: 2px; }
.setup-step.done .plate { background: var(--good); color: #fff; box-shadow: none; }
.setup-step.active .plate { background: var(--green); color: #fff; box-shadow: none; }
.step-body { min-width: 0; }
.step-title { margin: 4px 0 0; font: 600 18px/1.25 var(--sans); color: var(--ink); }
.setup-step.later .step-title { color: var(--mute); }
.step-detail { margin: 8px 0 0; font-size: 16px; color: var(--body); }
.step-detail code { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.command { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 6px 6px 6px 14px; background: var(--plate); color: var(--ink); border-radius: var(--r); min-width: 0; }
.command .prompt { font-family: var(--mono); color: var(--mute); user-select: none; }
.command code { flex: 1; min-width: 0; font: 14px/1.5 var(--mono); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.command code::-webkit-scrollbar { display: none; }
.copy-btn { min-height: 34px; padding: 0 12px; font-size: 14px; }
.copy-btn.done { background: var(--good); border-color: var(--good); color: #fff; }
.setup-live { min-height: 1.4em; margin: 10px 0 0; }
.settings-setup { margin-top: 18px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* the model, folded away until you want to change it */
.model-pick { margin: 18px 0 4px; max-width: 640px; }
.model-pick summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font: 400 15px var(--sans); color: var(--body); }
.model-pick summary::-webkit-details-marker { display: none; }
.model-pick summary > span:first-of-type { font-weight: 600; color: var(--ink); }
.mp-change { margin-left: 6px; color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.model-pick[open] .mp-change { display: none; }
.model-pick select { margin-top: 10px; }
.connect { max-width: 680px; }
.connect .lead { margin-bottom: 8px; }
.connect > .actions { margin-top: 14px; }
.connect input[type=password] { max-width: 640px; }

/* account and sign-in */
.signin { max-width: 560px; }
.signin-options { display: grid; gap: 10px; margin: 26px 0; max-width: 360px; }
.signin-options .btn { min-height: 50px; font-size: 16px; }
.account-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.account-head h1 { margin: 0 0 2px; }
.account-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 32px; margin: 0 0 24px; border-top: 1px solid var(--rule); }
.account-facts dt, .account-facts dd { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.account-facts dt { color: var(--mute); }
.account-facts dd { margin: 0; font-weight: 600; color: var(--ink); }

/* ---------- outline, build, library, editor */
.outline-list { list-style: none; padding: 0; margin: 20px 0; counter-reset: ex; border-top: 1px solid var(--rule); }
.outline-item { counter-increment: ex; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.outline-item::before { content: counter(ex); width: 30px; height: 30px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 700 14px var(--sans); }
.outline-item.known { opacity: .55; }
.outline-item.known::before { background: var(--paper); color: var(--mute); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.oi-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.oi-title strong { font: 700 19px/1.25 var(--sans); }
.oi-idea { margin: 6px 0 0; color: var(--body); }
.oi-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 360px; }
.removed { margin-top: 16px; }
.build-steps { list-style: none; padding: 0; margin: 20px 0; border-top: 1px solid var(--rule); }
.build-step { display: grid; grid-template-columns: 30px 1fr; gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.bs-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule-strong); font: 700 12px var(--sans); color: var(--mute); }
.bs-icon .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.build-step.active .bs-icon { box-shadow: inset 0 0 0 2px var(--green); color: var(--green); animation: pulse 1.6s cubic-bezier(.45, 0, .55, 1) infinite; }
.build-step.done .bs-icon { background: var(--good); box-shadow: none; color: #fff; }
.build-step.failed .bs-icon { background: var(--bad); box-shadow: none; color: #fff; }
.build-step.skipped .bs-icon { color: var(--faint); }
.bs-label { font: 600 17px/1.3 var(--sans); color: var(--ink); align-self: center; }
.build-step.waiting .bs-label { color: var(--mute); font-weight: 400; }
.bs-detail { grid-column: 2; color: var(--mute); font-size: 15px; }
.bs-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; align-self: center; }
.bs-time { flex: none; color: var(--mute); font: 500 14px var(--sans); font-variant-numeric: tabular-nums; }
.build-step.active .bs-time { color: var(--green); }
.bs-found { grid-column: 2; margin-top: 4px; font-size: 15px; color: var(--mute); }
.bs-found summary { cursor: pointer; color: var(--ink); }
.bs-found ul { margin: 6px 0 0; padding-left: 20px; }
.bs-found li { margin: 2px 0; overflow-wrap: anywhere; }
.build-progress { margin: 20px 0; max-width: 720px; }
.bp-summary { display: grid; gap: 8px; margin-bottom: 4px; }
.bp-count { margin: 0; font: 600 17px/1.3 var(--sans); }
.bp-bar { display: block; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 9999px; background: var(--plate-2); color: var(--green); overflow: hidden; }
.bp-bar::-webkit-progress-bar { background: var(--plate-2); }
.bp-bar::-webkit-progress-value { background: var(--green); transition: width .3s ease; }
.bp-bar::-moz-progress-bar { background: var(--green); }
.build-progress .build-steps { margin-top: 12px; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 2px var(--green), 0 0 0 5px color-mix(in srgb, var(--green) 18%, transparent); } }
.library { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.lib-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.lib-item h3 { margin: 0 0 4px; font-size: 19px; }
.lib-item .actions { margin: 0; }
.empty { max-width: 640px; }
.panel.empty { padding: 8px 0 0; }
fieldset { border: 0; border-top: 1px solid var(--rule); padding: 8px 0 22px; margin: 0 0 12px; }
legend { padding: 18px 0 0; font: 700 20px var(--sans); color: var(--ink); }
.advanced summary { cursor: pointer; font: 600 16px var(--sans); color: var(--ink); padding: 8px 0; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px); padding: 14px 0; border-top: 1px solid var(--rule); }

/* ---------- lesson: the plate */
body.lesson-mode .site-head, body.lesson-mode .site-foot { display: none; }
body.lesson-mode #main { max-width: none; padding: 0; }
.lesson { min-height: 100vh; display: flex; flex-direction: column; }
.lesson-top { position: sticky; top: 0; z-index: 6; display: flex; align-items: stretch; gap: 8px; min-height: 60px; padding: max(0px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.lesson-top > .icon-btn { align-self: center; }
.lt-mark { align-self: center; font: 700 18px/1 var(--sans); letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; margin: 0 4px 0 6px; }
.lt-mark .sq { width: 14px; height: 14px; box-shadow: inset 0 0 0 3.5px var(--green), inset 0 0 0 5px var(--paper); }
.lt-paper { align-self: center; color: var(--mute); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.lt-paper .words { color: var(--ink); font-size: 15px; }
.lesson-top .sound-btn { align-self: center; }
/* thumb tabs: one per concept, its colour on the bottom edge, its reading time beneath */
.lt-plates { display: flex; align-items: stretch; gap: 2px; margin-left: 4px; }
.lt-tab { --c: var(--green); position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px; width: clamp(110px, 12.5vw, 200px); padding: 6px 10px 8px; color: var(--mute); font: 400 12.5px/1.25 var(--sans); }
.lt-tab::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--c) 40%, transparent); }
.lt-tab b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--body); font-weight: 600; font-size: 13px; line-height: 1.2; }
.lt-tab .lt-time { font-variant-numeric: tabular-nums; }
.lt-tab.cur { background: var(--plate); color: var(--body); }
.lt-tab.cur b { color: var(--ink); }
.lt-tab.cur::after { background: var(--c); height: 4px; }
.lt-tab.done::after { background: var(--c); }
.lt-tab.pending { color: var(--faint); }
.lt-tab.pending b { color: var(--mute); font-weight: 400; }
.floor { flex: 1; display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); }
/* the notes column */
.rail { background: var(--paper); border-right: 1px solid var(--rule); padding: 32px clamp(24px, 2.6vw, 40px) calc(var(--bar-h) + 28px); }
.rail-inner { position: sticky; top: 92px; }
.rail-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.rail-head .plate.big { margin-top: 3px; background: var(--c, var(--green)); }
.rail-head h2 { font-size: clamp(26px, 2.3vw, 32px); line-height: 1.12; margin: 0; letter-spacing: -.02em; }
.verbs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.verb { border-bottom: 1px solid var(--rule); padding: 11px 0; color: var(--ink); }
.verb-head { display: flex; align-items: center; gap: 10px; font: 600 15px/1.2 var(--sans); color: var(--mute); }
.verb-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule-strong); flex-shrink: 0; font: 700 11.5px/1 var(--sans); color: var(--mute); }
.verb-mark .icon { width: 13px; height: 13px; stroke-width: 3; }
.verb.done .verb-head { color: var(--body); }
.verb.done .verb-mark { background: var(--ink); color: #fff; box-shadow: none; }
.verb.active { padding: 14px 0 18px; }
.verb.active .verb-head { color: var(--ink); font-size: 16px; }
.verb.active .verb-mark { box-shadow: inset 0 0 0 2px var(--green); }
.verb.active .verb-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.verb-body { margin-top: 12px; }
.verb-body p { margin: 0 0 10px; font-size: 17px; line-height: 1.55; color: var(--body); }
.verb-body .goal-text { font: 600 21px/1.35 var(--sans); letter-spacing: -.01em; color: var(--ink); margin: 6px 0 12px; }
.verb-body .count { font: 600 14px var(--sans); color: var(--mute); font-variant-numeric: tabular-nums; }
/* the plate itself */
.stage { padding: 32px clamp(20px, 3vw, 48px) calc(var(--bar-h) + 32px); min-width: 0; background: var(--plate); }
.stage-inner { max-width: 960px; }
.stage .lead { font-size: 20px; color: var(--ink); line-height: 1.45; }
.title-stage { display: grid; gap: 18px; align-content: start; max-width: 700px; }
.title-stage .idea { font-size: 24px; line-height: 1.38; color: var(--ink); font-weight: 400; letter-spacing: -.01em; }

/* options (predict, choice checks, reveal) */
.options { display: grid; gap: 10px; margin: 6px 0; }
.options.inline { grid-template-columns: repeat(2, minmax(0, 220px)); }
.option { display: flex; align-items: center; gap: 14px; margin: 0; min-height: 60px; padding: 14px 18px; border: 1px solid var(--rule-strong); border-radius: var(--r-lg); background: var(--paper); cursor: pointer; font: 400 18px/1.4 var(--sans); color: var(--ink); transition: background-color var(--ui), border-color var(--ui), box-shadow var(--ui); }
.option:hover { border-color: var(--faint); }
.option:has(input:checked), .option.chosen { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-soft); }
.option input { width: 20px; height: 20px; flex-shrink: 0; margin: 0; }
.options.reveal .option { cursor: default; }
.options.reveal .option:hover { border-color: var(--rule-strong); }
.options.reveal .option.is-answer { background: var(--good-bg); border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.options.reveal .option.chosen:not(.is-answer) { background: var(--paper); border-color: var(--rule-strong); border-style: dashed; box-shadow: none; }
.opt-mark { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.is-answer .opt-mark { color: var(--good); }
.chosen:not(.is-answer) .opt-mark { color: var(--mute); }
.opt-tag { font: 600 13px var(--sans); margin-left: auto; padding-left: 12px; color: var(--mute); white-space: nowrap; }
.is-answer .opt-tag { color: var(--good); }
.statement { margin: 4px 0 18px; padding: 20px 24px; background: var(--paper); border-radius: var(--r-lg); font: 400 23px/1.38 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.num-row { display: flex; align-items: center; gap: 12px; max-width: 320px; font-weight: 600; }
.order-list { list-style: none; padding: 0; margin: 10px 0; counter-reset: ord; display: grid; gap: 6px; }
.order-item { counter-increment: ord; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-lg); background: var(--paper); font-size: 17px; color: var(--ink); }
.order-item::before { content: counter(ord); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px var(--sans); flex-shrink: 0; }
.order-item > span:first-of-type { flex: 1; }
.order-btns { display: flex; gap: 4px; }
.order-btns button { width: 40px; min-height: 40px; padding: 0; }

/* the paper speaks: its own words, in italic, like a name on a plate */
.quote { margin: 0; padding: 4px 0 0; }
.quote blockquote { margin: 0 0 10px; font: italic 400 23px/1.45 var(--words); color: var(--ink); text-wrap: pretty; }
.quote blockquote::before { content: "“"; } .quote blockquote::after { content: "”"; }
.quote figcaption { font: 400 14px var(--sans); color: var(--mute); }
.explanation { font-size: 19px; line-height: 1.6; color: var(--ink); max-width: 64ch; }
.equation { margin: 0 0 20px; padding: 26px 20px; background: var(--paper); border-radius: var(--r-lg); text-align: center; font: italic 400 32px/1.7 var(--words); color: var(--ink); }
.term { font: inherit; font-style: italic; min-height: 0; padding: 0 5px; margin: 0 2px; border: 0; border-radius: 3px; box-shadow: inset 0 -3px 0 var(--k); background: transparent; color: var(--ink); display: inline; }
.term:hover, .term.hl { background: color-mix(in srgb, var(--k) 18%, transparent); border-color: transparent; }

/* ---------- the model on the plate ground */
.model-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.model-head h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.viz-box { padding: 6px 0 4px; }
.viz-wrap { width: 100%; }
.viz { display: block; width: 100%; height: auto; max-height: var(--viz-max-h, none); font-family: var(--sans); }
.viz-canvas { display: block; width: 100%; max-width: min(460px, var(--viz-max-h, 460px)); aspect-ratio: 1; margin: 0 auto; image-rendering: pixelated; border-radius: 4px; }
.viz-status { min-height: 1.2em; text-align: right; font: 400 13px var(--sans); color: var(--mute); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 2px 0; font: 400 14px var(--sans); color: var(--body); }
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--sw); border-radius: 2px; }
.swatch.dash { border-top-style: dashed; }
.swatch.area { height: 12px; border: 1.5px solid var(--sw); background: color-mix(in srgb, var(--sw) 30%, transparent); }
.swatch.square { width: 12px; height: 12px; border: 0; border-radius: 2px; background: var(--sw); }
.swatch.circle { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--sw); }
.swatch.ring { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--sw); }
@media (min-width: 901px) { .stage .caption { display: none !important; } }
.caption { margin: 12px 0 0; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r); font: 400 17px/1.45 var(--sans); }
/* readouts: numbers on the plate, separated by hairlines */
.outputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 14px 0 0; }
.out { position: relative; padding: 8px 16px 10px; border-left: 1px solid var(--plate-2); border-radius: 4px; transition: background-color var(--ui); }
.out:first-child { border-left: 0; padding-left: 4px; }
.out dt { display: flex; align-items: center; gap: 7px; font: 400 14px/1.25 var(--sans); color: var(--mute); }
.out dd { margin: 5px 0 0; font: 600 25px/1 var(--sans); letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.out.hl { background: var(--ochre-soft); }
.key { width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; background: var(--k); }
/* controls: plain sliders on the plate, each in its own ink */
.controls { margin-top: 14px; padding: 4px 0; }
.ctl { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "label value play" "range range range"; align-items: center; gap: 2px 12px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r); transition: background-color var(--ui); }
.ctl label { grid-area: label; margin: 0; display: flex; align-items: center; gap: 9px; color: var(--ink); font: 600 15px/1.3 var(--sans); }
.ctl-value { grid-area: value; font: 600 17px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); }
.ctl .play { grid-area: play; min-height: 32px; padding: 0 10px; font-size: 14px; background: var(--paper); }
.ctl .play:disabled { opacity: .55; }
.ctl.hl { background: var(--ochre-soft); }
.ctl input[type=range] { grid-area: range; width: 100%; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.ctl input[type=range]:disabled { cursor: default; }
.ctl input[type=range]::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, var(--k, var(--green)) var(--fill, 50%), var(--rule-strong) var(--fill, 50%)); border-radius: 9999px; }
.ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--k, var(--green)); box-shadow: 0 1px 3px rgba(29, 35, 33, .25); transition: transform var(--ui); }
.ctl input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
.ctl input[type=range]::-moz-range-track { height: 6px; border-radius: 9999px; background: var(--rule-strong); }
.ctl input[type=range]::-moz-range-progress { height: 6px; border-radius: 9999px; background: var(--k, var(--green)); }
.ctl input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2px solid var(--k, var(--green)); box-shadow: 0 1px 3px rgba(29, 35, 33, .25); }
.ctl input[type=range]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.ctl input.toggle { grid-area: range; justify-self: start; width: 22px; height: 22px; }
/* the signature move: while a note plays, its number pins onto the part of the model it names */
.ctl[data-pin]::before, .out[data-pin]::before { content: attr(data-pin); position: absolute; top: -9px; left: -9px; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font: 700 11.5px/1 var(--sans); box-shadow: 0 0 0 2px var(--plate); animation: pin-in .35s cubic-bezier(.16, 1, .3, 1); }
.out:first-child[data-pin]::before { left: -12px; }
.ctl[data-pin-state="said"]::before, .out[data-pin-state="said"]::before { background: var(--ink); animation: none; }
.ctl[data-pin-state="said"], .out[data-pin-state="said"] { background: transparent; }
@keyframes pin-in { from { transform: scale(.4); opacity: 0; } }
.viz .mark-pin circle { fill: var(--green); stroke: var(--plate); stroke-width: 2.5; }
.viz .mark-pin text { fill: #fff; font: 700 11.5px var(--sans); }
.viz .mark-pin.said circle { fill: var(--ink); }
.kbd-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin: 10px 0 0; font-size: 14px; color: var(--mute); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; text-align: center; font: 600 12.5px var(--sans); color: var(--ink); background: var(--paper); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--rule-strong), 0 1px 0 var(--rule-strong); }
.model-note { margin: 12px 0 0; font-size: 14px; color: var(--mute); }

/* ---------- the action bar */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--paper); border-top: 1px solid var(--rule); box-shadow: 0 -4px 18px rgba(29, 35, 33, .05); transition: background-color var(--ui), transform 240ms cubic-bezier(.16, 1, .3, 1); }
.action-bar.good { background: var(--good-bg); border-top-color: color-mix(in srgb, var(--good) 40%, transparent); }
.action-bar.bad { background: var(--bad-bg); border-top-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.action-bar.pop { transform: translateY(-3px); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(20px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.bar-left { flex: 1; min-width: 0; max-height: 36vh; overflow-y: auto; }
.bar-msg p { margin: 0 0 4px; font-size: 16px; color: var(--body); }
.bar-msg p:last-child { margin-bottom: 0; }
.bar-msg .bar-head { display: flex; align-items: center; gap: 8px; font: 700 19px/1.25 var(--sans); color: var(--ink); }
.action-bar.good .bar-head { color: var(--good); }
.action-bar.bad .bar-head { color: var(--bad); }
.bar-buttons { display: flex; gap: 10px; flex-shrink: 0; }
.bar-buttons button { min-height: 50px; padding: 0 26px; font-size: 17px; }
.bar-tip { margin: 0; }

/* ---------- overview pages (intro, finish, waiting) */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 56px; align-items: start; }
.overview h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.06; letter-spacing: -.025em; }
.overview .summary { font-size: 19px; line-height: 1.6; color: var(--ink); max-width: 62ch; }
.overview .source { color: var(--mute); }
.overview .source em, .overview .source cite { font-family: var(--words); color: var(--ink); }
/* the contents: plates listed like a guide's index */
.hall { padding: 0; }
.hall-head { padding: 0 0 10px; font: 600 15px var(--sans); color: var(--ink); }
.hall ol { list-style: none; padding: 0; margin: 0; }
.hall ol { border-top: 1px solid var(--rule); }
.hall li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.hall li button { min-height: 0; padding: 0; border: 0; background: none; text-align: left; justify-content: flex-start; white-space: normal; display: flex; gap: 14px; align-items: center; width: 100%; }
.hall li button:hover:not(:disabled) .h-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hall li button:disabled { background: none; }
.hall .h-title { font: 600 16px/1.3 var(--sans); color: var(--ink); }
.hall .h-state { display: block; font: 400 14px var(--sans); color: var(--mute); }
.hall li.omitted .h-title { text-decoration: line-through; color: var(--mute); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 32px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 18px 20px 18px 0; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--rule); }
.stat-num { font: 700 46px/1 var(--sans); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; font: 400 15px var(--sans); color: var(--mute); }
.recaps { padding-left: 0; list-style: none; counter-reset: rc; border-top: 1px solid var(--rule); }
.recaps li { counter-increment: rc; display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.recaps li::before { content: counter(rc); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font: 700 12px var(--sans); }
.waiting { max-width: 600px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--plate-2); border-top-color: var(--green); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chart pieces, in the plate's inks */
.viz .grid { stroke: var(--rule-strong); stroke-width: 1; stroke-opacity: .55; }
.viz .frame { fill: none; stroke: none; }
.viz .tick { fill: var(--mute); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.viz .axis-label { fill: var(--body); font-family: var(--sans); font-size: 13.5px; font-weight: 600; }
.viz .series { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.viz .series.dashed { stroke-width: 2.5; stroke-dasharray: 8 6; }
.viz .fill { opacity: .22; }
.viz .refline { fill: none; stroke: var(--mute); stroke-width: 1.5; stroke-dasharray: 3 5; }
.viz .ref-label { fill: var(--mute); font-size: 12.5px; font-weight: 600; }
.viz .marker { stroke-width: 2; stroke-dasharray: 6 5; }
.viz .marker-label { font-family: var(--sans); font-size: 13px; font-weight: 600; }
.viz .point { stroke: var(--paper); stroke-width: 2.5; }
.viz .point-label { fill: var(--ink); font-size: 13.5px; font-weight: 600; paint-order: stroke; stroke: var(--plate); stroke-width: 5px; }
.viz .bar { stroke: none; }
.viz .bar-value { fill: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz .bar-label { fill: var(--body); font-family: var(--sans); font-size: 14px; font-weight: 600; }
.viz .trace { fill: none; stroke-width: 1.2; opacity: .55; }
.viz .edge { stroke: var(--plate-2); stroke-width: 1.5; }
.viz .edge.lit { stroke: var(--model-1); opacity: .7; }
.viz .node { fill: var(--paper); stroke: var(--mute); stroke-width: 1.5; }
.viz .node.on { fill: var(--model-1); stroke: var(--paper); }
.viz .cnode { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.viz .cnode-label { fill: var(--ink); font-family: var(--sans); font-size: 14px; font-weight: 600; }
.viz .cnode-value { fill: var(--mute); font-size: 12.5px; font-weight: 400; }
.viz .cedge { stroke-linecap: round; }
.viz .cedge.pos { stroke: var(--model-0); }
.viz .cedge.neg { stroke: var(--model-1); stroke-dasharray: 9 6; }
.viz .cedge.zero { stroke: var(--model-7); stroke-dasharray: 2 6; }
.viz .edge-label { fill: var(--ink); font-size: 12.5px; font-weight: 600; paint-order: stroke; stroke: var(--plate); stroke-width: 5px; }
.viz .dot { fill: var(--model-7); opacity: .5; }
.viz .dot.sel { fill: var(--model-1); opacity: .95; }
.viz .axis0 { stroke: var(--mute); stroke-width: 1; }
.viz .vector { stroke-width: 3.5; stroke-linecap: round; }
.viz .segment { stroke-width: 2.5; }
.viz .poly { fill-opacity: .2; stroke-width: 2.5; }
.viz .gcircle { fill: none; stroke-width: 2.5; }
.viz-table { width: 100%; border-collapse: separate; border-spacing: 4px; font-variant-numeric: tabular-nums; }
.viz-table th { padding: 6px 8px; font: 600 14px var(--sans); color: var(--mute); }
.viz-table td { padding: 14px 8px; text-align: center; font: 600 18px var(--sans); color: var(--ink); background: var(--paper); border-radius: 4px; transition: background-color .3s; }
.viz-table td.hl { background: var(--ochre-soft); box-shadow: inset 0 0 0 2px var(--ochre); }

/* ---------- adaptive layouts */
.stage .model-panel { --viz-max-h: max(240px, calc(100vh - var(--bar-h) - 470px)); }
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hall-pin { grid-template-columns: minmax(0, 1fr); }
  .lt-tab { width: auto; max-width: 140px; }
}
@media (max-width: 900px) {
  .home-exhibit { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "stage" "verbs"; row-gap: 18px; min-height: 0; --viz-max-h: max(220px, 40svh); }
  .he-verbs .verb:not(.active) { display: block; }
  .floor { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--rule); padding: 20px 20px 18px; }
  .rail-inner { position: static; }
  .rail-head { margin-bottom: 12px; }
  .verb:not(.active) { display: none; }
  .verbs { border-top: 0; }
  .verb.active { border-bottom: 0; padding: 0; }
  .lt-paper { display: none; }
  .lt-plates { margin-left: auto; }
  .lt-tab { width: 58px; padding: 6px 4px 8px; align-items: center; text-align: center; }
  .lt-tab b { font-size: 13px; }
  .lt-tab .lt-name { display: none; }
  .lt-tab .lt-time { font-size: 11.5px; }
  .stage { padding: 20px 20px calc(var(--bar-h) + 28px); }
  .equation { font-size: 25px; padding: 18px; }
  .outline-item { grid-template-columns: 30px minmax(0, 1fr); }
  .oi-btns { grid-column: 2 / -1; justify-content: flex-start; max-width: none; }
}
@media (max-width: 520px) {
  main { padding-top: 24px; }
  .site-head { gap: 12px; }
  .site-nav a { padding: 8px; font-size: 14px; }
  .account-name { display: none; }
  .panel.yellow, .panel.empty { padding: 20px; }
  .lt-mark { display: none; }
  .rail { padding: 16px 16px 14px; }
  .rail-head { gap: 10px; margin-bottom: 8px; }
  .rail-head h2 { font-size: 23px; }
  .verb-body { margin-top: 6px; }
  .verb-body .goal-text { font-size: 18px; margin: 4px 0 6px; }
  .verb-body p { font-size: 16px; margin-bottom: 6px; }
  .model-panel { display: flex; flex-direction: column; }
  .model-panel .controls { order: 1; }
  .model-panel .outputs { order: 2; }
  .model-panel .kbd-hint, .model-panel .model-note { order: 3; }
  .stage .model-panel { --viz-max-h: max(180px, 32vh); }
  .viz-box { padding: 8px 8px 4px; }
  .viz .bar-label { font-size: 12px; font-weight: 600; }
  .viz .point-label, .viz .ref-label, .viz .marker-label { font-size: 11.5px; }
  .viz .tick { font-size: 11px; }
  .outputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .out { padding: 6px 8px 8px; }
  .out dt { font-size: 12px; }
  .out dd { font-size: 19px; }
  .bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .bar-buttons button { flex: 1; padding: 0 12px; }
  .bar-msg.hint { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat + .stat { padding: 14px 0; border-left: 0; }
  .stat + .stat { border-top: 1px solid var(--rule); }
  .options.inline { grid-template-columns: 1fr 1fr; }
  .he-intro .lead { font-size: 16px; margin-bottom: 4px; }
  .he-start { margin-top: 14px; }
  .he-stage { padding: 14px; }
  .hall-art { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 12px; }
  .hall-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hx-card { padding: 6px; }
  .hx-top { flex-direction: column; align-items: flex-start; gap: 4px; }
  .hx-title { font-size: 12px; }
  .hx-art { height: 34px; margin: 6px 0; }
  .hp-paper { padding: 14px; } .hp-title { font-size: 15px; } .hp-lines { gap: 6px; } .hp-line { font-size: 12.5px; }
}
@media (max-height: 560px) {
  .lesson-top, .rail-inner { position: static; }
  .bar-inner { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .bar-buttons button { min-height: 44px; }
  .bar-msg.hint, .kbd-hint, .model-note { display: none; }
  .stage .model-panel { --viz-max-h: max(200px, calc(100vh - var(--bar-h) - 80px)); }
}
@media (min-width: 700px) and (max-height: 560px) and (orientation: landscape) {
  .floor { grid-template-columns: minmax(240px, 34%) minmax(0, 1fr); }
  .rail { border-right: 1px solid var(--rule); border-bottom: 0; }
}
@media (pointer: coarse) {
  button, .btn { min-height: 48px; }
  button.small, .btn.small, .copy-btn, .ctl .play { min-height: 44px; }
  .ctl input[type=range] { height: 48px; }
  .ctl input[type=range]::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -12px; }
  .ctl input[type=range]::-moz-range-thumb { width: 26px; height: 26px; }
  .kbd-hint, .bar-tip { display: none; }
}
@media (hover: none) {
  .option:hover, .recent-item:hover:not(:disabled), .ghost:hover:not(:disabled), .icon-btn:hover:not(:disabled), .site-nav a:hover { background: transparent; }
  .option:has(input:checked):hover { background: var(--green-soft); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- numbered notes: the narrated tour and walkthrough in the notes column */
.tour-script { list-style: none; margin: 12px 0 4px; padding: 0; counter-reset: line; display: grid; gap: 2px; }
.tour-script li { counter-increment: line; position: relative; padding: 7px 0 7px 34px; font: 400 16px/1.5 var(--sans); color: var(--mute); transition: color .25s ease; }
.tour-script li::before { content: attr(data-n); position: absolute; left: 0; top: 8px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rule-strong); font: 700 11.5px/1 var(--sans); color: var(--mute); transition: background-color .25s, color .25s, box-shadow .25s; }
.tour-script li.said { color: var(--body); }
.tour-script li.said::before { background: var(--ink); color: #fff; box-shadow: none; }
.tour-script li.now { color: var(--ink); }
.tour-script li.now::before { background: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-soft); }
@media (max-width: 900px) {
  .tour-script { margin: 8px 0 0; }
  .tour-script:has(li.now) li:not(.now) { display: none; }
  .stage .caption { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tour-script li, .tour-script li::before, .ctl, .out { transition: none; } .ctl[data-pin]::before, .out[data-pin]::before { animation: none; } }

/* Per-option reasons on the reveal */
.opt-body { display: grid; gap: 4px; }
.opt-why { font-size: 15px; line-height: 1.5; color: var(--body); }
.option.is-answer .opt-why, .option.chosen .opt-why { color: var(--ink); }

/* Hint ladder: earlier hints step back */
.bar-msg .hint-old { color: var(--mute); }

/* New words, introduced after the walkthrough */
.terms { margin: 0 0 28px; padding: 14px 0; border-top: 1px solid var(--plate-2); border-bottom: 1px solid var(--plate-2); max-width: 720px; }
.terms-head { margin: 0 0 6px; font: 700 16px/1.3 var(--sans); color: var(--ink); }
.term-def { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 16px; padding: 8px 0; }
.term-def + .term-def { border-top: 1px solid var(--plate-2); }
.term-def dt { font-weight: 700; color: var(--ink); }
.term-def dd { margin: 0; color: var(--body); }
@media (max-width: 520px) { .term-def { grid-template-columns: 1fr; } }

/* Builds-on note on the title screen */
.builds-on { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; color: var(--body); }

/* The big surprise on the finish page */
.aha { margin: 8px 0 32px; padding: 20px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.aha-head { margin: 0 0 6px; font: 600 15px/1.3 var(--sans); color: var(--good); }
.aha-text { margin: 0; font: 400 22px/1.4 var(--sans); letter-spacing: -.01em; color: var(--ink); }

/* Goal reached: the plate and the step mark give a short pop */
@keyframes lemma-pop { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes lemma-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.viz-box.celebrate { animation: lemma-flash .8s cubic-bezier(.16, 1, .3, 1); }
.verb-mark.celebrate { animation: lemma-pop .45s cubic-bezier(.2, .8, .2, 1); }
.sound-btn[aria-pressed="false"] { color: var(--mute); }
@media (prefers-reduced-motion: reduce) { .viz-box.celebrate, .verb-mark.celebrate { animation: none; } }
@media (max-width: 640px) {
  .options.reveal .option.chosen { position: relative; padding-top: 24px; }
  .options.reveal .opt-tag { position: absolute; top: -11px; right: 12px; margin: 0; padding: 3px 8px; background: var(--ink); color: #fff; border-radius: 9999px; }
}

/* ---------- the paper in brief: the paper's story, read before the first plate */
.overview.brief { grid-template-columns: minmax(0, 44rem); justify-content: center; }
.brief-steps { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; padding: 0; margin: 0 0 40px; }
.brief-steps button { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--mute); text-align: left; white-space: normal; }
.brief-steps button:hover:not(:disabled) { border: 0; color: var(--ink); }
.brief-steps button:disabled { background: none; color: var(--faint); }
.brief-bar { display: block; height: 4px; border-radius: 4px; background: var(--plate-2); }
.brief-steps .done .brief-bar { background: var(--ink); }
.brief-steps .cur .brief-bar { background: var(--green); }
.brief-label { font: 400 14px/1.25 var(--sans); }
.brief-steps .cur .brief-label { color: var(--ink); font-weight: 600; }
.brief h1 { font-size: clamp(34px, 4.4vw, 52px); margin-bottom: 22px; }
.brief-body { font-size: 20px; line-height: 1.6; color: var(--ink); max-width: 62ch; margin: 0 0 18px; }
.brief .quote { margin: 32px 0 8px; padding-top: 22px; border-top: 1px solid var(--rule); }
.brief .actions { margin-top: 36px; }
.brief-intro { margin: 28px 0 6px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.brief-intro h3 { margin-bottom: 6px; font-size: 19px; }
.brief-intro p { margin: 0; color: var(--body); }
@media (max-width: 640px) {
  .brief-steps .brief-label { display: none; }
  .brief-body { font-size: 18px; }
  .brief .quote blockquote { font-size: 20px; }
}

/* ---------- search a topic: starting chips and the results list */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 9999px; font: 400 15px/1 var(--sans); color: var(--ink); }
.chip.surprise { background: var(--ochre-soft); border-color: transparent; color: var(--ochre-ink); gap: 6px; font-weight: 600; }
.chip.surprise:hover:not(:disabled) { border-color: var(--ochre); }
.results { max-width: 760px; margin-bottom: 32px; }
.results h2 { font-size: 24px; margin-top: 8px; }
.search-progress { margin-top: 8px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--r); }
.search-progress .sp-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-weight: 600; }
.search-progress .sp-spin { width: 18px; height: 18px; border-width: 2px; flex: none; }
.search-services { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; font-size: 15px; }
.search-services li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-services li > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-services li > .muted { white-space: nowrap; flex: none; }
.search-services .sp-done .icon { color: var(--green); }
.search-services .sp-failed .icon { color: var(--faint); }
.search-services .sp-dot { width: 8px; height: 8px; margin: 0 4px; border-radius: 50%; background: var(--rule-strong); flex: none; animation: sp-pulse 1.2s ease-in-out infinite; }
@keyframes sp-pulse { 50% { opacity: .3; } }
.search-bar { display: block; width: 100%; height: 6px; margin: 0 0 8px; appearance: none; border: 0; border-radius: 9999px; background: var(--plate-2); color: var(--green); overflow: hidden; }
.search-bar::-webkit-progress-bar { background: var(--plate-2); }
.search-bar::-webkit-progress-value { background: var(--green); transition: width .3s ease; }
.search-bar::-moz-progress-bar { background: var(--green); }
.search-progress > p.muted { margin: 0; }
@media (prefers-reduced-motion: reduce) { .search-services .sp-dot { animation: none; } .search-bar::-webkit-progress-value { transition: none; } }
.result-list { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--rule); }
.result { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.r-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; color: var(--mute); }
.r-cites { font-weight: 600; color: var(--ink); }
.r-title { margin: 0 0 6px; font: 600 19px/1.35 var(--sans); letter-spacing: -.005em; color: var(--ink); }
.r-meta { margin: 0 0 8px; font-size: 15px; color: var(--mute); }
.r-sum { margin: 0 0 14px; font-size: 16px; color: var(--body); max-width: 70ch; }
.r-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.r-open { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.result .error { margin-top: 12px; }
@media (max-width: 640px) { .r-title { font-size: 18px; } }
@media (max-width: 640px) {
  .segmented { display: flex; width: 100%; }
  .seg { flex: 1; padding: 0 6px; font-size: 14px; white-space: normal; line-height: 1.15; }
}

/* ---------- watch mode: script lines are buttons that play from that line */
.tour-script .line { display: block; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; text-align: left; white-space: normal; cursor: pointer; }
.tour-script .line:hover:not(:disabled) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.script-hint { margin-top: 10px; }
@media (max-width: 900px) { .script-hint { display: none; } }

/* ---------- trails: faint copies of earlier states under the live marks */
.trail-btn { margin-left: auto; min-height: 30px; padding: 0 10px; gap: 6px; font-size: 14px; }
.trail-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.viz .ghost { pointer-events: none; }
.viz path.ghost { stroke-width: 2; }
.viz rect.ghost, .viz polygon.ghost { stroke-width: 1.5; stroke-dasharray: 4 3; }

/* ---------- the equation builds one part at a time */
.equation .eq-wait { opacity: 0; }
.equation .eq-in { animation: lemma-eq-in .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes lemma-eq-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .equation .eq-in { animation: none; } .equation .eq-wait { opacity: 1; } }

/* ---------- The app: white cards on a cool canvas, ink actions, ultramarine live marks */

/* the shell: a translucent bar that floats over the canvas */
body { background: var(--paper); }
.site-head { position: sticky; top: 0; z-index: 10; max-width: none; margin: 0; flex-wrap: wrap; row-gap: 2px; border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  padding-left: max(24px, calc((100vw - 1240px) / 2 + 24px)); padding-right: max(24px, calc((100vw - 1240px) / 2 + 24px)); }
.wordmark { font: 800 22px/1 var(--sans); letter-spacing: -.035em; }
.wordmark .sq, .lt-mark .sq { width: 22px; height: 22px; border-radius: 7px; background: var(--ink); box-shadow: inset 0 0 0 6px var(--ink), inset 0 0 0 11px var(--lemon); }
.lt-mark .sq { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 9px var(--lemon); }
.site-nav a { white-space: nowrap; border-radius: 9999px; padding: 10px 14px; color: var(--body); }
.site-nav a:hover { background: var(--plate-2); color: var(--ink); }
.site-nav a[href="#/make"] { order: 9; margin-left: 6px; background: var(--ink); color: #fff; }
.site-nav a[href="#/make"]:hover { background: #2a2d36; color: #fff; }
.site-foot { border-top: 0; }
.avatar { background: var(--green-soft); color: var(--green-press); }

/* type: tight, confident display; quotes in the reading face, marked by a lemon rule-free highlight */
h1 { font-weight: 800; letter-spacing: -.032em; }
h2 { font-weight: 800; letter-spacing: -.025em; }
.words { font-style: normal; }
.he-quote blockquote, .he-from, .hp-title, .hp-line, .gal-paper cite, .quote blockquote, .equation, .term, .overview .source em, .overview .source cite { font-style: normal; }
.quote blockquote { font: 500 22px/1.45 var(--sans); letter-spacing: -.01em; }
.quote figcaption, .he-quote figcaption { margin-top: 4px; }

/* buttons: ink is the action, soft fills for the rest */
button, .btn { border: 0; background: var(--plate-2); color: var(--ink); border-radius: var(--r); box-shadow: none; transition: background-color var(--ui), color var(--ui), box-shadow var(--ui), transform var(--ui); }
button:hover:not(:disabled), .btn:hover { background: #dfe2e9; border-color: transparent; }
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button:disabled, .btn[aria-disabled="true"] { background: var(--plate-2); color: var(--faint); }
.primary { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(17, 19, 24, .2), 0 6px 16px rgba(17, 19, 24, .14); }
.primary:hover:not(:disabled) { background: #2a2d36; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(17, 19, 24, .2), 0 10px 24px rgba(17, 19, 24, .18); }
.primary:active:not(:disabled) { background: #000; transform: translateY(1px); box-shadow: none; }
.primary:disabled { background: var(--plate-2); color: var(--faint); box-shadow: none; }
.ghost, .icon-btn { background: transparent; }
.ghost:hover:not(:disabled), .icon-btn:hover:not(:disabled) { background: var(--plate-2); }
.danger { background: transparent; color: var(--bad); }
.danger:hover:not(:disabled) { background: var(--bad-bg); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

/* fields */
input[type=text], input[type=url], input[type=search], input[type=password], input[type=number], select, textarea { background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--r); min-height: 50px; }
input:hover, select:hover, textarea:hover { border-color: var(--rule-strong); }
input[type=file]::file-selector-button { border: 0; border-radius: var(--r); background: var(--plate-2); }
.segmented { background: var(--plate-2); border-radius: calc(var(--r) + 2px); padding: 4px; }
.seg { border-radius: 10px; background: transparent; }
.seg.active { background: var(--surface); box-shadow: 0 1px 2px rgba(17, 19, 24, .08), 0 2px 8px rgba(17, 19, 24, .06); }
.command { background: var(--plate-2); border-radius: var(--r); }
.chip { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule); }
.chip:hover:not(:disabled) { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.chip.surprise { background: var(--lemon); color: var(--ink); box-shadow: none; }
.chip.surprise:hover:not(:disabled) { background: #ffdb3d; }

/* marks and tags: soft, sentence case */
.plate { border-radius: 50%; font-family: var(--sans); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.plate.cur { background: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-soft); }
.plate.done { background: var(--ink); color: #fff; box-shadow: none; }
.tag { height: 26px; padding: 0 10px; font: 600 13px/1 var(--sans); border-radius: 9999px; background: var(--plate-2); color: var(--body); box-shadow: none; }
.tag.yellow { background: var(--ochre-soft); color: var(--ochre-ink); box-shadow: none; }
.note { border: 0; padding: 14px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--lift); color: var(--body); }
.note.warn { background: var(--bad-bg); box-shadow: none; }
.error { border-radius: var(--r); }
.error.floating { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift-hi); }

/* ---------- home: the model leads */
.home-exhibit { margin-top: 8px; grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); column-gap: clamp(32px, 5vw, 72px); }
.he-intro { padding-top: clamp(12px, 4vh, 48px); }
.he-intro h1 { font-size: clamp(44px, 5vw, 74px); line-height: .98; letter-spacing: -.045em; margin-bottom: 20px; }
.he-intro .lead { font-size: 19px; color: var(--body); }
.he-start { margin: 6px 0 28px; }
.he-start .primary { min-height: 52px; padding: 0 24px; font-size: 17px; }
.he-start .ghost, .he-start .btn.ghost { min-height: 52px; }
.he-stage { background: var(--surface); border: 0; border-radius: 28px; box-shadow: var(--lift-hi); padding: clamp(20px, 2.4vw, 32px); }
.he-stage .he-viz, .stage .viz-box { border-top: 0; padding-top: 4px; margin-top: 6px; }
.he-from { font: 600 15px/1.35 var(--sans); color: var(--mute); }
.model-head h3 { font: 700 17px/1.3 var(--sans); letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.viz { font-family: var(--sans); }

/* the step guide: plain rows with a number dot; the current step is a white card */
.verbs { border-top: 0; display: grid; gap: 6px; }
.verb { border: 0; border-radius: 16px; background: transparent; padding: 10px 14px; box-shadow: none; }
.verb-head { font: 600 15px/1.25 var(--sans); letter-spacing: 0; text-transform: none; color: var(--mute); }
.verb-mark { border-radius: 50%; font-family: var(--sans); box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.verb.done .verb-head { color: var(--body); }
.verb.done .verb-mark { background: var(--ink); color: #fff; box-shadow: none; }
.verb.active { padding: 16px 18px 18px; background: var(--surface); box-shadow: var(--lift); }
.verb.active .verb-head { color: var(--ink); font-size: 16px; font-weight: 700; }
.verb.active .verb-mark { background: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-soft); }
.verb.active .verb-mark::after { content: none; }
.verb-body { margin-top: 10px; }
.verb-body .goal-text { display: inline-block; padding: 6px 12px; border-radius: 12px; background: var(--lemon); font: 700 19px/1.35 var(--sans); }
.he-verbs .verb.active .verb-mark { background: var(--green); color: #fff; }

/* the paper-to-lesson figure and the gallery: white cards that lift on hover */
.hall-art, .gal-plate { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); }
.hp-paper { background: var(--plate); border-radius: 14px; }
.hp-line.idea::after { background: var(--lemon); box-shadow: none; }
.hx-card { border-top: 0; }
.gal-plate { transition: box-shadow var(--ui), transform var(--ui); }
.gal-item:hover .gal-plate { background: var(--surface); transform: translateY(-3px); box-shadow: var(--lift-hi); }
.gal-bars li { background: color-mix(in srgb, var(--green) 30%, var(--plate-2)); }
.gal-title { font-weight: 700; }
/* a lesson taught without a model: its source's own words, set as a poster on an ultramarine ground */
.gal-plate.gal-quote-plate, .gal-item:hover .gal-plate.gal-quote-plate { padding: 0; align-items: stretch; background: var(--green-soft); }
.gal-quote { display: flex; flex-direction: column; width: 100%; margin: 0; padding: clamp(22px, 2.4vw, 32px); }
.gal-mark { display: block; height: .5em; margin: 0 0 10px -.04em; font: 800 clamp(80px, 7.5vw, 112px)/1 var(--sans); color: var(--green); letter-spacing: -.05em; }
.gal-quote blockquote { margin: 0; font: italic 700 clamp(17px, 1.5vw, 21px)/1.24 var(--sans); letter-spacing: -.02em; color: var(--ink); text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; overflow: hidden; }
.gal-quote.is-short blockquote { font-size: clamp(20px, 1.85vw, 25px); line-height: 1.18; letter-spacing: -.025em; }
.gal-quote figcaption { margin-top: auto; padding-top: 12px; border-top: 1.5px solid color-mix(in srgb, var(--green) 28%, transparent); font: 600 13px/1.4 var(--sans); color: var(--green-press);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.panel.yellow { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); padding: 22px 24px; }

/* search results and lists outside the lesson: grouped white cards */
.search-progress { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); }
.result-list, .recent-list, .library, .build-steps, .provider-choice, .setup-steps { border-top: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); padding: 4px 20px; }
.result:last-child, .recent-list li:last-child, .lib-item:last-child, .build-step:last-child, .provider-option:last-child, .setup-step:last-child { border-bottom: 0; }
.result { border-bottom-color: var(--rule); }
.result:has(.source-choice input:checked) { border-color: var(--rule); }
.result:has(.source-choice input:checked) .r-title { color: var(--green-press); }
.recent-item { border-radius: 12px; }
.provider-option:has(input:checked) { background: var(--green-soft); }

/* ---------- outline: one grouped list of concept rows */
.outline-list { border-top: 0; margin: 24px 0; padding: 6px 8px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); }
.outline-item { padding: 18px 14px; border-bottom: 1px solid var(--rule); }
.outline-item:last-child { border-bottom: 0; }
.outline-item::before { width: 32px; height: 32px; background: var(--green-soft); color: var(--green-press); font: 800 15px var(--sans); }
.outline-item.known::before { background: var(--plate-2); color: var(--mute); box-shadow: none; }
.oi-title strong { font: 700 19px/1.25 var(--sans); letter-spacing: -.01em; }
.oi-btns { gap: 4px; align-items: center; }
.oi-btns button.small { min-height: 36px; background: transparent; }
.oi-btns button.small:hover:not(:disabled) { background: var(--plate-2); }
.oi-btns button.small[aria-pressed="true"] { background: var(--ink); color: #fff; }
.oi-btns button.small:disabled { background: transparent; color: var(--rule-strong); }
.oi-btns button.danger:hover:not(:disabled) { background: var(--bad-bg); }
details.advanced { margin: 20px 0 0; padding: 4px 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); }
details.advanced[open] { padding-bottom: 16px; }
details.advanced + .note { margin-top: 12px; }
details.advanced h3 { font-size: 19px; margin-top: 16px; }
.removed { padding: 4px 20px 12px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); }
.removed h3 { font-size: 17px; margin: 14px 0 6px; }
.removed ul { margin: 0; padding-left: 18px; }
.removed li { padding: 4px 0; }

/* build progress */
.bp-bar, .search-bar { height: 8px; background: var(--plate-2); }
.bp-bar::-webkit-progress-bar, .search-bar::-webkit-progress-bar { background: var(--plate-2); }
.gal-meta, .ri-meta, .bs-time, .stat-label, .h-state { font-family: var(--sans); }

/* ---------- the lesson: a white top bar with segmented progress, notes left, the model card right */
.lesson-top { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--rule); }
.lesson-top > .icon-btn, .lesson-top .sound-btn { color: var(--body); background: transparent; }
.lesson-top > .icon-btn:hover:not(:disabled), .lesson-top .sound-btn:hover:not(:disabled) { background: var(--plate-2); }
.lt-mark { color: var(--ink); font-weight: 800; letter-spacing: -.035em; }
.lt-paper { color: var(--mute); }
.lt-paper .words { color: var(--ink); font-family: var(--sans); }
.lt-plates { gap: 6px; align-items: stretch; }
.lt-tab { justify-content: flex-start; padding: 10px 6px 18px; border-radius: 0; border: 0; background: transparent; color: var(--mute); font: 500 12.5px/1.25 var(--sans); }
.lt-tab::before { content: ""; position: absolute; left: 6px; right: 6px; bottom: 9px; height: 6px; border-radius: 9999px; background: var(--plate-2); opacity: 1; }
.lt-tab::after { display: none; }
.lt-tab b { font-family: var(--sans); font-weight: 600; color: var(--body); }
.lt-tab .lt-time { font-family: var(--sans); font-size: 12px; }
.lt-tab.cur { background: transparent; box-shadow: none; }
.lt-tab.cur b { color: var(--ink); font-weight: 700; }
.lt-tab.cur::before { background: var(--green); }
.lt-tab.done::before { background: color-mix(in srgb, var(--green) 45%, var(--surface)); }
.lt-tab.pending::before { background: var(--plate-2); }
.lt-tab:hover b { color: var(--ink); }
.floor { background: var(--paper); }
.rail { background: var(--paper); border-right: 0; padding-top: 28px; }
.rail-head { align-items: center; }
.rail-head .plate.big { background: var(--green); color: #fff; box-shadow: none; }
.rail-head h2 { font-weight: 800; letter-spacing: -.03em; }
.stage { background: var(--paper); border-left: 0; padding-top: 28px; padding-left: clamp(8px, 1.4vw, 24px); }
.stage-inner { max-width: 1000px; }
.stage .model-panel, .title-stage, .stage-inner > .quote, .stage-inner > .equation, .stage-inner > .statement, .stage-inner > .explanation { background: var(--surface); border-radius: 26px; box-shadow: var(--lift-hi); padding: clamp(20px, 2.4vw, 32px); }
.stage-inner > * + * { margin-top: 16px; }
.title-stage { max-width: none; }
.title-stage .idea { font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.statement { background: var(--surface); padding: clamp(20px, 2.4vw, 32px); }
.equation { background: var(--surface); }
.term { box-shadow: inset 0 -4px 0 var(--k); border-radius: 4px; }

/* readouts: soft tiles; the one being talked about turns lemon */
.outputs { border-top: 0; padding-top: 0; gap: 10px; margin-top: 18px; }
.out, .out:first-child { padding: 12px 14px 14px; border-left: 0; border-radius: 16px; background: var(--plate); }
.out dt { font: 500 13.5px/1.3 var(--sans); letter-spacing: 0; text-transform: none; color: var(--mute); }
.out dd { margin-top: 8px; font: 800 27px/1 var(--sans); letter-spacing: -.03em; }
.out.hl { background: var(--ochre-soft); box-shadow: inset 0 0 0 2px var(--lemon); }

/* sliders: a thick rounded track filled in the series ink, a big white knob */
.controls { margin-top: 12px; }
.ctl { border-radius: 16px; padding: 12px 14px; margin: 0 -14px; }
.ctl.hl { background: var(--ochre-soft); }
.ctl-value { font-weight: 800; font-size: 18px; }
.ctl .play { background: var(--plate-2); border-radius: 9999px; }
.ctl input[type=range] { height: 36px; }
.ctl input[type=range]::-webkit-slider-runnable-track { height: 10px; background: linear-gradient(to right, var(--k, var(--green)) var(--fill, 50%), var(--plate-2) var(--fill, 50%)); }
.ctl input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -9px; border: 0; background: #fff; box-shadow: 0 0 0 3px var(--k, var(--green)), 0 3px 10px rgba(17, 19, 24, .22); }
.ctl input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.06); }
.ctl input[type=range]:active::-webkit-slider-thumb { transform: scale(1.14); }
.ctl input[type=range]::-moz-range-track { height: 10px; background: var(--plate-2); }
.ctl input[type=range]::-moz-range-progress { height: 10px; }
.ctl input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; background: #fff; box-shadow: 0 0 0 3px var(--k, var(--green)), 0 3px 10px rgba(17, 19, 24, .22); }
.ctl[data-pin]::before, .out[data-pin]::before { box-shadow: 0 0 0 3px var(--surface); }
.viz .mark-pin circle { stroke: var(--surface); }
.viz .point-label, .viz .edge-label { stroke: var(--surface); }
.viz-table td { background: var(--plate); border-radius: 10px; }
.trail-btn { border-radius: 9999px; }
.trail-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
kbd { background: var(--surface); border-radius: 6px; }

/* numbered notes: the current line is lemon-marked */
.tour-script { gap: 4px; }
.tour-script li { padding: 8px 10px 8px 42px; border-radius: 12px; transition: background-color .25s, color .25s; }
.tour-script li::before { left: 10px; top: 9px; font-family: var(--sans); }
.tour-script li.said::before { background: var(--ink); }
.tour-script li.now { background: var(--ochre-soft); color: var(--ink); }
.tour-script li.now::before { background: var(--green); box-shadow: none; }

/* options in checks: big tappable cards */
.option { border: 0; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule), 0 1px 2px rgba(17, 19, 24, .04); }
.option:hover { box-shadow: inset 0 0 0 1.5px var(--rule-strong), 0 4px 12px rgba(17, 19, 24, .06); }
.option:has(input:checked), .option.chosen { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); }
.options.reveal .option.is-answer { background: var(--good-bg); box-shadow: inset 0 0 0 2px var(--good); }
.order-item { border: 0; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--rule); }

/* the action bar: a white sheet; right and wrong tint it */
.action-bar { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--rule); box-shadow: 0 -8px 30px rgba(17, 19, 24, .06); }
.action-bar.good { background: var(--good-bg); border-top-color: transparent; }
.action-bar.bad { background: var(--bad-bg); border-top-color: transparent; }
.bar-buttons button { min-height: 52px; border-radius: 14px; }
.bar-buttons .ghost { background: transparent; }

/* overview pages: the paper in brief, intro and finish */
.lesson-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.overview h1, .brief h1 { font-weight: 800; letter-spacing: -.04em; }
.hall ol { border-top: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); padding: 4px 18px; }
.hall li:last-child { border-bottom: 0; }
.brief-bar { height: 6px; border-radius: 9999px; }
.brief-steps .done .brief-bar { background: color-mix(in srgb, var(--green) 45%, var(--surface)); }
.brief .quote, .brief-intro, .aha { border: 0; padding: 20px 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); }
.terms { border: 0; }
.stats { border: 0; gap: 12px; }
.stat, .stat + .stat { border: 0; padding: 18px 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--lift); }

/* small screens */
@media (max-width: 900px) {
  .rail { padding: 18px 16px 12px; }
  .stage { padding: 4px 12px calc(var(--bar-h) + 24px); }
  .stage .model-panel, .title-stage, .stage-inner > .quote, .stage-inner > .equation, .stage-inner > .statement { border-radius: 22px; padding: 16px; }
  .lt-tab { padding: 10px 2px 18px; }
  .lt-tab::before { left: 3px; right: 3px; }
}
@media (max-width: 560px) {
  .site-head { gap: 4px 10px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 9px; font-size: 14px; }
  .site-nav a[href="#/make"] { margin-left: 4px; }
  .he-intro h1 { font-size: 44px; }
  .he-stage { border-radius: 22px; padding: 14px; }
  .outline-list { padding: 4px; }
  .outline-item { padding: 16px 10px; }
  .oi-btns { flex-wrap: nowrap; }
  .oi-btns button.small { padding: 0 9px; }
  .outputs { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .out, .out:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
  .out dd { margin: 0; font-size: 21px; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .primary:hover:not(:disabled), .gal-item:hover .gal-plate { transform: none; } }
