/* reset */
:root{color-scheme:light;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}body{margin:0;font:14px system-ui,sans-serif}img{max-width:100%}[hidden]{display:none!important}
/* Layout: one reading column beside a narrow rail of ledger account labels; figures run wider than text.
   Colour is reserved for data: blue is money into the Treasury, orange is money out (cash),
   green is health coverage, yellow is other aid tied to low income, violet is people and prices. */
:root {
  --paper: #f3f5f1;
  --surface: #ffffff;
  --slip: #ffffff;
  --ink: #15201b;
  --ink-2: #56625b;
  --rule: #dce2db;
  --rule-strong: #b4beb6;
  --wash: #e8ece7;
  --in: #257de0;
  --out: #f47230;
  --people: #6a4ce2;
  --aid: #00b894;
  --other-aid: #f2a600;
  --muted-mark: #c3cbc5;
  --in-soft: color-mix(in srgb, var(--in) 16%, var(--surface));
  --out-soft: color-mix(in srgb, var(--out) 18%, var(--surface));
  --people-soft: color-mix(in srgb, var(--people) 14%, var(--surface));
  --shadow-color: 21 32 27;
  --shadow-strength: 0.1;
  --font-display: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 40rem;
  --wide: 54rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1210;
    --surface: #151b18;
    --slip: #1b231f;
    --ink: #e9eeea;
    --ink-2: #a0aba4;
    --rule: #29322d;
    --rule-strong: #46514a;
    --wash: #1e2622;
    --in: #338ced;
    --out: #e76624;
    --people: #9887ef;
    --aid: #00a888;
    --other-aid: #d28e05;
    --muted-mark: #4a554e;
    --shadow-color: 0 0 0;
    --shadow-strength: 0.45;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1210;
  --surface: #151b18;
  --slip: #1b231f;
  --ink: #e9eeea;
  --ink-2: #a0aba4;
  --rule: #29322d;
  --rule-strong: #46514a;
  --wash: #1e2622;
  --in: #338ced;
  --out: #e76624;
  --people: #9887ef;
  --aid: #00a888;
  --other-aid: #d28e05;
  --muted-mark: #4a554e;
  --shadow-color: 0 0 0;
  --shadow-strength: 0.45;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.page {
  max-width: 76rem;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: clamp(1.5rem, 4vw, 3rem) 4rem;
}
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.04; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.14; }
h3 { font: 600 1rem/1.3 var(--font-text); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
strong { font-weight: 600; }
.eyebrow, .rail {
  font: 500 0.75rem/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Sections: rail + body ---------- */
.section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
}
.section-body { display: grid; gap: 1.15rem; min-width: 0; }
.section-body > p, .section-body > h2, .section-body > ul, .section-body > ol, .section-body > .prose { max-width: var(--measure); }
.section-body > figure, .section-body > .figure-wide { max-width: var(--wide); }
.section-body > h2 { margin-bottom: 0.2rem; }
.section-body > ul, .section-body > ol { padding-left: 1.2rem; display: grid; gap: 0.45rem; }
@media (min-width: 62rem) {
  .section { grid-template-columns: 9.5rem minmax(0, 1fr); column-gap: 2.5rem; }
  .rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1.25rem); align-self: start; padding-top: 0.6rem; }
}
.lede { font-size: 1.1875rem; line-height: 1.5; }
.small { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }

/* ---------- Sourced figures ---------- */
.fact {
  all: unset;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  border-radius: 2px;
  white-space: nowrap;
}
.fact:hover, .fact[aria-expanded="true"] { text-decoration-style: solid; text-decoration-color: currentColor; }
.fact:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.pop {
  position: absolute;
  z-index: 30;
  width: min(23rem, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(var(--shadow-color) / var(--shadow-strength)), 0 12px 32px rgb(var(--shadow-color) / var(--shadow-strength));
  padding: 0.9rem 1rem 1rem;
  font: 400 0.8125rem/1.45 var(--font-text);
  display: grid;
  gap: 0.5rem;
}
.pop-label { font-weight: 600; font-size: 0.875rem; padding-right: 1.5rem; }
.pop-value { font: 500 0.875rem/1.3 var(--font-mono); overflow-wrap: anywhere; }
.pop-meta { color: var(--ink-2); overflow-wrap: anywhere; }
.pop-status { display: flex; gap: 0.4rem; align-items: baseline; color: var(--ink-2); }
.pop-status b { color: var(--ink); font-weight: 600; }
.pop-close {
  all: unset;
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1;
}
.pop-close:hover { background: var(--wash); color: var(--ink); }
.pop-close:focus-visible { outline: 2px solid var(--ink); }

.tip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  max-width: min(18rem, calc(100vw - 24px));
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font: 400 0.75rem/1.4 var(--font-text);
  display: grid;
  gap: 0.1rem;
}
.tip-value { font-weight: 600; font-size: 0.875rem; }
.tip-title, .tip-note { opacity: 0.82; }

