/* Fonts (self-hosted, SIL Open Font License; fonts/*-LICENSE.txt). Makeover ticket 156: 3D Chicago look. */
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url("../fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url("../fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("../fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* Colours. Dark is the main look (3D Chicago); light is kept for the toggle. Chicago flag: blue #b3ddf2, star red #ef3340. */
:root {
  --font-head: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font-body: Barlow, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --bg: #0b0f16; --surface: #131a26; --glass: rgba(12, 16, 24, .72); --text: #f3efe4; --cream: #fff6e0; --muted: #a9b2c1; --line: rgba(255, 255, 255, .11);
  --accent: #b3ddf2; --accent-ink: #0b0f16; --star: #ef3340; --focus: #b3ddf2; --warn-bg: #2b2112; --warn: #f3c37a;
  --dem: #3d8bfd; --dem-bg: #17345e; --dem-ink: #d8e7ff; --rep: #f0505f; --rep-bg: #5c1820; --rep-ink: #ffdfe2;
  --map-bg: #0b0f16; --map-fill: #1b2433; --map-line: #0b0f16; --field-line: rgba(255, 255, 255, .22); --ctrl-icon-filter: invert(1);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3efe4; --surface: #ffffff; --glass: rgba(255, 252, 244, .80); --text: #0e1726; --cream: #0e1726; --muted: #4f5868; --line: rgba(14, 23, 38, .12);
  --accent: #0b5d8c; --accent-ink: #ffffff; --star: #c8102e; --focus: #0b5d8c; --warn-bg: #fff4e5; --warn: #7a4300;
  --dem: #1f6fd6; --dem-bg: #dbe8ff; --dem-ink: #123e78; --rep: #d63445; --rep-bg: #ffe0e3; --rep-ink: #7c1622;
  --map-bg: #f3efe4; --map-fill: #ffffff; --map-line: #1c2433; --field-line: rgba(14, 23, 38, .28); --ctrl-icon-filter: none;
  --shadow: 0 10px 30px -12px rgba(14, 23, 38, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font-body); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }


.brand { margin: 0; padding: 14px 0; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.star { color: var(--star); font-size: 20px; line-height: 1; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

h1 { margin: 0 0 10px; font-size: clamp(2rem, 6vw, 3.1rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; }
.lede { margin: 0 0 24px; color: var(--muted); font-size: 18px; }

input[type="text"] {
  flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--field-line); background: var(--surface); color: var(--text);
}
input[type="text"]:focus-visible { border-color: var(--focus); outline-offset: 0; }
button { font: inherit; cursor: pointer; }
.primary { padding: 12px 20px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; white-space: nowrap; }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .6; cursor: progress; }
.link-btn { margin-top: 4px; min-height: 44px; padding: 10px 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.privacy { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.status { margin: 8px 0 0; font-weight: 500; }
.status:empty { display: none; }
.status.error { color: var(--warn); background: var(--warn-bg); padding: 10px 14px; border-radius: 10px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.suggestions .secondary { box-shadow: none; text-align: left; }

.results { padding: 0 0 8px; }
.summary { padding: 8px 0 4px; }
.summary h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.matched { margin: 0 0 12px; color: var(--muted); }
.districts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.districts li { display: flex; }
.chip { font: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip::after { content: " ↗"; color: var(--muted); }

.level { margin-top: 20px; }
.level h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@container (min-width: 680px) { .cards { grid-template-columns: 1fr 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 14px; display: flex; flex-direction: column; }
.card .office { margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.card .name { margin: 2px 0 2px; font-size: 21px; letter-spacing: -.015em; line-height: 1.25; }
.card .party { margin: 0; font-size: 14px; color: var(--muted); }
.card dl { margin: 12px 0 0; display: grid; gap: 10px; }
.card dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }
.card .na { color: var(--muted); font-style: italic; }
.card .note { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
/* Town kit (ticket 142): a council or board as one compact list */
.member-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 0; }
.member-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line); }
.member-list li:first-child { border-top: 0; }
.member-name { font-weight: 600; }
.member-seat { color: var(--muted); font-size: 14px; }
.card .source { margin: auto 0 0; padding-top: 14px; font-size: 13px; color: var(--muted); }
.card .source a { color: var(--muted); }
.card .report { margin: 2px 0 0; font-size: 13px; }
.card .report a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }

/* Who takes over next (ticket 119) */
.incoming { margin-top: 12px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--accent); font-size: 14px; }
.incoming p { margin: 0 0 4px; }
.incoming-title { font-weight: 700; color: var(--accent); }

/* Voting record (phase 3) */
.record { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.record > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; min-height: 44px; display: list-item; padding-top: 10px; }
.record-title { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.record-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.record-list li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.record-list li:first-child { border-top: 0; }
@container (min-width: 560px) { .record-list li { grid-template-columns: 6.5rem 1fr auto; gap: 2px 10px; } }
.record-date { color: var(--muted); }
.record-meta { color: var(--muted); }
.record-vote { font-weight: 650; white-space: nowrap; }
.money { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 6px 0 0; font-size: 14px; }
.money dt { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 14px; }
.money dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.record + .record { margin-top: 0; }
.record-source { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.record-source a { color: var(--muted); }

/* Map-first layout (ticket 135): street map + officials panel */
body.app-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); position: relative; z-index: 3; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 16px; }
.head-row .brand { padding: 4px 0; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; }
.lookup { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; max-width: 680px; margin: 0; }
@media (max-width: 560px) {
  .lookup { flex-basis: 100%; }
  .lookup .primary { padding: 10px 14px; }
  .head-row { padding: 6px 12px 8px; }
}
.lookup input[type="text"] { padding: 10px 14px; font-size: 16px; }
.lookup .primary { padding: 10px 18px; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; border: 1.5px solid var(--field-line); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; }
.icon-btn:hover { border-color: var(--accent); }

.app { flex: 1; min-height: 0; position: relative; }
.map-pane { position: absolute; inset: 0 0 var(--peek, 42%) 0; }
.map { position: absolute; inset: 0; background: var(--map-bg); }
.map-tabs { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.map-tabs button, .secondary {
  pointer-events: auto; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; box-shadow: 0 1px 4px rgb(0 0 0 / .12);
}
.map-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (max-width: 640px) {
  .map-tabs { flex-wrap: nowrap; overflow-x: auto; pointer-events: auto; scrollbar-width: none; padding-bottom: 4px; }
  .map-tabs button { flex: 0 0 auto; padding: 8px 12px; }
  .map-zoom-out .secondary { padding: 8px 12px; }
}
.map-zoom-out { position: absolute; left: 10px; bottom: 34px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap; }
.map-status { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 2; margin: 0; max-width: 90%;
  font-size: 14px; color: var(--text); background: var(--surface); border-radius: 10px; padding: 0 10px; }
.map-status:empty { display: none; }

.panel { position: absolute; left: 0; right: 0; bottom: 0; height: var(--peek, 42%); z-index: 4; display: flex; flex-direction: column;
  background: var(--bg); border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px rgb(0 0 0 / .14); }
.panel[data-open="true"] { height: 88%; }
@media (prefers-reduced-motion: no-preference) { .panel { transition: height .25s ease-out; } }
.panel-toggle { flex: 0 0 auto; min-height: 44px; margin: 0; border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--accent); font-weight: 650; border-radius: 16px 16px 0 0; }
.panel-toggle::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 6px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; container-type: inline-size; }

@media (min-width: 1024px) {
  .map-pane { inset: 0 440px 0 0; }
  .panel { top: 0; left: auto; width: 440px; height: auto; border-radius: 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: none; }
  .panel[data-open="true"] { height: auto; }
  .panel-toggle { display: none; }
  .panel-body { padding: 8px 22px 32px; }
}

.panel-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 6px; position: sticky; top: -4px; background: var(--bg); z-index: 1; }
.panel-tabs [role="tab"] { min-height: 44px; padding: 8px 14px; border: 0; background: none; color: var(--muted); font-weight: 650; border-bottom: 3px solid transparent; }
.panel-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.intro { padding: 10px 0 4px; }
.intro h2 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -.03em; line-height: 1.1; }
.intro .lede { font-size: 16px; margin: 0 0 8px; }
.district-view h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.district-view .level { margin-top: 12px; }
.map-list { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.map-list label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.map-list select {
  width: 100%; min-height: 44px; font: inherit; font-size: 15px; padding: 8px 12px;
  border-radius: 10px; border: 1.5px solid var(--field-line); background: var(--surface); color: var(--text);
}
.map-source { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.map-source a { color: var(--muted); }
.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; }

/* Map engine controls, themed and 44px */
.maplibregl-ctrl-group { background: var(--surface) !important; box-shadow: 0 1px 4px rgb(0 0 0 / .18) !important; }
.maplibregl-ctrl-group button { width: 44px !important; height: 44px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: var(--ctrl-icon-filter, none); }
.maplibregl-ctrl-attrib { font-size: 11px; }
/* Key dates (phase 5) */
.dates { padding: 8px 0 24px; }
.dates h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.dates-lede { margin: 0 0 8px; color: var(--muted); max-width: 44rem; }
.dates-sub { margin: 28px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.muted { color: var(--muted); }
.election { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.election + .election { margin-top: 14px; }
.election-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.election-name { font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.election-day { color: var(--accent); font-weight: 600; }
.election-what { margin: 6px 0 4px; color: var(--muted); font-size: 15px; }
details.election-collapsed > summary { cursor: pointer; list-style-position: outside; margin-left: 18px; min-height: 44px; display: list-item; padding-top: 10px; }
details.election-collapsed > summary .election-name { font-size: 17px; }
details.election-collapsed > summary .election-day { margin-left: 10px; }
.date-list { list-style: none; margin: 8px 0 0; padding: 0; }
.date-row { display: grid; grid-template-columns: 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.date-row:first-child { border-top: 0; }
@container (min-width: 560px) { .date-row { grid-template-columns: 11rem 1fr auto; align-items: start; } }
.date-when { margin: 0; font-weight: 650; }
.date-name { margin: 0; font-weight: 600; }
.date-meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.date-official { margin-top: 2px; font-size: 14px; color: var(--muted); }
.date-official summary { cursor: pointer; color: var(--accent); min-height: 44px; display: list-item; padding-top: 10px; width: fit-content; }
.date-official p { margin: 6px 0 0; }
.date-official a { color: var(--text); }
.doc-links { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.doc-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; }
.doc-links a:hover { border-color: var(--accent); }
.cal-btn {
  justify-self: start; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cal-btn:hover { border-color: var(--accent); }
.dates-source, .dates-meta-line { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.dates-meta-line { font-size: 15px; }
.dates-source a { color: var(--muted); }

.site-foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 18px 0 8px; color: var(--muted); font-size: 14px; }
.site-foot h2 { font-size: 15px; color: var(--text); margin: 0 0 8px; }
.site-foot p { max-width: 48rem; margin: 0 0 10px; }
.site-foot .fine { font-size: 12.5px; }

@media (prefers-reduced-motion: no-preference) {
  .results:not([hidden]) { animation: fade .25s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Coverage page (ticket 142) */
.coverage { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.coverage h1 { font-size: 30px; letter-spacing: -.02em; margin: 8px 0 8px; }
.coverage h2 { font-size: 20px; margin: 28px 0 4px; }
.coverage .lede { color: var(--muted); }
.coverage-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0 0; }
.coverage-grid dt { font-weight: 600; }
.coverage-grid dd { margin: 0; color: var(--muted); }
.coverage-page .brand a { color: inherit; text-decoration: none; }

/* Cards with photo (tickets 153-154) */
.card-head { display: flex; gap: 14px; align-items: flex-start; }
.card-who { min-width: 0; }
.photo { flex: none; width: 64px; height: 80px; border-radius: 10px; object-fit: cover; background: var(--line); }
.photo-none { display: grid; place-items: center; font-weight: 700; font-size: 20px; color: var(--muted); border: 1px solid var(--line); background: var(--bg); }
.card .map-btn { align-self: flex-start; margin-top: 6px; padding: 10px 0; }
.card .fact { margin: 8px 0 0; font-size: 14px; }
.card .fact-label { color: var(--muted); }
.more { margin-top: 12px; border-top: 1px solid var(--line); }
.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; min-height: 44px; display: list-item; padding-top: 10px; }
.more .record { border-top: 0; }
.more .record > summary { color: var(--text); font-size: 14px; }

/* Map pop-up with the official's photo (ticket 155) */
.who-pop .maplibregl-popup-content { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.18); font: inherit; }
.who-pop.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .who-pop.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .who-pop.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.who-pop.maplibregl-popup-anchor-top .maplibregl-popup-tip, .who-pop.maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .who-pop.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.who-pop.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.who-pop.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.who-pop .maplibregl-popup-close-button { color: var(--muted); font-size: 20px; width: 32px; height: 32px; }
.pop { display: flex; gap: 10px; align-items: flex-start; padding-right: 18px; }
.pop p { margin: 0; }
.pop-photo { width: 48px; height: 60px; border-radius: 8px; object-fit: cover; flex: none; }
.pop-unit { font-size: 12px; color: var(--accent); font-weight: 600; }
.pop-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.pop-party { font-size: 13px; color: var(--muted); }
.pop-more { margin-top: 4px; min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font: inherit; font-size: 14px; cursor: pointer; }
@media (hover: hover) { .pop-more { display: none; } .pop { padding-right: 0; } }
.card .fact-source { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.card .fact-source a { color: var(--muted); }

/* =====================  Makeover (tickets 156-158): 3D Chicago look  ===================== */
h1, h2, .intro h2, .summary h2, .dates h2, .district-view h2 { font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; color: var(--cream); }
.intro h2 { font-size: 2.3rem; line-height: 1; }
.summary h2, .dates h2, .district-view h2 { font-size: 30px; line-height: 1.05; }
.level h3, .dates-sub { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.lede { color: var(--muted); }
.lede .example, .matched, .date-when, .election-day, .record-date, .money dd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Header: slim frosted bar, red Chicago star, condensed wordmark */
.site-head { background: var(--glass); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(1px)) { .site-head { backdrop-filter: blur(12px) saturate(1.2); } }
.head-row .brand { font-family: var(--font-head); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .02em; color: var(--cream); gap: 8px; }
.logo { width: 26px; height: 26px; fill: var(--star); flex: none; filter: drop-shadow(0 0 6px rgba(239, 51, 64, .35)); }
.tag { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.theme-btn { margin-left: auto; }
@media (max-width: 560px) { .theme-btn { position: absolute; top: 6px; right: 12px; } .head-row { position: relative; } }
input[type="text"] { background: color-mix(in srgb, var(--surface) 85%, transparent); border-radius: 12px; }
.primary { border-radius: 12px; font-weight: 700; letter-spacing: .02em; }
.icon-btn { border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, transparent); }

/* Map buttons: chunky game-style pills */
.map-tabs button, .secondary {
  font-family: var(--font-head); font-weight: 800; font-size: 17px; text-transform: uppercase; letter-spacing: .03em;
  border: 2px solid var(--line); background: var(--glass); color: var(--cream); box-shadow: var(--shadow);
}
@supports (backdrop-filter: blur(1px)) { .map-tabs button, .secondary { backdrop-filter: blur(8px); } }
.map-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.secondary { font-size: 15px; }

/* Panel: a frosted card floating over the full map on desktop; bottom sheet on phones */
.panel { background: var(--glass); border-top-color: var(--line); }
@supports (backdrop-filter: blur(1px)) { .panel { backdrop-filter: blur(14px) saturate(1.15); } }
.panel-tabs { background: transparent; }
.panel-tabs [role="tab"] { font-family: var(--font-head); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; }
@media (min-width: 1024px) {
  .map-pane { inset: 0; }
  .panel { top: 12px; right: 12px; bottom: 12px; width: 440px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
}
@media (prefers-reduced-transparency: reduce) { .site-head, .panel, .map-tabs button, .secondary { background: var(--bg); backdrop-filter: none; } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 12px; }
.card .office { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.card .name { font-family: var(--font-head); font-weight: 800; font-size: 27px; text-transform: uppercase; letter-spacing: .01em; line-height: 1; margin: 4px 0 6px; color: var(--cream); }
.photo { width: 72px; height: 90px; border-radius: 12px; box-shadow: 0 0 0 2px var(--line); }
.photo-none { font-family: var(--font-head); font-size: 26px; }
.party { display: inline-block; margin: 0; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); }
.party-dem { background: var(--dem-bg); color: var(--dem-ink); border-color: transparent; }
.party-rep { background: var(--rep-bg); color: var(--rep-ink); border-color: transparent; }
.chip { font-family: var(--font-mono); font-size: 13px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.chip:hover { border-color: var(--accent); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card, .chip, .map-tabs button, .secondary, .primary { transition: transform .25s var(--ease), opacity .25s var(--ease), border-color .15s, box-shadow .25s var(--ease); }
  .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .cards:has(.card:hover) .card:not(:hover) { opacity: .62; }
  .map-tabs button:hover, .secondary:hover, .primary:hover { transform: translateY(-1px); }
}
.cards:has(.card:focus-within) .card:not(:focus-within) { opacity: .75; }
.election, .incoming { border-radius: 16px; }
.election { background: var(--surface); }
.election-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .01em; }
.site-foot h2 { font-family: var(--font-head); font-size: 18px; }
/* Headings that only receive focus so screen readers announce them: no visible ring */
[tabindex="-1"]:focus { outline: none; }
.matched { font-size: 13px; letter-spacing: -.01em; }

/* =====================  Game map (tickets 157-158)  ===================== */
:root {
  --ink: rgba(255, 246, 224, .55); --edge: rgba(255, 255, 255, .28); --tile-opacity: .55;
  --tile-dem: #2f6fd1; --tile-rep: #d94455; --tile-none: #5b6577;
  --tile-ward: #3a4558;
}
:root[data-theme="light"] { --ink: rgba(28, 36, 51, .55); --edge: rgba(255, 255, 255, .7); --tile-opacity: .5; --tile-ward: #aeb6c2; --tile-dem: #2f7de1; --tile-rep: #e04a5a; --tile-none: #8b93a3; }

/* Faces on the map */
.dpin { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; pointer-events: auto; }
.dpin[data-mode="off"] { display: none; }
.dpin-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 3px solid var(--ring, var(--cream));
  background: var(--surface); box-shadow: 0 3px 0 var(--ink), 0 6px 14px rgba(0, 0, 0, .45); display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--cream); }
.dpin-tag { font-family: var(--font-head); font-weight: 800; font-size: 14px; line-height: 1; text-transform: uppercase; letter-spacing: .02em;
  color: #fff6e0; background: #05080d; border: 2px solid var(--ring, #fff6e0); border-radius: 8px; padding: 3px 7px 2px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.dpin-tag b { color: var(--ring, #b3ddf2); font-weight: 800; }
.dpin[data-mode="small"] .dpin-face, .dpin[data-mode="small"] .dpin-tag span { display: none; }
.ring-dem { --ring: #6aa8ff; } .ring-rep { --ring: #ff7b88; } .ring-none, .ring-ward { --ring: #fff6e0; }
.dpin.is-mine .dpin-face { box-shadow: 0 0 0 4px var(--accent), 0 3px 0 var(--ink), 0 0 22px var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .dpin { transition: transform .2s var(--ease); }
}
.dpin.is-hover { transform: scale(1.18) translateY(-3px); z-index: 5; }

/* "You live here" */
.you-badge { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.you-text { font-family: var(--font-head); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: #0b0f16;
  background: #b3ddf2; border: 2px solid #05080d; border-radius: 10px; padding: 3px 9px 2px; box-shadow: 0 3px 0 #05080d; white-space: nowrap; margin-bottom: 4px; }
.you-dot { width: 16px; height: 16px; border-radius: 50%; background: #ef3340; border: 3px solid #fff6e0; box-shadow: 0 0 0 3px #05080d, 0 0 16px #ef3340; }

/* Legend */
.map-legend { position: absolute; left: 10px; bottom: 92px; z-index: 2; max-width: min(360px, calc(100% - 80px)); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
  font-size: 12.5px; color: var(--text); background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; box-shadow: var(--shadow); }
.map-legend:empty { display: none; }
@supports (backdrop-filter: blur(1px)) { .map-legend { backdrop-filter: blur(8px); } }
.lg-item { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lg-swatch { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--ink); display: inline-block; }
.lg-dem { background: var(--tile-dem); } .lg-rep { background: var(--tile-rep); }

/* The big hover card (HUD) */
.hud { position: absolute; z-index: 3; left: 12px; top: 68px; width: min(340px, calc(100% - 24px)); background: var(--glass); color: var(--text);
  border: 2px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; }
@supports (backdrop-filter: blur(1px)) { .hud { backdrop-filter: blur(14px) saturate(1.15); } }
.hud.is-pinned { border-color: var(--accent); }
@media (max-width: 1023px) { .hud { top: auto; bottom: 10px; left: 10px; width: calc(100% - 20px); } }
@media (prefers-reduced-motion: no-preference) { .hud:not([hidden]) { animation: hud-in .2s var(--ease); } @keyframes hud-in { from { opacity: 0; transform: translateY(6px); } } }
.hud-head { display: flex; gap: 12px; align-items: flex-start; }
.hud-photo { width: 84px; height: 105px; border-radius: 14px; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--line); display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 30px; color: var(--muted); background: var(--surface); }
.hud-who { min-width: 0; flex: 1; }
.hud-who p { margin: 0; }
.hud-unit { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.hud-name { font-family: var(--font-head); font-weight: 800; font-size: 28px; line-height: 1; text-transform: uppercase; color: var(--cream); margin: 4px 0 4px !important; }
.hud-role { font-size: 14px; color: var(--muted); margin-bottom: 6px !important; }
.hud-role.is-mine { color: var(--accent); font-weight: 700; }
.hud-close { flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; border: 0; background: none; color: var(--muted); font-size: 18px; border-radius: 12px; }
.hud-close:hover { color: var(--text); }
@media (hover: hover) { .hud:not(.is-pinned) .hud-close { visibility: hidden; } }
.hud-fact { margin: 10px 0 0; font-size: 14px; }
.hud-fact span { color: var(--muted); }
.hud-fact + .hud-fact { margin-top: 2px; }
.hud-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hud-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer; }
.hud-btn:hover { border-color: var(--accent); }
.hud-more { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .hud:not(.is-pinned) .hud-actions::after { content: "Click to keep this card open"; flex-basis: 100%; font-size: 12px; color: var(--muted); } }
.maplibregl-marker { z-index: 1; }
@media (min-width: 1024px) { .hud.hud-right { left: auto; right: 472px; } }
.map-legend { pointer-events: none; } /* information only: taps go to the map */
@media (max-width: 640px) { .map-legend { bottom: 84px; font-size: 11px; padding: 5px 8px; gap: 2px 8px; max-width: calc(100% - 72px); } .lg-swatch { width: 11px; height: 11px; } }
/* Legend text must stay readable over any map colour (a11y audit 2026-11-18): nearly solid background */
.map-legend { background: color-mix(in srgb, var(--bg) 94%, transparent); }

/* =====================  Calling cards (ticket 160)  ===================== */
.callcard { padding: 0; overflow: hidden; }
.cc-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; padding: 10px 12px; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; border-radius: 16px; }
.cc-toggle:focus-visible { outline-offset: -3px; }
.callcard .photo { width: 56px; height: 70px; border-radius: 10px; }
.callcard .photo-none { font-size: 20px; }
.callcard .card-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.callcard .name { font-family: var(--font-head); font-weight: 800; font-size: 24px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; color: var(--cream); margin: 0; }
.callcard .office { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0; }
.cc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 2px; }
.cc-meta .party { font-size: 12px; padding: 1px 8px; }
.cc-term { font-size: 13px; color: var(--muted); }
.cc-chev { flex: none; width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); }
.cc-chev::before { content: ""; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.callcard.is-open .cc-chev::before { transform: translateY(2px) rotate(-135deg); }
.callcard.is-open { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.cc-body { padding: 0 16px 12px; border-top: 1px solid var(--line); }
.cc-body > :first-child { margin-top: 8px; }
.cc-toggle:hover .cc-chev { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .cc-chev::before { transition: transform .25s var(--ease); }
  .callcard.is-open .cc-body { animation: cc-open .28s var(--ease); }
  @keyframes cc-open { from { opacity: 0; transform: translateY(-6px); } }
}
/* closed cards no longer need the lift/dim on hover (they are short); keep it subtle */
.cards:has(.card:hover) .card:not(:hover) { opacity: 1; }
.cards { gap: 10px; }
.callcard { scroll-margin-top: 64px; scroll-margin-bottom: 12px; } /* keep an opened card's header clear of the sticky tabs */
.panel-tabs { background: color-mix(in srgb, var(--bg) 96%, transparent); } /* sticky tabs: nothing shows through */
/* District chips moved under the officials (Jairo 2026-11-18): compact, out of the way */
.districts-wrap { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.districts-wrap:has(.districts:empty) { display: none; }
.districts-title { margin: 0 0 8px; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.districts { gap: 6px; }
.chip { font-size: 12px; padding: 6px 12px; }

/* Recent votes (ticket 128): as recorded, newest first; the vote word is always written out */
.votes { margin-top: 10px; }
.votes-title { margin: 0 0 6px; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.vote-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.vote-row { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: 2px 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.vote-row:first-child { border-top: 0; }
.vote-date { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); padding-top: 2px; }
.vote-what a { color: var(--text); }
.vote-badge { font-family: var(--font-head); font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; padding: 1px 8px; border-radius: 8px; border: 2px solid var(--line); white-space: nowrap; }
.vote-yes { border-color: var(--accent); color: var(--accent); }
.vote-no { border-color: var(--text); color: var(--text); }
.cc-latest { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); letter-spacing: -.01em; }

/* =====================  Calling card + profile (ticket 161)  ===================== */
.callcard .cc-chev::before { transform: rotate(-45deg); } /* › : opens the profile */
.cc-toggle:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cc-meta { gap: 4px 6px; }
.cc-term { font-size: 13px; color: var(--muted); }

.profile-view { padding: 4px 0 12px; }
.profile-back { margin: 0 0 6px; padding: 10px 0; font-weight: 700; text-decoration: none; }
.profile-back:hover { text-decoration: underline; }
.profile { display: flex; flex-direction: column; gap: 14px; }
.profile-head { display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.profile-photo { width: 104px !important; height: 130px !important; border-radius: 14px !important; flex: none; }
.profile-photo.photo-none { font-size: 34px; }
.profile-who { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.profile-who .office { margin: 0; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.profile-name { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 34px; line-height: .95; text-transform: uppercase; color: var(--cream); }
.profile-name:focus { outline: none; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.pbtn:hover { border-color: var(--accent); }
.pbtn:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.psec { padding-top: 12px; border-top: 1px solid var(--line); }
.psec-title { margin: 0 0 8px; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.psec .votes { margin-top: 0; }
.pdl { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 0; }
.pdl dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 6px; }
.pdl dt:first-child { margin-top: 0; }
.pdl dd { margin: 0; overflow-wrap: anywhere; }
.pdl-inline { grid-template-columns: max-content 1fr; gap: 6px 14px; align-items: baseline; }
.pdl-inline dt { margin: 0; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.pchip-lead { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text); font-weight: 600; }
.pchips-more { width: 100%; }
.pchips-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; min-height: 44px; display: list-item; padding-top: 10px; }
.pchips-more .pchips { margin-top: 4px; }
.psources { border-top: 1px solid var(--line); padding-top: 8px; }
.psources .source { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.psources .source a { color: var(--muted); }
.profile .more { margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .profile-view:not([hidden]) { animation: prof-in .28s var(--ease); }
  @keyframes prof-in { from { opacity: 0; transform: translateX(14px); } }
}

/* =====================  Profile insides (ticket 169): calm, sectioned, plain words first  ===================== */
.profile { gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tile-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile-value { font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.05; text-transform: uppercase; color: var(--cream); }
.tile-sub { font-size: 12px; color: var(--muted); }
.psec { padding-top: 14px; }
.psec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.psec-title { margin: 0; }
.psec-aside { font-size: 12px; color: var(--muted); }
.psec-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
.psec-link:hover { text-decoration: underline; }
/* votes */
.vlist { list-style: none; margin: 0; padding: 0; }
.vrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.vrow:first-child { border-top: 0; padding-top: 2px; }
.vrow .vote-badge { min-width: 48px; text-align: center; margin-top: 1px; }
.vtop { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.vtitle { color: var(--text); font-weight: 600; text-decoration: none; line-height: 1.3; }
.vtitle:hover { text-decoration: underline; color: var(--accent); }
.vdate { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.vmeta { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.vbar { margin-top: 6px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 35%, transparent); overflow: hidden; max-width: 220px; }
.vbar-yes { display: block; height: 100%; background: var(--accent); }
.vofficial { margin: 5px 0 0; font-size: 11.5px; color: var(--muted); opacity: .85; font-style: italic; }
.vote-not-voting, .vote-present, .vote-absent { color: var(--muted); }
/* contact */
.contact { list-style: none; margin: 0; padding: 0; }
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.contact-row:first-child { border-top: 0; padding-top: 0; }
.contact-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.contact-label { font-weight: 700; font-size: 14px; }
.contact-addr { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.contact-phone { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); font-family: var(--font-mono); font-size: 13px; text-decoration: none; color: var(--text); white-space: nowrap; }
.contact-phone:hover { border-color: var(--accent); }
/* money */
.money-committee { margin: 0 0 8px; font-size: 14px; }
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.fig { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.fig-value { font-family: var(--font-head); font-weight: 800; font-size: 21px; color: var(--cream); font-variant-numeric: tabular-nums; }
.fig-label { font-size: 12px; color: var(--muted); }
.money-block .record-list li { grid-template-columns: 1fr auto; }
.pnote { margin: 0; font-size: 14px; color: var(--muted); }
/* footer */
.pfoot { border-top: 1px solid var(--line); padding-top: 6px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; }
.psources { flex: 1 1 auto; }
.psources > summary { cursor: pointer; min-height: 44px; display: list-item; padding-top: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.src-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; display: grid; gap: 6px; }
.src-list li { display: flex; flex-wrap: wrap; gap: 0 8px; color: var(--muted); }
.src-what { color: var(--text); font-weight: 600; min-width: 9rem; }
.src-list a { color: var(--muted); }
.pfoot .report { margin: 0; }
.money-block > .record-meta, .money-block p.record-meta { font-size: 12px; line-height: 1.45; margin-top: 8px; }
.money-block .record-title { margin-top: 4px; }

/* =====================  Key dates makeover (ticket 170)  ===================== */
.dates-lede { margin: 0 0 12px; }
#kd-tiles { margin-bottom: 4px; }
.tile-strong { color: var(--text); font-weight: 600; font-size: 13px; }
#kd-elections { display: grid; gap: 10px; }
.edate { flex: none; width: 58px; height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); line-height: 1; }
.edate-m { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.edate-d { font-family: var(--font-head); font-weight: 800; font-size: 28px; }
.edate-y { font-family: var(--font-mono); font-size: 10px; opacity: .8; }
.edate-big { width: 92px; height: 104px; border-radius: 16px; }
.edate-big .edate-d { font-size: 46px; }
.edate-big .edate-m { font-size: 13px; }
.ecount { font-weight: 700; font-size: 13px; color: var(--accent); }
.ehead-sub { margin: 0; font-size: 14px; color: var(--text); font-weight: 600; }
.ehead-what { margin: 0; font-size: 13.5px; color: var(--muted); }
/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-month { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 0 6px 64px; }
.tl-month:first-child { padding-top: 0; }
.tl-item { position: relative; }
.tl-item::before { content: ""; position: absolute; left: 25px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl-det > summary { list-style: none; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 0; cursor: pointer; }
.tl-det > summary::-webkit-details-marker { display: none; }
.tl-date { position: relative; z-index: 1; flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.tl-dnum { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--cream); }
.tl-dwk { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; color: var(--muted); }
.tl-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tl-name { font-weight: 600; line-height: 1.3; }
.tl-when { font-size: 12.5px; color: var(--muted); }
.tl-det > summary:hover .tl-name { color: var(--accent); }
.tl-det[open] > summary .tl-date { border-color: var(--accent); }
.tl-official { margin: 0 0 10px 66px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tl-day .tl-date { background: var(--star); border-color: var(--star); }
.tl-day .tl-dnum, .tl-day .tl-dwk { color: #fff; }
.tl-day .tl-name { font-family: var(--font-head); font-weight: 800; font-size: 20px; text-transform: uppercase; color: var(--cream); letter-spacing: .01em; }
/* meetings */
.meet-list { list-style: none; margin: 0; padding: 0; }
.meet-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.meet-row:first-child { border-top: 0; padding-top: 0; }
.meet-text { display: flex; flex-direction: column; gap: 1px; }
.meet-when { font-weight: 700; }
.meet-next .meet-when { color: var(--accent); }
.meet-what { font-size: 13px; color: var(--muted); }
.meet-docs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#dates-authority .psec { margin-top: 18px; }
#kd-sources { margin-top: 14px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) { #kd-detail:not([hidden]) { animation: prof-in .28s var(--ease); } }

/* Key dates tidy-up (ticket 171): one line per meeting, documents inside; "Good to know" box */
.meet-row { display: block; padding: 0; }
.meet-det > summary, .info-det > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 0; cursor: pointer; }
.meet-det > summary::-webkit-details-marker, .info-det > summary::-webkit-details-marker { display: none; }
.meet-det .cc-chev::before, .info-det .cc-chev::before { transform: translateY(-2px) rotate(45deg); }
.meet-det[open] .cc-chev::before, .info-det[open] .cc-chev::before { transform: translateY(2px) rotate(-135deg); }
.meet-body, .info-body { padding: 0 0 10px; font-size: 14px; color: var(--muted); }
.meet-body p, .info-body p { margin: 0 0 6px; }
.meet-docs { display: block; justify-content: initial; }
.meet-docs a, .info-body a { color: var(--accent); }
.kd-good { margin-top: 22px; }
.info-list { list-style: none; margin: 0; padding: 4px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-det > summary .contact-text { flex: 1; }
.info-det > summary .contact-phone { margin-left: auto; }
#kd-meetings > .record-meta { font-size: 12.5px; margin: 6px 0 0; }

/* Who takes over next (ticket 172) */
.cc-next { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); max-width: 100%; }
.cc-next.is-same { padding-left: 10px; }
.cc-next-text { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-next-text b { color: var(--accent); font-weight: 700; }
.callcard .cc-next-photo { width: 26px !important; height: 26px !important; border-radius: 50% !important; font-size: 10px !important; object-position: 50% 20%; box-shadow: 0 0 0 2px var(--accent); }
.next-sec { padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.next-row { display: flex; gap: 14px; align-items: center; }
.next-photo { width: 64px !important; height: 80px !important; border-radius: 12px !important; flex: none; font-size: 22px !important; }
.next-text { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.next-name { font-family: var(--font-head); font-weight: 800; font-size: 24px; line-height: 1; text-transform: uppercase; color: var(--cream); }
.next-when { font-size: 14px; font-weight: 600; }
.next-votes { font-size: 12.5px; color: var(--muted); }
.next-sec .record-source { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.sample-bar { position: sticky; top: 0; z-index: 9999; padding: 8px 16px; background: var(--star); color: #fff; font-weight: 700; font-size: 13px; text-align: center; }
.cc-next.is-unofficial { border-style: dashed; }
.next-sec.is-unofficial { border-style: dashed; }
.next-final { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--text); }
.cc-next-text { white-space: normal; }
.cc-next { border-radius: 14px; }

/* Logo goes home (ticket 174): star, name, tag and the space around them are one link to the start */
.brand-link { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; margin: -8px -12px; padding: 8px 12px; border-radius: 12px; }
.brand-link:hover .wordmark { color: var(--accent); }
.brand-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .brand-link .logo { transition: transform .25s var(--ease); } .brand-link:hover .logo { transform: rotate(30deg); } }

/* =====================  Search bar makeover (ticket 176)  ===================== */
.lookup { display: block; position: relative; }
.search-field { position: relative; display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 16px;
  border: 1.5px solid var(--field-line); background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-ico { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.search-field:focus-within .search-ico { stroke: var(--accent); }
.lookup .search-field input[type="text"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 6px; font-size: 16px; box-shadow: none; outline: none; }
.lookup .search-field input[type="text"]::placeholder { color: var(--muted); }
.field-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.field-btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.field-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
#addr-clear { font-size: 15px; }
.lookup .find-btn { position: relative; flex: none; min-height: 44px; padding: 0 20px; border-radius: 12px; font-family: var(--font-head); font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.lookup.is-busy .find-label { visibility: hidden; }
.lookup.is-busy .find-btn::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: find-spin .7s linear infinite; }
@keyframes find-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lookup.is-busy .find-btn::after { animation: none; border-right-color: currentColor; opacity: .6; } }
/* suggestions */
.addr-list { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; margin: 0; padding: 6px; list-style: none; max-height: min(60vh, 380px); overflow-y: auto;
  border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.addr-opt { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main note" "sub note"; align-items: center; column-gap: 12px;
  min-height: 48px; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.addr-opt[aria-selected="true"], .addr-opt:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.addr-main { grid-area: main; font-weight: 600; color: var(--text); }
.addr-main b { color: var(--accent); font-weight: 800; }
.addr-sub { grid-area: sub; font-size: 12.5px; color: var(--muted); }
.addr-note { grid-area: note; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.addr-note.is-ok { color: var(--accent); }
@media (max-width: 640px) {
  .search-field { padding-left: 12px; }
  .lookup .find-btn { padding: 0 14px; }
  .addr-note { display: none; }
  .addr-opt.is-address .addr-main::after { content: " ✓"; color: var(--accent); }
}
