/* AI Football - Private Financial & Execution Proposal.
   Light "chalk paper and turf" theme. Self-contained: the Archivo font (SIL OFL 1.1) is bundled in
   assets/fonts; no CDN, no external requests. Tokens copied (not linked) from the technical presentation. */
@font-face {
  font-family: "Archivo AF";
  src: url("fonts/archivo-variable.woff2") format("woff2-variations"), url("fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* chalk paper neutrals, tinted toward turf green */
  --bg: oklch(0.977 0.007 145);
  --bg-2: oklch(0.958 0.011 145);
  --surface: oklch(0.993 0.004 145);
  --surface-2: oklch(0.945 0.013 145);
  --surface-3: oklch(0.905 0.018 145);
  --line: oklch(0.30 0.04 155 / 0.13);
  --line-strong: oklch(0.30 0.04 155 / 0.26);
  --text: oklch(0.21 0.03 158);
  --text-2: oklch(0.34 0.028 158);
  --muted: oklch(0.45 0.022 158);
  --dim: oklch(0.60 0.016 158);          /* decorative only, never body text */
  /* turf green: the brand colour */
  --turf: oklch(0.46 0.13 152);
  --turf-deep: oklch(0.33 0.09 155);
  --turf-ink: oklch(0.25 0.06 158);
  --turf-bright: oklch(0.62 0.16 148);
  --turf-wash: oklch(0.93 0.04 148);
  --chalk: oklch(0.985 0.006 120);
  --floodlight: oklch(0.83 0.15 85);
  /* semantic colours (same meanings as before, tuned for a light background) */
  --c-cash: var(--turf);                       /* A: cash the company pays */
  --c-cash-wash: oklch(0.93 0.04 148);
  --c-contrib: oklch(0.47 0.13 295);           /* B: contribution value, not cash */
  --c-contrib-wash: oklch(0.94 0.03 295);
  --c-repl: oklch(0.47 0.035 250);             /* C: replacement cost, comparison only */
  --c-repl-bar: oklch(0.66 0.035 250);
  --c-repl-wash: oklch(0.94 0.012 250);
  --c-select: oklch(0.30 0.06 250);            /* selected hiring option */
  --c-visual: oklch(0.49 0.11 68);             /* D: future visual investment, text */
  --c-visual-bar: oklch(0.78 0.14 80);         /* D: bar fill (floodlight amber) */
  --c-visual-wash: oklch(0.95 0.04 85);
  --ev-strong: oklch(0.44 0.12 155);
  --ev-weak: oklch(0.49 0.11 68);
  --ev-missing: oklch(0.50 0.17 28);
  --ev-derived: oklch(0.42 0.10 245);
  --chart-grid: oklch(0.30 0.04 155 / 0.10);
  --chart-track: oklch(0.30 0.04 155 / 0.06);
  --chart-track-alloc: oklch(0.30 0.04 155 / 0.13);
  --ink-print: oklch(0 0 0);
  --paper-print: oklch(1 0 0);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -32px oklch(0.30 0.06 155 / 0.35), 0 2px 6px -2px oklch(0.30 0.06 155 / 0.10);
  --font: "Archivo AF", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Archivo AF", ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-stretch: 100%;
  font-size: 16.5px; line-height: 1.62; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
svg { display: block; max-width: 100%; }
a { color: var(--turf); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; letter-spacing: -0.01em; font-weight: 760; font-stretch: 84%; color: var(--turf-ink); }
h2 { font-size: clamp(27px, 2.8vw, 38px); font-stretch: 80%; font-weight: 790; }
h3 { font-size: clamp(19px, 1.7vw, 22px); font-stretch: 88%; font-weight: 720; }
h4 { font-size: 16px; font-stretch: 88%; font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin: 0 0 .35em; }
strong { color: var(--text); font-weight: 680; }
code, .mono { font-family: var(--mono); font-size: .9em; }
::selection { background: var(--turf-wash); }
:focus-visible { outline: 2px solid var(--turf); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--turf-ink); color: var(--chalk); padding: 10px 14px; border-radius: 8px; font-weight: 650; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Top bar: a calm turf band ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--turf-ink); color: var(--chalk); border-bottom: 1px solid oklch(0.20 0.05 158); }
.topbar-inner { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 14px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--chalk); min-width: 0; min-height: 44px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 760; font-stretch: 84%; font-size: 18px; white-space: nowrap; }
.brand-sub { color: oklch(0.86 0.03 150); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conf-chip { margin-left: auto; font-size: 14px; font-weight: 650; color: var(--floodlight); border: 1px solid oklch(0.83 0.15 85 / 0.55); padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.toc-mobile { position: relative; }
.toc-mobile > summary {
  list-style: none; cursor: pointer; font-size: 15px; font-weight: 650; padding: 0 16px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px;
  border: 1px solid oklch(0.985 0.006 120 / 0.45); color: var(--chalk); white-space: nowrap; transition: background-color .2s var(--ease), transform .16s var(--ease);
}
.toc-mobile > summary::-webkit-details-marker { display: none; }
.toc-mobile > summary:active { transform: scale(0.97); }
.toc-mobile[open] > summary { background: oklch(0.985 0.006 120 / 0.14); }
.toc-mobile .toc-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px; box-shadow: var(--shadow);
}

/* ---------- Layout ---------- */
.layout { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.sidebar { display: none; }
main { min-width: 0; }
@media (min-width: 1180px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); gap: 56px; }
  .sidebar { display: block; }
  .toc-mobile { display: none; }
  .sidebar nav { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: auto; padding: 30px 0 24px; }
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a { display: flex; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.35; transition: background-color .2s var(--ease); }
.toc-list a .n { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 18px; padding-top: 2px; }
.toc-list a[aria-current="true"] { color: var(--turf-ink); background: var(--turf-wash); font-weight: 650; }
.toc-list a[aria-current="true"] .n { color: var(--turf); }
.toc-group { font-size: 13px; font-weight: 650; color: var(--muted); padding: 14px 10px 4px; }

/* ---------- Hero ---------- */
.hero { padding: 52px 0 36px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 14px; font-weight: 650; color: var(--turf); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-bottom: 14px; }
.eyebrow .num { font-family: var(--mono); font-weight: 500; color: var(--muted); }
.eyebrow .quiet { color: var(--muted); font-weight: 500; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); font-stretch: 78%; font-weight: 800; letter-spacing: -0.015em; max-width: 18ch; margin-bottom: 18px; color: var(--turf-ink); }
.lede { font-size: clamp(17px, 1.5vw, 19.5px); color: var(--text-2); max-width: 66ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 14px; margin: 18px 0 28px; }
.meta-row span { display: inline-block; }
.meta-row b { color: var(--text); font-weight: 650; }
.glance h2 { font-size: 20px; font-stretch: 88%; font-weight: 720; margin-bottom: 4px; }
.glance td.r { font-family: var(--display); font-weight: 700; color: var(--turf-ink); font-size: 15.5px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0 20px; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-head { margin-bottom: 26px; max-width: 74ch; }
.section-head p { color: var(--text-2); }
.sub { margin-top: 34px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 36px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; }
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Columns read as text with a hairline, not as a grid of identical boxes */
.card { border-top: 1px solid var(--line-strong); padding: 16px 0 8px; min-width: 0; }
.card h3, .card h4 { margin-bottom: .45em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card.boxed { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 16px 18px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.tiny { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* Rule callout */
.rule { border: 1px solid oklch(0.46 0.13 152 / 0.35); background: var(--turf-wash); border-radius: var(--radius); padding: 20px 22px; margin: 22px 0; }
.rule .rule-tag { font-size: 14px; font-weight: 700; color: var(--turf-deep); margin-bottom: 6px; }
.rule p { margin: 0; font-size: 17px; color: var(--turf-ink); }
.rule p strong { color: var(--turf-ink); }
.rule p + p { margin-top: 8px; font-size: 15px; color: var(--text-2); }

.notice { border: 1px solid oklch(0.78 0.14 80 / 0.55); background: var(--c-visual-wash); padding: 14px 16px; border-radius: 12px; color: var(--text-2); font-size: 15px; margin: 18px 0; }
.notice strong { color: var(--text); }
.notice.blue { border-color: var(--line-strong); background: var(--surface-2); }

/* Concept chips (sentence case, sans) */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; padding: 1px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; line-height: 1.6; background: var(--surface); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.c-a { color: var(--c-cash); }
.c-b { color: var(--c-contrib); }
.c-c { color: var(--c-repl); }
.c-d { color: var(--c-visual); }
.tag { display: inline-block; font-size: 13px; font-weight: 650; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.reuse { background: var(--turf-wash); color: var(--turf-deep); }
.tag.develop { background: var(--c-repl-wash); color: var(--c-select); }
.tag.specialist { background: var(--c-visual-wash); color: var(--c-visual); }

/* Evidence labels */
.ev { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 650; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; background: var(--surface); line-height: 1.6; }
.ev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev-strong { color: var(--ev-strong); }
.ev-weak { color: var(--ev-weak); }
.ev-missing { color: var(--ev-missing); }
.ev-derived { color: var(--ev-derived); }

/* Tables */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 18px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
table.narrow { min-width: 420px; }
table.wide { min-width: 760px; }
caption { text-align: left; padding: 12px 14px 4px; color: var(--muted); font-size: 14px; caption-side: top; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13.5px; font-weight: 650; color: var(--muted); background: var(--bg-2); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 650; color: var(--text); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td, tr.total th { font-weight: 700; color: var(--turf-ink); background: var(--bg-2); }
tr.is-selected td, tr.is-selected th { background: var(--turf-wash); }

/* ---------- Controls ---------- */
.explorer { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 22px; margin: 22px 0; box-shadow: var(--shadow); }
.explorer-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.explorer-head h3 { margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; margin-bottom: 18px; }
fieldset.seg { border: 0; padding: 0; margin: 0; min-width: 0; max-width: 100%; }
fieldset.seg legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 7px; font-weight: 650; }
.seg-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opts input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg-opts label {
  cursor: pointer; min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 15px; font-weight: 650; color: var(--text-2); line-height: 1.25; user-select: none;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .16s var(--ease);
}
.seg-opts label:active { transform: scale(0.97); }
.seg-opts input:checked + label { background: var(--turf-ink); border-color: var(--turf-ink); color: var(--chalk); }
.seg-opts input:checked + label small { color: oklch(0.88 0.03 150); }
.seg-opts input:focus-visible + label { outline: 2px solid var(--turf); outline-offset: 3px; }
.seg-opts label small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; font-weight: 650; color: var(--text-2); min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; flex: none; transition: background-color .2s var(--ease), transform .16s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px oklch(0.30 0.06 155 / 0.35); transition: transform .22s var(--ease); }
.switch:active .track { transform: scale(0.97); }
.switch input:checked + .track { background: var(--turf); border-color: var(--turf); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--turf); outline-offset: 3px; }

input[type="number"] { width: 120px; min-height: 44px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 650; }

/* Results: a ruled list (label and formula left, value right), not a grid of metric cards */
.results { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; background: var(--bg); overflow: hidden; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.res:last-child { border-bottom: 0; }
.res .r-label { grid-column: 1; font-size: 15px; font-weight: 650; color: var(--text); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.res .r-value { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-family: var(--display); font-size: 19px; font-weight: 720; font-stretch: 90%; font-variant-numeric: tabular-nums; line-height: 1.25; color: var(--turf-ink); }
.res .r-formula { grid-column: 1; font-family: var(--mono); font-size: 13px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.res.cash .r-value { color: var(--turf-deep); }
.res.contrib .r-value { color: var(--c-contrib); }
.res.repl .r-value { color: var(--c-select); }
.res.visual .r-value { color: var(--c-visual); }
@media (max-width: 620px) {
  .res { grid-template-columns: minmax(0, 1fr); }
  .res .r-value { grid-column: 1; grid-row: auto; text-align: left; }
}
.live-summary { font-size: 15px; color: var(--text-2); margin: 14px 0 0; }

/* Charts (inline SVG, tokens applied through CSS) */
.chart { margin: 16px 0 6px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--text-2); }
.chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--mono); }
.chart .grid line { stroke: var(--chart-grid); }
.chart .track { fill: var(--chart-track); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin: 8px 0 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; gap: 7px; align-items: center; margin: 0; }
.legend .sw { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.sw-cash { background: var(--c-cash); }
.sw-contrib { border: 1.5px dashed var(--c-contrib); }
.sw-repl { background: var(--c-repl-bar); }
.sw-select { background: var(--c-select); }
.sw-visual { background: var(--c-visual-bar); }
.sw-visual-dash { border: 1.5px dashed var(--c-visual); }
.sw-central { background: var(--turf-ink); width: 3px !important; }
.sw-track { background: var(--chart-track-alloc); }
.sw-cash-dash { border: 1.5px dashed var(--c-cash); }
.sw-milestone { background: var(--c-select); border-radius: 50% !important; width: 10px !important; height: 10px !important; }
.sw-check { background: var(--c-visual); }

/* Buttons shared feel */
.ladder-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ladder-tabs button, .ft-steps button { transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .16s var(--ease); }
.ladder-tabs button:active, .ft-steps button:active { transform: scale(0.97); }
.ladder-tabs button { cursor: pointer; min-height: 44px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; text-align: left; min-width: 0; color: var(--text-2); font-size: 14px; line-height: 1.3; }
.ladder-tabs button b { display: block; font-size: 15.5px; color: var(--text); }
.ladder-tabs button[aria-selected="true"] { border-color: var(--c-visual); background: var(--c-visual-wash); box-shadow: inset 0 0 0 1px var(--c-visual); }

@media (hover: hover) and (pointer: fine) {
  .toc-list a:hover { color: var(--text); background: var(--bg-2); }
  .toc-mobile > summary:hover { background: oklch(0.985 0.006 120 / 0.10); }
  .seg-opts label:hover { border-color: var(--turf); color: var(--turf-ink); }
  .seg-opts input:checked + label:hover { color: var(--chalk); }
  .ladder-tabs button:hover { border-color: var(--c-visual); }
  .ft-steps button:hover { border-color: var(--turf); }
  a:hover { color: var(--turf-deep); }
}

/* Funding timeline steps */
.ft-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .ft-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ft-steps li { margin: 0; }
.ft-steps button { width: 100%; height: 100%; min-height: 44px; cursor: pointer; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text-2); }
.ft-steps button .ft-k { font-size: 13.5px; font-weight: 650; color: var(--turf); display: block; margin-bottom: 2px; }
.ft-steps button b { display: block; color: var(--text); font-size: 15px; line-height: 1.3; }
.ft-steps button .ft-v { display: block; font-size: 13.5px; margin-top: 4px; color: var(--muted); }
.ft-steps button[aria-pressed="true"] { border-color: var(--turf); background: var(--turf-wash); box-shadow: inset 0 0 0 1px var(--turf); }
.ft-detail { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--bg); }
.ft-detail h4 { font-size: 17px; margin-bottom: 6px; }
.ft-detail p:last-child, .ft-detail ul:last-child { margin-bottom: 0; }

.order-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0; list-style: none; counter-reset: ord; }
.order-strip li { counter-increment: ord; margin: 0; padding: 7px 12px 7px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14.5px; color: var(--text-2); display: inline-flex; gap: 8px; align-items: center; background: var(--surface); }
.order-strip li::before { content: counter(ord); font-family: var(--mono); font-size: 13px; color: var(--turf); font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); margin: 0; }
.checklist li::before { content: ""; width: 14px; height: 14px; border: 1.5px solid var(--turf); border-radius: 4px; margin-top: 5px; }
.checklist b { color: var(--text); }

