/* FF free-riding project page: shell styles (tokens, base, layout, shared components, static sections).
   The design tokens below are the contract of SPEC_FINAL.md section 3. Component files
   (assets/css/comp_<name>.css) scope their rules under #viz-<name> and use only these custom properties
   and the shared classes of section 12, never raw colors. No web fonts, no external resources. */

/* ---------------------------------------------------------------- 1. Tokens */
:root {
  color-scheme: light;
  --font-sans: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", "Liberation Sans", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;

  /* surfaces */
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --tint: #eaf0f6;
  --hero-top: #e6edf5;
  /* text */
  --ink: #344854;
  --ink-strong: #1f2e3a;
  --muted: #5a6b78;
  --accent: #2e4a6b;
  --accent-strong: #22395a;
  --on-accent: #ffffff;
  --bar: #2e4a6b;             /* poster navy: result bars, verdict bar, MEASURED badge (both themes) */
  --on-bar: #ffffff;
  --illus: #4f5f6d;           /* italic illustration readouts */
  --hist-text: #a84a00;       /* the only colored text: "history" labels */
  /* lines */
  --line: rgba(46, 74, 107, .16);
  --line-strong: rgba(46, 74, 107, .34);
  --focus: #2e4a6b;
  /* chart furniture */
  --grid: #e4eaf1;
  --axis: #8592a0;
  --tick: #5a6b78;
  --band: #e9eff6;
  --band-edge: #7d90a4;
  /* data marks (never text) */
  --arm-cum: #d55e00;
  --arm-free: #0072b2;
  --arm-gated: #009e73;
  --arm-mgc: #aa3377;
  --arm-neutral: #6b7785;
  --own: #44546a;             /* own goodness (poster ownSlate) */
  --hist: #d55e00;            /* inherited history outline/marks (= cumulative) */
  --hist-fill: #fbe1cf;       /* inherited history fill (poster histFill) */
  --toy: #8796a5;             /* toy-number marks */

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .05), 0 18px 40px -26px rgba(16, 24, 40, .30);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --w-page: 1200px;
  --w-text: 680px;
  --gutter: 16px;
  --section-gap: 56px;
  --topbar-h: 56px;

  --fs-xs: .8125rem;   /* 13 px: chart text, eyebrows */
  --fs-sm: .875rem;    /* 14 px: captions, source lines */
  --fs-body: 1.0625rem;
  --fs-lead: 1.125rem;
  --fs-h3: 1.25rem;
  --fs-h2: clamp(1.6rem, 1.15rem + 1.6vw, 2.25rem);
  --fs-topic: clamp(1.05rem, .92rem + .5vw, 1.375rem);
  --fs-verdict: clamp(1.9rem, 1.05rem + 3.1vw, 3.25rem);
  --fs-stat: clamp(1.15rem, 1rem + .45vw, 1.4rem);

  --dur: 160ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (min-width: 640px) { :root { --gutter: 24px; --fs-body: 1.125rem; --fs-lead: 1.1875rem; --section-gap: 72px; } }
@media (min-width: 960px) { :root { --gutter: 32px; --section-gap: 96px; } }

/* dark tokens: the same set, selected (not inverted); arm steps validated with the dataviz checks */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1621; --bg-alt: #111c29; --surface: #162231; --surface-2: #1a283a; --tint: #1c2b3d; --hero-top: #13202f;
    --ink: #dde5ed; --ink-strong: #f2f6fa; --muted: #a3b3c3; --accent: #9dbbe0; --accent-strong: #b9d0ec; --on-accent: #0e1621;
    --bar: #2e4a6b; --on-bar: #ffffff; --illus: #c2cfdb; --hist-text: #f2a36b;
    --line: rgba(157, 187, 224, .16); --line-strong: rgba(157, 187, 224, .34); --focus: #9dbbe0;
    --grid: #22344a; --axis: #6f8197; --tick: #a3b3c3; --band: #1f3046; --band-edge: #6a829d;
    --arm-cum: #df5d00; --arm-free: #069af4; --arm-gated: #089665; --arm-mgc: #d56ba8; --arm-neutral: #8d9aa8;
    --own: #a9b8c8; --hist: #df5d00; --hist-fill: #4a2c1a; --toy: #7d8fa3;
    --shadow-sm: none; --shadow-md: 0 0 0 1px rgba(157, 187, 224, .06);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1621; --bg-alt: #111c29; --surface: #162231; --surface-2: #1a283a; --tint: #1c2b3d; --hero-top: #13202f;
  --ink: #dde5ed; --ink-strong: #f2f6fa; --muted: #a3b3c3; --accent: #9dbbe0; --accent-strong: #b9d0ec; --on-accent: #0e1621;
  --bar: #2e4a6b; --on-bar: #ffffff; --illus: #c2cfdb; --hist-text: #f2a36b;
  --line: rgba(157, 187, 224, .16); --line-strong: rgba(157, 187, 224, .34); --focus: #9dbbe0;
  --grid: #22344a; --axis: #6f8197; --tick: #a3b3c3; --band: #1f3046; --band-edge: #6a829d;
  --arm-cum: #df5d00; --arm-free: #069af4; --arm-gated: #089665; --arm-mgc: #d56ba8; --arm-neutral: #8d9aa8;
  --own: #a9b8c8; --hist: #df5d00; --hist-fill: #4a2c1a; --toy: #7d8fa3;
  --shadow-sm: none; --shadow-md: 0 0 0 1px rgba(157, 187, 224, .06);
}

/* ---------------------------------------------------------------- 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--fs-body); line-height: 1.6;
  font-kerning: normal; overflow-wrap: break-word;
}
h1, h2, h3, h4 { color: var(--ink-strong); line-height: 1.2; margin: 0; text-wrap: balance; }
p, ul, ol, dl { margin: 0 0 var(--s-4); }
figure { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
strong, b { color: var(--ink-strong); font-weight: 700; }
code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
sub, sup { line-height: 0; }
q { quotes: "“" "”" "‘" "’"; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
/* focus scrolling honors html's scroll-padding-top (the sticky top bar plus 16 px), so a focused control never lands
   under the bar. Controls carry no scroll margin of their own: Firefox adds it to the scroll padding, and then a tap on
   a control within ~140 px of the top (or near the bottom edge) re-centered the page, pushing the chart below the
   control off screen. site.js brings a keyboard-focused element fully into view; chart marks are revealed by their
   components (both use this scroll padding). */
