:root {
  color-scheme: light;
  --ink: #111214;
  --muted: #666a6f;
  --line: #d6d8da;
  --soft: #f1f1f1;
  --republican: #ed1745;
  --democratic: #273fbd;
  --neutral: #777b80;
  --brand: #b20c25;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  line-height: 1.35;
}

.page-shell {
  width: min(1180px, calc(100% - 16px));
  margin-inline: auto;
}

h3, p { margin-top: 0; }

main { min-height: 55vh; padding-block: 12px 52px; }

.initial-state, .update-notice {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 12px 14px;
  font-size: .88rem;
}

.update-notice { margin-bottom: 18px; }
.update-notice.is-warning { border-left: 4px solid #8a5200; }

.contest-grid { display: grid; gap: 46px 28px; }

.area-section { min-width: 0; }

.area-heading {
  margin: 0 0 16px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 7px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.area-contest-grid { display: grid; gap: 46px 28px; }

.contest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.contest-placeholder { min-width: 0; }
.contest { min-width: 0; }
.contest-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.contest-kicker-row { display: contents; }

.contest-kicker {
  grid-column: 1 / -1;
  grid-row: 1;
  margin: 0;
  font-size: .8125rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.reporting {
  grid-column: 2;
  grid-row: 3;
  align-self: end;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.2;
  text-align: right;
}

.contest h3 {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 2px 0 0;
  font-size: .9375rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.contest-area { grid-column: 1; grid-row: 3; margin: 4px 0 0; color: #4f5357; font-size: .8125rem; }

.status-banner {
  margin: 10px 0 0;
  border-radius: 2px;
  background: var(--soft);
  padding: 8px 9px;
  color: #42464a;
  font-size: .7rem;
  font-style: italic;
}

.candidate-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.candidate-table col:nth-child(1) { width: auto; }
.candidate-table col:nth-child(2) { width: 72px; }
.candidate-table col:nth-child(3) { width: 44px; }

.candidate-table th {
  padding: 3px 7px 2px;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.15;
  text-align: left;
  text-transform: uppercase;
}

.candidate-table th:not(:first-child), .candidate-table td:not(:first-child) { text-align: right; }

.candidate-table td {
  border-top: 1px solid var(--line);
  padding: 6px 7px;
  font-size: .9375rem;
  line-height: 1.25;
  vertical-align: top;
}

.candidate-table td:first-child { border-left: 6px solid var(--neutral); overflow-wrap: anywhere; }
.candidate-table tr.party-republican td:first-child { border-left-color: var(--republican); }
.candidate-table tr.party-democratic td:first-child { border-left-color: var(--democratic); }
.candidate-table tr.is-winner .candidate-name { font-weight: 700; }
.candidate-name { font-weight: 400; }
.winner-label { margin-left: 5px; font-size: .6875rem; font-weight: 800; text-transform: uppercase; }
.party-label { margin-left: 7px; color: var(--muted); font-size: .6875rem; white-space: nowrap; }
.numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.contest-description {
  margin: 10px 0 0;
  border-radius: 2px;
  background: var(--soft);
  padding: 8px 9px;
  color: #42464a;
  font-size: .7rem;
  font-style: italic;
}

.contest-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.25;
}

.contest-footer p { margin: 0; }
.updated { margin-left: auto !important; text-align: right; }
:focus-visible { outline: 3px solid #111; outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 899px) {
  .page-shell { width: min(100% - 28px, 720px); }
  .contest-row { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .contest-placeholder { display: none; }
}

@media (max-width: 420px) {
  .page-shell { width: min(100% - 20px, 400px); }
  main { padding-top: 18px; }
  .candidate-table col:nth-child(2) { width: 66px; }
  .candidate-table col:nth-child(3) { width: 44px; }
  .candidate-table td { padding-inline: 5px; font-size: .8rem; }
  .contest-footer { display: block; }
  .updated { margin-top: 4px !important; text-align: left; }
}
