:root {
  --ground: #f8f3e9;
  --raised: #fffcf5;
  --ink: #2f261b;
  --ink-2: #5a4d3c;
  --ink-3: #6c5e4b;
  --rule: #e4dacb;
  --contour: #9a7b56;
  --d: #2f6d9e;
  --r: #b8483e;
  --i: #6d5e8c;
  --d-soft: #8fb3cf;
  --r-soft: #dda59f;
  --d-wash: #e0e8ea;
  --r-wash: #f6e1d6;
  --toss: #dcc58e;
  --warn-bg: #f3e6c4;
  --warn-ink: #4f3f0e;
  --pencil: #a4530f;
  --num: "Archivo Narrow", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 32px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #2b2018; --raised: #37291e; --ink: #f0e5d2; --ink-2: #cdbda5; --ink-3: #b3a28b;
  --rule: #4d3d2f; --contour: #a98b62;
  --d: #5a9bd0; --r: #d9705f; --i: #ad9dcc; --d-soft: #38668a; --r-soft: #8c4d42;
  --d-wash: #223342; --r-wash: #40261f; --toss: #94803f;
  --warn-bg: #4a3a1c; --warn-ink: #f2dfb0; --pencil: #e5a35a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--text); }
::selection { background: var(--toss); color: #2f261b; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 30; background: var(--raised); padding: 8px 12px; }
h2 { font: 700 clamp(1.5rem, 4vw, 2rem)/1.15 var(--text); letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
h3 { font: 700 1.1rem/1.3 var(--text); margin: 32px 0 8px; }
section { padding-block: 40px; border-top: 1px solid var(--rule); }
section#balance { border-top: 0; padding-top: 20px; }
.lede { color: var(--ink-2); max-width: 65ch; margin: 0 0 20px; }

.mast { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--ground); border-bottom: 1px solid var(--rule); }
.mast-row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; padding-top: 10px; }
.mast h1 { font: 800 1.6rem/1.1 var(--num); letter-spacing: 0.005em; text-transform: uppercase; margin: 0; }
.mast h1 span { color: var(--ink-3); }
.updated { margin: 0 0 0 auto; font-size: .85rem; color: var(--ink-2); }
.theme { position: relative; align-self: center; flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--ink-2); background: none; border: 1px solid var(--contour); border-radius: 3px; cursor: pointer; }
.theme::after { content: ""; position: absolute; inset: -6px; }
.theme:hover { color: var(--ink); background: var(--raised); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme svg[hidden] { display: none; }
.jump { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding-block: 6px 8px; font-size: .9rem; font-weight: 500; }
.jump a { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.jump a:hover { color: var(--ink); text-decoration: underline; }

.alerts:empty { display: none; }
.alert { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 500; }
.alert a { color: inherit; }

.chamber { padding-block: 10px 22px; }
.chamber + .chamber { border-top: 1px solid var(--rule); padding-top: 22px; }
.chamber-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.tally { display: flex; align-items: baseline; gap: 8px; }
.tally.right { justify-content: flex-end; }
.tally b { font: 800 clamp(3.2rem, 11vw, 5.5rem)/.9 var(--num); letter-spacing: -0.01em; }
.tally.D b { color: var(--d); } .tally.R b { color: var(--r); }
.tally small { font-size: .9rem; color: var(--ink-2); line-height: 1.2; }
.goal { text-align: center; line-height: 1.15; padding-bottom: 4px; }
.goal strong { display: block; font-size: 1.15rem; }
.goal span { display: block; font-size: .78rem; color: var(--ink-2); max-width: 19ch; margin-inline: auto; }
.chamber-foot { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-top: 6px; font-size: .9rem; color: var(--ink-2); }
.chamber-foot strong { color: var(--ink); font-weight: 500; }
.cook-strip { display: flex; height: 10px; gap: 2px; margin-top: 12px; }
.cook-strip i { display: block; min-width: 2px; }
.cook-note { font-size: .8rem; color: var(--ink-3); margin: 4px 0 0; }
.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--ground); font-size: .82rem; padding: 4px 8px; border-radius: 6px; max-width: 240px; }

