/* 2026 results viewer: cd1gop.com tokens (V:\cd_sites\cd1\color_palatte\CD1_Theme.json) */
:root {
  --navy: #102A5C; --navy-dark: #0B1C3A; --cream: #F4EFE4; --mist: #E8E2D6; --card: #FFFFFF;
  --line: #C8C0B4; --ink: #14181F; --slate: #4A5C6A; --red: #C41E3A; --green: #1F5A3A; --wheat: #C4A35A;
  --dfl: #1E4FBF; --gop: #C41E3A; --purple: #71378A;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 Georgia, "Times New Roman", serif; color: var(--ink); background: var(--cream); }
body[data-theme="olmsted"] { --navy: #0B2A4A; }
a { color: var(--red); }
button, select, input { font: inherit; }

.wrap { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
header.top { background: var(--navy); color: var(--cream); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
header.top h1 { margin: 0; font-size: 20px; font-weight: 600; }
header.top .sub { font-size: 12px; opacity: .8; letter-spacing: .12em; text-transform: uppercase; }
header.top .status { margin-left: auto; font-size: 12px; opacity: .85; }

.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 12px; padding: 10px 16px; background: var(--mist); border-bottom: 1px solid var(--line); }
.controls label[hidden] { display: none; }
.controls label { display: grid; gap: 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); }
.controls select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); min-width: 0; }

main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 480px; }
#map { min-height: 480px; height: calc(100vh - 170px); background: #dfe7ef; }
aside.panel { background: var(--card); border-left: 1px solid var(--line); padding: 14px 16px; overflow: auto; height: calc(100vh - 170px); }
aside h2 { margin: 0 0 2px; font-size: 18px; color: var(--navy); }
aside .scope { font-size: 12px; color: var(--slate); margin-bottom: 10px; }
aside .note { font-size: 12px; color: var(--slate); margin: 6px 0; }

.cands { display: grid; gap: 6px; margin: 8px 0 12px; }
.cand { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 6px; border: 1px solid transparent; }
.cand:hover { background: var(--cream); }
.cand.sel { border-color: var(--navy); background: var(--cream); }
.cand .nm { font-weight: 600; }
.cand .pt { font-size: 11px; color: var(--slate); margin-left: 4px; font-weight: 400; }
.cand .vt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cand .bar { grid-column: 1 / -1; height: 7px; background: var(--mist); border-radius: 4px; overflow: hidden; }
.cand .bar i { display: block; height: 100%; }

.legend { margin: 10px 0 14px; font-size: 11px; color: var(--slate); }
.legend .ramp { height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.legend .ticks { display: flex; justify-content: space-between; margin-top: 2px; }

table.sub { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.sub th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); border-bottom: 1px solid var(--line); padding: 4px 4px; }
table.sub td { padding: 4px 4px; border-bottom: 1px solid var(--mist); font-variant-numeric: tabular-nums; }
table.sub td.n { text-align: right; }
table.sub tr.row { cursor: pointer; }
table.sub tr.row:hover { background: var(--cream); }
table.sub tr.cur { background: var(--mist); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }

.pct-detail { border: 2px solid var(--navy); border-radius: 8px; background: #fff; margin: 0 0 14px; padding: 10px 12px; font-size: 13px; }
.pct-detail[hidden] { display: none; }
.pct-detail .hd { display: flex; align-items: flex-start; gap: 8px; }
.pct-detail h3 { margin: 0 0 2px; font-size: 16px; color: var(--navy); flex: 1; }
.pct-detail .close { border: 1px solid var(--line); background: var(--cream); border-radius: 6px; font: inherit; font-size: 12px; padding: 2px 8px; cursor: pointer; }
.pct-detail h4 { margin: 10px 0 2px; font-size: 13px; color: var(--navy); cursor: pointer; }
.pct-detail h4:hover { text-decoration: underline; }
.pct-detail h4.cur::before { content: "\25B6  "; color: var(--red); font-size: 10px; }
.pct-detail table { width: 100%; border-collapse: collapse; }
.pct-detail td { padding: 2px 4px; border-bottom: 1px solid var(--mist); vertical-align: top; }
.pct-detail td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pct-detail tr.win td { font-weight: 600; }
.pct-detail .pt { font-size: 11px; color: var(--slate); margin-left: 4px; font-weight: 400; }

.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.links button, .links a { font-size: 12px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--navy); text-decoration: none; cursor: pointer; }

footer.foot { padding: 10px 16px; font-size: 12px; color: var(--slate); border-top: 1px solid var(--line); background: var(--mist); }
footer.foot p { margin: 2px 0; }

.leaflet-tooltip.pct-tip { font: 12px/1.35 Georgia, serif; padding: 6px 8px; min-width: 250px; max-width: 320px; white-space: normal; }
.pct-tip b { color: var(--navy); }
.pct-tip .r { display: grid; grid-template-columns: 1fr auto auto; gap: 0 8px; }
.pct-tip .r span:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.leaflet-container { font-family: Georgia, serif; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  #map { height: 62vh; min-height: 380px; }
  aside.panel { height: auto; border-left: 0; border-top: 1px solid var(--line); }
}
body.embed header.top, body.embed footer.foot { display: none; }
body.embed #map, body.embed aside.panel { height: calc(100vh - 70px); }
@media (max-width: 900px) { body.embed #map { height: 60vh; } body.embed aside.panel { height: auto; } }
