/* Ballot Intel components. Colors, type and spacing come from tokens.css; nothing here hard-codes a
   theme color. Sections: base, primitives, access screens, app bar, intro, toolbar, overview,
   office explainer, matchups, tables, sources and donors, measures, dialogs, drawers, admin,
   toast and tooltip, footer, responsive, reduced motion. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
html:has(dialog[open].drawer), html:has(dialog[open].modal), html:has(dialog[open].sheet) { overflow: hidden; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-tint); color: var(--text); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 600; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--sunken); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -0.2em; }
.ic-fill { fill: currentColor; }
.wrap { width: 100%; max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.muted { color: var(--text-3); }
.small { font-size: var(--fs-12); }
.mt0 { margin-top: 0 !important; }
.mb0 { margin-bottom: 0 !important; }
.mt16 { margin-top: 16px !important; }
.mt20 { margin-top: 20px !important; }
.mt24 { margin-top: 24px !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- primitives: buttons ---------- */
.btn, .btn-ghost, .btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 14px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-size: var(--fs-14); font-weight: 600; line-height: 1.2; white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-1); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm, .btn-ghost.small { min-height: 32px; padding: 5px 10px; font-size: var(--fs-13); border-radius: var(--r-sm); gap: 6px; }
.btn-lg { min-height: 46px; padding: 12px 18px; font-size: var(--fs-15); }
.btn-block { width: 100%; }
.btn-ghost.ok { color: var(--yes); border-color: var(--yes-border); }
.btn-ghost.ok:hover { background: var(--yes-tint); }
.btn-ghost.danger { color: var(--no); border-color: var(--no-border); }
.btn-ghost.danger:hover { background: var(--no-tint); }
.btn-secondary[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); color: var(--text-3); flex-shrink: 0; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ic { width: 20px; height: 20px; }
.link-btn { color: var(--text-2); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); text-decoration-color: currentColor; }
.btn-link { display: inline-block; margin-top: 14px; color: var(--text-3); font-size: var(--fs-13); text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--text); }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--on-accent); font-size: var(--fs-11); font-weight: 700; font-variant-numeric: tabular-nums; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--sunken); color: var(--text-2); font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-secondary[aria-pressed="true"] .count-pill { background: var(--accent-fill); color: var(--on-accent); }

/* ---------- primitives: fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.field-hint { font-size: var(--fs-13); color: var(--text-3); margin: -2px 0 4px; }
.field-group { border: 0; display: flex; flex-direction: column; gap: 8px; }
select, input[type="text"], input[type="tel"], input[type="search"], input[type="email"], textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  font-size: var(--fs-14); line-height: 1.3;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; text-overflow: ellipsis; }
select:hover, input:hover, textarea:hover { border-color: var(--text-3); }
select:focus-visible, input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-tint); }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input[type="checkbox"] { accent-color: var(--accent-fill); width: 16px; height: 16px; }
.search { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 0; }
.search .ic { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 38px; border-radius: var(--r-md); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- primitives: segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-md); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 12px; border-radius: 7px; color: var(--text-3); font-size: var(--fs-13); font-weight: 600; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg-icons .seg-btn { padding: 5px 8px; }

/* ---------- primitives: chips, badges, pills ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 0; padding-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 8px 3px 12px; border-radius: var(--r-pill); background: var(--accent-tint); border: 1px solid var(--accent-border); color: var(--text); font-size: var(--fs-13); font-weight: 500; }
.chip .ic { width: 14px; height: 14px; color: var(--text-3); }
.chip:hover .ic { color: var(--text); }
.chip-clear { background: transparent; border-color: transparent; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; padding-left: 8px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--sunken); color: var(--text-2); font-size: var(--fs-12); font-weight: 600; line-height: 1.45; white-space: nowrap; vertical-align: middle; }
.badge .ic { width: 12px; height: 12px; }
.bd { color: var(--dem); background: var(--dem-tint); border-color: var(--dem-border); }
.br { color: var(--rep); background: var(--rep-tint); border-color: var(--rep-border); }
.bg { color: var(--grn); background: var(--grn-tint); border-color: var(--grn-border); }
.bl { color: var(--lib); background: var(--lib-tint); border-color: var(--lib-border); }
.bp { color: var(--pf); background: var(--pf-tint); border-color: var(--pf-border); }
.bai { color: var(--aip); background: var(--aip-tint); border-color: var(--aip-border); }
.bn { color: var(--npp); background: var(--npp-tint); border-color: var(--npp-border); }
.bnp { color: var(--np); background: var(--np-tint); border-color: var(--np-border); }
.binc { color: var(--accent); background: var(--accent-tint); border-color: var(--accent-border); }
.bwd { color: var(--no); background: var(--no-tint); border-color: var(--no-border); }
.bwon { color: var(--yes); background: var(--yes-tint); border-color: var(--yes-border); }
.bj { color: var(--text-2); background: var(--sunken); border-color: var(--border); }
.badge[class*="dt-"] { color: var(--pf); background: var(--pf-tint); border-color: var(--pf-border); }
.badge.dt-union { color: var(--dem); background: var(--dem-tint); border-color: var(--dem-border); }
.badge.dt-corporation, .badge.dt-trade-association { color: var(--accent); background: var(--accent-tint); border-color: var(--accent-border); }
.badge.dt-individual { color: var(--grn); background: var(--grn-tint); border-color: var(--grn-border); }
.badge.dt-party { color: var(--rep); background: var(--rep-tint); border-color: var(--rep-border); }
.badge.dt-tribe, .badge.dt-nonprofit { color: var(--np); background: var(--np-tint); border-color: var(--np-border); }

.stance { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-13); }
.stance::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.t-pro { color: var(--rep); }
.t-anti { color: var(--dem); }
.t-neu { color: var(--text-2); }
.t-na { color: var(--text-3); }
.ap-yes { color: var(--no); font-weight: 600; }
.ap-none { color: var(--text-3); }
.pos { display: inline-block; font-size: var(--fs-11); font-weight: 700; letter-spacing: 0.02em; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }
.pos-support { color: var(--yes); background: var(--yes-tint); }
.pos-oppose, .d-kind.pos-oppose { color: var(--no); background: var(--no-tint); border-color: transparent; }

/* ---------- access screens and loader ---------- */
.screen { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.wall-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px 28px 26px; box-shadow: var(--shadow-3); }
.wall-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: var(--fs-20); font-weight: 600; margin-bottom: 22px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--text); color: var(--accent-fill); flex-shrink: 0; }
[data-theme="dark"] .brand-mark { background: var(--accent-tint); border: 1px solid var(--accent-border); }
.brand-mark .ic { width: 20px; height: 20px; }
.wall-kicker { font-size: var(--fs-13); font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.wall-title { font-family: var(--font-serif); font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.wall-title.sm { font-size: var(--fs-24); }
.wall-text { font-size: var(--fs-15); line-height: 1.6; color: var(--text-2); margin-bottom: 14px; }
.wall-text strong { color: var(--text); }
.wall-fine { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); font-size: var(--fs-12); line-height: 1.55; color: var(--text-3); }
.wall-fine p + p { margin-top: 8px; }
.wall-fine strong { color: var(--text-2); }
.wall-error { color: var(--no); font-size: var(--fs-13); margin-top: 10px; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 12px 18px; background: #FFFFFF; color: #1F1F1F; border: 1px solid #DADCE0; border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-15); transition: box-shadow var(--dur-fast) ease; margin-top: 4px; }
.btn-google:hover { box-shadow: var(--shadow-2); }
.gate-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-weight: 600; font-size: var(--fs-14); margin: 6px 0 12px; border: 1px solid; }
.gate-status.pending { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-border); }
.gate-status.denied { background: var(--no-tint); color: var(--no); border-color: var(--no-border); }
.req-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 14px; }
.req-fields .full { grid-column: 1 / -1; }
.optin { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-13); line-height: 1.5; color: var(--text-2); margin: 0 0 16px; cursor: pointer; }
.optin input { margin-top: 2px; flex-shrink: 0; }

