/* Tally LA — a civic ledger. Freeway-sign display type (Overpass), US-government body type (Public Sans),
   jacaranda accent. Every number can open into a plain-language explanation. */
:root {
  --ground: #f2f2f7;
  --paper: #ffffff;
  --ink: #1b1a2e;
  --muted: #5d5a77;
  --faint: #8a87a3;
  --rule: #dddbe8;
  --accent: #6a4cc2;
  --accent-ink: #4f36a3;
  --accent-soft: #eee9fb;
  --sign: #0e6b4e;
  --sign-soft: #e3f3ec;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --crit: #b3261e;
  --crit-soft: #fbe6e4;
  --hover: rgba(27, 26, 46, .045);
  --bar-muted: #c9c6da;

  /* Categorical slots, validated for color-vision deficiency in this order. */
  --s-state: #2a78d6; --s-county: #eb6834; --s-city: #1baf7a; --s-metro: #eda100;
  --s-schools: #e87ba4; --s-measure_a: #008300; --s-federal: #6250d6; --s-other: #e34948;
  --r1: #3a2880; --r2: #5b42b0; --r3: #8670d3; --r4: #a898e3;

  --f-display: "Overpass", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Overpass Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: .8125rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.625rem; --step-3: 2.25rem;
  --step-4: clamp(2.75rem, 8vw, 5rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #12111c; --paper: #1a1926; --ink: #eceaf6; --muted: #aeabc6; --faint: #85829f; --rule: #2f2d43;
    --accent: #a795f0; --accent-ink: #c4b8f7; --accent-soft: #2a2444;
    --sign: #45c597; --sign-soft: #15302a; --warn: #f0b44a; --warn-soft: #36290f; --crit: #f07a70; --crit-soft: #3a1c1c;
    --hover: rgba(255, 255, 255, .055); --bar-muted: #3f3c57;
    --s-state: #3987e5; --s-county: #d95926; --s-city: #199e70; --s-metro: #c98500;
    --s-schools: #d55181; --s-measure_a: #008300; --s-federal: #9085e9; --s-other: #e66767;
    --r1: #c9bdf5; --r2: #a795f0; --r3: #8670d3; --r4: #6650b8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #12111c; --paper: #1a1926; --ink: #eceaf6; --muted: #aeabc6; --faint: #85829f; --rule: #2f2d43;
  --accent: #a795f0; --accent-ink: #c4b8f7; --accent-soft: #2a2444;
  --sign: #45c597; --sign-soft: #15302a; --warn: #f0b44a; --warn-soft: #36290f; --crit: #f07a70; --crit-soft: #3a1c1c;
  --hover: rgba(255, 255, 255, .055); --bar-muted: #3f3c57;
  --s-state: #3987e5; --s-county: #d95926; --s-city: #199e70; --s-metro: #c98500;
  --s-schools: #d55181; --s-measure_a: #008300; --s-federal: #9085e9; --s-other: #e66767;
  --r1: #c9bdf5; --r2: #a795f0; --r3: #8670d3; --r4: #6650b8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--f-body); font-size: var(--step-0); line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.1; }
h1 { font-size: var(--step-3); font-weight: 900; letter-spacing: -.015em; }
h2 { font-size: var(--step-2); font-weight: 900; letter-spacing: -.01em; }
h3 { font-size: var(--step-1); font-weight: 800; }
p { margin: 0; }
ul, ol { margin: 0; }
.num, td.n { font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--f-display); font-weight: 800; font-size: var(--step--1); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.lede { color: var(--muted); max-width: 66ch; font-size: 1.0625rem; }
.small { font-size: var(--step--1); color: var(--muted); }
.src { font-size: var(--step--1); color: var(--faint); }
.src a { color: var(--muted); }
.stack-v { display: grid; gap: 14px; }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--paper); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand b { font-family: var(--f-display); font-weight: 900; font-size: 1.375rem; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 26px; }
/* ---------- main menu: grouped dropdowns on wide screens, a drawer on phones ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--paper); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 12px; }
.top .topbar { justify-content: space-between; }
.mainnav { position: relative; }
.burger { display: none; align-items: center; gap: 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 .9375rem var(--f-display); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.burger-icon { display: grid; gap: 4px; width: 18px; }
.burger-icon i { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.mainnav.is-open .burger-icon i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mainnav.is-open .burger-icon i:nth-child(2) { opacity: 0; }
.mainnav.is-open .burger-icon i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.group { position: relative; }
.gbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font: 700 .9375rem var(--f-display); color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.gbtn svg { width: 12px; height: 12px; transition: transform .2s; }
.gbtn:hover, .group.is-open > .gbtn { background: var(--hover); color: var(--ink); }
.group.is-current > .gbtn { color: var(--accent-ink); }
.group.is-current > .gbtn::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.group.is-open > .gbtn svg { transform: rotate(180deg); }
.gpanel { display: none; position: absolute; right: 0; top: calc(100% + 12px); width: min(460px, 92vw); background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 14px 40px rgba(20, 16, 50, .16); padding: 14px; z-index: 20; }
.group:first-child .gpanel, .group:nth-child(2) .gpanel { right: auto; left: 0; }
.group.is-open > .gpanel { display: block; }
.gblurb { font-family: var(--f-display); font-weight: 800; font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 10px 8px; }
.gpanel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gpanel a { display: grid; gap: 1px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.gpanel a:hover { background: var(--hover); }
.gpanel a b { font-family: var(--f-display); font-weight: 800; font-size: 1rem; }
.gpanel a span { font-size: var(--step--1); color: var(--muted); }
.gpanel a[aria-current="page"] { background: var(--accent-soft); }
.gpanel a[aria-current="page"] b { color: var(--accent-ink); }
@media (max-width: 900px) {
  .burger { display: inline-flex; }
  .menu { display: none; position: fixed; left: 0; right: 0; top: var(--menu-top, 60px); bottom: 0; overflow-y: auto; flex-direction: column; gap: 0; background: var(--paper); border-top: 1px solid var(--rule); padding: 8px max(16px, env(safe-area-inset-left, 0px)) 40px; z-index: 20; }
  .mainnav.is-open .menu { display: flex; }
  .group { border-bottom: 1px solid var(--rule); }
  .gbtn { width: 100%; justify-content: space-between; font-size: 1.125rem; padding: 16px 4px; color: var(--ink); }
  .group.is-current > .gbtn::after { display: none; }
  .gpanel { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 12px; }
  .gblurb { display: none; }
  body.menu-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .burger-icon i, .gbtn svg { transition: none; } }

/* ---------- page scaffolding ---------- */
.page-head { background: var(--paper); border-bottom: 1px solid var(--rule); padding-block: 36px 32px; }
.page-head .wrap { display: grid; gap: 12px; }
.crumbs { font-size: var(--step--1); color: var(--muted); }
.crumbs a { color: var(--muted); }
main section { padding-block: 40px; border-bottom: 1px solid var(--rule); }
main section:last-child { border-bottom: 0; }
main section > .wrap { display: grid; gap: 22px; }
.head { display: grid; gap: 8px; }
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 22px; min-width: 0; }
/* Fixed column counts by width, so a row never ends with one card on its own. */
.grid-2, .grid-3, .grid-4 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-4 { gap: 14px; align-items: stretch; }
@media (min-width: 560px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 820px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 880px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stack-rows { display: grid; gap: 18px; }

/* ---------- stat ---------- */
.stat { display: grid; gap: 4px; align-content: start; }
.stat .v { font-family: var(--f-display); font-weight: 900; font-size: var(--step-3); line-height: 1; letter-spacing: -.01em; }
.stat .l { font-size: .9375rem; }
.stat .c { font-size: var(--step--1); color: var(--muted); }

/* ---------- explain box ---------- */
details.explain { border-top: 1px dashed var(--rule); padding-top: 8px; }
details.explain > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; color: var(--accent-ink); padding: 4px 0; }
details.explain > summary::-webkit-details-marker { display: none; }
details.explain > summary .q { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 800 .75rem var(--f-display); flex: none; }
details.explain > summary::after { content: "Show"; font-weight: 500; color: var(--faint); font-size: var(--step--1); }
details.explain[open] > summary::after { content: "Hide"; }
.explain-body { display: grid; gap: 10px; padding: 12px 14px; margin-top: 6px; background: var(--accent-soft); border-radius: 8px; font-size: .9375rem; max-width: 76ch; }
.explain-body .laws ul { padding-left: 18px; display: grid; gap: 6px; margin-top: 6px; }
.explain-body .tag { font-size: var(--step--1); color: var(--muted); }
.explain-body .pool b, .explain-body .laws > b { font-family: var(--f-display); }

