/* Ouija board styles (ouija-board design.md, Revision 2026-12-03, J-a). System fonts only;
   no downloads. Every colour, size step, space, radius and shadow is a token in the one
   :root block below; no colour literal appears anywhere else in this file. Contrast of each
   text token on both section bands and on the card surface is computed by
   tests/test_ui_style.py: text at least 4.5:1, chart lines and the focus ring at least 3:1.
   Over 400 lines on purpose: one stylesheet, so the token test can see every colour use in
   one file and the page needs one request; each section's rules are grouped under a comment. */

:root {
  /* Colour: identity = near-black purple, warm gold; purple = what the grader paid,
     teal = really right, red = paid for a wrong answer. */
  --bg: #15111c;
  --bg-alt: #1d1727;
  --surface: #261e32;
  --surface-2: #31273f;
  --line: #463a56;
  --text: #f2eadb;
  --muted: #cbbfa9;
  --accent: #ffd866;
  --accent-ink: #15111c;
  --paid: #b9a2ff;
  --right: #5fd8b0;
  --wrong: #ff8a80;
  --amber: #f5be5f;
  --ref: #b8b8c6;
  --alarm-band: rgb(255 138 128 / 16%);
  --mark-bg: #ff8a80;
  --mark-ink: #15111c;
  --wood-dark: #24170d;
  --wood-mid: #3b2716;
  --wood-light: #4c331d;
  --wood-edge: #a77f4a;
  --wood-groove: #120b05;
  --glyph: #f6ead0;
  --planchette: rgb(246 234 208 / 82%);
  --scrim: rgb(10 7 14 / 92%);

  /* Type scale: five steps. */
  --fs-1: 0.875rem;
  --fs-2: 1rem;
  --fs-3: 1.25rem;
  --fs-4: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
  --fs-5: clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem);
  --lh: 1.55;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --serif: Georgia, "Times New Roman", serif;

  /* Spacing scale and the content column. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;
  --max: 1100px;
  --bar-h: 56px;

  /* Radii, shadows, focus ring. */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-2: 0 10px 30px rgb(0 0 0 / 45%);
  --focus-ring: 3px solid var(--accent);
  --focus-offset: 2px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--fs-2)/var(--lh) var(--font);
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 { line-height: 1.2; }
h1 { font-size: var(--fs-5); margin: 0 0 var(--sp-4); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-4); margin: 0 0 var(--sp-4); }
h3 { font-size: var(--fs-3); margin: var(--sp-5) 0 var(--sp-2); }
h4 { font-size: var(--fs-2); margin: 0 0 var(--sp-2); }
p { margin: 0 0 var(--sp-3); }
a { color: var(--accent); }
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--sp-4); top: var(--sp-2); background: var(--surface); padding: var(--sp-2) var(--sp-3); z-index: 10; }

/* Bands: full-bleed sections in two alternating shades, content in one 1100 px column. */
header#headline, main > section, footer {
  padding: var(--sp-7) max(var(--sp-4), calc((100% - var(--max)) / 2));
}
header#headline { background: var(--bg-alt); }
main > section:nth-of-type(odd) { background: var(--bg); }
main > section:nth-of-type(even) { background: var(--bg-alt); }
main > section { scroll-margin-top: var(--bar-h); }
footer { background: var(--bg); border-top: 1px solid var(--line); }

/* Sticky top bar (J3): name, anchors, GitHub. Under 720 px the anchors fold behind the
   Sections button and open as a panel under the bar while aria-expanded is "true". */
