/* ==== 00-base.css ==== */
/* Exit Liquidity — editorial paper theme */

/* ---------- Tokens ---------- */
:root {
  --paper: #f4efe6;
  --card: #fbf8f2;
  --ink: #1c1915;
  --muted: #6b6358;
  --line: #ddd4c5;
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.14);
  --you: #0f766e;
  --good: #367034;
  --bad: #b42318;
  --warn: #8a5a00;
  /* Categorical: protocol / creator / LP / buyback / platform fee.
     Checked for ΔE separation under deuteranopia, protanopia and tritanopia
     and ≥3:1 against --paper; none of them is the accent's vermilion. */
  --c1: #1f5f99;  /* protocol: deep blue */
  --c2: #b07a10;  /* creator: ochre */
  --c3: #2f9a7f;  /* LP: bluish green */
  --c4: #a3487a;  /* buyback: reddish purple */
  --c5: #3f3a33;  /* platform fee: graphite */
  --nav-h: 48px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 11px;
  --prose: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1916; --card: #24211d; --ink: #ede6da; --muted: #a39a8c;
    --line: #3a352e; --accent: #ea6a2e; --accent-soft: rgba(234, 106, 46, 0.18);
    --you: #3fb8a8; --good: #6fbf62; --bad: #f0645a; --warn: #e0b041;
    --c1: #5b9bd5; --c2: #e0b041; --c3: #4fc29f; --c4: #d685b3; --c5: #8b8478;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1916; --card: #24211d; --ink: #ede6da; --muted: #a39a8c;
  --line: #3a352e; --accent: #ea6a2e; --accent-soft: rgba(234, 106, 46, 0.18);
  --you: #3fb8a8; --good: #6fbf62; --bad: #f0645a; --warn: #e0b041;
  --c1: #5b9bd5; --c2: #e0b041; --c3: #4fc29f; --c4: #d685b3; --c5: #8b8478;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 40px); }
p, ul, h3 { max-width: var(--prose); }
p { margin: 0 0 1.1em; }
strong, b { font-weight: 600; }
a { color: var(--accent); text-underline-offset: 3px; }
code, .mono, output {
  font-family: var(--mono); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
code { font-size: 0.86em; background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 4px; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 12vw, 120px); padding-bottom: 24px; }
.kicker {
  font: 500 12px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; }
h1 { font-size: clamp(52px, 13vw, 112px); margin: 0 0 24px; letter-spacing: -0.03em; line-height: 0.95; }
h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(18px, 2.4vw, 21px); line-height: 1.55; color: var(--ink); }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: clamp(12px, 3vw, 28px);
  height: var(--nav-h);
  padding: 0 max(clamp(16px, 5vw, 40px), calc((100% - 800px) / 2));
  font: 500 12px/1 var(--mono);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topnav a { text-decoration: none; white-space: nowrap; }
