.leg-hero {
    position: relative;
    background: #0B1220;  /* default dark — fallback for unknown party */
    color: #FFFFFF;
    padding: var(--sp-12) 0 var(--sp-10);
    overflow: hidden;
  }
  /* Solid party-themed backgrounds with a diagonal gradient for depth */
  .leg-hero[data-party="D"] {
    background: linear-gradient(135deg, var(--party-D-strong) 0%, #1e3a8a 60%, #172554 100%);
  }
  .leg-hero[data-party="R"] {
    background: linear-gradient(135deg, var(--party-R-strong) 0%, #991b1b 60%, #7f1d1d 100%);
  }
  .leg-hero[data-party="I"] {
    background: linear-gradient(135deg, var(--party-I-strong) 0%, #5b21b6 60%, #4c1d95 100%);
  }
  /* Subtle radial accent on top so it's not a flat slab */
  .leg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 75% 25%, rgba(255,255,255,0.12), transparent 55%);
    pointer-events: none;
  }
  .leg-hero-inner { position: relative; z-index: 1; }
  .leg-hero img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow-lg);
  }
  .leg-hero .placeholder {
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.5);
  }
  .leg-hero h1, .leg-hero .text-meta { color: #FFFFFF !important; }
  .leg-hero .meta { color: rgba(255,255,255,0.85); }
  /* The party badge in the hero — solid-color backgrounds mean a colored pill
     would vanish. Use a high-contrast white/translucent pill instead so the
     label still reads cleanly on top of the party-colored background. */
  .leg-hero .party-badge {
    background: rgba(255,255,255,0.18) !important;
    color: #FFFFFF !important;
    border: 1px solid rgba(255,255,255,0.4);
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    letter-spacing: 0.04em;
  }
  /* Stat tiles riding on the colored hero — translucent so the party color shows through */
  .leg-hero .stat-tile {
    background: rgba(255,255,255,0.1) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: var(--always-white) !important;
    backdrop-filter: blur(4px);
  }
  .leg-hero .stat-tile .stat-label,
  .leg-hero .stat-tile .stat-meta { color: rgba(255,255,255,0.75) !important; }
  .leg-hero .stat-tile .stat-value { color: var(--always-white) !important; }
  /* Hero action buttons — make them readable on solid color backgrounds */
  .leg-hero .btn { color: #FFFFFF; }
  .leg-hero .btn-warning {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.35);
    color: #FFFFFF;
  }
  .leg-hero .btn-warning:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.55);
    color: #FFFFFF;
  }

/* ---------- Leadership pills (Speaker, Majority Leader, etc.) ---------- */
.leadership-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-2) 0 var(--sp-3);
}
.leadership-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  background: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.25);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.leadership-pill i { font-size: 0.9em; }

/* ---- Legislator hero layout + dark-mode text -------------------------- */
.legislator-hero-main { min-width: 240px; }
.legislator-hero-eyebrow { color: rgba(255, 255, 255, 0.55); }
.legislator-hero-title { margin: var(--sp-1) 0; }
.legislator-hero-meta {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
}
.legislator-hero-state { font-size: var(--fs-md); }

/* ---- Stats grid spacing ---------------------------------------------- */
.legislator-stats-grid { margin-top: var(--sp-8); }
.legislator-stat-value-lg {
  font-size: var(--fs-lg);
  margin-top: var(--sp-3);
}

/* ---- Section banded background (used for highlighted strip) ----------- */
.section--banded {
  background: var(--ink-50);
  border-top: 1px solid var(--ink-200);
  border-bottom: 1px solid var(--ink-200);
}

/* ---- Office card line spacing ---------------------------------------- */
.office-line { margin: 0 0 var(--sp-1); }
.office-line:last-child { margin-bottom: 0; }
.office-line--last { margin: 0; }

/* ---- Voting nay pill ------------------------------------------------- */
.legislator-vote-nay-pill {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

/* ---- General footnote text ------------------------------------------- */
.legislator-meta-footnote {
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
}

/* Dark-mode tuning: --danger (#DC2626) on its translucent wash is too
   dim against the dark card surface; lift the foreground to coral. */
[data-theme="dark"] .legislator-vote-nay-pill { color: #F87171; }

/* ---- In Memoriam treatment for deceased members ---------------------- */
/* The .leg-hero--memorial modifier class was already on the section but
   its actual styling was inlined as a fallback. Promoted here so dark
   mode + future tweaks live in one place. */
.leg-hero--memorial {
  background: var(--ink-50);
  border-top: 3px solid var(--ink-400);
}
[data-theme="dark"] .leg-hero--memorial {
  background: var(--ink-100);
  border-top-color: var(--ink-500);
}
.leg-hero--memorial img {
  filter: grayscale(0.45);
}
.legislator-hero-eyebrow--memorial {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
}
.leg-memorial-years {
  font-style: italic;
  margin-top: 4px;
  color: var(--ink-600);
}
.leg-memorial-note {
  margin-top: var(--sp-3);
  font-style: italic;
}

/* ---- Demographic-flags chip row (under the hero, above the meta) ---- */
.demographic-flags {
  margin-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.demographic-flags .demo-pill {
  text-decoration: none;
  font-size: var(--fs-xs);
}

/* ---- Final-actions card row (deceased profiles) -------------------- */
.final-action-tile  { height: 100%; }
.final-action-stamp { margin-top: 4px; }
.final-action-body  { margin-top: 6px; }
.final-action-pos-pill { text-transform: capitalize; }

/* ---- Committee assignments flex list ------------------------------- */
.committee-flex-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