::selection { background: var(--tint); color: var(--ink-strong); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-4); top: -64px; z-index: 60; padding: var(--s-2) var(--s-4); background: var(--accent); color: var(--on-accent); border-radius: var(--r-sm); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: var(--s-3); color: var(--on-accent); }
.wrap { width: 100%; max-width: calc(var(--w-page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--w-text); }
.muted { color: var(--muted); }
.no-js .js-only, [hidden] { display: none !important; }
.noscript-band { padding-top: var(--s-4); background: var(--hero-top); }
.noscript-note { margin: 0; padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--ink-strong); }

/* ---------------------------------------------------------------- 3. Type helpers */
.eyebrow { display: block; margin: 0 0 var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow--accent { color: var(--accent); }
.lede { font-size: var(--fs-lead); }
.src { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); margin: var(--s-2) 0 0; }
.note { font-size: .9375rem; color: var(--muted); margin: var(--s-4) 0 0; }
.section__head { margin-bottom: var(--s-5); }
.section__head h2 { font-size: var(--fs-h2); }
.section__head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-5); }
.prose { max-width: var(--w-text); }
.prose > p:last-child { margin-bottom: 0; }
/* section intros: one column on phones and tablets, two balanced columns on wide screens */
.intro-grid { display: grid; gap: var(--s-5); margin-bottom: var(--s-2); }
.intro-grid > p { margin: 0; max-width: var(--w-text); }
.intro-grid > .resultbar { margin: 0; max-width: var(--w-text); }
@media (min-width: 1100px) {
  .intro-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
  /* #how: the history-rules paragraph follows the Key-idea card on phones (it needs γ), and fills the left column
     under the prose on wide screens, where the card spans both rows */
  .intro-grid--how { grid-template-rows: auto 1fr; row-gap: var(--s-5); }
  .intro-grid--how > .prose { grid-column: 1; grid-row: 1; }
  .intro-grid--how > .keyidea { grid-column: 2; grid-row: 1 / span 2; }
  .intro-grid--how > .intro-rules { grid-column: 1; grid-row: 2; }
  .intro-grid--result > .lede, .intro-grid--result > .prose { margin-top: var(--s-2); padding: 2px 0 2px var(--s-5); border-left: 3px solid var(--line-strong); }
}
.intro-rules { margin: 0; max-width: var(--w-text); }
.keyidea { padding: var(--s-5); background: var(--tint); border-radius: var(--r-lg); max-width: var(--w-text); }
.keyidea > p { font-size: 1rem; }
.keyidea > p:last-child { margin-bottom: 0; }
.keyidea__title { margin: 0 0 var(--s-3); font-size: var(--fs-h3); }
.keyidea .eq--card { margin: var(--s-3) 0 var(--s-4); }
@media (max-width: 639px) { .keyidea { padding: var(--s-4); } }
.eq-row { max-width: 900px; margin: var(--s-5) 0 0; }
.eq-row .eq { margin: 0; }
.prose__h3 { margin: var(--s-6) 0 var(--s-3); font-size: var(--fs-h3); }
.sub-h3 { margin: var(--s-7) 0 var(--s-4); font-size: var(--fs-h3); }

/* ---------------------------------------------------------------- 4. Top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar__row { position: relative; display: flex; align-items: center; gap: var(--s-3); min-height: var(--topbar-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-strong); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--accent); }
.brand__glyph { width: 26px; height: 26px; flex: none; }
.brand__glyph .own { fill: var(--accent); }
.brand__glyph .inh { fill: var(--line-strong); }
.toc { display: none; margin-left: auto; }
.toc ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.toc a:hover { color: var(--ink-strong); background: var(--tint); }
.toc a[aria-current="true"] { color: var(--accent); font-weight: 700; }
.topbar__actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.toc + .topbar__actions { margin-left: var(--s-2); }
.menu { position: static; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--ink-strong); font-size: .9375rem; font-weight: 600; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { width: 18px; height: 18px; }
.menu[open] > summary { background: var(--tint); }
.menu__panel { position: absolute; right: var(--gutter); top: calc(100% + 6px); width: min(320px, calc(100vw - 2 * var(--gutter))); max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; display: grid; padding: var(--s-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.menu__panel a { padding: 10px 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.menu__panel a:hover { background: var(--tint); color: var(--ink-strong); }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: transparent; color: var(--ink-strong); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn:hover { background: var(--tint); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress__bar { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }
/* the "Contents" label needs a 450 px viewport (brand, label, theme button and Paper inside the gutters); below that the
   menu is its icon (its name stays "Contents"), so 428-440 px phones (iPhone Plus / Pro Max) never scroll sideways */
@media (max-width: 449px) { .menu__label { display: none; } .menu > summary { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 359px) { .brand__name { display: none; } }
@media (min-width: 1120px) { .toc { display: block; } .menu { display: none; } }

/* ---------------------------------------------------------------- 5. Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-strong); font: 600 .9375rem/1 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { color: var(--ink-strong); background: var(--tint); border-color: var(--accent); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }
.btn--sm svg { width: 16px; height: 16px; }
.btn__meta { font-weight: 400; font-size: .8125rem; opacity: .78; }
.btn__meta::before { content: "· "; }

/* ---------------------------------------------------------------- 6. Hero */
.hero { background: linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 100%); padding: var(--s-5) 0 var(--s-7); }
.hero__grid { display: grid; gap: var(--s-6); align-items: start; }
/* the venue: a plain label in the eyebrow style (no outline or fill, so it does not read as a button or a switch) */
.venue { margin: 0 0 var(--s-3); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero__title { margin: 0 0 var(--s-4); }
.hero__topic { display: block; margin-bottom: var(--s-2); font-size: var(--fs-topic); font-weight: 600; line-height: 1.3; color: var(--accent); }
.hero__verdict { display: block; font-size: var(--fs-verdict); font-weight: 700; line-height: 1.06; letter-spacing: -.02em; color: var(--ink-strong); }
/* "Accuracy-Dominant" stays on one line where the column has room for it; the threshold is in rem, so a larger
   default font size (or a wider system font) on the narrowest phones falls back to normal wrapping, never overflow */
.hero__text { container-type: inline-size; min-width: 0; }
@container (max-width: 19rem) { .hero__verdict .nw { white-space: normal; } }
.byline { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 0 0 var(--s-5); font-size: 1.125rem; }
.byline__name { font-weight: 700; color: var(--ink-strong); }
.byline__aff { color: var(--muted); }
.links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 0 0 var(--s-5); padding: 0; max-width: 35rem; }
.links .btn { width: 100%; }
@media (min-width: 480px) { .links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 379px) { .btn__meta { display: none; } .links .btn { padding: 0 12px; } }
.links > li:first-child { grid-column: 1 / -1; }   /* the primary link on its own row: the other six fill 3 x 2 (2 x 3 on phones) */
/* the poster session (author-supplied; its date and times are [data-nocheck]): one compact box under the links,
   Paris time first; the jump link opens #visit (the official listing, the reader's own time zone, the calendar file).
   The link sits beside "Poster session · Paris Poster Hall" while the hero column has room for both (about 486 px
   with the default font; the threshold keeps a margin), and drops under the time otherwise. On phones the date and
   the time take a line each, and in the narrowest column the hall too, with their separators hidden, so no line ends
   in "·" and "(Paris time)" never sits alone (the thresholds keep a margin for wider system fonts). The box and the
   link grid are 35rem wide (560 px with the default font), so they grow with a larger default font size, as the
   rem thresholds do. */
