/* ============================================================
   GA Vote Watch — the signal room.
   A modern forensic instrument: deep layered dark (default) and
   porcelain light, one electric accent, validated series inks,
   Geist type, motion that answers the hand. Data voice is mono;
   honesty rules (null = hole, retraction = red) are law.
   ============================================================ */

/* ---- Vendored variable fonts (offline-safe; no external hosts) ---- */
@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geistmono-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: 'Geist Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;
  --pad: 16px;
  --maxw: 1320px;
  --t-fast: 100ms cubic-bezier(.3,.7,.4,1);
  --t: 180ms cubic-bezier(.2,.8,.3,1);
  --t-slow: 320ms cubic-bezier(.2,.8,.25,1);
}

/* Dark — the default: near-black blue, two faint color washes, layered translucent surfaces.
   Series inks validated 2026-07-03 (dataviz six checks, surface #0e1218): ALL PASS. */
html[data-theme="dark"] {
  --bg: #07090e;
  --bg-grad:
    radial-gradient(1100px 540px at 85% -10%, rgba(33, 164, 186, .09) 0%, transparent 62%),
    radial-gradient(900px 600px at -10% 110%, rgba(74, 92, 154, .10) 0%, transparent 60%);
  --surface: #0e1218;
  --surface-2: #141a24;
  --surface-3: #1b2331;
  --border: #1f2734;
  --border-strong: #2e3950;
  --text: #e6ecf5;
  --muted: #94a0b4;
  --faint: #5e6a7e;
  --accent: #21a4ba;          /* series/mark teal (validated) */
  --accent-2: #4fd4e8;        /* interactive: links, hovers, focus */
  --accent-weak: #10303a;
  --active: #31ab5f;          /* series/status green (validated) */
  --inactive: #c08519;        /* amber (validated) */
  --removed: #d94f4f;         /* red (validated) */
  --gap: #273043;
  --shadow: 0 10px 34px rgba(0, 0, 0, .5);
  --glow: 0 0 0 1px color-mix(in srgb, var(--accent-2) 28%, transparent),
          0 8px 30px color-mix(in srgb, var(--accent) 14%, transparent);
  --selection: #1d4a55;
  --chart-glow: drop-shadow(0 0 5px color-mix(in srgb, var(--sc) 45%, transparent));
  color-scheme: dark;
}

/* Light — porcelain: cool white, hairline grays, the same accent family a step deeper.
   Series inks validated 2026-07-03 (surface #ffffff): ALL PASS. */
html[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-grad:
    radial-gradient(1100px 540px at 85% -10%, rgba(7, 145, 173, .07) 0%, transparent 62%),
    radial-gradient(900px 600px at -10% 110%, rgba(90, 106, 160, .07) 0%, transparent 60%);
  --surface: #ffffff;
  --surface-2: #f2f5f8;
  --surface-3: #e8edf2;
  --border: #e2e7ee;
  --border-strong: #c6cfda;
  --text: #131c28;
  --muted: #5b6879;
  --faint: #93a0b0;
  --accent: #0791ad;
  --accent-2: #056a80;
  --accent-weak: #dcf1f5;
  --active: #2c8c4b;
  --inactive: #a9781a;
  --removed: #bd3a33;
  --gap: #dde3ea;
  --shadow: 0 10px 30px rgba(23, 34, 51, .10);
  --glow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
          0 8px 26px color-mix(in srgb, var(--accent) 12%, transparent);
  --selection: #cdeaf0;
  --chart-glow: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--selection); }
a { color: var(--accent-2); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 3px; }

