:root {
  --bg: #eef1f2;
  --panel: #ffffff;
  --ink: #17181a;
  --muted: #525a5f;
  --muted-2: #7c868c;
  --line: #dde2e4;
  --accent: #0b6e80;
  --accent-2: #006494;
  --accent-soft: #e8f2f7;
  --good: #1b7f5d;
  --bad: #ad3f2f;
  /* Water/Sanitation/Hygiene/ladder colors sampled directly from
     washdata.org (WHO/UNICEF JMP): water = blue family, sanitation =
     green family, hygiene = JMP's own purple (its third SDG6.2 ladder),
     shared amber/red for the sub-Basic ladder rungs. Institutional
     (schools + health facilities, not a JMP topic) has its own amber-
     brown, freed up from an earlier round that borrowed the hygiene
     purple for it before hygiene was modelled as a real sector —
     re-validated as a 4-color categorical set (validate_palette.py, all
     checks pass) after this change. */
  --water: #0080c6;
  --water-light: #00b8ec;
  --water-soft: #e5f4fb;
  --sanitation: #2e7d32;
  --sanitation-light: #66bb6a;
  --sanitation-soft: #eaf5ea;
  --hygiene: #9a48b2;
  --hygiene-soft: #f4e9f7;
  --institutional: #c77d18;
  --institutional-soft: #fbf0e0;
  --capex: #2f5fa8;
  --capex-soft: #eaf0fb;
  --opex: #b5326f;
  --opex-soft: #fbe9f1;
  --ladder-limited: #ffda46;
  --ladder-unimproved: #fcba12;
  --ladder-none: #d32f2f;
  /* JMP's own dark navy chrome (sampled: rgb(38,50,56)) */
  --navy: #263238;
  --navy-2: #37474f;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-soft: 0 1px 3px rgba(23, 24, 26, 0.08);
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Helvetica", "Arial", sans-serif;
}

* { box-sizing: border-box; }

html, body { font-family: var(--font); }

body {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  background: var(--bg);
}

/* ---- top bar (mirrors washdata.org's persistent dark navy nav) ---- */
.topbar { background: var(--navy); position: sticky; top: 0; z-index: 10; }
.topbar-inner {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 0;
  min-height: 56px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 10px 0; }