/* ---------- ledger rows (expandable) ---------- */
.ledger { display: grid; border-top: 1px solid var(--rule); }
details.row { border-bottom: 1px solid var(--rule); }
details.row > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 6.5rem 18px; gap: 14px; align-items: center; padding: 12px 6px; border-radius: 6px; }
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary:hover { background: var(--hover); }
details.row .rl { display: grid; gap: 2px; min-width: 0; }
details.row .rl b { font-weight: 600; }
details.row .rl span { font-size: var(--step--1); color: var(--muted); }
details.row .rn { font-family: var(--f-mono); font-weight: 600; text-align: right; font-size: .9375rem; }
details.row .chev { width: 18px; height: 18px; display: grid; place-items: center; color: var(--faint); transition: transform .2s; }
details.row[open] .chev { transform: rotate(90deg); }
details.row .rb { padding: 4px 6px 18px; display: grid; gap: 12px; }
details.row .rb .explain-inline { display: grid; gap: 8px; max-width: 76ch; font-size: .9375rem; }
@media (max-width: 620px) {
  details.row > summary { grid-template-columns: minmax(0, 1fr) 5.5rem 16px; }
  details.row > summary .bars { grid-column: 1 / -1; grid-row: 2; }
}
.bars { display: grid; gap: 4px; }
.bar { height: 10px; background: var(--ground); border-radius: 0 4px 4px 0; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: var(--bar-muted); }
.bar.accent > i { background: var(--accent); }
.bar.social > i { background: var(--accent); }
.bar-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--step--1); color: var(--muted); }
.bar-key span { display: inline-flex; align-items: center; gap: 6px; }
.bar-key i { width: 18px; height: 8px; border-radius: 2px; display: inline-block; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: var(--sign-soft); color: var(--sign); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.none { background: var(--ground); color: var(--muted); }
.note { font-size: .9375rem; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); }
.note b { color: var(--warn); }