/* ---------------- Scrollbars (always visible, themed) ---------------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 7px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------------- App bar: floating glass ---------------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 10px clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 660; letter-spacing: -.02em; }
.brand-mark { width: 22px; height: 22px; }
.brand-mark rect { fill: var(--accent); }
.brand-mark rect:nth-child(2) { fill: var(--active); }
.brand-mark rect:nth-child(3) { fill: var(--inactive); }
.brand-text { white-space: nowrap; font-size: 15px; }
@media (max-width: 720px) { .brand-text { display: none; } }

.appnav { display: flex; gap: 2px; }
#theme { margin-left: auto; }
.appnav a {
  position: relative;
  color: var(--muted); padding: 7px 12px; border-radius: 8px;
  font-weight: 560; font-size: 13px; letter-spacing: .01em;
  transition: color var(--t), background var(--t);
}
.appnav a:hover { color: var(--text); background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.appnav a.active { color: var(--accent-2); }
.appnav a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  border-radius: 2px; background: var(--accent-2);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent-2) 60%, transparent);
}
/* Small screens: the nav becomes a horizontally scrollable strip — never hidden with no substitute. */
@media (max-width: 600px) {
  .appnav { overflow-x: auto; scrollbar-width: none; }
  .appnav::-webkit-scrollbar { display: none; }
  .omni-wrap { display: none; }   /* the lookup needs a keyboard; nav keeps every surface reachable */
}

/* ---------------- Omnibox: the global lookup ---------------- */
.omni-wrap { position: relative; margin-left: auto; }
.omni-wrap + #theme { margin-left: 0; }
.omni {
  width: clamp(180px, 22vw, 300px); height: 36px; padding: 0 44px 0 12px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font: inherit; font-size: 13px; transition: var(--t);
}
.omni::placeholder { color: var(--faint); }
.omni:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-weak); }
.omni-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10px; color: var(--faint);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; pointer-events: none;
}
.omni-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: min(420px, 92vw);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 10px; max-height: min(520px, 76vh); overflow-y: auto;
}
.omni-group + .omni-group { margin-top: 10px; }
.omni-group > .eyebrow { margin: 0 4px 5px; }
.omni-row {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 9px; border-radius: var(--r-sm);
  color: inherit; text-decoration: none; cursor: pointer;
}
.omni-row b { font-size: 13px; font-weight: 600; color: var(--text); }
.omni-row span { font-size: 11.5px; color: var(--muted); }
.omni-row:hover, .omni-row.sel { background: var(--surface-2); }
.omni-row:hover b, .omni-row.sel b { color: var(--accent-2); }
.omni-empty { padding: 8px 9px; font-size: 12.5px; }

.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  color: var(--muted); border-radius: var(--r-md); cursor: pointer; transition: var(--t);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="light"] .i-moon { display: none; }

/* ---------------- Layout ---------------- */
.view { flex: 1; width: 100%; padding: clamp(16px, 3vw, 30px); }
.reading { max-width: var(--maxw); margin-inline: auto; }
.vd-narrative { max-width: var(--maxw); }
.appfoot { border-top: 1px solid var(--border); color: var(--faint); font-size: 12.5px; padding: 12px clamp(14px, 3vw, 28px); display: flex; justify-content: space-between; gap: 12px; }
.appfoot .mono { color: var(--muted); }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 680; color: var(--faint); }

/* ---------------- Panels (tool chrome) ---------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.panel-pad { padding: var(--pad) clamp(16px, 2.2vw, 22px); }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 14px; }

/* ---------------- Buttons & chips ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 560; cursor: pointer; transition: var(--t);
}
.btn:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04222a; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #04222a; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  color: var(--muted); font-size: 12.5px; cursor: pointer; transition: var(--t);
}
.chip:hover { border-color: var(--accent-2); color: var(--accent-2); }
.chip.active { border-color: var(--accent); color: var(--accent-2); background: var(--accent-weak); }

/* ---------------- Badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.active   { color: var(--active);   background: color-mix(in srgb, var(--active) 13%, transparent); }
.badge.inactive { color: var(--inactive); background: color-mix(in srgb, var(--inactive) 15%, transparent); }
.badge.removed, .badge.cancelled { color: var(--removed); background: color-mix(in srgb, var(--removed) 13%, transparent); }
.badge.neutral  { color: var(--muted); background: var(--surface-3); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; font-weight: 580; }

/* ---------------- Flap strip (signature) ---------------- */
.flap { display: flex; gap: 1.5px; align-items: stretch; width: 100%; }
.flap.mini { gap: 1px; width: auto; }
.flap-cell { flex: 1 1 auto; min-width: 3px; height: 22px; border-radius: 2px; background: var(--gap); transition: transform var(--t-fast); }
.flap.mini .flap-cell { min-width: 7px; height: 13px; flex: 0 0 auto; }
.flap-cell.is-a { background: var(--active); }
.flap-cell.is-i { background: var(--inactive); }
.flap-cell.is-h { background: var(--active); }
.flap-cell.is-x { background: var(--accent); }
.flap-cell.is-gap { background: var(--gap); }
.flap-cell:hover { transform: scaleY(1.18); outline: 1px solid var(--text); }