.topbar {
  position: sticky; top: 0; z-index: 5; background: var(--scrim);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-1);
  padding: 0 max(var(--sp-4), calc((100% - var(--max)) / 2));
}
.topbar-inner { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--bar-h); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: 0.02em; white-space: nowrap; }
.nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; gap: var(--sp-4); margin: 0; padding: 0; }
.nav-list a { color: var(--muted); text-decoration: none; font-size: var(--fs-1); white-space: nowrap; }
.nav-list a:hover { color: var(--text); text-decoration: underline; }
.nav-toggle { display: none; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-1); }
.gh {
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--fs-1);
  padding: var(--sp-1) var(--sp-3); border-radius: var(--r-pill); text-decoration: none; white-space: nowrap;
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-list {
    display: none; position: absolute; top: var(--bar-h); left: 0; right: 0;
    flex-direction: column; gap: var(--sp-1); background: var(--bg-alt);
    padding: var(--sp-2) var(--sp-4) var(--sp-4); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2);
  }
  .nav-list a { display: block; padding: var(--sp-2) 0; font-size: var(--fs-2); }
  .nav-toggle[aria-expanded="true"] + .nav-list { display: flex; }
}

/* Hero (J4-J7): two big numbers, one line, three cards, the grader line. */
.hero h1 { max-width: 20ch; }
.hero-numbers { display: flex; flex-wrap: wrap; gap: var(--sp-5) var(--sp-7); margin: var(--sp-5) 0 var(--sp-3); }
.hero-number { margin: 0; display: flex; flex-direction: column; }
.hero-label { font-size: var(--fs-3); color: var(--muted); font-weight: 600; }
.hero-value { font-size: var(--fs-5); font-weight: 800; line-height: 1.05; }
.n-said .hero-value { color: var(--paid); }
.n-right .hero-value { color: var(--right); }
.hero-honest { font-size: var(--fs-3); margin-bottom: var(--sp-1); }
.q-title { margin: var(--sp-7) 0 var(--sp-1); }
.q-true { color: var(--muted); margin-bottom: var(--sp-4); }
.q-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 900px) { .q-cards { grid-template-columns: minmax(0, 1fr); } }
.q-card {
  background: var(--surface); border-radius: var(--r-3); padding: var(--sp-4); box-shadow: var(--shadow-1);
  border-top: 4px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0;
}
.q-card.is-right { border-top-color: var(--right); }
.q-card.is-wrong { border-top-color: var(--wrong); }
.q-card h3 { margin: 0; }
.q-card p { margin: 0; }
.q-grader { color: var(--muted); font-size: var(--fs-1); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-block; padding: 1px var(--sp-3); border-radius: var(--r-pill);
  font-size: var(--fs-1); font-weight: 700; border: 2px solid currentColor;
}
.chip-right { color: var(--right); }
.chip-wrong { color: var(--wrong); }
.chip-paid { color: var(--paid); }
.chip-unpaid { color: var(--muted); }
.q-note { color: var(--wrong); font-weight: 600; }
.answer { background: var(--bg); border-radius: var(--r-2); padding: var(--sp-3); }
.raw { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--r-2); padding: var(--sp-3); }
.raw-toggle { align-self: flex-start; font-size: var(--fs-1); padding: var(--sp-1) var(--sp-3); }
.code-box { margin: var(--sp-5) 0 0; background: var(--surface); border-radius: var(--r-3); padding: var(--sp-4); box-shadow: var(--shadow-1); }
.code-box figcaption { font-weight: 600; margin-bottom: var(--sp-2); }
.code-box pre { background: var(--bg); border-radius: var(--r-2); padding: var(--sp-3); }
.code-box code { display: block; min-width: 0; }
.code-line { display: block; }
.ln { display: inline-block; min-width: 3ch; margin-right: var(--sp-2); color: var(--muted); user-select: none; }
.code-box mark { background: var(--accent); color: var(--accent-ink); border-radius: 2px; }
.grader-code .note { margin: var(--sp-2) 0 0; font-size: var(--fs-2); color: var(--text); font-weight: 600; }