.session { display: flex; align-items: flex-start; gap: 10px; max-width: 35rem; margin: calc(-1 * var(--s-2)) 0 var(--s-5); padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-size: .9375rem; line-height: 1.5; color: var(--ink); }
.session__icon { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--accent); }
.session__text { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; }
.session__what { grid-column: 1; grid-row: 1; }
.session__when { grid-column: 1 / -1; grid-row: 2; font-weight: 600; color: var(--ink-strong); }
.session__tz { font-weight: 400; color: var(--ink); }
.session .more { grid-column: 2; grid-row: 1; }
@container (max-width: 31.5rem) { .session .more { grid-column: 1 / -1; grid-row: 3; justify-self: start; } }
@container (max-width: 26rem) { .session__when > .nw:first-child { display: block; } .session__when .session__sep { display: none; } }
@container (max-width: 20rem) { .session__what > .nw { display: block; } .session__what .session__sep { display: none; } }

.tldr { padding-top: var(--s-4); border-top: 1px solid var(--line); }
.tldr__label { margin-bottom: var(--s-3); }
.steps { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-4); }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; position: relative; }
.step + .step::before { content: ""; position: absolute; left: 16px; top: calc(-1 * var(--s-4)); height: var(--s-4); width: 2px; background: var(--line-strong); }
.step__num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bar); color: var(--on-bar); font-size: .8125rem; font-weight: 700; letter-spacing: .02em; }
.step__claim { margin: 3px 0 2px; line-height: 1.5; }
.step__stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; }
.step__stat .more { margin-left: 2px; }
.stat__v { font-size: var(--fs-stat); font-weight: 700; color: var(--ink-strong); line-height: 1.25; white-space: nowrap; }
.stat__l { font-size: var(--fs-sm); color: var(--muted); }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); text-decoration: none; }
.more svg { width: 14px; height: 14px; }
.more:hover { text-decoration: underline; }
.scope-line { margin: var(--s-4) 0 0; font-size: var(--fs-sm); color: var(--muted); max-width: 620px; }
.tldr__jump { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: var(--s-3) 0 0; }
/* the testbed check under the TL;DR: the prior-FF calibration in one line (paper wording; the table is #calibration) */
.testbed { margin: var(--s-4) 0 0; padding: 10px 14px; background: var(--tint); border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: .9375rem; line-height: 1.55; color: var(--ink); }
.testbed strong { color: var(--ink-strong); }
.testbed .more { margin-left: 2px; }

@media (min-width: 960px) {
  .hero { padding: 40px 0 var(--s-8); }
  .hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: var(--s-7); }
}

/* ---------------------------------------------------------------- 7. Cards and the teaser */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.teaser { padding: var(--s-5); }
/* the central result plays itself in, automatically (no button), like a short clip: bars grow, then the paired CIs drop
   into the +-1 pp band, about 3.5 s in all, when the card first comes into view and again each time it comes back
   after leaving (site.js). The charts are complete without JavaScript or with reduced motion: the animation only ever
   starts from, and ends on, the finished state. */
@media (prefers-reduced-motion: no-preference) {
  .teaser.is-playing .tz-bar { transform-box: fill-box; transform-origin: 0 50%; animation: tz-grow .8s cubic-bezier(.2, .7, .2, 1) calc(.15s + var(--i, 0) * .32s) both; }
  .teaser.is-playing .tz-val, .teaser.is-playing .tz-note { animation: tz-fade .35s ease-out calc(.8s + var(--i, 0) * .32s) both; }
  .teaser.is-playing .tz-band, .teaser.is-playing .tz-band-edge { animation: tz-fade .6s ease-out 1.75s both; }
  .teaser.is-playing .tz-wh { animation: tz-fade .3s ease-out calc(2.05s + var(--i, 0) * .14s) both; }
  .teaser.is-playing .tz-ring { transform-box: fill-box; transform-origin: 50% 50%; animation: tz-drop .45s cubic-bezier(.2, .7, .3, 1.25) calc(2.05s + var(--i, 0) * .14s) both; }
}
@keyframes tz-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tz-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tz-drop { from { opacity: 0; transform: translateY(-16px) scale(.6); } to { opacity: 1; transform: none; } }
@media (max-width: 639px) { .teaser { padding: 14px; } }
.teaser__title { font-size: 1.3125rem; margin: 0 0 var(--s-4); }
.panel + .panel { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: var(--s-2); }
.panel__title { font-size: 1rem; }
.panel__note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; margin: 0 0 var(--s-2); padding: 0; font-size: var(--fs-sm); color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.glyph { width: .78em; height: .78em; flex: none; }
.glyph--cum { fill: var(--arm-cum); } .glyph--free { fill: var(--arm-free); } .glyph--gated { fill: var(--arm-gated); } .glyph--mgc { fill: var(--arm-mgc); }
.glyph--neutral { fill: none; color: var(--arm-neutral); }
.teaser__foot { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.teaser__foot .src { margin: 0 0 var(--s-2); }
.cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); text-decoration: none; }
.cta svg { width: 16px; height: 16px; }
.cta:hover { text-decoration: underline; }