.loader-card { text-align: left; overflow: hidden; }
.ballot-scene { display: flex; justify-content: center; margin: 0 0 14px; }
.ballot-svg { overflow: visible; }
.lb-paper { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.lb-line { fill: var(--border-strong); }
.lb-box-empty { fill: none; stroke: var(--text-3); stroke-width: 1.5; }
.lb-checked { fill: var(--accent-fill); }
.lb-tick { fill: none; stroke: var(--on-accent); stroke-width: 1.6; }
.lb-box { fill: var(--loader-box); stroke: var(--accent-border); }
.lb-slot { fill: var(--bg); stroke: var(--accent-border); }
.lb-seal { fill: none; stroke: var(--accent-fill); stroke-width: 2; }
.ballot-sparks circle { fill: var(--accent-fill); }
.ballot-paper { animation: ballot-drop 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite; transform-origin: 110px 55px; }
.ballot-box { animation: box-bump 2.4s ease-in-out infinite; transform-origin: 110px 112px; }
.ballot-sparks circle { animation: spark 2.4s ease-in-out infinite; transform-origin: center; opacity: 0; }
.ballot-sparks circle:nth-child(2) { animation-delay: 0.12s; }
.ballot-sparks circle:nth-child(3) { animation-delay: 0.24s; }
@keyframes ballot-drop {
  0% { transform: translateY(-22px) rotate(-6deg); opacity: 0; }
  18% { transform: translateY(0) rotate(0deg); opacity: 1; }
  55% { transform: translateY(0) rotate(0deg); opacity: 1; }
  78% { transform: translateY(66px) scaleY(0.2); opacity: 0; }
  100% { transform: translateY(66px) scaleY(0.2); opacity: 0; }
}
@keyframes box-bump { 0%, 70% { transform: scale(1); } 80% { transform: scale(1.04, 0.95); } 90% { transform: scale(0.98, 1.03); } 100% { transform: scale(1); } }
@keyframes spark { 0%, 76% { opacity: 0; transform: translateY(0) scale(0.6); } 84% { opacity: 1; transform: translateY(-8px) scale(1.2); } 100% { opacity: 0; transform: translateY(-18px) scale(0.4); } }
.load-track { height: 6px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; }
.load-bar { height: 100%; width: 0; border-radius: var(--r-pill); background: var(--accent-fill); transition: width 0.35s ease-out; }
.load-meta { display: flex; justify-content: space-between; font-size: var(--fs-12); color: var(--text-3); margin: 8px 0 14px; font-variant-numeric: tabular-nums; }
.load-quip { font-family: var(--font-serif); font-size: var(--fs-18); font-weight: 600; margin: 0 0 14px; min-height: 26px; opacity: 0; }
.load-quip.in { animation: quip-in 0.45s var(--ease) forwards; }
@keyframes quip-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.load-faces { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.load-face { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-11); font-weight: 700; color: #FFFFFF; background: hsl(var(--hue, 210), 32%, 35%); opacity: 0; transform: scale(0.4); animation: face-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards; }
@keyframes face-pop { to { opacity: 1; transform: scale(1); } }

/* ---------- app bar ---------- */
.appbar { border-bottom: 1px solid var(--border); background: var(--bg); }
.appbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--font-serif); font-size: var(--fs-20); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.countdown-inline { display: none; }
.brand-sub { font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-right { display: flex; align-items: center; gap: 10px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--accent-tint); border: 1px solid var(--accent-border); color: var(--accent); font-size: var(--fs-13); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.acct { position: relative; }
.acct-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sunken); border: 1px solid var(--border-strong); color: var(--text-2); overflow: visible; transition: border-color var(--dur-fast) ease; }
.acct-btn:hover { border-color: var(--text-3); }
.acct-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-btn img:not([hidden]) + .acct-initial { display: none; }
.acct-initial { display: inline-flex; font-weight: 700; font-size: var(--fs-14); }
.acct-dot { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent-fill); border: 2px solid var(--bg); display: none; }
.acct-btn.has-pending .acct-dot { display: block; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-border); } 50% { box-shadow: 0 0 0 6px transparent; } }