.governors { display: flex; align-items: baseline; gap: 6px 20px; flex-wrap: wrap; padding-block: 14px; border-top: 1px solid var(--rule); }
.governors h2 { font-size: 1.1rem; margin: 0; letter-spacing: 0; }
.governors b { font: 800 2rem/1 var(--num); }
.governors .D b { color: var(--d); } .governors .R b { color: var(--r); }
.governors span { color: var(--ink-2); font-size: .9rem; }

.latest { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0 28px; padding-top: 12px; border-top: 1px solid var(--rule); }
.latest h2 { grid-column: 1 / -1; font-size: 1.1rem; letter-spacing: 0; margin: 0 0 4px; }
.latest p { grid-column: 1 / -1; color: var(--ink-2); margin: 0; }
.call { display: grid; grid-template-columns: auto 1fr auto; gap: 0 8px; align-items: baseline; padding-block: 5px; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.call time, .call .by { color: var(--ink-3); font-size: .8rem; }
.pty { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 45% 55% 50% 50%; color: #fff; font-size: .78rem; font-weight: 700; flex: none; }
.pty.D { background: #2f6d9e; } .pty.R { background: #b8483e; } .pty.I { background: #6d5e8c; }


.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.filters label { display: grid; gap: 2px; font-size: .8rem; color: var(--ink-2); flex: 1 1 130px; min-width: 0; }
.filters .grow { flex: 2 1 180px; }
.filters select, .filters input { font: inherit; font-size: 1rem; width: 100%; color: var(--ink); background: var(--raised); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 8px; min-height: 40px; }
.count { color: var(--ink-2); font-size: .9rem; margin: 12px 0 4px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .78rem; font-weight: 500; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--ink-3); white-space: nowrap; }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--pencil); }
td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr.row { cursor: pointer; }
tr.row:hover td { background: var(--raised); }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.race-name { font-weight: 500; white-space: nowrap; }
.sub { display: block; color: var(--ink-3); font-size: .8rem; font-weight: 400; }
.rate { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .78rem; white-space: nowrap; background: var(--chip, var(--rule)); color: var(--chip-ink, var(--ink)); }
.rate.assumed { background: none; box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink-2); }
.cand { display: flex; gap: 6px; align-items: center; }
.state-called { font-weight: 500; }
.detail td { background: var(--raised); font-size: .88rem; }
.detail dl { display: grid; grid-template-columns: minmax(90px, max-content) 1fr; gap: 2px 14px; margin: 0; }
.detail dt { color: var(--ink-2); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.detail ul { margin: 0 0 8px; padding: 0; list-style: none; }
.more { display: block; margin: 14px auto 0; font: inherit; font-weight: 500; color: var(--ink); background: var(--raised); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 18px; cursor: pointer; }

.upset { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; padding-block: 12px; border-bottom: 1px solid var(--rule); align-items: center; }
.upset .ring { position: relative; display: inline-block; min-width: 104px; text-align: center; padding: 2px 10px; font-weight: 700; }
.upset .ring svg { position: absolute; inset: -6px -8px; width: calc(100% + 16px); height: calc(100% + 12px); overflow: visible; pointer-events: none; }
.upset .ring path { fill: none; stroke: var(--pencil); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.upset p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.empty { color: var(--ink-2); margin: 0; }
.tossups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 0 28px; }
.toss { display: flex; justify-content: space-between; gap: 10px; padding-block: 6px; border-bottom: 1px solid var(--rule); font-size: .92rem; }

.timeline { position: relative; padding-left: 26px; }
.wave { position: relative; padding-bottom: 22px; }
.wave-time { font: 800 1.5rem/1.2 var(--num); margin: 0; }
.wave-time small { font: 400 .85rem var(--text); color: var(--ink-2); margin-left: 6px; }
.states-row { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 2px 0 6px; font-size: .9rem; color: var(--ink-2); }
.split { color: var(--ink-3); font-size: .8rem; }
.watch { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.watch li { font-size: .84rem; padding: 2px 8px; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--rule); }
.watch li.bell { box-shadow: inset 0 0 0 1.5px var(--pencil); font-weight: 500; }
.watch li.plain { background: none; box-shadow: none; padding: 0; color: var(--ink-2); }
.bells { margin-bottom: 8px; }
.now-line { position: relative; margin: 2px 0 18px -26px; height: 0; border-top: 2px solid var(--pencil); }
.now-line span { position: absolute; left: 26px; top: -12px; background: var(--ground); padding-right: 8px; font-size: .8rem; font-weight: 700; color: var(--pencil); }

.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px 40px; }
.path-item h3 { margin: 0 0 6px; }
.path-line { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; padding-block: 7px; border-top: 1px solid var(--rule); }
.path-line strong { font-weight: 500; }
.path-line span.t { color: var(--ink-2); font-size: .9rem; display: block; }