.topnav .brand {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-weight: 500;
}
.topnav .brand::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.topnav-links {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 0;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links > :first-child { margin-left: auto; } /* right-align without clipping the start on overflow */
.topnav-links a {
  flex: none; padding: 8px 6px; border-radius: 6px; color: var(--muted);
}
.topnav-links a:hover, .topnav-links a[aria-current] { color: var(--ink); background: var(--accent-soft); }
.topnav-links a:focus-visible { outline-offset: -2px; }

/* ---------- Table of contents (9 items: 3 × 3) ---------- */
.toc {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 40px; border-top: 1px solid var(--ink);
}
.toc a {
  display: flex; gap: 12px; align-items: baseline; min-width: 0;
  padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; line-height: 1.3;
}
.toc a:not(:nth-child(3n+1)) { padding-left: 14px; border-left: 1px solid var(--line); }
.toc a span { flex: none; font: 500 12px var(--mono); color: var(--muted); }
.toc a:hover { color: var(--accent); background: var(--accent-soft); }
.toc a:hover span { color: var(--accent); }

/* ---------- Hero overview diagram ---------- */
.overview { margin: 36px 0 0; min-height: 120px; }
.overview svg { display: block; width: 100%; height: auto; overflow: visible; }
.overview .caption { text-align: left; margin: 10px 0 0; }
.overview a { cursor: pointer; }
.overview .box { fill: var(--card); stroke: var(--line); stroke-width: 1; transition: stroke .15s; }
.overview .box.accent { fill: var(--accent-soft); stroke: var(--accent); }
.overview .box.branch { fill: var(--paper); stroke-dasharray: 4 3; stroke: var(--muted); }
.overview a:hover .box, .overview a:focus .box { stroke: var(--accent); stroke-width: 1.5; }
.overview a:hover .ov-t { fill: var(--accent); }
.overview .wire { stroke: var(--muted); stroke-width: 1.25; fill: none; }
.overview .wire.dash { stroke-dasharray: 3 3; }
.overview .head-fill { fill: var(--muted); }
.overview .pill { fill: none; stroke: var(--c2); stroke-width: 1.25; }
.overview text.ov-k { font: 500 11px var(--mono); letter-spacing: 0.08em; fill: var(--muted); }
.overview .accent-k text.ov-k, .overview text.ov-k.accent { fill: var(--accent); }
.overview text.ov-t { font: 600 15px var(--sans); fill: var(--ink); }
.overview text.ov-d { font: 400 13px var(--sans); fill: var(--muted); }
.overview text.ov-s { font: 500 12px var(--sans); fill: var(--ink); }

/* ---------- Sections ---------- */
main section, .part, .hero, [id] { scroll-margin-top: calc(var(--nav-h) + 16px); }
main section { padding-top: clamp(56px, 10vw, 96px); }
.head {
  display: flex; align-items: baseline; gap: 18px;
  border-top: 1px solid var(--ink); padding-top: 18px; margin-bottom: 20px;
}
.num {
  font: 500 clamp(32px, 6vw, 48px)/1 var(--mono); color: var(--accent);
  letter-spacing: -0.04em; flex: none;
}
h2 { font-size: clamp(26px, 4.4vw, 38px); margin: 0; max-width: 18em; }
h3 { font-size: 22px; margin: 40px 0 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(16px, 3.5vw, 28px); margin: 28px 0;
}
.card > :last-child { margin-bottom: 0; }

/* ---------- Slider rows ---------- */
label.row {
  display: grid; grid-template-columns: 200px 1fr 92px; align-items: center; gap: 16px;
  margin-bottom: 14px; font-size: 15px; color: var(--muted);
}
label.row output { text-align: right; color: var(--ink); font-size: 15px; }
.row.compact { grid-template-columns: auto 1fr 64px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; min-width: 0;
  height: 22px; background: transparent; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: var(--line); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 3px; background: var(--line); border-radius: 2px; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7.5px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--card);
  box-shadow: 0 0 0 1px var(--accent); transition: transform .15s;
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--accent); transition: transform .15s;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:active::-moz-range-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline-offset: 4px; }

/* ---------- Charts ---------- */
svg.chart { display: block; width: 100%; height: auto; margin: 18px 0 6px; overflow: visible; }
svg text { font-family: var(--mono); }
svg text.axis { font-size: 11px; fill: var(--muted); }
svg text.lbl { font-size: 13px; fill: var(--ink); font-family: var(--sans); font-weight: 500; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); margin-top: 18px;
}
.stats:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.stats > div { padding: 16px 12px 4px 0; min-width: 0; }
.stats > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.stats b {
  display: block; font: 500 clamp(18px, 2.6vw, 24px)/1.2 var(--mono);
  font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.stats span { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 4px; }
.stats b.pos { color: var(--good); }
.stats b.neg { color: var(--bad); }

/* ---------- Notes, callouts, captions ---------- */
.note {
  font-size: 15px; color: var(--muted); border-left: 2px solid var(--accent);
  padding: 2px 0 2px 16px; margin: 24px 0;
}
.callout {
  margin: 20px 0 0; padding: 14px 16px; border-radius: 8px;
  background: var(--accent-soft); color: var(--ink); font-size: 16px; line-height: 1.5;
}
.callout:empty { display: none; }
.caption { font: 500 12px/1.4 var(--mono); color: var(--muted); text-align: center; margin: 16px auto 0; letter-spacing: 0.04em; }

/* ---------- Split card (fees) ---------- */
.card.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(20px, 4vw, 40px); align-items: center; }
.split .big { border-right: 1px solid var(--line); padding-right: clamp(20px, 4vw, 40px); }
.split .big b {
  display: block; font: 500 clamp(52px, 10vw, 84px)/1 var(--mono);
  color: var(--accent); letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
}
.split .big span { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); max-width: 22em; }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 18px; }
.bar i { display: block; height: 100%; width: 0; background: var(--bad); border-radius: 4px; transition: width .35s ease; }