/* ---------------- Tables ---------------- */
.tbl-wrap { overflow: auto; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); transition: box-shadow var(--t); }
/* Scroll-edge cue (.cue-l/.cue-r set by the table's scroll sync): a clipped edge announces
   itself with an inset fade, so off-screen columns are never a secret. The shadow paints at the
   wrap's border box, which does not scroll with the content. */
.tbl-wrap.cue-l { box-shadow: inset 20px 0 16px -16px color-mix(in srgb, var(--text) 30%, transparent); }
.tbl-wrap.cue-r { box-shadow: inset -20px 0 16px -16px color-mix(in srgb, var(--text) 30%, transparent); }
.tbl-wrap.cue-l.cue-r { box-shadow:
  inset 20px 0 16px -16px color-mix(in srgb, var(--text) 30%, transparent),
  inset -20px 0 16px -16px color-mix(in srgb, var(--text) 30%, transparent); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-weight: 640; color: var(--faint);
  background: var(--surface); padding: 10px 14px;
  border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
}
table.data td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--t-fast), box-shadow var(--t-fast); }
table.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent-2); }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data .changed { color: var(--inactive); font-weight: 600; position: relative; }
table.data .changed::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 2px; background: color-mix(in srgb, var(--inactive) 55%, transparent); border-radius: 2px; }
table.data th.sortable { cursor: pointer; user-select: none; transition: color var(--t-fast); }
table.data th.sortable:hover { color: var(--text); }
table.data th.sorted { color: var(--accent-2); }
table.data th .sort-ind { display: inline-block; margin-left: 5px; font-size: 9px; color: var(--faint); vertical-align: 1px; }
table.data th.sortable:hover .sort-ind { color: var(--muted); }
table.data th.sorted .sort-ind { color: var(--accent-2); }
/* A negative snap delta — the retraction ink. */
table.data td.neg { color: var(--removed); font-weight: 600; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 570; cursor: pointer; white-space: nowrap; transition: var(--t); margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-2); border-bottom-color: var(--accent-2); }
.tabs button .count { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------------- Page-header meta row ---------------- */
.idmeta { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13.5px; }
.idmeta .vrn { font-family: var(--font-mono); color: var(--text); }
.copy { cursor: pointer; border: none; background: none; color: var(--faint); padding: 2px; border-radius: var(--r-sm); }
.copy:hover { color: var(--accent-2); }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; }

/* ---------------- Facets ---------------- */
.browse { display: grid; grid-template-columns: 248px 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .browse { grid-template-columns: 1fr; } }
.facets label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; font-weight: 570; }
.facets select, .facets input { width: 100%; height: 36px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); padding: 0 10px; font: inherit; }
.facets select:focus, .facets input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-weak); }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ---------------- Column chooser (browse) ---------------- */
.cc-wrap { position: relative; }
.cc-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: min(480px, 88vw); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px; }
.cc-cols { display: flex; gap: 14px; height: 64vh; min-height: 240px; max-height: 80vh; resize: vertical; overflow: hidden; }
.cc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-col > .eyebrow { margin-bottom: 8px; flex: none; }
.cc-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.cc-item { display: flex; align-items: center; gap: 8px; padding: 6px 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 13px; cursor: grab; transition: border-color var(--t-fast), background var(--t-fast); }
.cc-item:hover { border-color: var(--border-strong); background: var(--surface-3); }
.cc-item.dragging { opacity: .4; }
.cc-item.locked { cursor: default; border-style: dashed; opacity: .8; }
.cc-grip { color: var(--faint); font-size: 13px; line-height: 1; }
.cc-name { flex: 1; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12px; }
@media (max-width: 560px) { .cc-cols { flex-direction: column; } }
.browse-data table.data th, .snaps-data table.data th { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------------- Layout picker (saved views) ---------------- */
.lp-wrap { position: relative; }
.lp-btn { gap: 7px; }
.lp-cur { font-weight: 560; }
.lp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--inactive); display: inline-block; }
.lp-caret { color: var(--faint); font-size: 11px; margin-left: 1px; }
.lp-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 264px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 10px; }
.lp-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; margin-bottom: 8px; }
.lp-row { display: flex; align-items: center; border-radius: var(--r-sm); }
.lp-row:hover { background: var(--surface-2); }
.lp-row.active { background: var(--accent-weak); }
.lp-name { flex: 1; min-width: 0; padding: 7px 9px; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row.active .lp-name { color: var(--accent-2); font-weight: 600; }
.lp-del { flex: none; border: none; background: none; color: var(--faint); cursor: pointer; padding: 4px 9px; border-radius: var(--r-sm); font-size: 12px; }
.lp-del:hover { color: var(--removed); }
.lp-update { width: 100%; justify-content: center; margin-bottom: 8px; }
.lp-save { display: flex; gap: 6px; }
.lp-input { flex: 1; min-width: 0; height: 32px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); padding: 0 10px; font: inherit; font-size: 13px; }
.lp-input:focus { outline: none; border-color: var(--accent-2); }