.swing-avg { display: flex; flex-wrap: wrap; gap: 8px 36px; margin-bottom: 18px; }
.swing-avg div { min-width: 130px; }
.swing-avg b { display: block; font: 800 2.4rem/1 var(--num); }
.swing-avg span { font-size: .85rem; color: var(--ink-2); }
.swing-row { display: grid; grid-template-columns: minmax(84px, 130px) 1fr 74px; gap: 10px; align-items: center; padding-block: 5px; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.swing-head { border-bottom: 0; padding-bottom: 0; font-size: .78rem; color: var(--ink-2); }
.swing-axis { display: flex; justify-content: space-between; }
.swing-key { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: .8rem; color: var(--ink-2); }
.swing-key i { width: 10px; height: 10px; border-radius: 50%; }
.swing-key i.then { box-shadow: inset 0 0 0 2px var(--ink-3); }
.swing-key i.now { margin-left: 10px; background: var(--ink-2); }
.dumb { position: relative; height: 18px; }
.dumb .axis { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ink-3); }
.dumb .bar { position: absolute; top: 8px; height: 2px; background: var(--ink-3); }
.dumb .then, .dumb .now { position: absolute; top: 4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.dumb .then { background: var(--ground); box-shadow: inset 0 0 0 2px var(--ink-3); }

.markets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px 36px; }
.market { margin: 0; }
.market figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.market .read { font-size: .88rem; font-variant-numeric: tabular-nums; }
.market svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.market svg text { font: 11px var(--text); fill: var(--ink-2); }
.foot { padding-block: 32px 48px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .92rem; }
.foot h2 { font-size: 1.2rem; letter-spacing: 0; color: var(--ink); }
.source { display: flex; gap: 8px; padding-block: 3px; }
.dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--d); flex: none; }
.dot.bad { background: var(--r); }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 500; color: var(--ink); }
#closing-sources { columns: 2 260px; margin-top: 8px; font-size: .84rem; }
#closing-sources p { margin: 0 0 6px; break-inside: avoid; }
.fine { font-size: .84rem; max-width: 65ch; }

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .mast-row { align-items: center; }
  .updated { order: 1; flex-basis: 100%; margin-left: 0; }
  .goal span { font-size: .75rem; max-width: 15ch; }
  .tally small { font-size: .78rem; white-space: nowrap; }
  .fn { display: none; }
  td, th { padding-inline: 4px; }
  table { font-size: .86rem; }
  .race-name { white-space: normal; }
  .rate { padding-inline: 5px; font-size: .75rem; }
  .cand { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* On phones, the newest calls come first once there are any. */
#balance { display: flex; flex-direction: column; }
@media (max-width: 640px) {
  #latest:has(.call) { order: -1; border-top: 0; padding-top: 0; padding-bottom: 8px; }
  #latest .call:nth-of-type(n+4) { display: none; }
  .goal strong { font-size: 1rem; white-space: nowrap; }
}

/* Topo Quad: survey-sheet rules, map-legend headings, scale bars and a trail. */
.mast { border-bottom: 2px solid var(--ink); }
.mast h1 { font-weight: 700; letter-spacing: .04em; }
.jump { border-top: 1px solid var(--contour); }
h2 { font: 700 clamp(1.15rem, 3.4vw, 1.45rem)/1.2 var(--num); letter-spacing: .06em; text-transform: uppercase; }
h3 { font: 700 1rem/1.3 var(--num); letter-spacing: .05em; text-transform: uppercase; }
section { border-top: 2px solid var(--ink); }
section > h2::after { content: ""; display: block; width: 120px; height: 7px; margin-top: 6px; border-bottom: 1.5px solid var(--ink); background: repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 12px); }
.tally b { font-weight: 700; letter-spacing: 0; }
.goal h2 { font-size: 1rem; }
.goal strong { font: 700 1.05rem var(--num); }
.seatbar { display: block; width: 100%; height: 50px; margin-top: 8px; touch-action: pan-y; }
.cook-strip { height: 8px; }
.scroll { background: var(--raised); border: 1px solid var(--contour); }
th { border-bottom: 1.5px solid var(--ink); font-family: var(--num); letter-spacing: .04em; text-transform: uppercase; }
.pty { border-radius: 3px; }
.filters select, .filters input { border-radius: 3px; border-color: var(--contour); }
.more, .watch li, .alert { border-radius: 3px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; border-left: 3px dashed var(--contour); }
.wave::before { content: ""; position: absolute; left: -22px; top: 5px; width: 14px; height: 13px; background: var(--contour); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.wave.past::before { background: var(--ink); }
.wave-time { font-weight: 700; }
.dumb .then { box-shadow: inset 0 0 0 2px var(--ink-2); }
.updated.late { background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; padding: 1px 6px; border-radius: 3px; }
.bar-key { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-2); margin-top: 2px; }
.bar-key span { display: inline-flex; align-items: center; gap: 5px; }
.bar-key i { width: 18px; height: 10px; border: 1px solid var(--ink); }
.bar-key .solid { background: var(--ink-2); }
.bar-key .hatch { background: repeating-linear-gradient(135deg, var(--ink-2) 0 2px, var(--raised) 2px 4px); }
.bar-key .open { background: var(--raised); }
.cook-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.cook-note { font-size: .82rem; }
.bells { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 28px; }
.watch .bell-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 0; background: none; box-shadow: none; border-radius: 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
.bell-row strong { font-weight: 600; }
.bell-row b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pty.none { background: var(--toss); }
@media (max-width: 480px) {
  .tally { flex-direction: column; align-items: flex-start; gap: 2px; }
  .tally.right { flex-direction: column-reverse; align-items: flex-end; text-align: right; }
}
.range { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: .85rem; color: var(--ink-2); }
.range-set { display: flex; min-width: 0; }
.range button { font: inherit; font-size: .82rem; font-weight: 500; color: var(--ink-2); background: var(--raised); border: 1px solid var(--contour); margin-left: -1px; min-height: 36px; padding: 0 9px; cursor: pointer; white-space: nowrap; }
.range button:first-child { margin-left: 0; border-radius: 3px 0 0 3px; }
.range button:last-child { border-radius: 0 3px 3px 0; }
.range button:hover { color: var(--ink); }
.range button[aria-pressed="true"] { position: relative; color: var(--ground); background: var(--ink); border-color: var(--ink); font-weight: 600; }
.range button:focus-visible { position: relative; z-index: 1; }
@media (max-width: 400px) {
  .range button { padding-inline: 5px; font-size: .78rem; }
}