/* ---------- stacked bars ---------- */
.stack { display: flex; gap: 2px; height: 40px; border-radius: 5px; overflow: hidden; }
.stack > span { display: block; min-width: 3px; }
.stack > span:hover { filter: brightness(1.12) saturate(1.1); }
.stack.tall { height: 52px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 8px 22px; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: baseline; font-size: .9375rem; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; transform: translateY(1px); flex: none; }
.legend .v { font-family: var(--f-mono); font-size: .875rem; color: var(--muted); }

/* ---------- home ---------- */
.hero { background: var(--paper); padding-block: 40px 44px; border-bottom: 1px solid var(--rule); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 40px; align-items: end; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } }
.hero h1 { font-size: var(--step-2); font-weight: 800; max-width: 24ch; }
.rate { font-family: var(--f-display); font-weight: 900; font-size: var(--step-4); line-height: .9; letter-spacing: -.03em; }
.rate small { font-size: .35em; font-weight: 800; letter-spacing: 0; color: var(--muted); margin-left: .2em; }
.now { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)); gap: 14px; }
.now .panel { display: grid; gap: 6px; align-content: start; }
.go { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)); gap: 14px; }
.go a { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); text-decoration: none; color: var(--ink); }
.go a:hover { border-color: var(--accent); }
.go a b { font-family: var(--f-display); font-size: var(--step-1); font-weight: 800; }
.go a span { color: var(--muted); font-size: .9375rem; }
.go a em { font-style: normal; color: var(--accent-ink); font-weight: 600; font-size: .9375rem; }
.statusline { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: var(--step--1); color: var(--muted); }
.statusline b { color: var(--ink); font-weight: 600; }

