:root {
  --paper: #f3f2ef;
  --white: #fbfaf8;
  --ink: #1e2021;
  --muted: #777875;
  --line: #deddd9;
  --red: #e53430;
  --dark: #202223;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "DM Sans", Arial, sans-serif;
  --max: 1040px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.tracker { max-width: var(--max); margin: 0 auto; padding: 51px 30px 65px; }
.tracker-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.section-kicker { margin: 0 0 8px; color: #888984; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.tracker-heading h1 { margin: 0; font-family: var(--display); font-size: clamp(42px, 6vw, 62px); font-weight: 700; letter-spacing: -.025em; line-height: .91; }
.tracker-heading h1 span { color: var(--red); }
.qualification-copy { margin: 13px 0 0; color: #666762; font-size: 12px; }
.refresh-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 3px; color: #858681; font-size: 9px; white-space: nowrap; }
.refresh-indicator { color: var(--ink); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.refresh-indicator.is-stale .live-dot { background: #a6a69f; box-shadow: none; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #6ac58a; box-shadow: 0 0 0 3px rgba(106,197,138,.12); vertical-align: middle; }

.spotlight-grid { display: grid; grid-template-columns: 1.15fr 1fr .92fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.vote-panel, .rank-panel, .qualification-panel { min-height: 137px; padding: 20px 22px; background: white; }
.vote-panel { position: relative; overflow: hidden; background: var(--red); color: white; }
.vote-panel:after { position: absolute; top: -78px; right: -51px; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; content: ""; }
.panel-top, .rank-panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-top { font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.panel-overline { color: rgba(255,255,255,.68); font-size: 8px; }
.vote-total { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 8px; }
.vote-total > span:first-child { font-family: var(--display); font-size: 62px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.025em; line-height: .95; }
.vote-unit { font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.vote-panel-bottom { position: relative; display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.72); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.delta-chip { padding: 4px 6px; border: 1px solid rgba(255,255,255,.35); color: white; font-size: 9px; letter-spacing: 0; }
.rank-panel { background: #292b2c; color: white; }
.rank-label { color: #c3c3bd; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.rank-current { color: var(--red); font-family: var(--display); font-size: 31px; font-weight: 700; }
.rank-position { margin-top: 3px; font-family: var(--display); font-size: 24px; font-weight: 700; }
.rank-panel-rule { height: 1px; margin: 10px 0 9px; background: #48494a; }
.rank-gap-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aaa9a2; font-size: 8px; font-weight: 600; letter-spacing: .06em; }
.rank-gap-row strong { color: white; font-size: 9px; white-space: nowrap; }
.qualification-panel { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-top: 3px solid #b6b7b1; transition: background .2s; }
.qualification-panel.is-qualified { border-top-color: #4a9c64; background: #f4faf4; }
.qualification-panel.is-outside { border-top-color: var(--red); background: #fff4f2; }
.qualification-label { color: #858681; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.qualification-panel strong { margin-top: 7px; font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1; }
.qualification-panel.is-qualified strong { color: #327749; }
.qualification-panel.is-outside strong { color: #a52d29; }
.qualification-panel small { margin-top: 6px; color: #777875; font-size: 9px; }
.error-banner { margin-top: 10px; padding: 9px 12px; border-left: 2px solid #aaa9a2; background: #ebeae6; color: #696a65; font-size: 10px; }

.ranking-layout { margin-top: 25px; }
.ranking-card { border: 1px solid #e1e0dc; background: var(--white); }
.ranking-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 23px 17px; }
.ranking-header h2 { margin: 0; font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: -.025em; line-height: .95; }
.ranking-header h2 span { color: #8e8f89; }
.scope-switch { display: flex; gap: 3px; padding: 3px; background: #eae9e5; }
.scope-button { padding: 10px 13px; border: 0; background: transparent; color: #777873; font: 700 9px var(--body); letter-spacing: .06em; cursor: pointer; transition: background .18s, color .18s; }
.scope-button:hover { color: var(--ink); }
.scope-button.is-active { background: var(--dark); color: white; }
.ranking-meta { display: flex; height: 35px; align-items: center; justify-content: space-between; padding: 0 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #8a8b85; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.ranking-list { margin: 0; padding: 0; list-style: none; }
.ranking-item { display: grid; min-height: 67px; grid-template-columns: 56px minmax(0, 1fr) 112px; align-items: center; padding: 10px 23px; border-bottom: 1px solid #eeede9; animation: rise .34s both; animation-delay: calc(var(--row-index, 0) * 22ms); transition: background .2s; }
.ranking-item:hover { background: #f4f3ef; }
.ranking-item.is-top-three .rank-number { font-size: 29px; }
.ranking-item.is-ronald { position: relative; background: #fff1ef; }
.ranking-item.is-ronald:before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--red); content: ""; }
.ranking-item.is-ronald:hover { background: #ffe8e5; }
.rank-number { color: #9b9c97; font-family: var(--display); font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-main { min-width: 0; }
.candidate-name { display: flex; align-items: center; gap: 8px; overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.candidate-club { display: block; overflow: hidden; margin-top: 4px; color: #8b8c86; font-size: 10px; text-overflow: ellipsis; text-transform: capitalize; white-space: nowrap; }
.candidate-badge { flex: none; padding: 4px 6px; background: var(--red); color: white; font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.candidate-votes { text-align: right; font-family: var(--display); font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.candidate-votes small { display: block; margin-top: 1px; color: #999a94; font: 700 8px var(--body); letter-spacing: .11em; }
.ranking-loading { padding: 30px; color: #858681; font-size: 12px; text-align: center; }
.ron-outside { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 23px; border-top: 1px solid #f2d6d3; background: #fff1ef; }
.ron-outside-label { color: #a0524d; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.ron-outside-name { margin-top: 4px; font-size: 12px; font-weight: 700; }
.ron-outside-stats { text-align: right; font-family: var(--display); font-size: 22px; font-weight: 700; }
.ron-outside-stats small { display: block; color: #9b9c97; font: 700 8px var(--body); letter-spacing: .1em; }
.data-note { padding: 12px 23px; color: #8d8175; font-size: 10px; }
.site-footer { display: flex; max-width: var(--max); align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 19px 30px 28px; border-top: 1px solid #deddd9; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-decoration: none; }
.wordmark-mark { display: grid; width: 23px; height: 23px; place-items: center; transform: skew(-7deg); background: var(--red); color: white; font-family: var(--display); font-size: 17px; font-weight: 800; }
.wordmark-light { color: #8a8a85; font-weight: 400; }
.site-footer p { margin: 0; color: #62635f; font-size: 10px; line-height: 1.8; text-align: center; }
.site-footer p span { color: #92938d; font-size: 9px; }
.site-footer p a { border-bottom: 1px solid #b4b4ae; text-decoration: none; }
.back-top { color: #777873; font-size: 8px; font-weight: 700; letter-spacing: .11em; text-decoration: none; }
.number-update { animation: count-pop .4s ease; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes count-pop { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 680px) {
  .tracker { padding: 32px 16px 44px; }
  .tracker-heading { align-items: flex-start; gap: 12px; }
  .tracker-heading h1 { font-size: clamp(37px, 9.7vw, 52px); }
  .qualification-copy { max-width: 260px; font-size: 11px; line-height: 1.5; }
  .refresh-meta { gap: 5px; padding-top: 3px; font-size: 7px; }
  .refresh-indicator { font-size: 8px; }
  .spotlight-grid { grid-template-columns: 1fr 1fr; }
  .vote-panel, .rank-panel, .qualification-panel { min-height: 119px; padding: 15px; }
  .vote-total > span:first-child { font-size: 54px; }
  .panel-top { font-size: 8px; }
  .panel-overline { font-size: 7px; }
  .rank-position { font-size: 21px; }
  .rank-gap-row { font-size: 7px; }
  .qualification-panel strong { font-size: 23px; }
  .qualification-panel small { font-size: 8px; }
  .qualification-panel { display: grid; min-height: 84px; grid-column: 1 / -1; grid-template-columns: 1fr auto; align-content: center; gap: 5px 12px; }
  .qualification-panel strong { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
  .qualification-panel small { grid-column: 1; }
  .ranking-header { display: block; padding: 19px 15px 15px; }
  .ranking-header h2 { font-size: 33px; }
  .scope-switch { width: max-content; max-width: 100%; margin-top: 15px; }
  .scope-button { padding: 10px 11px; font-size: 8px; }
  .ranking-meta { height: 34px; padding: 0 15px; font-size: 7px; }
  .ranking-item { min-height: 63px; grid-template-columns: 41px minmax(0, 1fr) 72px; padding: 9px 14px; }
  .rank-number { font-size: 21px; }
  .ranking-item.is-top-three .rank-number { font-size: 26px; }
  .candidate-name { gap: 6px; font-size: 12px; }
  .candidate-club { font-size: 9px; }
  .candidate-votes { font-size: 21px; }
  .candidate-votes small, .candidate-badge { font-size: 7px; }
  .site-footer { flex-wrap: wrap; gap: 12px; padding: 18px 16px 23px; }
  .site-footer p { order: 3; width: 100%; font-size: 9px; text-align: left; }
  .back-top { margin-left: auto; font-size: 7px; }
}

@media (max-width: 390px) {
  .tracker-heading { flex-direction: column; }
  .tracker-heading h1 { font-size: 40px; }
  .refresh-meta { flex-direction: row; align-items: center; }
  .ranking-header h2 { font-size: 31px; }
  .scope-button { padding: 9px 8px; }
  .ranking-item { grid-template-columns: 35px minmax(0, 1fr) 67px; padding-right: 11px; padding-left: 11px; }
  .candidate-name { font-size: 11px; }
  .candidate-badge { padding: 3px 4px; font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