.brand-mark { display: block; width: 22px; height: 22px; flex: none; }
.brand-name { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-name b { font-weight: 800; }
.brand-sub { display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #9fb0b6; margin-top: -2px; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.tab-btn {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 17px 13px 14px;
  font: 600 0.86rem var(--font);
  color: #c3ccd0;
  background: transparent;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: #fff; border-bottom-color: var(--water-light); }

/* Currency toggle (Phase 3) — sits in the topbar, visible on every tab */
.currency-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.currency-btns { display: flex; border: 1px solid #3d5760; border-radius: 7px; overflow: hidden; }
.currency-btn { border: none; background: transparent; color: #c3ccd0; font: 700 0.72rem var(--font); padding: 6px 10px; cursor: pointer; letter-spacing: 0.03em; }
.currency-btn.active { background: var(--water-light); color: #08262e; }
.currency-rate { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: #c3ccd0; white-space: nowrap; }

/* Unsaved-edits indicator — visible from every tab (topbar, like the
   currency toggle), so a live parameter edit is confirmed as "taken
   effect" no matter which tab you're looking at, and so leaving the
   page (refresh, close tab, navigate away) without saving is a
   deliberate choice, not a silent surprise (paired with the
   beforeunload confirm in app.js). Direct response to a user report
   that read exactly like this: edits ARE applied live, but with no
   visible confirmation of that outside the Parameters tab itself, an
   accidental refresh discarding unsaved work looked identical to
   "changing parameters doesn't do anything." */
/* :not([hidden]), not a bare class selector — an author stylesheet's
   `display` on the class otherwise wins the cascade over the browser's
   own `[hidden]{display:none}` default (equal specificity, author rule
   comes later in source order), so the element would show even while
   `hidden` — a real bug caught by actually rendering the page fresh and
   looking, not assumed away. */
.unsaved-indicator:not([hidden]) { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(245, 166, 35, 0.16); border: 1px solid rgba(245, 166, 35, 0.4); color: #ffd48a; font: 700 0.72rem var(--font); white-space: nowrap; cursor: pointer; }
.unsaved-indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f5a623; flex: none; }
.unsaved-indicator:hover { background: rgba(245, 166, 35, 0.24); }
.currency-rate input { width: 68px; padding: 4px 6px; border-radius: 5px; border: 1px solid #3d5760; background: #16333c; color: #fff; font: 600 0.75rem var(--font); }
.currency-reset { border: none; background: transparent; color: #9fb0b6; cursor: pointer; font-size: 0.9rem; padding: 2px; }
.currency-reset:hover { color: #fff; }
.currency-basis { font-size: 0.66rem; color: #9fb0b6; border-bottom: 1px dotted #5d757e; cursor: help; min-width: 0; overflow-wrap: break-word; }

/* ---- page shell ---- */
.shell {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: grid;
  gap: 14px;
}
/* #main is .shell's grid item (the single implicit column everything
   else stacks inside). A grid item's default min-width is `auto`, which
   lets it grow past its track's width to fit its widest descendant
   (here, a 33-district table) instead of respecting the track and
   letting that descendant's own overflow-x:auto scroll internally —
   the real cause of the whole PAGE scrolling sideways on narrow
   viewports on tabs with wide tables, not anything about the tables or
   .table-wrap themselves (which were already set up correctly). */
.shell > #main { min-width: 0; }

.hero, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0; /* same fix, one level down, for panels inside a flex/grid parent (e.g. .chart-grid) */
}

.hero { padding: 22px 24px; }
.panel { padding: 18px; box-shadow: var(--shadow-soft); }

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

h1, h2, h3 { margin: 0; font-family: var(--font); }
h1 { margin-top: 6px; font-size: clamp(1.5rem, 2.6vw, 2.15rem); letter-spacing: -0.01em; font-weight: 800; }
h2 { font-size: 1.14rem; margin-bottom: 4px; font-weight: 700; }
h3 { font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; font-weight: 700; }

.lead { margin: 8px 0 0; max-width: 980px; color: var(--muted); line-height: 1.55; font-size: 0.96rem; }
p.note { color: var(--muted); font-size: 0.87rem; line-height: 1.55; margin: 6px 0 12px; }
p.note code { background: #eef2f5; border-radius: 4px; padding: 1px 5px; font-size: 0.82em; }
p.note.danger { color: var(--bad); font-weight: 600; }
.evidence-workspace details { margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.evidence-workspace details > summary { cursor: pointer; padding: 13px 15px; font-weight: 750; color: var(--navy); }
.evidence-workspace details[open] > summary { border-bottom: 1px solid var(--border); background: var(--accent-soft); }
.evidence-workspace details > div { padding: 2px 14px 14px; }

.formula-block {
  margin: 8px 0 12px;
  padding: 11px 14px;
  background: #f6f8f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.7;
}
.formula-block code { background: none; padding: 0; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; color: var(--ink); font-size: 0.88em; }

/* ---- KPI cards (used within Home / Results content, not global chrome) */
.top-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 10px;
}
/* Third attempt at this component (see CLAUDE.md's Round 17/18 notes):
   a colored left rail + tinted gradient + a colored number was still
   read as generic "AI dashboard" styling — that exact combination
   (accent bar/rail on a rounded card, a colored figure) is one of the
   patterns that clusters across AI-generated UI. Rebuilt around
   restraint instead of color: a plain hairline card, ONE ink color for
   every number (so the row reads as a considered set, not a color
   wheel), and identity carried by a single small dot beside the label —
   the smallest device that still lets a water figure read as "water" at
   a glance, spending color by the gram rather than the fistful. Numbers
   lead on size and weight (a real type-scale jump + tabular figures),
   not on hue. Six identity colors still cycle by a card's position in
   its row (see the dot-only rule below) — unchanged from before, just
   no longer driving the border, fill or number color too. */
.top-card, .kpi {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}
.top-card:hover, .kpi:hover { border-color: var(--muted-2); }
.top-card .label, .kpi .label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); font-weight: 700; display: flex; align-items: center; gap: 7px; }
.top-card .label::before, .kpi .label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--kpi-c, var(--accent)); flex: none; }
.top-card strong, .kpi .value { font-size: 1.5rem; display: block; margin: 6px 0 3px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.top-card .sub, .kpi .sub { font-size: 0.74rem; color: var(--muted-2); }
.top-cards > :nth-child(6n+1), .kpi-row > :nth-child(6n+1) { --kpi-c: var(--accent); }
.top-cards > :nth-child(6n+2), .kpi-row > :nth-child(6n+2) { --kpi-c: var(--water); }
.top-cards > :nth-child(6n+3), .kpi-row > :nth-child(6n+3) { --kpi-c: var(--sanitation); }
.top-cards > :nth-child(6n+4), .kpi-row > :nth-child(6n+4) { --kpi-c: var(--capex); }
.top-cards > :nth-child(6n+5), .kpi-row > :nth-child(6n+5) { --kpi-c: var(--opex); }
.top-cards > :nth-child(6n+6), .kpi-row > :nth-child(6n+6) { --kpi-c: var(--hygiene); }

/* ---- secondary sub-tabs (Data tab) — deliberately smaller/muted, this
   is the "background" editing area, not the primary navigation ---- */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.subtab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font: 600 0.78rem var(--font);
  color: var(--muted);
  background: #f4f6f7;
  cursor: pointer;
}
.subtab-btn:hover { background: #eceff0; }
.subtab-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
/* 3.18.0: the section strip under each top-level tab (Results, Method &
   inputs) is the page's main navigation, so it reads a size up from the
   Inputs sub-tabs below it. */
.section-nav { border-bottom: 0; padding-bottom: 0; margin-bottom: 16px; }
.section-nav .subtab-btn { font-size: 0.86rem; padding: 8px 16px; background: var(--panel); }
.section-nav .subtab-btn.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
/* 3.19.0: one orientation line above a group's section strip. */
.group-intro { margin: 0 0 12px; max-width: 980px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.group-intro b { color: var(--ink); }
/* 3.19.0: Inputs is one row of numbered steps that also explain
   themselves; there is no third level of menus under them. */
.inputs-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.inputs-steps .input-step { display: flex; align-items: flex-start; gap: 9px; text-align: left; border-radius: var(--radius-sm); padding: 10px 12px; background: var(--panel); min-height: 64px; }
.inputs-steps .input-step:hover { background: var(--accent-soft); }
.input-step-n { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 0.8rem; font-weight: 800; }
.input-step-text { display: flex; flex-direction: column; gap: 2px; }
.input-step-label { font-size: 0.88rem; font-weight: 800; color: var(--ink); }
.input-step-blurb { font-size: 0.76rem; font-weight: 500; color: var(--muted); }
.inputs-steps .input-step.active { background: var(--navy); border-color: var(--navy); }
.inputs-steps .input-step.active .input-step-n { background: #fff; color: var(--navy); }
.inputs-steps .input-step.active .input-step-label, .inputs-steps .input-step.active .input-step-blurb { color: #fff; }
.input-step-explain { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 15px; margin: 10px 0 14px; font-size: 0.88rem; line-height: 1.5; color: var(--ink); }
.input-step-explain p { margin: 0 0 6px; }
.input-step-explain p:last-of-type { margin-bottom: 0; }
.source-legend-details { margin-top: 8px; font-size: 0.82rem; }
.source-legend-details summary { cursor: pointer; color: var(--accent-2); font-weight: 700; }
.contribute-callout { background: var(--institutional-soft); border-left: 4px solid var(--institutional); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 14px; font-size: 0.88rem; line-height: 1.5; color: var(--ink); }
.contribute-callout a { color: var(--accent-2); font-weight: 700; }
@media (max-width: 900px) { .inputs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .inputs-steps .input-step { min-height: 0; padding: 8px 10px; } .input-step-blurb { display: none; } }
.inputs-warning a { color: var(--accent-2); font-weight: 700; }
.inputs-intro { margin-bottom: 10px; }
.inputs-warning { background: var(--institutional-soft); border-left: 4px solid var(--institutional); border-radius: var(--radius-sm); padding: 9px 13px; margin: 6px 0 12px; font-size: 0.86rem; color: var(--ink); }
.data-tab-note { display: flex; align-items: center; gap: 10px; background: #f4f6f7; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 13px; font-size: 0.8rem; color: var(--muted); margin-bottom: 14px; }
.data-tab-note svg { width: 22px; height: 22px; flex: none; }

/* ---- sector color coding ---- */
.sector-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; }
.sector-tag.water { color: var(--water); background: var(--water-soft); }
.sector-tag.sanitation { color: var(--sanitation); background: var(--sanitation-soft); }
.sector-tag.hygiene { color: var(--hygiene); background: var(--hygiene-soft); }
.sector-tag.institutional { color: var(--institutional); background: var(--institutional-soft); }
.sector-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Sector identity on these panels already comes from the .sector-tag pill
   in each one's own <h2> (a small colored dot, not a full-height rail) —
   these classes are kept as selectors for other rules but no longer add
   their own colored border, matching the restrained KPI-card treatment
   (a colored-rail card reads as generic AI-dashboard styling). */
.panel.water-border, .panel.sanitation-border, .panel.hygiene-border, .panel.institutional-border { border-left: 1px solid var(--line); }

/* ---- Safely-Managed alternative-target callout (SDG6 Results) ---- */
.sm-target-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #f4f8fa; border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; }
/* A model-estimated proxy, not a real published figure (see the
   sanitation Safely Managed proxy panel, Round 18) — visually distinct
   from the box above it, which IS a real DHS indicator. */
.sm-target-box.proxy { background: #fdf7ec; border-color: #e6cd8f; }
.sm-target-label { display: block; font-weight: 700; font-size: 0.84rem; color: var(--ink); }
.sm-target-note { display: block; font-size: 0.76rem; color: var(--muted-2); max-width: 46ch; margin-top: 2px; }
.sm-target-stats { display: flex; flex-direction: column; gap: 3px; font-size: 0.84rem; text-align: right; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 640px; background: #fff; }
thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  position: sticky;
  top: 0;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
tbody td { padding: 6px 9px; border-bottom: 1px solid #eef1f3; white-space: nowrap; }
/* A handful of tables (Methodology's validation-plan table) hold real
   paragraph-length prose per cell, not short values/labels — nowrap would
   force one unreadable, far-scrolling line instead of wrapping like any
   normal paragraph. Opt in per-table with this class rather than changing
   every table's default (short-value tables benefit from nowrap + the
   shared .table-wrap horizontal scroll). */
table.wrap-cells td, table.wrap-cells th { white-space: normal; }
tbody tr:hover { background: #f4f9fb; }
tbody tr.total-row td { font-weight: 700; background: #f6f8f9; }
tfoot td { font-weight: 700; background: #f0f4f2; padding: 8px 9px; }

/* ---- editable cell inputs (TrackFin blue/black/green convention) ---- */
input.cell-input {
  width: 66px;
  border: 1px solid #cfd8de;
  border-radius: 7px;
  padding: 3px 6px;
  font-size: 12.5px;
  color: var(--accent-2);
  font-weight: 700;
  background: #fbfdff;
  font-family: var(--font);
}
input.cell-input.wide { width: 104px; }
input.cell-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.pct-field { display: inline-flex; align-items: center; gap: 3px; }
.pct-field .pct-suffix { color: var(--muted-2); font-size: 11.5px; font-weight: 700; }

.calc { color: var(--ink); }
.link-val { color: var(--good); font-weight: 700; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.ok { background: var(--hygiene-soft); color: var(--good); }
.badge.bad { background: #fbe7e5; color: var(--bad); }

.tag { display: inline-block; border-radius: 999px; padding: 2px 8px; font-size: 0.72rem; font-weight: 700; }
.tag.bad { background: #f8e3de; color: var(--bad); }
.tag.good { background: #dff0e8; color: var(--good); }

/* ---- toolbars / KPI grid (Results tab etc.) ---- */
.tab-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.progress-scenario-readout { display: flex; gap: 14px; align-items: center; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; }
.progress-scenario-readout b { color: var(--ink); }
a.link-btn { font-size: 0.78rem; font-weight: 700; color: var(--accent-2); text-decoration: none; white-space: nowrap; }
a.link-btn:hover { text-decoration: underline; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; margin-bottom: 6px; }
.kpi { padding: 13px 16px; } /* size only — color/border/background/label/value/sub all come from the shared .top-card, .kpi rule above */
.results-plan-costs .kpi { border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.results-plan-note { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); background: #f3f8fb; color: var(--muted); font-size: 0.79rem; line-height: 1.45; border-radius: var(--radius-sm); }
.results-plan-note a { color: var(--accent-2); font-weight: 700; }
.results-reference { margin-top: 20px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafcfd; }
.results-reference summary { cursor: pointer; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.results-reference[open] summary { margin-bottom: 8px; color: var(--ink); }

button.btn, a.btn {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #eef3f7;
  color: var(--ink);
  padding: 8px 15px;
  font: 600 0.82rem var(--font);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  line-height: 1.3;
}
button.btn:hover, a.btn:hover { background: #e5edf4; }
button.btn.primary, a.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
button.btn.primary:hover, a.btn.primary:hover { background: var(--navy-2); color: #fff; }

select.district-select, select.chart-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 12px;
  font: 600 0.85rem var(--font);
}

/* ---- persistent district decision workspace ---- */
.district-workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 14px; margin: -4px 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f7fafb; }
.district-workspace-bar label { display: block; margin-bottom: 4px; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); }
.district-workspace-bar .actions { display: flex; flex-wrap: wrap; gap: 7px; }
.district-workspace-context { margin-left: 9px; color: var(--muted-2); font-size: 0.78rem; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--accent-2); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.district-profile { border-top: 4px solid var(--accent); }
.district-profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.district-profile-head h2 { margin: 0; }
.district-profile-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); gap: 16px; margin-top: 16px; }
.district-profile-grid > * { min-width: 0; }
.district-profile-grid h3 { margin: 0 0 6px; }
.district-cost-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
.district-cost-list { margin: 0; }
.district-cost-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #e8edef; }
.district-cost-list dt { color: var(--muted); font-size: .8rem; }
.district-cost-list dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.financing-evidence-note { margin: 12px 0 0; padding: 10px; border: 1px solid var(--line); background: var(--institutional-soft); color: var(--muted); font-size: .78rem; line-height: 1.5; border-radius: var(--radius-sm); }
.comparison-delta { display: block; font-size: .68rem; font-weight: 700; }
.comparison-delta.up { color: var(--good); }
.comparison-delta.down { color: var(--bad); }
.district-profile-narrative { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.district-profile-narrative p { margin: 0; padding: 11px 13px; background: #f7fafb; border-radius: 9px; color: var(--muted); font-size: .82rem; line-height: 1.55; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; margin-top: 8px; }
.legend span.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Same grid-blowout fix as .shell > #main (see that rule's own comment)
   — a grid item's default min-width is `auto`, letting it grow past its
   track to fit a wide descendant (here, Methodology §4's water/
   sanitation ladder-definition tables, min-width:640px) instead of
   respecting the track and letting .table-wrap's own overflow-x:auto
   scroll internally. Found on the Methodology tab at phone width via the
   same document.scrollWidth check used throughout this project — the
   single-column collapse below doesn't fix it alone, since one column
   at track width can still be exceeded by the same wide table. */
.two-col > * { min-width: 0; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.tag-source { font-size: 10.5px; color: var(--muted-2); font-style: italic; }
.row-sparkline { display: block; vertical-align: middle; border-radius: 3px; overflow: hidden; }
/* Source badges (Parameters tab) — a colored pill naming exactly where a
   number came from, so "where did this come from?" is answerable at a
   glance per-row, not just once in a top-of-tab note. Four kinds: a real
   Malawi data source (DHS/WASH Accounts), TrackFinModel's own template,
   this tool's own stated assumption, or a value calculated from other
   rows (not independently sourced at all). */
.source-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 2px 7px 2px 6px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.02em; }
.source-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.source-badge.real { background: #e6f4ea; color: #1b7f5d; }
.source-badge.assumption { background: #fdf1e3; color: #a15c07; }
.source-badge.computed { background: #f1eef7; color: #6a4c93; }
.source-note { display: block; font-size: 10.5px; color: var(--muted-2); font-style: italic; margin-top: 3px; text-transform: none; letter-spacing: normal; font-weight: 400; }
.source-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 8px 0 2px; }
.source-legend .source-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }

/* ---- charts ---- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; margin-top: 4px; }
.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdff;
  padding: 14px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.chart-card h4 { margin: 0 0 2px; font-size: 0.94rem; color: var(--ink); }
.chart-card .chart-note { font-size: 0.78rem; color: var(--muted-2); margin: 0 0 8px; line-height: 1.4; }

/* "Jump to section" strip — added to long single-page-scroll tabs
   (Financing Gap, SDG6 Ladder Gaps) via app.js's addQuickNav(). Styled as
   plain small text links (no pill/border/fill) so it reads as clearly
   subordinate to the sub-tab strip above it, not a second row of buttons. */
.quick-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; margin-bottom: 16px; padding-top: 8px; border-top: 1px dashed var(--line); }
.quick-nav-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); }
.quick-nav a { font-size: 0.76rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line); }
.quick-nav a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* Shown while a heavy calculation (Sensitivity tab's tornado/Monte Carlo
   pass) runs — see renderSensitivity's own comment for why this exists:
   the computation still blocks the main thread for real, but the user
   sees why instead of a dead tab. */
.loading-state { display: flex; align-items: center; gap: 10px; padding: 20px 4px; color: var(--muted); font-size: 0.92rem; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--accent); flex: none; animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; border-top-color: var(--line); opacity: 0.6; } }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-card svg { width: 100%; height: auto; display: block; }

/* Investment Timeline & Costs — a chart-card's own "break down by" select
   and/or its Area/Bar view toggle, side by side above the chart itself. */
.chart-card-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 8px; }
.chart-select-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); font-weight: 700; margin-bottom: 4px; }
.chart-style-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.chart-style-toggle button { border: none; background: #fff; color: var(--muted); font: 600 0.74rem var(--font); padding: 5px 12px; cursor: pointer; }
.chart-style-toggle button + button { border-left: 1px solid var(--line); }
.chart-style-toggle button.active { background: var(--navy); color: #fff; }

/* Financing Gap tab — recommendation cards (report's own 7 prioritized
   recommendations, Phase 2) */
.rec-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.rec-card { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
.rec-num { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.rec-title { font-weight: 700; color: var(--ink); font-size: 0.92rem; margin-bottom: 3px; }
.rec-rationale { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
details.rec-card { display: block; padding: 0; }
details.rec-card > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
details.rec-card > summary::-webkit-details-marker { display: none; }
details.rec-card > summary .rec-title { margin: 0; flex: 1; }
details.rec-card > summary::after { content: "+"; color: var(--muted-2); font-weight: 700; font-size: 1.1rem; }
details.rec-card[open] > summary::after { content: "\2212"; }
details.rec-card > .rec-rationale { padding: 0 14px 12px 54px; }

/* Results (3.17.0): figures first, depth on request. */
.overview-heading { margin: 20px 0 8px; font-size: 0.78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.overview-caption { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.overview-caption a, .results-overview .note a, .overview-explore a { color: var(--accent-2); font-weight: 700; }
.overview-explore { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 0.86rem; }
.overview-explore span { color: var(--muted-2); font-weight: 700; }
.results-detail > summary { cursor: pointer; font-size: 0.95rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.results-detail > summary::-webkit-details-marker { display: none; }
.results-detail > summary::before { content: "\25B8"; color: var(--accent-2); display: inline-block; transition: transform .15s; }
.results-detail[open] > summary::before { transform: rotate(90deg); }
.chart-grid + .results-detail, .results-overview + .chart-grid, .panel + .chart-grid, .chart-grid + .panel { margin-top: 14px; }
.results-detail > summary .note { margin: 0; }
.results-detail[open] > summary { margin-bottom: 4px; }
.benchmark-notes { margin: 6px 0 10px; padding-left: 18px; line-height: 1.5; }
.benchmark-notes li { margin-bottom: 6px; }
@media (max-width: 640px) {
  .results-overview .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .results-overview .kpi .value { font-size: 1.15rem; }
}
.view-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.view-switch-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.84rem; font-weight: 700; padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.view-switch-btn:hover { background: var(--accent-soft); color: var(--ink); }
.view-switch-btn.active { background: var(--accent-2); color: #fff; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 31, 42, 0.95);
  color: #fff;
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 8px;
  opacity: 0;
  max-width: 220px;
  z-index: 4;
  transition: opacity .08s ease;
}

/* ---- map ---- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.8fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .map-layout { grid-template-columns: 1fr; } }
.map-shell {
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f4f8 100%);
}
.map-shell svg { width: 100%; height: clamp(420px, 58vh, 760px); display: block; }
.map-feature { stroke: rgba(16, 37, 51, 0.35); stroke-width: 0.6; vector-effect: non-scaling-stroke; cursor: pointer; }
.map-feature:hover { stroke: rgba(16, 37, 51, 0.9); stroke-width: 1.4; }
.map-feature.selected { stroke: #17181a; stroke-width: 3; }
.map-feature:focus { outline: none; stroke: #17181a; stroke-width: 3; }
.map-legend-ramp { display: grid; grid-template-columns: repeat(7, 1fr); height: 12px; border-radius: 999px; border: 1px solid var(--line); overflow: hidden; margin-top: 8px; }
.map-legend-row { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--muted-2); margin-top: 4px; }
.map-rank-list { display: grid; gap: 6px; margin-top: 10px; max-height: 620px; overflow-y: auto; }
.map-rank-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: 500 0.82rem var(--font); text-align: left; cursor: pointer; }
.map-rank-row:hover, .map-rank-row.selected { border-color: var(--accent-2); background: var(--accent-soft); }
.map-rank-row .swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.map-rank-row .val { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- ladder legend chip strip (Home tab) ---- */
.ladder-legend { display: flex; flex-wrap: wrap; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-top: 6px; }
.ladder-legend .rung { flex: 1; min-width: 110px; padding: 10px 12px; color: #fff; font-size: 0.76rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ladder-legend .rung .rung-label { display: block; }
.ladder-legend .rung .rung-sub { font-weight: 500; opacity: .9; font-size: 0.7rem; }

/* ---- landing page tiles ---- */
.home-hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .home-hero-grid { grid-template-columns: 1fr; } }
.home-simple h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 12px; }
.home-lead { font-size: 1rem; line-height: 1.55; margin: 0 0 8px; color: var(--ink); }
.home-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 16px 0; }
.home-figure { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--accent-soft); }
.home-figure strong { display: block; font-size: 1.3rem; color: var(--accent-2); }
.home-figure span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; margin-top: 10px; }
.icon-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  display: block;
  width: 100%;
  font-family: var(--font);
}
.icon-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.icon-tile svg { width: 34px; height: 34px; margin-bottom: 8px; }
.icon-tile .tile-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); display: block; }
.icon-tile .tile-sub { font-size: 0.78rem; color: var(--muted-2); display: block; margin-top: 3px; }

/* Home's map+regional-access panel — replaced a static hand-drawn
   illustration (Round 29, direct feedback: "replace the big image with
   something more meaningful") with real, live-updating content reusing
   the Analysis tab's own choropleth (drawMetricMap) and JMP-style
   100%-stacked-bar (Charts.draw100StackedBar, matching a chart type
   provided as a reference image) primitives, not a new visual system.
   Round 30: map and chart sit side by side (Malawi's own outline is
   tall and narrow, pairing naturally with a narrower map column beside
   a wider column of horizontal bars), with a Water/Sanitation/Hygiene
   selector driving both at once. */
.home-region-panel { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfd; padding: 14px; min-width: 0; }
.home-region-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.home-region-panel h4 { margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-2); font-weight: 700; }
.home-region-body { display: grid; grid-template-columns: minmax(110px, 0.8fr) 1.5fr; gap: 14px; align-items: start; }
@media (max-width: 640px) { .home-region-body { grid-template-columns: 1fr; } }
.home-mini-map { position: relative; border-radius: var(--radius-sm); border: 1px solid var(--line); overflow: hidden; background: linear-gradient(180deg, #f8fafc 0%, #f1f4f8 100%); min-width: 0; }
.home-mini-map svg { width: 100%; height: 280px; display: block; }
.home-region-chart-wrap { position: relative; min-width: 0; }
.home-region-chart-wrap svg { width: 100%; height: auto; display: block; }

/* ---- methodology / references ---- */
.method-intro { border-top: 3px solid var(--accent); }
.method-intro .lead { max-width: 980px; }
.method-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; margin: 20px 0 16px; }
.method-step { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
/* Methodology is deliberately a sober process diagram: neutral cards and a
   consistently centred step marker, rather than decorative colour blocks. */
.method-step-data, .method-step-choice, .method-step-result { background: #fff; }
.method-step-number { display: flex; align-items: center; justify-content: center; flex: 0 0 30px; box-sizing: border-box; width: 30px; height: 30px; padding: 0; border: 1px solid var(--navy); border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 800; line-height: 1; text-align: center; text-indent: 0; font-variant-numeric: tabular-nums; }
.method-step b, .method-step div > span { display: block; }
.method-step b { color: var(--ink); font-size: .88rem; line-height: 1.25; }
.method-step div > span { margin-top: 5px; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.method-flow-arrow { align-self: center; color: var(--muted-2); font-size: 1.1rem; font-weight: 600; }
.method-boundary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.method-boundary-card { padding: 14px 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.method-boundary-card.is-for, .method-boundary-card.is-not { border-left: 1px solid var(--line); background: #fff; }
.method-boundary-card h3 { margin: 0 0 6px; font-size: .72rem; color: var(--ink); }
.method-boundary-card p, .method-next { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.method-next { margin-top: 14px; }
.method-release-details { margin-top: 14px; }
.method-release-details > summary { cursor: pointer; color: var(--muted); font-size: .86rem; font-weight: 700; }
.method-release-details[open] > summary { margin-bottom: 8px; }
@media (max-width: 760px) {
  .method-flow { grid-template-columns: 1fr; gap: 7px; }
  .method-flow-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
  .method-boundary { grid-template-columns: 1fr; }
}
.ref-list { display: grid; gap: 8px; margin-top: 6px; }
.ref-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff;
}
.ref-item a { color: var(--accent-2); font-weight: 700; text-decoration: none; font-size: 0.88rem; }
.ref-item a:hover { text-decoration: underline; }
.ref-item .ref-note { color: var(--muted-2); font-size: 0.78rem; max-width: 60%; text-align: right; }

/* ---- reports tab ---- */
.report-builder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; align-items: end; margin-bottom: 6px; }
.report-builder label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); font-weight: 700; margin-bottom: 4px; }
#printReport { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; background: #fff; margin-top: 14px; }
#printReport .report-meta { color: var(--muted-2); font-size: 0.78rem; margin-bottom: 14px; }
#printReport h2 { margin-bottom: 2px; }
#printReport .report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 10px; margin: 12px 0 18px; }
#printReport .report-kpis > :nth-child(6n+1) { --kpi-c: var(--accent); }
#printReport .report-kpis > :nth-child(6n+2) { --kpi-c: var(--water); }
#printReport .report-kpis > :nth-child(6n+3) { --kpi-c: var(--sanitation); }
#printReport .report-kpis > :nth-child(6n+4) { --kpi-c: var(--capex); }
#printReport .report-kpis > :nth-child(6n+5) { --kpi-c: var(--opex); }
#printReport .report-kpis > :nth-child(6n+6) { --kpi-c: var(--hygiene); }
/* Unscoped (not just #printReport) — Round 18 shares this heading style
   between the printed report body and a couple of live tabs that now
   reuse the same report-section helpers (regionalEquityHtml/
   sensitivitySummaryHtml — see app.js) to avoid keeping two copies of
   the same table in sync by hand. */
.report-section-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
#printReport .report-footnote { margin-top: 18px; font-size: 0.74rem; color: var(--muted-2); border-top: 1px solid var(--line); padding-top: 10px; }
#printReport .report-appendix { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--line); }
#printReport .report-appendix .report-section-title { margin-top: 0; }
#printReport .report-appendix p.note { font-size: 0.78rem; margin: 0 0 9px; }
@media print { #printReport .report-appendix { break-before: page; padding-top: 0; border-top: none; } }

/* Changelog tab */
.changelog-list { display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.changelog-entry { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.changelog-entry:last-child { border-bottom: none; padding-bottom: 0; }
.changelog-version { font-weight: 800; color: var(--accent-2); font-size: 0.9rem; padding-top: 2px; }
.changelog-title { font-weight: 700; color: var(--ink); font-size: 0.98rem; margin-bottom: 6px; }
.changelog-items { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.87rem; line-height: 1.6; }
.changelog-items li { margin-bottom: 4px; }

/* Narrative prose in Reports (for readers who prefer text over tables) */
.report-narrative { background: #fafcfd; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0 16px; }
.report-narrative p { margin: 0 0 8px; font-size: 0.88rem; line-height: 1.6; color: var(--ink); }
.report-narrative p:last-child { margin-bottom: 0; }

/* ---- concise two-page district investment brief ---- */
.district-brief { max-width: 980px; margin: 0 auto; }
.district-brief-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--ink); padding-bottom: 11px; }
.district-brief-head h2 { margin: 0; }
.district-brief-head .report-meta { margin: 4px 0 0; }
.district-brief-badge { flex: none; padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.district-brief-lead { margin: 11px 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.brief-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 14px 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brief-kpis > div { min-width: 0; padding: 10px 13px; border-right: 1px solid var(--line); }
.brief-kpis > div:first-child { padding-left: 0; }
.brief-kpis > div:last-child { padding-right: 0; border-right: 0; }
.brief-kpis span, .brief-kpis small { display: block; color: var(--muted-2); font-size: .68rem; line-height: 1.3; }
.brief-kpis b { display: block; margin: 4px 0 2px; color: var(--ink); font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.brief-section h3 { margin: 0 0 6px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.brief-section .table-wrap { border-radius: 8px; }
.brief-note { margin: 6px 0 0; color: var(--muted-2); font-size: .73rem; line-height: 1.35; }
.brief-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.brief-two-col > * { min-width: 0; }
.brief-two-col > * + * { padding-left: 22px; border-left: 1px solid var(--line); }
.brief-cost-list { margin: 0; }
.brief-cost-list > div { display: flex; justify-content: space-between; gap: 9px; padding: 5px 0; border-top: 1px solid #e9eef0; }
.brief-cost-list > div:last-child { border-bottom: 1px solid #e9eef0; }
.brief-cost-list dt { color: var(--muted); font-size: .75rem; }
.brief-cost-list dd { margin: 0; color: var(--ink); font-size: .78rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.brief-decision { padding: 0; border: 0; background: transparent; }
.brief-decision p { margin: 0 0 7px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.brief-decision p:last-child { margin-bottom: 0; }
.district-brief-footer { margin-top: 12px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: .68rem; }

/* Comparisons dashboard's Plotly charts (Round 13) — height is set
   explicitly per-chart via Plotly's own layout.height (it varies with
   item count); this is just a sane placeholder size before JS runs. */
.plotly-card h4 { margin: 0 0 4px; font-size: 0.94rem; color: var(--ink); }
.plotly-chart { width: 100%; min-height: 320px; }
.plotly-card .map-layout .map-shell svg { height: clamp(320px, 46vh, 620px); }

/* Charts embedded inside Reports (Phase 3 — previously tables only) */
.report-chart { width: 100%; height: auto; display: block; margin: 8px 0 16px; }

/* Report cover page (Phase 3) — every export's own first page */
.report-cover { text-align: center; padding: 40px 20px 10px; border-bottom: 2px solid var(--line); margin-bottom: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.report-cover-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 1.3rem; color: var(--ink); margin-bottom: 30px; }
.report-cover-logo { width: 30px; height: 30px; }
.report-cover-map { width: 340px; max-width: 100%; margin: 0 auto 30px; }
.report-cover-map svg { width: 100%; height: auto; display: block; }
.report-cover-title { font-size: 2.1rem; margin: 0 0 8px; color: var(--ink); }
.report-cover-meta { color: var(--muted-2); font-size: 0.95rem; margin: 0 0 20px; }
.report-cover-version { font-size: 0.82rem; color: var(--muted-2); max-width: 560px; margin: 0 0 16px; }
.report-cover-version a { color: var(--accent-2); font-weight: 700; }
/* Targets & timeframe — added Round 22: these change (they're editable
   planning assumptions, not fixed facts) and directly determine the
   Planned figures below, so a reader of the PDF alone needs to see WHICH
   plan produced these numbers, not just the numbers themselves. Kept as
   small wrapping chips (not a table — a table nearly overflowed this
   page once before, see the print-only comment further down) so it
   costs only 1-2 lines of vertical space. */
.report-cover-targets { margin: 0 0 22px; max-width: 640px; }
.report-cover-targets-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); font-weight: 700; margin-bottom: 8px; }
.report-cover-target-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
/* min-width:0 — the same flex-child overflow fix this project has
   already needed twice before (Round 16's `.shell > #main`, Round 19's
   `.two-col > *`): a flex item's default min-width is its own content's
   longest unbroken run, which forces the WHOLE ROW past a narrow phone
   viewport instead of letting a long chip's own text wrap internally. */
.report-cover-target-chip { font-size: 0.78rem; color: var(--ink); background: #f4f7f8; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.report-cover-stats { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 30px; }
.report-cover-stat { min-width: 0; }
.report-cover-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 28px; border-radius: 14px; background: var(--accent-soft); }
.report-cover-stat-value { font-size: 1.9rem; font-weight: 800; color: var(--accent-2); }
.report-cover-stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.report-cover-flag { width: 240px; max-width: 100%; margin: 0 auto 24px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.report-cover-flag svg { width: 100%; height: auto; display: block; }
.report-cover-footer { font-size: 0.8rem; color: var(--muted-2); margin: 0; }
/* Print-only: bigger than the screen preview (a preview this size would
   dwarf the rest of the live Reports tab) but NOT as big as an earlier
   round tried (420px map / 300px flag) — that combination, added up with
   every element's own margins, actually overflowed a single A4 page by
   about 25mm (measured by rendering a real PDF and inspecting page 2:
   the flag and footer were landing there alone) and pushed the report's
   real content to page 3. Sizes and margins below were recalculated to
   fit A4's ~269mm usable content height (297mm page minus server.py's
   14mm top/bottom margins) with a real margin of safety, not just
   trimmed until it happened to work once. Round 22 added the targets
   chips + a second stat box, and shrank the map/flag/stat font sizes
   further to hold the same real margin of safety with the new content —
   re-measured by rendering an actual PDF to images again, not assumed. */
@media print {
  .report-cover-brand { margin-bottom: 14px; }
  .report-cover-map { width: 300px; margin-bottom: 14px; }
  .report-cover-flag { width: 190px; margin-bottom: 12px; }
  .report-cover-title { font-size: 2.2rem; }
  .report-cover-meta { margin-bottom: 12px; }
  .report-cover-targets { margin-bottom: 16px; }
  .report-cover-stats { margin-bottom: 20px; }
  .report-cover-stat { padding: 12px 26px; }
  .report-cover-stat-value { font-size: 2.1rem; }
}
/* Full single page on print/PDF — a real cover, not a compact header
   that happens to break early. A4 content area (297mm page minus
   server.py's 14mm top/bottom margins) is ~269mm; leave a little slack. */
@media print {
  .report-cover { break-after: page; border-bottom: none; min-height: 255mm; padding: 0; margin-bottom: 0; }
}

/* ---- chart-card toolbar (expand / print) ---- */
.chart-card { position: relative; }
.chart-card-toolbar { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.chart-icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; width: 26px; height: 26px; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chart-icon-btn:hover { background: #f4f6f7; color: var(--ink); }

/* ---- expand modal ---- */
.chart-modal-overlay { position: fixed; inset: 0; background: rgba(23,24,26,0.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.chart-modal-overlay[hidden] { display: none; }
.chart-modal { background: #fff; border-radius: var(--radius); max-width: min(1100px, 96vw); max-height: 92vh; width: 100%; overflow: auto; padding: 20px 24px; }
.chart-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart-modal-body svg { width: 100%; height: auto; }
.chart-modal-body .chart-legend { margin-top: 10px; }

/* ---- single-chart print target (Progress & Costs "Print" button) ---- */
.chart-print-root { display: none; }

@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  body[data-report-print] .shell > *:not(main) { display: none !important; }
  body[data-report-print] .no-print { display: none !important; }
  body[data-report-print] .panel { border: none; box-shadow: none; padding: 0; border-radius: 0; }
  body[data-report-print] #printReport { border: none; box-shadow: none; padding: 0; }
  body[data-chart-print] .shell > *:not(#chartPrintRoot) { display: none !important; }
  body[data-chart-print] #chartPrintRoot { display: block !important; padding: 12px; }
  body[data-chart-print] #chartPrintRoot svg { width: 100%; height: auto; }
  .topbar, .chart-modal-overlay, .chart-card-toolbar { display: none !important; }
  * { box-shadow: none !important; }

  /* A real bug, found by actually rendering a PDF and looking at it, not
     assumed fixed: `table { min-width: 640px }` and th/td's `white-space:
     nowrap` (both deliberate on-screen — .table-wrap's own overflow-x:
     auto makes a wide table scroll horizontally instead of wrapping)
     have no scroll escape valve in print. The Service Provider/
     Financing Type/Funding Unit allocation tables (5-6 columns, several
     with long header names like "Government (National/Regional/Local)")
     were overflowing the printable page width and having their
     rightmost 1-2 columns silently cut off — not wrapped to a new page,
     just gone. Printed tables wrap and shrink instead; on-screen tables
     (and their horizontal-scroll behaviour) are completely unaffected.
  */
  body[data-report-print] table { min-width: 0; font-size: 10px; table-layout: fixed; }
  body[data-report-print] table th, body[data-report-print] table td { white-space: normal; padding: 5px 6px; overflow-wrap: break-word; }

  /* Keep charts, tables and KPI/recommendation blocks from splitting
     across a page break — a table or chart cut mid-row/mid-shape is
     unreadable in a printed report. */
  body[data-report-print] .table-wrap,
  body[data-report-print] svg.report-chart,
  body[data-report-print] .report-kpis,
  body[data-report-print] .rec-card,
  body[data-report-print] .report-narrative,
  body[data-report-print] .report-section-title {
    break-inside: avoid;
  }
  /* A section's heading should never be the last line on a page, orphaned
     from the table/chart it introduces. */
  body[data-report-print] .report-section-title { break-after: avoid; }
  /* A table genuinely too long for one page (the 33-district lists) still
     has to break somewhere — repeat its header row on the new page rather
     than leaving the continuation unlabeled, and never split a single
     row across the boundary. */
  body[data-report-print] table thead { display: table-header-group; }
  body[data-report-print] table tr { break-inside: avoid; }
  body[data-report-print] .district-brief { font-size: 10px; }
  body[data-report-print] .district-brief-head { padding-bottom: 7px; }
  body[data-report-print] .district-brief-head h2 { font-size: 1.45rem; }
  body[data-report-print] .district-brief-lead { margin: 8px 0; font-size: .78rem; }
  body[data-report-print] .brief-kpis { gap: 6px; margin-bottom: 10px; }
  body[data-report-print] .brief-kpis > div { padding: 7px 8px; }
  body[data-report-print] .brief-kpis b { font-size: 1rem; }
  body[data-report-print] .brief-section h3 { margin-bottom: 4px; }
  body[data-report-print] .brief-note { margin-top: 4px; font-size: .66rem; }
  body[data-report-print] .brief-two-col { gap: 10px; margin-top: 9px; }
  body[data-report-print] .brief-cost-list > div { padding: 3px 0; }
  body[data-report-print] .brief-decision { padding: 7px 8px; }
  body[data-report-print] .brief-decision p { font-size: .68rem; line-height: 1.28; }
  body[data-report-print] .district-brief-footer { margin-top: 8px; padding-top: 5px; font-size: .62rem; }
  body[data-report-print] .district-brief .table-wrap,
  body[data-report-print] .district-brief .brief-kpis,
  body[data-report-print] .district-brief .brief-two-col { break-inside: avoid; }
}

footer.app-footer { text-align: center; color: var(--muted-2); font-size: 11.5px; padding: 6px 0 30px; }
footer.app-footer .footer-sep { margin: 0 6px; }
footer.app-footer a { color: var(--accent-2); font-weight: 600; text-decoration: none; }
footer.app-footer a:hover { text-decoration: underline; }

/* ---- Responsive: phone/tablet ----------------------------------------
   The desktop-first layout above already resizes fairly well on its own
   (charts and Plotly panels are width:100%; tables sit inside their own
   overflow-x:auto wrapper; most grids use repeat(auto-fit, minmax(...)),
   which naturally collapses to fewer columns as the viewport narrows).
   Two things that layout alone doesn't fix, addressed explicitly below:
   (1) a bare pixel minimum inside minmax() can force a grid track WIDER
   than a narrow phone's viewport ("grid blowout"), overflowing the whole
   page horizontally rather than just wrapping to one column — every such
   minmax() above is now minmax(min(Npx, 100%), 1fr), which caps the
   minimum at the container's own width; (2) the 10-tab nav bar, which at
   phone width has nowhere good to wrap to (wrapping it turns the topbar
   into several cramped rows) — turned into a horizontally swipeable strip
   instead, the standard mobile pattern for a tab bar too wide to fit. */
body { overflow-x: hidden; } /* defensive backstop; grid-blowout fix above is the real fix */

@media (max-width: 860px) {
  /* Tabs: swipeable single-row strip instead of wrapping into several
     cramped rows. Dropped onto its own full-width line (flex-basis:100%)
     so the brand mark and currency toggle keep a clean first row above it. */
  .topbar-inner { gap: 4px 14px; }
  .tabs {
    flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin-left: 0; gap: 0; scrollbar-width: thin;
  }
  .tab-btn { flex: none; white-space: nowrap; padding: 13px 12px 11px; } /* fixed height, doesn't stretch */
  .currency-toggle { padding: 8px 0; margin-left: auto; flex-wrap: wrap; min-width: 0; }
  /* Give the price-basis caveat its own line rather than letting its
     text force the whole topbar wider than a phone viewport. */
  .currency-basis { flex-basis: 100%; }

  /* Touch targets: WCAG's own ~44px guidance, for anything a finger (not
     a mouse pointer) taps — selects, inputs, buttons, subtab pills, and
     each chart card's Expand/Print icon buttons (previously sized for a
     mouse cursor's precision). */
  select.district-select, select.chart-select, .report-builder select, .report-builder input,
  button.btn, a.btn, .subtab-btn, .currency-btn { min-height: 40px; }
  .chart-card-toolbar button { width: 34px; height: 34px; }
}

@media (max-width: 700px) {
  .shell { width: calc(100vw - 16px); }
  .hero, .panel { padding: 14px; }
  /* One column everywhere a grid would otherwise still try to fit two
     narrow-but-not-narrow-enough tracks side by side. */
  .top-cards, .kpi-row, .icon-tile-grid, .report-builder, #printReport .report-kpis,
  .changelog-entry { grid-template-columns: 1fr; }
  .changelog-entry { gap: 6px; }
  table { font-size: 0.82rem; }
  .tab-toolbar { flex-direction: column; align-items: stretch; }
  .tab-toolbar .actions { width: 100%; }
  .district-workspace-bar, .district-profile-head { align-items: stretch; flex-direction: column; }
  .district-workspace-bar .actions > * { flex: 1 1 130px; }
  .district-workspace-context { display: block; margin: 6px 0 0; }
  .district-profile-grid, .district-profile-narrative { grid-template-columns: 1fr; }
  .district-brief-head { flex-direction: column; }
  .brief-kpis, .brief-two-col { grid-template-columns: 1fr; }
}

/* Real, found-by-rendering-an-actual-PDF bug (Round 22): Chromium's
   page.pdf({format:"A4"}) call in server.py re-lays-out the page at the
   PRINTED page's own width for @media evaluation, not the browser
   viewport server.py opens the page at (1280px) — A4 minus server.py's
   14mm margins evaluates to ~687 CSS px, just under the 700px breakpoint
   above, so EVERY exported PDF's report-kpis grid was silently
   collapsing to one full-width card per row (confirmed by rendering a
   real PDF to an image and looking, not assumed from the CSS alone) even
   though the same page at a real 1280px browser viewport correctly
   showed 3 per row. That breakpoint is still correct for genuinely
   narrow on-screen phone viewing of the live Reports-tab preview (this
   selector's other purpose) — so restore multiple columns specifically
   for print/PDF, where ~687px of real width is always available. */
@media print {
  #printReport .report-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  body[data-report-print] .brief-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-report-print] .brief-two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Public cost-estimate form ---------------------------------------- */
.cost-shared-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.cost-shared-grid label { display: block; font-weight: 600; font-size: 0.86rem; color: var(--ink); min-width: 0; }
.cost-shared-grid input, .cost-shared-grid select {
  display: block; width: 100%; max-width: 100%; margin-top: 5px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 6px; font: 400 0.92rem var(--font); background: #fff; }
.cost-form-hint { display: block; margin-top: 4px; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.cost-form-contact { margin-top: 16px; }
/* Stepped layout for partners: numbered panels, a jump list, and plain
   reassurance up front. Navigation only; no figure is ever shown here. */
.cost-shared-grid textarea {
  display: block; width: 100%; max-width: 100%; margin-top: 5px; padding: 9px 10px; resize: vertical;
  border: 1px solid var(--line); border-radius: 6px; font: 400 0.92rem var(--font); background: #fff; }
.cost-intro-facts { margin: 0 0 14px; padding-left: 18px; font-size: 0.9rem; line-height: 1.6; color: var(--ink); }
.cost-steps-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.cost-steps-link { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--accent-2);
  font: 600 0.82rem var(--font); }
.cost-steps-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.cost-why { margin-top: 10px; }
.cost-why summary { cursor: pointer; font-weight: 600; font-size: 0.86rem; color: var(--accent-2); }
.cost-step { scroll-margin-top: 80px; }
.cost-step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.cost-step-head .note { margin: 4px 0 0; }
.cost-step-title { margin: 4px 0 0; color: var(--ink); }
.cost-step-num { flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem; }
.cost-step-num.small { width: 20px; height: 20px; font-size: 0.72rem; }
.cost-required { font-weight: 400; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-left: 4px; }
.cost-includes { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.cost-includes legend { font-weight: 600; font-size: 0.86rem; padding: 0 4px; }
.cost-check { display: inline-flex; align-items: center; gap: 6px; margin: 6px 16px 0 0; font-size: 0.86rem; }
.cost-check input { width: 16px; height: 16px; }
.cost-questions { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.cost-ref { font-size: 1rem; margin: 14px 0 4px; }
.cost-ref b { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: .06em; color: var(--accent-2); }
.cost-review-head { margin-top: 28px; }
.cost-form-contact summary { cursor: pointer; font-weight: 600; font-size: 0.86rem; }

.cost-sector-head { margin: 22px 0 8px; font-size: 0.94rem; color: var(--ink); }
table.cost-form-table { min-width: 0; width: 100%; }
table.cost-form-table th, table.cost-form-table td { white-space: normal; vertical-align: top; }
table.cost-form-table input {
  width: 100%; max-width: 100%; min-width: 0; padding: 7px 8px; border: 1px solid var(--line);
  border-radius: 5px; font: 400 0.88rem var(--font); background: #fff; }
.cost-row-name { max-width: 260px; }
.cost-row-unit { display: block; margin-top: 3px; font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.cost-row-msg td { font-size: 0.82rem; padding-top: 0; border-top: 0; }
.cost-row-msg.bad td { color: #8c2455; }
.cost-row-msg.warn td { color: #8a5a10; }

.cost-form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.cost-offline h3 { margin-top: 0; }
.cost-offline-steps { margin: 0; padding-left: 20px; font-size: 0.9rem; line-height: 1.6; }
.cost-offline .cost-form-actions { margin-top: 12px; }
.cost-feedback ul { margin: 8px 0 0; padding-left: 20px; }
.cost-form-feedback:empty { display: none; }
.cost-feedback { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 7px; font-size: 0.88rem; }
.cost-feedback.ok { border-color: #2e7d32; background: #f2f9f3; }
.cost-feedback.warn { border-color: #c77d18; background: #fdf7ee; }
.cost-feedback.bad { border-color: #b5326f; background: #fdf2f6; }
.cost-apply-list { margin: 10px 0 14px; padding-left: 18px; font-size: 0.9rem; }
.cost-apply-list li { margin-bottom: 5px; }
.cost-estimates-banner { background: #fdf7ee; border-bottom: 1px solid #e0c48f; color: #6b4a12;
  padding: 7px 18px; font-size: 0.8rem; text-align: center; }
.cost-estimates-banner:not([hidden]) { display: block; }

/* A five-column table of inputs is unusable on a phone. Below the mobile
   breakpoint each row becomes its own labelled block instead of scrolling
   sideways, which is the wrong interaction for data entry. */
@media (max-width: 700px) {
  table.cost-form-table thead { display: none; }
  table.cost-form-table, table.cost-form-table tbody, table.cost-form-table tr,
  table.cost-form-table td { display: block; width: 100%; }
  table.cost-form-table tr { border: 1px solid var(--line); border-radius: 8px;
    padding: 12px; margin-bottom: 12px; background: #fff; }
  table.cost-form-table tr.cost-row-msg { border-color: currentColor; padding: 10px 12px; }
  table.cost-form-table td { border: 0; padding: 6px 0; }
  table.cost-form-table td[data-label]::before {
    content: attr(data-label); display: block; font-weight: 600;
    font-size: 0.78rem; color: var(--muted); margin-bottom: 3px; }
  .cost-row-name { max-width: none; }
  table.cost-form-table input { min-height: 42px; }
  .cost-shared-grid input, .cost-shared-grid select { min-height: 42px; }
}

/* ---- Publishing a reviewed cost version ------------------------------- */
.cost-readiness { list-style: none; margin: 8px 0 14px; padding: 0; font-size: 0.87rem; }
.cost-readiness li { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0;
  border-bottom: 1px solid var(--line); }
.cost-readiness li:last-child { border-bottom: 0; }
.cost-readiness-mark { flex: 0 0 auto; width: 16px; text-align: center; font-weight: 700; }
.cost-readiness li.met .cost-readiness-mark { color: #2e7d32; }
.cost-readiness li.unmet .cost-readiness-mark { color: var(--muted); }
.cost-readiness li.unmet b { color: var(--muted); font-weight: 600; }
.cost-readiness-why { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--muted); }
.cost-publish-link { word-break: break-all; font-size: 0.88rem; }