/* static SVG charts (hero teaser): text sizes are in viewBox units */
.panel { container-type: inline-size; }
.tz-wrap { margin: 0; max-width: 560px; }
.tz { display: block; width: 100%; height: auto; overflow: visible; }
.tz--narrow { display: none; }
@container (max-width: 419px) { .tz--wide { display: none; } .tz--narrow { display: block; } }
/* chart text: viewBox units; the wide variant renders at >= 420 px (scale >= .95), the narrow at >= 260 px (>= .9) */
.tz text { font-family: var(--font-sans); fill: var(--ink); }
.tz-lbl { font-size: 13.5px; }
.tz-val { font-size: 13.5px; font-weight: 700; fill: var(--ink-strong); font-variant-numeric: tabular-nums; }
.tz-tick { font-size: 13px; fill: var(--tick); font-variant-numeric: tabular-nums; }
.tz-note { font-size: 13px; fill: var(--muted); }
.tz-xl { font-size: 13px; }
.tz-grp { font-size: 13px; fill: var(--muted); }
.tz--narrow .tz-lbl, .tz--narrow .tz-val { font-size: 14px; }
.tz--narrow .tz-tick, .tz--narrow .tz-note, .tz--narrow .tz-grp, .tz--narrow .tz-xl { font-size: 13.5px; }
.tz-axis { stroke: var(--axis); stroke-width: 1; }
.tz-grid { stroke: var(--grid); stroke-width: 1; }
.tz-zero { stroke: var(--axis); stroke-width: 1; }
.tz-band { fill: var(--band); }
.tz-band-edge { stroke: var(--band-edge); stroke-width: 1; }
.tz-m--cum { fill: var(--arm-cum); } .tz-m--free { fill: var(--arm-free); } .tz-m--gated { fill: var(--arm-gated); } .tz-m--mgc { fill: var(--arm-mgc); }
.tz-ring { stroke: var(--surface); stroke-width: 2; paint-order: stroke; }
.tz-wh { stroke-width: 2; stroke-linecap: round; }
.tz-wh--free { stroke: var(--arm-free); } .tz-wh--gated { stroke: var(--arm-gated); } .tz-wh--cum { stroke: var(--arm-cum); } .tz-wh--mgc { stroke: var(--arm-mgc); }

/* ---------------------------------------------------------------- 8. Read this first */
.readfirst { padding: var(--s-6) 0 0; }
.readfirst__title { margin-bottom: var(--s-3); }
.readfirst__grid { display: grid; gap: var(--s-5); padding: var(--s-5); background: var(--tint); border-radius: var(--r-lg); }
.readfirst__col h3 { display: flex; align-items: center; gap: 8px; font-size: 1.0625rem; margin-bottom: var(--s-3); }
.readfirst__col h3 svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.readfirst__col ul { margin: 0; padding-left: 1.1em; font-size: .9375rem; line-height: 1.55; }
.readfirst__col li + li { margin-top: var(--s-2); }
.readfirst__col .more { margin-top: var(--s-3); }
@media (min-width: 900px) { .readfirst__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); padding: var(--s-6); } }

