:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --panel-soft: #eef4f1;
  --ink: #172033;
  --muted: #5b667a;
  --line: #d8e0eb;
  --line-strong: #bbc7d6;
  --nav: #12203a;
  --blue: #164ea6;
  --green: #1f7a58;
  --gold: #9a5a00;
  --red: #a0392a;
  --shadow: 0 8px 18px rgba(23, 32, 51, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--blue);
}

a:hover {
  color: #0d397d;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--nav);
  color: #fff;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  gap: 0.65rem;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 148px;
  height: 38px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

.brand span {
  white-space: nowrap;
}

.site-header nav,
.site-footer nav,
.related-links,
.jump-nav,
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-header nav {
  justify-content: flex-end;
  min-width: 0;
  row-gap: 0.35rem;
}

.site-header nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.25rem;
  color: #e8eef9;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.site-header nav a[aria-current="page"] {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.related-links {
  margin: 0.5rem 0 1rem;
  font-size: 0.92rem;
}

.related-links span {
  color: var(--muted);
  font-weight: 800;
}

.related-links a,
.jump-nav a,
.hero-actions a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  background: #e8eef7;
  border: 1px solid #d3ddeb;
  border-radius: 6px;
  color: #123b74;
  font-weight: 700;
  text-decoration: none;
}

.related-links a[aria-current="page"] {
  background: #dff1ea;
  border-color: #a9d1c2;
  color: #14543d;
}

.jump-nav {
  margin: 0 0 1rem;
  padding: 0.65rem 0;
  border-block: 1px solid var(--line);
}

.hero {
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  align-items: start;
  gap: 1.5rem;
}

.hero h1 {
  max-width: 820px;
  margin: 0.25rem 0 0.75rem;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  margin-top: 1rem;
}

.freshness-line {
  margin-top: 1rem;
  color: #314157;
  font-size: 0.98rem;
}

.hero-panel,
.metric,
.event-card,
.question-card,
.rule-panel,
.state-card,
.glossary-list div,
.resource-list li,
.fact-list div,
.faq-list details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1rem;
}

.index-finder {
  display: grid;
  gap: 1rem;
}

.hero-panel dl {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.hero-panel dl div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.hero-panel dl div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-panel dt,
.metric span,
.state-card span,
.fact-list dt {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero-panel dd,
.fact-list dd {
  min-width: 0;
  margin: 0;
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-note,
.trust-note {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: var(--panel-soft);
  border: 1px solid #cddfd7;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  color: #314157;
}

.source-note a,
.trust-note a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}

.section-intro {
  max-width: 760px;
  margin: -0.4rem 0 1rem;
  color: var(--muted);
}

.state-finder {
  display: grid;
  gap: 0.55rem;
}

.state-finder label {
  color: var(--ink);
  font-weight: 800;
}

.state-finder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.state-finder select,
.state-finder button {
  min-height: 42px;
  border-radius: 6px;
  font: inherit;
}

.state-finder select {
  width: 100%;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.state-finder button {
  padding: 0 0.85rem;
  border: 1px solid #123b74;
  background: #164ea6;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.state-finder button:hover:not(:disabled) {
  background: #123b74;
}

.state-finder button:disabled {
  border-color: #aeb9c8;
  background: #c8d1dd;
  color: #5b667a;
  cursor: not-allowed;
}

.election-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.election-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.election-table th,
.election-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.election-table thead th {
  background: #e8eef7;
  color: #123b74;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.election-table tbody tr:last-child th,
.election-table tbody tr:last-child td {
  border-bottom: 0;
}

.election-table a {
  font-weight: 800;
}

.primary-comparison-table {
  min-width: 760px;
}

.electoral-comparison-table {
  min-width: 760px;
}

.type-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.type-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  background: #e8eef7;
  border: 1px solid #d3ddeb;
  border-radius: 999px;
  color: #123b74;
  font-size: 0.88rem;
  font-weight: 800;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.metric {
  min-height: 124px;
  padding: 1rem;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  line-height: 1.15;
}

.metric em,
.state-card em {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-style: normal;
}

.section-heading {
  margin: 2.25rem 0 1rem;
}

.section-heading h2 {
  margin: 0.25rem 0 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.event-list {
  display: grid;
  gap: 1rem;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.event-card {
  padding: 1rem;
}

.question-card,
.rule-panel {
  padding: 1rem;
}

.event-card-header {
  margin-bottom: 0.5rem;
}

.event-card h3,
.question-card h3,
.rule-panel h3 {
  margin: 0.2rem 0 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.question-card h3,
.rule-panel h3 {
  color: #123b74;
  font-size: 1.28rem;
}

.question-card p,
.rule-panel p {
  color: #37445a;
}

.rules-stack {
  display: grid;
  gap: 1rem;
}

.event-card details {
  margin-top: 0.75rem;
}

.event-card summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.source-link,
.content-link {
  margin: 0.75rem 0 0;
  font-weight: 800;
}

.source-link a,
.content-link a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.deadline-list {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
}

.deadline-list time {
  display: block;
  color: var(--gold);
  font-weight: 800;
}

.deadline-list p {
  margin: 0.25rem 0 0;
  color: #37445a;
}

.resource-list,
.fact-list,
.faq-list,
.glossary-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-list li,
.fact-list div,
.glossary-list div {
  padding: 0.85rem;
}

.glossary-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.glossary-list dt {
  color: #123b74;
  font-size: 1.08rem;
  font-weight: 900;
}

.glossary-list dd {
  margin: 0.4rem 0 0;
  color: #37445a;
}

.resource-list a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
}

.faq-list details {
  padding: 0.85rem 1rem;
}

.faq-list summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 800;
}

.faq-list p {
  margin: 0.75rem 0 0;
  color: #37445a;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.state-card {
  min-height: 126px;
  padding: 1rem;
  text-decoration: none;
}

.state-card strong {
  display: block;
  margin-top: 0.5rem;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.2;
}

.state-card p {
  margin: 0.35rem 0 0;
  color: #37445a;
  font-size: 0.92rem;
}

.state-card-detailed {
  min-height: 176px;
}

.state-jump {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.state-jump label {
  color: var(--muted);
  font-weight: 800;
}

.state-jump select {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.footer-copyright {
  flex-basis: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.75rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    justify-content: stretch;
    width: 100%;
  }

  .site-header nav a {
    justify-content: center;
    min-width: 0;
    min-height: 42px;
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    text-align: center;
    white-space: normal;
  }

  .site-header nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .coverage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .site-header nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    width: min(100% - 1rem, 1180px);
  }

  .brand span {
    white-space: normal;
  }

  .hero {
    padding-top: 1.25rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero-panel dl div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .election-table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .election-table {
    min-width: 0;
  }

  .election-table,
  .election-table tbody,
  .election-table tr,
  .election-table th,
  .election-table td {
    display: block;
  }

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

  .election-table tbody {
    display: grid;
    gap: 0.85rem;
  }

  .election-table tbody tr {
    padding: 0.9rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .election-table tbody th {
    padding: 0 0 0.7rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.02rem;
  }

  .election-table tbody td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 42%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
  }

  .election-table tbody td:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .election-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

  .metric-grid,
  .question-grid,
  .state-grid,
  .coverage-grid,
  .glossary-list,
  .state-finder-row {
    grid-template-columns: 1fr;
  }
}
