/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg-dark:       #0d2626;
  --bg-card:       #122e2e;
  --bg-card-alt:   #163535;
  --bg-modal:      #0f2828;
  --accent-green:  #3d9c72;
  --accent-bright: #4bb882;
  --accent-muted:  #2a7a58;
  --text-primary:  #e8f0ee;
  --text-secondary:#9dbfb8;
  --text-muted:    #6a9e96;
  --border:        rgba(61,156,114,0.2);
  --border-bright: rgba(75,184,130,0.4);
  --tier1-color:   #4bb882;
  --tier2-color:   #3b8f9e;
  --tier3-color:   #7a6fad;
  --tier4-color:   #6a8a8a;
  --danger-color:  #e07070;
  --tag-bg:        rgba(75,184,130,0.12);
  --shadow:        0 8px 32px rgba(0,0,0,0.45);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset / Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: rgba(13,38,38,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
}

.header-nav { display: flex; gap: 28px; }

.header-nav a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.header-nav a:hover { color: var(--accent-bright); text-decoration: none; }

/* ── Search Bar ─────────────────────────────────────────────────────────────── */
.search-bar-wrap { background: var(--bg-dark); padding: 20px 24px 0; }

.search-bar-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 0 14px;
  gap: 10px;
  transition: border-color var(--transition);
}

.search-bar-inner:focus-within { border-color: var(--accent-bright); box-shadow: 0 0 0 3px rgba(75,184,130,0.12); }
.search-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

#candidate-search {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 14px; padding: 13px 0; font-family: inherit;
}
#candidate-search::placeholder { color: var(--text-muted); }

.search-clear {
  display: none; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 4px; border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.search-clear:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.search-count { font-size: 12px; color: var(--text-muted); margin: 8px 2px 0; min-height: 18px; }
.no-results { text-align: center; padding: 60px 32px; color: var(--text-secondary); font-size: 15px; }

/* ── Page Hero ──────────────────────────────────────────────────────────────── */
.page-hero {
  text-align: center;
  padding: 72px 32px 56px;
  background: linear-gradient(180deg, #0a1e1e 0%, var(--bg-dark) 100%);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.hero-sub { font-size: 17px; color: var(--text-secondary); line-height: 1.7; }

/* ── Candidates Page ────────────────────────────────────────────────────────── */
.candidates-page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px 96px 56px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ── Tier Section ───────────────────────────────────────────────────────────── */
.tier-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tier-label h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }

.tier-label .tier-desc {
  font-size: 13px; color: var(--text-muted);
  max-width: 480px; text-align: right;
}

/* ── Collapsible tier section ──────────────────────────────────────────────── */
.tier-collapsible .tier-label {
  cursor: pointer;
  user-select: none;
  transition: border-color var(--transition);
}

.tier-collapsible .tier-label:hover {
  border-bottom-color: var(--border-bright);
}

.tier-collapsible .tier-label:hover .tier-toggle-chevron,
.tier-collapsible .tier-label:focus-visible .tier-toggle-chevron {
  color: var(--accent-bright);
}

.tier-collapsible .tier-label:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

.tier-toggle-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.tier-toggle-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s, color var(--transition);
}

.tier-collapsible:not(.tier-collapsed) .tier-toggle-chevron {
  transform: rotate(180deg);
}

.tier-collapsible.tier-collapsed .card-grid,
.tier-collapsible.tier-collapsed .tier-general-cta {
  display: none;
}

/* During search, force-show grids and CTAs even if user has the section
   collapsed, so matching candidates remain visible. */
body.searching .tier-collapsible.tier-collapsed .card-grid {
  display: grid;
}
body.searching .tier-collapsible.tier-collapsed .tier-general-cta {
  display: flex;
}
body.searching .tier-collapsible .tier-toggle-chevron,
body.searching .tier-collapsible .tier-toggle-count {
  display: none;
}

.tier-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}

