/* BudgetState — the family's one stylesheet: dopecode house style, from
 * vLockin's sheet, for every BudgetState site. A site adds its own few
 * rules in its web/site.css, which the build writes after these.
 *
 * Amber goes to three places only: the mark, the selected control, and the
 * focus ring. Data takes the budget scale: over budget (or a norm) on the
 * warm arm, by how far; under it (within the norm) on the cool one; within
 * 2% neutral. Breaking a rule is the worst there is. Roles, not hexes:
 * every colour is a token that resolves per appearance. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --canvas: #F7F4EF;
  --card: #FFFDFA;
  --hover: #F7F3EC;
  --raised: #F0EBE2;
  --line: #E0D8CB;
  --line-soft: #EFE9E0;
  --text: #17130F;
  --prose: #5C5248;
  --dim: #6B6055;
  --amber: #FFB224;
  --amber-hi: #FFC65C;
  --amber-dn: #E89A12;
  --amber-text: #8F5806;
  --ink: #17130F;
  --ink-card: #1B1712;
  --ink-line: #3A322A;
  --bone: #F4EFE8;
  --ink-dim: #9A8F82;
  /* The headline number: the house's bad red, on Ink in both appearances
     (5.5:1). The one number on the page that is an alarm. */
  --alert: #F2555A;

  /* the budget scale: far over ↔ far under, neutral within 2%, a light
     fill for no report. A norm takes its arms: within it is the cool one. */
  --b-over2: #BF2F3B;
  --b-over1: #E5735F;
  --b-near: #9A8F82;
  --b-under1: #5E93E8;
  --b-under2: #2456BD;
  --b-none: #DDD5C8;
  /* one series, no judgement: the budget as planned */
  --plan: #BDB2A3;
  /* worse the more of it: vLockin's validated sequential ramp, pale to
     deep (its paler two fall under 2:1 on the card: fills, not text) */
  --heat1: #F6DCD5;
  --heat2: #EFB0A2;
  --heat3: #E27B69;
  --heat4: #C9464A;
  --heat5: #992331;
  /* the graphs' categorical series, in a fixed order: colour follows the
     thing, never a judgement, so neither is the scale's red or blue; the
     third series is --plan */
  --c1: #773F9B;
  --c2: #96872D;

  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --r-panel: 12px;
  --r-row: 10px;
  --r-ctl: 8px;
  --r-chip: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #17130F;
    --card: #1B1712;
    --hover: #211C16;
    --raised: #241E18;
    --line: #3A322A;
    --line-soft: #2B241D;
    --text: #F4EFE8;
    --prose: #BDB3A6;
    --dim: #9A8F82;
    --amber-text: #FFB224;
    --ink: #0F0D0A;
    --ink-card: #17130F;
    --b-over2: #EC5B63;
    --b-over1: #A93F37;
    --b-near: #7D7266;
    --b-under1: #3A63B8;
    --b-under2: #6793E3;
    --b-none: #3A322A;
    --plan: #54493E;
    --heat1: #3A2522;
    --heat2: #5E2E2A;
    --heat3: #8E3833;
    --heat4: #C4474B;
    --heat5: #F0666C;
    --c1: #834BA8;
    --c2: #8A7B1D;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #17130F;
  --card: #1B1712;
  --hover: #211C16;
  --raised: #241E18;
  --line: #3A322A;
  --line-soft: #2B241D;
  --text: #F4EFE8;
  --prose: #BDB3A6;
  --dim: #9A8F82;
  --amber-text: #FFB224;
  --ink: #0F0D0A;
  --ink-card: #17130F;
  --b-over2: #EC5B63;
  --b-over1: #A93F37;
  --b-near: #7D7266;
  --b-under1: #3A63B8;
  --b-under2: #6793E3;
  --b-none: #3A322A;
  --plan: #54493E;
  --heat1: #3A2522;
  --heat2: #5E2E2A;
  --heat3: #8E3833;
  --heat4: #C4474B;
  --heat5: #F0666C;
  --c1: #834BA8;
  --c2: #8A7B1D;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber-text); text-decoration: none; border-bottom: 1px solid var(--line); }
a:hover { border-bottom-color: currentColor; }
code, .mono { font-family: var(--mono); }
code { font-size: 0.88em; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: var(--r-ctl); }
:focus-visible { outline: 2px solid var(--amber-text); outline-offset: 2px; border-radius: 4px; }
.muted, .dim { color: var(--dim); }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 56px; }
@media (max-width: 720px) { .wrap { padding: 0 16px; } }

/* ── the family: every topic, above the top bar ─────────────────────── */
/* On ink, quiet, one line that scrolls on a phone: the topic being read in
   bone on the amber rule, as the top bar marks its section. It scrolls
   away with the page; the top bar under it stays. */