/* disclosure blocks (plain words, glossary, theorem): native details with an icon and a chevron */
.plain, .glossary, .theorem { margin-top: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.plain > summary, .glossary > summary, .theorem > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px var(--s-4); font-weight: 700; color: var(--ink-strong); cursor: pointer; border-radius: var(--r-md); }
.plain > summary::-webkit-details-marker, .glossary > summary::-webkit-details-marker, .theorem > summary::-webkit-details-marker { display: none; }
.plain > summary:hover, .glossary > summary:hover, .theorem > summary:hover { background: var(--tint); }
.plain__icon { width: 20px; height: 20px; flex: none; color: var(--accent); }
.plain__chev { width: 18px; height: 18px; flex: none; margin-left: auto; color: var(--muted); transition: transform var(--dur) var(--ease); }
details[open] > summary > .plain__chev { transform: rotate(90deg); }
.plain__body { padding: 0 var(--s-5) var(--s-2) calc(var(--s-4) + 30px); font-size: 1rem; }
.glossary__list { margin: 0; padding: 0 var(--s-5) var(--s-4) calc(var(--s-4) + 30px); font-size: .9375rem; line-height: 1.55; }
.glossary__list > div { display: grid; gap: 2px var(--s-5); padding: 10px 0; border-top: 1px solid var(--line); }
.glossary__list dt { font-weight: 700; color: var(--ink-strong); }
.glossary__list dd { margin: 0; }
@media (min-width: 720px) { .glossary__list > div { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 639px) { .glossary__list { padding-left: var(--s-4); padding-right: var(--s-4); } }
@media (max-width: 639px) { .plain__body { padding-left: var(--s-4); padding-right: var(--s-4); } }

/* ---------------------------------------------------------------- 9. Explore map (four interactive figures) */
.explore { padding: var(--section-gap) 0 calc(var(--section-gap) * .75); }
.explore__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .explore__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .explore__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.xcard__link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; gap: 4px; height: 100%; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); text-decoration: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.xcard__link:hover { border-color: var(--accent); box-shadow: var(--shadow-md); color: var(--ink); text-decoration: none; transform: translateY(-2px); }
.xcard__glyph { width: 96px; height: 48px; margin-bottom: var(--s-2); }
.xcard__tag { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.xcard__title { font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
.xcard__text { margin-top: 2px; font-size: .9375rem; line-height: 1.5; color: var(--ink); }
@media (max-width: 639px) {
  .explore__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .xcard__link { padding: var(--s-3) 14px var(--s-4); }
  .xcard__glyph { width: 72px; height: 36px; margin-bottom: 2px; }
  .xcard__title { font-size: 1rem; }
  .xcard__text { display: none; }
}
.g-own { fill: var(--own); } .g-hist { fill: var(--hist-fill); stroke: var(--hist); stroke-width: 1.5; }
.g-seg { fill: var(--hist-fill); stroke: var(--hist); stroke-width: 1.5; }
.g-line { fill: none; stroke: var(--ink-strong); stroke-width: 2; stroke-linecap: round; }
.g-arc { fill: none; stroke: var(--hist); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-dot { fill: var(--accent); } .g-dot--hist { fill: var(--hist); }
.g-bar--cum { fill: var(--arm-cum); } .g-bar--gated { fill: var(--arm-gated); } .g-bar--free { fill: var(--arm-free); }
.g-band { fill: var(--band); stroke: var(--band-edge); stroke-width: 1; }
.g-wh { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }

/* ---------------------------------------------------------------- 10. Sections, result bars, callouts, quotes */
.sec { padding: var(--section-gap) 0; }
.sec--alt { background: var(--bg-alt); }
.resultbar { margin: 0 0 var(--s-5); border-radius: var(--r-md); overflow: hidden; background: var(--tint); }
.resultbar__head { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 16px; background: var(--bar); color: var(--on-bar); font-size: 1.0625rem; line-height: 1.35; }
.resultbar__head b { color: var(--on-bar); }
.resultbar__num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--on-bar); color: var(--bar); font-size: .8125rem; font-weight: 700; }
.resultbar__body { margin: 0; padding: 12px 16px 14px; }
.resultbars { display: grid; gap: var(--s-4); margin-bottom: var(--s-5); }
.resultbars .resultbar { margin: 0; }
@media (min-width: 1000px) { .resultbars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.verdictbar { margin: 0; padding: 12px 18px; border-radius: var(--r-md); background: var(--bar); color: var(--on-bar); font-size: 1.25rem; font-weight: 700; }

.callout { margin: var(--s-4) 0; padding: var(--s-4) var(--s-5); background: var(--tint); border-left: 3px solid var(--bar); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: .9375rem; line-height: 1.55; }
.callout > :last-child { margin-bottom: 0; }
.callouts { display: grid; gap: var(--s-4); margin: var(--s-6) 0 var(--s-5); }
@media (min-width: 900px) { .callouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .callouts .callout { margin: 0; } .callout--wide { grid-column: 1 / -1; } }
.callout--solo { margin-top: var(--s-6); }
/* #real: the two notes (a phone fold) and the theorem's scope note (always shown) read as one grid on wide screens */
.callouts--pair { margin-bottom: var(--s-4); }
.callouts--scope { margin-top: 0; }
@media (max-width: 639px) { .callouts--scope { margin-top: var(--s-4); } }
.arm { white-space: nowrap; }
.arm .glyph { margin-right: .3em; vertical-align: -.04em; }

.pullquote { margin: var(--s-7) 0 0; padding: 0 0 0 var(--s-5); border-left: 4px solid var(--hist); max-width: 860px; }
.pullquote blockquote { margin: 0; }
.pullquote p { margin: 0 0 var(--s-3); font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.45; font-weight: 600; color: var(--ink-strong); text-wrap: pretty; }
.pullquote figcaption { font-size: var(--fs-sm); color: var(--muted); }
.pullquote--close { border-left-color: var(--bar); }

/* theorem as stated (details) */
.theorem { margin-top: var(--s-6); }
.theorem__tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--bar); color: var(--on-bar); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.theorem__body { padding: var(--s-2) var(--s-5) var(--s-5); font-size: 1rem; line-height: 1.65; max-width: 860px; }
.theorem__body .eq { margin: var(--s-2) 0 var(--s-4); }
.theorem__lead { margin: var(--s-4) 0 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
@media (max-width: 639px) { .theorem__body { padding: var(--s-2) var(--s-4) var(--s-4); } }

/* verdict (takeaways) */
.verdict { max-width: 860px; }
.verdict .verdictbar { display: inline-block; font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem); padding: 12px 20px; }
.verdict__text { margin: var(--s-5) 0 0; }
.detective { margin: var(--s-6) 0 0; }
.detective picture { display: block; }
.detective img.detective__img { display: block; width: 100%; margin: 0; }
.evidence { display: none; }
@media (max-width: 600px) {
  .detective img.detective__img { max-width: 520px; }
  .evidence { display: block; margin: var(--s-4) 0 0; }
}
.evidence__head { margin: 0 0 var(--s-2); font-size: var(--fs-sm); font-style: italic; color: var(--ink); }
.evidence__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.evidence__item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s-3); padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.evidence__who { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.evidence__v { font-size: var(--fs-stat); font-weight: 700; line-height: 1.25; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.evidence__l { font-size: var(--fs-sm); line-height: 1.4; color: var(--ink); }
.detective figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px var(--s-5); margin: var(--s-2) 0 0; }
.detective__zoom { white-space: nowrap; }

/* scope */
.scope__grid { display: grid; gap: var(--s-4); }
@media (min-width: 720px) { .scope__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scope__card { padding: var(--s-5); }
.scope__card h3 { font-size: 1.0625rem; margin-bottom: var(--s-3); }
.scope__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .9375rem; }
.scope__list li { position: relative; padding-left: 20px; }
.scope__list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.scope__list--open li::before { background: transparent; border: 1.5px solid var(--accent); border-radius: 50%; }
.scope__prose { margin-top: var(--s-6); }

/* phone folds: details that read as plain blocks on wide screens (open, no summary) and collapse on phones */
.fold > summary { display: none; }
@media (max-width: 639px) {
  .fold { margin: var(--s-5) 0 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px var(--s-4); font-weight: 700; color: var(--ink-strong); cursor: pointer; border-radius: var(--r-md); }
  .fold > summary::-webkit-details-marker { display: none; }
  .fold > summary:hover { background: var(--tint); }
  .fold > summary .plain__chev { margin-left: auto; }
  .fold[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--r-md) var(--r-md) 0 0; }
  .fold__body { padding: var(--s-2) var(--s-4) var(--s-4); }
  .fold .callouts, .fold .callout--solo, .fold .scope__prose, .fold .tbl-wrap--holds { margin: 0; }
  .fold .tbl-wrap--holds { padding: 0; border: 0; background: none; }
  .fold .callouts { gap: var(--s-3); }
  .fold .fold__dup { display: none; }   /* the summary already says it */
}