.tier-badge.tier-1 { background: rgba(75,184,130,0.18); color: var(--tier1-color); border: 1px solid rgba(75,184,130,0.3); }
.tier-badge.tier-2 { background: rgba(59,143,158,0.18); color: var(--tier2-color); border: 1px solid rgba(59,143,158,0.3); }
.tier-badge.tier-3 { background: rgba(122,111,173,0.18); color: var(--tier3-color); border: 1px solid rgba(122,111,173,0.3); }
.tier-badge.tier-4 { background: rgba(106,138,138,0.18); color: var(--tier4-color); border: 1px solid rgba(106,138,138,0.3); }

/* ── Tier General (tracked only) ───────────────────────────────────────────── */
.tier-general-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  background: rgba(75,184,130,0.06);
  border: 1px solid rgba(75,184,130,0.2);
  border-radius: var(--radius);
}

.tier-general-cta p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.tier-general-cta-btn {
  padding: 8px 20px;
  background: var(--accent-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition);
}

.tier-general-cta-btn:hover {
  background: var(--accent-bright);
  text-decoration: none;
}

.card-not-recommended {
  padding: 10px 12px;
  background: rgba(106,138,138,0.08);
  border: 1px solid rgba(106,138,138,0.2);
  border-radius: var(--radius-sm);
}