/* ---------- Figures ---------- */
.chart {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.chart-head { display: grid; gap: 0.2rem; }
.chart-title { font: 600 1rem/1.3 var(--font-text); }
.chart-sub { font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.chart-note { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.8125rem; color: var(--ink-2); padding: 0; margin: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.swatch { width: 0.75rem; height: 0.75rem; border-radius: 2px; flex: none; background: var(--muted-mark); }
.swatch--line { height: 2px; width: 1rem; border-radius: 1px; }
.legend .swatch.swatch--dashed { background: none; height: 0; width: 1.25rem; border-top: 2px dashed var(--tone); border-radius: 0; }
.tone-in { --tone: var(--in); --tone-soft: var(--in-soft); }
.tone-out { --tone: var(--out); --tone-soft: var(--out-soft); }
.tone-people { --tone: var(--people); --tone-soft: var(--people-soft); }
.tone-muted { --tone: var(--muted-mark); --tone-soft: var(--wash); }
.tone-ref { --tone: var(--ink-2); }
.tone-aid { --tone: var(--aid); }
.tone-other { --tone: var(--other-aid); }
.swatch[class*="tone-"] { background: var(--tone); }

/* Bars: thin, rounded at the data end, square at the baseline. */
.bar {
  display: block;
  height: 14px;
  width: calc(var(--w) * 1%);
  min-width: 2px;
  background: var(--tone, var(--muted-mark));
  border-radius: 0 4px 4px 0;
}

/* Ranked bar list: name, bar, figure. The bar drops under the name on narrow screens. */
.barlist { display: grid; gap: 0.15rem; font-size: 0.875rem; }
.barlist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "label value" "track track";
  gap: 0.3rem 1rem;
  align-items: center;
  padding: 0.5rem 0.4rem;
  border-radius: 6px;
}
.barlist-row:hover, .barlist-row:focus-visible { background: var(--wash); }
.barlist-label { grid-area: label; min-width: 0; }
.barlist-label small { display: block; color: var(--ink-2); font-size: 0.75rem; line-height: 1.35; }
.barlist-track { grid-area: track; min-width: 0; }
.barlist-value { grid-area: value; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barlist-value .share { color: var(--ink-2); display: inline-block; min-width: 3.4em; }
@media (min-width: 40rem) {
  .barlist-row { grid-template-columns: minmax(8rem, 15rem) minmax(0, 1fr) auto; grid-template-areas: "label track value"; }
}

/* Paired bars: two measures for the same group. */
.pairlist { display: grid; gap: 0.2rem; font-size: 0.875rem; }
.pair-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem 1rem; padding: 0.55rem 0.4rem; border-radius: 6px; align-items: center; }
.pair-row:hover, .pair-row:focus-visible { background: var(--wash); }
.pair-label small { display: block; color: var(--ink-2); font-size: 0.75rem; line-height: 1.35; }
.pair-bars { display: grid; gap: 3px; min-width: 0; }
.pair-bar { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.pair-bar .bar { width: calc(var(--w) * (100% - 4rem) / 100); flex: none; }
.pair-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 40rem) {
  .pair-row { grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); }
}

/* Diverging bars: received on the left of the line, paid on the right. Figures sit in their own columns
   outside the bar areas, so one dollar is the same length on both sides. */
.diverge { display: grid; gap: 0.2rem; font-size: 0.875rem; --label-w: 4.6rem; }
.diverge-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem 1rem; padding: 0.55rem 0.4rem; border-radius: 6px; align-items: center; }
.diverge-row:hover, .diverge-row:focus-visible { background: var(--wash); }
.diverge-label small { display: block; color: var(--ink-2); font-size: 0.75rem; line-height: 1.35; }
.diverge-plot, .diverge-axis-inner { display: grid; grid-template-columns: var(--label-w) minmax(0, var(--left, 1fr)) minmax(0, var(--right, 1fr)) var(--label-w); min-width: 0; align-items: center; }
.diverge-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.diverge-val--left { grid-column: 1; text-align: right; padding-right: 0.4rem; }
.diverge-side { display: flex; align-items: center; min-width: 0; padding-block: 3px; }
.diverge-side--left { grid-column: 2; justify-content: flex-end; border-right: 1px solid var(--rule-strong); }
.diverge-side--right { grid-column: 3 / 5; gap: 0.4rem; }
.diverge-side--left .bar { width: calc(var(--w) * 1%); flex: none; border-radius: 4px 0 0 4px; }
.diverge-side--right .bar { width: calc(var(--w) / 100 * (100% - var(--label-w))); flex: none; }
.diverge-stack { display: flex; gap: 2px; width: calc(var(--w) * 1%); flex: none; min-width: 2px; }
.diverge-side--left .diverge-stack .bar { width: auto; flex: 1 1 0; border-radius: 0; }
.diverge-side--left .diverge-stack .bar:first-child { border-radius: 4px 0 0 4px; }
.diverge-net { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.diverge-net b { color: var(--ink); font-weight: 600; }
.diverge-axis { display: grid; grid-template-columns: minmax(0, 1fr); font-size: 0.75rem; line-height: 1.3; color: var(--ink-2); padding-inline: 0.4rem; }
.diverge-axis-inner { align-items: end; }
.diverge-axis-inner span:first-child { grid-column: 1 / 3; text-align: right; padding-right: 0.5rem; }
.diverge-axis-inner span:last-child { grid-column: 3 / 5; padding-left: 0.5rem; }
@media (min-width: 46rem) {
  .diverge-row, .diverge-axis { grid-template-columns: 9.5rem minmax(0, 1fr) 11rem; column-gap: 1rem; }
  .diverge-axis-inner { grid-column: 2; }
}

/* Line plots: the SVG stretches to any width; labels and dots are HTML so they keep their size. */
.plot-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.5rem; }
.plot-y { position: relative; width: 2.6rem; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plot-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.plot { position: relative; height: var(--plot-h, 15rem); min-width: 0; touch-action: pan-y; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot .grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot .base { stroke: var(--rule-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot .ref { stroke: var(--ink-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plot .line { fill: none; stroke: var(--tone); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.plot .line--projected { stroke-dasharray: 5 4; }
.plot .area { fill: var(--tone); opacity: 0.1; stroke: none; }
.plot .band { fill: var(--wash); stroke: none; }
.plot-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 2px var(--surface);
}
.plot-tag {
  position: absolute;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--ink-2);
  white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  padding: 0 0.2rem;
  border-radius: 2px;
}
.plot-tag b { color: var(--ink); font-weight: 600; }
.plot-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-2); pointer-events: none; }
.plot-cross-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.plot-x { grid-column: 2; position: relative; height: 1.4rem; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.plot-x span { position: absolute; top: 0.3rem; transform: translateX(-50%); white-space: nowrap; }
.plot-x span:first-child { transform: none; }
.plot-x span:last-child { transform: translateX(-100%); }

.multiples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1.25rem; }
@media (min-width: 46rem) { .multiples { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.panel { display: grid; gap: 0.4rem; min-width: 0; }
.panel-name { font-size: 0.875rem; font-weight: 600; }
.panel-change { font-size: 0.8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.panel .plot { --plot-h: 7.5rem; }
.panel-x { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Table twin of a chart */
.table-toggle { all: unset; cursor: pointer; font-size: 0.8125rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 0.18em; justify-self: start; }
.table-toggle:hover { color: var(--ink); }
.table-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.table-scroll { overflow-x: auto; max-height: 20rem; overflow-y: auto; border: 1px solid var(--rule); border-radius: 6px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 0.35rem 0.7rem; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }

/* Plain tables in the text */
.table-wrap { overflow-x: auto; max-width: var(--wide); }
.plain-table { border-collapse: collapse; width: 100%; font-size: 0.875rem; line-height: 1.45; }
.plain-table th, .plain-table td { text-align: left; vertical-align: top; padding: 0.6rem 0.9rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.plain-table thead th { font: 500 0.75rem/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom-color: var(--rule-strong); }
.plain-table td:first-child { font-weight: 600; min-width: 9rem; }

/* Sources */
.sources { display: grid; gap: 0.6rem; font-size: 0.875rem; line-height: 1.5; padding-left: 1.2rem; max-width: var(--wide); }
.sources li { overflow-wrap: anywhere; }
.sources .count { color: var(--ink-2); }

@media (prefers-reduced-motion: no-preference) {
  .bar, .meter-fill { transition: width 0.25s ease; }
}

/* Single-column grids must let their children shrink, or long content pushes the page wider than the screen. */
.section-body, .chart, .chart-head, .barlist, .pairlist, .diverge, .panel, .pop { grid-template-columns: minmax(0, 1fr); }
fieldset { min-width: 0; }

/* ---------- The ledger slip, callouts and stat rows (shared by every page) ---------- */
.slip-wrap { filter: drop-shadow(0 1px 1px rgb(var(--shadow-color) / var(--shadow-strength))) drop-shadow(0 14px 28px rgb(var(--shadow-color) / var(--shadow-strength))); min-width: 0; }
.slip {
  background: var(--slip);
  color: var(--ink);
  font: 400 0.8125rem/1.55 var(--font-mono);
  padding: 1.5rem 1.25rem 2.25rem;
  display: grid;
  gap: 1.1rem;
  /* A torn lower edge, the way a till receipt ends. */
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.slip-head { text-align: center; display: grid; gap: 0.15rem; }
.slip-title { font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.slip-sub { color: var(--ink-2); }
.slip-group { display: grid; gap: 0.1rem; }
.slip-group-name { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; border-bottom: 1px solid var(--ink); padding-bottom: 0.25rem; margin-bottom: 0.3rem; }
.slip-group-name .swatch { width: 0.6rem; height: 0.6rem; border-radius: 1px; }
.slip-group-name .unit { margin-left: auto; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.slip-row { display: flex; align-items: baseline; gap: 0.5ch; min-width: 0; }
.slip-row .name { min-width: 0; }
.slip-row .lead { flex: 1 1 1ch; min-width: 1ch; border-bottom: 1px dotted var(--rule-strong); transform: translateY(-0.28em); }
.slip-row .amt { white-space: nowrap; text-align: right; }
.slip-row .pct { width: 5.6ch; text-align: right; color: var(--ink-2); white-space: nowrap; flex: none; }
.slip-row--total { font-weight: 500; border-top: 1px solid var(--ink); padding-top: 0.3rem; margin-top: 0.3rem; }
.slip-row--total .lead { border-bottom-color: transparent; }
.slip-balance { border-top: 3px double var(--ink); padding-top: 0.6rem; display: grid; gap: 0.2rem; }
.slip-balance .slip-row { font-weight: 500; }
.slip-foot { color: var(--ink-2); text-align: center; }

/* ---------- Callout: why a finding matters for a basic income ---------- */
.matters { border-left: 2px solid var(--ink); padding: 0.1rem 0 0.1rem 1.1rem; display: grid; gap: 0.35rem; max-width: var(--measure); }
.matters .eyebrow { color: var(--ink); }

/* ---------- Stat rows ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.25rem 2rem; max-width: var(--wide); }
.stat { display: grid; gap: 0.15rem; align-content: start; border-top: 1px solid var(--rule-strong); padding-top: 0.7rem; }
.stat-value { font: 600 1.75rem/1.1 var(--font-text); letter-spacing: -0.01em; }
.stat-value .fact { text-decoration-color: var(--rule-strong); }
.stat-label { font-size: 0.875rem; line-height: 1.4; color: var(--ink-2); }
.slip, .slip-group, .slip-balance, .matters { grid-template-columns: minmax(0, 1fr); }


/* ---------- Masthead and the scenario tabs ---------- */
.masthead { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); padding-block: clamp(0.5rem, 3vw, 2rem) clamp(1.5rem, 4vw, 2.5rem); max-width: 46rem; }
.masthead .lede { max-width: var(--measure); }
.tabs {
  --tabs-h: 3rem;
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6;
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none;
  background: var(--paper); border-bottom: 1px solid var(--rule-strong);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))) calc(-1 * max(16px, env(safe-area-inset-right, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
}
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: baseline; gap: 0.45rem; height: var(--tabs-h); padding: 0 0.7rem; align-items: center; white-space: nowrap; text-decoration: none; font-size: 0.9375rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:first-child { padding-left: 0; }
.tab .n { font: 500 0.75rem/1 var(--font-mono); }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.view { display: grid; grid-template-columns: minmax(0, 1fr); }
.view-head { display: grid; gap: 0.9rem; grid-template-columns: minmax(0, 1fr); padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem); max-width: 46rem; }
.view-head h2 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06; }
.view-foot { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; border-top: 1px solid var(--rule); padding-block: 1.5rem; font-size: 0.9375rem; }
.go { font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Overview: one card per scenario ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; max-width: var(--wide); }
@media (min-width: 52rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; } }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(1.1rem, 2.5vw, 1.5rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; align-content: start; }
.card-n { font: 500 0.75rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.card h3 { font: 500 1.5rem/1.15 var(--font-display); letter-spacing: -0.01em; }
.card-idea { line-height: 1.5; }
.facts-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.55rem; font-size: 0.9375rem; line-height: 1.45; }
.facts-list div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
.facts-list dt { font: 500 0.6875rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
@media (min-width: 30rem) { .facts-list div { grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; } }
.card-figure { border-top: 1px solid var(--rule); padding-top: 0.9rem; display: grid; gap: 0.15rem; }
.card-figure b { font: 600 1.75rem/1.1 var(--font-text); letter-spacing: -0.01em; }
.card-figure span { font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }

/* ---------- People behind an idea ---------- */
.voices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; max-width: var(--wide); }
@media (min-width: 46rem) { .voices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.voice { border-top: 1px solid var(--rule-strong); padding-top: 0.75rem; display: grid; gap: 0.35rem; align-content: start; font-size: 0.9375rem; line-height: 1.5; }
.voice-name { font-weight: 600; }
.voice-when { font: 500 0.75rem/1.3 var(--font-mono); letter-spacing: 0.04em; color: var(--ink-2); }
.keyfacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; max-width: var(--wide); font-size: 0.9375rem; line-height: 1.5; }
.keyfacts div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.15rem 1.5rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.keyfacts dt { font-weight: 600; }
@media (min-width: 40rem) { .keyfacts div { grid-template-columns: 12rem minmax(0, 1fr); } }

/* ---------- The simulator ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "live" "levers" "rest"; gap: 1.25rem; min-width: 0; }
.levers { grid-area: levers; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(1rem, 2.5vw, 1.4rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; align-content: start; min-width: 0; }
.result-live { grid-area: live; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 3rem); z-index: 4; background: var(--paper); border-bottom: 1px solid var(--rule); padding-block: 0.7rem; display: grid; gap: 0.1rem; }
.result-rest { grid-area: rest; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.6rem; min-width: 0; align-content: start; }
@media (min-width: 62rem) {
  .sim { grid-template-columns: minmax(0, 23rem) minmax(0, 1fr); grid-template-areas: "levers live" "levers rest"; column-gap: 2.5rem; grid-template-rows: auto 1fr; }
  .section--wide { grid-template-columns: minmax(0, 1fr); }
  .section--wide > .rail { position: static; padding-top: 0; }
}
.result-figure { font: 600 clamp(2rem, 6vw, 3rem)/1.05 var(--font-text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.result-caption { color: var(--ink-2); font-size: 0.9375rem; }
.result-say { max-width: var(--measure); line-height: 1.55; }
.result-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; min-width: 0; }
.result-block h4 { margin: 0; font: 600 0.9375rem/1.35 var(--font-text); }
.result-rest .slip-wrap { max-width: 27rem; }
.slip-row--sub { color: var(--ink-2); padding-left: 2ch; }
.slip-row--plain { font-weight: 400 !important; }
.slip-row--note { color: var(--ink-2); }

.lever { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.4rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.lever-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.lever label.lever-name, .lever legend { font-weight: 600; font-size: 0.9375rem; line-height: 1.35; padding: 0; }
.lever legend { margin-bottom: 0.45rem; }
.lever output { font: 600 0.9375rem/1.2 var(--font-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lever input[type="range"] { width: 100%; accent-color: var(--ink); height: 1.75rem; margin: 0; }
.lever-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: -0.3rem; }
.lever-hint { font-size: 0.8125rem; line-height: 1.45; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chips label { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0.3rem 0.8rem 0.3rem 0.55rem; font-size: 0.875rem; cursor: pointer; }
.chips label:has(input:checked) { border-color: var(--ink); background: var(--wash); }
.chips label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.chips input { accent-color: var(--ink); margin: 0; }
.levers-group { font: 500 0.6875rem/1.3 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--rule); padding-bottom: 0.35rem; margin-bottom: -0.5rem; }
.more-levers { border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.more-levers summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; }
.more-levers[open] summary { margin-bottom: 1.2rem; }
.more-levers .more-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; }
.sim-reset { justify-self: start; font: inherit; font-size: 0.875rem; color: var(--ink); background: none; border: 1px solid var(--rule-strong); border-radius: 6px; padding: 0.4rem 0.8rem; cursor: pointer; }
.sim-reset:hover:not(:disabled) { background: var(--wash); border-color: var(--ink); }
.sim-reset:disabled { color: var(--ink-2); cursor: default; opacity: 0.6; }

/* What covers the payout: spending no longer made, new money raised, and what is left to find. */
.cover-track { position: relative; display: flex; gap: 2px; height: 22px; }
.cover-seg { background: var(--tone); min-width: 2px; }
.cover-seg:first-child { border-radius: 4px 0 0 4px; }
.cover-seg:last-of-type { border-radius: 0 4px 4px 0; }
.cover-seg:first-child:last-of-type { border-radius: 4px; }
.cover-gap { background: repeating-linear-gradient(135deg, var(--rule-strong) 0 2px, transparent 2px 7px); outline: 1px solid var(--rule-strong); outline-offset: -1px; }
.swatch.cover-gap { background: repeating-linear-gradient(135deg, var(--rule-strong) 0 2px, transparent 2px 5px); outline: 1px solid var(--rule-strong); outline-offset: -1px; }
.cover-mark { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); }
.cover-mark span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-size: 0.6875rem; color: var(--ink-2); white-space: nowrap; }
.cover-legend { list-style: none; padding: 0; margin-top: -1rem; }
.cover-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Year by year through the transition. */
.path { display: flex; align-items: stretch; gap: 2px; height: 7rem; border-bottom: 1px solid var(--rule-strong); }
.path--both, .path:has(.path-down) { border-bottom: 0; height: 10rem; }
.path-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.path-up { flex: 1 1 0; display: flex; align-items: flex-end; }
.path-down { flex: 1 1 0; display: flex; align-items: flex-start; border-top: 1px solid var(--rule-strong); }
.path-bar { display: block; width: 100%; min-height: 1px; }
.path-bar--gap { background: var(--ink-2); border-radius: 2px 2px 0 0; }
.path-bar--spare { background: var(--in); border-radius: 0 0 2px 2px; }
.path-axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-2); margin-top: -0.3rem; }

.caveats { display: grid; gap: 0.6rem; padding-left: 1.2rem; }
.inputs-table td:last-child, .inputs-table th:last-child { text-align: right; white-space: nowrap; }

/* Linked phrases (not single figures) wrap like ordinary text. */
.voice .fact, .keyfacts .fact, .lever-hint .fact, .section-body > p .fact:not(:only-child), .caveats .fact { white-space: normal; }
.voice-when { overflow-wrap: anywhere; }
.path { gap: 0; }
.path-col { align-items: center; }
.path-up, .path-down { width: 100%; justify-content: center; }
.path-bar { width: min(70%, 1.5rem); }

/* ---------- Timeline: year by year ---------- */
.timeline { display: grid; gap: 1.25rem; }
.tl-block { display: grid; gap: 0.5rem; min-width: 0; }
.tl-block h5 { font: 600 0.9375rem/1.3 var(--font-text); margin: 0; }
.tl-lead { margin: 0; font-size: 0.9375rem; }
.tl-pair { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .tl-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tl-chart { display: grid; gap: 0.35rem; padding-left: 3.2rem; padding-right: 0.25rem; }
.tl-plot { position: relative; height: 9rem; border-bottom: 1px solid var(--rule-strong); }
.tl-block--main .tl-plot { height: 12rem; }
.tl-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tl-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--rule); }
.tl-grid i { position: absolute; right: calc(100% + 0.4rem); transform: translateY(-50%); font: 400 0.6875rem/1 var(--font-mono); font-style: normal; color: var(--ink-2); white-space: nowrap; }
.tl-line { stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.tl-in { stroke: var(--in); }
.tl-out { stroke: var(--out); }
.tl-pay { stroke: var(--out); stroke-dasharray: 5 4; }
.tl-people { stroke: var(--people); }
.swatch-line { height: 0; width: 1rem; border-top: 2px solid var(--ink-2); border-radius: 0; background: none; align-self: center; }
.swatch-line.tl-in { border-color: var(--in); }
.swatch-line.tl-out { border-color: var(--out); }
.swatch-line.tl-pay { border-top: 2px dashed var(--out); }
.tl-end, .tl-start { position: absolute; transform: translateY(-50%); font-size: 0.6875rem; line-height: 1.1; color: var(--ink-2); white-space: nowrap; background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 0.15rem; pointer-events: none; }
.tl-end { right: 0; transform: translateY(-120%); }
.tl-end b { color: var(--ink); font-weight: 600; }
.tl-start { left: 0.15rem; transform: translateY(-120%); }
.tl-axis { position: relative; height: 1rem; font-size: 0.6875rem; color: var(--ink-2); }
.tl-axis span { position: absolute; top: 0; white-space: nowrap; }
.tl-axis span:first-child { left: 0; }
.tl-axis span:nth-child(2) { transform: translateX(-50%); }
.tl-axis span:last-child { right: 0; }
.tl-axis--bars span:nth-child(2) { transform: none; left: auto; right: 0; }
.tl-bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.tl-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 0; }
.tl-col:hover { background: var(--wash); }
.tl-seg { display: block; width: 100%; min-height: 0; border-top: 1px solid var(--surface); }
.tl-seg:first-child { border-radius: 2px 2px 0 0; }
.tl-seg.tone-in, .swatch.tone-in { background: var(--in); }
.tl-seg.tone-out, .swatch.tone-out { background: var(--out); }
.tl-spare, .swatch.tl-spare { background: var(--in-soft); outline: 1px solid var(--in); outline-offset: -1px; }
.tl-mark { position: absolute; top: -0.2rem; bottom: 0; border-left: 1px dashed var(--ink-2); z-index: 1; pointer-events: none; }
.tl-mark i { position: absolute; top: -0.9rem; left: 0.25rem; font: 400 0.6875rem/1 var(--font-text); font-style: normal; color: var(--ink-2); white-space: nowrap; }
.tl-table summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; }
.tl-table .data-table { font-size: 0.8125rem; }
@media (max-width: 30rem) { .tl-bars { gap: 1px; } }

/* ---------- Intro and questions ---------- */
.intro { display: grid; gap: 1rem; max-width: 46rem; }
.intro p { margin: 0; }
.intro-stats { list-style: none; padding: 0; margin: 0.25rem 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.intro-stats li { display: grid; gap: 0.2rem; padding: 0.75rem 0.9rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.intro-stats b { font: 600 1.5rem/1.1 var(--font-text); letter-spacing: -0.01em; }
.intro-stats span { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.35; }
.faq { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); padding: 0.2rem 0; }
.faq-item summary { cursor: pointer; padding: 0.7rem 0; list-style-position: outside; }
.faq-item summary h3 { display: inline; font-size: 1rem; margin: 0; }
.faq-item p { margin: 0 0 0.9rem; max-width: 44rem; }
.sitebar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding-block: 1rem 0.5rem; font: 500 0.8125rem/1.3 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.sitebar a { color: var(--ink); text-decoration: none; }
.sitebar a:hover { text-decoration: underline; }
.tl-col { position: relative; }
.tl-need { position: absolute; left: -1px; right: -1px; height: 0; border-top: 2px solid var(--ink); z-index: 1; }
.swatch.swatch-need { height: 0; width: 1rem; border-top: 2px solid var(--ink); border-radius: 0; background: none; align-self: center; }
.tl-mark i { top: 0.25rem; left: 0.3rem; background: var(--surface); padding: 0 0.2rem; border-radius: 2px; z-index: 2; }
.tl-mark { top: 0; z-index: 2; }
/* Focused levers and source buttons scroll clear of the sticky tabs and result bar. */
.sim :focus, .sim input, .sim .fact, .sim summary { scroll-margin-top: 12rem; }
.sitebar a { display: inline-block; padding-block: 0.35rem; min-height: 24px; }
.view-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.06; margin: 0; }


/* ---------- Hero: headline beside the year's ledger slip ---------- */
.hero { display: grid; gap: 2.5rem; padding-block: clamp(1rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
.hero-text { display: grid; gap: 1.25rem; max-width: 38rem; }
.findings { list-style: none; padding: 0; display: grid; gap: 0.9rem; }
.findings li { padding-left: 1.1rem; border-left: 2px solid var(--ink); line-height: 1.5; }
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); column-gap: 4rem; }
}