/* ---------------------------------------------------------------- 11. FAQ, resources, cite, footer */
.faq__all { margin-bottom: 4px; }
.qa-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-3); }
.qa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.qa > summary { list-style: none; display: grid; grid-template-columns: 28px minmax(0, 1fr) 20px; gap: 2px 12px; align-items: start; min-height: 48px; padding: var(--s-4); cursor: pointer; border-radius: var(--r-md); }
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary:hover { background: var(--tint); }
.qa__badge { grid-row: 1 / span 2; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bar); color: var(--on-bar); font-size: .8125rem; font-weight: 700; }
.qa__q { font-weight: 700; color: var(--ink-strong); line-height: 1.4; padding-top: 2px; }
.qa__chev { grid-column: 3; grid-row: 1; width: 20px; height: 20px; margin-top: 4px; color: var(--muted); transition: transform var(--dur) var(--ease); }
.qa__preview { grid-column: 2; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.qa[open] .qa__preview { display: none; }
.qa[open] .qa__chev { transform: rotate(90deg); }
.qa[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.qa__a { padding: 0 var(--s-5) var(--s-4) calc(var(--s-4) + 40px); font-size: .9875rem; line-height: 1.65; }
.qa__a p { max-width: 760px; }
.qa__src { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 639px) { .qa__a { padding-left: var(--s-4); padding-right: var(--s-4); } }

.res-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.res { display: flex; flex-direction: column; padding: var(--s-5); }
.res p { font-size: .9375rem; line-height: 1.55; }
.res__title { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--s-2); font-size: 1.0625rem; }
.res__title svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.res__link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-weight: 700; font-size: .9375rem; text-decoration: none; overflow-wrap: anywhere; }
.res__link svg { width: 15px; height: 15px; flex: none; }
.res__link:hover { text-decoration: underline; }
.res__links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: auto; }
.res__links .res__link { margin-top: 0; }
.res__thumb { position: relative; display: block; aspect-ratio: 16 / 9; margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-4); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; background: var(--surface-2); }
.res__thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; transition: transform var(--dur) var(--ease); }
.res__thumb:hover img { transform: scale(1.015); }
.res__files { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; }
.res__files a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-weight: 700; font-size: .875rem; text-decoration: none; }
.res__files a:hover { background: var(--tint); }
.res__size { font-weight: 400; color: var(--muted); }
@media (min-width: 720px) and (max-width: 1039px) { .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .res:nth-child(3) { grid-column: 1 / -1; } }
@media (min-width: 1040px) { .res-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .res { grid-column: span 2; } .res--thumb { grid-column: span 3; } }
.res-extra { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin-top: var(--s-4); }
.res-extra > *, .res-grid > * { min-width: 0; }
@media (min-width: 960px) { .res-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pitch, .reproduce { padding: var(--s-5); }
.pitch p { margin: 0; font-size: 1rem; line-height: 1.65; }
.reproduce p { font-size: .9375rem; }
.reproduce .code { margin-bottom: 0; }
@media (max-width: 639px) { .res, .pitch, .reproduce, .scope__card { padding: var(--s-4); } .res__thumb { margin: calc(-1 * var(--s-4)) calc(-1 * var(--s-4)) var(--s-4); } }
/* "Visit the poster": Paris time, place and (with JavaScript) the reader's own time zone; the official listing as a note */
.visit { margin-top: var(--s-4); padding: var(--s-5); }
.visit__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-4) var(--s-6); margin: var(--s-4) 0; }
.visit__facts > div { min-width: 0; }
.visit__facts dt { margin: 0 0 4px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.visit__facts dd { margin: 0; font-weight: 700; line-height: 1.45; color: var(--ink-strong); }
.visit__line { display: block; }
.visit__sub { font-weight: 400; font-size: .9375rem; color: var(--ink); }
.visit__note { margin: 0 0 var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.visit__note strong { color: var(--ink-strong); }
.visit__cal { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: 0; }
.visit__hint { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 639px) { .visit { padding: var(--s-4); } }

/* code blocks with a copy button */
.code { position: relative; margin: var(--s-4) 0; }
.code pre { margin: 0; padding: var(--s-4) var(--s-5); overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); font-size: .8125rem; line-height: 1.6; color: var(--ink-strong); tab-size: 2; }
.code .code__copy { position: absolute; top: 8px; right: 8px; background: var(--surface); }
.code pre:has(~ .code__copy:not([hidden])) { padding-top: 52px; }
.code--bib pre { font-size: .875rem; }
/* long lines wrap instead of hiding off the edge (the Copy button copies the exact text); only a token longer than
   the line breaks. BibTeX keeps its lines whole (a citation key or URL broken in two reads as a typo) and scrolls
   sideways inside its card instead (site.js makes it a focusable region while it overflows). */
.code pre { white-space: pre-wrap; overflow-wrap: break-word; }
.code.code--bib pre { white-space: pre; overflow-wrap: normal; }
#repro-code { white-space: pre; overflow-wrap: normal; } /* commands stay whole; the pre scrolls sideways */
@media (max-width: 639px) { .code pre { padding: var(--s-3) var(--s-4); } .code pre:has(~ .code__copy:not([hidden])) { padding-top: 52px; } }
.cite__note { margin: var(--s-3) 0 0; font-size: var(--fs-sm); }
.cite__note + .cite__note { margin-top: var(--s-1); }

.footer { padding: var(--s-7) 0 var(--s-7); background: var(--bg-alt); border-top: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.55; }
.footer p { margin: 0 0 var(--s-2); }
.footer__grid { display: grid; gap: var(--s-5); }
.footer__title { font-weight: 700; color: var(--ink-strong); }
@media (min-width: 900px) { .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-7); } }