.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: pop-in var(--dur-fast) var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-kicker { font-size: var(--fs-12); color: var(--text-3); }
.menu-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-14); text-align: left; }
.menu-item:hover { background: var(--hover); }
.menu-item .ic { color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
#btnAdmin.has-pending { color: var(--accent); }
#btnAdmin.has-pending .ic { color: var(--accent); }
.menu-check { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 10px; border-radius: var(--r-sm); font-size: var(--fs-14); cursor: pointer; user-select: none; }
.menu-check:hover { background: var(--hover); }

/* ---------- intro ---------- */
.intro { padding-top: 36px; padding-bottom: 24px; }
.eyebrow { font-size: var(--fs-13); font-weight: 600; color: var(--accent); margin-bottom: 6px; }
.page-title { font-family: var(--font-serif); font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; }
.intro-lede { margin-top: 10px; font-size: var(--fs-16); color: var(--text-2); max-width: 60ch; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 22px; }
.stat { display: flex; flex-direction: column-reverse; }
.stat dt { font-size: var(--fs-12); color: var(--text-3); }
.stat dd { font-size: var(--fs-24); font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 30; background: var(--toolbar-bg); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.toolbar-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border: 1px solid var(--border); border-radius: var(--r-md); }
.vt-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px; border-radius: 7px; color: var(--text-3); font-weight: 600; font-size: var(--fs-14); white-space: nowrap; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.vt-btn:hover { color: var(--text); }
.vt-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.tab-count { font-size: var(--fs-12); font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.vt-btn.active .tab-count { color: var(--accent); }
.controls { display: flex; align-items: center; gap: 8px; flex: 1 1 420px; min-width: 0; }
.controls .btn-secondary { flex-shrink: 0; }
.result-count { margin-left: auto; font-size: var(--fs-13); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 4px; }

/* ---------- overview charts ---------- */
.overview { margin-top: 20px; }
.overview > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); padding: 4px 0; border-radius: var(--r-sm); }
.overview > summary::-webkit-details-marker { display: none; }
.overview > summary:hover { color: var(--text); }
.overview .chev { transition: transform var(--dur-fast) ease; }
.overview:not([open]) .chev { transform: rotate(-90deg); }
.insights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 10px; }
.insight-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 12px; }
.insight-title { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.party-bar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--sunken); gap: 2px; }
.party-seg { height: 100%; transition: width 0.4s var(--ease); }
.party-seg.dem, .dot.dem, .dot.anti { background: var(--dem); }
.party-seg.rep, .dot.rep, .dot.pro { background: var(--rep); }
.party-seg.ind, .dot.ind, .dot.neu { background: var(--chart-other); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-13); color: var(--text-2); }
.legend-col { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-13); color: var(--text-2); }
.leg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.leg strong { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.donut-row { display: flex; align-items: center; gap: 18px; }
.donut-wrap { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.donut { width: 100%; height: 100%; }
.donut circle { transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray 0.4s var(--ease), stroke-dashoffset 0.4s var(--ease); }
.donut-track { stroke: var(--sunken); }
.donut-seg.pro { stroke: var(--rep); }
.donut-seg.anti { stroke: var(--dem); }
.donut-seg.neu { stroke: var(--chart-other); }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut-label strong { font-size: var(--fs-16); font-variant-numeric: tabular-nums; }
.donut-label span { font-size: var(--fs-11); color: var(--text-3); }
.vbars { display: flex; flex-direction: column; gap: 10px; }
.vbar { display: grid; grid-template-columns: 92px 1fr 32px; align-items: center; gap: 10px; font-size: var(--fs-13); color: var(--text-2); }
.vbar strong { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.vbar-track { height: 8px; background: var(--sunken); border-radius: var(--r-pill); overflow: hidden; }
.vbar-fill { height: 100%; width: 0; border-radius: var(--r-pill); transition: width 0.4s var(--ease); }
.vbar-fill.front { background: var(--accent-fill); }
.vbar-fill.chal { background: var(--text-3); }
.vbar-fill.wd { background: var(--no); }

/* ---------- office explainer (inline card and dialog) ---------- */
.office-card { margin-top: 20px; }
.office-card > .ex { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-1); }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ex-eyebrow { font-size: var(--fs-13); font-weight: 600; color: var(--accent); }
.ex-title { font-family: var(--font-serif); font-size: var(--fs-24); font-weight: 600; letter-spacing: -0.01em; }
.ex-area { font-size: var(--fs-13); color: var(--text-3); margin-top: 2px; }
.ex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ex-block + .ex-block { margin-top: 14px; }
.ex-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ex-h .ic { color: var(--accent); }
.ex-p { font-size: var(--fs-14); line-height: 1.6; color: var(--text); }
.ex-metrics { display: grid; gap: 6px; }
.ex-metric { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-14); }
.ex-metric span { color: var(--text-3); }
.ex-metric strong { text-align: right; font-variant-numeric: tabular-nums; }
.ex-list { padding-left: 18px; display: grid; gap: 6px; font-size: var(--fs-14); line-height: 1.5; }
.ex-sub { font-size: var(--fs-13); color: var(--text-3); margin-bottom: 8px; }
.ex-area-lg { font-size: var(--fs-14); color: var(--text-2); margin-bottom: 16px; }
.ex-run { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal .ex-grid { grid-template-columns: 1fr 1fr; }
.modal .ex-grid > :first-child { grid-column: 1 / -1; }
.mt-6 { margin-top: 6px; }

/* ---------- candidates: view head ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; margin-bottom: 12px; }
.col-sel { position: relative; }
.col-menu { min-width: 220px; }

/* ---------- matchups ---------- */
.matchups { display: flex; flex-direction: column; gap: 32px; padding-bottom: 48px; }
.m-section { display: flex; flex-direction: column; gap: 14px; }
.section-title { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-serif); font-size: var(--fs-24); font-weight: 600; letter-spacing: -0.01em; padding-bottom: 8px; border-bottom: 1px solid var(--border); scroll-margin-top: calc(var(--toolbar-h) + 12px); }
.section-count { font-family: var(--font-sans); font-size: var(--fs-13); font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.contest-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.contest { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 380px; scroll-margin-top: calc(var(--toolbar-h) + 12px); }
.contest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.contest-eyebrow { font-size: var(--fs-12); font-weight: 600; color: var(--text-3); }
.contest-title { font-family: var(--font-serif); font-size: var(--fs-20); font-weight: 600; letter-spacing: -0.005em; line-height: 1.2; }
.contest-area { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.contest-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.contest-body { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contest-body.solo { grid-template-columns: minmax(0, 1fr); }
.vs { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-family: var(--font-serif); font-style: italic; font-size: var(--fs-13); color: var(--text-3); }
.cand { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 16px; min-width: 0; transition: background-color var(--dur-fast) ease; }
.cand + .cand { border-left: 1px solid var(--border); }
.cand.picked { background-image: linear-gradient(var(--accent-tint), var(--accent-tint)); box-shadow: inset 0 3px 0 var(--accent-fill); }
.cand.wd { opacity: 0.6; }
.cand.dim > :not(.cand-note) { opacity: 0.45; }
.cand-note { display: inline-flex; align-self: flex-start; font-size: var(--fs-12); color: var(--text-3); background: var(--sunken); border-radius: var(--r-pill); padding: 2px 8px; }
.cand-top { display: flex; align-items: flex-start; gap: 12px; }
.cand-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cand-name { display: inline; text-align: left; font-size: var(--fs-16); font-weight: 650; line-height: 1.25; color: var(--text); text-decoration: none; }
.cand-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cand-name .ic { width: 14px; height: 14px; color: var(--accent); margin-left: 4px; vertical-align: -1px; }
.cand-desig { font-size: var(--fs-13); color: var(--text-3); line-height: 1.35; }
.cand-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.meter { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: var(--fs-12); color: var(--text-3); }
.meter-track { height: 6px; border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; min-width: 40px; }
.meter-fill { height: 100%; border-radius: var(--r-pill); background: var(--text-3); }
.meter-fill.hi { background: var(--yes); }
.meter-fill.mid { background: var(--accent-fill); }
.meter-fill.lo { background: var(--text-3); }
.meter-val { font-size: var(--fs-14); font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: right; }
.cand-facts { display: grid; gap: 8px; }
.cand-facts > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.cand-facts dt { font-size: var(--fs-12); color: var(--text-3); font-weight: 500; }
.cand-facts dd { font-size: var(--fs-13); line-height: 1.45; color: var(--text); min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cand-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 2px; }
.cand-actions .research-link { margin-left: auto; }
.pick-toggle { position: relative; display: inline-flex; cursor: pointer; }
.pick-toggle .pick-cb { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick-ui { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-13); font-weight: 600; transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.pick-ui .ic { width: 14px; height: 14px; }
.pick-toggle:hover .pick-ui { border-color: var(--text-3); color: var(--text); }
.pick-cb:checked + .pick-ui { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.pick-cb:focus-visible + .pick-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.pick-ui .when-on { display: none; }
.pick-cb:checked + .pick-ui .when-on { display: inline; }
.pick-cb:checked + .pick-ui .when-off { display: none; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--sunken); border: 1px solid var(--border); }
.avatar-md { width: 52px; height: 52px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-14); color: #FFFFFF; background: hsl(var(--hue, 210), 30%, 35%); border-color: transparent; letter-spacing: 0.02em; }
.avatar-md.avatar-initials { font-size: var(--fs-16); }
.avatar-lg.avatar-initials { font-size: var(--fs-20); }

/* ---------- tables (candidates table and donors) ---------- */
.tbl-scroll { position: relative; scroll-margin-top: calc(var(--toolbar-h) + 12px); overflow: auto; max-height: calc(100vh - var(--toolbar-h) - 32px); max-height: calc(100dvh - var(--toolbar-h) - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overscroll-behavior-x: contain; margin-bottom: 48px; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-13); }
.data-table th { position: sticky; top: 0; z-index: 2; background: var(--sunken); text-align: left; vertical-align: bottom; padding: 0; border-bottom: 1px solid var(--border-strong); white-space: nowrap; font-weight: 600; }
.th-btn { display: inline-flex; align-items: center; gap: 4px; padding: 10px 4px 10px 12px; font-size: var(--fs-12); font-weight: 600; color: var(--text-2); }
.th-btn:hover { color: var(--text); }
.data-table th.sa .th-btn { color: var(--accent); }
.arrow { font-size: var(--fs-12); min-width: 0.6em; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: var(--text-3); vertical-align: middle; margin-right: 6px; }
.info-btn:hover { color: var(--text); background: var(--hover); }
.info-btn .ic { width: 14px; height: 14px; }
.data-table td { padding: 12px; vertical-align: top; border-bottom: 1px solid var(--border); background: var(--surface); line-height: 1.45; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background-image: linear-gradient(var(--hover), var(--hover)); }
.data-table th.num, .data-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table th.num .th-btn { flex-direction: row-reverse; padding: 10px 12px 10px 4px; }

.cand-table th.col-pick, .cand-table td:nth-child(1) { position: sticky; left: 0; width: 56px; min-width: 56px; text-align: center; }
.cand-table th.col-name, .cand-table td:nth-child(2) { position: sticky; left: 56px; width: 250px; min-width: 250px; }
.cand-table th.col-pick, .cand-table th.col-name { z-index: 4; }
.cand-table td:nth-child(1), .cand-table td:nth-child(2) { z-index: 1; }
.cand-table th.col-pick .th-btn { padding-left: 8px; padding-right: 8px; }
.cand-table td:nth-child(1) { vertical-align: middle; }
.tbl-scroll.scrolled-x .cand-table td:nth-child(2), .tbl-scroll.scrolled-x .cand-table th.col-name { box-shadow: 8px 0 12px -8px rgba(0, 0, 0, 0.28); }
.cand-table th.col-office { min-width: 180px; }
.cand-table th.col-party { min-width: 140px; }
.cand-table th.col-win { min-width: 150px; }
.cand-table th.col-trump { min-width: 200px; }
.cand-table th.col-text { min-width: 280px; }
.cand-table tr.picked td { background-image: linear-gradient(var(--accent-tint), var(--accent-tint)); }
.cand-table tr.picked td:nth-child(1) { box-shadow: inset 3px 0 0 var(--accent-fill); }
.cand-table tr.wd td { color: var(--text-3); }
.name-cell { display: flex; gap: 10px; align-items: flex-start; }
.name-cell .research-link { font-weight: 600; font-size: var(--fs-14); text-align: left; color: var(--text); }
.name-cell .research-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.name-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ballot-desig { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.office-cell strong { display: block; font-weight: 600; margin-top: 4px; }
.decided-note { font-size: var(--fs-12); color: var(--yes); margin-top: 4px; font-weight: 600; }
.cw { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.cw.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.tb-btn { display: flex; width: fit-content; margin-top: 4px; font-size: var(--fs-12); font-weight: 600; color: var(--accent); }
.tb-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
input[type="checkbox"].pick-cb.table-cb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease; }
input[type="checkbox"].pick-cb.table-cb:hover { border-color: var(--accent); }
input[type="checkbox"].pick-cb.table-cb:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
input[type="checkbox"].pick-cb.table-cb:checked::after { content: ''; width: 10px; height: 6px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: translateY(-1px) rotate(-45deg); }

.donor-table th.col-dname, .donor-table td:first-child { position: sticky; left: 0; min-width: 220px; }
.donor-table th.col-dname { z-index: 4; }
.donor-table td:first-child { z-index: 1; }
.donor-table th.col-top { min-width: 260px; }
.tbl-scroll.scrolled-x .donor-table td:first-child, .tbl-scroll.scrolled-x .donor-table th.col-dname { box-shadow: 8px 0 12px -8px rgba(0, 0, 0, 0.28); }

/* ---------- sources, donors lists, drawer text ---------- */
.srcs { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; flex-wrap: wrap; }
.src { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 5px; font-size: var(--fs-11); font-weight: 700; text-decoration: none; border: 1px solid currentColor; line-height: 1; font-variant-numeric: tabular-nums; }
.src:hover { background: var(--hover); }
.src.conf-high { color: var(--conf-high); }
.src.conf-mod { color: var(--conf-mod); }
.src.conf-low { color: var(--conf-low); }
.conf-high { color: var(--conf-high); }
.conf-mod { color: var(--conf-mod); }
.conf-low { color: var(--conf-low); }
.src-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: var(--fs-12); }
.src-list.none { color: var(--text-3); }
.src-line { color: var(--text-2); text-decoration: none; }
.src-line:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.src-line small { color: var(--text-3); font-size: var(--fs-11); }
.dlist { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.dlist li::marker { color: var(--text-3); font-variant-numeric: tabular-nums; }
.donor-list { list-style: none; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-12); }
.donor-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.donor-link { color: var(--text); font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--accent-border); text-underline-offset: 3px; }
.donor-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.cand-link { color: var(--accent); font-weight: 600; text-align: left; }
.cand-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.d-amt { font-weight: 700; color: var(--yes); font-variant-numeric: tabular-nums; }
.d-kind { font-size: var(--fs-11); color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.d-more { margin-top: 2px; }
.donor-more { font-size: var(--fs-12); font-weight: 600; color: var(--accent); }
.donor-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.d-sub { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }

/* ---------- measures ---------- */
.measure-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; padding-bottom: 48px; }
.measure-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); transition: border-color var(--dur-fast) ease; }
.measure-card.voted-yes { border-color: var(--yes-border); box-shadow: inset 0 3px 0 var(--yes), var(--shadow-1); }
.measure-card.voted-no { border-color: var(--no-border); box-shadow: inset 0 3px 0 var(--no), var(--shadow-1); }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-num { font-family: var(--font-serif); font-size: var(--fs-28); font-weight: 600; color: var(--accent); line-height: 1; letter-spacing: -0.01em; font-variant-numeric: lining-nums; }
.m-kind { font-size: var(--fs-12); font-weight: 600; color: var(--text-3); }
.m-title { font-family: var(--font-serif); font-size: var(--fs-20); font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
.m-summary { font-size: var(--fs-14); line-height: 1.6; color: var(--text-2); }
.m-summary.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.m-more { align-self: flex-start; font-size: var(--fs-13); font-weight: 600; color: var(--accent); margin-top: -8px; }
.m-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.m-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-yes, .m-no { padding: 12px; border-radius: var(--r-md); border: 1px solid; font-size: var(--fs-13); line-height: 1.5; }
.m-yes { background: var(--yes-tint); border-color: var(--yes-border); }
.m-no { background: var(--no-tint); border-color: var(--no-border); }
.m-yes strong, .m-no strong { display: block; font-size: var(--fs-12); margin-bottom: 4px; }
.m-yes strong { color: var(--yes); }
.m-no strong { color: var(--no); }
.m-facts { display: grid; gap: 8px; }
.m-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: var(--fs-13); line-height: 1.5; color: var(--text); }
.m-row > strong { font-size: var(--fs-12); font-weight: 500; color: var(--text-3); padding-top: 1px; }
.m-details { border-top: 1px solid var(--border); padding-top: 10px; }
.m-details > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); padding: 4px 0; border-radius: var(--r-sm); }
.m-details > summary::-webkit-details-marker { display: none; }
.m-details > summary:hover { color: var(--text); }
.m-details > summary .ic { transition: transform var(--dur-fast) ease; }
.m-details:not([open]) > summary .ic { transform: rotate(-90deg); }
.m-details-body { display: grid; gap: 10px; padding-top: 8px; }
.m-money > strong { display: block; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); }
.m-money.yes .donor-list { border-top-color: var(--yes-border); }
.m-money.no .donor-list { border-top-color: var(--no-border); }
.m-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.m-sources { font-size: var(--fs-12); color: var(--text-3); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.m-vote { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.mv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: var(--r-md); font-weight: 700; font-size: var(--fs-14); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.mv-btn:hover { border-color: var(--text-3); }
.mv-btn.yes.active { background: var(--yes); border-color: var(--yes); color: var(--surface); }
.mv-btn.no.active { background: var(--no); border-color: var(--no); color: var(--surface); }
[data-theme="dark"] .mv-btn.yes.active, [data-theme="dark"] .mv-btn.no.active { color: #0E1013; }
.mv-btn.clear { color: var(--text-3); font-weight: 600; border-color: transparent; }
.mv-btn.clear:hover { color: var(--text); background: var(--hover); }

/* ---------- donors view ---------- */
.view-lede { font-size: var(--fs-15); color: var(--text-2); max-width: 75ch; margin-top: 20px; }
.donor-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 14px 0 16px; font-size: var(--fs-13); color: var(--text-2); }
.ds-stat strong { font-size: var(--fs-18); color: var(--text); font-variant-numeric: tabular-nums; }
.ds-stat em { font-style: normal; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 56px 16px; color: var(--text-3); font-size: var(--fs-15); }

/* ---------- dialogs (modal, sheet, drawer share these) ---------- */
dialog { padding: 0; margin: auto; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: none; max-height: none; overflow: hidden; }
dialog::backdrop { background: rgba(14, 16, 19, 0.5); background: var(--scrim, rgba(14, 16, 19, 0.5)); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal { width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 820px); border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
.modal[open] { display: flex; flex-direction: column; animation: modal-in var(--dur) var(--ease); }
.modal-wide { width: min(720px, calc(100vw - 32px)); }
.modal-xl { width: min(1000px, calc(100vw - 32px)); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--border); }
.modal-head-left { display: flex; align-items: center; gap: 12px; }
.modal-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent-tint); color: var(--accent); }
.modal-eyebrow { font-size: var(--fs-13); font-weight: 600; color: var(--accent); }
.modal-title { font-family: var(--font-serif); font-size: var(--fs-24); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.modal-body { padding: 20px 24px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-foot.space-between { justify-content: space-between; }
.prose { font-size: var(--fs-15); line-height: 1.65; color: var(--text); }
.prose p { margin-bottom: 12px; }
.prose .muted { font-size: var(--fs-14); }
.callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 16px; font-size: var(--fs-14); }
.callout p { margin-bottom: 6px; }
.callout-title { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.key-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.src-secs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.src-sec { padding: 10px 12px; border-radius: var(--r-md); transition: background-color 0.3s ease; }
.src-sec.flash { background: var(--accent-tint); }
.src-sec h4 { font-size: var(--fs-15); margin-bottom: 4px; }
.src-sec p { color: var(--text-2); font-size: var(--fs-14); margin: 0; }
.ql-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 16px 0 20px; }
.ql-grid-wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 4px; }
.ql-btn { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); color: var(--text); text-decoration: none; font-size: var(--fs-13); font-weight: 600; transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease; }
.ql-btn:hover { border-color: var(--text-3); background: var(--surface-2); color: var(--text); }
.ql-btn .ic { color: var(--accent); }
.mono-box { width: 100%; min-height: 160px; padding: 12px; font-family: var(--font-mono); font-size: var(--fs-12); line-height: 1.55; background: var(--sunken); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); resize: vertical; }
.rfo-wrap { position: relative; margin: 8px 0 14px; }
.rfo-copy { position: absolute; right: 8px; top: 8px; }
.about-link { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-14); font-weight: 600; color: var(--accent); text-decoration: none; }
.about-photo { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent-fill); object-fit: cover; }

