:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #16202a;
  --ink-soft: #5b6875;
  --line: #e5e8ec;
  --brand: #14563d;         /* deep evergreen */
  --brand-ink: #0d3a29;
  --agree-bg: #d7f0dc;
  --agree-ink: #14663a;
  --dissent-bg: #fbdcdc;
  --dissent-ink: #9e2a2a;
  --neutral-bg: #fef3d3;
  --neutral-ink: #8a6a1a;
  --na-bg: #f0f1f3;
  --shadow: 0 1px 2px rgba(16,32,42,.06), 0 8px 24px rgba(16,32,42,.05);
  --radius: 14px;
  --group-h: 30px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.masthead {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  color: #fff;
  padding: 34px 0 30px;
}
.masthead h1 { margin: 0; font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; }
.tagline { margin: 6px 0 0; color: #cfe6da; font-weight: 500; }

main.wrap { padding-top: 22px; padding-bottom: 60px; }

.notice { padding: 40px; text-align: center; color: var(--ink-soft); }
.notice.error { color: var(--dissent-ink); }

.banner {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
  border: 1px solid #f0dfa8;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .92rem;
}
.banner code, .notice code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

.legend {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-left: 6px; vertical-align: -2px; }
.legend .swatch:first-child { margin-left: 0; }
.swatch.agree { background: var(--agree-bg); }
.swatch.dissent { background: var(--dissent-bg); }
.swatch.neutral { background: var(--neutral-bg); }
.swatch.blank { background: var(--surface); border: 1px solid var(--line); }
.legend .meta { margin-left: auto; font-variant-numeric: tabular-nums; }

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table.grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 900px;
  font-size: .875rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fbfcfd;
  color: var(--ink-soft);
  font-weight: 650;
  text-align: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.2;
}
thead th:not(.race-col) {
  min-width: 82px;
  max-width: 100px;
}

/* Grouping band above the outlet names */
.group-head {
  top: 0;
  height: var(--group-h);
  box-sizing: border-box;
  padding: 0 8px;
  background: #edf1f3;
  color: var(--brand-ink);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  vertical-align: middle;
  border-left: 2px solid #fff;
  border-bottom: 1px solid var(--line);
  z-index: 3;
}
.group-head:first-of-type { border-left: none; }
.outlet-row th { top: var(--group-h); z-index: 3; }
.outlet-row th:not(:first-child) { border-left: 1px solid var(--line); }
thead th.race-col { z-index: 4; top: 0; }

/* Merged "To be released" column for outlets whose endorsements aren't out yet */
thead th.pending-head {
  top: 0;
  min-width: 132px;
  max-width: 150px;
  background: #e7eaed;
  border-left: 2px solid #fff;
  vertical-align: middle;
  padding: 8px 10px;
}
.pending-title {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}
.pending-names {
  display: block;
  margin-top: 4px;
  font-size: .64rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
}
td.pending-cell {
  background: #eef1f3;
  border-left: 1px solid var(--line);
  /* no inner row borders so the column reads as one continuous block */
}
thead th a { color: var(--brand); text-decoration: none; }
thead th a:hover { text-decoration: underline; }

th.race-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fbfcfd;
  text-align: left;
  min-width: 100px;
  max-width: 260px;
}
thead th.race-col { z-index: 4; }

tbody th.race-col { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.office { display: block; font-weight: 650; color: var(--ink); }
.district { display: block; font-size: .76rem; color: var(--ink-soft); font-weight: 500; margin-top: 1px; }

.section-row td {
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 14px;
  position: sticky;
  left: 0;
}

td.cell {
  text-align: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  vertical-align: middle;
}
td.cell .cand { font-weight: 600; }
.cand-name { display: block; }
/* In a dual endorsement that meets consensus, the pick that is NOT part of the
   consensus is reddened and faded so it isn't read as agreement. */
.cand-name.against { color: var(--dissent-ink); opacity: .48; }

/* Dual endorsements: stacked names (no "/" separator) plus a badge, so they
   don't get confused with slash-containing names like "Yes / Approve". */
.cand.is-dual .cand-name + .cand-name { margin-top: 2px; }
.dual-badge {
  display: inline-block;
  margin-bottom: 3px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(16, 32, 42, .10);
  color: #455360;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.55;
}

td.agree   { background: var(--agree-bg); color: var(--agree-ink); }
td.dissent { background: var(--dissent-bg); color: var(--dissent-ink); }
td.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
td.blank   { background: var(--surface); }
td.na      { background: var(--na-bg); color: #b3bac2; }

tbody tr:hover td.cell:not(.na) { filter: brightness(0.975); }

.foot { margin-top: 16px; color: var(--ink-soft); font-size: .8rem; }
.foot p { margin: 0; }

@media (max-width: 640px) {
  .masthead h1 { font-size: 1.55rem; }
  .legend .meta { margin-left: 0; width: 100%; }
}
