/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg: #0c0c0e;
  --bg-elevated: #141418;
  --card: #18181e;
  --card-hover: #22222c;
  --text: #f0f0f0;
  --text-dim: #8888a0;
  --border: #26263a;
  --border-soft: #1e1e2c;
  --accent: #7da0ff;
  --accent-dim: rgba(125, 160, 255, 0.1);

  /* Stance colors — dark-theme tuned */
  --c-red-bg:      rgba(220, 38, 38, 0.14);
  --c-red-text:    #ff9090;
  --c-red-border:  rgba(220, 38, 38, 0.35);

  --c-green-bg:    rgba(22, 163, 74, 0.13);
  --c-green-text:  #6de098;
  --c-green-border:rgba(22, 163, 74, 0.32);

  --c-gray-bg:     rgba(110, 110, 140, 0.12);
  --c-gray-text:   #c0c0d8;
  --c-gray-border: rgba(110, 110, 140, 0.3);

  --c-neutral-bg:     rgba(99, 102, 241, 0.1);
  --c-neutral-text:   #a8a8f8;
  --c-neutral-border: rgba(99, 102, 241, 0.28);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   STARS LAYER (landing page only)
   ============================================================ */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star {
  position: absolute;
  color: rgba(255, 255, 255, 0.22);
  font-weight: 300;
  line-height: 1;
  user-select: none;
}

/* ============================================================
   LANDING LAYOUT
   ============================================================ */
.landing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- top nav ---- */
.top-nav {
  display: flex;
  gap: 18px;
  padding: 22px 28px;
}

.page > .top-nav {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

.nav-link {
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

/* ---- hero ---- */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 28px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.site-title {
  margin: 0 0 14px;
  font-size: clamp(38px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: #fff;
  font-style: normal;
}

.site-title em {
  font-style: italic;
  color: var(--accent);
}

.site-tagline {
  margin: 0 0 38px;
  font-size: clamp(14px, 2vw, 16px);
  color: var(--text-dim);
  max-width: 420px;
  line-height: 1.55;
}

.subtext {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
}

/* ---- legend row ---- */
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
}

.state-shortcut-wrap {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.my-state-button {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.my-state-button:hover {
  background: var(--card-hover);
  border-color: rgba(125, 160, 255, 0.4);
}

.my-state-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.my-state-status {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.my-state-status a {
  color: var(--accent);
}

.my-state-status.is-error {
  color: #d7a1a1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: rgba(125, 160, 255, 0.5);
  box-shadow:
    0 0 0 3px var(--accent-dim),
    0 4px 32px rgba(0, 0, 0, 0.5);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

#candidateSearch {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 18px 0;
  caret-color: var(--accent);
}

#candidateSearch::placeholder {
  color: var(--text-dim);
}

/* ============================================================
   RESULTS DROPDOWN
   ============================================================ */
.results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: none;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
}

.results.open { display: block; }

.result-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  padding: 11px 16px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  transition: background 0.1s;
}

.result-row:hover,
.result-row.active {
  background: var(--card-hover);
}

.result-row-red {
  background: var(--c-red-bg);
  border-bottom-color: var(--c-red-border);
}

.result-row-green {
  background: var(--c-green-bg);
  border-bottom-color: var(--c-green-border);
}

.result-row-gray {
  background: var(--c-gray-bg);
  border-bottom-color: var(--c-gray-border);
}

.result-row-neutral {
  background: var(--c-gray-bg);
  border-bottom-color: var(--c-gray-border);
}

.result-row-red:hover,
.result-row-red.active {
  background: rgba(220, 38, 38, 0.2);
}

.result-row-green:hover,
.result-row-green.active {
  background: rgba(22, 163, 74, 0.2);
}

.result-row-gray:hover,
.result-row-gray.active {
  background: rgba(110, 110, 140, 0.2);
}

.result-row-neutral:hover,
.result-row-neutral.active {
  background: rgba(110, 110, 140, 0.2);
}

.result-row:last-child { border-bottom: 0; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  filter: grayscale(100%) contrast(1.35) brightness(0.86);
}

.result-copy { min-width: 0; }

.result-name {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-count-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid #2c2c35;
  color: #ffffff;
  background: #0f0f12;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-red {
  background: var(--c-red-bg);
  color: var(--c-red-text);
  border-color: var(--c-red-border);
}

.badge-green {
  background: var(--c-green-bg);
  color: var(--c-green-text);
  border-color: var(--c-green-border);
}

.badge-gray {
  background: var(--c-gray-bg);
  color: var(--c-gray-text);
  border-color: var(--c-gray-border);
}

.badge-neutral {
  background: var(--c-neutral-bg);
  color: var(--c-neutral-text);
  border-color: var(--c-neutral-border);
}

.lobby-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  color: #ffffff;
}

.lobby-badge-positive {
  background: #0f0f12;
  border-color: #2c2c35;
}

.lobby-badge-zero {
  background: #0f3b29;
  border-color: #1f6a49;
}

/* ============================================================
   TICKER (scrolling candidate strip)
   ============================================================ */
.ticker-section {
  padding: 0 0 36px;
}

.ticker-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.ticker-outer {
  position: relative;
  overflow: hidden;
}

/* Fade edges */
.ticker-outer::before,
.ticker-outer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}
.ticker-outer::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.ticker-outer::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.ticker-track {
  display: flex;
  gap: 10px;
  padding: 6px 12px;
  width: max-content;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.2s;
  min-width: 0;
}