.family { background: var(--ink); border-bottom: 1px solid var(--ink-line); }
.family-row { display: flex; align-items: center; gap: 4px 20px; height: 34px; overflow-x: auto; scrollbar-width: none; }
.family-row::-webkit-scrollbar { display: none; }
.fam { flex: none; align-self: stretch; display: inline-flex; align-items: center; gap: 6px; border: 0; color: var(--ink-dim);
  font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.fam:hover { color: var(--bone); }
.fam[aria-current] { color: var(--bone); text-decoration: underline 2px var(--amber); text-underline-offset: 6px; }
.fam-hub { font-weight: 700; letter-spacing: -0.02em; text-transform: none; font-size: 12px; color: var(--bone); padding-right: 16px; border-right: 1px solid var(--ink-line); }
/* On a phone the topics do not fit on one line: the row scrolls under the
   front page's name, which stays at the left, and fades at the right where
   more topics wait; the rows are as tall as a thumb needs. */
@media (max-width: 720px) {
  .family-row { height: 42px; gap: 4px 18px; padding-left: 0; padding-right: 44px;
    mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .fam { font-size: 11.5px; }
  .fam-hub { position: sticky; left: 0; z-index: 1; padding-left: 16px; background: var(--ink);
    box-shadow: 14px 0 12px -8px var(--ink); }
}
.fam-mark { width: 13px; height: 13px; color: var(--amber); flex: none; }

/* ── top bar ─────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ink-line);
}
.top-row { display: flex; align-items: center; gap: 24px; height: 56px; }
.lockup { display: inline-flex; align-items: center; gap: 10px; border: 0; color: var(--bone); flex: none; }
.lockup .mark { width: 32px; height: 32px; color: var(--amber); flex: none; }
/* The name is the lockup: its two words stacked, flush left, the same size
   and weight — BudgetState in bone, the section's word in amber, the mark's
   colour — so the section reads as part of the name, not as a subtitle.
   The front page's is the name alone, set larger. */
.lockup-text { display: flex; flex-direction: column; gap: 2px; }
.wordmark { font: 700 16px/1 var(--mono); letter-spacing: -0.04em; color: var(--bone); white-space: nowrap; }
.wordmark-section { color: var(--amber); }
.lockup:hover .wordmark-section { color: var(--amber-hi); }
.lockup-hub .wordmark { font-size: 21px; }
.lockup-hub .mark { width: 28px; height: 28px; }
.nav { display: flex; gap: 16px; margin-left: auto; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-dim); border: 0; font-size: 13px; white-space: nowrap; }
.nav a:hover { color: var(--bone); }
/* The section being read, or the one a page belongs to: bone, on an amber
   rule (the selected control). */
.nav a[aria-current] { color: var(--bone); text-decoration: underline 2px var(--amber); text-underline-offset: 6px; }
/* Another language: its code, set as the theme switch beside it, so a reader
   who does not read this one finds it on every width. */
.lang { flex: none; height: 34px; min-width: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: var(--r-ctl);
  border: 1px solid var(--ink-line); color: var(--ink-dim); font: 700 12px/1 var(--mono); letter-spacing: 0.04em; }
.lang:hover { color: var(--bone); border-bottom-color: var(--ink-line); }
.top-row .lang + .theme { margin-left: -16px; }
.theme { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-ctl);
  background: transparent; border: 1px solid var(--ink-line); color: var(--ink-dim); cursor: pointer; }
.theme:hover { color: var(--bone); }
.theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* The maker, named where the maker is named: after the navigation, quiet,
   the same lockup and treatment as the footer's bar. */
.maker-top { flex: none; display: flex; align-items: center; height: 22px; padding-left: 22px;
  border: 0; border-left: 1px solid var(--ink-line); color: var(--ink-dim); opacity: 0.75; line-height: 0; }
.maker-top:hover { opacity: 1; border-left-color: var(--ink-line); }
.maker-top svg { display: block; height: 16px; width: auto; }
@media (max-width: 720px) {
  .nav { display: none; }
  .top-row { gap: 12px; }
  .top-row .lang + .theme { margin-left: -6px; }
  .maker-top { margin-left: auto; padding-left: 0; border-left: 0; }
}
@media (max-width: 400px) { .maker-top svg { height: 13px; } }
/* the narrowest phones keep the language and the theme; the footer names the maker */
@media (max-width: 370px) { .maker-top { display: none; } .top-row .lang { margin-left: auto; } }