/* ---------- The scale check ---------- */
.calc { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: clamp(1rem, 2.5vw, 1.5rem); display: grid; gap: 1.5rem; max-width: var(--wide); min-width: 0; }
.calc-controls { display: grid; gap: 1.1rem; }
.calc-amount-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.calc-label { font-weight: 600; font-size: 0.9375rem; }
.calc-amount { font: 600 1.5rem/1 var(--font-text); }
.calc input[type="range"] { width: 100%; accent-color: var(--ink); height: 1.75rem; margin: 0; }
.calc-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.calc-who { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.calc-who legend { font-weight: 600; font-size: 0.9375rem; padding: 0; margin-bottom: 0.5rem; }
.calc-who label { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 0.35rem 0.85rem 0.35rem 0.6rem; font-size: 0.875rem; cursor: pointer; }
.calc-who label:has(input:checked) { border-color: var(--ink); background: var(--wash); }
.calc-who label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.calc-who input { accent-color: var(--ink); margin: 0; }
.calc-result { display: grid; gap: 0.9rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.calc-cost { font: 600 clamp(2.25rem, 7vw, 3.25rem)/1 var(--font-text); letter-spacing: -0.02em; }
.calc-cost-unit { font-size: 1.0625rem; color: var(--ink-2); }
.meterlist { display: grid; gap: 0.2rem; font-size: 0.875rem; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 0.3rem 1rem; align-items: center; padding: 0.5rem 0.4rem; border-radius: 6px; }
.meter-label { grid-area: label; min-width: 0; }
.meter-label small { display: block; color: var(--ink-2); font-size: 0.75rem; line-height: 1.35; }
.meter-value { grid-area: value; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.meter-track { grid-area: track; position: relative; height: 14px; background: var(--out-soft); border-radius: 0 4px 4px 0; min-width: 0; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--out); border-radius: 0 4px 4px 0; min-width: 2px; }
.meter-mark { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 2px; background: var(--ink); }
.meter-axis { display: grid; grid-template-columns: minmax(0, 1fr); font-size: 0.75rem; color: var(--ink-2); padding-inline: 0.4rem; }
.meter-axis-inner { position: relative; height: 1.2rem; }
.meter-axis-inner span { position: absolute; top: 0; white-space: nowrap; }
.meter-axis-inner span:nth-child(1) { left: 0; }
.meter-axis-inner span:nth-child(2) { left: 50%; transform: translateX(-50%); color: var(--ink); font-weight: 600; }
.meter-axis-inner span:nth-child(3) { right: 0; }
@media (min-width: 40rem) {
  .meter-row { grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) 5.5rem; grid-template-areas: "label track value"; }
  .meter-axis { grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr) 5.5rem; column-gap: 1rem; }
  .meter-axis-inner { grid-column: 2; }
}
.calc-erosion { border-top: 1px solid var(--rule); padding-top: 1.25rem; display: grid; gap: 0.9rem; }
.calc-erosion h3 { font-size: 0.9375rem; }

/* ---------- Scenario list ---------- */
.scenario-levers { color: var(--ink-2); }

.hero, .hero-text, .slip, .slip-group, .slip-balance, .calc, .calc-controls, .calc-result, .calc-erosion, .meterlist, .matters { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); }
}

.meter-group { font: 500 0.75rem/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding: 0.9rem 0.4rem 0.15rem; }
.meter-group:first-child { padding-top: 0.7rem; }