/* ---------------------------------------------------------------- 12. Shared components (shell sections and comp_*.css) */
/* figure frame: one per interactive figure; provenance badge in the head */
.fig { margin: var(--s-5) 0 0; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
@media (max-width: 639px) { .fig { padding: 14px; border-radius: var(--r-md); } }
.fig--illus, .fig--toy { border: 1.5px dashed var(--line-strong); }
.fig__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: var(--s-4); }
.fig__num { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fig__title { flex: 1 1 260px; font-size: 1.1875rem; }
.fig__grid { display: grid; gap: var(--s-5); }
@media (min-width: 900px) { .fig__grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.fig__caption { margin: var(--s-4) 0 0; font-size: .9375rem; line-height: 1.5; }
/* the italic lead word of an illustration or toy caption ("Illustration:", "Toy numbers"); math letters stay ink */
.fig__caption .fig__lead { font-style: italic; color: var(--illus); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.badge--measured { background: var(--bar); color: var(--on-bar); }
.badge--illus, .badge--toy { border: 1.5px dashed var(--muted); color: var(--illus); font-style: italic; font-weight: 600; letter-spacing: 0; text-transform: none; font-size: .8125rem; }

/* controls: a labeled row above the plot it scopes (segmented radios, toggles, ranges) */
.controls { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: flex-end; margin: 0 0 var(--s-4); padding: var(--s-4); background: var(--surface-2); border-radius: var(--r-md); }
.ctl { margin: 0; padding: 0; border: 0; min-width: 0; }
.ctl__label { display: block; margin: 0 0 6px; padding: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-strong); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); }
@media (max-width: 559px) { .ctl { width: 100%; } .seg { display: flex; } .seg label { flex: 1 1 auto; justify-content: center; text-align: center; } }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); color: var(--ink); font-size: .9375rem; cursor: pointer; }
.seg label:hover { background: var(--tint); }
.seg input:checked + label { background: var(--tint); color: var(--ink-strong); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.seg input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg input:disabled + label { opacity: .45; cursor: not-allowed; }
/* phones: a segment shows its short label; the full label stays in the accessible name (visually hidden) */
.seg__short { display: none; }
@media (max-width: 559px) {
  .seg label { padding: 0 12px; }
  .seg label .seg__long { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .seg label .seg__short { display: inline; }
}
/* hints that name the pointer: "Tap …" on touch screens, "Hover …" (with the keyboard keys) everywhere else,
   including devices without a pointer; keyboard help is also in each chart's visually hidden description */
.only-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .only-hover { display: none; } .only-touch { display: inline; } }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-strong); font: 600 .875rem/1 var(--font-sans); cursor: pointer; }
.chip:hover { background: var(--tint); }
.chip[aria-pressed="false"] { background: transparent; color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.chip[aria-pressed="false"] .glyph { opacity: .35; }
.range-field { display: grid; gap: 4px; flex: 1 1 220px; min-width: 0; }
.range-field__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.range-field__top label { font-size: .9375rem; font-weight: 700; color: var(--ink-strong); }
.range-field output { font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.range-field__hint { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.range-ticks { display: flex; justify-content: space-between; margin: 0; font-size: var(--fs-xs); color: var(--muted); }
input[type="range"].range { width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; --pct: 50%; }
input[type="range"].range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--band-edge); }   /* >= 3:1 on the panel (WCAG 1.4.11) */
input[type="range"].range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type="range"].range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"].range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--pct) 100% no-repeat, var(--band-edge); }
input[type="range"].range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"].range:focus-visible { outline: none; }
input[type="range"].range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--focus); }
input[type="range"].range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--focus); }