/* Filter sheets: right-side panel on larger screens, bottom sheet on phones */
.sheet { margin: 0 0 0 auto; width: min(420px, 100vw); height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-3); }
.sheet[open] { display: flex; flex-direction: column; animation: drawer-in var(--dur) var(--ease); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--border); }
.sheet-title { font-family: var(--font-serif); font-size: var(--fs-24); font-weight: 600; }
.sheet-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.sheet-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface-2); }
.sheet-foot .btn-primary { flex: 1; }
.district-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.df-item { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); }
.df-item select { min-height: 36px; font-size: var(--fs-13); }

/* ---------- drawers ---------- */
.drawer { margin: 0 0 0 auto; width: min(560px, 100vw); height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-3); }
.drawer-wide { width: min(780px, 100vw); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in var(--dur) var(--ease); }
@keyframes drawer-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.drawer-header { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 18px 16px 16px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.drawer-avatar { flex-shrink: 0; }
.drawer-avatar-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.drawer-avatar-icon .ic { width: 24px; height: 24px; }
.drawer-titles { flex: 1; min-width: 0; }
.drawer-eyebrow { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-13); font-weight: 600; color: var(--accent); }
.drawer-eyebrow .sep { color: var(--text-3); }
.drawer-eyebrow span:empty, .drawer-eyebrow span:empty + .sep { display: none; }
.drawer-name { font-family: var(--font-serif); font-size: var(--fs-28); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin-top: 2px; }
.drawer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-13); color: var(--text-2); }
.drawer-meta-text { font-size: var(--fs-13); color: var(--text-2); margin-top: 4px; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-15); line-height: 1.6; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.fact { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.fact-label { font-size: var(--fs-12); color: var(--text-3); }
.fact-val { font-size: var(--fs-15); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.fact .meter { grid-template-columns: 1fr auto; }
.dsec { padding: 18px 0; border-top: 1px solid var(--border); }
.dsec-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-14); font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dsec-title .ic { color: var(--accent); width: 16px; height: 16px; }
.dsec-body { color: var(--text); }
.dsec-body + .dsec-body { margin-top: 6px; }
.dsec-fine p { font-size: var(--fs-12); color: var(--text-3); line-height: 1.5; }
.dsec-fine p + p { margin-top: 6px; }
.fc-card { margin: 4px 0 18px; padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.fc-card .dsec-title { margin-bottom: 0; }
.fc-hint { font-size: var(--fs-13); color: var(--text-3); margin-top: -6px; }
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-actions .btn-secondary { flex: 1 1 140px; }
.dd-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dd-totals .tot { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.dd-totals .tot span { font-size: var(--fs-12); color: var(--text-3); }
.dd-totals .tot strong { font-size: var(--fs-18); font-variant-numeric: tabular-nums; }
.mt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-md); }
.mini-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--fs-13); }
.mini-table th { text-align: left; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); padding: 8px 10px; background: var(--sunken); border-bottom: 1px solid var(--border); }
.mini-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.45; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table th.num, .mini-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- admin ---------- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.admin-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.admin-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--fs-13); color: var(--text-3); }
.admin-sum strong { color: var(--text); font-variant-numeric: tabular-nums; }
.admin-sum select { width: auto; min-height: 32px; margin-left: auto; font-size: var(--fs-13); padding-top: 4px; padding-bottom: 4px; }
.admin-list-wrap { max-height: 60vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.admin-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-13); color: var(--text-2); }
.admin-bulk-all { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; min-height: 32px; cursor: pointer; }
.arow-cb { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; margin: -6px 0 -6px -6px; cursor: pointer; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.arow:last-child { border-bottom: 0; }
.arow.pending { background: var(--accent-tint); }
.arow.selected { box-shadow: inset 3px 0 0 var(--accent-fill); }
.arow.arow-user { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.arow-who { min-width: 0; }
.arow-name { font-weight: 600; }
.arow-email { font-size: var(--fs-13); color: var(--text-2); overflow-wrap: anywhere; }
.arow-meta { font-size: var(--fs-12); color: var(--text-3); margin-top: 2px; }
.arow-status, .arow-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.zq-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 10px; font-size: var(--fs-13); color: var(--text-2); }
.zq-cap select { margin-left: 6px; }
.st { font-size: var(--fs-11); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.st-pending { color: var(--accent); background: var(--accent-tint); }
.st-approved { color: var(--yes); background: var(--yes-tint); }
.st-denied, .st-revoked { color: var(--no); background: var(--no-tint); }
.st-optin { color: var(--dem); background: var(--dem-tint); }
.st-researching { color: var(--np); background: var(--np-tint); }
.st-live { color: var(--yes); background: var(--yes-tint); }
.st-failed { color: var(--no); background: var(--no-tint); }
.admin-note { font-size: var(--fs-13); color: var(--text-3); line-height: 1.5; }
#contentFile { font-size: var(--fs-13); color: var(--text-2); }

/* ---------- toast and sourcing tooltip ---------- */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 100; transform: translate(-50%, 140%); opacity: 0; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-size: var(--fs-14); font-weight: 600; box-shadow: var(--shadow-3); pointer-events: none; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#sourcingTooltip { position: absolute; z-index: 70; width: min(280px, calc(100vw - 20px)); padding: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); font-size: var(--fs-13); line-height: 1.5; }
.sourcing-tooltip-header { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 600; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.stt-label { font-size: var(--fs-12); color: var(--text-3); }
.stt-src { font-weight: 600; margin-bottom: 8px; }
.stt-notes { font-size: var(--fs-13); color: var(--text-2); }
.stt-more { margin-top: 10px; text-align: right; }
.stt-more a { font-weight: 600; font-size: var(--fs-13); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; background: var(--surface-2); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 24px; padding-top: 24px; padding-bottom: 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.creator { display: flex; align-items: center; gap: 10px; }
.creator-photo-link { display: inline-flex; }
.creator-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--accent-fill); }
.creator-text { display: flex; flex-direction: column; line-height: 1.25; }
.creator-kicker { font-size: var(--fs-12); color: var(--text-3); }
.creator-name { font-weight: 600; color: var(--text); text-decoration: none; }
.creator-name:hover { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; font-size: var(--fs-14); }
.footer-fine { grid-column: 1 / -1; font-size: var(--fs-12); color: var(--text-3); max-width: 80ch; }

/* ---------- version pill, "What's new" page ---------- */
/* Tag colors reuse the theme's semantic hues (both themes already pass AA); no party meaning here. */
.version-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 12px 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-13); font-weight: 500; text-decoration: none; white-space: nowrap; }
.version-pill:hover { color: var(--text); border-color: var(--accent-border); }
.version-num { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 600; color: var(--accent); }
.version-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); }
.wall-version { margin-top: 14px; text-align: center; font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-3); }
.ic.flip { transform: rotate(180deg); }
.releases { padding-bottom: 48px; min-height: 60vh; }
.releases .wrap { max-width: calc(860px + 2 * var(--gutter)); }
.rel-head { padding-top: 28px; padding-bottom: 6px; }
.rel-head h1:focus { outline: none; }
.rel-top { margin-bottom: 18px; }
.rel-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--text-2); font-size: var(--fs-14); font-weight: 500; text-decoration: none; }
.rel-back:hover { color: var(--text); }
.rel-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.rel-filter { min-height: 30px; padding: 3px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: var(--fs-13); font-weight: 500; }
.rel-filter:hover { color: var(--text); }
.rel-filter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.rel-list { display: grid; gap: 12px; padding-top: 18px; }
.rel-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; color: inherit; text-decoration: none; transition: border-color var(--dur-fast) var(--ease); }
.rel-card:hover { border-color: var(--accent-border); }
.rel-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rel-ver { font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 600; color: var(--accent); }
.rel-title { font-family: var(--font-serif); font-size: var(--fs-20); font-weight: 600; line-height: 1.2; }
.rel-date { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rel-items { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rel-item { display: flex; align-items: baseline; gap: 10px; font-size: var(--fs-14); line-height: 1.5; color: var(--text-2); }
.rel-item > span:last-child { min-width: 0; }
.rel-item.plain { display: list-item; list-style: disc; margin-left: 1.2em; padding-left: 2px; }
.rel-item.plain::marker { color: var(--text-3); }
.rtag { flex: none; min-width: 7.4em; display: inline-block; text-align: center; padding: 1px 8px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--sunken); color: var(--text-2); font-size: var(--fs-11); font-weight: 600; line-height: 1.6; }
.rtag-new { color: var(--grn); background: var(--grn-tint); border-color: var(--grn-border); }
.rtag-improved { color: var(--np); background: var(--np-tint); border-color: var(--np-border); }
.rtag-admin { color: var(--pf); background: var(--pf-tint); border-color: var(--pf-border); }
.rtag-security { color: var(--rep); background: var(--rep-tint); border-color: var(--rep-border); }
.rtag-data, .rtag-current { color: var(--accent); background: var(--accent-tint); border-color: var(--accent-border); }
.rtag-architecture, .rtag-operations { border-color: var(--border-strong); }
.rtag-current { min-width: 0; }
.rel-quiet { margin-top: 8px; font-size: var(--fs-13); color: var(--text-3); }
.rel-tz { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: var(--fs-13); color: var(--text-3); }
.rel-tz select { width: auto; min-height: 32px; font-size: var(--fs-13); padding-top: 4px; padding-bottom: 4px; }
.rel-meta { margin-top: 8px; font-size: var(--fs-13); color: var(--text-3); font-variant-numeric: tabular-nums; }
.rel-body { padding-top: 4px; }
.rel-group { margin-top: 26px; font-family: var(--font-serif); font-size: var(--fs-18); font-weight: 600; }
.rel-body > .rel-group:first-child { margin-top: 12px; }
.rel-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); }
.rel-nav-link { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: var(--fs-14); font-weight: 500; text-decoration: none; min-width: 0; }
.rel-nav-link:hover { border-color: var(--accent-border); }
.rel-nav-link small { display: block; font-size: var(--fs-12); font-weight: 500; color: var(--text-3); }
.rel-nav-link.next { grid-column: 2; justify-content: flex-end; text-align: right; }