/* How it works (J8): three columns with an arrow between them; stacked, arrows point down. */
.how-steps {
  list-style: none; padding: 0; margin: var(--sp-5) 0; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6);
}
.how-step {
  position: relative; background: var(--surface); border-radius: var(--r-3); padding: var(--sp-4);
  box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--sp-2);
}
.how-step p { margin: 0; }
.how-step:not(:last-child)::after {
  content: "→"; position: absolute; top: 50%; right: calc(-1 * var(--sp-6)); width: var(--sp-6);
  transform: translateY(-50%); text-align: center; color: var(--accent); font-size: var(--fs-4); font-weight: 700;
}
.how-when { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-1); }
.how-what { font-size: var(--fs-3); line-height: 1.35; }
.how-code {
  align-self: flex-start; font: var(--fs-1)/1.4 var(--mono); background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-1); padding: var(--sp-1) var(--sp-2);
}
.how-time { color: var(--muted); font-size: var(--fs-1); }
.how-defs { color: var(--muted); }
.how-defs strong { color: var(--text); }
@media (max-width: 760px) {
  .how-steps { grid-template-columns: minmax(0, 1fr); }
  .how-step:not(:last-child)::after {
    content: "↓"; top: auto; bottom: calc(-1 * var(--sp-6)); right: 0; left: 0; width: auto; transform: none;
  }
}

.kicker { color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin: 0; font-size: var(--fs-1); }
.big { font-size: var(--fs-4); font-weight: 700; margin: var(--sp-3) 0 var(--sp-1); }
.source, .note, .mini-title { color: var(--muted); font-size: var(--fs-1); }
.warning { border-left: 4px solid var(--amber); padding-left: var(--sp-3); }

/* Board (J10, J-c). Wood from gradients only: a diagonal grain gradient, a radial
   vignette and faint grain lines; a carved double border. Glyph sizes are SVG units: 42
   units are 14.4 CSS px on a 343 px phone board. */
.board-frame { border-radius: var(--r-3); box-shadow: var(--shadow-2); margin: var(--sp-3) 0 0; }
.board-frame:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
.board { width: 100%; height: auto; display: block; }
.wood-stop-light { stop-color: var(--wood-light); }
.wood-stop-mid { stop-color: var(--wood-mid); }
.wood-stop-dark { stop-color: var(--wood-dark); }
.vignette-stop-in { stop-color: var(--wood-groove); stop-opacity: 0; }
.vignette-stop-out { stop-color: var(--wood-groove); stop-opacity: 0.55; }
.board-bg { fill: url(#wood-grad); }
.board-vignette { fill: url(#vignette-grad); }
.grain { fill: none; stroke: var(--wood-groove); stroke-width: 1.5; opacity: 0.3; }
.board-edge { fill: none; stroke: var(--wood-edge); }
.board-edge.outer { stroke-width: 4; }
.board-edge.inner { stroke-width: 3; }
.board-edge.groove { stroke: var(--wood-groove); stroke-width: 3; opacity: 0.8; }
.ornament { fill: none; stroke: var(--wood-edge); stroke-width: 3; stroke-linecap: round; }
.glyph { fill: var(--glyph); font: 600 44px var(--serif); text-anchor: middle; dominant-baseline: central; }
.glyph.word { letter-spacing: 0.08em; }
/* Wordmark: the letter style, smaller (layout.js BOARD.wordmark: 26 units, 0.2em spacing). */
.glyph.wordmark { font-size: 26px; letter-spacing: 0.2em; opacity: 0.85; }
.glyph.lit { fill: var(--accent); }
/* The lit copy sits above the cream planchette, so it gets a dark outline to stay readable. */
#lit .glyph {
  fill: var(--accent); pointer-events: none;
  stroke: var(--wood-groove); stroke-width: 7px; stroke-linejoin: round; paint-order: stroke;
}
.glyph.glow { animation: glow 900ms ease-out; }
@keyframes glow {
  from { filter: drop-shadow(0 0 12px var(--accent)); }
  to { filter: drop-shadow(0 0 0 transparent); }
}
.planchette { transition: transform 500ms ease-in-out; }
.planchette.snap { transition: none; }
/* The body has a window cut out (fill-rule evenodd in index.html); the lens is only a ring,
   and the lit glyph is redrawn above the planchette, so the pointed-at letter stays visible. */
.planchette .body { fill: var(--planchette); stroke: var(--accent); stroke-width: 2.5; }
.planchette .lens { fill: none; stroke: var(--accent); stroke-width: 3; }

/* Control bar under the board, then the message strip (J10). */
.control-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border-radius: var(--r-3); box-shadow: var(--shadow-1);
}
.control-bar input[type="range"] { flex: 1 1 200px; min-width: 0; accent-color: var(--accent); }
.play-btn { min-width: 6.5em; font-weight: 700; border-color: var(--accent); }
.speeds { display: flex; gap: var(--sp-1); }
.speeds button { min-width: 3em; padding: var(--sp-1) var(--sp-2); }
.scrub-label { color: var(--muted); font-size: var(--fs-1); }
.control-bar .readout { flex: 1 1 100%; margin: 0; min-height: 1.5em; color: var(--text); font-variant-numeric: tabular-nums; }
.strip {
  margin-top: var(--sp-3); padding: var(--sp-4) var(--sp-5); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-3);
}
.strip p { margin: 0; }
.strip-label { color: var(--muted); min-height: 1.5em; }
.strip-word {
  font: 700 var(--fs-4)/1.25 var(--serif); color: var(--accent);
  display: flex; flex-wrap: wrap; column-gap: 1.2em; min-height: 1.25em; margin: var(--sp-1) 0;
}
.strip-word span { white-space: pre; }
.scrub { flex: 1 1 220px; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.strip-end { font-size: var(--fs-3); font-weight: 700; min-height: 1.4em; }
.run-detail { margin-top: var(--sp-5); }

/* Run picker (J11): three large featured choices, then the others behind one button. */
.picker { margin: var(--sp-2) 0 var(--sp-3); }
.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 720px) { .featured { grid-template-columns: minmax(0, 1fr); } }
.featured button {
  text-align: left; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-3);
  display: flex; flex-direction: column; gap: 2px; min-height: 5.5em;
}
.featured .run-title { font-size: var(--fs-3); font-weight: 700; line-height: 1.25; }
.run-sub { color: var(--muted); font-size: var(--fs-1); }
.runs button { display: flex; flex-direction: column; text-align: left; }
.more-runs { margin-top: var(--sp-3); font-size: var(--fs-1); }
h3 .run-id { display: inline; margin-left: var(--sp-2); font-weight: 400; }