.not-recommended-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.not-recommended-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tracked-only .card-main {
  opacity: 0.75;
  transition: opacity var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tracked-only .card-main:hover {
  opacity: 0.9;
}

/* ── Card Grid ──────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ── Card Wrapper ───────────────────────────────────────────────────────────── */
.card-wrapper {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.card-main:hover { border-color: var(--border-bright); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

/* ── Card Top ─────────────────────────────────────────────────────────────── */
.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.card-photo-col { flex-shrink: 0; }

.candidate-photo {
  width: 64px; height: 64px;
  object-fit: cover;
}

.card-photo-col {
  overflow: hidden;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border: 2px solid var(--border-bright);
}

.photo-placeholder {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-muted), #1e5a48);
  border: 2px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--text-primary);
  flex-shrink: 0;
}

.card-info-col { flex: 1; min-width: 0; }

.candidate-name {
  font-size: 18px; font-weight: 800; color: var(--text-primary);
  margin-bottom: 4px; letter-spacing: -0.02em; line-height: 1.2;
}

.candidate-meta {
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.partisanship-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
}
.partisanship-badge.solid-dem  { background: #1a4a8a; color: #c8deff; border: 1px solid #2a5aaa; }
.partisanship-badge.likely-dem { background: #2e6db4; color: #d4e8ff; border: 1px solid #3e7dc4; }
.partisanship-badge.lean-dem   { background: #6a9fd8; color: #fff;    border: 1px solid #7aafde; }
.partisanship-badge.tossup     { background: #5a5a5a; color: #e0e0e0; border: 1px solid #7a7a7a; }
.partisanship-badge.lean-rep   { background: #d88080; color: #fff;    border: 1px solid #e09090; }
.partisanship-badge.likely-rep { background: #c0392b; color: #ffd4d4; border: 1px solid #d04030; }
.partisanship-badge.solid-rep  { background: #7b1a1a; color: #ffc8c8; border: 1px solid #9b2a2a; }


/* ── Endorsements ─────────────────────────────────────────────────────────── */
.card-endorsements {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

/* When the endorsements block lives inside the card header as a third flex
   child of .card-top, pin it to the right and stack pills vertically on the
   same horizontal row as the photo + name/meta column. */
.card-endorsements-header {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.endorsements-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

.endorsement-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary);
  white-space: nowrap;
  text-decoration: none;
}

.endorsement-pill-link {
  cursor: pointer;
  border-color: rgba(255,255,255,0.18);
}

.endorsement-pill-link:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  border-color: var(--accent-bright);
}


/* ── Stance (alignment blurb) ──────────────────────────────────────────────── */
.card-stance {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: rgba(75,184,130,0.06);
  border: 1px solid rgba(75,184,130,0.18);
  border-radius: var(--radius-sm);
}

.stance-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.stance-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Bullet list used by the admin editor for support_reasons */
.stance-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.stance-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.stance-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.stance-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.check-icon {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
}

.check-yes {
  color: var(--accent-bright);
  background: rgba(75,184,130,0.12);
  border-color: rgba(75,184,130,0.28);
}

.check-no {
  color: var(--danger-color);
  background: rgba(224,112,112,0.08);
  border-color: rgba(224,112,112,0.2);
  text-decoration: line-through;
  text-decoration-color: rgba(224,112,112,0.5);
  text-decoration-thickness: 1px;
  opacity: 0.75;
}

.check-unknown {
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
  opacity: 0.55;
}

/* Larger footprint inside the modal for readability */
.modal-section .stance-checklist { gap: 6px 8px; margin-top: 10px; }
.modal-section .check-item { font-size: 12px; padding: 4px 10px; border-radius: 12px; }
.modal-section .check-icon { font-size: 12px; width: 12px; }

.modal-stance-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ── Viability ────────────────────────────────────────────────────────────── */
.card-viability {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: rgba(59,143,158,0.08);
  border: 1px solid rgba(59,143,158,0.2);
  border-radius: var(--radius-sm);
}

.viability-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tier2-color);
}

.viability-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Opponent ─────────────────────────────────────────────────────────────── */
.card-opponent-section {
  padding: 10px 12px;
  background: rgba(224,112,112,0.06);
  border: 1px solid rgba(224,112,112,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.opponent-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.card-opponent {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.opponent-vs {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); font-style: italic;
}

.opponent-name {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
}

.opponent-flag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--danger-color);
  background: rgba(224,112,112,0.12);
  border: 1px solid rgba(224,112,112,0.25);
  padding: 2px 8px; border-radius: 12px;
}

/* ── Race Comparison (Polling + Fundraising) ────────────────────────────── */
.card-race-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
}

.race-scroll {
  overflow-x: auto;
}

.race-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.race-rows {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 68px 108px;
  column-gap: 6px;
  row-gap: 4px;
  align-items: center;
  min-width: 360px;
}

/* Variant for single-column stats (e.g. uninformed-only polling): collapse to
   2 columns so name + stat don't leave a trailing empty cell that causes next
   row's name to flow into the gap. Stat column auto-sizes to fit its content
   (e.g. the "UNINFORMED" header) and min-width is dropped so the table no
   longer overflows the narrow card. */
.race-rows.race-rows-2col {
  grid-template-columns: minmax(100px, 1fr) auto;
  min-width: 0;
}

.race-row {
  display: contents;
}

.race-row > * {
  padding: 2px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.race-row-ours > .race-row-name,
.race-row-ours > .race-row-party {
  color: var(--text-primary);
  font-weight: 600;
}

.race-row-header {
  display: contents;
}

.race-row-header > * {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  padding-bottom: 4px;
  overflow: visible;
}

.race-header-sep {
  grid-column: 1 / -1;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 2px;
}



.race-row-party {
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; flex-shrink: 0; width: fit-content;
  display: inline-block; margin-right: 5px; vertical-align: middle;
}
.race-party-dem { background: rgba(42,90,170,0.25); color: #7aaaf0; }
.race-party-rep { background: rgba(192,57,43,0.25); color: #f08080; }
.race-party-npa, .race-party-ind { background: rgba(120,120,120,0.2); color: var(--text-muted); }

.race-row-stat {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-align: right;
}

.race-row-name {
  white-space: nowrap;
  min-width: 0;
}

.race-row-ours > .race-row-stat { color: var(--accent-bright); }
.race-row-ours > .race-row-coh  { color: var(--accent-bright); }

.race-row-coh {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-align: right;
}

.race-source {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
  grid-column: 1 / -1;
}


.race-polling-text {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-top: 2px;
  grid-column: 1 / -1;
}

/* ── Card Donate Area ─────────────────────────────────────────────────────── */
.card-donate-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.card-donate-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 7px 12px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.preset-btn:hover { border-color: var(--accent-bright); color: var(--accent-bright); }
.preset-btn.active { background: rgba(75,184,130,0.15); border-color: var(--accent-bright); color: var(--accent-bright); }

.card-donate-field {
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  transition: border-color var(--transition);
}

.card-donate-field:focus-within { border-color: var(--accent-bright); }

.card-donate-dollar {
  font-size: 13px; font-weight: 700; color: var(--text-muted);
}

.card-donate-input {
  width: 50px; padding: 7px 4px;
  background: transparent; border: none;
  color: var(--text-primary); font-size: 13px; font-weight: 700;
  outline: none; -moz-appearance: textfield;
}

.card-donate-input::-webkit-outer-spin-button,
.card-donate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card-donate-input::placeholder { color: var(--text-muted); opacity: 0.5; font-weight: 400; }

.card-donate-btn {
  padding: 9px 18px;
  background: var(--accent-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background var(--transition);
  flex-shrink: 0;
}

.card-donate-btn:hover { background: var(--accent-bright); text-decoration: none; }

/* ── Expand / Analysis ────────────────────────────────────────────────────── */
.card-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.card-expand-btn:hover { color: var(--accent-bright); border-color: var(--border-bright); }

.expand-chevron { transition: transform 0.2s; }
.card-expand-btn.expanded .expand-chevron { transform: rotate(180deg); }

.card-analysis {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analysis-bio {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.analysis-section {}

.endorsements-full {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analysis-heading {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 8px;
}
.strengths-heading { color: var(--tier1-color); }
.analysis-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
}

.analysis-list li {
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
  padding-left: 14px; position: relative;
}

.strengths-list li::before { content: "+"; position: absolute; left: 0; color: var(--tier1-color); font-weight: 700; }

/* ── Tier Donate-All Bar ──────────────────────────────────────────────────── */
.tier-donate-bar {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.tier-donate-bar-label { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.tier-donate-bar-right { display: flex; align-items: center; gap: 8px; }

.tier-donate-bar-field {
  display: flex; align-items: center;
  background: var(--bg-dark); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px;
  transition: border-color var(--transition);
}
.tier-donate-bar-field:focus-within { border-color: var(--accent-bright); }
.tier-donate-bar-dollar { font-size: 16px; font-weight: 700; color: var(--text-muted); }
.tier-donate-bar-field input {
  width: 90px; padding: 10px 6px; background: transparent; border: none;
  color: var(--text-primary); font-size: 16px; font-weight: 700;
  outline: none; -moz-appearance: textfield;
}
.tier-donate-bar-field input::-webkit-outer-spin-button,
.tier-donate-bar-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tier-donate-bar-field input::placeholder { color: var(--text-muted); opacity: 0.4; }

.tier-donate-all-btn {
  padding: 12px 28px; background: var(--accent-green); color: #fff;
  border: none; border-radius: var(--radius); font-size: 15px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background var(--transition);
}
.tier-donate-all-btn:hover { background: var(--accent-bright); }

/* ── CTA Button ─────────────────────────────────────────────────────────────── */
.cta-btn {
  display: inline-block; background: var(--accent-green); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 14px 32px; border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition); text-align: center;
}
.cta-btn:hover { background: var(--accent-bright); text-decoration: none; transform: translateY(-1px); }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,18,18,0.85);
  backdrop-filter: blur(8px); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-card {
  background: var(--bg-modal); border: 1px solid var(--border-bright);
  border-radius: var(--radius); max-width: 860px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 40px; position: relative;
  box-shadow: var(--shadow); transform: translateY(20px); transition: transform var(--transition);
}
.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.modal-hero {
  display: grid; grid-template-columns: 120px 1fr; gap: 28px;
  align-items: start; margin-bottom: 28px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.modal-photo-wrap {
  width: 112px; height: 112px; border-radius: var(--radius);
  overflow: hidden; border: 3px solid var(--border-bright); flex-shrink: 0;
}
.modal-photo { width: 112px; height: 112px; object-fit: cover; }
.modal-photo-placeholder {
  width: 112px; height: 112px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-muted), #1e5a48);
  border: 3px solid var(--border-bright);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: var(--text-primary);
}
.modal-hero-info h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }

.modal-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.modal-section h3 { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-green); margin-bottom: 10px; }
.modal-section p { font-size: 14px; color: var(--text-secondary); line-height: 1.75; }

.modal-cta { display: flex; justify-content: center; padding-top: 8px; }


/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
}

.footer-org {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ──────────────────────────────────────────────────────────────────────────
   Admin editor
   ── Reuses main-page card structure; these styles layer editing affordances
   ── on top of it (dashed borders, tables, click-to-cycle chips).
   ────────────────────────────────────────────────────────────────────────── */

.admin-body .site-header { display: none; }

.admin-topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(13,38,38,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-bright);
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-topbar h1 { font-size: 16px; font-weight: 700; color: var(--accent-bright); }
.admin-topbar-title { display: flex; align-items: center; gap: 12px; }
.admin-topbar-count { font-size: 12px; color: var(--text-muted); }
.admin-topbar-actions { display: flex; gap: 8px; }

.admin-btn {
  padding: 7px 16px; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: 0.2s;
  font-family: inherit;
}
.admin-btn-primary { background: var(--accent-green); color: #fff; }
.admin-btn-primary:hover { background: var(--accent-bright); }
.admin-btn-outline { background: transparent; color: var(--accent-bright); border: 1px solid var(--border-bright); }
.admin-btn-outline:hover { background: rgba(75,184,130,0.1); }
.admin-btn-danger { background: #e07070; color: #fff; }
.admin-btn-danger:hover { opacity: 0.85; }
.admin-btn-sm { padding: 4px 10px; font-size: 11px; }

/* 2-column grid for admin so there's room for editing controls */
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1200px) { .admin-grid { grid-template-columns: 1fr; } }

/* Base editable input/textarea */
.ed {
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 3px 7px;
  outline: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.ed:focus {
  border-color: var(--accent-bright);
  background: rgba(75,184,130,0.06);
}
.ed:hover { border-color: rgba(255,255,255,0.22); }

textarea.ed {
  display: block; width: 100%; resize: vertical; min-height: 40px;
  line-height: 1.5;
}

/* Name header inside admin cards */
.ed-name {
  width: 100%;
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ed-meta {
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  padding: 2px 6px;
  min-width: 80px;
}

/* Partisanship select keeps the colored badge look */
.ed-partisanship {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='%239dbfb8'%3e%3cpath d='M5 6L0 0h10z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 8px;
  padding-right: 20px;
}

.ed-label-inline {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(75,184,130,0.5);
  display: inline-block; margin-right: 6px;
}

.ed-inline { display: flex; align-items: center; gap: 4px; }
.ed-inline > .ed { flex: 1; min-width: 60px; }
.ed-inline-sm > .ed { flex: 0 0 auto; }

.ed-row-compact {
  display: grid;
  grid-template-columns: 1fr 90px 120px;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.ed-block {
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.ed-block-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}

/* Pill-style list editors (endorsements, opponent tags) */
.ed-pill-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ed-pill { display: inline-flex; align-items: center; gap: 3px; }
.ed-pill input {
  min-width: 60px; max-width: 200px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--text-secondary);
  font-size: 11px; font-weight: 600;
  outline: none; font-family: inherit;
}
.ed-pill input:focus { border-color: var(--accent-bright); }
.ed-pill-danger input { color: var(--danger-color); background: rgba(224,112,112,0.06); border-color: rgba(224,112,112,0.2); }

.ed-remove {
  width: 18px; height: 18px; padding: 0;
  background: none; border: none;
  color: #e07070; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; flex-shrink: 0;
}
.ed-remove:hover { background: rgba(224,112,112,0.15); }

.ed-add {
  background: none;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 4px 10px;
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.ed-add:hover { border-color: var(--accent-bright); color: var(--accent-bright); }

/* Click-to-cycle chips for positions (in admin) — visual identical to main page */
.check-edit {
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border-width: 1px;
  border-style: solid;
  transition: transform 0.1s, box-shadow 0.2s;
}
.check-edit:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.check-edit:active { transform: translateY(0); }

/* Structured table editor (polling & fundraising) */
.admin-editor-section { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); }
.admin-editor-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.admin-editor-help {
  font-size: 10px; color: var(--text-muted);
  font-style: italic; font-weight: 400; letter-spacing: 0;
  text-transform: none;
}

.admin-table {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 4px;
}
.admin-table-header, .admin-table-row {
  display: grid;
  gap: 6px;
  align-items: center;
}
.polling-table .admin-table-header,
.polling-table .admin-table-row {
  grid-template-columns: 62px minmax(0,1fr) 72px 72px 36px 24px;
}
.fr-table .admin-table-header,
.fr-table .admin-table-row {
  grid-template-columns: 62px minmax(0,1fr) 92px 92px 36px 24px;
}
.admin-table-header > span {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}
.admin-table-row > .ed {
  font-size: 12px;
  padding: 3px 6px;
  min-width: 0;
}
.admin-table-row .row-party-select {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 4px;
  text-align: center;
}
.admin-table-row input[type="number"] {
  text-align: right;
  -moz-appearance: textfield;
}
.admin-table-row input[type="number"]::-webkit-outer-spin-button,
.admin-table-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.admin-table-row.admin-row-ours > .ed { border-color: rgba(75,184,130,0.35); background: rgba(75,184,130,0.05); }
.admin-table-ours { display: flex; align-items: center; justify-content: center; }
.admin-table-ours input { margin: 0; cursor: pointer; accent-color: var(--accent-bright); }

/* Tier section overrides for admin (tighten margins) */
.admin-body .tier-label { margin-bottom: 18px; padding-bottom: 14px; }
.admin-body .tier-section { }
.admin-body .candidates-page { padding: 24px 32px; gap: 48px; }
.admin-body .tier-general-cta { display: none; }

/* Admin bar at bottom of each card */
.card-admin-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-admin-bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-admin-bar-right { display: flex; gap: 6px; flex-shrink: 0; }

.tier-select {
  padding: 4px 8px; background: var(--bg-card-alt); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-primary); font-size: 12px; font-weight: 600;
  cursor: pointer; outline: none; font-family: inherit;
}
.tier-select:focus { border-color: var(--accent-bright); }

/* Toast notification */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 24px; background: var(--accent-green);
  color: #fff; font-weight: 600; border-radius: 8px;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; z-index: 300;
}
.toast.show { opacity: 1; }

/* Disabled preview donate area (admin cards) */
.admin-body .card-donate-area { opacity: 0.7; cursor: default; }
.admin-body .card-donate-area .preset-btn,
.admin-body .card-donate-area .card-donate-input,
.admin-body .card-donate-area .card-donate-btn { cursor: default; pointer-events: none; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-muted); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 900px) {
  .card-grid { grid-template-columns: 1fr; }
  .modal-hero { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .candidates-page { padding: 32px 16px; }
  .page-hero { padding: 48px 16px 36px; }
  .modal-card { padding: 24px 20px; }
  .tier-label { flex-wrap: wrap; }
  .tier-label .tier-desc { margin-left: 0; text-align: left; }
  .card-donate-area { flex-direction: column; align-items: stretch; }
  .card-donate-btn { text-align: center; padding: 12px; }
}