/* ── hero: always on ink ─────────────────────────────────────────────── */
.hero { background: var(--ink); color: var(--bone); padding: 72px 0 56px; }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-text); }
.hero .eyebrow { color: var(--amber); }
/* The question the page answers, at its head: large and quiet, the mono in
   Ink 300, the one word it turns on in bone. Never amber. */
.hero .ask { margin: 0 0 20px; font: 700 clamp(28px, 4.2vw, 50px)/1.05 var(--mono); letter-spacing: -0.04em; word-spacing: -0.3em; color: var(--ink-dim); }
.hero .ask strong { font-weight: 700; color: var(--bone); }
.hero h1 { margin: 22px 0 0; font-size: clamp(26px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; max-width: 900px; }
.hero h1 .big { display: block; font-size: clamp(88px, 17vw, 196px); line-height: 0.9; letter-spacing: -0.06em; color: var(--alert); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.hero h1 .big.mid { font-size: clamp(64px, 11vw, 132px); }
/* Under budget is good news: the cool arm's bright step, legible on ink;
   within 2% is neither, in bone. */
.hero h1 .big.good { color: #6793E3; }
.hero h1 .big.flat { color: var(--bone); }
.hero .lede { margin-top: 22px; font-size: 17px; line-height: 1.6; color: var(--ink-dim); max-width: 680px; text-wrap: pretty; }
.hero .lede a { color: var(--amber-hi); border-bottom-color: var(--ink-line); }
.hero .lede strong { color: var(--bone); }
.hero .lede em { font-style: normal; font-weight: 600; color: var(--bone); }
.hero-foot { margin-top: 28px; font-size: 12px; color: var(--ink-dim); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px 48px; align-items: start; }
@media (max-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } .hero-map { max-width: 440px; } }
.crumbs { font-size: 13px; color: var(--ink-dim); margin-bottom: 18px; }
.crumbs a { color: var(--ink-dim); border-bottom-color: var(--ink-line); }

.seg-control { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: var(--r-ctl);
  background: var(--card); border: 1px solid var(--line); }
.seg-control button { font: 13px/1 var(--sans); color: var(--dim); background: transparent; border: 0; border-radius: var(--r-chip);
  padding: 8px 12px; cursor: pointer; min-height: 32px; }
.seg-control button:hover { color: var(--text); background: var(--hover); }
.seg-control button[aria-selected="true"] { background: var(--raised); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--amber); }
.hero .seg-control { margin-top: 36px; background: var(--ink-card); border-color: var(--ink-line); }
.hero .seg-control button { color: var(--ink-dim); }
.hero .seg-control button:hover { color: var(--bone); background: #211C16; }
.hero .seg-control button[aria-selected="true"] { background: #241E18; color: var(--bone); }

/* ── tiles: the hero's families of facts ─────────────────────────────── */
.tiles { margin-top: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .tiles, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 26px; }
  /* two to a row: an odd last tile takes the row, not half of it */
  .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .tiles, .tiles.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
  .tile { padding: 12px; }
  .tile-v { font-size: 24px; }
  .tile-d { font-size: 11.5px; }
  .tile-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}
.tfam { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tfam-k { font: 700 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone);
  padding: 0 2px 8px; border-bottom: 1px solid var(--ink-line); }
.tile { background: var(--ink-card); border: 1px solid var(--ink-line); border-radius: var(--r-panel); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--bone); }
a.tile { border-bottom: 1px solid var(--ink-line); }
a.tile:hover { background: #211C16; }
.tile-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tile-k { font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); min-width: 0; }
.tile-v { font-size: clamp(26px, 2.8vw, 34px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-v.alarm { color: var(--alert); }
.tile-d { font-size: 12px; color: var(--ink-dim); line-height: 1.45; }
.tile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.tile-n { font: 10px/1 var(--mono); color: var(--ink-dim); white-space: nowrap; }
.tile-bar { height: 4px; border-radius: 2px; background: var(--ink-line); overflow: hidden; display: flex; margin-top: 4px; }
.tile-bar i { display: block; height: 100%; background: var(--b-over2); }
@media (max-width: 1000px) { .tile-top { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* ── callouts: the band of findings under the hero ──────────────────── */
.band { background: var(--card); border-bottom: 1px solid var(--line); }
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); }
.callout { padding: 28px 24px 30px 0; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line-soft); }
.callout + .callout { padding-left: 24px; }
.callout:last-child { border-right: 0; }
.callout-v { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.callout-t { font-size: 14px; color: var(--prose); line-height: 1.5; }
@media (max-width: 820px) {
  .callouts { grid-template-columns: 1fr; }
  .callout, .callout + .callout { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .callout:last-child { border-bottom: 0; }
}

/* ── sections ────────────────────────────────────────────────────────── */
.section { padding: 72px 0 8px; }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.section h2 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.015em; line-height: 1.15; }
.section h3 { font-size: 17px; letter-spacing: -0.01em; margin: 28px 0 10px; }
.prose { font-size: 15px; color: var(--prose); max-width: 680px; line-height: 1.6; text-wrap: pretty; }
.prose + .prose { margin-top: 10px; }
.prose strong { color: var(--text); }
.note { margin-top: 12px; font-size: 12.5px; line-height: 1.55; color: var(--dim); max-width: 760px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; font-size: 12px; color: var(--prose); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-k { font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

/* ── the budget scale ────────────────────────────────────────────────── */
.b-over2 { background: var(--b-over2); }
.b-over1 { background: var(--b-over1); }
.b-near { background: var(--b-near); }
.b-under1 { background: var(--b-under1); }
.b-under2 { background: var(--b-under2); }
.b-none { background: var(--b-none); }
/* the rules broken — no filing, a filing error — the worst there is: the
   far-over red, crossed out where nothing was filed, striped where the
   filing was wrong. Text that reports them takes the same red. */
.b-nofile { background: linear-gradient(45deg, transparent 40%, #fff 40% 60%, transparent 60%),
  linear-gradient(-45deg, transparent 40%, #fff 40% 60%, transparent 60%), var(--b-over2); }
.b-err { background: repeating-linear-gradient(135deg, var(--b-over2) 0 2px, transparent 2px 4px),
  color-mix(in srgb, var(--b-over2) 30%, transparent); }
.sw-plan { background: var(--plan); } .sw-text { background: var(--text); }
.sw-b-over2 { background: var(--b-over2); } .sw-b-over1 { background: var(--b-over1); } .sw-b-near { background: var(--b-near); }
.sw-b-under1 { background: var(--b-under1); } .sw-b-under2 { background: var(--b-under2); } .sw-b-none { background: var(--b-none); }
.sw-heat1 { background: var(--heat1); } .sw-heat2 { background: var(--heat2); } .sw-heat3 { background: var(--heat3); }
.sw-heat4 { background: var(--heat4); } .sw-heat5 { background: var(--heat5); }
.sw-c1 { background: var(--c1); } .sw-c2 { background: var(--c2); }
/* A gap in its step: white on the strong steps, ink on the pale ones. */
.pill { display: inline-block; min-width: 58px; padding: 2px 7px; border-radius: var(--r-chip); font: 700 12px/1.5 var(--mono);
  text-align: right; color: #fff; white-space: nowrap; }
.pill.b-near, .pill.b-none, .pill.b-under1, .pill.b-over1 { color: var(--text); }
:root[data-theme="dark"] .pill.b-under1, :root[data-theme="dark"] .pill.b-over1 { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.b-under1, :root:not([data-theme="light"]) .pill.b-over1 { color: #fff; } }
.pill.sw-heat1, .pill.sw-heat2 { color: var(--text); }
.alert-inline { color: var(--b-over2); }
.dtable .alert-inline, .trow .alert-inline, .brow .alert-inline { white-space: nowrap; }
.alert-inline .ico-alert { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; }
.hero .alert-inline { color: var(--alert); }
.hero .alert-inline strong { color: var(--alert); }
.ico-alert { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alert-line .ico-alert { stroke: var(--b-over2); }
.hero .ico-alert { stroke: var(--alert); }
.scale-inline { display: inline-flex; gap: 2px; vertical-align: -1px; margin: 0 4px; }
.scale-inline i { width: 16px; height: 9px; display: inline-block; }
.scale-inline i:first-child { border-radius: 2px 0 0 2px; }
.scale-inline i:last-child { border-radius: 0 2px 2px 0; }
/* A spark: a small bar per year, up for over budget and down for under. */
.spark { display: inline-flex; align-items: center; gap: 2px; height: 26px; }
.spark i { display: block; width: 6px; height: 13px; position: relative; background: none; }
.spark i::after { content: ""; position: absolute; left: 0; right: 0; border-radius: 1px; background: inherit; }
.spark i.pos::after { bottom: 50%; height: calc(var(--h) / 2); }
.spark i.neg::after { top: 50%; height: calc(var(--h) / 2); }
.spark i.b-over2::after { background: var(--b-over2); }
.spark i.b-over1::after { background: var(--b-over1); }
.spark i.b-near::after { background: var(--b-near); }
.spark i.b-under1::after { background: var(--b-under1); }
.spark i.b-under2::after { background: var(--b-under2); }
.spark i.b-none::after { background: var(--line); }
.spark i.b-nofile::after, .spark i.b-err::after { background: var(--b-over2); }
.hero .spark i.b-none::after { background: var(--ink-line); }
.hero .spark i { height: 26px; }
.alert-line { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-row);
  background: color-mix(in srgb, var(--b-over2) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--b-over2) 40%, var(--line)); font-size: 14px; }
.hero .alert-line { background: color-mix(in srgb, var(--alert) 12%, var(--ink-card)); border-color: color-mix(in srgb, var(--alert) 45%, var(--ink-line)); color: var(--bone); }

/* ── bars: one line per thing, its gap from the middle ──────────────── */
.bars { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 14px 20px; }
.brow { position: relative; display: grid; grid-template-columns: minmax(120px, 240px) 1fr 120px; gap: 14px; align-items: center; padding: 7px 0; border-radius: 6px; }
.brow:hover { background: var(--hover); }
.brow .l { font-size: 13px; display: flex; flex-direction: column; min-width: 0; }
.brow .l b, .brow .l a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); border: 0; }
.brow .l a::after { content: ""; position: absolute; inset: 0; }
.brow .l span { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .track { height: 14px; position: relative; }
.brow .track.div::before { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 1px solid var(--line); }
.brow .fill { position: absolute; top: 0; height: 100%; min-width: 3px; }
.brow .fill.pos { left: 50%; border-radius: 0 4px 4px 0; }
.brow .fill.neg { right: 50%; border-radius: 4px 0 0 4px; }
.brow .fill.share { left: 0; border-radius: 0 4px 4px 0; }
.brow .v { font: 12px var(--mono); text-align: right; color: var(--text); white-space: nowrap; }
.brow .v small { color: var(--dim); font-size: 11px; display: block; }
@media (max-width: 720px) {
  .bars { padding: 10px 14px; }
  .brow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "t t"; gap: 6px 12px; padding: 8px 0; }
  .brow .l { grid-area: l; }
  .brow .l b, .brow .l a { white-space: normal; }
  .brow .track { grid-area: t; height: 10px; }
  .brow .v { grid-area: v; }
}

/* ── top tens: the highest and the lowest ───────────────────────────── */
/* Every pair of picks is in the page, ranked at build time; the controls
   the script shows pick the one in view. Without them the first reads. */
.picks { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.ctl { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ctl-k { font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.tops-scope { font-size: 12px; color: var(--dim); margin: 0 0 12px; }
.tops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .tops { grid-template-columns: minmax(0, 1fr); } }
.top-panel { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px 20px 14px; }
/* The panel's edge says which end of the scale it lists. */
.top-panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--edge); }
.top-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section .top-head h3 { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.thumb { align-self: baseline; transform: translateY(2px); display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--edge) 14%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--edge) 40%, var(--card)); }
.thumb svg { width: 20px; height: 20px; fill: none; stroke: var(--edge); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-panel { --edge: var(--b-under2); }
.top-panel.worst { --edge: var(--b-over2); }
.top-head .top-n { font-size: clamp(56px, 7vw, 80px); font-weight: 700; line-height: 0.85; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.top-head > span { font-size: 11px; color: var(--dim); white-space: nowrap; }
.top-rule { font-size: 12px; color: var(--prose); margin: 8px 0 10px; }
.top-empty { font-size: 14px; color: var(--prose); padding: 10px 0 6px; }
.top-list { list-style: none; margin: 0 -8px; padding: 0; }
.trow { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 132px; grid-template-areas: "rk who fp sc";
  gap: 12px; align-items: center; padding: 7px 8px; border-radius: 8px; }
.trow:hover { background: var(--hover); }
.trow .rk { grid-area: rk; font-size: 15px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.trow .rk.tie { color: var(--dim); font-weight: 400; }
.trow .who { grid-area: who; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trow .who a { font-size: 14px; font-weight: 600; color: var(--text); border: 0; }
.trow .who small { font: 11px var(--mono); color: var(--dim); overflow-wrap: anywhere; }
.trow .sc { grid-area: sc; font: 700 13px var(--mono); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .sc small { display: block; font: 400 10px/1.3 var(--mono); margin-top: 2px; }
.trow .sc.bad, .trow .who small.bad { color: var(--b-over2); }
.trow .ico-alert { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; stroke: currentColor; }
/* The strip: a bar per period, in the step of its figure. */
.fp { grid-area: fp; display: flex; gap: 1px; height: 20px; align-items: stretch; }
.fp i { display: block; flex: none; width: 3px; border-radius: 1px; box-shadow: inset 0 -2px var(--line); }
.fp i[class] { box-shadow: none; }
.trow .spark { grid-area: fp; }
.tops-key { margin: 14px 0 0; }
@media (max-width: 520px) {
  .trow { grid-template-columns: 22px minmax(0, 1fr) 88px; grid-template-areas: "rk who sc" "rk fp sc"; gap: 6px 10px; }
  .fp { height: 14px; }
  .trow .sc { font-size: 12px; }
}

/* ── tables ──────────────────────────────────────────────────────────── */
/* A table wider than its column scrolls; a shadow on the side where more
   of it waits says so, and goes where the table ends (the covers move with
   the table, the shadows stay with the box). */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-panel);
  background:
    linear-gradient(to right, var(--card) 40%, transparent) left center / 32px 100% no-repeat local,
    linear-gradient(to left, var(--card) 40%, transparent) right center / 32px 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--text) 18%, transparent), transparent) left center / 14px 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--text) 18%, transparent), transparent) right center / 14px 100% no-repeat scroll,
    var(--card); }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th, .dtable td { padding: 9px 12px; text-align: left; vertical-align: top; }
.dtable thead th { font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  border-bottom: 1px solid var(--line); background: var(--card); vertical-align: bottom; min-width: 84px; max-width: 200px; }
.dtable thead th:first-child { min-width: 200px; max-width: none; }
.dtable thead th small { text-transform: none; letter-spacing: 0; margin-top: 2px; }
.dtable thead th[data-sort] { cursor: pointer; user-select: none; }
.dtable thead th[data-sort]:hover, .dtable thead th.sorted { color: var(--text); }
.dtable thead th.sorted::after { content: " ↓"; }
.dtable thead th.sorted.asc::after { content: " ↑"; }
.dtable tbody tr { border-top: 1px solid var(--line-soft); }
.dtable tbody tr:hover { background: var(--hover); }
.dtable tbody th { font-weight: 600; min-width: 200px; }
.dtable tbody th a { color: var(--text); border-bottom-color: var(--line); }
/* A row whose name is a link opens that page from anywhere on the row: the
   link's box stretches over the row, its containing block. No script; the
   link keeps its address, its new tab and its place in the tab order. */
.dtable tbody tr, .trow { position: relative; }
.dtable tbody th a::after, .trow .who a::after { content: ""; position: absolute; inset: 0; }
.dtable tbody tr:hover th a { border-bottom-color: currentColor; }
.dtable tbody th a:focus-visible, .trow .who a:focus-visible { outline: 0; }
.dtable tbody th a:focus-visible::after, .trow .who a:focus-visible::after { outline: 2px solid var(--amber-text); outline-offset: -2px; border-radius: 4px; }
.dtable small { display: block; color: var(--dim); font: 11px var(--mono); font-weight: 400; }
.dtable .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.dtable .date { font-family: var(--mono); white-space: nowrap; }
.dtable thead th.num { white-space: normal; font-family: var(--mono); min-width: 96px; }
.dtable .num small { font-family: var(--mono); }
.dtable tr.sep th { padding-top: 18px; font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-text); }
.dtable tr.sub th { padding-left: 32px; font-weight: 400; }
.dtable tr.total th, .dtable tr.total td { font-weight: 700; border-top: 1px solid var(--line); }
.dtable .neg { color: var(--b-over2); }
.dtable td.empty { color: var(--dim); }
.dtable .dim { color: var(--dim); }
.wide { min-width: 880px; }
/* A long list's finder: a field that keeps the rows whose name it matches. */
.finder { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 18px; }
.finder label { display: flex; flex-direction: column; gap: 6px; font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.field { min-width: 260px; font: 15px var(--sans); padding: 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--card); color: var(--text); }
.field:focus { outline: none; border-color: var(--amber-hi); box-shadow: 0 0 0 2px var(--amber-text); }
.finder .hint { font-size: 12px; color: var(--dim); }
/* A row the finder or a filter leaves out. */
.dtable tbody tr[data-out-find], .dtable tbody tr[data-out-pick] { display: none; }
.finder .seg-control { align-self: flex-end; }

/* ── cards, facts ───────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 36px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
a.card { color: var(--text); display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
a.card:hover { background: var(--hover); }
.card .card-k { font: 500 10px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.card .card-v { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.card .card-d { font-size: 13px; color: var(--prose); line-height: 1.5; }

/* ── graphs: drawn at build time, written as SVG ─────────────────────── */
/* Each graph is drawn twice: the page shows the one its width takes. Every
   colour is a token class, so a graph turns dark with the page. */
.chart { margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px 12px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--mono); }
.chart .draw-narrow { display: none; }
@media (max-width: 720px) {
  .chart { padding: 14px 12px 8px; }
  .chart .draw-wide { display: none; }
  .chart .draw-narrow { display: block; }
}
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin: 28px 0 10px; }
.chart-head h3 { margin: 0; }
.wrap > .chart-head:first-child { margin-top: 0; }
.chart-head .legend { margin: 0; }
.charts-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .charts-2 { grid-template-columns: minmax(0, 1fr); } }
.charts-2 .chart-head { margin-top: 0; }
/* A map, the places over it; on ink in the hero. */
.map-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-dim); max-width: 400px; }
.hero .hero-map { --card: var(--ink); --canvas: var(--ink-card); --line: var(--ink-line); --text: var(--bone); --dim: var(--ink-dim);
  --b-over2: #EC5B63; --b-over1: #A93F37; --b-near: #7D7266; --b-under1: #3A63B8; --b-under2: #6793E3; --b-none: #4A4037;
  --heat1: #3A2522; --heat2: #5E2E2A; --heat3: #8E3833; --heat4: #C4474B; --heat5: #F0666C; }
.hero-map .legend { margin: 12px 0 0; color: var(--ink-dim); }
.hero .chart.map { background: transparent; border: 0; padding: 0; margin: 0; }
.chart.map { padding: 8px; }
.with-map { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .with-map { grid-template-columns: minmax(0, 1fr); } .with-map .chart { max-width: 380px; } }
/* A sparkline in a table's row, the size of a word. */
.chart.spark { display: block; background: none; border: 0; border-radius: 0; padding: 0; margin: 0; height: auto; }
.chart.spark svg { width: 112px; height: 26px; overflow: hidden; }
.dtable .spark-col { min-width: 132px; }
.dtable td.spark-col small { display: block; margin-top: 2px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
/* The readouts: a zone per mark; hovered, its band or cursor and its card. */
.chart .zone { fill: transparent; }
.chart .hit .band { fill: var(--text); opacity: 0; }
.chart .hit .cursor { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .hit .dot { stroke: var(--card); stroke-width: 2; opacity: 0; }
.chart .hit .tip { opacity: 0; pointer-events: none; }
.chart .hit .ring { fill: none; stroke: var(--text); stroke-width: 2; opacity: 0; }
.chart .hit:hover .band { opacity: 0.06; }
.chart .hit:hover .ring { opacity: 1; }
.chart a { outline: none; border: 0; }
.chart a:focus-visible .ring, .chart a:focus-visible .tip { opacity: 1; }
.chart .hit:hover .cursor, .chart .hit:hover .dot, .chart .hit:hover .tip { opacity: 1; }
.chart .tip rect:first-child { fill: var(--ink); stroke: var(--ink-line); stroke-width: 1; }
.chart .tip text { fill: var(--bone); }
.chart .tip text.k { fill: var(--ink-dim); }
.chart .f-text { fill: var(--text); } .chart .s-text { stroke: var(--text); } .chart .t-text { stop-color: var(--text); }
.chart .f-dim { fill: var(--dim); } .chart .s-dim { stroke: var(--dim); } .chart .t-dim { stop-color: var(--dim); }
.chart .f-line { fill: var(--line); } .chart .s-line { stroke: var(--line); } .chart .t-line { stop-color: var(--line); }
.chart .f-card { fill: var(--card); } .chart .s-card { stroke: var(--card); } .chart .t-card { stop-color: var(--card); }
.chart .f-canvas { fill: var(--canvas); } .chart .s-canvas { stroke: var(--canvas); } .chart .t-canvas { stop-color: var(--canvas); }
.chart .f-b-over2 { fill: var(--b-over2); } .chart .s-b-over2 { stroke: var(--b-over2); } .chart .t-b-over2 { stop-color: var(--b-over2); }
.chart .f-b-over1 { fill: var(--b-over1); } .chart .s-b-over1 { stroke: var(--b-over1); } .chart .t-b-over1 { stop-color: var(--b-over1); }
.chart .f-b-near { fill: var(--b-near); } .chart .s-b-near { stroke: var(--b-near); } .chart .t-b-near { stop-color: var(--b-near); }
.chart .f-b-under1 { fill: var(--b-under1); } .chart .s-b-under1 { stroke: var(--b-under1); } .chart .t-b-under1 { stop-color: var(--b-under1); }
.chart .f-b-under2 { fill: var(--b-under2); } .chart .s-b-under2 { stroke: var(--b-under2); } .chart .t-b-under2 { stop-color: var(--b-under2); }
.chart .f-b-none { fill: var(--b-none); } .chart .s-b-none { stroke: var(--b-none); } .chart .t-b-none { stop-color: var(--b-none); }
.chart .f-plan { fill: var(--plan); } .chart .s-plan { stroke: var(--plan); } .chart .t-plan { stop-color: var(--plan); }
.chart .f-heat1 { fill: var(--heat1); } .chart .s-heat1 { stroke: var(--heat1); } .chart .t-heat1 { stop-color: var(--heat1); }
.chart .f-heat2 { fill: var(--heat2); } .chart .s-heat2 { stroke: var(--heat2); } .chart .t-heat2 { stop-color: var(--heat2); }
.chart .f-heat3 { fill: var(--heat3); } .chart .s-heat3 { stroke: var(--heat3); } .chart .t-heat3 { stop-color: var(--heat3); }
.chart .f-heat4 { fill: var(--heat4); } .chart .s-heat4 { stroke: var(--heat4); } .chart .t-heat4 { stop-color: var(--heat4); }
.chart .f-heat5 { fill: var(--heat5); } .chart .s-heat5 { stroke: var(--heat5); } .chart .t-heat5 { stop-color: var(--heat5); }
.chart .f-c1 { fill: var(--c1); } .chart .s-c1 { stroke: var(--c1); } .chart .t-c1 { stop-color: var(--c1); }
.chart .f-c2 { fill: var(--c2); } .chart .s-c2 { stroke: var(--c2); } .chart .t-c2 { stop-color: var(--c2); }

/* ── phones ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .hero { padding: 40px 0 40px; }
  .section { padding: 52px 0 4px; }
  .dtable th, .dtable td { padding: 8px 9px; }
  .dtable thead th, .dtable thead th:first-child, .dtable thead th.num, .dtable tbody th { min-width: 0; }
  .dtable tbody th { max-width: 46vw; }
}

/* ── method ──────────────────────────────────────────────────────────── */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.method-grid .card p, .method-grid .mcard p { font-size: 14px; color: var(--prose); line-height: 1.6; }
.method-grid .card p + p { margin-top: 8px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px 20px; }
.mcard h3 { margin: 0 0 8px; }

/* ── 404: the page booked as a budget line ──────────────────────────── */
.nf-hero h1 { overflow-wrap: anywhere; }
.nf-ledger { margin: 32px 0 0; max-width: 680px; padding: 16px 20px 14px; background: var(--ink-card); border: 1px solid var(--ink-line);
  border-radius: var(--r-panel); font-size: 13px; color: var(--bone); }
.nl-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px 84px; gap: 12px; align-items: center; padding: 6px 0; }
.nl-row > span:not(:first-child) { text-align: right; }
.nl-head { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); border-bottom: 1px solid var(--ink-line); padding-top: 0; }
.nl-line { overflow-wrap: anywhere; font-weight: 700; }
.nl-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--ink-line); font-size: 11.5px; color: var(--ink-dim); }
.nl-foot b { color: var(--alert); font-weight: 700; }
@media (max-width: 520px) { .nl-row { grid-template-columns: minmax(0, 1fr) 58px 58px 70px; gap: 8px; font-size: 12px; } }
.nf-go { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.nf-go a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-panel); color: var(--text); }
.nf-go a:hover { background: var(--hover); border-color: var(--line); }
.nf-go a[aria-current] { box-shadow: inset 0 0 0 1px var(--amber); }
.nf-go-t { font-size: 15px; font-weight: 600; }
.nf-go-d { font: 12px var(--mono); line-height: 1.5; color: var(--dim); }