/* ---------- receipt ---------- */
.receipt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .receipt-grid { grid-template-columns: 1fr; } }
form.inputs { display: grid; gap: 22px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
fieldset legend { font-family: var(--f-display); font-weight: 800; font-size: 1.0625rem; padding: 0; margin-bottom: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; align-content: start; }
.field label { font-weight: 600; font-size: .875rem; }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.money { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 8px; background: var(--ground); }
.money span { padding: 0 0 0 10px; color: var(--muted); font-family: var(--f-mono); font-size: .9375rem; }
.money span.after { padding: 0 10px 0 0; }
.money input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 1rem var(--f-mono); padding: 9px 10px 9px 6px; }
.money input:focus { outline: none; }
.money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.use-avg { justify-self: start; border: 1px solid var(--rule); background: var(--paper); color: var(--accent-ink); font: 600 .8125rem var(--f-body); padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.use-avg:hover { border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 3px; background: var(--ground); gap: 3px; justify-self: start; }
.seg label { cursor: pointer; padding: 6px 14px; border-radius: 6px; font-weight: 600; font-size: .9375rem; color: var(--muted); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.example-note { font-size: var(--step--1); color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 6px; }

.receipt { font-family: var(--f-mono); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 22px 20px 26px; position: relative; font-size: .875rem; }
.receipt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: linear-gradient(-45deg, transparent 6px, var(--paper) 0) 0 0/12px 8px, linear-gradient(45deg, transparent 6px, var(--paper) 0) 0 0/12px 8px; }
.receipt .rhead { text-align: center; display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px dashed var(--rule); }
.receipt .rhead b { font-family: var(--f-display); font-weight: 900; font-size: 1.25rem; letter-spacing: .02em; }
.receipt details { border-bottom: 1px dashed var(--rule); }
.receipt details > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; font-weight: 600; }
.receipt details > summary::-webkit-details-marker { display: none; }
.receipt details > summary span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.receipt details > summary .sw { width: 10px; height: 10px; border-radius: 2px; }
.receipt .rlines { padding: 0 0 12px 18px; display: grid; gap: 4px; }
.receipt .rline { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.receipt .rline.fee { font-style: italic; }
.receipt .rline.ctx { color: var(--faint); }
.receipt .rwhy { font-family: var(--f-body); font-size: .875rem; color: var(--ink); margin-top: 6px; }
.receipt .rwhy > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-weight: 600; font-size: .8125rem; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.receipt .rwhy > summary::-webkit-details-marker { display: none; }
.receipt .rwhy > summary::after { content: "+"; font-weight: 700; }
.receipt .rwhy[open] > summary::after { content: "−"; }
.receipt .rwhy-body { display: grid; gap: 6px; background: var(--accent-soft); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.receipt .rtotal { display: flex; justify-content: space-between; font-weight: 600; font-size: 1.0625rem; padding-top: 14px; }
.receipt .rsub { display: flex; justify-content: space-between; color: var(--muted); padding-top: 6px; }
.receipt .rsocial { margin-top: 14px; padding: 10px 12px; background: var(--accent-soft); border-radius: 6px; color: var(--ink); font-family: var(--f-body); font-size: .9375rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--f-display); font-weight: 800; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--ground); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.n { font-family: var(--f-mono); font-size: .875rem; white-space: nowrap; }

/* ---------- traces, promises, decisions ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--rule); border-radius: 8px; padding: 14px; display: grid; gap: 8px; align-content: start; background: var(--paper); }
.step .st { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step .st b { font-family: var(--f-display); font-weight: 800; }
.step p { font-size: .9375rem; color: var(--muted); }
.step.gap { border-style: dashed; border-color: var(--crit); }
.prow { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 10px; align-items: center; }
.prow .lbl { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.ptrack { position: relative; height: 26px; }
.pbar { height: 100%; border-radius: 0 4px 4px 0; display: flex; align-items: center; padding-left: 8px; font: 600 .8125rem var(--f-mono); white-space: nowrap; }
.pbar.promised { background: repeating-linear-gradient(135deg, var(--rule) 0 6px, transparent 6px 10px); border: 1px solid var(--faint); color: var(--ink); }
.pbar.actual { background: var(--accent); color: var(--paper); }
.pbar.missing { border: 1px dashed var(--crit); color: var(--crit); background: transparent; width: 100%; }
.pout { position: absolute; top: 4px; font: 600 .8125rem var(--f-mono); }
.ratio { font-family: var(--f-display); font-weight: 900; font-size: var(--step-2); }
.timeline { display: grid; }
.dec { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 18px; padding-block: 18px; border-top: 1px solid var(--rule); }
@media (max-width: 640px) { .dec { grid-template-columns: 1fr; gap: 6px; } }
.dec .when { font-family: var(--f-mono); font-size: .875rem; color: var(--muted); }
.dec .body { display: grid; gap: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); }
.tag.amt { color: var(--ink); border-color: var(--faint); font-family: var(--f-mono); }
.progress { height: 18px; border-radius: 4px; background: var(--ground); display: flex; overflow: hidden; gap: 2px; }
.progress i { display: block; height: 100%; }

/* ---------- live chart ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--f-mono); font-size: 11px; fill: var(--muted); }
.empty { border: 1px dashed var(--rule); border-radius: 10px; padding: 26px; display: grid; gap: 8px; justify-items: start; background: var(--paper); }
.empty b { font-family: var(--f-display); font-size: var(--step-1); font-weight: 800; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--paper); font-size: .8125rem; padding: 6px 10px; border-radius: 6px; max-width: 260px; transform: translate(-50%, calc(-100% - 12px)); }
footer.site { padding-block: 36px 56px; color: var(--muted); font-size: var(--step--1); border-top: 1px solid var(--rule); }
footer.site .wrap { display: grid; gap: 8px; }
@media (prefers-reduced-motion: no-preference) { details.row .chev { transition: transform .2s; } }
@media (prefers-reduced-motion: reduce) { details.row .chev { transition: none; } }

.sticky-col { position: sticky; top: 76px; }
@media (max-width: 900px) { .sticky-col { position: static; } }

/* ---------- v3: hidden attribute must win over display rules (renter / car fields) ---------- */
[hidden] { display: none !important; }

/* ---------- header slogan, footer ---------- */
.brand .slogan { font-family: var(--f-display); font-weight: 600; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--rule); padding-left: 10px; white-space: nowrap; }
@media (max-width: 720px) { .brand .slogan { display: none; } }
footer.site .foot-brand b { font-family: var(--f-display); font-weight: 900; color: var(--ink); font-size: 1.0625rem; }
footer.site .foot-brand span { font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-left: 8px; }
footer.site .made-by { margin-top: 6px; font-family: var(--f-display); font-weight: 700; color: var(--ink); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 14px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.filters label { display: grid; gap: 4px; font-size: var(--step--1); font-weight: 600; color: var(--muted); }
.filters select { font: 600 .9375rem var(--f-body); color: var(--ink); background: var(--ground); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 30px 7px 10px; min-width: 9rem; }
.filters .count { margin-left: auto; font-size: var(--step--1); color: var(--muted); align-self: center; }
.filters .chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button.chipbtn { border: 1px solid var(--rule); background: var(--ground); color: var(--muted); font: 600 .8125rem var(--f-body); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.filters button.chipbtn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- votes ---------- */
.vote-card { border-top: 1px solid var(--rule); padding-block: 18px; display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 18px; }
@media (max-width: 640px) { .vote-card { grid-template-columns: 1fr; gap: 6px; } }
.vote-card .when { font-family: var(--f-mono); font-size: .875rem; color: var(--muted); display: grid; gap: 2px; align-content: start; }
.vote-card .body { display: grid; gap: 8px; min-width: 0; }
.vote-card h3 { font-size: 1.125rem; }
.tally { display: inline-flex; align-items: center; gap: 8px; font: 700 .875rem var(--f-mono); }
.tally .dots { display: inline-flex; gap: 2px; flex-wrap: wrap; max-width: 220px; }
.tally .dots i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.v-yes { background: var(--sign); } .v-no { background: var(--crit); } .v-absent { background: var(--bar-muted); }
.v-abstain { background: var(--warn); } .v-recused { background: var(--faint); }
.rollcall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 4px 14px; font-size: .875rem; padding: 0; list-style: none; }
.rollcall li { display: flex; align-items: center; gap: 7px; }
.rollcall li i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.rollcall li span { color: var(--muted); font-size: var(--step--1); margin-left: auto; text-transform: capitalize; }
.record { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; }
.claim { border-left: 3px solid var(--rule); padding: 6px 0 6px 12px; display: grid; gap: 4px; font-size: .9375rem; }
.claim.supported { border-color: var(--sign); } .claim.missing_context { border-color: var(--warn); } .claim.contradicted { border-color: var(--crit); }
.claim q { font-style: italic; }

/* ---------- money timeline stages ---------- */
.stages { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.stages li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.stages li::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--rule); }
.stages li:last-child::before { display: none; }
.stages .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 800 .6875rem var(--f-display); background: var(--sign); color: var(--paper); position: relative; z-index: 1; }
.stages li.unknown .dot { background: var(--paper); color: var(--crit); border: 2px dashed var(--crit); }
.stages li.held .dot { background: var(--warn); }
.stages .what { display: grid; gap: 2px; }
.stages .what b { font-family: var(--f-display); font-weight: 800; }
.stages .what .d { font-family: var(--f-mono); font-size: .8125rem; color: var(--muted); }
.stages .what .d.gap { color: var(--crit); }
.stages .what p { font-size: .9375rem; color: var(--muted); }
.lag { font: 700 .8125rem var(--f-mono); color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; justify-self: start; }