/* readouts: illustration outputs (dashed tray, italic, "about") vs. measured chips (navy rule, upright) */
.tray { display: grid; gap: var(--s-4); margin: var(--s-4) 0 0; padding: var(--s-4); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); }
@media (min-width: 720px) { .tray { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
.tray__key { display: block; font-size: var(--fs-sm); font-style: italic; color: var(--illus); }
.tray__val { display: block; font-size: 1.375rem; font-weight: 700; font-style: italic; color: var(--illus); line-height: 1.3; }
.measured { padding-left: 12px; border-left: 3px solid var(--bar); }
.measured__key { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.measured__val { display: block; font-size: 1.375rem; font-weight: 700; color: var(--ink-strong); line-height: 1.3; }
.measured__src { display: block; font-size: var(--fs-sm); color: var(--muted); }

/* tables: real <table>, no zebra, numbers right-aligned with tabular figures */
.tbl-wrap { overflow-x: auto; margin: 0 0 var(--s-5); }
.tbl-wrap:last-child { margin-bottom: 0; }
.tbl-wrap:focus-visible { outline-offset: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.tbl caption { padding: 0 0 var(--s-2); text-align: left; font-weight: 700; color: var(--ink-strong); caption-side: top; }
.tbl caption .src { display: block; font-weight: 400; margin: 2px 0 0; }
.tbl th, .tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); border-bottom: 1.5px solid var(--line-strong); vertical-align: bottom; }
.tbl thead tr.tbl__group th[colspan] { border-bottom: 1px solid var(--line); text-align: center; color: var(--ink-strong); }
.tbl th[scope="row"] { font-weight: 600; color: var(--ink-strong); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr.tbl__sep th, .tbl tbody tr.tbl__sep td { border-top: 1.5px solid var(--line-strong); }
.tbl .arm .glyph { width: .72em; height: .72em; }
.tbl--toy td.num { font-style: italic; color: var(--illus); }
.tbl caption .badge { margin-left: 8px; vertical-align: 1px; }
.nw { white-space: nowrap; }
@media (max-width: 559px) { .tbl th, .tbl td { padding: 8px 6px; } .tbl { font-size: .875rem; } }
/* prose tables that become labeled cards on narrow screens (cells carry data-label) */
.tbl--stack td { font-size: .9375rem; }
@media (max-width: 719px) {
  .tbl--stack, .tbl--stack tbody, .tbl--stack tr, .tbl--stack th, .tbl--stack td { display: block; width: 100%; }
  .tbl--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl--stack tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
  .tbl--stack tr:first-child { border-top: 1.5px solid var(--line-strong); }
  .tbl--stack th, .tbl--stack td { border: 0; padding: 2px 0; }
  .tbl--stack th[scope="row"] { font-size: 1rem; }
  .tbl--stack td[data-label]::before { content: attr(data-label); display: block; margin-top: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
}
/* small numeric tables that become one labeled card per row on phones (calibration): label left, value right */
.tbl thead th.num { white-space: normal; }
@media (max-width: 559px) {
  .tbl--stack-sm, .tbl--stack-sm tbody, .tbl--stack-sm tr, .tbl--stack-sm th, .tbl--stack-sm td { display: block; width: 100%; }
  .tbl--stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl--stack-sm tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl--stack-sm tr:first-child { border-top: 1.5px solid var(--line-strong); }
  .tbl--stack-sm th, .tbl--stack-sm td { padding: 0; border: 0; }
  .tbl--stack-sm th[scope="row"] { margin-bottom: 4px; font-size: 1rem; }
  .tbl.tbl--stack-sm td { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 3px 0; text-align: left; white-space: normal; }
  .tbl.tbl--stack-sm td::before { content: attr(data-label); flex: 1 1 0; min-width: 0; font-size: .8125rem; line-height: 1.35; color: var(--muted); text-align: left; }
  .tbl.tbl--stack-sm td > span { flex: 0 0 auto; max-width: 62%; text-align: right; font-variant-numeric: tabular-nums; }
  .tbl.tbl--stack-sm td.num > span { white-space: nowrap; }
}
.tbl-wrap--holds { padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
@media (max-width: 639px) { .tbl-wrap--holds { padding: var(--s-2) var(--s-4); } }
details.tbl-toggle { margin-top: var(--s-4); }
details.tbl-toggle > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: 700; color: var(--accent); cursor: pointer; }
details.tbl-toggle > summary::-webkit-details-marker { display: none; }
details.tbl-toggle > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
details.tbl-toggle[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
details.tbl-toggle > summary:hover { background: var(--tint); }
details.tbl-toggle[open] > summary { margin-bottom: var(--s-4); }
.tbl-toggle__body { padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
@media (max-width: 639px) { .tbl-toggle__body { padding: var(--s-3) 10px; } }

/* tooltip (one per page, created by a component): value first, then label */
.tip { position: fixed; z-index: 70; max-width: 300px; padding: 8px 10px; background: var(--ink-strong); color: var(--bg); border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: 1.4; pointer-events: none; box-shadow: var(--shadow-md); }
.tip__v { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.tip__l { display: block; opacity: .85; }

/* display equations: inline SVG drawn by LaTeX (tools/build_math.py), number beside, plain-language line under */
.eq { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; margin: var(--s-4) 0; container-type: inline-size; }
.eq__m { grid-column: 1; min-width: 0; padding: 6px 0; font-size: 1.15em; color: var(--ink-strong); }
.eqsvg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.eqv--narrow { display: none; }
@container (max-width: 479px) { .eq__m { font-size: 1em; } .eqv--wide { display: none; } .eqv--narrow { display: block; } }
.eq__num { grid-column: 2; grid-row: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.eq__plain { grid-column: 1 / -1; margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink); }
.eq--card { padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.sec--alt .eq--card { box-shadow: var(--shadow-sm); }
@media (max-width: 639px) { .eq--card { padding: var(--s-3) var(--s-4); } }

/* interactive mount: static fallback until a component marks itself live (data-state="live") */
.viz { margin-top: var(--s-6); }
.viz:not([data-state="live"]) [data-live] { display: none; }
.viz[data-state="live"] [data-fallback] { display: none; }
.viz > .eq[data-adopt] { margin: 0 0 var(--s-4); max-width: var(--w-text); }
.fb-grid { display: grid; gap: var(--s-5); }
@media (min-width: 1000px) { .fb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s-6) var(--s-5); } .fb-grid > .fb:only-child { grid-column: 1 / -1; max-width: 900px; } }
.fb { margin: 0; }
.fb figcaption { margin: var(--s-3) 0 0; font-size: .9375rem; line-height: 1.5; max-width: 860px; }
.fb figcaption .src { display: block; margin-top: var(--s-2); }
.viz__static-note { margin: var(--s-4) 0 0; padding: 10px var(--s-4); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-sm); color: var(--muted); }
.viz__static-note code { font-size: .875rem; color: var(--ink-strong); }
.viz[data-state="live"] .viz__static-note { display: none; }
.paper-frame { display: block; max-width: 100%; height: auto; padding: 8px; background: #ffffff; border: 1px solid var(--line); border-radius: var(--r-md); }
/* the poster's light artwork on a slightly dimmed paper frame in the dark theme (no glare) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .paper-frame { filter: brightness(.9); } }
:root[data-theme="dark"] .paper-frame { filter: brightness(.9); }

/* calibration (permanent static figure inside #viz-results): a plain table, no highlighted row */
.calib { margin-top: var(--s-6); }
.calib__sub { margin: calc(-1 * var(--s-2)) 0 var(--s-4); font-size: .9375rem; color: var(--muted); }
.calib .tbl-wrap { margin-bottom: 0; }

/* 404 page */
.notfound { padding-top: var(--s-9); padding-bottom: var(--s-9); max-width: calc(var(--w-text) + 2 * var(--gutter)); }
.notfound__title { margin: 0 0 var(--s-4); font-size: var(--fs-h2); }
.notfound__text { margin-bottom: var(--s-5); }

/* ---------------------------------------------------------------- 13. Preferences, forced colors, print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .xcard__link:hover, .res__thumb:hover img { transform: none; }
}
@media (forced-colors: active) {
  .tz-m--cum, .tz-m--free, .tz-m--gated, .tz-m--mgc, .tz-bar { fill: CanvasText; }
  .tz-wh { stroke: CanvasText; }
  .step__num, .resultbar__head, .verdictbar, .qa__badge, .theorem__tag, .badge--measured { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .progress__bar { background: Highlight; }
  input[type="range"].range::-moz-range-track { background: GrayText; }
  input[type="range"].range::-webkit-slider-runnable-track { background: GrayText; }
  input[type="range"].range::-moz-range-progress { background: Highlight; }
  input[type="range"].range::-moz-range-thumb { background: Highlight; border-color: Canvas; box-shadow: none; }
  input[type="range"].range::-webkit-slider-thumb { background: Highlight; border-color: Canvas; box-shadow: none; }
  input[type="range"].range:focus-visible::-moz-range-thumb { outline: 2px solid CanvasText; outline-offset: 2px; }
  input[type="range"].range:focus-visible::-webkit-slider-thumb { outline: 2px solid CanvasText; outline-offset: 2px; }
  .seg input:checked + label { outline: 2px solid Highlight; outline-offset: -2px; }
  .seg input:focus-visible + label { outline: 2px solid CanvasText; outline-offset: 2px; }
  .chip[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
@media print {
  .topbar, .skip-link, .iconbtn, .menu, .code__copy, .faq__all, .viz__static-note { display: none !important; }
  .hero { background: none; }
  .card, .xcard__link { box-shadow: none; }
  .sec { padding: 24px 0; }
  a { text-decoration: underline; }
}