.ticker-card-green {
  background: var(--c-green-bg);
  border-color: var(--c-green-border);
}

.ticker-card-red {
  background: var(--c-red-bg);
  border-color: var(--c-red-border);
}

.ticker-card:hover {
  background: var(--card-hover);
  border-color: rgba(125, 160, 255, 0.3);
}

.ticker-card-green:hover {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(22, 163, 74, 0.5);
}

.ticker-card-red:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.5);
}

.ticker-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  flex-shrink: 0;
  filter: grayscale(100%) contrast(1.35) brightness(0.86);
}

.ticker-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ticker-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ticker-meta {
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================================================
   FOOTER (landing)
   ============================================================ */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 28px;
  border-top: 1px solid var(--border-soft);
}

.site-footer.page-footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 28px;
  margin-top: auto;
}

.footer-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.stat-subvalue {
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.sep { opacity: 0.4; }

.footer-disclaimer {
  margin: 0;
  max-width: 520px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: right;
}

.footer-disclaimer a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-disclaimer a:hover {
  color: var(--accent);
}

.site-footer.page-footer .footer-disclaimer {
  max-width: 520px;
  text-align: right;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 20px 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 18px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.detail-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.page-last-updated {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.page-last-updated-link {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-last-updated-link:hover {
  color: var(--text);
}

.detail-header {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 20px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: center;
}

.detail-header-red {
  background: var(--c-red-bg);
  border-color: var(--c-red-border);
}

.detail-header-green {
  background: var(--c-green-bg);
  border-color: var(--c-green-border);
}

.detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  filter: grayscale(100%) contrast(1.35) brightness(0.86);
}

.detail-name {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.detail-meta {
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 14px;
}

.detail-lobby-row {
  margin: 0;
}

.detail-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  padding: 20px 22px;
  margin-bottom: 12px;
}

.detail-card h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.detail-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(125, 160, 255, 0.45),
    rgba(125, 160, 255, 0.16)
  );
}

.timeline li {
  margin-bottom: 22px;
  padding: 0 0 2px 30px;
  position: relative;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #0f1424;
  border: 2px solid #8ba9ff;
  box-shadow: 0 0 0 3px rgba(125, 160, 255, 0.14);
}

.timeline-empty::before,
.timeline-empty + li::before {
  border-color: var(--border);
}

.timeline-empty {
  padding-left: 0;
  margin-bottom: 0;
}

.timeline-empty::before {
  display: none;
}

.timeline-date {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.timeline-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.timeline-inline-sources {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-dim);
}

.timeline-inline-sources a {
  color: var(--accent);
  text-decoration: none;
}

.timeline-inline-sources a:hover {
  text-decoration: underline;
}

.timeline-inline-sep {
  color: var(--text-dim);
}

.timeline-event {
  margin: 0;
  color: #e8e8ef;
}

.timeline-additional-sources {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-dim);
}

.timeline-additional-sources a {
  color: var(--accent);
  text-decoration: none;
}

.timeline-additional-sources a:hover {
  text-decoration: underline;
}

.states-header {
  margin-bottom: 14px;
}

.states-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.states-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.state-link-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 12px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.state-link-card:hover {
  border-color: rgba(125, 160, 255, 0.35);
  background: var(--card-hover);
}

.state-link-name {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.state-link-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.state-count-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid #2c2c35;
  color: #ffffff;
  background: #0f0f12;
}

.state-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.state-card:hover {
  border-color: rgba(125, 160, 255, 0.35);
  background: var(--card-hover);
}