dl.defs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 18px; margin: 0; }
@media (min-width: 700px) { dl.defs { grid-template-columns: 150px minmax(0, 1fr); } }
dl.defs dt { color: var(--muted); font-size: 14px; font-weight: 650; padding-top: 8px; }
dl.defs dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 700px) { dl.defs dt { border-bottom: 1px solid var(--line); } }

.formula-line { font-family: var(--mono); font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-wrap: anywhere; color: var(--turf-ink); }

.foot { padding: 40px 0 60px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 30px; }
.foot p { max-width: 90ch; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .brand-sub { display: none; }
  .topbar-inner { gap: 10px; }
  .hero { padding-top: 36px; }
  .explorer { padding: 16px; border-radius: 14px; }
  .section { padding-top: 48px; }
}
@media (max-width: 430px) { .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* Phone: first-class. No text below 14px; tap targets at least 44px. */
@media (max-width: 760px) {
  .small, .tiny, .legend, caption, .chip, .ev, .tag, thead th, .toc-list a, .toc-list a .n, .toc-group,
  .eyebrow, .res .r-formula, .meta-row, .brand-sub, .conf-chip, fieldset.seg legend, .seg-opts label small, .field,
  .ft-steps button .ft-k, .ft-steps button .ft-v, .ladder-tabs button, .notice, dl.defs dt, .rule .rule-tag,
  .chart .axis text, .order-strip li, .order-strip li::before, .foot, table, code, .mono, .live-summary {
    font-size: 14px;
  }
  .toc-list a { min-height: 44px; align-items: center; }
  .ladder-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .skip-link { min-height: 44px; }
  th, td { padding: 10px 12px; }
}

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

/* ---------- Print: readable black on white ---------- */
@media print {
  :root {
    --text: var(--ink-print); --text-2: var(--ink-print); --muted: oklch(0.30 0 0); --dim: oklch(0.40 0 0);
    --line: oklch(0.75 0 0); --line-strong: oklch(0.55 0 0); --turf-ink: var(--ink-print); --turf-deep: var(--ink-print);
    --bg: var(--paper-print); --bg-2: oklch(0.95 0 0); --surface: var(--paper-print); --turf-wash: oklch(0.93 0 0);
    --chart-grid: oklch(0.80 0 0); --chart-track: oklch(0.93 0 0);
  }
  html, body { background: var(--paper-print) !important; color: var(--ink-print) !important; font-size: 11pt; }
  .topbar, .sidebar, .toc-mobile, .skip-link { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .hero, .section { padding: 18px 0 8px; break-inside: auto; }
  .explorer, .ft-detail, .ft-steps button, .rule, .notice, .table-scroll, .results { background: var(--paper-print) !important; box-shadow: none !important; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 9.5pt; }
  th, td { padding: 5px 7px; }
  .seg-opts input:checked + label { background: oklch(0.85 0 0) !important; color: var(--ink-print) !important; }
  a { color: var(--ink-print); text-decoration: underline; }
  .section, .explorer, table, .chart { page-break-inside: avoid; }
  .conf-print { display: block !important; }
  .chip, .ev, .tag, .eyebrow, .rule .rule-tag, .res .r-value { color: var(--ink-print) !important; border-color: oklch(0.40 0 0) !important; background: var(--paper-print) !important; }
}
.conf-print { display: none; font-size: 10pt; border: 1px solid var(--text); padding: 6px 8px; margin-bottom: 10px; }