/* ---------------- Most gaps controls ---------------- */
.gapctl { display: flex; gap: 22px 28px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chiprow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- Timeline "Changed" delta cell ---------------- */
.delta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.delta-f { color: var(--muted); }
.delta-from { color: var(--faint); }
.delta-to { color: var(--inactive); font-weight: 600; }
input.selbox { cursor: pointer; }

/* ---------------- Modal + snapshot compare ---------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: color-mix(in srgb, #000 62%, transparent); backdrop-filter: blur(3px); display: flex; padding: clamp(12px, 4vw, 48px); }
.modal { margin: auto; width: 100%; max-width: 1100px; max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: rise .28s cubic-bezier(.2,.8,.3,1); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 15px; }
.modal-head .icon-btn { width: 32px; height: 32px; }
.modal-body { overflow: auto; }
.cmp-wrap { overflow: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.cmp th, table.cmp td { padding: 6px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; vertical-align: top; }
table.cmp thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
table.cmp .cmp-field { position: sticky; left: 0; background: var(--surface); color: var(--muted); z-index: 1; }
table.cmp thead .cmp-field { background: var(--surface-2); z-index: 3; }
table.cmp tr.difrow .cmp-field { color: var(--inactive); font-weight: 600; }
table.cmp td.difcell { color: var(--inactive); font-weight: 600; }

/* ---------------- SQL console ---------------- */
.sql-editor { width: 100%; min-height: 130px; resize: vertical; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); padding: 12px 14px; tab-size: 2; }
.sql-editor:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-weak); }
.sql-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.sql-status { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sql-examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------------- SQL rail: find a name, insert it qualified ---------------- */
.sqllayout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 920px) { .sqllayout { grid-template-columns: 1fr; } }
.rail-side { position: sticky; top: 70px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 8px; }
.rail-search, .mdl-search { width: 100%; font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); padding: 7px 10px; }
.rail-search:focus, .mdl-search:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-weak); }
.rail-note { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1.45; }
.rail-grp { margin-bottom: 12px; }
.rail-grp > .eyebrow { margin-bottom: 5px; }
.rail-rel { display: flex; align-items: baseline; gap: 7px; padding: 2px 0; }
.rail-ins { flex: 1; text-align: left; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--text); background: none; border: none; padding: 3px 5px; margin-left: -5px; border-radius: var(--r-sm); cursor: pointer; }
.rail-ins:hover { background: var(--accent-weak); color: var(--accent-2); }
.rail-rows { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.rail-doc { font-size: 12px; color: var(--faint); text-decoration: none; padding: 0 2px; }
.rail-doc:hover { color: var(--accent-2); }
.rail-col { display: flex; align-items: baseline; gap: 7px; padding: 3px 5px; margin: 0 -5px; cursor: pointer; border-radius: var(--r-sm); }
.rail-col:hover { background: var(--surface-2); }
.rail-col .cn { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); }
.rail-col .cq { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); flex: 1; }
.rail-col .ct { font-size: 10px; color: var(--faint); text-transform: lowercase; letter-spacing: .02em; }
.rail-all { font-size: 11.5px; color: var(--accent-2); text-decoration: none; padding-top: 8px; border-top: 1px solid var(--border); }
.rail-all:hover { text-decoration: underline; }

