/* SignalData — site styles. Tokens mirror the SignalData design system (Paper / Gloss). */
:root,
.paper {
  --surface:#faf9f5; --panel:#ffffff; --stage:#efece3; --ink:#172024; --muted:#5f6566;
  --line:#d9d8d2; --line-strong:#c9cbbf; --lime:#d6f579; --lime-ink:#13221a;
  --accent:#c8432c; --chip:#efece3;
  --s1:#285e55; --s2:#4d8b7c; --s4:#a4bda0; --owed:#4d8b7c; --gave:#dd4b32;
  --rep:#b8432f; --dem:#3f6fb5; --track:#eeede7;
  --badge:#fff1bd; --badge-ink:#54451c; --tint-sage:#e5eedb; --tint-blue:#e5edfc; --tint-peach:#f4e4d9; --tint-lilac:#eee9f7;
  --acc:#fce9e8; --acc-line:#e5a9a5; --none:#e8f5ec; --none-line:#a6d3b4; --pend:#f4f5f3; --pend-line:#9aa39b;
  --focus:#ed5639; --backdrop:rgba(16,32,42,.74);
  color-scheme: light;
}
.gloss {
  --surface:#101f28; --panel:#172c36; --stage:#263d47; --ink:#edf3ea; --muted:#a6afac;
  --line:#33444c; --line-strong:#49606a; --lime:#d9fa80; --lime-ink:#11212a;
  --accent:#d9fa80; --chip:#263d47;
  --s1:#d9fa80; --s2:#64d4c1; --s4:#78a9ef; --owed:#64d4c1; --gave:#f7b075;
  --rep:#f08a73; --dem:#7fa8ef; --track:#22373f;
  --badge:#37453d; --badge-ink:#d7efb1; --tint-sage:#22372a; --tint-blue:#1f3346; --tint-peach:#3a2c25; --tint-lilac:#2c2840;
  --acc:#3a2423; --acc-line:#7a3b35; --none:#1f3a2c; --none-line:#3f7a58; --pend:#1b2a31; --pend-line:#5b6c73;
  --focus:#fb944f; --backdrop:rgba(5,12,16,.82);
  color-scheme: dark;
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: "Archivo", Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.6;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img, svg { max-width: 100%; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.serif { font-family: Georgia, "Times New Roman", serif; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--lime); color: var(--lime-ink); padding: 10px 14px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; min-height: 72px; padding-top: 10px; padding-bottom: 10px; }
.wordmark { margin-right: auto; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 700; letter-spacing: -2px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark span { color: var(--accent); }
.paper .wordmark span { color: #dd4b32; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.nav a { text-decoration: none; padding: 6px 0; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.theme-toggle { display: flex; padding: 3px; border-radius: 30px; background: var(--chip); }
.theme-toggle button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 30px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.theme-toggle button[aria-pressed="true"] { background: var(--lime); color: var(--lime-ink); }
.preview-flag { padding: 4px 8px; border-radius: 4px; background: var(--badge); color: var(--badge-ink); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

/* Breadcrumbs */
.crumbs { border-bottom: 1px solid var(--line); font-size: 13px; }
.crumbs ol { list-style: none; margin: 0; padding: 10px 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.crumbs li { display: flex; align-items: center; color: var(--muted); min-width: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.crumbs a { color: var(--ink); text-decoration: none; padding: 4px 0; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--muted); }

/* Type */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.7px; text-transform: uppercase; }
.eyebrow.accent { color: var(--accent); }
.paper .eyebrow.accent { color: #c8432c; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 4px; background: var(--badge); color: var(--badge-ink); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-weight: 800; }
.display { font-size: clamp(40px, 6.4vw, 80px); line-height: 1.01; letter-spacing: -0.05em; max-width: 1100px; }
.display .hl { color: var(--accent); }
.paper .display .hl { color: #c8432c; }
.h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.035em; max-width: 940px; }
.h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; }
.lede { margin: 0; max-width: 780px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(19px, 2vw, 23px); line-height: 1.42; color: var(--muted); }
.body-serif { margin: 0; max-width: 820px; font-family: Georgia, serif; font-size: 19px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.source { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11px; line-height: 1.6; color: var(--muted); }

/* Layout */
.hero { padding: 48px 0 52px; }
.hero .wrap { display: flex; flex-direction: column; gap: 22px; }
.main { padding: 44px 0 80px; }
.main .wrap { display: flex; flex-direction: column; gap: 64px; }
.section { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 16px; }
.grid { display: grid; gap: 18px; }
.g-420 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g-520 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.g-300 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.g-270 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.byline a { color: var(--ink); }
.note { margin: 0; padding: 16px 18px; background: var(--stage); border-radius: 8px; font-size: 14px; line-height: 1.6; max-width: 980px; }
.chapters { display: flex; flex-wrap: wrap; gap: 8px; }
.chapters a { padding: 10px 15px; border-radius: 30px; background: var(--chip); font-size: 12px; font-weight: 700; text-decoration: none; }

/* Cards and panels */
.panel { margin: 0; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel figcaption, .fig-title { font-size: 14px; font-weight: 700; }
.panel .source { padding-top: 12px; border-top: 1px solid var(--line); }
.stat { font-size: clamp(48px, 6vw, 64px); line-height: 1; font-weight: 800; letter-spacing: -0.06em; }
.stat-label { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.divider-label { padding: 15px; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); text-align: center; font-size: 11px; font-weight: 700; letter-spacing: 1.7px; color: var(--muted); }
.caveat { padding: 18px 20px; background: var(--stage); border-radius: 8px; font-size: 15px; line-height: 1.6; }
.chip-acc { background: var(--acc); color: var(--ink); }
.chip-blue { background: var(--tint-blue); color: var(--ink); }
.chip-none { background: var(--none); color: var(--ink); }

/* Butterfly chart: owed vs gave */
.butterfly .row { display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,230px) minmax(0,1fr); align-items: center; gap: 14px; font-size: 14px; }
.butterfly .l { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.butterfly .r { display: flex; align-items: center; gap: 10px; }
.butterfly .m { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.butterfly .m b { line-height: 1.25; }
.butterfly .bar { height: 24px; border-radius: 3px; flex: 0 0 auto; }
.butterfly .bar.owed { background: var(--owed); }
.butterfly .bar.gave { background: var(--gave); }
.butterfly .v { font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; }
@media (max-width: 640px) {
  .butterfly .row { grid-template-columns: 1fr 1fr; grid-template-areas: "m m" "l r"; gap: 6px 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .butterfly .m { grid-area: m; text-align: left; }
  .butterfly .l, .butterfly .r { flex-direction: column-reverse; align-items: stretch; gap: 4px; }
  .butterfly .l { grid-area: l; }
  .butterfly .r { grid-area: r; flex-direction: column; }
  .butterfly .bar { height: 14px; }
  .butterfly .v { font-size: 12px; white-space: nowrap; }
}

/* Recipient (candidate) cards */
.recipient { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 8px; color: var(--ink); }
.recipient.yes { background: var(--acc); border: 1px solid var(--acc-line); }
.recipient.no { background: var(--none); border: 1px solid var(--none-line); }
.recipient.pending { background: var(--pend); border: 1px dashed var(--pend-line); }
.recipient .office { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.recipient .name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.recipient .amt { font-size: 34px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.1; }
.recipient .detail { font-size: 13px; line-height: 1.5; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* Horizontal bars */
.hbar { display: grid; align-items: center; gap: 10px; font-size: 13px; }
.hbar.cols-state { grid-template-columns: 112px minmax(0,1fr) 92px; }
.hbar.cols-co { grid-template-columns: minmax(120px,196px) minmax(0,1fr) 84px; }
.hbar.cols-svc { grid-template-columns: minmax(110px,150px) minmax(0,1fr) 44px; }
.hbar .track { height: 16px; background: var(--track); border-radius: 3px; display: flex; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 3px; }
.hbar .num { font-family: "IBM Plex Mono", monospace; font-size: 12px; text-align: right; }
.hbar .zero { color: var(--muted); font-style: italic; }
.cols { display: flex; align-items: flex-end; gap: 20px; height: 220px; padding-top: 10px; }
.cols .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.cols .col div { width: 64%; background: var(--s1); border-radius: 3px 3px 0 0; }
.cols .col span:last-child { font-size: 12px; text-align: center; color: var(--muted); line-height: 1.35; }
.stackbar { display: flex; height: 34px; border-radius: 4px; overflow: hidden; }

/* Primary record card */
.record { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--tint-blue); border-radius: 12px; }
.record dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.record dt { color: var(--muted); }
.record dd { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 4px; border: 0; background: var(--lime); color: var(--lime-ink); font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; align-self: flex-start; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid currentColor; }

/* Share cards (fixed colors so they look the same in both themes) */
.share { display: flex; flex-direction: column; gap: 12px; min-height: 420px; padding: 26px; border-radius: 20px; }
.share .q { font-size: 30px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.share .big { font-size: 60px; line-height: 1; font-weight: 800; letter-spacing: -0.05em; }
.share .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid currentColor; font-size: 11px; line-height: 1.6; }
.share.s1 { background: #101f28; color: #edf3ea; } .share.s1 .big { color: #d9fa80; }
.share.s2 { background: #e9e8df; color: #172024; }
.share.s3 { background: #254e47; color: #ffffff; } .share.s3 .big { color: #d9fa80; }

/* File cards (index + homepage) */
.file-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--ink); transition: transform .15s ease; min-height: 240px; }
a.file-card:hover { transform: translateY(-3px); }
.file-card.feature { background: var(--tint-blue); border-color: transparent; }
.file-card.t-peach { background: var(--tint-peach); border-color: transparent; }
.file-card.t-sage { background: var(--tint-sage); border-color: transparent; }
.file-card.t-lilac { background: var(--tint-lilac); border-color: transparent; }
.file-card .title { font-size: 24px; line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; }
.file-card p { margin: 0; font-size: 14px; line-height: 1.55; }
.file-card .meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 9px; border-radius: 30px; background: var(--surface); font-size: 11px; font-weight: 700; }
.status-live { background: var(--lime); color: var(--lime-ink); }
.status-reporting { background: var(--badge); color: var(--badge-ink); }

/* Homepage hero (always dark, flow-led) */
.home-hero { background: #101f28; color: #edf3ea; overflow: hidden; }
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.home-hero .display .hl { color: #d9fa80; }
.home-hero .lede { color: #b7c0bd; }
.home-hero .btn.ghost { color: #edf3ea; }
.flow-svg { width: 100%; height: auto; }
@media (max-width: 860px) { .home-hero .wrap { grid-template-columns: 1fr; } }
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.principles div { padding: 20px; border-top: 3px solid var(--ink); }
.principles b { display: block; font-size: 17px; margin-bottom: 6px; }

/* Prose pages */
.prose { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.prose h2 { font-size: 26px; letter-spacing: -0.02em; margin-top: 18px; }
.prose p, .prose li { font-size: 17px; line-height: 1.65; }
.prose p { margin: 0; }

/* Tables and dialog */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
td:last-child { color: var(--muted); }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 560px; }
dialog { width: min(820px, calc(100% - 32px)); max-height: calc(100% - 64px); padding: 30px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: var(--backdrop); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.close { min-width: 44px; min-height: 44px; border-radius: 22px; border: 0; background: var(--stage); color: var(--ink); font-size: 20px; cursor: pointer; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; font-size: 13px; line-height: 1.7; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- County map (shared component; see tools/maps.py, assets/map.js) ---------- */
:root, .paper {
  --m-active: #1f5f73; --m-reducing: #6fa7b6; --m-suspended: #9d97cf; --m-unconfirmed: #a9b4bc; --m-ended: #d99a4e; --m-none: #cfd9c6;
  --m-hatch-bg: #eceae2; --m-hatch: #c9c6bb; --m-stroke: #faf9f5; --m-sel: #172024;
  --q0: #e4eedc; --q1: #bcd6b1; --q2: #88b48c; --q3: #4d8b7c; --q4: #23574f;
  --loc-off: #e3e1d8; --loc-on: #c8432c;
}
.gloss {
  --m-active: #64d4c1; --m-reducing: #3b8f86; --m-suspended: #8d88c4; --m-unconfirmed: #5f6b73; --m-ended: #f7b075; --m-none: #3a4f45;
  --m-hatch-bg: #1c2d35; --m-hatch: #2e434c; --m-stroke: #101f28; --m-sel: #d9fa80;
  --q0: #21352c; --q1: #2e5443; --q2: #3f7c62; --q3: #5fae8a; --q4: #a6e8c6;
  --loc-off: #22373f; --loc-on: #d9fa80;
}
.k-active { fill: var(--m-active); } .k-reducing { fill: var(--m-reducing); } .k-suspended { fill: var(--m-suspended); } .k-unconfirmed { fill: var(--m-unconfirmed); } .k-ended { fill: var(--m-ended); }
.k-none { fill: var(--m-none); } .k-unchecked { fill: url(#hatch); }
.q0 { fill: var(--q0); } .q1 { fill: var(--q1); } .q2 { fill: var(--q2); } .q3 { fill: var(--q3); } .q4 { fill: var(--q4); }
.hatch-bg { fill: var(--m-hatch-bg); } .hatch-line { stroke: var(--m-hatch); stroke-width: 2.4; }
.cmap { display: flex; flex-direction: column; gap: 12px; }
.cmap-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 16px; }
.cmap-find { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 0; flex: 0 1 280px; }
.cmap-find input { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: inherit; font-size: 14px; font-weight: 400; width: 100%; }
.cmap-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 13px; border-radius: 30px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.cmap-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 16px; align-items: start; }
@media (max-width: 860px) { .cmap-body { grid-template-columns: 1fr; } }
.cmap-stage { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.cmap-svg { display: block; width: 100%; height: auto; }
.cmap-svg .cty { stroke: var(--m-stroke); stroke-width: 1.1; cursor: pointer; transition: opacity .12s; outline: none; }
.cmap-svg .cty:hover, .cmap-svg .cty:focus-visible { stroke: var(--m-sel); stroke-width: 2.4; }
.cmap-svg .cty.sel { stroke: var(--m-sel); stroke-width: 3; }
.cmap-legend { position: absolute; left: 6%; top: 40%; display: flex; flex-direction: column; gap: 6px; font-size: 12px; max-width: 46%; }
.cmap-legend .li { display: flex; align-items: center; gap: 8px; }
.cmap-legend svg { flex: 0 0 auto; border-radius: 3px; }
.cmap-legend .n { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
@media (max-width: 640px) { .cmap-legend { position: static; max-width: none; padding: 10px 4px 2px; } }
.cmap-tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; line-height: 1.4; max-width: 240px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.cmap-tip b { display: block; font-size: 13px; }
.cmap-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; position: sticky; top: 12px; }
.cmap-panel h3 { margin: 4px 0 10px; font-size: 22px; letter-spacing: -0.02em; }
.cmap-panel .btn { margin-top: 12px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--stage); font-size: 13px; }
.plist li span { color: var(--muted); }
.plist.pay li { flex-direction: row; justify-content: space-between; gap: 10px; }
.plist.pay li span { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
.cmap-note { margin: 0; font-size: 12px; color: var(--muted); }
.spill { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.spill.k-active { background: var(--m-active); } .spill.k-reducing { background: var(--m-reducing); } .spill.k-suspended { background: var(--m-suspended); } .spill.k-unconfirmed { background: var(--m-unconfirmed); } .spill.k-ended { background: var(--m-ended); }
.spill.k-none { background: var(--m-none); } .spill.k-unchecked { background: repeating-linear-gradient(45deg, var(--m-hatch-bg) 0 3px, var(--m-hatch) 3px 5px); }
.cmap-locator { width: min(320px, 100%); }
.cmap-locator .loc-off { fill: var(--loc-off); stroke: var(--surface); stroke-width: 1.2; }
.cmap-locator .loc-on { fill: var(--loc-on); stroke: var(--surface); stroke-width: 1.2; }
.county-hero { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
@media (max-width: 760px) { .county-hero { grid-template-columns: 1fr; } .cmap-locator { width: 200px; } }

/* sortable data table */
.dtable caption { text-align: left; font-weight: 700; padding: 0 0 10px; font-size: 14px; }
table.sortable td.r, table.sortable th.r { text-align: right; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.sortable td:last-child { color: inherit; }
.th-sort { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: inherit; }
.th-sort::after { content: " ↕"; color: var(--muted); font-weight: 400; }
.th-sort[data-dir="asc"]::after { content: " ↑"; } .th-sort[data-dir="desc"]::after { content: " ↓"; }
.dtable .table-scroll { max-height: 640px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.dtable thead th { position: sticky; top: 0; background: var(--stage); z-index: 1; }
.dtable td, .dtable th { padding: 9px 10px; }
.small-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.tag-c { display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--badge); color: var(--badge-ink); font-size: 10px; font-weight: 700; margin-left: 4px; }

/* agency records, timelines */
.agency { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 12px; }
.agency h3 { font-size: 22px; letter-spacing: -0.02em; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--line); }
.timeline li { padding-left: 14px; font-size: 14px; line-height: 1.55; }
.ev-date { display: inline-block; min-width: 86px; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
.src-inline { font-size: 12px; color: var(--muted); }
.src-inline a { color: var(--muted); }
.conf { margin: 0; font-size: 12px; color: var(--muted); }
.srclist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.prose-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; max-width: 820px; }

/* ---------- Entity and people pages (tools/entities.py) ---------- */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar.cols-band { grid-template-columns: minmax(130px,190px) minmax(0,1fr) minmax(120px,150px); }
.hbar .hlabel { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.hbar .num .muted { font-size: 11px; }
@media (max-width: 640px) {
  .hbar.cols-co, .hbar.cols-band, .hbar.cols-state { grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; }
  .hbar .track { grid-column: 1 / -1; grid-row: 2; height: 12px; }
}
.link-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); text-decoration: none; transition: transform .15s ease; }
.link-card b { font-size: 20px; letter-spacing: -0.02em; }
a.link-card:hover, a.link-recipient:hover { transform: translateY(-2px); }
a.link-recipient { text-decoration: none; transition: transform .15s ease; }
.ledger { display: flex; flex-direction: column; gap: 12px; }
.ledger-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.ledger-bar .btn { margin-left: auto; }
.ledger-table td.amt-neg { color: var(--accent); }
.link-card b a { text-decoration: none; } .link-card b a:hover { text-decoration: underline; }
.notes { padding: 12px 14px; border-radius: 8px; background: var(--badge); color: var(--badge-ink); font-size: 13px; }
.notes ul { margin: 6px 0 0; padding-left: 18px; }
.defs { font-size: 13px; max-width: 900px; } .defs dt { color: var(--ink); font-weight: 700; white-space: nowrap; }
.toplist li b { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.toplist li span { white-space: nowrap; }
.tdetails summary { cursor: pointer; font-size: 14px; font-weight: 700; padding: 6px 0; }
.tdetails[open] summary { margin-bottom: 10px; }
/* U.S. state map (entity pages): legend below the map; $0 states in neutral gray, not a funding color */
:root, .paper { --m-zero: #d9d8d2; }
.gloss { --m-zero: #33444c; }
.k-zero { fill: var(--m-zero); }
#state-map .cmap-legend { position: static; max-width: none; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; padding: 8px 6px 2px; }
/* Values SignalData changed from the filing (tools/doe.py): visible, with the as-filed text on hover */
.tag-fix { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-family: "Archivo", Arial, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; vertical-align: 1px; white-space: nowrap; cursor: help; }
.tag-corrected { background: var(--badge); color: var(--badge-ink); }
.tag-completed { background: var(--stage); color: var(--muted); border: 1px solid var(--line-strong); }