.state-card-image {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.state-card-copy {
  min-width: 0;
}

.state-card-title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-card-meta {
  margin: 0;
  color: var(--text-dim);
  font-size: 12px;
}

.states-empty {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.state-table-wrap {
  overflow-x: auto;
}

.state-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.state-table th,
.state-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}

.state-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.state-row {
  cursor: pointer;
}

.state-row:hover {
  background: var(--card-hover);
}

.state-candidate-row {
  cursor: pointer;
}

.state-candidate-row:hover {
  filter: brightness(1.06);
}

.state-row-red {
  background: var(--c-red-bg);
}

.state-row-green {
  background: var(--c-green-bg);
}

.state-row-gray,
.state-row-neutral {
  background: var(--c-gray-bg);
}

.state-candidate-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-candidate-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.state-cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-candidate-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  filter: grayscale(100%) contrast(1.35) brightness(0.86);
}

.state-cell-amount {
  white-space: nowrap;
}

.state-header-flag {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-elevated);
}

.state-candidate-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.state-candidate-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.state-empty-cell {
  color: var(--text-dim);
}

.state-view-toggle-card {
  padding: 12px 14px;
}

.state-view-toggle {
  display: inline-flex;
  gap: 8px;
}

.state-view-toggle-button {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.state-view-toggle-button:hover {
  color: var(--text);
  border-color: rgba(125, 160, 255, 0.35);
}

.state-view-toggle-button.is-active {
  color: var(--text);
  background: var(--accent-dim);
  border-color: rgba(125, 160, 255, 0.45);
}

pre {
  margin: 0 0 12px;
  padding: 14px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-size: 13px;
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .hero {
    padding: 28px 16px 24px;
  }

  .site-title {
    font-size: clamp(34px, 10vw, 56px);
  }

  .top-nav {
    gap: 14px;
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  .page {
    padding: 20px 14px 0;
  }

  .detail-card {
    padding: 16px 16px;
  }

  .state-table {
    min-width: 560px;
  }
}

@media (max-width: 760px) {
  .hero {
    justify-content: flex-start;
    padding-top: 22px;
  }

  .site-tagline {
    margin-bottom: 20px;
    max-width: 100%;
  }

  .search-wrap {
    max-width: 100%;
  }

  .search-box {
    border-radius: 12px;
    padding: 0 14px;
  }

  #candidateSearch {
    font-size: 15px;
    padding: 14px 0;
  }

  .results {
    border-radius: 12px;
    max-height: 60vh;
  }

  .ticker-section {
    padding-bottom: 22px;
  }

  .ticker-card {
    padding: 8px 10px;
    gap: 8px;
  }

  .ticker-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-header {
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 14px;
  }

  .detail-avatar,
  .state-header-flag {
    width: 56px;
    height: 56px;
  }

  .detail-name {
    font-size: 20px;
  }

  .detail-meta {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .timeline li {
    margin-bottom: 18px;
    padding-left: 24px;
    line-height: 1.55;
  }

  .timeline::before {
    left: 5px;
  }

  .timeline li::before {
    left: 0;
    width: 10px;
    height: 10px;
  }

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

  .state-card {
    grid-template-columns: 32px 1fr auto;
  }

  .state-table {
    min-width: 520px;
  }

  .state-table th,
  .state-table td {
    padding: 8px 9px;
    font-size: 12px;
  }

  .site-footer,
  .site-footer.page-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px 20px;
  }

  .footer-disclaimer,
  .site-footer.page-footer .footer-disclaimer {
    max-width: 100%;
    text-align: left;
    font-size: 12px;
    line-height: 1.45;
  }
}

@media (max-width: 520px) {
  .top-nav {
    gap: 10px;
    padding: 14px 14px;
  }

  .nav-link {
    font-size: 12px;
  }

  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .site-title {
    font-size: clamp(30px, 11vw, 40px);
  }

  .result-row {
    grid-template-columns: 36px 1fr;
    gap: 9px;
    padding: 10px 12px;
  }

  .result-row .lobby-badge,
  .result-row .result-count-badge {
    display: none;
  }

  .result-name {
    font-size: 13px;
  }

  .result-meta {
    font-size: 11px;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .detail-top-row {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .back-link {
    margin-bottom: 0;
  }

  .page-last-updated {
    white-space: normal;
    text-align: left;
  }

  .detail-card h2 {
    font-size: 10px;
  }

  .detail-card p,
  .timeline li {
    font-size: 13px;
  }

  .state-table {
    min-width: 470px;
  }

  .state-card {
    grid-template-columns: 28px 1fr;
    padding: 10px;
  }

  .state-card-image {
    width: 28px;
    height: 28px;
  }

  .state-card .state-count-badge {
    display: none;
  }

  .ticker-outer::before,
  .ticker-outer::after {
    width: 26px;
  }
}