/* ---------- ZIP chip, ZIP dialog, coverage banner ---------- */
.zip-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: var(--fs-13); font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.zip-chip:hover { border-color: var(--text-3); }
.zip-chip .ic { color: var(--accent); }
.zip-dialog { width: min(520px, calc(100vw - 32px)); }
.zip-row { display: flex; gap: 8px; margin-top: 14px; }
.zip-row input { flex: 1; font-size: var(--fs-18); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; min-height: 46px; }
.zip-row .btn-primary { min-height: 46px; }
.zip-result { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-14); line-height: 1.55; }
.zip-result strong { display: block; font-size: var(--fs-16); margin-bottom: 2px; }
.zip-result .btn { margin-top: 10px; }
.zip-browse-toggle { margin-top: 12px; min-height: 32px; }
.zip-browse { margin-top: 18px; }
.zip-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: min(50vh, 420px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.zip-area-card { display: flex; flex-direction: column; gap: 6px; }
.zip-area-zips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zip-chip-btn { min-height: 32px; padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.zip-chip-btn:hover { border-color: var(--accent); background: var(--accent-tint); }
.zip-area-note { margin: 0; font-size: var(--fs-12); color: var(--text-3); }
.zip-area { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); text-align: left; }
.zip-area:hover { border-color: var(--text-3); background: var(--surface-2); }
.zip-area strong { font-size: var(--fs-15); }
.zip-area span { font-size: var(--fs-12); color: var(--text-3); }
.coverage-wrap { margin-top: 16px; }
.coverage { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-lg); background: var(--accent-tint); border: 1px solid var(--accent-border); }
.coverage .ic { color: var(--accent); flex-shrink: 0; }
.coverage p { flex: 1; font-size: var(--fs-14); color: var(--text); }

