:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #1c2430; --muted: #556070; --line: #dcd8cf;
  --brand: #1f3a5f; --brand-ink: #ffffff; --accent: #8a5a00; --link: #1d4f91; --focus: #c77d00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --card: #1a2029; --ink: #e8ebef; --muted: #a3adba; --line: #2c3440;
          --brand: #16263b; --brand-ink: #f2f4f7; --accent: #e0b25c; --link: #8fb8ee; --focus: #f0a830; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 9; }

.masthead { background: var(--brand); color: var(--brand-ink); padding: 40px 0 32px; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .12em; font-size: 13px; opacity: .85; }
h1 { margin: 0 0 10px; font: 700 clamp(28px, 5vw, 44px)/1.1 Georgia, "Times New Roman", serif; }
.lede { margin: 0; max-width: 62ch; font-size: 17px; }

.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px;
  margin: 20px 0 12px; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 5;
  border-bottom: 1px solid var(--line); }
.controls label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--muted); gap: 4px; }
select, input { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%; }

.jump { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin: 4px 0 8px; }
.status { color: var(--muted); font-size: 14px; margin: 0 0 8px; }

section.tier { margin: 28px 0; }
section.tier > h2 { font: 700 22px/1.2 Georgia, serif; margin: 0 0 12px; padding-bottom: 6px;
  border-bottom: 2px solid var(--ink); scroll-margin-top: 90px; }
h3.county { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 22px 0 8px; }

.races { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.race { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.race h4 { margin: 0 0 2px; font-size: 15px; line-height: 1.3; }
.race .where { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.race ul { list-style: none; margin: 0; padding: 0; }
.race li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.race li:first-child { border-top: 0; }
.race li a { font-weight: 600; text-decoration: none; }
.race li a:hover { text-decoration: underline; }
.mate { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.party { font-size: 13px; color: var(--muted); white-space: nowrap; text-align: right; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 16px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.fine { font-size: 13px; }

@media (max-width: 600px) {
  .controls { grid-template-columns: 1fr; position: static; }
  .masthead { padding: 28px 0 24px; }
}