/* Chart chips (J12): toggles with the line's own swatch. */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.chip-toggle {
  border-radius: var(--r-pill); font-size: var(--fs-1); padding: var(--sp-1) var(--sp-3);
  display: inline-flex; align-items: center; color: var(--muted);
}
.chip-toggle[aria-pressed="true"] { color: var(--text); }
.chip-toggle[aria-pressed="false"] .key { opacity: 0.35; }

/* Controls */
.runs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
button, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); cursor: pointer;
}
button:hover { background: var(--surface-2); }
button[aria-current="true"], button[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-2); }

/* Timeline */
.chart { width: 100%; height: auto; display: block; background: var(--surface); border-radius: var(--r-2); }
.chart.mini { margin-bottom: var(--sp-3); }
.grid { stroke: var(--line); stroke-width: 1; }
/* The chart viewBox matches its rendered width (timeline.js), so these are real pixels. */
.axis, .flag-label { fill: var(--muted); font-size: 13px; }
.axis-title { fill: var(--text); font-size: 13px; font-weight: 600; }
.flag-label { fill: var(--accent); font-weight: 700; stroke: var(--surface); stroke-width: 5px; paint-order: stroke; }
.tick { stroke: var(--muted); stroke-width: 1; }
.band { fill: var(--alarm-band); }
/* Grader reward and truth bold; the other lines thin and lighter (Revision 2026-11-28, P7). */
.line { fill: none; stroke-width: 1.5; stroke-linecap: round; opacity: 0.6; }
.line.s-reward, .line.s-truth { stroke-width: 3.4; opacity: 1; }
.s-reward { stroke: var(--paid); }
.s-truth { stroke: var(--right); stroke-dasharray: 9 4; }
.s-paid { stroke: var(--wrong); stroke-dasharray: 3 3; }
.s-false { stroke: var(--amber); stroke-dasharray: 1 4; }
.line.s-false { stroke-width: 2; }
.s-ref { stroke: var(--ref); stroke-dasharray: 6 6; }
.dot { fill: var(--bg); stroke: var(--right); stroke-width: 2.5; }
.flag { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 2 3; }
.playhead { stroke: var(--text); stroke-width: 1.5; }

.legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-1); }
.key { display: inline-block; width: 28px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: var(--sp-2); }
.key.s-reward { border-color: var(--paid); }
.key.s-truth { border-color: var(--right); border-top-style: dashed; }
.key.s-paid { border-color: var(--wrong); border-top-style: dashed; }
.key.s-false { border-color: var(--amber); border-top-style: dotted; }
.key.s-ref { border-color: var(--ref); border-top-style: dashed; }
.key.s-reward, .key.s-truth { border-top-width: 4px; }
.key.s-paid, .key.s-false, .key.s-ref { border-top-width: 2px; opacity: 0.6; }
.key.dot-key { width: 12px; height: 12px; border: 2.5px solid var(--right); border-radius: 50%; }
.key.band-key { height: 12px; border: 0; background: var(--alarm-band); }

/* Evidence (J14): one composed line, the rendered answer, the raw-text button. */
.evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 900px) { .evidence { grid-template-columns: minmax(0, 1fr); } }
.evidence .example { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: var(--sp-4); border-radius: var(--r-3); }
.example-line { font-size: var(--fs-2); margin: 0; line-height: 1.4; }
.evidence .note { margin: 0; }

/* Exorcism (J14): four numbered steps in a row with arrows, then the two charts. */
.exo-steps {
  list-style: none; counter-reset: exo; padding: 0; margin: var(--sp-4) 0 var(--sp-5);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-6);
}
.exo-step {
  counter-increment: exo; position: relative; background: var(--surface); border-radius: var(--r-3);
  padding: var(--sp-4); box-shadow: var(--shadow-1);
}
.exo-step p { margin: 0; }
.exo-step::before {
  content: counter(exo); display: inline-grid; place-items: center; width: 2em; height: 2em;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: var(--sp-2);
}
.exo-step:not(:last-child)::after {
  content: "→"; position: absolute; top: 50%; right: calc(-1 * var(--sp-6)); width: var(--sp-6);
  transform: translateY(-50%); text-align: center; color: var(--accent); font-size: var(--fs-4); font-weight: 700;
}
.exo-title { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: var(--fs-1); }
.exo-text { font-size: var(--fs-3); line-height: 1.35; margin: var(--sp-1) 0 !important; }
.exo-source { font-size: var(--fs-1); }
.s-retrain .exo-text { color: var(--right); font-weight: 700; }
@media (max-width: 900px) {
  .exo-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exo-step:not(:last-child)::after { content: none; }
}
@media (max-width: 479.98px) { .exo-steps { grid-template-columns: minmax(0, 1fr); } }
.exo-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-4); }
@media (max-width: 900px) { .exo-charts { grid-template-columns: minmax(0, 1fr); } }
.exo-chart { margin: 0; }
.exo-chart figcaption { margin-bottom: var(--sp-2); }
.exo-caption { display: block; color: var(--text); }

/* Séance (J13): the three example graders as cards with ghost tables, then the benchmark. */
.seance-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin: var(--sp-4) 0 var(--sp-6); }
@media (max-width: 1000px) { .seance-story { grid-template-columns: minmax(0, 1fr); } }
.seance-card {
  background: var(--surface); border-radius: var(--r-3); padding: var(--sp-4); box-shadow: var(--shadow-1);
  border-top: 4px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0;
}
.seance-card.is-right { border-top-color: var(--right); }
.seance-card.is-wrong { border-top-color: var(--wrong); }
.seance-card p { margin: 0; }
.seance-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.seance-head h3 { margin: 0; font-family: var(--mono); font-size: var(--fs-3); }
.seance-role { color: var(--muted); font-style: italic; }
.seance-summary { font-weight: 700; }
.ghost-table { width: 100%; border-collapse: collapse; font-size: var(--fs-1); }
.ghost-table th { text-align: left; color: var(--muted); font-weight: 600; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--line); }