/* The gotchas block — cross-table rules, shared by the SQL rail and #/model */
details.gotchas { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
details.gotchas summary { cursor: pointer; padding: 7px 10px; font-size: 12px; font-weight: 620; color: var(--muted); user-select: none; }
details.gotchas summary:hover { color: var(--text); }
details.gotchas[open] summary { color: var(--text); border-bottom: 1px solid var(--border); }
.gotchas-body { padding: 2px 12px 10px; }
.gotchas-note { font-size: 11px; color: var(--faint); margin: 7px 0 0; line-height: 1.45; }
.gotchas-note a { color: var(--accent-2); text-decoration: none; }
.gotchas-note a:hover { text-decoration: underline; }
.gotcha-grp { margin-top: 10px; }
.gotcha-grp > .eyebrow { margin-bottom: 3px; }
.gotcha-grp ul { margin: 0; padding-left: 15px; }
.gotcha-grp li { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 4px 0; }
.gotcha-grp code, .gotchas-note code { font-family: var(--font-mono); font-size: 11px; color: var(--text); }

/* ---------------- Data model surface ---------------- */
.mdllayout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 920px) { .mdllayout { grid-template-columns: 1fr; } }
.mdl-side { position: sticky; top: 70px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 10px; }
.mdl-grp { margin-bottom: 12px; }
.mdl-grp > .eyebrow { margin-bottom: 5px; }
a.mdl-nl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 3px 6px; margin: 0 -6px; border-radius: var(--r-sm); text-decoration: none; color: var(--text); }
a.mdl-nl:hover { background: var(--surface-2); }
a.mdl-nl.active { background: var(--accent-weak); }
a.mdl-nl.active .nn { color: var(--accent-2); }
.mdl-nl .nn { font-family: var(--font-mono); font-size: 12.5px; }
.mdl-nl .nc { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.mdl-title { display: inline-flex; align-items: baseline; gap: 9px; font-family: var(--font-mono); }
.mdl-cmt { font-size: 14px; line-height: 1.62; color: var(--text); margin: 2px 0 4px; }
.mdl-ty { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); text-transform: lowercase; letter-spacing: .02em; }
.chip-data { background: var(--accent-weak); color: var(--accent-2); }
.chip-derived { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
/* Grids are nowrap by convention (dense, scroll with edge cues). A documentation column is the
   one case that must break it — a 590-char annotation on a single line is not readable at all. */
table.data td.prose { white-space: normal; max-width: 68ch; line-height: 1.5; padding-top: 11px; padding-bottom: 11px; }
.chip-session { background: color-mix(in srgb, var(--accent-2) 12%, transparent); color: var(--muted); }
.chip-provenance, .chip-internal { background: var(--surface-2); color: var(--muted); }

/* ---------------- States ---------------- */
.state { display: grid; place-items: center; gap: 12px; text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--border-strong); border-top-color: var(--accent-2); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { border: 1px solid color-mix(in srgb, var(--removed) 45%, var(--border)); background: color-mix(in srgb, var(--removed) 9%, transparent); color: var(--text); padding: 14px 16px; border-radius: var(--r-md); }
.error-box .lbl { color: var(--removed); font-weight: 650; }

.fadein { animation: fade .26s cubic-bezier(.2,.7,.3,1); }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0 !important; transition-duration: .001ms !important; }
}