/* ---------- pipeline diagram ---------- */
.diagram { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--f-body); fill: var(--ink); }
.diagram .t { font-family: var(--f-display); font-weight: 800; font-size: 15px; }
.diagram .s { font-size: 12px; fill: var(--muted); }
.diagram .box { fill: var(--paper); stroke: var(--rule); stroke-width: 1.5; }
.diagram .box.acc { stroke: var(--accent); stroke-width: 2; }
.diagram .box.gate { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.diagram .box.out { fill: var(--sign-soft); stroke: var(--sign); }
.diagram .box.bad { fill: var(--crit-soft); stroke: var(--crit); stroke-dasharray: 5 4; }
.diagram .ln { stroke: var(--faint); stroke-width: 1.75; fill: none; }
.diagram .ln.bad { stroke: var(--crit); stroke-dasharray: 5 4; }
.diagram .ah { fill: var(--faint); }
.diagram .num { font: 900 12px var(--f-display); fill: var(--paper); }
.diagram .numbg { fill: var(--accent); }
.diagram-mobile { display: none; }
@media (max-width: 760px) { .diagram-desktop { display: none; } .diagram-mobile { display: block; } }
.rules { display: grid; gap: 18px; counter-reset: rule; }
.rules article { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 4px 14px; }
.rules article::before { counter-increment: rule; content: counter(rule); grid-row: span 2; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font: 900 1rem var(--f-display); }
.rules h3 { font-size: 1.125rem; align-self: center; }
.rules p { max-width: 72ch; }

/* ---------- measures ---------- */
.mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.mcard { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); text-decoration: none; color: var(--ink); align-content: start; }
.mcard:hover { border-color: var(--accent); }
.mcard b { font-family: var(--f-display); font-weight: 900; font-size: var(--step-1); }
.mcard .k { font-size: var(--step--1); color: var(--muted); }
.mcard .alloc { display: flex; height: 10px; border-radius: 3px; overflow: hidden; gap: 2px; }
.mcard .alloc span { display: block; background: var(--accent); }
.mcard .alloc span:nth-child(2n) { background: var(--r3); } .mcard .alloc span:nth-child(3n) { background: var(--r1); } .mcard .alloc span:nth-child(5n) { background: var(--r4); }
.dash-yes { color: var(--sign); font-weight: 700; } .dash-no { color: var(--crit); font-weight: 700; }
.bars-v { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 180px; padding-top: 8px; }
.bars-v div { display: grid; gap: 4px; align-items: end; height: 100%; grid-template-rows: 1fr auto; min-width: 0; }
.bars-v .col { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bars-v .col i { flex: 1; border-radius: 3px 3px 0 0; display: block; min-height: 2px; }
.bars-v .col i.now { background: var(--accent); } .bars-v .col i.prev { background: var(--bar-muted); }
.bars-v span { font: 600 .6875rem var(--f-mono); color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }

/* ---------- video + transcript ---------- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { aspect-ratio: 16 / 9; border: 1px dashed var(--rule); border-radius: 10px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 20px; background: var(--paper); }
.player-empty b { font-family: var(--f-display); font-size: var(--step-1); font-weight: 800; }
.transcript { max-height: 460px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); }
.transcript .seg { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--rule); font-size: .9375rem; }
.transcript .seg button { font: 600 .8125rem var(--f-mono); color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; align-self: start; }
.transcript .seg b { font-weight: 700; margin-right: 6px; }
.transcript input[type=search] { width: 100%; border: 0; border-bottom: 1px solid var(--rule); padding: 10px 14px; font: 1rem var(--f-body); background: var(--ground); color: var(--ink); position: sticky; top: 0; }
.mlist .mrow { border-top: 1px solid var(--rule); }
.mlist .mrow > summary, .mlist a.mrow { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 6px; cursor: pointer; list-style: none; text-decoration: none; color: var(--ink); }
.mlist .mrow > summary::-webkit-details-marker { display: none; }
.mlist .mrow > summary:hover { background: var(--hover); }
.mlist .mrow > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mlist .mrow[open] > summary { background: var(--hover); }
.mlist .mrow .when { font-family: var(--f-mono); font-size: .875rem; color: var(--muted); }
.mlist .mrow .has { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.mlist .mbody { display: grid; gap: 12px; padding: 4px 6px 18px; max-width: 860px; }
.mlist .docs { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; font-size: var(--step--1); }
.player button.play { position: absolute; inset: 0; width: 100%; border: 0; background: #111; color: #fff; font: 700 1rem var(--f-body); cursor: pointer; }
.player button.play:hover, .player button.play:focus-visible { background: #222; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.pdfview iframe { width: 100%; height: 75vh; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
@media (max-width: 640px) { .mlist .mrow > summary, .mlist a.mrow { grid-template-columns: 1fr; gap: 4px; } .mlist .mrow .has { justify-content: start; } }

/* ---------- data tables on the site ---------- */
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tbar label { font-weight: 700; font-size: .875rem; }
.tbar input { flex: 1 1 240px; min-width: 0; font: 1rem var(--f-body); color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; }
.tbar .tcount { font-size: var(--step--1); color: var(--muted); }
.sortbtn { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sortbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
th[aria-sort="ascending"] .sortbtn span::after { content: "▲"; font-size: .625rem; }
th[aria-sort="descending"] .sortbtn span::after { content: "▼"; font-size: .625rem; }
th[aria-sort="none"] .sortbtn span::after { content: "↕"; font-size: .6875rem; color: var(--faint); }
table caption { text-align: left; padding: 12px 14px; font-size: var(--step--1); color: var(--muted); caption-side: top; }
@media (max-width: 700px) {
  table[data-table] thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table[data-table], table[data-table] tbody, table[data-table] tr, table[data-table] td { display: block; width: 100%; }
  table[data-table] tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
  table[data-table] caption { display: block; }
  table[data-table] td { border: 0; padding: 4px 14px 4px calc(7rem + 24px); position: relative; text-align: left !important; white-space: normal; min-height: 1.6em; }
  table[data-table] td::before { content: attr(data-label); position: absolute; left: 14px; top: 6px; width: 7rem; font-family: var(--f-display); font-weight: 800; font-size: .6875rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
}
.viewtoggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; padding: 3px; background: var(--ground); gap: 3px; }
.viewtoggle button { border: 0; background: none; font: 600 .875rem var(--f-body); color: var(--muted); padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.viewtoggle button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Collapsible source lists */
.srcgroups { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.srcgroup { border-bottom: 1px solid var(--rule); }
.srcgroup > summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 4px; cursor: pointer; font-weight: 600; list-style: none; }
.srcgroup > summary::-webkit-details-marker, details.srcs > summary::-webkit-details-marker { display: none; }
.srcgroup > summary::before, details.srcs > summary::before { content: "+"; display: inline-block; width: 1.1em; font-weight: 700; color: var(--accent-ink); }
.srcgroup[open] > summary::before, details.srcs[open] > summary::before { content: "−"; }
.srcgroup > summary > span:first-child { flex: 1; }
.srcgroup ul { margin: 0 0 14px; padding-left: 1.6rem; display: grid; gap: 4px; font-size: .9375rem; }
details.srcs { font-size: var(--step--1); color: var(--muted); margin-top: 8px; }
details.srcs > summary { cursor: pointer; list-style: none; font-weight: 600; }
details.srcs ul { margin: 6px 0 0; padding-left: 1.4rem; display: grid; gap: 3px; }
.muted { color: var(--muted); }
ul.plain { margin: 0; padding-left: 1.1rem; display: grid; gap: 8px; }
/* Contact form */
.contact-form label { display: grid; gap: 5px; font-weight: 600; font-size: var(--step--1); color: var(--ink); }
.contact-form input, .contact-form select, .contact-form textarea { font: 400 1rem var(--f-body); color: var(--ink); background: var(--ground); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; width: 100%; box-sizing: border-box; }
.contact-form input:focus-visible, .contact-form select:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form .row2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 560px) { .contact-form .row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-form .small { font-weight: 400; color: var(--muted); }
.contact-form .ferr { color: var(--crit); font-weight: 600; font-size: .8125rem; }
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.powbox { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--ground); font-size: var(--step--1); }
.powdot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.powbox.ok .powdot { animation: none; border: 0; background: var(--sign); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .powdot { animation: none; } }
.btn { font: 700 1rem var(--f-body); background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; justify-self: start; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.note.crit { border-color: var(--crit); background: var(--crit-soft); }
/* Meeting agenda and roll calls */
.agsec { margin: 18px 0 6px; font-size: var(--step-0); }
.agenda { border-top: 1px solid var(--rule); }
.agitem { border-bottom: 1px solid var(--rule); }
.agitem > summary { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 4px; cursor: pointer; list-style: none; }
.agitem > summary::-webkit-details-marker { display: none; }
.agitem > summary:hover { background: var(--hover); }
.agitem > summary .small { display: block; }
.agno { font-family: var(--f-mono); color: var(--muted); }
.agbody { padding: 0 4px 14px 3.1rem; display: grid; gap: 10px; font-size: .9375rem; }
.roll ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; font-size: .875rem; }
.roll li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--rule); padding: 2px 0; }
.roll li.v-no { color: var(--crit); font-weight: 600; }
.roll li.v-absent, .roll li.v-recused { color: var(--muted); }
@media (max-width: 640px) { .agitem > summary { grid-template-columns: 2rem minmax(0, 1fr); } .agitem > summary .has { grid-column: 2; } .agbody { padding-left: 4px; } }
