/* OncoVision viewer. Tokens, base, layout, components. See ../DESIGN.md.
   Strictly greyscale: no hue anywhere. Meaning is carried by solidity, line pattern, shape and weight.
   Light and dark follow the OS; the theme button overrides it. Every colour token is a light-dark()
   pair, so a region that sets `color-scheme: dark` (the imaging console, the footer) gets the dark
   values in both themes without a second token block. */

:root {
  color-scheme: light dark;

  --bg: light-dark(#ffffff, #0b0b0b);
  --surface: light-dark(#ffffff, #0b0b0b);
  --surface-2: light-dark(#f4f4f4, #171717);
  --line: light-dark(#e2e2e2, #2b2b2b);
  --line-strong: light-dark(#8c8c8c, #707070);
  --text: light-dark(#0a0a0a, #f4f4f4);
  --text-2: light-dark(#3a3a3a, #c6c6c6);
  --text-3: light-dark(#6e6e6e, #8e8e8e);
  --wash: light-dark(rgba(0, 0, 0, 0.045), rgba(255, 255, 255, 0.07));

  /* names the scripts refer to; all of them resolve to ink or a grey */
  --accent: var(--text);
  --accent-ink: var(--bg);
  --accent-soft: var(--wash);
  --teal: var(--text);
  --measured: var(--text);
  --warn: var(--text-3);
  --bad: var(--text);
  --good: var(--text);

  /* scenario curves: grey level + dash pattern + marker shape (see js/format.js) */
  --s-none: var(--text);
  --s-rec: var(--text-3);
  --s-tmz: var(--text-3);
  --s-ttf: var(--text-2);
  --s-bev: var(--text-2);

  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-1: 2px;
  --pad: clamp(16px, 3.4vw, 56px);
  --gap: clamp(20px, 2.4vw, 40px);
  --gutter: var(--pad);
  --maxw: 1560px;
  --mast: 92px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--mast) + 20px); }
@media (min-width: 1800px) { html { font-size: 112.5%; } }
@media (min-width: 2400px) { html { font-size: 131.25%; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 0.9375rem/1.6 var(--font-ui);
  font-feature-settings: "tnum" 1, "ss01" 1;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--text); color: var(--bg); }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.012em; line-height: 1.02; text-wrap: balance; }
h3 { font-size: 0.95rem; font-weight: 550; letter-spacing: -0.005em; }
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
strong, b { font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 12px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }
.note { color: var(--text-3); font-size: 0.8rem; line-height: 1.5; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* small caps label: the one label style, used for panel headings and section eyebrows */
.eyebrow, .panel-h, .ro-block h3, .chart-head h3, .slot h3, .slot-ds h3 {
  font: 500 0.68rem/1.4 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.panel-h .tag, .ro-block h3 .tag, .chart-head h3 .tag, .slot h3 .tag, .slot-ds h3 .tag { letter-spacing: 0.08em; }
.panel-h-unit { letter-spacing: 0.02em; text-transform: none; color: var(--text-3); font-family: var(--font-mono); }
.eyebrow .idx { font-family: var(--font-mono); letter-spacing: 0.04em; color: var(--text); }

/* ---------- masthead: top bar + notice line, sticky together ---------- */
.mast { position: sticky; top: 0; z-index: 50; background: var(--bg); }
.top {
  display: flex; align-items: center; gap: 6px 28px; flex-wrap: wrap;
  padding: 10px max(var(--pad), calc((100% - var(--maxw)) / 2 + var(--pad)));
  min-height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 400 1.5rem/1 var(--font-display); letter-spacing: -0.01em; }
.brand small { font: 500 0.64rem/1.2 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); align-self: stretch; display: inline-flex; align-items: center; }
@media (max-width: 1699px) { .brand small { display: none; } }
.top nav { display: flex; gap: 22px; }
.top nav a { color: var(--text-2); text-decoration: none; padding: 6px 0; font-size: 0.84rem; white-space: nowrap; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .25s ease, color .15s; }
.top nav a:hover { color: var(--text); background-size: 100% 1px; }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.chip { font: 500 0.66rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 9px; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.chip.is-fixture { border-style: dashed; }
.case-chip { font: 400 0.72rem/1.3 var(--font-mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.case-chip b { color: var(--text); font-weight: 500; }
@media (max-width: 1499px) { .case-chip { display: none; } }

/* on-this-device strip: only rendered when /api/health answers */
.device { display: flex; align-items: center; gap: 0; min-width: 0; font: 400 0.7rem/1.3 var(--font-mono); color: var(--text-3); border: 1px solid var(--line); overflow: hidden; }
.device > span { padding: 5px 10px; white-space: nowrap; border-left: 1px solid var(--line); }
.device > span:first-child { border-left: 0; background: var(--text); color: var(--bg); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 7px; }
.device > span:first-child::before { content: ""; width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.device b { color: var(--text); font-weight: 500; }
/* keep the top bar on one line: the trailing segments drop first */
@media (min-width: 1000px) and (max-width: 1799px) { .device > span:nth-child(n+5) { display: none; } }
@media (min-width: 1000px) and (max-width: 1699px) { .device > span:nth-child(n+4) { display: none; } }
@media (min-width: 1000px) and (max-width: 1559px) { .device > span:nth-child(n+3) { display: none; } }
@media (min-width: 1000px) and (max-width: 1099px) { .device > span:nth-child(n+2) { display: none; } }

.honesty { background: var(--text); color: var(--bg); }
.honesty p { margin: 0; padding: 7px max(var(--pad), calc((100% - var(--maxw)) / 2 + var(--pad))); font-size: 0.78rem; line-height: 1.45; }
.honesty strong { font-weight: 550; }
.honesty .long, .honesty .short { opacity: .68; }
.honesty a { margin-left: 6px; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); white-space: nowrap; }
.honesty a:focus-visible { outline-color: var(--bg); }
.honesty .short { display: none; }
@media (max-width: 900px) { .honesty .long { display: none; } .honesty .short { display: inline; } }

/* ---------- buttons and form controls ---------- */
.btn {
  font: 500 0.8rem/1.2 var(--font-ui); color: var(--text);
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--r-1); padding: 6px 14px; min-height: 34px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost { border-color: transparent; padding: 6px; min-width: 34px; color: var(--text-2); display: inline-grid; place-items: center; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0; }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn-cta { background: var(--text); color: var(--bg); border-color: var(--text); min-height: 46px; padding: 8px 16px; display: inline-flex; align-items: center; gap: 12px; font-size: 0.86rem; }
.btn-cta:hover { background: transparent; color: var(--text); }
select, input[type="search"] {
  font: inherit; font-size: 0.84rem; color: var(--text);
  background-color: transparent; border: 1px solid var(--line-strong); border-radius: var(--r-1);
  padding: 6px 10px; min-height: 34px; max-width: 100%;
}
select {
  -webkit-appearance: none; appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
select option { background: var(--bg); color: var(--text); }
select:hover, input[type="search"]:hover { border-color: var(--text); }
input[type="search"] { width: 100%; border-width: 0 0 1px; border-radius: 0; padding: 8px 0; }
input[type="search"]::placeholder { color: var(--text-3); }
label { font-size: 0.8rem; color: var(--text-2); }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--text); width: 15px; height: 15px; margin: 0; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; height: 24px; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 7px; height: 17px; margin-top: -8px; background: var(--text); border: 0; border-radius: 0; }
input[type="range"]::-moz-range-thumb { width: 7px; height: 17px; background: var(--text); border: 0; border-radius: 0; }
input[type="range"]:disabled { opacity: .4; cursor: default; }

/* ---------- layout ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad) clamp(56px, 8vw, 112px); }
.panel { min-width: 0; }

.hero { padding: clamp(24px, 3.4vw, 48px) 0 clamp(20px, 2.4vw, 32px); display: grid; gap: 18px var(--gap); grid-template-columns: minmax(0, 1fr); align-items: end; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 4.3rem); line-height: 1; max-width: 26ch; }
.hero h1 em { font-style: italic; }
@media (min-width: 760px) { .hero h1 em { display: block; } }
.hero-side { display: grid; gap: 12px; justify-items: start; padding-bottom: 6px; }
.lede { color: var(--text-2); font-size: 1.02rem; line-height: 1.55; max-width: 52ch; }
.lede strong { color: var(--text); font-weight: 550; }
.lede.narrow { max-width: 62ch; }
.key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--text); margin-top: clamp(6px, 1.4vw, 20px); font-size: 0.82rem; color: var(--text-3); }
.key div { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 16px 12px 0; }
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero .eyebrow, .key { grid-column: 1 / -1; }
  .key { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .key div + div { padding-left: 16px; border-left: 1px solid var(--line); }
}

.ws { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.center { display: grid; gap: var(--gap); min-width: 0; }
.rail { display: contents; }
.steps { order: 1; }
.picker { order: 2; }
.slot-ds { order: 2; }
.center { order: 3; }
.params { order: 4; }
.readout { order: 5; }
.slot { order: 6; }
@media (min-width: 1000px) {
  .ws { grid-template-columns: minmax(0, 1fr) 340px; }
  .rail { display: grid; gap: calc(var(--gap) * 0.9); min-width: 0; grid-column: 2; grid-row: 1; align-content: start; }
  .center { grid-column: 1; grid-row: 1; }
}
@media (min-width: 1280px) { .ws { grid-template-columns: minmax(0, 1fr) 392px; } }

/* a panel is a ruled block, not a card: one ink rule above, nothing around it */
.ws .panel:not(.stage-panel) { border-top: 1px solid var(--text); padding-top: 14px; }

/* sections after the workspace: label in the margin, content beside it */
.band { padding-top: clamp(72px, 9vw, 136px); display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0; }
.band > * { min-width: 0; }
.band > .eyebrow { padding-top: 12px; border-top: 1px solid var(--text); margin-bottom: 18px; }
.band > h2 { font-size: clamp(2.1rem, 4.4vw, 4rem); margin: 0 0 22px; max-width: 20ch; }
@media (min-width: 1200px) {
  .band { grid-template-columns: 250px minmax(0, 1fr); column-gap: var(--gap); }
  .band > * { grid-column: 2; }
  .band > .eyebrow { grid-column: 1 / -1; grid-row: 1; margin-bottom: 0; align-self: start; display: block; max-width: none; }
  .band > .eyebrow .idx { display: inline-block; width: 2.4em; }
  .band > h2 { grid-row: 1; padding-top: 44px; }
}
/* the evidence band sits on a full-bleed tint so the page has a rhythm: paper, console, paper, tint, paper */
.band.evidence { background: var(--surface-2); box-shadow: 0 0 0 100vmax var(--surface-2); clip-path: inset(0 -100vmax); margin-top: clamp(72px, 9vw, 136px); padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(56px, 7vw, 104px); }
.band.evidence + .band { padding-top: clamp(56px, 7vw, 104px); }

/* ---------- tags: text plus shape plus solidity, never tone alone ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 0.62rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 7px 4px 6px; border: 1px solid var(--text); color: var(--text); white-space: nowrap; vertical-align: 1px; }
.tag::before { content: ""; width: 7px; height: 7px; flex: none; }
.tag-measured { background: var(--text); color: var(--bg); }
.tag-measured::before { background: currentColor; border-radius: 50%; }
.tag-illustrative { border-style: dashed; }
.tag-illustrative::before { border: 1.4px solid currentColor; transform: rotate(45deg) scale(0.82); }
.tag-fixture { color: var(--text-2); border-color: var(--line-strong); background: repeating-linear-gradient(135deg, transparent 0 4px, var(--wash) 4px 6px); }
.tag-fixture::before { background: repeating-linear-gradient(135deg, currentColor 0 1.5px, transparent 1.5px 3px); border: 1px solid currentColor; }
.tag-ai { border-color: var(--line-strong); }
.tag-ai::before { border: 1.4px solid currentColor; }

/* ---------- guided steps ---------- */
.steps { display: grid; gap: 14px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.steps li { counter-increment: step; border-bottom: 1px solid var(--line); }
.steps li button {
  width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; align-items: baseline; text-align: left;
  font: inherit; font-size: 0.9rem; color: var(--text-2); background: transparent; border: 0; padding: 9px 0; cursor: pointer; transition: color .15s, padding-left .2s ease;
}
.steps li button::before { content: counter(step, decimal-leading-zero); font: 400 0.72rem/1 var(--font-mono); color: var(--text-3); }
.steps li button:hover { color: var(--text); padding-left: 6px; }
.steps li.is-current button { color: var(--text); font-weight: 550; padding-left: 10px; box-shadow: inset 2px 0 var(--text); }
.steps li.is-current button::before { color: var(--text); }
.steps li.is-done button::before { content: "\2713"; color: var(--text); font-size: 0.8rem; }
.steps .btn-cta { justify-content: space-between; flex-direction: row-reverse; }

.tour-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; width: min(780px, calc(100vw - 2 * var(--pad))); background: var(--text); color: var(--bg); padding: 14px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: center; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
.tour-bar .eyebrow { color: inherit; opacity: .6; margin-bottom: 2px; }
.tour-bar p { font-size: 0.96rem; line-height: 1.4; }
.tour-bar .tour-btns { display: flex; gap: 6px; }
.tour-bar .btn { color: inherit; border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
.tour-bar .btn:hover { background: var(--bg); color: var(--text); border-color: var(--bg); }
.tour-bar .btn:focus-visible { outline-color: var(--bg); }
.tour-bar .tour-prog { grid-column: 1 / -1; height: 1px; background: color-mix(in srgb, var(--bg) 28%, transparent); }
.tour-bar .tour-prog span { display: block; height: 3px; margin-top: -1px; width: 0; background: var(--bg); transition: width .3s ease; }
.tour-focus { outline: 1px solid var(--text); outline-offset: 8px; }

/* ---------- picker ---------- */
.picker > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: baseline; padding-bottom: 12px; }
.picker > summary::-webkit-details-marker { display: none; }
.picker > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1px solid var(--text); border-bottom: 1px solid var(--text); transform: translateY(-3px) rotate(45deg); transition: transform .2s; align-self: center; }
.picker[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.picker-sum-label { font: 500 0.68rem/1.4 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
#picker-title { font-size: 0.9rem; font-weight: 500; }
.picker-body { display: grid; gap: 10px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters label:not(.check) { display: grid; gap: 4px; min-width: 0; }
.filters select { width: 100%; min-width: 0; }
.filters .check { grid-column: span 1; font-size: 0.78rem; }
.more-filters > summary, .ro-details > summary, .stage-more > summary, .cite > summary { cursor: pointer; }
.more-filters > summary { font-size: 0.8rem; color: var(--text-2); }
.more-filters[open] > summary { margin-bottom: 10px; }
.plist { position: relative; height: min(calc(var(--n, 6) * 52px + 1px), clamp(160px, 26vh, 300px)); overflow: auto; border-top: 1px solid var(--line); overscroll-behavior: contain; scrollbar-width: thin; }
.plist-inner { position: relative; width: 100%; }
.prow { position: absolute; left: 0; right: 0; height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 8px; align-items: center; padding: 0 10px; border-bottom: 1px solid var(--line); cursor: pointer; background: transparent; transition: background-color .12s; }
.prow:hover { background: var(--surface-2); }
/* the selected row is inverted; the row-local tokens keep its text and sparkline readable */
.prow[aria-selected="true"] { background: var(--text); color: var(--bg); --text-2: var(--bg); --text-3: color-mix(in srgb, var(--bg) 66%, transparent); --warn: color-mix(in srgb, var(--bg) 66%, transparent); }
.prow.is-active-desc { outline: 2px solid var(--text); outline-offset: -2px; }
.prow[aria-selected="true"].is-active-desc { outline-color: var(--line-strong); }
.prow .pid { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pmeta { font-size: 0.72rem; color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow svg { display: block; }
.plist-count { font: 400 0.7rem/1.4 var(--font-mono); color: var(--text-3); }
.plist:focus-visible { outline-offset: 0; }
.status-mark { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border: 1.2px solid currentColor; vertical-align: 1px; }
.st-ok .status-mark { border-radius: 50%; background: currentColor; }
.st-shrinking .status-mark { transform: rotate(45deg); }
.st-bad .status-mark { border-radius: 0; background: repeating-linear-gradient(45deg, currentColor 0 1.5px, transparent 1.5px 3px); }

/* segmented choice (dataset switch) */
.segc { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); }
.segc button { font: inherit; font-size: 0.8rem; padding: 6px 12px; min-height: 34px; background: transparent; color: var(--text-2); border: 0; border-left: 1px solid var(--line-strong); cursor: pointer; }
.segc button:first-child { border-left: 0; }
.segc button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.slot, .slot-ds { display: grid; gap: 10px; }
.ws .slot.is-preview { border-top-style: dashed; }
.drop { border: 1px dashed var(--line-strong); padding: 22px 14px; text-align: center; color: var(--text-2); font-size: 0.85rem; }
.drop.is-over { border-color: var(--text); background: var(--wash); }
.drivers { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 0.82rem; }
.drivers li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: center; }
.drivers .bar-track { height: 3px; background: var(--line); overflow: hidden; }
.drivers .bar-track span { display: block; height: 100%; background: var(--text); }

/* ---------- imaging console: dark in both themes ---------- */
.stage-panel { color-scheme: dark; overflow: hidden; background: #000; color: var(--text); border: 1px solid var(--line); }
.stage-head { display: flex; justify-content: space-between; gap: 8px 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stage-title { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.stage-title .mono { font-size: 0.74rem; letter-spacing: 0.04em; color: var(--text-3); }
.stage-scen { font: 400 1.5rem/1.1 var(--font-display); letter-spacing: -0.005em; color: var(--text); }
.stage-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-cmp { display: inline-flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 0.78rem; }
.stage-cmp select { max-width: 200px; }
.stage {
  position: relative; height: clamp(320px, 52vh, 780px); width: 100%;
  background: radial-gradient(ellipse at 50% 46%, #0f0f0f 0%, #000 72%);
  overflow: hidden; touch-action: none; cursor: grab;
}
.stage:active { cursor: grabbing; }
.stage:focus-visible { outline-offset: -3px; }
.gl, .gl canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* registration marks in two opposite corners */
.stage::before, .stage::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--text); opacity: .55; pointer-events: none; z-index: 2; }
.stage::before { left: 12px; top: 12px; border-right: 0; border-bottom: 0; }
.stage::after { right: 12px; bottom: 12px; border-left: 0; border-top: 0; }
.gizmo { position: absolute; right: 16px; top: 16px; width: 64px; height: 64px; pointer-events: none; z-index: 2; }
.gizmo text { font: 500 9px var(--font-mono); fill: var(--text-3); }
.legend-row { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 8px 24px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: start; }
.legend-ramp { height: 8px; border: 1px solid var(--line); background: linear-gradient(90deg, #262626, #6e6e6e 35%, #bdbdbd 62%, #ffffff); }
.legend-ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.gl-note { padding: 10px 16px; font-size: 0.82rem; color: var(--text); border-top: 1px solid var(--line); }
.legend-note, .scalebar { font-size: 11.5px; line-height: 1.45; color: var(--text-3); }
.scalebar { margin-top: 2px; font-size: 10.5px; }
.slice-inset { position: absolute; right: 16px; bottom: 16px; width: 132px; z-index: 2; background: rgba(0, 0, 0, 0.82); border: 1px solid var(--line-strong); padding: 4px; }
.slice-inset canvas { width: 100%; height: auto; display: block; image-rendering: auto; background: #000; }
.slice-inset span { display: block; font-size: 10px; color: var(--text-3); margin-top: 4px; }
.slice-inset.is-main { right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, 62%, 46vh); }
.stage.no-gl { cursor: default; }
.split-labels { position: absolute; left: 0; right: 0; top: 14px; display: flex; z-index: 2; pointer-events: none; }
.split-labels span { flex: 1; text-align: center; font: 400 1.05rem/1.2 var(--font-display); padding: 0 8px; text-shadow: 0 1px 8px #000; }
.split-labels::after { content: ""; position: absolute; left: 50%; top: -14px; bottom: -999px; width: 1px; background: var(--line); }
.stage-state { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 20px; background: rgba(0, 0, 0, .78); }
.stage-state[hidden] { display: none; }
.stage-state p { color: var(--text); max-width: 42ch; font-size: 0.9rem; }
.bar { width: min(240px, 70vw); height: 1px; background: var(--line-strong); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0%; background: var(--text); transition: width .2s; }
.stage-state .bar { height: 2px; }
.bar.indeterminate span { width: 40%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.orb { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--text); position: relative; }
.orb::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--text); }
.stage-state.is-error .orb { border-radius: 0; transform: rotate(45deg); }
.stage-state.is-error .orb::after { border-radius: 0; }

/* viewport overlays, in the manner of scan annotations: composition readout, scale bar, cut-plane position */
.hud { position: absolute; left: 22px; top: 46px; z-index: 2; pointer-events: none; min-width: 236px; max-width: min(270px, 60%); color: var(--text); text-shadow: 0 0 6px #000, 0 0 2px #000; }
.hud h4 { font: 500 0.6rem/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.hud h4 span:last-child { color: var(--text); }
.hud dl { display: grid; gap: 4px; }
.hud dl div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.72rem; }
.hud dt { color: var(--text-2); }
.hud dd { font: 500 0.74rem var(--font-mono); font-variant-numeric: tabular-nums; }
.hud i { width: 7px; height: 7px; display: block; }
.hud .d-a { background: var(--text); border-radius: 50%; }
.hud .d-b { background: var(--text-3); }
.hud .d-c { border: 1.2px solid var(--text-2); border-radius: 50%; }
.hud .d-d { border: 1.2px solid var(--text); transform: rotate(45deg) scale(.82); }
.viewbar { position: absolute; left: 22px; bottom: 20px; z-index: 2; pointer-events: none; display: grid; gap: 5px; font: 400 0.66rem/1.3 var(--font-mono); color: var(--text-3); text-shadow: 0 0 6px #000; }
.viewbar .sb { height: 5px; border: 1px solid var(--text); border-top: 0; min-width: 20px; }
.viewbar b { color: var(--text); font-weight: 500; }

/* ---------- transport and view options (part of the console) ---------- */
.transport { padding: 14px 16px 12px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.transport-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.time-readout { font: 300 1.7rem/1 var(--font-ui); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-width: 6.4ch; }
.speed { display: inline-flex; gap: 8px; align-items: center; color: var(--text-3); }
.jumps { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.t-range { height: 28px; }
.t-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--text) var(--p, 0%), var(--line-strong) var(--p, 0%)); }
.t-range::-moz-range-progress { height: 1px; background: var(--text); }
.t-phase { font-size: 0.8rem; color: var(--text-3); min-height: 1.5em; }
.stage-more { border-top: 1px solid var(--line); }
.stage-more > summary { padding: 11px 16px; font-size: 0.8rem; color: var(--text-3); transition: color .15s; }
.stage-more > summary:hover, .stage-more[open] > summary { color: var(--text); }
.stage-controls { display: grid; gap: 14px 28px; padding: 6px 16px 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.seg { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.seg > label:not(.check):not(.switch):not(.range) { display: grid; gap: 4px; }
.seg .range { display: grid; gap: 2px; min-width: 120px; flex: 1 1 130px; }
.switch { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--text); cursor: pointer; }
.axis { display: inline-flex; border: 1px solid var(--line-strong); }
.axis label { position: relative; }
.axis label + label { border-left: 1px solid var(--line-strong); }
.axis input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.axis span { display: block; padding: 7px 12px; font: 400 0.74rem/1.2 var(--font-mono); color: var(--text-2); }
.axis input:checked + span { background: var(--text); color: var(--bg); }
.axis input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- chart ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.chart { width: 100%; min-height: 280px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; user-select: none; }
.chart .ax { fill: var(--text-3); font: 10.5px var(--font-mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lab { font: 500 11px var(--font-ui); }
.chart .ph-hit { cursor: ew-resize; touch-action: none; }
.chart .ph:focus-visible .ph-handle { stroke: var(--line-strong); stroke-width: 3; }
.chart-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart .ph:focus-visible { outline: none; }
.chart-panel .note { margin: 8px 0 0; max-width: 86ch; }

/* ---------- readout ---------- */
.readout { display: grid; gap: 18px; align-content: start; }
.ro-block { display: grid; gap: 8px; }
.ro-day { display: flex; align-items: baseline; gap: 12px; }
.ro-day .mono { font: 300 3.6rem/0.95 var(--font-ui); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.ro-unit { font-size: 0.8rem; color: var(--text-3); }
.ro-phase { font-size: 0.84rem; color: var(--text-2); }
.ro-big { font: 300 2.3rem/1.05 var(--font-ui); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.ro-list { display: grid; gap: 0; }
.ro-list > div { display: flex; justify-content: space-between; gap: 14px; font-size: 0.84rem; border-top: 1px solid var(--line); padding: 7px 0; }
.ro-list dt { color: var(--text-3); }
.ro-list dd { text-align: right; font-variant-numeric: tabular-nums; }
/* a warning is an ink frame with a hatched edge; a notice is a plain rule */
.callout { position: relative; border: 1px solid var(--text); padding: 12px 14px 12px 24px; font-size: 0.84rem; line-height: 1.5; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: repeating-linear-gradient(135deg, var(--text) 0 1.5px, transparent 1.5px 5px); border-right: 1px solid var(--text); }
.callout.is-info { border-color: var(--line-strong); padding-left: 14px; }
.callout.is-info::before { content: none; }
.ro-details { border-top: 1px solid var(--line); padding-top: 10px; }
.ro-details > summary { font-size: 0.84rem; font-weight: 500; color: var(--text-2); }
.ro-details > summary:hover { color: var(--text); }
.ro-details[open] > summary { margin-bottom: 10px; }
.prose p + p { margin-top: 8px; }
.prose.small { font-size: 0.82rem; color: var(--text-2); }
.prose ul { padding-left: 18px; margin: 6px 0 0; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 24px 9px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { color: var(--text-3); font: 500 0.66rem/1.4 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; border-top: 0; border-bottom: 1px solid var(--text); vertical-align: bottom; }
table.data tbody tr:first-child th, table.data tbody tr:first-child td { border-top: 0; }
table.data th[scope="row"] { font-weight: 500; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data td.num { font-family: var(--font-mono); font-size: 0.8rem; }
.table-wrap { overflow-x: auto; max-width: 100%; }
#scen-table td, #scen-table th { padding: 8px 4px; }
#scen-table .scen-name { display: grid; grid-template-columns: auto auto auto 1fr; gap: 7px; align-items: center; }
#scen-table label { color: var(--text); font-size: 0.82rem; display: contents; }
#scen-table td { font-size: 0.82rem; }
#scen-table tr.is-active { background: var(--surface-2); box-shadow: inset 2px 0 var(--text); }
#scen-table tr.is-active td:first-child { padding-left: 10px; }
.swatch { width: 28px; height: 10px; display: inline-block; vertical-align: middle; }
.swatch svg { display: block; }

/* ---------- model parameters (read-only) and scenario effect ---------- */
.params { display: grid; gap: 12px; }
.params label.sel { display: grid; gap: 8px; }
.params label.sel select { width: 100%; }
.plist2 { display: grid; gap: 0; }
.plist2 > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.84rem; }
.plist2 dt { color: var(--text-2); }
.plist2 dd { font: 500 0.8rem/1.6 var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.plist2 dd small { font: 400 0.7rem var(--font-mono); color: var(--text-3); margin-left: 5px; }
.plist2 .src { grid-column: 1 / -1; font-size: 0.72rem; color: var(--text-3); }
.effect-panel { display: grid; gap: 12px; }
.effect { list-style: none; padding: 0; display: grid; gap: 0; }
.effect li { display: grid; grid-template-columns: minmax(120px, 15rem) minmax(60px, 1fr) 5.5rem; gap: 14px; align-items: center; font-size: 0.84rem; padding: 8px 0; border-top: 1px solid var(--line); }
.effect .track { height: 3px; background: var(--line); }
.effect .track span { display: block; height: 100%; background: var(--text); }
.effect .v { font: 500 0.8rem var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 700px) { .effect li { grid-template-columns: minmax(0, 1fr) 5.5rem; } .effect .track { grid-column: 1 / -1; order: 3; } }

/* ---------- checked explanation: bench, tally, sentence ledger ---------- */
.checked-intro { display: grid; gap: 8px; margin-bottom: clamp(24px, 3vw, 44px); }
.checked-intro .lede { max-width: 64ch; }
.expl { display: grid; gap: 22px; }
.expl-wide { margin: 0 0 clamp(32px, 4vw, 56px); padding-bottom: clamp(32px, 4vw, 56px); border-bottom: 1px solid var(--line-strong); }
.expl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.expl-head h3 { font: 400 1.7rem/1.1 var(--font-display); letter-spacing: -0.005em; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.expl-head .btn { margin-left: auto; }
.expl-how { color: var(--text-2); font-size: 0.9rem; max-width: 78ch; margin-top: -10px; }
.expl-text { font-size: 1rem; line-height: 1.6; max-width: 78ch; }
.expl > .note:empty { display: none; }

.bench { list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); counter-reset: bench; border-top: 1px solid var(--text); }
.bench li { counter-increment: bench; position: relative; padding: 16px 20px 18px 0; display: grid; gap: 4px; align-content: start; border-bottom: 1px solid var(--line); }
.bench li::before { content: counter(bench, decimal-leading-zero); font: 400 0.68rem/1 var(--font-mono); color: var(--text-3); margin-bottom: 8px; }
@media (min-width: 760px) {
  .bench { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
  .bench li { border-bottom: 0; padding-left: 20px; border-left: 1px solid var(--line); }
  .bench li:first-child { padding-left: 0; border-left: 0; }
}
.bench .role { font: 400 1.6rem/1.1 var(--font-display); }
.bench .does { color: var(--text-2); font-size: 0.86rem; max-width: 34ch; }
.bench .meta { font: 400 0.7rem/1.4 var(--font-mono); color: var(--text-3); margin-top: 8px; }
.bench li.is-judge { background: var(--text); color: var(--bg); padding-left: 20px; border-color: var(--text); }
.bench li.is-judge::before, .bench li.is-judge .does, .bench li.is-judge .meta { color: inherit; opacity: .7; }

.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tally div { background: var(--bg); padding: 14px 16px 16px; display: grid; gap: 4px; align-content: start; }
.tally dt { font-size: 0.76rem; line-height: 1.35; color: var(--text-3); order: 2; }
.tally dd { font: 400 3rem/1 var(--font-display); letter-spacing: -0.01em; }

.ledger { list-style: none; padding: 0; margin: 0; counter-reset: sent; border-top: 1px solid var(--text); }
.ledger > li { counter-increment: sent; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 4px 10px; padding: 16px 8px 16px 0; border-bottom: 1px solid var(--line); transition: background-color .3s; }
.ledger > li::before { content: counter(sent, decimal-leading-zero); font: 400 0.72rem/2.1 var(--font-mono); color: var(--text-3); }
.ledger .l-body { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ledger .l-body { grid-template-columns: minmax(0, 1fr) 14.5rem; column-gap: 28px; } .ledger .l-extra { grid-column: 1; } .ledger .stamp { justify-self: end; } }
.ledger .l-text { font-size: 1.04rem; line-height: 1.5; max-width: 68ch; }
.ledger > li.is-lit { background: var(--surface-2); box-shadow: inset 2px 0 var(--text); }
.ledger > li.is-lit::before { color: var(--text); padding-left: 10px; }
.stamp { justify-self: start; align-self: start; display: inline-flex; align-items: center; gap: 7px; font: 500 0.62rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 7px 4px 6px; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; margin-top: 4px; }
.stamp::before { content: ""; width: 7px; height: 7px; flex: none; }
.stamp-advocate::before { background: currentColor; border-radius: 50%; }
.stamp-revised { border-style: dashed; border-color: var(--text); color: var(--text); }
.stamp-revised::before { border: 1.4px solid currentColor; transform: rotate(45deg) scale(.82); }
.stamp-ledger { background: var(--text); border-color: var(--text); color: var(--bg); }
.stamp-ledger::before { background: currentColor; }
.stamp-fixed::before { background: repeating-linear-gradient(135deg, currentColor 0 1.5px, transparent 1.5px 3px); border: 1px solid currentColor; }
.cite > summary { font: 400 0.72rem/1.5 var(--font-mono); color: var(--text-3); }
.cite > summary:hover { color: var(--text); }
.cite ol { list-style: none; margin: 8px 0 0; padding: 10px 14px; background: var(--surface-2); border-left: 1px solid var(--text); display: grid; gap: 6px; font-size: 0.85rem; color: var(--text-2); }
.cite ol b { font: 500 0.72rem var(--font-mono); color: var(--text); margin-right: 8px; }
.objection { border: 1px solid var(--text); font-size: 0.86rem; margin-top: 10px; }
.objection p { padding: 9px 14px; display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: 10px; }
.objection p + p { border-top: 1px solid var(--line); }
.objection p:last-child { background: var(--surface-2); }
.objection b { font: 500 0.64rem/2.1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.objection .ruling { font-weight: 600; }
.dbt h5 { margin: 14px 0 4px; font-size: 0.85rem; font-weight: 550; }
.dbt ul { margin: 4px 0 8px; padding-left: 18px; font-size: 0.82rem; }
.dbt q { font-style: normal; color: var(--text-2); }
.dbt-claims ol { font-size: 0.8rem; padding-left: 20px; }
.dbt-claims > summary { cursor: pointer; font-size: 0.82rem; color: var(--text-2); }

/* ---------- evidence: a ruled grid of findings, hairlines instead of cards ---------- */
.evidence .lede.narrow { margin-bottom: clamp(24px, 3vw, 40px); }
.bento { display: grid; gap: 1px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); background: var(--line-strong); border: 1px solid var(--line-strong); }
@media (min-width: 900px) { .bento { grid-template-columns: repeat(6, 1fr); } .bcard { grid-column: span 2; } .b-wide, .b-hero { grid-column: span 4; } }
.bcard { background: var(--bg); padding: clamp(18px, 2.2vw, 32px); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bcard h3 { font: 500 0.92rem/1.35 var(--font-ui); letter-spacing: -0.005em; color: var(--text); }
.bcard p { color: var(--text-2); font-size: 0.88rem; max-width: 70ch; }
.b-big { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; }
.num-serif { font: 400 clamp(3rem, 5.2vw, 4.6rem)/0.95 var(--font-display); letter-spacing: -0.015em; color: var(--text); }
.b-hero .num-serif { font-size: clamp(3.6rem, 7.4vw, 6.6rem); }
.b-unit { font-size: 0.84rem; color: var(--text-3); }
.b-foot { margin-top: auto; padding-top: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz text { font: 10.5px var(--font-ui); fill: var(--text-3); }
.viz .v-strong { fill: var(--text); font-weight: 500; }
.viz .v-axis { stroke: var(--line-strong); }
.viz .v-chance { stroke: var(--text); stroke-dasharray: 2 3; }

/* ---------- model card: a document. Heading in the left column, body in the right ---------- */
.mc-grid { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.mc-grid section { border-top: 1px solid var(--line); padding: clamp(20px, 2.4vw, 32px) 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.mc-grid section:first-child { border-top-color: var(--text); }
@media (min-width: 900px) {
  .mc-grid section { grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr); column-gap: var(--gap); }
  .mc-grid section > * { grid-column: 2; }
  .mc-grid section > h3 { grid-column: 1; grid-row: 1 / span 12; align-self: start; }
  .mc-grid section { row-gap: 0; }
  .mc-grid section > * + * { margin-top: 12px; }
  .mc-grid section > h3 + * { margin-top: 0; }
}
.mc-grid p { color: var(--text-2); max-width: 74ch; }
.mc-grid h3 { font: 400 1.5rem/1.15 var(--font-display); letter-spacing: -0.005em; display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap; }
.mc-grid strong { color: var(--text); }
.bullets { margin: 0; padding: 0; list-style: none; color: var(--text-2); display: grid; gap: 0; max-width: 78ch; counter-reset: lim; }
.bullets li { counter-increment: lim; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); padding: 10px 0; border-top: 1px solid var(--line); }
.bullets li:first-child { border-top: 0; padding-top: 0; }
.bullets li::before { content: counter(lim, decimal-leading-zero); font: 400 0.72rem/2.1 var(--font-mono); color: var(--text-3); }

/* ---------- footer: dark in both themes ---------- */
.foot { color-scheme: dark; background: #000; color: var(--text-2); border-top: 1px solid var(--line); }
.foot-in { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px, 6vw, 88px) var(--pad) clamp(36px, 4vw, 56px); display: grid; gap: clamp(28px, 4vw, 56px); }
.foot-mark { font: 400 clamp(3rem, 9vw, 8rem)/0.9 var(--font-display); letter-spacing: -0.02em; color: var(--text); }
.foot-cols { display: grid; gap: 20px var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line-strong); padding-top: 18px; }
.foot-cols p { font-size: 0.82rem; line-height: 1.55; max-width: 44ch; }
.foot-h { display: block; font: 500 0.66rem/1.4 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.noscript { padding: 20px var(--pad); border-top: 1px solid var(--text); }

/* ---------- methodology dialog ---------- */
dialog.method { width: min(720px, calc(100vw - 2 * var(--pad))); max-height: min(86vh, 900px); padding: 0; border: 1px solid var(--text); border-radius: 0; background: var(--bg); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
dialog.method::backdrop { background: rgba(0, 0, 0, .62); }
.method-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--text); position: sticky; top: 0; background: var(--bg); }
.method-head h2 { font-size: 1.8rem; }
.method-body { padding: 22px 24px 26px; display: grid; gap: 12px; }
.method-body .panel-h { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.method-body .panel-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.method-body p, .method-body li { color: var(--text-2); font-size: 0.9rem; }
.method-body ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* ---------- small screens ---------- */
@media (max-width: 999px) {
  .top { gap: 6px 18px; }
  .top nav { order: 3; width: 100%; overflow-x: auto; gap: 18px; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .device { order: 4; width: 100%; overflow-x: auto; }
  .steps .btn-cta { width: 100%; }
}
@media (max-width: 700px) {
  /* the top bar scrolls away; only the notice line stays pinned */
  :root { --mast: 64px; }
  .mast { top: calc(-1 * var(--top-h, 0px)); }
  .honesty .short { display: none; }
  .legend-row { grid-template-columns: minmax(0, 1fr); }
  .chip { max-width: 40vw; }
  .top-end { width: 100%; margin-left: 0; gap: 10px; }
  .top-end .btn-ghost { margin-left: auto; }
  .mc-grid table.data { min-width: 540px; }
  .jumps .btn { white-space: normal; }
  .stage { height: min(92vw, 60vh); min-height: 300px; }
  .jumps { margin-left: 0; width: 100%; }
  .jumps .btn { flex: 1; padding-inline: 6px; }
  .slice-inset { width: 96px; bottom: auto; top: 60px; }
  .slice-inset.is-main { top: 50%; }
  .gizmo { width: 52px; height: 52px; }
  .hud { left: 16px; top: 34px; min-width: 0; }
  .hud dl div { font-size: 0.68rem; }
  .viewbar { left: 16px; }
  .ledger > li { grid-template-columns: 1.9rem minmax(0, 1fr); }
  .objection p { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tour-bar { grid-template-columns: minmax(0, 1fr); bottom: 8px; }
  .bench li.is-judge { padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bar.indeterminate span { width: 100%; opacity: .5; }
}
@media print {
  .mast, .stage-more, .transport, .steps, .tour-bar, dialog.method, .chart-actions { display: none; }
  .band.evidence { box-shadow: none; clip-path: none; }
}