/* ---------- "What bothers you most?" ---------- */
.issues-card { margin-top: 16px; }
.issues-card > summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--accent-border); box-shadow: var(--shadow-1); }
.issues-card > summary::-webkit-details-marker { display: none; }
.issues-card > summary:hover { background: var(--surface-2); }
.issues-card[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.issues-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent-tint); color: var(--accent); flex-shrink: 0; }
.issues-sum { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.issues-title { font-family: var(--font-serif); font-size: var(--fs-18); font-weight: 600; }
.issues-sub { font-size: var(--fs-13); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.issues-cta { font-size: var(--fs-13); font-weight: 600; color: var(--accent); white-space: nowrap; }
.issues-card .chev { color: var(--text-3); transition: transform var(--dur-fast) ease; }
.issues-card[open] .chev { transform: rotate(180deg); }
.issues-body { padding: 16px; border: 1px solid var(--accent-border); border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.issues-tray-head { display: flex; align-items: center; gap: 10px; }
.issues-tray-head .dsec-title { margin: 0; }
.issues-tray-head .btn { margin-left: auto; }
.issues-empty { font-size: var(--fs-13); }
.issues-tray { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.issues-tray li { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--on-accent); font-size: var(--fs-13); font-weight: 600; }
.issues-tray .n { font-variant-numeric: tabular-nums; margin-right: 6px; }
.tray-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: var(--on-accent); }
.tray-btn:hover { background: rgba(0, 0, 0, 0.1); }
.tray-btn .ic { width: 14px; height: 14px; }
.tray-btn .ic.up { transform: rotate(180deg); }
.tray-btn[disabled] { opacity: 0.35; cursor: default; }
.issues-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 20px; }
.issue-group h4 { font-size: var(--fs-12); font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
.issue-group div { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: var(--fs-13); font-weight: 500; text-align: left; }
.issue-chip:hover { border-color: var(--text-3); }
.issue-chip[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent-border); font-weight: 600; }
.issue-chip .rank { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--on-accent); font-size: var(--fs-11); font-weight: 700; }
.issues-foot { display: flex; justify-content: flex-end; }
.rank-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.rank-label { font-size: var(--fs-13); color: var(--text-3); font-weight: 600; }
.rank-bar { flex-wrap: wrap; }
.rank-hint { font-size: var(--fs-13); color: var(--text-2); }