.ghost-table td { padding: var(--sp-2); vertical-align: top; border-bottom: 1px solid var(--line); }
.ghost-text { background: var(--bg); border-radius: var(--r-1); padding: var(--sp-1) var(--sp-2); margin-bottom: var(--sp-1); }
.ghost-table .chip { white-space: nowrap; }
.ghost-fam { display: block; margin-bottom: var(--sp-1); border: 0; padding: 0; color: var(--text); font-weight: 600; }
.ghost-table td:not(:first-child), .ghost-table th:not(:first-child) { width: 1%; }
.seance-run { margin-top: auto !important; overflow-wrap: anywhere; }
.bench-title { margin-top: var(--sp-5); }
.bench-list {
  list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-4);
}
@media (max-width: 760px) { .bench-list { grid-template-columns: minmax(0, 1fr); } }
.bench-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
  background: var(--surface); border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3);
}
.bench-fams { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.fam {
  font: var(--fs-1)/1.4 var(--mono); padding: 0 var(--sp-2); border-radius: var(--r-pill);
  border: 1px solid var(--wrong); color: var(--wrong);
}
.fam-none { border-color: var(--right); color: var(--right); }
.bench-id { color: var(--muted); font-size: var(--fs-1); white-space: nowrap; }

/* Medium (J15): a phone-shaped frame beside one line and the link. */
.medium-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-6); }
.phone {
  margin: 0; width: min(280px, 100%); aspect-ratio: 1 / 2; padding: var(--sp-3) var(--sp-2);
  background: var(--bg); border: 3px solid var(--line); border-radius: 36px; box-shadow: var(--shadow-2);
  overflow: hidden; flex: 0 0 auto;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 26px; display: block; }
.medium-text { flex: 1 1 320px; max-width: 60ch; }
.medium-line { font-size: var(--fs-3); }
.medium-text .gh { display: inline-block; font-size: var(--fs-2); padding: var(--sp-2) var(--sp-4); }

/* Use it (J15): code boxes with a Copy button each. */
.use-boxes { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.use-box { margin: 0; min-width: 0; }
.use-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.use-box pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-btn { font-size: var(--fs-1); padding: var(--sp-1) var(--sp-3); }

/* Footer: links, then the one sentence. */
.footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-bottom: var(--sp-3); }
.footer-links a { font-weight: 600; }

/* Panels */
.example, .ghost, .rule { background: var(--surface); border-radius: var(--r-2); padding: var(--sp-3); margin: 0 0 var(--sp-3); box-shadow: var(--shadow-1); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: var(--fs-1)/1.45 var(--mono); }
mark { background: var(--mark-bg); color: var(--mark-ink); padding: 0 2px; }
.caption { margin: 0 0 var(--sp-2); }
/* Header and results (Revision 2026-11-28, P2, P3) */
.intro { font-size: var(--fs-3); margin: var(--sp-4) 0 var(--sp-3); }
.parts { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-2); }
.parts li { background: var(--surface); border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); }
.parts strong { display: block; color: var(--accent); }
.code-link { font-weight: 600; }
/* Results (J9): six tiles in full rows, 3 x 2 on desktop, 2 x 3 on a tablet, one column
   under 480 px. Big values, one short label each. */
.results { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
@media (max-width: 900px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479.98px) {
  .results { grid-template-columns: minmax(0, 1fr); }
}
.result {
  background: var(--surface); border-radius: var(--r-3); padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-1); border-left: 4px solid var(--accent);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.result-value { display: block; font-size: var(--fs-4); font-weight: 800; line-height: 1.05; white-space: nowrap; }
.result-label { display: block; color: var(--muted); font-size: var(--fs-2); line-height: 1.35; }
.run-id { display: block; color: var(--muted); font-size: var(--fs-1); }
footer { color: var(--muted); font-size: var(--fs-1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