/* ---------- Graduation flow ---------- */
.flow { display: flex; align-items: stretch; gap: 10px; }
.flow .node {
  flex: 1 1 0; min-width: 0; padding: 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--paper);
}
.flow .node b { display: block; font: 500 17px/1.25 var(--mono); }
.flow .node span { display: block; font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 4px; }
.flow .node.accent { border-color: var(--accent); background: var(--accent-soft); }
.flow .node.accent b { color: var(--accent); }
.flow .arrow { align-self: center; font: 500 18px var(--mono); color: var(--muted); flex: none; }

/* ---------- Odds dots ---------- */
.dots {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: clamp(4px, 1vw, 8px);
  max-width: 560px; margin: 4px auto 0;
}
.dots i { display: block; aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.dots i.hit { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Checklist ---------- */
ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks li {
  position: relative; padding: 12px 0 12px 32px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 16px;
}
ul.checks li:last-child { border-bottom: 1px solid var(--line); }
ul.checks li::before {
  content: ""; position: absolute; left: 2px; top: 19px; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
ul.checks b { color: var(--ink); }

/* ---------- Card grids ---------- */
.grid2, .grid3 { display: grid; gap: 16px; margin: 28px 0; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 > .card, .grid3 > .card { margin: 0; }
.grid2 > *, .grid3 > * { min-width: 0; }
.card h3:first-child, .card h4:first-child { margin-top: 0; }
.card h4 { font: 600 16px/1.3 var(--sans); margin: 0 0 8px; }

/* ---------- Part divider ---------- */
.part { padding-top: clamp(88px, 16vw, 160px); }
.part > span {
  display: block; border-top: 3px double var(--ink); padding-top: 16px;
  font: 500 12px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.part h2 {
  font-size: clamp(38px, 8vw, 68px); line-height: 1; letter-spacing: -0.025em;
  margin: 12px 0 18px; max-width: 13em;
}
.part p { font-size: clamp(17px, 2.2vw, 19px); color: var(--muted); }

/* ---------- Segmented buttons ---------- */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%;
  padding: 3px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
}
.seg button {
  font: 500 13px/1.2 var(--sans); color: var(--muted); background: transparent;
  border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; min-height: 32px;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); background: var(--accent-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Toggle (checkbox + text) ---------- */
.toggle {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 15px; color: var(--ink); margin: 0 16px 12px 0; user-select: none;
}
.toggle input {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  position: relative; width: 34px; height: 20px; border-radius: 999px;
  background: var(--line); transition: background .15s;
}
.toggle input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.toggle input:checked { background: var(--accent); }
.toggle input:checked::before { transform: translateX(14px); }
.toggle input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Legend ---------- */
.legend {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0;
  font-size: 13px; line-height: 1.4; color: var(--muted);
}
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.legend .key i { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--muted); }
.legend .key b { color: var(--ink); font: 500 13px var(--mono); }

/* ---------- Key-value list ---------- */
dl.kv, .kv {
  display: grid; grid-template-columns: minmax(8em, 38%) minmax(0, 1fr);
  margin: 20px 0; border-bottom: 1px solid var(--line); max-width: var(--prose);
}
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.kv dt { color: var(--muted); padding-right: 16px; }
.kv dd { color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

/* ---------- Data tables ---------- */
.tablewrap {
  max-width: 100%; max-height: min(72vh, 620px); overflow: auto; margin: 24px 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.4; }
table.data caption {
  caption-side: top; text-align: left; padding: 12px 14px 4px;
  font: 500 12px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.04em;
}
table.data th, table.data td { padding: 9px 14px; text-align: left; vertical-align: baseline; font-variant-numeric: tabular-nums; }
table.data thead th {
  position: sticky; top: 0; z-index: 1; background: var(--card); white-space: nowrap;
  font: 500 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--ink);
}
table.data tbody th { font-weight: 500; color: var(--ink); min-width: 9em; max-width: 16em; }
table.data td { min-width: 4em; }
/* Prose cells wrap; number cells (.mono / .num) stay on one line in IBM Plex Mono. */
table.data td:not(.mono):not(.num) { min-width: 14em; max-width: 30em; font-size: 14px; }
table.data td.mono, table.data td.num, table.data th.num {
  font-family: var(--mono); font-weight: 500; font-size: 13px; white-space: nowrap;
}
table.data td a.src { margin: 2px 2px 0 0; }
table.data .num { text-align: right; }
table.data tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--ink) 4%, var(--card)); }
table.data tbody tr.hl > * { background: var(--accent-soft); }
table.data tbody tr:hover > * { background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
table.data tbody tr + tr > * { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; vertical-align: 0.12em; white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 999px; color: var(--muted);
  border: 1px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent);
}
.badge.ok { color: var(--good); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }
.badge.info { color: var(--c1); }

/* ---------- Source chips ---------- */
a.src {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; vertical-align: 0.08em;
  font: 500 11.5px/1.2 var(--mono); color: var(--muted); text-decoration: none;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s, border-color .15s;
}
a.src::after { content: "↗"; flex: none; font-size: 11px; opacity: .7; }
a.src:hover { color: var(--accent); border-color: var(--accent); }
.sources {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 16px 0;
  padding: 0; list-style: none; max-width: none; font: 500 11px/1.2 var(--mono); color: var(--muted);
}
.sources > li { margin: 0; min-width: 0; max-width: 100%; }

/* ---------- Proof screenshots ---------- */
figure.proof {
  margin: 28px 0; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
figure.proof img {
  display: block; width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line);
  background: var(--paper);
}
figure.proof figcaption { margin: 10px 4px 2px; font-size: 13px; line-height: 1.45; color: var(--muted); }
figure.proof figcaption a.src { margin-left: 4px; }

/* ---------- Footer ---------- */
footer { margin-top: clamp(64px, 12vw, 120px); padding-bottom: 48px; }
footer p {
  border-top: 1px solid var(--line); padding-top: 20px;
  font-size: 13px; line-height: 1.6; color: var(--muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toc a { font-size: 14px; }
  .toc a:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; }
  .toc a:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dd { border-top: 0; padding-top: 0; }
  .topnav { gap: 10px; }
  .topnav-links {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  label.row { grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 18px; }
  label.row > span { grid-column: 1; grid-row: 1; }
  label.row output { grid-column: 2; grid-row: 1; }
  label.row input { grid-column: 1 / -1; grid-row: 2; }
  .stats, .stats:has(> :nth-child(3):last-child) { grid-template-columns: repeat(2, 1fr); }
  .stats > div + div { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .card.split { grid-template-columns: 1fr; }
  .split .big { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .flow { flex-direction: column; }
  .flow .arrow { transform: rotate(90deg); line-height: 1; }
  .flow .arrow.plus { transform: none; }
  .dots { grid-template-columns: repeat(10, 1fr); max-width: 320px; }
  .head { gap: 12px; }
}

@media (max-width: 359px) {
  .toc { grid-template-columns: minmax(0, 1fr); }
  .toc a:nth-child(even) { padding-left: 0; border-left: 0; }
}

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

/* ---------- Temporary preview ---------- */
.preview-banner {
  margin: 0; max-width: none; padding: 8px 16px; text-align: center;
  font: 500 12px/1.4 var(--mono); letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-soft); border-bottom: 1px solid var(--line);
}
.ended { padding-top: 20vh; }

/* ==== 10-curve.css ==== */
/* Engineer A: #curve, #grad and Part II (trader) section-only rules. */

.c-h { margin-top: 0; font-size: 20px; }
.c-sub { font-size: 15px; color: var(--muted); }

/* play buttons */
.c-btn {
  font: 500 14px/1 var(--sans); color: var(--card); background: var(--accent);
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; flex: none;
  min-height: 40px; white-space: nowrap;
}
.c-btn:hover { filter: brightness(1.08); }
#g-play { margin-bottom: 4px; }

/* progress to graduation */
.c-play { display: flex; align-items: center; gap: 18px; margin: 4px 0 6px; }
.c-meter { flex: 1 1 auto; min-width: 0; }
.c-meter-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.c-meter-top b { color: var(--ink); font-weight: 500; }
.c-track { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.c-track i { display: block; height: 100%; width: 0; background: var(--you); border-radius: 5px; }

/* token allocation */
.c-stack { display: flex; height: 44px; border-radius: 8px; overflow: hidden; margin: 8px 0 14px; }
.c-stack i { display: flex; align-items: center; justify-content: center; min-width: 0; }
.c-stack span { font: 500 13px var(--mono); color: var(--card); white-space: nowrap; }

/* early vs late */
.c-el-row + .c-el-row { margin-top: 18px; }
.c-el-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--muted); }
.c-el-top b { font-size: 22px; color: var(--ink); }
.c-el-track { height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; margin-top: 6px; }
.c-el-track i { display: block; height: 100%; border-radius: 7px; }
.c-el-pre { font: 500 12px var(--mono); color: var(--muted); margin-top: 4px; }

/* round trips: split layout inside a card that also holds a .seg */
.r-split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(20px, 4vw, 40px); align-items: center; margin-top: 20px; }
#r-bar { background: var(--bad); }

/* reported graduation rates */
.o-row { display: grid; grid-template-columns: minmax(0, 15em) 1fr 4.5em; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.o-row + .o-row { border-top: 1px solid var(--line); }
.o-k { color: var(--muted); line-height: 1.3; }
.o-track { height: 12px; background: var(--paper); border-radius: 6px; overflow: hidden; }
.o-track i { display: block; height: 100%; min-width: 3px; background: var(--muted); border-radius: 6px; }
.o-track i.o-boost { background: var(--accent); }
.o-row b { text-align: right; font-size: 15px; }

@media (max-width: 680px) {
  .c-play { flex-direction: column; align-items: stretch; gap: 12px; }
  .c-btn { align-self: flex-start; }
  .r-split { grid-template-columns: 1fr; }
  .r-split .big { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .o-row { grid-template-columns: 1fr 4em; gap: 4px 12px; }
  .o-k { grid-column: 1 / -1; }
  .o-track { grid-column: 1; }
}

/* ==== 30-pool.css ==== */
/* Engineer B: sections 03 #amm, 04 #fees, 05 #creators (section-only rules) */
.pool-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 18px; }
#creators .seg { margin-bottom: 4px; }
#amm .kv, #creators .kv { margin-top: 18px; }

/* split builder */
.sp-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; }
.sp-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-row label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 15px; color: var(--muted); }
.sp-row label span:first-child { flex: 1; }
.sp-row input {
  width: 72px; padding: 6px 8px; font: 500 15px var(--mono); text-align: right;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
}
.sp-btn, .sp-x {
  font: 500 14px var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.sp-x { padding: 2px 10px; font-size: 16px; line-height: 1.4; }
.sp-btn:hover:not(:disabled), .sp-x:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.sp-btn:disabled, .sp-x:disabled { opacity: .4; cursor: default; }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.sp-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.sp-bar i { display: block; height: 100%; border-right: 2px solid var(--card); transition: width .25s ease; }
#sp-msg[data-state="bad"] { background: color-mix(in srgb, var(--bad) 14%, transparent); }
#sp-msg[data-state="ok"] { background: color-mix(in srgb, var(--good) 14%, transparent); }

/* ==== 50-mayhem.css ==== */
/* Section-only rules for #charity (06) and #mayhem (07). Engineer C. */

/* Charity flow: six nodes need tighter type on desktop */
#ch-flow { gap: 6px; }
#ch-flow .node { padding: 10px; cursor: pointer; }
#ch-flow .node b { font-size: 15px; overflow-wrap: anywhere; }
#ch-flow .node span { font-size: 12px; }
.ch-steps { display: flex; align-items: stretch; gap: 10px; margin-top: 18px; }
.ch-steps .callout { flex: 1; margin: 0; min-height: 3em; }
.ch-steps button {
  flex: none; width: 44px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: 500 18px var(--mono); cursor: pointer;
}
.ch-steps button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ch-steps button:disabled { opacity: .35; cursor: default; }

#charity .note p { margin: 0; }

/* Mayhem */
#mayhem label.row { grid-template-columns: 260px 1fr 64px; }
#mayhem label.row .badge { margin-left: 4px; }
.m-burn-key {
  border: 1px dashed var(--bad);
  background: repeating-linear-gradient(45deg, transparent 0 3px, var(--bad) 3px 4px) !important;
  opacity: .8;
}
#m-chart { max-height: 240px; }

@media (max-width: 680px) {
  #ch-flow .node b { font-size: 16px; }
  #ch-flow .node span { font-size: 13px; }
  #mayhem label.row { grid-template-columns: 1fr auto; }
}

/* Zero-specificity fallbacks until 00-base.css styles these shared classes; designer rules always win. */
:where(#charity, #mayhem) :where(.legend) { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
:where(#charity, #mayhem) :where(.legend .key) { display: inline-flex; align-items: center; gap: 6px; }
:where(#charity, #mayhem) :where(.legend .key i) { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
:where(#charity, #mayhem) :where(dl.kv) { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 0; margin: 0; }
:where(#charity, #mayhem) :where(dl.kv dt, dl.kv dd) { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
:where(#charity, #mayhem) :where(dl.kv dt) { font-weight: 600; padding-right: 16px; }
:where(#charity, #mayhem) :where(dl.kv dd) { color: var(--muted); font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
:where(#charity, #mayhem) :where(.badge) { display: inline-block; font: 500 11px/1.6 var(--mono); padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
:where(#charity, #mayhem) :where(.badge.warn) { color: var(--accent); border-color: var(--accent); }
:where(#charity, #mayhem) :where(.sources) { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
:where(#charity, #mayhem) :where(a.src) { font: 500 12px/1.4 var(--mono); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  :where(#charity, #mayhem) :where(dl.kv) { grid-template-columns: 1fr; }
  :where(#charity, #mayhem) :where(dl.kv dd) { border-top: 0; padding-top: 0; }
}

/* ==== 80-factcheck.css ==== */
/* Fact-check section (#factcheck) — section-only rules */
#factcheck h3 { margin-top: 40px; }
#factcheck .fc-table td:nth-child(2) { min-width: 20em; }
#factcheck .fc-table td:nth-child(3) { min-width: 0; width: 1%; white-space: nowrap; }
#factcheck .fc-table td:last-child { min-width: 11em; max-width: 16em; }
#factcheck .fc-table td:last-child a.src { max-width: 15em; }
#factcheck .fc-proofs { align-items: start; }
#factcheck .fc-proofs > figure.proof { margin: 0; }
#factcheck figure.proof a { display: block; }
#factcheck figure.proof figcaption a.src { display: inline-flex; }
#factcheck .grid3.fc-proofs img { max-height: 320px; object-fit: contain; object-position: left top; }