/* "Why it's here" on ranked contest and measure cards */
.why-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.why-label { font-size: var(--fs-12); color: var(--text-3); }
.why-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-12); font-weight: 600; color: var(--text); cursor: help; }
.why-chip.c3 { background: var(--accent-tint); border-color: var(--accent-border); }
.why-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.why-chip.c3::before { background: var(--yes); }
.why-chip.c2::before { background: var(--accent-fill); }
.zip-note { font-size: var(--fs-12); color: var(--text-3); margin-top: 4px; }

/* ---------- responsive ---------- */
@media (min-width: 900px) {
  .measure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .contest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1179px) {
  .result-count { display: none; }
}
@media (max-width: 1023px) {
  .ex-grid { grid-template-columns: 1fr 1fr; }
  .ex-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 767px) {
  .appbar-inner { min-height: 56px; }
  .brand-sub { display: none; }
  .intro { padding-top: 22px; padding-bottom: 16px; }
  .intro-lede { font-size: var(--fs-15); }
  .stats { gap: 6px 20px; margin-top: 16px; }
  .stat dd { font-size: var(--fs-20); }
  .toolbar-inner { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .tabs { width: 100%; }
  .vt-btn { flex: 1; justify-content: center; }
  .controls { flex-basis: 100%; }
  .result-count { display: none; }
  .ex-grid, .modal .ex-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .dd-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .rel-nav { grid-template-columns: 1fr; }
  .rel-nav-link.next { grid-column: auto; }
}
@media (max-width: 479px) {
  .brand-text { display: none; } /* the ZIP chip needs the room; the logo mark stays */
  .rel-item { flex-direction: column; gap: 4px; }
  .rtag { min-width: 0; }
  .rel-date { margin-left: 0; width: 100%; }
}
@media (max-width: 639px) {
  .cand-table th.col-pick, .cand-table td:nth-child(1) { width: 44px; min-width: 44px; }
  .cand-table th.col-name, .cand-table td:nth-child(2) { left: 44px; width: 150px; min-width: 150px; }
  .cand-table .name-cell .avatar { display: none; }
  .cand-table th.col-text { min-width: 240px; }
  .countdown { display: none; }
  .zip-chip { max-width: 120px; padding: 4px 10px; }
  .issues-sub { white-space: nowrap; }
  .issues-groups { grid-template-columns: 1fr; }
  .coverage { flex-wrap: wrap; }
  .countdown-inline:not([hidden]) { display: inline; }
  .countdown-inline::before { content: ' · '; }
  .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-juris { display: none; }
  .contest-head { padding: 12px 14px 10px; }
  .contest-body { grid-template-columns: minmax(0, 1fr); }
  .cand { padding: 14px; }
  .cand + .cand { border-left: 0; border-top: 1px solid var(--border); }
  .vs { display: none; }
  .cand-facts > div { grid-template-columns: 84px minmax(0, 1fr); }
  .contest-actions .btn-label { display: none; }
  .m-yesno { grid-template-columns: 1fr; }
  .m-row { grid-template-columns: 1fr; gap: 2px; }
  .measure-card { padding: 16px; }
  .section-title { font-size: var(--fs-20); }
  .req-fields { grid-template-columns: 1fr; }
  .wall-card { padding: 26px 20px 22px; }
  .wall-title { font-size: var(--fs-24); }
  .district-filters { grid-template-columns: 1fr; }
  .modal, .modal-wide, .modal-xl { width: 100vw; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; border-width: 1px 0 0; }
  .modal[open] { animation: sheet-up var(--dur) var(--ease); }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .sheet { margin: auto 0 0; width: 100vw; height: auto; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-width: 1px 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .sheet[open] { animation: sheet-up var(--dur) var(--ease); }
  .drawer, .drawer-wide { margin: auto 0 0; width: 100vw; height: calc(100vh - 16px); height: calc(100dvh - 16px); border-width: 1px 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .drawer[open] { animation: sheet-up var(--dur) var(--ease); }
  .drawer-header { padding: 16px 12px 14px 16px; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .drawer-header::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: var(--r-pill); background: var(--border-strong); }
  .drawer-name { font-size: var(--fs-24); }
  .drawer-body { padding: 16px 16px 28px; }
  .avatar-lg { width: 52px; height: 52px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (max-width: 479px) {
  .hide-xs { display: none; }
  #picksTogLabel { display: none; }
  .countdown .ic { display: none; }
  .seg-icons .seg-btn { padding: 5px 6px; }
  .appbar-right { gap: 6px; }
}
@media (hover: none) {
  .data-table tbody tr:hover td { background-image: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ballot-paper { opacity: 1; }
  .load-quip.in, .load-face { opacity: 1; transform: none; }
}
@media (max-width: 479px) {
  .arow.arow-user { grid-template-columns: auto minmax(0, 1fr); }
  .arow-user .arow-status, .arow-user .arow-actions { grid-column: 2; }
}

/* ---------- mailbox ---------- */
.inbox-btn { position: relative; }
.inbox-btn.has-unread { color: var(--accent); background: var(--accent-tint); }
.inbox-dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--on-accent); border: 2px solid var(--bg); font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; animation: pulse 2.6s ease-in-out infinite; }
.inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inbox-msg { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface); }
.inbox-msg.unread { border-color: var(--accent-border); background: var(--accent-tint); }
.inbox-msg-head { display: flex; align-items: baseline; gap: 8px; }
.inbox-msg-title { font-weight: 600; }
.inbox-msg-date { margin-left: auto; font-size: var(--fs-12); color: var(--text-3); white-space: nowrap; }
.inbox-msg-body { margin: 4px 0 0; color: var(--text-2); }
.inbox-msg .btn { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .inbox-dot { animation: none; } }

/* ---------- admin: add an area ---------- */
.add-area { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.add-area-title { margin: 0; font-size: var(--fs-14); font-weight: 600; }
.add-area .btn { align-self: flex-start; }
.combo { position: relative; }
.combo input { width: 100%; }
.combo-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.combo-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-14); }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--hover); }
.combo-list .combo-tag { margin-left: auto; font-size: var(--fs-11); color: var(--text-3); }
.add-area-people summary { cursor: pointer; font-size: var(--fs-13); color: var(--text-2); min-height: 32px; display: flex; align-items: center; }
.add-area-people input[type="search"] { width: 100%; margin: 6px 0; }
.add-area-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.add-area-list label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: var(--fs-13); border-bottom: 1px solid var(--border); cursor: pointer; }
.add-area-list label:last-child { border-bottom: 0; }
.add-area-list .muted { margin-left: auto; overflow-wrap: anywhere; text-align: right; }