/* ── footer ──────────────────────────────────────────────────────────── */
.foot { margin-top: 96px; background: var(--ink); color: var(--ink-dim); padding: 40px 0 36px; }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.foot .lockup .mark { width: 26px; height: 26px; }
.foot .wordmark { font-size: 13px; }
.foot-family { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-family a { color: var(--ink-dim); border: 0; font: 500 11px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.foot-family a:hover { color: var(--bone); }
.foot-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--ink-line); font-size: 12px; }
.foot-maker { display: flex; align-items: center; gap: 14px; }
.foot-maker a { display: block; color: var(--ink-dim); opacity: 0.75; line-height: 0; border: 0; }
.foot-maker a:hover { opacity: 1; }
.foot-maker svg { display: block; height: 18px; width: auto; }

/* BudgetState Agencies — its own few rules, after the family's stylesheet
 * (the kit's web/style.css): every status in one bar under the hero, its
 * key, and a status beside its swatch. No new colours: the budget scale for
 * within and over, neutral for spending without a budget, the "not filed"
 * cross for nothing shown. */
.zstack { display: flex; height: 14px; margin-top: 30px; border-radius: 4px; overflow: hidden; max-width: 760px; gap: 2px; }
.zstack i { display: block; min-width: 3px; }
.zkey { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 12.5px; color: var(--ink-dim); max-width: 760px; }
.zkey span { display: inline-flex; align-items: center; gap: 7px; }
.zkey b { color: var(--bone); font-weight: 600; }
.zst { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12.5px; }
.hero .lede .zst { font-size: 15px; }
.zst .sw.b-none { background: var(--line); }
