/* The Abshire Aggregator - shared styles */
:root {
  --navy: #0f2341;
  --navy-2: #1b3a66;
  --red: #b3202c;
  --blue: #1f5fbf;
  --rep: #c8323c;
  --rep-soft: #f6d5d7;
  --dem: #2a62c9;
  --dem-soft: #d6e2f7;
  --ind: #7a6a2f;
  --ink: #16181d;
  --ink-2: #4a505c;
  --ink-3: #7b8190;
  --line: #e2e4e9;
  --bg: #f6f5f1;
  --card: #ffffff;
  --gold: #c99a2e;
  --good: #1e7a46;
  --bad: #b3202c;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---------- masthead ---------- */
.topbar { background: var(--navy); color: #cfd8e6; font-size: 12px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 5px; padding-bottom: 5px; flex-wrap: wrap; }
.masthead { background: #fff; border-bottom: 3px solid var(--red); }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-star { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--serif); font-weight: 800; font-size: 1.75rem; letter-spacing: -.01em; line-height: 1; }
.brand-name em { font-style: normal; color: var(--red); }
.brand-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
nav.main { background: var(--navy-2); }
nav.main .wrap { display: flex; gap: 2px; overflow-x: auto; }
nav.main a { color: #e8eef7; padding: 10px 14px; font-size: 13px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
nav.main a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
nav.main a.active { background: var(--red); color: #fff; }

/* ---------- layout pieces ---------- */
main { padding: 18px 0 40px; }
.page-head { margin-bottom: 16px; }
.page-head p { color: var(--ink-2); max-width: 820px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; margin-bottom: 10px; }
.card-title h2, .card-title h3 { margin: 0; }
.card-title a { font-size: 12px; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
@media (max-width: 600px) {
  .brand-name { font-size: 1.35rem; }
  .masthead .wrap > .muted { display: none; }
  .topbar .wrap span:last-child { display: none; }
  #home-agg th:nth-child(6), #home-agg td:nth-child(6), #home-agg th:nth-child(7), #home-agg td:nth-child(7) { display: none; }
  .heat td.cell { min-width: 34px; }
}
.g-home { grid-template-columns: 300px 1fr 300px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-side { grid-template-columns: 1fr 360px; }
@media (max-width: 1100px) { .g-home { grid-template-columns: 1fr 1fr; } .g-home > .col-news { grid-column: 1 / -1; order: 3; } }
@media (max-width: 820px) { .g-home, .g-2, .g-side { grid-template-columns: 1fr; } }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #eceef2; color: var(--ink-2); white-space: nowrap; }
.pill.R { background: var(--rep-soft); color: #8d1a22; }
.pill.D { background: var(--dem-soft); color: #173f86; }
.pill.I { background: #efe7cf; color: var(--ind); }
.pill.est { background: #fff1d6; color: #7a5300; }
.pill.ok { background: #dcf1e4; color: #145a32; }
.sample-flag { background: #fff1d6; border: 1px solid #f0d08a; color: #6b4a00; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); border-bottom: 2px solid var(--line); padding: 6px 8px; white-space: nowrap; }
table.data td { border-bottom: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
table.data tr:hover td { background: #fafbfc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.net-pos { color: var(--good); font-weight: 700; }
.net-neg { color: var(--bad); font-weight: 700; }
.table-scroll { overflow-x: auto; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.controls label { font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; font-weight: 600; max-width: 100%; min-width: 0; }
.controls select { max-width: 100%; }
input[type=search], input[type=text], input[type=date], select { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid #cdd1d9; border-radius: 5px; background: #fff; min-width: 0; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid #cdd1d9; border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; padding: 7px 13px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid #cdd1d9; }
.seg button.on { background: var(--navy); color: #fff; }
.btn { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid #cdd1d9; background: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.btn:hover { border-color: var(--navy-2); }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12px; font-weight: 600; border: 1px solid #cdd1d9; background: #fff; padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }

/* ---------- news list (RCP style) ---------- */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 7px 0; border-bottom: 1px dotted #d3d6dd; }
.news-list li:last-child { border-bottom: 0; }
.news-list a { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.news-list a:hover { color: var(--red); text-decoration: none; }
.news-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.news-meta b { color: var(--red); font-weight: 700; }

/* ---------- aggregate ---------- */
.agg-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.agg-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; cursor: pointer; }
.agg-tile:hover, .agg-tile.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.agg-tile .who { font-weight: 700; font-size: 14px; }
.agg-tile .office { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.agg-tile .nums { display: flex; gap: 10px; align-items: baseline; margin-top: 6px; font-variant-numeric: tabular-nums; }
.agg-tile .ap { font-size: 1.5rem; font-weight: 800; color: var(--good); }
.agg-tile .dis { font-size: 1.1rem; font-weight: 700; color: var(--bad); }
.agg-tile .net { margin-left: auto; font-weight: 700; font-size: 13px; }
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 5px; border-radius: 2px; }
.chart-tip { position: fixed; pointer-events: none; background: var(--navy); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 5px; z-index: 50; display: none; max-width: 260px; }

/* ---------- methodology ---------- */
.formula { font-family: "Cambria Math", Georgia, serif; font-size: 1.15rem; background: #f3f5f9; border-left: 4px solid var(--navy); padding: 12px 16px; border-radius: 4px; overflow-x: auto; margin: 10px 0 14px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps > li { counter-increment: s; position: relative; padding: 4px 0 14px 46px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; display: grid; place-items: center; font-family: var(--serif); }
.factor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 10px 0; }
.factor { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; }
.factor h4 { margin: 0 0 4px; font-size: 14px; }
.factor code { background: #f0f2f6; padding: 1px 5px; border-radius: 3px; font-size: 13px; }

/* ---------- legislature map ---------- */
.map-wrap { position: relative; background: #eef1f5; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-wrap svg { width: 100%; height: 620px; display: block; cursor: grab; touch-action: none; }
.map-wrap svg:active { cursor: grabbing; }
.map-wrap path.dist { stroke: #fff; stroke-width: .6; vector-effect: non-scaling-stroke; transition: fill-opacity .15s; }
.map-wrap path.dist:hover, .map-wrap path.dist.sel { stroke: #111; stroke-width: 2; }
.map-wrap path.dist.flip { stroke: var(--gold); stroke-width: 2.4; }
.map-tools { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-tools .btn { padding: 4px 10px; font-size: 12px; background: rgba(255,255,255,.95); }
.map-metros { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.map-metros .btn { padding: 3px 9px; font-size: 12px; background: rgba(255,255,255,.95); }
.comp-bar { display: flex; height: 26px; border-radius: 4px; overflow: hidden; font-size: 12px; font-weight: 700; color: #fff; margin: 6px 0; }
.comp-bar div { display: flex; align-items: center; justify-content: center; }
.member-panel img.photo { width: 96px; height: 120px; object-fit: cover; border-radius: 4px; background: #e6e8ec; flex: none; }
.member-head { display: flex; gap: 12px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 4px 8px; font-size: 13px; margin: 10px 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.staff-list, .comm-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.staff-list li, .comm-list li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.staff-list img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #e6e8ec; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #dfe3ea; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ink-2); flex: none; }
.member-row img { width: 30px; height: 36px; object-fit: cover; border-radius: 3px; background: #e6e8ec; }

/* ---------- legislation heat map ---------- */
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 13px; }
.heat th { font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; padding: 4px; vertical-align: bottom; }
.heat th.row { text-align: left; white-space: nowrap; font-size: 13px; color: var(--ink); }
.heat td.cell { text-align: center; border-radius: 4px; padding: 7px 4px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; min-width: 46px; }
.heat td.cell:hover { outline: 2px solid var(--ink); }
.heat td.cell.on { outline: 3px solid var(--gold); }
.lean { display: flex; height: 14px; border-radius: 3px; overflow: hidden; min-width: 110px; background: #eee; }
.lean div { height: 100%; }
.bill { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bill-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.bill-num { font-weight: 800; font-family: var(--serif); font-size: 15px; }
.bill-cap { font-size: 14px; margin: 3px 0; }
.bill-meta { font-size: 12px; color: var(--ink-3); }
.stage-track { display: flex; gap: 2px; margin-top: 4px; }
.stage-track span { height: 5px; flex: 1; background: #e3e6ec; border-radius: 2px; }
.stage-track span.done { background: var(--navy-2); }

/* ---------- elections ---------- */
.elex { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.elex-date { text-align: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; align-self: start; }
.elex-date .m { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 3px 0; }
.elex-date .d { font-family: var(--serif); font-size: 1.9rem; font-weight: 800; line-height: 1.1; padding-top: 4px; }
.elex-date .y { font-size: 12px; color: var(--ink-3); padding-bottom: 5px; }
.elex h3 { margin-bottom: 4px; }
.elex .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.elex .dates { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.elex .dates b { color: var(--ink); }
.countdown { font-family: var(--serif); font-size: 2.4rem; font-weight: 800; color: var(--red); line-height: 1; }
.month-label { font-family: var(--serif); font-weight: 800; font-size: 1.1rem; color: var(--navy); margin: 18px 0 2px; padding-bottom: 4px; border-bottom: 2px solid var(--navy); }

footer.site { background: var(--navy); color: #b9c4d6; font-size: 13px; padding: 26px 0; }
footer.site a { color: #fff; }
footer.site .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { footer.site .wrap { grid-template-columns: 1fr; } .map-wrap svg { height: 440px; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat .v { font-family: var(--serif); font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.empty { color: var(--ink-3); font-style: italic; padding: 10px 0; }

/* ---------- RCP-style poll tables ---------- */
table.rcp { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
table.rcp th { background: #3a3f4a; color: #fff; font-size: 12px; font-weight: 600; padding: 8px 10px; text-align: center; white-space: nowrap; }
table.rcp td { padding: 8px 10px; border-bottom: 1px solid #e3e5ea; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rcp th:first-child, table.rcp td:first-child { text-align: left; white-space: normal; }
table.rcp tbody tr:nth-child(even):not(.avg) td { background: #f8f9fa; }
table.rcp tr.avg td { background: #e6edf7; font-weight: 800; border-bottom: 2px solid #b7c5dc; }
table.rcp tr.out td { color: #9aa0ab; }
table.rcp td a { color: var(--ink); font-weight: 600; }
.spread-a { color: var(--good); font-weight: 700; }
.spread-d { color: var(--bad); font-weight: 700; }
.calc-head { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin: 4px 0 14px; }
.calc-head .big { font-family: var(--serif); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.calc-head .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-top: 4px; }

/* labeled numbers on Aggregate tiles */
.agg-tile .nums { align-items: flex-end; gap: 14px; }
.agg-tile .nums > div { display: flex; flex-direction: column; line-height: 1.1; }
.agg-tile .nums .net-box { margin-left: auto; text-align: right; }
.agg-tile .nums .net { margin-left: 0; font-size: 1.1rem; }
.agg-tile .nl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 3px; }
.agg-big { grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); }
.agg-tile .ap { font-size: 1.4rem; }
.agg-tile .dis { font-size: 1.1rem; }

.card-title .seg { flex-wrap: nowrap; flex: none; }

/* committee chips in the member directory */
.cchips { display: flex; flex-wrap: wrap; gap: 4px; }
.cchip { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: #eef0f4; color: var(--ink-2); line-height: 1.5; }
.cchip.chair { background: #fdf0d2; color: #6b4a00; }
.cchip.vice { background: #e3ebf8; color: #1b3a66; }
.cchip.sub { background: transparent; border: 1px solid #e0e3e9; color: var(--ink-3); }

/* ---------- calendar ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h2 { margin: 0 6px; min-width: 190px; text-align: center; }
.chip .dot, .day-row .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; flex: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--ink-3); padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f8fa; }
.cal-day { min-height: 104px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.off { background: #fafafb; }
.cal-day.past { background: #fbfbfc; }
.cal-day.past .cal-ev { opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal-num { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal-day.today .cal-num { color: var(--red); }
.cal-ev { all: unset; cursor: pointer; font-size: 11.5px; line-height: 1.25; padding: 3px 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 12%, #fff); border-left: 3px solid var(--c); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev:hover { background: color-mix(in srgb, var(--c) 22%, #fff); }
.cal-more { all: unset; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--navy-2); padding: 1px 4px; }
.cal-more.local { color: var(--good); }
.modal { position: fixed; inset: 0; background: rgba(15, 35, 65, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 10px; max-width: 560px; width: 100%; max-height: 85vh; overflow: auto; padding: 22px 22px 18px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ink-3); }
.day-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: flex-start; gap: 4px; width: 100%; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.day-row .dot { margin-top: 5px; }
.day-row:hover { background: #f6f8fb; }
@media (max-width: 700px) {
  .cal-day { min-height: 64px; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left: 0; background: var(--c); }
  .cal-nav h2 { min-width: 0; font-size: 1.1rem; }
}

#cats .chip.on { background: #fff; color: var(--ink); border-color: var(--c); }
#cats .chip:not(.on) { opacity: .45; }

/* ---------- newsroom layout ---------- */
.kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.news-top { grid-template-columns: 1fr 320px; align-items: start; }
.lead > a { display: block; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lead-img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; background: #e6e8ec; }
.lead-body { padding: 16px 18px 18px; }
.lead h1 { font-size: 2rem; margin: 0 0 8px; }
.lead > a:hover h1 { color: var(--red); }
.lead p { color: var(--ink-2); font-size: 15px; margin-bottom: 8px; }
.latest .news-list a { font-size: 14px; }
.feat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding-bottom: 10px; }
.feat > a { display: block; color: inherit; text-decoration: none; }
.feat-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #e6e8ec; margin-bottom: 8px; }
.feat .kicker, .feat h3, .feat .news-meta { padding: 0 12px; }
.feat h3 { font-size: 1rem; margin: 0 0 4px; }
.feat > a:hover h3, .topic-lead a:hover h3 { color: var(--red); }
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.topic + .topic { margin-top: 0; }
.topic-lead > a { color: inherit; text-decoration: none; display: block; }
.topic-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 6px; background: #e6e8ec; }
.topic-lead h3 { font-size: 1.05rem; margin: 0 0 3px; }
.topic-lead { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
@media (max-width: 1000px) { .news-top { grid-template-columns: 1fr; } .feat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .feat-row, .topic-grid { grid-template-columns: 1fr; } .lead h1 { font-size: 1.45rem; } }

/* home: top story block */
.home-lead > a { display: block; color: inherit; text-decoration: none; }
.home-lead img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 8px; background: #e6e8ec; }
.home-lead h3 { font-size: 1.25rem; margin: 0 0 4px; }
.home-lead a:hover h3 { color: var(--red); }
.thumb-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dotted #d3d6dd; }
.thumb-row img { width: 74px; height: 56px; object-fit: cover; border-radius: 3px; flex: none; background: #e6e8ec; }
.thumb-row a { font-family: var(--serif); font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.25; }
.thumb-row a:hover { color: var(--red); text-decoration: none; }

.lead-img { max-height: 430px; }

/* home Aggregate table: one-line names, even rows */
#home-agg td { vertical-align: middle; height: 56px; }
#home-agg .agg-who b, #home-agg .agg-who small { display: block; white-space: nowrap; }
#home-agg .agg-who small { color: var(--ink-3); }

@media (max-width: 1100px) { #home-agg th:nth-child(6), #home-agg td:nth-child(6) { display: none; } }

/* ---------- early vote page ---------- */
#cmap { height: 560px; cursor: pointer; }
#cmap path.cty { stroke: #fff; stroke-width: .5; vector-effect: non-scaling-stroke; }
#cmap path.cty:hover, #cmap path.cty.sel { stroke: #111; stroke-width: 2; }
.proj { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.proj-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.proj-controls input[type=range] { width: 100%; accent-color: var(--navy); }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.proj-nums { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.proj-nums .big { font-family: var(--serif); font-size: 2.8rem; font-weight: 800; line-height: 1; }
.proj-nums .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-top: 4px; }
@media (max-width: 820px) { .proj { grid-template-columns: 1fr; } #cmap { height: 380px; } }

nav.main a { padding: 10px 12px; font-size: 12.5px; letter-spacing: .02em; }

/* news page: stories take 2/3, sidebar 1/3 */
.news-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.news-layout .feat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.news-layout .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.news-layout .lead-img { max-height: 360px; }
.news-layout aside .card + .card { margin-top: 14px; }
#side-agg td, #side-agg th { padding: 6px 8px; }
@media (max-width: 900px) { .news-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .news-layout .feat-row, .news-layout .topic-grid { grid-template-columns: 1fr; } }

/* ---------- my ballot ---------- */
.addr-form { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.addr-form input { flex: 1; font-size: 16px; padding: 12px 14px; border-radius: 8px; }
.addr-form .btn { padding: 0 22px; font-size: 15px; border-radius: 8px; }
.addr-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.addr-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.rep-group + .rep-group { margin-top: 14px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rep { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; align-items: flex-start; }
.rep-img, .rep .avatar { width: 56px; height: 68px; object-fit: cover; border-radius: 6px; flex: none; background: #e6e8ec; }
.rep .avatar { border-radius: 6px; font-size: 16px; }
.rep-office { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.rep-name { font-weight: 700; font-size: 15px; margin: 1px 0; }
.rep-sub { font-size: 13px; color: var(--ink-2); }
.rep-links { font-size: 12.5px; margin-top: 4px; }
.ballot-elex { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ballot-date { min-width: 52px; text-align: center; color: var(--red); line-height: 1.1; }
.ballot-date b { display: block; font-size: 14px; }
.ballot-date small { color: var(--ink-3); }
.race { margin-top: 8px; }
.race-office { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.cand { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.cand-img, .cand .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
@media (max-width: 600px) { .addr-form { flex-direction: column; } .addr-form .btn { padding: 10px; } }
.roster td:first-child { width: 42%; color: var(--ink-2); font-size: 13px; }
.roster td { white-space: normal !important; text-align: left !important; font-size: 13.5px; }
.school { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.map-card { margin-top: 18px; padding-bottom: 12px; }
.map-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
#dmap { width: 100%; height: auto; display: block; border-radius: 6px; }

#dmap { height: 300px; border-radius: 6px; z-index: 0; background: #eef1f5; }
@media (max-width: 600px) { #dmap { height: 240px; } }

.rep-links a, .rep-name a, .school .rep-links a { color: #1f5fbf; font-weight: 600; }
.rep-links a:hover, .rep-name a:hover { color: #0f3f8c; }
.rep-name a { color: var(--ink); }

/* ---------- legislator profile ---------- */
.prof-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.prof-photo, .prof-head .avatar { width: 120px; height: 150px; object-fit: cover; border-radius: 8px; flex: none; background: #e6e8ec; font-size: 28px; }
.prof-id { flex: 1; min-width: 240px; }
.prof-score { text-align: center; padding: 10px 18px; border-left: 1px solid var(--line); max-width: 190px; }
.prof-score .big { font-family: var(--serif); font-size: 3rem; font-weight: 800; line-height: 1; }
.prof-score .lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin: 4px 0; }
.issue-row { display: grid; grid-template-columns: 180px 1fr 60px 64px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
#pmap { height: 260px; border-radius: 6px; z-index: 0; }
@media (max-width: 640px) { .issue-row { grid-template-columns: 1fr 1fr; } .prof-score { border-left: 0; } }

/* margin bars */
.mbars { display: flex; flex-direction: column; gap: 6px; }
.mbar-row { display: grid; grid-template-columns: 130px 1fr 52px; gap: 10px; align-items: center; }
.mbar-label b { display: block; font-size: 13px; }
.mbar-label small { color: var(--ink-3); font-size: 11.5px; }
.mbar-track { position: relative; height: 18px; background: #f1f3f6; border-radius: 4px; }
.mbar-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #9aa1ad; }
.mbar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.mbar-val { font-weight: 800; font-size: 14px; text-align: right; }
.mbar-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin: 6px 52px 0 140px; }

/* ---------- election results ---------- */
.sw-race { padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.sw-race.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.sw-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.cand-bar { display: grid; grid-template-columns: 150px 1fr 54px 80px; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.cbar-track { height: 10px; background: #eef0f4; border-radius: 3px; overflow: hidden; }
.cbar-track div { height: 100%; }
.other-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }
.other-grid .sw-race { cursor: default; margin: 0; }
@media (max-width: 640px) { .cand-bar { grid-template-columns: 1fr 1fr 50px; } .cand-bar small:last-child { display: none; } }

.hist-banner { background: #fff8e6; border: 1px solid #f0d08a; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.hist-img, .hist-banner .avatar { width: 44px; height: 54px; object-fit: cover; border-radius: 4px; flex: none; }

/* voting record summary */
.vr-summary { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.vr-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.vr-big { font-family: var(--serif); font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.vr-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.vr-side { display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--line); padding-left: 16px; }
.vr-mid { font-family: var(--serif); font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.vr-mid small { font-family: var(--sans); font-size: 13px; color: var(--ink-3); font-weight: 600; }
@media (max-width: 640px) { .vr-summary { grid-template-columns: 1fr; } .vr-side { border-left: 0; padding-left: 0; } }
.hovercard { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.hc-img, .hovercard .avatar { width: 48px; height: 58px; object-fit: cover; border-radius: 4px; flex: none; }
.chart-tip { max-width: 300px; }

/* even control rows: everything bottom-aligned and the same height */
.controls { align-items: flex-end; }
.controls select, .controls input[type=search], .controls input[type=text], .controls input[type=date] { height: 38px; padding-top: 0; padding-bottom: 0; }
.controls .seg { height: 38px; }
.controls .seg button { height: 100%; display: inline-flex; align-items: center; }

/* address search + suggestions */
.addr-wrap { position: relative; flex: 1; }
.addr-wrap input { width: 100%; }
.addr-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px 0; background: #fff; border: 1px solid #cdd1d9; border-radius: 8px; box-shadow: 0 10px 28px rgba(15, 35, 65, .16); }
.addr-sugg li { padding: 9px 14px; font-size: 15px; cursor: pointer; }
.addr-sugg li:hover, .addr-sugg li.on { background: #eef3fb; }
#result { margin-top: 22px; }

/* vote-by-method stacked bars */
.method-bars { display: flex; flex-direction: column; gap: 7px; }
.mb-row { display: grid; grid-template-columns: 48px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.mb-track { display: flex; height: 24px; border-radius: 5px; overflow: hidden; background: #eef0f4; }
.mb-track span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.mb-row small { text-align: right; }

.stage-dot { display: block; width: 10px; height: 10px; border-radius: 50%; margin: 0 auto 4px; }

/* county office tiles */
.ogroup + .ogroup { margin-top: 14px; }
.ogroup h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 0 0 8px; font-family: var(--sans); }
.otile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.otile { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: #fff; }
.otile-name { font-weight: 700; font-size: 14.5px; margin: 2px 0 1px; }

/* statewide official cards */
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.sw-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-decoration: none; }
.sw-card:hover { border-color: var(--navy); text-decoration: none; }
.sw-img, .sw-card .avatar { width: 58px; height: 70px; object-fit: cover; border-radius: 6px; flex: none; }

/* Aggregate tiles: 3 per row on wide screens (two even rows of three) */
.agg-big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .agg-big { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .agg-big { grid-template-columns: 1fr; } }

/* the larger of approve/disapprove gets the big number */
.agg-tile .nums .lead { font-size: 1.4rem; font-weight: 800; }
.agg-tile .nums .trail { font-size: 1.1rem; font-weight: 700; }

footer.site .disclaimer { max-width: 860px; margin: 12px auto 0; font-size: 11.5px; line-height: 1.5; color: #8d9ab0; }

.stat-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
#summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { #summary { grid-template-columns: 1fr; } }

.power-stack { display: grid; grid-template-columns: 1fr; gap: 12px; }
.power-stack small { font-size: 12px; }