/* ---------------- Voter view: phantom banner ---------------- */
.banner { border: 1px solid color-mix(in srgb, var(--removed) 42%, var(--border)); background: color-mix(in srgb, var(--removed) 8%, transparent); border-radius: var(--r-md); padding: 14px 16px; }
.banner-h { font-weight: 650; color: var(--removed); margin-bottom: 6px; }
.banner p { margin: 0 0 8px; color: var(--muted); font-size: 13px; max-width: 76ch; }
.banner details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.banner .explain { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.banner .explain li { margin: 4px 0; }
.banner .explain b { color: var(--text); font-weight: 600; }

/* ---------------- Unified cross-domain timeline (voter hero) ---------------- */
.utl { overflow-x: auto; font-family: var(--font-mono); }
.utl-row { display: grid; grid-template-columns: 108px repeat(var(--ny), minmax(22px, 1fr)); align-items: stretch; border-bottom: 1px solid var(--border); }
.utl-row:last-child { border-bottom: 0; }
.utl-lab { font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); padding: 7px 10px 7px 0; display: flex; align-items: center; }
.utl-col { border-left: 1px solid var(--border); padding: 5px 4px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px; min-height: 24px; }
.utl-years { border-bottom: 1px solid var(--border-strong); }
.utl-years .utl-col { border-left: 0; padding: 3px 4px; color: var(--faint); font-size: 11px; }
.rdot { width: 8px; height: 14px; border-radius: 2px; background: var(--gap); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; cursor: default; }
.rdot.is-a { background: var(--active); }
.rdot.is-i { background: var(--inactive); }
.rdot.is-c { background: var(--removed); }
.rdot.is-o { background: var(--accent); }
.rdot.is-conf { background: #a371f7; }
.rdot.is-gap { background: var(--gap); }
.rdot:hover { outline: 1px solid var(--text); }
.uchip { font-size: 11px; padding: 1px 7px; border-radius: var(--r-sm); cursor: pointer; color: #04222a; font-weight: 650; }
.uchip.is-h { background: var(--active); }
.uchip.is-x { background: var(--accent); }
.uchip:hover { filter: brightness(1.12); }
.utl-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 12px; padding: 9px 0 2px; font-family: var(--font-sans); }
.utl-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------------- Dynamic browse filters ---------------- */
.flt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.flt-row { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); padding: 8px 10px; }
.flt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.flt-col { font-size: 12.5px; color: var(--text); font-weight: 600; }
.flt-x { border: none; background: none; color: var(--faint); cursor: pointer; padding: 2px 5px; border-radius: var(--r-sm); font-size: 12px; line-height: 1; }
.flt-x:hover { color: var(--removed); }
.flt-ctl { display: flex; gap: 6px; align-items: center; }
.facets .flt-ctl input, .facets .flt-ctl select { height: 32px; width: auto; }
.flt-op { flex: none; min-width: 86px; }
.flt-ctl .flt-in, .flt-sm { flex: 1; min-width: 0; }
.flt-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 184px; overflow-y: auto; }
.flt-n { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.flt-add { position: relative; margin-top: 12px; }
.flt-pick { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 232px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px; }
.flt-pick-list { display: flex; flex-direction: column; gap: 1px; max-height: 280px; overflow-y: auto; margin-top: 7px; }
.flt-pick-row { padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 12.5px; color: var(--text); }
.flt-pick-row:hover { background: var(--surface-2); color: var(--accent-2); }
.flt-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ============================================================
   The record voice — headers, figures, plates, section rules.
   Modern: big Geist numerals with a gradient ink, hairline
   structure, cards that lift to the hand.
   ============================================================ */

/* Inner-page header: tight display title + small-caps eyebrow on a strong hairline. */
.page-head { border-bottom: 1px solid var(--border-strong); padding-bottom: 16px; margin-bottom: 22px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: 8px; color: var(--accent-2); }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; line-height: 1.02; color: var(--text); }
.page-sub { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 82ch; }
.page-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Caprule — small-caps run-in section heading on a hairline. */
.caprule { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-strong); padding-top: 12px; margin-bottom: 18px; }
.caprule-l { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.caprule-n { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.caprule-link { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }

/* Register figures — key counts as big numerals on hairline column rules, never boxed. */
.figwrap { padding-top: clamp(8px, 2vw, 14px); }
.figrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); row-gap: 26px; }
@media (max-width: 680px) { .figrow { grid-template-columns: repeat(2, 1fr); } }
.fig { padding: 2px clamp(14px, 2vw, 24px); border-left: 1px solid var(--border); min-width: 0; }
.fig:first-child { border-left: 0; padding-left: 0; }
.fig-k { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; min-height: 2.1em; }
.fig-v {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3vw, 36px);
  line-height: .98; letter-spacing: -.035em; white-space: nowrap;
  background: linear-gradient(180deg, var(--text) 55%, color-mix(in srgb, var(--text) 62%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fig-v.sm { font-size: clamp(19px, 2.2vw, 26px); line-height: 1.2; }
.fig-s { margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.figrow.tight { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); row-gap: 18px; }
.figrow.tight .fig { padding: 2px 14px; }
.fig-k.mono-k { font-family: var(--font-mono); text-transform: none; letter-spacing: .04em; font-size: 11.5px; min-height: auto; }
.datestack { font-size: 12.5px; line-height: 1.55; }

/* Plate — the card frame for every chart / evidentiary exhibit. */
.plate { margin-top: clamp(26px, 4vw, 44px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.plate-head { display: flex; align-items: baseline; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.plate-no { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); white-space: nowrap; }
.plate-cap { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.plate-body { padding: 18px 16px 14px; }

/* Shared intro note under a tab bar / above a grid. */
.tabnote { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; max-width: 78ch; }

/* ---------------- Home — the signal room front page ---------------- */
.home > * { animation: rise .5s cubic-bezier(.2,.8,.25,1) both; }
.home > *:nth-child(1) { animation-delay: .02s } .home > *:nth-child(2) { animation-delay: .09s }
.home > *:nth-child(3) { animation-delay: .16s } .home > *:nth-child(4) { animation-delay: .23s }
.home > *:nth-child(5) { animation-delay: .30s } .home > *:nth-child(6) { animation-delay: .37s }
.home > *:nth-child(7) { animation-delay: .44s }

.hero { padding: clamp(30px, 5vw, 58px) 0 clamp(22px, 3vw, 36px); }
.hero .kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-2); background: var(--accent-weak);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero .kicker::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 5.2vw, 58px); line-height: 1.0; letter-spacing: -.04em; max-width: 21ch;
  background: linear-gradient(180deg, var(--text) 60%, color-mix(in srgb, var(--text) 55%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .standfirst { font-size: clamp(14px, 1.5vw, 16px); line-height: 1.6; color: var(--muted); max-width: 68ch; margin: 16px 0 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.hero-meta b { color: var(--muted); font-weight: 600; }
.hero-meta .ro { color: var(--accent-2); font-weight: 640; }

.recent, .contents { padding-top: clamp(26px, 4vw, 44px); }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.entry {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 12px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.entry:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--glow); }
.entry .ord { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.entry .nm { font-family: var(--font-display); font-weight: 650; font-size: 17px; color: var(--text); letter-spacing: -.02em; }
.entry .gl { grid-column: 2; font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.entry .arw { color: var(--faint); transition: transform var(--t), color var(--t); }
.entry:hover .nm { color: var(--accent-2); }
.entry:hover .arw { color: var(--accent-2); transform: translateX(4px); }

/* ---- The shared time-series figure (chart.js) ---- */
.ch-plot { position: relative; }
.ch-frame, .ch-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ch-h    { --sc: var(--active); }
.ch-a    { --sc: var(--accent); }
.ch-roll { --sc: var(--accent); }
.ch-line { fill: none; stroke: var(--sc); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; filter: var(--chart-glow); }
.ch-area { fill: var(--sc); opacity: .14; }
.ch-lone { fill: var(--sc); }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-ref  { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-reflab { position: absolute; top: -2px; transform: translateX(-50%); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.ch-tick { position: absolute; left: 4px; transform: translateY(-110%); font-size: 10.5px; color: var(--faint); }
.ch-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--sc); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface), 0 0 10px color-mix(in srgb, var(--sc) 70%, transparent); }
.ch-endlab { position: absolute; transform: translate(-100%, -160%); font-size: 11px; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }
.ch-hair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-strong); pointer-events: none; }
.ch-tip { position: absolute; top: 8px; z-index: 5; pointer-events: none; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 7px 10px; font-size: 12px; }
.ch-tip-x { color: var(--faint); font-size: 11px; margin-bottom: 4px; }
.ch-tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.ch-tip-row b { font-variant-numeric: tabular-nums; }
.ch-tip-lab { color: var(--muted); font-family: var(--font-sans); font-size: 11.5px; }
.ch-key { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--muted); vertical-align: middle; }
.ch-key.ch-h, .ch-key.ch-a, .ch-key.ch-roll { border-color: var(--sc); }
.ch-axis { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; letter-spacing: .04em; color: var(--faint); font-family: var(--font-mono); }
.ch-legend { display: flex; gap: 18px; margin-top: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.ch-legend i { margin-right: 6px; }
.ch-mini .ch-axis { margin-top: 5px; font-size: 10px; }
.spark { display: inline-block; line-height: 0; }
.spark-svg { display: block; }
/* Draw-in: honest theatre — the marks arrive, the values do not change. */
.ch-line, .ch-area { animation: drawin .8s cubic-bezier(.3,.7,.3,1) both; }
@keyframes drawin { from { opacity: 0; } 40% { opacity: 1; } }

/* ---- Capture watch (cross-election small multiples) ---- */
.watchgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.watch-card {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.watch-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--glow); }
.watch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.watch-name { font-family: var(--font-display); font-weight: 650; font-size: 15.5px; letter-spacing: -.015em; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.watch-name:hover { color: var(--accent-2); }
.watch-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.watch-figs { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.watch-figs b { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.watch-drift { color: var(--removed); font-weight: 600; }

/* ---- Signals board ---- */
.sig-group { padding-top: clamp(18px, 3vw, 30px); }
.siggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sig-card {
  display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  padding: 16px 18px; color: inherit; text-decoration: none;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.sig-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--glow); }
.sig-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sig-title { font-family: var(--font-display); font-weight: 660; font-size: 16.5px; letter-spacing: -.02em; color: var(--text); }
.sig-card:hover .sig-title { color: var(--accent-2); }
.sig-arw { color: var(--faint); transition: transform var(--t), color var(--t); }
.sig-card:hover .sig-arw { color: var(--accent-2); transform: translateX(4px); }
.sig-desc { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.sig-figs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: auto; padding-top: 4px; font-size: 12px; color: var(--muted); }
.sig-fig b { font-family: var(--font-mono); font-weight: 640; color: var(--text); margin-right: 1px; }

/* Home signal strip: the board's pulse, on the front page. */
.pulse { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pulse-card {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); background: var(--surface); padding: 12px 15px;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.pulse-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.pulse-card b { font-family: var(--font-mono); font-size: 19px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.pulse-card span { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---- Address record + lens grids ---- */
.addr-link { font-family: var(--font-mono); font-size: 12.5px; }
.vrnlist { font-size: 12.5px; white-space: normal; }
.sig-sub { color: var(--faint); font-size: 11px; }

/* Rank bar: the lens's ranked metric — numeral in text ink over a zero-baseline wash scaled to
   the shown rows' max. A direct encoding of the printed value; never a verdict color. */
.rankbar { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; min-width: 76px; padding: 1px 4px; }
.rankbar i { position: absolute; right: 0; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.rankbar b { position: relative; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Signal strip: one fixed slot per outlier lens (position = identity, the flap-strip convention);
   the three lens groups separate with gaps. Lit = this voter is a member of that lens's set. */
.sigstrip { display: inline-flex; gap: 7px; }
.sigstrip-g { display: inline-flex; gap: 2px; }
.sig-cell { display: inline-block; width: 9px; height: 14px; border-radius: 2px; background: var(--gap); }
.sig-cell.on { background: var(--accent); box-shadow: 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.sig-cell:hover { outline: 1px solid var(--text); }

/* Election capture coverage (artflap mask). */
.coverage { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 12px 14px; }
.cov-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.cov-strip { display: flex; gap: 2px; }
.cov-cell { flex: 1 1 auto; min-width: 6px; height: 16px; border-radius: 2px; background: var(--gap); transition: transform var(--t-fast); }
.cov-cell:hover { transform: scaleY(1.2); outline: 1px solid var(--text); }
.cov-cell.cov-b { background: var(--active); }
.cov-cell.cov-h { background: var(--accent); }
.cov-cell.cov-a { background: var(--inactive); }
.cov-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.cov-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.cov-legend .cov-b { background: var(--active); } .cov-legend .cov-h { background: var(--accent); } .cov-legend .cov-a { background: var(--inactive); }
.cov-tally { margin-left: auto; font-family: var(--font-mono); color: var(--faint); }
