/*
  CM Election Predictions — Primary state detail clean visual layer
  ----------------------------------------------------------------
  Loaded last on /election-night/primary/_detail/. This is the only state-page
  layer allowed to draw projection glyphs and the final layer for result cards,
  county tooltips, and House district tiles.
*/

body.en-primary-detail{
  --cmep-call-d:var(--solid-d,#0076ba);
  --cmep-call-r:var(--solid-r,#ee220c);
  --cmep-call-o:#64748b;
  --cmep-panel:var(--bg-card,#ffffff);
  --cmep-panel-soft:color-mix(in srgb, var(--bg-card,#ffffff) 86%, var(--text-main,#0f172a) 4%);
  --cmep-line:var(--border-subtle,rgba(148,163,184,.26));
  --cmep-muted:var(--text-muted,#64748b);
  --cmep-strong:var(--text-strong,#0f172a);
  --cmep-card-radius:24px;
  --cmep-inner-radius:18px;
  --cmep-row-radius:16px;
  --cmep-card-shadow:0 18px 42px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.16);
  --cmep-card-shadow-dark:0 18px 42px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.08);
  --cmep-call-shadow:0 14px 30px rgba(2,6,23,.20), inset 0 1px 0 rgba(255,255,255,.22);
}

/* Layout rhythm: wider on desktops, not edge-to-edge. */
body.en-primary-detail .container{
  width:min(1720px, calc(100vw - 48px));
  max-width:none;
  margin-inline:auto;
}
body.en-primary-detail .page-head{ margin:clamp(.6rem,1.4vw,1.2rem) 0 clamp(1rem,2vw,1.7rem); }
body.en-primary-detail .state-hero{
  border-radius:28px;
  padding:clamp(1.1rem,2vw,1.75rem);
  overflow:hidden;
}
body.en-primary-detail .state-name{
  font-size:clamp(2.15rem,4.6vw,4.8rem);
  line-height:.95;
  letter-spacing:-.055em;
}
body.en-primary-detail .state-subtitle{ max-width:72ch; }
body.en-primary-detail .state-outline-wrap{ opacity:.82; }
body.en-primary-detail .page-actions{ gap:.7rem; }
body.en-primary-detail .segmented,
body.en-primary-detail .back-btn,
body.en-primary-detail .primary-refresh-btn{
  backdrop-filter:saturate(150%) blur(12px);
}
body.en-primary-detail .segmented{ padding:.25rem; border-radius:999px; }
body.en-primary-detail .segmented .seg-btn{ min-height:2.25rem; border-radius:999px; }

/* Main live-results layout. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .grid-2{
  display:grid !important;
  grid-template-columns:minmax(410px,.92fr) minmax(480px,1.08fr) !important;
  gap:clamp(1rem,2vw,1.45rem) !important;
  align-items:start !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card,
body.en-primary-detail #view-house .card,
body.en-primary-detail :is(#countyListCard,#countyListCardSenate,.state-analytics-card){
  border:1px solid var(--cmep-line) !important;
  border-radius:var(--cmep-card-radius) !important;
  background:linear-gradient(180deg, color-mix(in srgb, var(--cmep-panel) 98%, #fff 2%), var(--cmep-panel)) !important;
  box-shadow:var(--cmep-card-shadow) !important;
}
@media (prefers-color-scheme:dark){
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card,
  body.en-primary-detail #view-house .card,
  body.en-primary-detail :is(#countyListCard,#countyListCardSenate,.state-analytics-card){ box-shadow:var(--cmep-card-shadow-dark) !important; }
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card{ padding:clamp(1rem,1.8vw,1.45rem) !important; }
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card-header{
  align-items:flex-start !important;
  gap:1rem !important;
  padding-bottom:.9rem !important;
  margin-bottom:.9rem !important;
  border-bottom:1px solid var(--cmep-line) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card-title{
  font-size:clamp(1.35rem,2vw,1.9rem) !important;
  line-height:1.02 !important;
  letter-spacing:-.04em !important;
  max-width:22ch;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card-help{
  font-size:.95rem !important;
  line-height:1.38 !important;
  color:var(--cmep-muted) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .live-row{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  gap:.55rem .7rem !important;
  margin-top:.35rem !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-refresh-btn{
  min-height:2.4rem !important;
  padding:.55rem .95rem !important;
  border-radius:999px !important;
  font-weight:950 !important;
  letter-spacing:-.01em !important;
}

/* Maps need a stronger stage and stable proportions. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .map{
  min-height:420px !important;
  border-radius:22px !important;
  border:1px solid color-mix(in srgb, var(--cmep-line) 82%, transparent) !important;
  background:linear-gradient(180deg, var(--cmep-panel-soft), color-mix(in srgb, var(--cmep-panel-soft) 80%, #000 4%)) !important;
  overflow:hidden !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .reset-view-btn{
  top:.85rem !important;
  right:.85rem !important;
  border-radius:999px !important;
  min-height:2.15rem !important;
  font-weight:950 !important;
}

/* Remove every older projection marker system on this state page. */
body.en-primary-detail :is(.winner-pill,.rowBadge,.winner-text,.winner-icon,.winner-icon-check,.winner-icon-arrow,.ct-winner-pill,.cme-proj-glyph,.cme-proj-glyph-single,.cme-proj-glyph-final,.cme-projection-glyph-final,.district-tile-pill-wrap,.district-tile-pill-label){
  display:none !important;
  visibility:hidden !important;
  width:0 !important;
  height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) :is(.primary-row,.candidate-row,.result-row,.county-row):is(.is-winner,.is-advance,.winD,.winR,.advD,.advR) :is(.primary-cand .n,.n,.candidate-name,.primary-name)::before,
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) :is(.ct-row,.candidate-row,.result-row):is(.is-winner,.is-advance,.winD,.winR,.advD,.advR) :is(.ct-name,.n,.candidate-name)::before,
html body.en-primary-detail :is(#view-house,.house-district-tile,.district-tile) :is(.district-name,.district-meta,.district-submeta,.district-status)::before,
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) :is(.primary-row,.candidate-row,.result-row,.county-row):is(.is-winner,.is-advance,.winD,.winR,.advD,.advR)::after,
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) :is(.ct-row,.candidate-row,.result-row):is(.is-winner,.is-advance,.winD,.winR,.advD,.advR)::after,
html body.en-primary-detail :is(#view-house,.house-district-tile,.district-tile) :is(.district-submeta,.district-status)::after{
  content:none !important;
  display:none !important;
}

/* Race card: more newsroom, less patchwork. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-mount{
  gap:1rem !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-race{
  padding:clamp(.95rem,1.6vw,1.25rem) !important;
  border:1px solid var(--cmep-line) !important;
  border-radius:22px !important;
  background:linear-gradient(180deg, color-mix(in srgb, var(--cmep-panel-soft) 92%, transparent), var(--cmep-panel-soft)) !important;
  box-shadow:none !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-head{
  display:block !important;
  padding-bottom:.8rem !important;
  margin-bottom:.8rem !important;
  border-bottom:1px solid var(--cmep-line) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-head .kicker{
  margin-bottom:.22rem !important;
  font-size:.72rem !important;
  letter-spacing:.18em !important;
  font-weight:950 !important;
  color:var(--cmep-muted) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-head .name{
  font-size:clamp(1.2rem,1.75vw,1.55rem) !important;
  line-height:1.05 !important;
  letter-spacing:-.035em !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-meta{
  margin-top:.65rem !important;
  font-size:clamp(.98rem,1.25vw,1.14rem) !important;
  line-height:1.35 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-rows{
  display:flex !important;
  flex-direction:column !important;
  gap:.62rem !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row{
  position:relative !important;
  overflow:hidden !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row{
  padding:.72rem .82rem !important;
  min-height:4.1rem !important;
  border:1px solid color-mix(in srgb, var(--cmep-line) 70%, transparent) !important;
  border-radius:var(--cmep-row-radius) !important;
  background:color-mix(in srgb, var(--cmep-panel) 82%, transparent) !important;
  transition:transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:hover{
  transform:translateY(-1px);
  border-color:color-mix(in srgb, var(--cmep-line) 90%, var(--cmep-strong) 10%) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected])::before,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:not([data-cme-projected])::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  left:0 !important;
  top:.68rem !important;
  bottom:.68rem !important;
  width:3px !important;
  border-radius:999px !important;
  background:var(--cmep-call-o) !important;
  opacity:.34 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected]::before,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected]::before{
  content:none !important;
  display:none !important;
}

/* Projected rows: single, clean call treatment. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected]{
  border-color:rgba(255,255,255,.32) !important;
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
  box-shadow:var(--cmep-call-shadow) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projection-party="D"],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projection-party="D"]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d) 96%, #00111f 4%), color-mix(in srgb, var(--cmep-call-d) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projection-party="R"],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projection-party="R"]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r) 96%, #210000 4%), color-mix(in srgb, var(--cmep-call-r) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected]:not([data-cme-projection-party]),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected]:not([data-cme-projection-party]){
  background:linear-gradient(135deg,#475569,#94a3b8) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .left,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected] .ct-left{
  display:flex !important;
  align-items:center !important;
  gap:.72rem !important;
  min-width:0 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] :is(.primary-dot,.ct-dot),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected] :is(.primary-dot,.ct-dot){ display:none !important; }
body.en-primary-detail .cme-state-row-glyph{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  width:1.12em !important;
  min-width:1.12em !important;
  height:1.12em !important;
  margin:0 !important;
  color:#fff !important;
  font-size:1.7rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
  letter-spacing:-.065em !important;
  text-shadow:0 2px 3px rgba(0,0,0,.28) !important;
}
body.en-primary-detail .cme-state-row-glyph[data-kind="advance"]{
  font-size:1.92rem !important;
  letter-spacing:-.03em !important;
  transform:translateY(-.02em);
}
body.en-primary-detail .ct-left > .cme-state-row-glyph{ font-size:1.34rem !important; }
body.en-primary-detail .ct-left > .cme-state-row-glyph[data-kind="advance"]{ font-size:1.5rem !important; }
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] :is(.primary-cand,.primary-cand .n,.primary-cand .p,.pct,.votes,.pct-wrap),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected] :is(.ct-name,.ct-party,.p,.ct-pct,.ct-votes){
  color:#fff !important;
  opacity:1 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row[data-cme-projected] .primary-cand .n{
  font-size:clamp(1.05rem,1.35vw,1.28rem) !important;
  font-weight:1000 !important;
  line-height:1.04 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row[data-cme-projected] .primary-cand .p,
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row[data-cme-projected] .votes,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected] :is(.ct-party,.p,.ct-votes){ color:rgba(255,255,255,.91) !important; }
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row[data-cme-projected] .primary-right .pct{
  font-size:clamp(1.18rem,1.75vw,1.55rem) !important;
  font-weight:1000 !important;
  letter-spacing:-.04em !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-bar{
  height:8px !important;
  margin:.52rem .15rem .12rem !important;
  border-radius:999px !important;
  background:rgba(148,163,184,.24) !important;
}

/* County tooltip: visually match the result card, but stay compact. */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout){
  border-radius:22px !important;
  border:1px solid var(--cmep-line) !important;
  background:color-mix(in srgb, var(--cmep-panel) 96%, transparent) !important;
  box-shadow:0 22px 48px rgba(2,6,23,.26), inset 0 1px 0 rgba(255,255,255,.10) !important;
  color:var(--cmep-strong) !important;
}
body.en-primary-detail .county-tooltip{
  max-width:min(560px, calc(100vw - 32px)) !important;
  padding:1.05rem 1.15rem !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-title{
  font-size:clamp(1.05rem,1.45vw,1.35rem) !important;
  line-height:1.05 !important;
  letter-spacing:-.035em !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-summary{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:.45rem !important;
  align-items:center !important;
  margin:.72rem 0 .85rem !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-chip{
  display:inline-flex !important;
  align-items:center !important;
  min-height:1.38rem !important;
  padding:.25rem .58rem !important;
  border-radius:999px !important;
  border:1px solid color-mix(in srgb, var(--cmep-line) 70%, transparent) !important;
  background:color-mix(in srgb, var(--cmep-panel) 88%, #fff 12%) !important;
  color:var(--cmep-strong) !important;
  font-size:.78rem !important;
  font-weight:950 !important;
  line-height:1 !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:.72rem !important;
  padding:.56rem .62rem !important;
  border-radius:14px !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row + .ct-row{ border-top:0 !important; }
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-name{
  font-size:.95rem !important;
  font-weight:950 !important;
  line-height:1.05 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-party,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-votes{
  font-size:.78rem !important;
  font-weight:850 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-pct{
  font-size:1.04rem !important;
  font-weight:1000 !important;
  letter-spacing:-.03em !important;
}
body.en-primary-detail .county-tooltip.mobile-popout::after{ display:none !important; }
body.en-primary-detail .tooltip-view-all,
body.en-primary-detail .ct-view-all{
  min-height:2.55rem !important;
  border-radius:999px !important;
  font-weight:950 !important;
  margin-top:.62rem !important;
}

/* House overview: clearer buckets and district tiles. */
body.en-primary-detail #view-house .house-buckets{ gap:1rem !important; }
body.en-primary-detail #view-house .house-bucket{
  border-radius:22px !important;
  border:1px solid var(--cmep-line) !important;
  background:linear-gradient(180deg, color-mix(in srgb, var(--cmep-panel-soft) 90%, transparent), var(--cmep-panel-soft)) !important;
  padding:1rem !important;
}
body.en-primary-detail #view-house .house-bucket-head{
  margin-bottom:.8rem !important;
  padding-bottom:.7rem !important;
  border-bottom:1px solid var(--cmep-line) !important;
}
body.en-primary-detail #view-house .district-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr)) !important;
  gap:.75rem !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile){
  min-height:8.4rem !important;
  border-radius:18px !important;
  padding:.85rem .9rem !important;
  border:1px solid color-mix(in srgb, var(--cmep-line) 82%, transparent) !important;
  background:color-mix(in srgb, var(--cmep-panel) 86%, transparent) !important;
  box-shadow:none !important;
  transition:transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile):hover{
  transform:translateY(-2px) !important;
  box-shadow:0 12px 26px rgba(2,6,23,.12) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile]{
  position:relative !important;
  overflow:hidden !important;
  border-color:rgba(255,255,255,.28) !important;
  box-shadow:0 16px 34px rgba(2,6,23,.18), inset 0 1px 0 rgba(255,255,255,.18) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] :is(.district-name,.district-meta,.district-submeta,.district-status){
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.24) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile).called-d[data-cme-projected-tile]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d) 94%, #00111f 6%), color-mix(in srgb, var(--cmep-call-d) 74%, #fff 26%)) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile).called-r[data-cme-projected-tile]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r) 94%, #210000 6%), color-mix(in srgb, var(--cmep-call-r) 74%, #fff 26%)) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile).called-o[data-cme-projected-tile],
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile]:not(.called-d):not(.called-r){
  background:linear-gradient(135deg,#475569,#94a3b8) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .district-submeta{
  display:flex !important;
  align-items:center !important;
  gap:.58rem !important;
  margin-top:.62rem !important;
  min-width:0 !important;
}
body.en-primary-detail .cme-house-tile-glyph{
  flex:0 0 auto !important;
  color:#fff !important;
  font-size:1.45rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
  text-shadow:0 1px 2px rgba(0,0,0,.32) !important;
}
body.en-primary-detail .cme-house-tile-copy{ display:flex !important; flex-direction:column !important; gap:.13rem !important; min-width:0 !important; }
body.en-primary-detail .cme-house-tile-label{
  color:rgba(255,255,255,.80) !important;
  font-size:.66rem !important;
  font-weight:950 !important;
  letter-spacing:.13em !important;
  line-height:1.05 !important;
  text-transform:uppercase !important;
}
body.en-primary-detail .cme-house-tile-name{
  color:#fff !important;
  font-size:.94rem !important;
  font-weight:950 !important;
  line-height:1.13 !important;
}

@media (min-width:1500px){
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .map{ min-height:500px !important; }
  body.en-primary-detail #view-house .district-grid{ grid-template-columns:repeat(auto-fit,minmax(210px,1fr)) !important; }
}
@media (max-width:1040px){
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .grid-2{ grid-template-columns:1fr !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .map{ min-height:390px !important; }
}
@media (max-width:720px){
  body.en-primary-detail .container{ width:min(100% - 22px, 1720px); }
  body.en-primary-detail .state-hero{ border-radius:22px; padding:1rem; }
  body.en-primary-detail .state-name{ font-size:clamp(2rem,13vw,3.25rem); }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card{ border-radius:20px !important; padding:.92rem !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .card-header{ flex-direction:column !important; align-items:stretch !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-refresh-btn{ width:100% !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row{ min-height:3.75rem !important; padding:.66rem .7rem !important; gap:.62rem !important; }
  body.en-primary-detail .cme-state-row-glyph{ font-size:1.45rem !important; }
  body.en-primary-detail .cme-state-row-glyph[data-kind="advance"]{ font-size:1.64rem !important; }
  body.en-primary-detail .ct-left > .cme-state-row-glyph{ font-size:1.22rem !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .left,
  body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row[data-cme-projected] .ct-left{ gap:.52rem !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .map{ min-height:330px !important; }
  body.en-primary-detail #view-house .district-grid{ grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  body.en-primary-detail #view-house :is(.house-district-tile,.district-tile){ min-height:7.8rem !important; padding:.72rem !important; }
}
@media (max-width:430px){
  body.en-primary-detail #view-house .district-grid{ grid-template-columns:1fr !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row{ align-items:flex-start !important; }
  body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-right{ max-width:38%; }
}

/* -------------------------------------------------------------------------
   Targeted polish pass — 2026-06-23
   Fixes: tooltip projection persistence, candidate-copy inner boxes, and
   a more prominent global projection banner.
   ------------------------------------------------------------------------- */

/* The candidate copy should be text only. Older global cohesion rules sometimes
   treated .primary-cand like a nested card, which created a visible box inside
   projected rows. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row :is(.primary-cand,.primary-cand .n,.primary-cand .p),
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] :is(.primary-cand,.primary-cand .n,.primary-cand .p){
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  outline:0 !important;
  border-radius:0 !important;
  padding:0 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row .primary-cand{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-start !important;
  justify-content:center !important;
  gap:.04rem !important;
  min-width:0 !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .primary-cand{
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
}

/* Tooltip projection rows must look called even before/after the JS normalizer
   runs. The renderer now also writes data-cme-projected directly, but these
   class fallbacks cover any late MapLibre redraws. */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.is-advance,.winD,.winR,.advD,.advR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected]{
  border:1px solid rgba(255,255,255,.32) !important;
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
  box-shadow:var(--cmep-call-shadow) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.winD,.advD),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projection-party="D"]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d) 96%, #00111f 4%), color-mix(in srgb, var(--cmep-call-d) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.winR,.advR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projection-party="R"]{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r) 96%, #210000 4%), color-mix(in srgb, var(--cmep-call-r) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.is-advance):not(.winD):not(.advD):not(.winR):not(.advR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected]:not([data-cme-projection-party]){
  background:linear-gradient(135deg,#475569,#94a3b8) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.is-advance,.winD,.winR,.advD,.advR) :is(.ct-name,.ct-party,.p,.ct-pct,.ct-votes),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] :is(.ct-name,.ct-party,.p,.ct-pct,.ct-votes){
  color:#fff !important;
  opacity:1 !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
}

/* Larger, more election-night style projection banner. */
body.en-primary-detail #globalWinnerBanner{
  margin:0 0 clamp(1.05rem,2vw,1.55rem) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner,
body.en-primary-detail .winner-banner{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) !important;
  align-items:center !important;
  gap:clamp(.95rem,1.8vw,1.45rem) !important;
  width:100% !important;
  min-height:clamp(6.6rem,9vw,8.6rem) !important;
  padding:clamp(1.05rem,2vw,1.55rem) clamp(1.15rem,2.3vw,1.85rem) !important;
  border-radius:clamp(22px,2.2vw,30px) !important;
  border:1px solid rgba(255,255,255,.32) !important;
  box-shadow:0 22px 52px rgba(2,6,23,.24), inset 0 1px 0 rgba(255,255,255,.26) !important;
  overflow:hidden !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-icon,
body.en-primary-detail .winner-banner .winner-banner-icon{
  width:clamp(3.35rem,5.6vw,4.85rem) !important;
  height:clamp(3.35rem,5.6vw,4.85rem) !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.20) !important;
  border:1px solid rgba(255,255,255,.38) !important;
  color:#fff !important;
  font-size:clamp(2rem,3.5vw,3rem) !important;
  font-weight:1000 !important;
  line-height:1 !important;
  text-shadow:0 2px 4px rgba(0,0,0,.28) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-label,
body.en-primary-detail .winner-banner .winner-banner-label{
  color:rgba(255,255,255,.84) !important;
  font-size:clamp(.78rem,1vw,.95rem) !important;
  font-weight:1000 !important;
  letter-spacing:.16em !important;
  line-height:1.05 !important;
  text-transform:uppercase !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-name,
body.en-primary-detail .winner-banner .winner-banner-name{
  margin-top:.16rem !important;
  color:#fff !important;
  font-size:clamp(1.75rem,3.4vw,3.15rem) !important;
  line-height:.98 !important;
  font-weight:1000 !important;
  letter-spacing:-.055em !important;
  text-shadow:0 2px 5px rgba(0,0,0,.28) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-sub,
body.en-primary-detail .winner-banner .winner-banner-sub{
  margin-top:.28rem !important;
  color:rgba(255,255,255,.88) !important;
  font-size:clamp(.95rem,1.25vw,1.12rem) !important;
  font-weight:850 !important;
  line-height:1.22 !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner.bannerD,
body.en-primary-detail .winner-banner.bannerD,
body.en-primary-detail #globalWinnerBanner .winner-banner.win-d,
body.en-primary-detail .winner-banner.win-d{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d) 98%, #00111f 2%), color-mix(in srgb, var(--cmep-call-d) 68%, #fff 32%)) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner.bannerR,
body.en-primary-detail .winner-banner.bannerR,
body.en-primary-detail #globalWinnerBanner .winner-banner.win-r,
body.en-primary-detail .winner-banner.win-r{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r) 98%, #210000 2%), color-mix(in srgb, var(--cmep-call-r) 68%, #fff 32%)) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner.bannerN,
body.en-primary-detail .winner-banner.bannerN,
body.en-primary-detail #globalWinnerBanner .winner-banner.win-n,
body.en-primary-detail .winner-banner.win-n,
body.en-primary-detail #globalWinnerBanner .winner-banner.win-mixed,
body.en-primary-detail .winner-banner.win-mixed{
  background:linear-gradient(135deg,#334155,#94a3b8) !important;
}

@media (max-width:720px){
  body.en-primary-detail #globalWinnerBanner .winner-banner,
  body.en-primary-detail .winner-banner{
    grid-template-columns:auto minmax(0,1fr) !important;
    min-height:5.6rem !important;
    padding:.95rem 1rem !important;
    gap:.8rem !important;
  }
  body.en-primary-detail #globalWinnerBanner .winner-banner-name,
  body.en-primary-detail .winner-banner .winner-banner-name{
    font-size:clamp(1.45rem,8vw,2.2rem) !important;
  }
}

/* -------------------------------------------------------------------------
   Projection marker/color polish — 2026-06-23
   - banner uses only the large circular icon
   - result cards/tooltips use the same circular glyph language
   - candidate/party color dots remain visible on projected rows
   ------------------------------------------------------------------------- */

/* Kill legacy banner-name checkmarks from site-cohesion and older detail CSS. */
body.en-primary-detail #globalWinnerBanner .winner-banner-name::before,
body.en-primary-detail .winner-banner .winner-banner-name::before,
body.en-primary-detail #globalWinnerBanner .winner-banner-name::after,
body.en-primary-detail .winner-banner .winner-banner-name::after{
  content:none !important;
  display:none !important;
}

/* Use the same circular projection icon language from the top banner in cards. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .cme-state-row-glyph,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .cme-state-row-glyph{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  width:2.18rem !important;
  min-width:2.18rem !important;
  height:2.18rem !important;
  border-radius:999px !important;
  margin:0 !important;
  color:#fff !important;
  background:linear-gradient(135deg,rgba(255,255,255,.28),rgba(255,255,255,.12)) !important;
  border:1px solid rgba(255,255,255,.46) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.32), 0 8px 18px rgba(2,6,23,.22) !important;
  font-size:1.62rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
  letter-spacing:-.06em !important;
  text-shadow:0 2px 4px rgba(0,0,0,.34) !important;
  transform:none !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .cme-state-row-glyph[data-kind="advance"],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .cme-state-row-glyph[data-kind="advance"]{
  font-size:1.7rem !important;
  letter-spacing:-.02em !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .cme-state-row-glyph{
  width:1.82rem !important;
  min-width:1.82rem !important;
  height:1.82rem !important;
  font-size:1.32rem !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.30), 0 5px 12px rgba(2,6,23,.20) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .cme-state-row-glyph[data-kind="advance"]{
  font-size:1.42rem !important;
}

/* Keep candidate/party color visible on called rows. Earlier cleanup hid the dot
   because the projection row itself carries the party color. The ring gives the
   actual candidate color enough contrast even on a same-party gradient. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .primary-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .ct-dot{
  display:inline-flex !important;
  flex:0 0 auto !important;
  width:.92rem !important;
  min-width:.92rem !important;
  height:.92rem !important;
  border-radius:999px !important;
  border:2px solid rgba(255,255,255,.92) !important;
  box-shadow:0 0 0 1px rgba(15,23,42,.22), 0 2px 8px rgba(2,6,23,.22) !important;
  opacity:1 !important;
  margin:0 .02rem 0 0 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .ct-dot{
  width:.74rem !important;
  min-width:.74rem !important;
  height:.74rem !important;
  border-width:1.8px !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .left,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .ct-left{
  gap:.58rem !important;
}

/* Party copy remains readable over the projection gradient without becoming a box. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected] .primary-cand .p,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] :is(.ct-party,.p){
  color:rgba(255,255,255,.93) !important;
  text-shadow:0 1px 2px rgba(0,0,0,.30) !important;
  font-weight:900 !important;
}

/* -------------------------------------------------------------------------
   Winner/advancer color model + House card projection polish — 2026-06-23
   -------------------------------------------------------------------------
   Winners: the row itself carries the projection/party color, so the candidate
   dot is redundant and visually muddy. Advancers: neutral projection treatment
   keeps the candidate color meaningful and visible.
*/

/* Winner rows: no redundant candidate color dot. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected="winner"] .primary-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="winner"] .ct-dot{
  display:none !important;
}

/* Advancer rows: neutral projection color, candidate dot preserved. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected="advance"],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="advance"]{
  background:
    linear-gradient(135deg, rgba(71,85,105,.98), rgba(148,163,184,.92)) !important;
  border-color:rgba(255,255,255,.34) !important;
  box-shadow:0 10px 24px rgba(2,6,23,.20), inset 0 1px 0 rgba(255,255,255,.20) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected="advance"] .primary-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="advance"] .ct-dot{
  display:inline-flex !important;
  opacity:1 !important;
}

/* House cards: same visual grammar. Winner tiles use party color; advancer tiles
   use neutral projection color. Once a winner is projected, reporting % is not
   the story and is suppressed. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"]{
  background:linear-gradient(135deg, rgba(71,85,105,.98), rgba(148,163,184,.92)) !important;
  border-color:rgba(255,255,255,.34) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="winner"] .district-meta{
  display:none !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .district-submeta{
  align-items:center !important;
  gap:.7rem !important;
  margin-top:.7rem !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .cme-house-tile-glyph{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:2.06rem !important;
  min-width:2.06rem !important;
  height:2.06rem !important;
  border-radius:999px !important;
  background:linear-gradient(135deg,rgba(255,255,255,.28),rgba(255,255,255,.12)) !important;
  border:1px solid rgba(255,255,255,.46) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.32), 0 8px 18px rgba(2,6,23,.22) !important;
  font-size:1.42rem !important;
  line-height:1 !important;
  text-shadow:0 2px 4px rgba(0,0,0,.34) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-glyph{
  font-size:1.56rem !important;
}
body.en-primary-detail #view-house .cme-house-tile-label{
  display:none !important;
}
body.en-primary-detail #view-house .cme-house-tile-name{
  color:#fff !important;
  font-size:clamp(1.16rem,1.25vw,1.42rem) !important;
  font-weight:1000 !important;
  line-height:1.04 !important;
  letter-spacing:-.035em !important;
  text-shadow:0 2px 4px rgba(0,0,0,.28) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .district-status.is-projected{
  background:rgba(255,255,255,.18) !important;
  border:1px solid rgba(255,255,255,.30) !important;
  color:rgba(255,255,255,.94) !important;
  box-shadow:none !important;
}

@media (max-width:720px){
  body.en-primary-detail #view-house .cme-house-tile-name{
    font-size:1.12rem !important;
  }
  body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .cme-house-tile-glyph{
    width:1.86rem !important;
    min-width:1.86rem !important;
    height:1.86rem !important;
    font-size:1.3rem !important;
  }
}

/* Class fallback for freshly rendered tooltip/result rows before the normalizer annotates data attributes. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row:is(.is-winner,.winD,.winR) .primary-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.winD,.winR) .ct-dot{
  display:none !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row:is(.is-advance,.advD,.advR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-advance,.advD,.advR){
  background:linear-gradient(135deg, rgba(71,85,105,.98), rgba(148,163,184,.92)) !important;
  border-color:rgba(255,255,255,.34) !important;
}
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row:is(.is-advance,.advD,.advR) .primary-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-advance,.advD,.advR) .ct-dot{
  display:inline-flex !important;
  opacity:1 !important;
}

/* -------------------------------------------------------------------------
   Locked tooltip + advancer clarity polish — 2026-06-23
   ------------------------------------------------------------------------- */

/* Advancers are intentionally neutral. Legacy advD/advR classes or a stale
   projection-party data attribute must never reintroduce a party-colored fill. */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row[data-cme-projected="advance"],
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse) .primary-row:is(.is-advance,.advD,.advR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="advance"],
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-advance,.advD,.advR){
  background:linear-gradient(135deg, rgba(55,65,81,.98), rgba(148,163,184,.94)) !important;
  border-color:rgba(255,255,255,.36) !important;
  box-shadow:0 10px 24px rgba(2,6,23,.20), inset 0 1px 0 rgba(255,255,255,.22) !important;
}

body.en-primary-detail .cme-row-projection-label{
  display:block !important;
  margin-top:.16rem !important;
  color:rgba(255,255,255,.88) !important;
  font-size:.76rem !important;
  font-weight:1000 !important;
  line-height:1.05 !important;
  text-transform:uppercase !important;
  letter-spacing:.08em !important;
  text-shadow:0 1px 2px rgba(0,0,0,.32) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .cme-row-projection-label{
  margin-top:.12rem !important;
  font-size:.62rem !important;
  letter-spacing:.075em !important;
}

/* Banner advancers should read as separate advancing candidates, not as a
   slash/ampersand list. */
body.en-primary-detail #globalWinnerBanner .winner-banner-name--advancers,
body.en-primary-detail .winner-banner .winner-banner-name--advancers{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:.72rem !important;
  align-items:stretch !important;
  margin-top:.15rem !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-advancer,
body.en-primary-detail .winner-banner .winner-banner-advancer{
  display:flex !important;
  flex-direction:column !important;
  gap:.06rem !important;
  min-width:min(15rem, 100%) !important;
  padding:.18rem .35rem .2rem !important;
  border-radius:14px !important;
  background:rgba(255,255,255,.13) !important;
  border:1px solid rgba(255,255,255,.20) !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-advancer-action,
body.en-primary-detail .winner-banner .winner-banner-advancer-action{
  color:rgba(255,255,255,.86) !important;
  font-size:clamp(.72rem,.85vw,.86rem) !important;
  font-weight:1000 !important;
  line-height:1 !important;
  letter-spacing:.10em !important;
  text-transform:uppercase !important;
}
body.en-primary-detail #globalWinnerBanner .winner-banner-advancer-name,
body.en-primary-detail .winner-banner .winner-banner-advancer-name{
  color:#fff !important;
  font-size:clamp(1.55rem,2.35vw,2.85rem) !important;
  font-weight:1000 !important;
  line-height:.98 !important;
  letter-spacing:-.055em !important;
  text-shadow:0 2px 4px rgba(0,0,0,.26) !important;
}

@media (max-width:720px){
  body.en-primary-detail #globalWinnerBanner .winner-banner-name--advancers,
  body.en-primary-detail .winner-banner .winner-banner-name--advancers{
    gap:.45rem !important;
  }
  body.en-primary-detail #globalWinnerBanner .winner-banner-advancer,
  body.en-primary-detail .winner-banner .winner-banner-advancer{
    width:100% !important;
  }
}

/* -------------------------------------------------------------------------
   Final tooltip-lock, tooltip-dot, and House advancer card polish — 2026-06-23
   ------------------------------------------------------------------------- */

/* Tooltips always show candidate color dots, including projected winners. */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row .ct-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="winner"] .ct-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.winD,.winR) .ct-dot{
  display:inline-flex !important;
  opacity:1 !important;
  visibility:visible !important;
  width:.82rem !important;
  min-width:.82rem !important;
  height:.82rem !important;
  border:2px solid rgba(255,255,255,.88) !important;
  box-shadow:0 0 0 1px rgba(15,23,42,.32), 0 2px 7px rgba(0,0,0,.28) !important;
}

/* Completed House advancer tiles: same-party advancers get the party color;
   mixed-party advancers stay neutral gray. Partial/awaiting tiles are not filled. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"].called-d{
  background:linear-gradient(135deg, rgba(0,118,186,.98), rgba(125,211,252,.90)) !important;
  border-color:rgba(186,230,253,.76) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"].called-r{
  background:linear-gradient(135deg, rgba(238,34,12,.98), rgba(248,113,113,.88)) !important;
  border-color:rgba(254,202,202,.70) !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"].called-o,
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"]:not(.called-d):not(.called-r){
  background:linear-gradient(135deg, rgba(55,65,81,.98), rgba(148,163,184,.92)) !important;
  border-color:rgba(255,255,255,.34) !important;
}

/* Hide reporting entirely once a complete House projection has been made. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .district-meta[aria-hidden="true"],
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile] .district-meta:empty{
  display:none !important;
}

/* House advancer card content: show an explicit advancing label and separate names. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .district-submeta{
  align-items:flex-start !important;
  gap:.7rem !important;
  margin-top:.58rem !important;
}
body.en-primary-detail #view-house .cme-house-tile-name-list{
  display:flex !important;
  flex-direction:column !important;
  gap:.12rem !important;
  min-width:0 !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-label{
  display:block !important;
  margin-bottom:.08rem !important;
  color:rgba(255,255,255,.82) !important;
  font-size:.72rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
  letter-spacing:.11em !important;
  text-transform:uppercase !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name{
  display:block !important;
  color:#fff !important;
  font-size:clamp(1.05rem, 1.7vw, 1.38rem) !important;
  font-weight:1000 !important;
  line-height:1.02 !important;
  letter-spacing:-.04em !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="winner"] .cme-house-tile-label{
  display:none !important;
}

@media (max-width:720px){
  body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name{
    font-size:1.12rem !important;
  }
}

/* -------------------------------------------------------------------------
   Light-mode segmented menu readability polish — 2026-06-23
   -------------------------------------------------------------------------
   The global election-night button stack can leave segmented controls with
   white text on light/white button fills. Keep this state-detail page's
   party, office, and analytics-map menus readable in explicit light mode,
   system light mode, and dark mode.
*/

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented){
  display:flex !important;
  flex-wrap:wrap !important;
  gap:.28rem !important;
  padding:.28rem !important;
  border:1px solid rgba(148,163,184,.34) !important;
  background:rgba(248,250,252,.86) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.82), 0 8px 22px rgba(15,23,42,.07) !important;
}

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn{
  min-height:2.35rem !important;
  padding:.58rem .95rem !important;
  border:1px solid transparent !important;
  border-radius:999px !important;
  background:transparent !important;
  color:#334155 !important;
  font-weight:950 !important;
  letter-spacing:-.012em !important;
  text-shadow:none !important;
  box-shadow:none !important;
  opacity:1 !important;
}

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:hover:not(:disabled){
  background:rgba(226,232,240,.74) !important;
  border-color:rgba(148,163,184,.38) !important;
  color:#0f172a !important;
}

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]){
  background:#0f172a !important;
  border-color:#0f172a !important;
  color:#ffffff !important;
  box-shadow:0 10px 24px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:disabled{
  color:#94a3b8 !important;
  background:transparent !important;
  border-color:transparent !important;
  opacity:.7 !important;
  cursor:not-allowed !important;
}

body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:focus-visible{
  outline:3px solid rgba(14,165,233,.38) !important;
  outline-offset:2px !important;
}

/* Dark mode: keep inactive buttons muted but readable, and active buttons bright. */
@media (prefers-color-scheme:dark){
  body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
  body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented){
    background:rgba(15,23,42,.76) !important;
    border-color:rgba(148,163,184,.24) !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 10px 26px rgba(0,0,0,.24) !important;
  }
  body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn{
    color:#cbd5e1 !important;
    background:transparent !important;
  }
  body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:hover:not(:disabled){
    background:rgba(51,65,85,.72) !important;
    border-color:rgba(148,163,184,.24) !important;
    color:#f8fafc !important;
  }
  body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]){
    background:#f8fafc !important;
    border-color:rgba(255,255,255,.86) !important;
    color:#0f172a !important;
    box-shadow:0 12px 28px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.92) !important;
  }
}

html[data-theme="dark"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
html.dark body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
body.en-primary-detail.dark-mode :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
body.en-primary-detail.theme-dark :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
html[data-theme="dark"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented),
html.dark body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented),
body.en-primary-detail.dark-mode :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented),
body.en-primary-detail.theme-dark :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented){
  background:rgba(15,23,42,.76) !important;
  border-color:rgba(148,163,184,.24) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 10px 26px rgba(0,0,0,.24) !important;
}

html[data-theme="dark"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn,
html.dark body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn,
body.en-primary-detail.dark-mode :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn,
body.en-primary-detail.theme-dark :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn{
  color:#cbd5e1 !important;
  background:transparent !important;
}

html[data-theme="dark"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]),
html.dark body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]),
body.en-primary-detail.dark-mode :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]),
body.en-primary-detail.theme-dark :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]){
  background:#f8fafc !important;
  border-color:rgba(255,255,255,.86) !important;
  color:#0f172a !important;
  box-shadow:0 12px 28px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.92) !important;
}

/* Explicit light mode wins over system dark when the app sets data-theme="light". */
html[data-theme="light"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented).segmented,
html[data-theme="light"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented){
  background:rgba(248,250,252,.86) !important;
  border-color:rgba(148,163,184,.34) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.82), 0 8px 22px rgba(15,23,42,.07) !important;
}
html[data-theme="light"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn{
  color:#334155 !important;
  background:transparent !important;
}
html[data-theme="light"] body.en-primary-detail :is(#primaryPartyToggle,#officeToggle,[id^="analysisMapToggle"],.map-tab-row .segmented) .seg-btn:is(.active,[aria-selected="true"]){
  background:#0f172a !important;
  border-color:#0f172a !important;
  color:#ffffff !important;
  box-shadow:0 10px 24px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.14) !important;
}

/* Tooltip light-mode text repair: county title and summary chips were inheriting white
   text from older tooltip layers. Keep candidate projected rows white, but keep tooltip
   chrome/readout text dark on the light panel. */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title){
  color:#0f172a !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-head,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-title{
  font-weight:1000 !important;
  letter-spacing:-.035em !important;
  line-height:1.05 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *{
  color:#0f172a !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip{
  color:#0f172a !important;
  background:rgba(248,250,252,.94) !important;
  border-color:rgba(100,116,139,.36) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78), 0 1px 2px rgba(15,23,42,.06) !important;
  text-shadow:none !important;
}

/* Preserve proper contrast when the page is explicitly dark. */
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title){
  color:#f8fafc !important;
  text-shadow:none !important;
}
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *,
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *,
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *,
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *{
  color:#f8fafc !important;
  text-shadow:none !important;
}
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip,
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip,
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip,
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip{
  color:#f8fafc !important;
  background:rgba(15,23,42,.82) !important;
  border-color:rgba(148,163,184,.28) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.18) !important;
}

/* Explicit app light mode wins over OS-level dark media queries. */
html[data-theme="light"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
html[data-theme="light"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary,
html[data-theme="light"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-summary *{
  color:#0f172a !important;
  text-shadow:none !important;
}
html[data-theme="light"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-chip{
  color:#0f172a !important;
  background:rgba(248,250,252,.94) !important;
  border-color:rgba(100,116,139,.36) !important;
}


/* -------------------------------------------------------------------------
   Tooltip chip/readability and non-projected-row reset — 2026-06-23
   -------------------------------------------------------------------------

   The tooltip summary chips are not projection content. In light mode they must
   stay dark-on-light even if older tooltip rules, OS dark media queries, or
   popup-level color inheritance try to make tooltip text white.

   Also, advD/advR are treated as legacy party hints only. A tooltip candidate
   row should only receive the gray advancer background when the renderer/cleaner
   explicitly marks it with data-cme-projected="advance" or .is-advance.
*/
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta){
  color:#0f172a !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) :is(.ct-chip,span,div){
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) .ct-chip{
  display:inline-flex !important;
  align-items:center !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  background:#f8fafc !important;
  border:1px solid rgba(100,116,139,.42) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.86), 0 1px 2px rgba(15,23,42,.08) !important;
  text-shadow:none !important;
}

/* Neutral/default tooltip candidate rows. No gray projection fill unless the row
   is explicitly projected. */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:not([data-cme-projected]):not(.is-winner):not(.is-advance):not(.winD):not(.winR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.advD,.advR):not([data-cme-projected]):not(.is-advance){
  background:transparent !important;
  background-image:none !important;
  border-color:transparent !important;
  box-shadow:none !important;
  color:var(--cmep-strong,#0f172a) !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:not([data-cme-projected]):not(.is-winner):not(.is-advance):not(.winD):not(.winR) :is(.ct-name,.ct-pct),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.advD,.advR):not([data-cme-projected]):not(.is-advance) :is(.ct-name,.ct-pct){
  color:var(--cmep-strong,#0f172a) !important;
  -webkit-text-fill-color:var(--cmep-strong,#0f172a) !important;
  text-shadow:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:not([data-cme-projected]):not(.is-winner):not(.is-advance):not(.winD):not(.winR) :is(.ct-party,.p,.ct-votes),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.advD,.advR):not([data-cme-projected]):not(.is-advance) :is(.ct-party,.p,.ct-votes){
  color:var(--cmep-muted,#64748b) !important;
  -webkit-text-fill-color:var(--cmep-muted,#64748b) !important;
  text-shadow:none !important;
}

/* In explicit dark mode, keep chips readable on the dark tooltip shell. */
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta),
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta),
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta),
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta){
  color:#f8fafc !important;
}
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) :is(.ct-chip,span,div),
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) :is(.ct-chip,span,div),
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) :is(.ct-chip,span,div),
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) :is(.ct-chip,span,div){
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
}
html[data-theme="dark"] body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) .ct-chip,
html.dark body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) .ct-chip,
body.en-primary-detail.dark-mode :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) .ct-chip,
body.en-primary-detail.theme-dark :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-summary,.ct-meta) .ct-chip{
  background:rgba(15,23,42,.82) !important;
  border-color:rgba(148,163,184,.32) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.18) !important;
}

/* -------------------------------------------------------------------------
   Tooltip dark-mode county title repair — 2026-06-23
   -------------------------------------------------------------------------

   The light-mode tooltip repair intentionally forces county titles dark for
   light panels. On systems using OS-level dark mode rather than an explicit
   html[data-theme="dark"] flag, that selector can win and leave the county
   title black on a dark tooltip. Restore dark-mode title/chrome contrast here
   while preserving explicit app light mode.
*/
@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]):not(.light) body.en-primary-detail:not(.light):not(.light-mode):not(.theme-light) :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title){
    color:#f8fafc !important;
    -webkit-text-fill-color:#f8fafc !important;
    text-shadow:none !important;
  }

  html:not([data-theme="light"]):not(.light) body.en-primary-detail:not(.light):not(.light-mode):not(.theme-light) :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-title *{
    color:#f8fafc !important;
    -webkit-text-fill-color:#f8fafc !important;
    text-shadow:none !important;
  }
}

/* Also support body-level dark classes used by older site layers. */
body.dark-mode.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
body.theme-dark.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title),
body.dark.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-top,.ct-head,.ct-title){
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  text-shadow:none !important;
}

/* -------------------------------------------------------------------------
   Tooltip candidate-dot shape fix — 2026-06-23
   -------------------------------------------------------------------------
   Some older tooltip styles can leave ordinary, non-projected candidate color
   markers with square corners. Force every tooltip color marker to render as a
   true circular swatch, regardless of projection state or inherited button/card
   styling.
*/
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row .ct-dot{
  display:inline-block !important;
  flex:0 0 auto !important;
  width:.82rem !important;
  min-width:.82rem !important;
  max-width:.82rem !important;
  height:.82rem !important;
  min-height:.82rem !important;
  max-height:.82rem !important;
  aspect-ratio:1 / 1 !important;
  padding:0 !important;
  margin:0 .02rem 0 0 !important;
  border-radius:50% !important;
  overflow:hidden !important;
  background-clip:padding-box !important;
  transform:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row .ct-dot::before,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row .ct-dot::after{
  content:none !important;
  display:none !important;
}

/* -------------------------------------------------------------------------
   Tooltip winner-dot suppression — 2026-06-23
   -------------------------------------------------------------------------
   Tooltip color dots should remain visible for ordinary candidates and projected
   advancers. For projected winners, the row already carries the party/call color,
   so the dot is redundant and is hidden after the global dot-shape fix.
*/
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="winner"] .ct-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.is-winner .ct-dot{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected="advance"] .ct-dot,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.is-advance .ct-dot{
  display:inline-block !important;
  visibility:visible !important;
  opacity:1 !important;
}

/* ======================================================================
   Reset-view button placement lock — 2026-06-23
   Keep Reset View as a compact overlay button in the map's top-left corner.
   ====================================================================== */
body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) :is(.map,.state-analytics-map,.map-wrap,.primary-map-wrap){
  position:relative !important;
}
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) :is(.map,.state-analytics-map) > .reset-view-btn,
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .reset-view-btn{
  position:absolute !important;
  left:.85rem !important;
  right:auto !important;
  top:.85rem !important;
  bottom:auto !important;
  z-index:30 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:0 !important;
  max-width:max-content !important;
  inline-size:auto !important;
  min-inline-size:0 !important;
  max-inline-size:max-content !important;
  align-self:flex-start !important;
  justify-self:flex-start !important;
  flex:0 0 auto !important;
  white-space:nowrap !important;
  padding:.5rem .8rem !important;
  margin:0 !important;
  border-radius:999px !important;
  line-height:1 !important;
  text-align:center !important;
}
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .reset-view-btn.show{
  transform:translateY(0) scale(1) !important;
}
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .reset-view-btn:not(.show){
  transform:translateY(-2px) scale(.98) !important;
}

/* ======================================================================
   State hero light-mode treatment — 2026-06-23
   Light mode gets a bright civic-card header with dark text. Dark/night mode
   intentionally preserves the existing dark hero treatment.
   ====================================================================== */
html:not([data-theme="dark"]) body.en-primary-detail .state-hero{
  background:
    radial-gradient(circle at 86% 18%, rgba(148,163,184,.18), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.94) 58%, rgba(241,245,249,.98)) !important;
  border:1px solid rgba(203,213,225,.84) !important;
  box-shadow:0 18px 42px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.92) !important;
  color:#0f172a !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero::before,
html:not([data-theme="dark"]) body.en-primary-detail .state-hero::after{
  opacity:.42 !important;
  mix-blend-mode:multiply !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero :is(.state-prefix,.state-name,.state-subtitle,#pageTitle,#pageSub){
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  text-shadow:none !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero .state-prefix{
  color:#475569 !important;
  -webkit-text-fill-color:#475569 !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero .state-subtitle,
html:not([data-theme="dark"]) body.en-primary-detail .state-hero #pageSub{
  color:#475569 !important;
  -webkit-text-fill-color:#475569 !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-outline-wrap{
  opacity:.38 !important;
  filter:none !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-outline-fill{
  fill:rgba(15,23,42,.045) !important;
}
html:not([data-theme="dark"]) body.en-primary-detail #stateOutlineStrokeGroup,
html:not([data-theme="dark"]) body.en-primary-detail #stateOutlineGlowGroup{
  color:#334155 !important;
  opacity:.52 !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero :is(.back-btn,#votingBtn,.primary-refresh-btn){
  background:rgba(255,255,255,.76) !important;
  border:1px solid rgba(148,163,184,.42) !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  box-shadow:0 8px 20px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.9) !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero :is(.back-btn,#votingBtn,.primary-refresh-btn):hover{
  background:#f8fafc !important;
  border-color:rgba(100,116,139,.48) !important;
  color:#020617 !important;
  -webkit-text-fill-color:#020617 !important;
}

@media (prefers-color-scheme: dark){
  html:not([data-theme="light"]) body.en-primary-detail .state-hero{
    background:inherit !important;
    color:inherit !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero :is(.state-prefix,.state-name,.state-subtitle,#pageTitle,#pageSub){
    color:inherit !important;
    -webkit-text-fill-color:currentColor !important;
  }
}

/* ======================================================================
   State hero outline contrast polish — 2026-06-23
   Light mode: stronger state silhouette. Dark mode: lighter silhouette and
   no accidental light-mode border/outline bleed.
   ====================================================================== */
html:not([data-theme="dark"]) body.en-primary-detail .state-hero .state-outline-wrap{
  opacity:.56 !important;
  filter:none !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero .state-outline-fill{
  fill:rgba(15,23,42,.095) !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup){
  color:#1e293b !important;
  opacity:.72 !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke]{
  stroke:color-mix(in srgb, #1e293b 78%, transparent) !important;
}

html[data-theme="dark"] body.en-primary-detail .state-hero,
body.dark.en-primary-detail .state-hero,
body.dark-mode.en-primary-detail .state-hero,
body.theme-dark.en-primary-detail .state-hero{
  border-color:rgba(255,255,255,.10) !important;
  outline:0 !important;
  box-shadow:0 22px 48px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.07) !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero::before,
html[data-theme="dark"] body.en-primary-detail .state-hero::after,
body.dark.en-primary-detail .state-hero::before,
body.dark.en-primary-detail .state-hero::after,
body.dark-mode.en-primary-detail .state-hero::before,
body.dark-mode.en-primary-detail .state-hero::after,
body.theme-dark.en-primary-detail .state-hero::before,
body.theme-dark.en-primary-detail .state-hero::after{
  mix-blend-mode:screen !important;
  opacity:.26 !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero .state-outline-wrap,
body.dark.en-primary-detail .state-hero .state-outline-wrap,
body.dark-mode.en-primary-detail .state-hero .state-outline-wrap,
body.theme-dark.en-primary-detail .state-hero .state-outline-wrap{
  opacity:.64 !important;
  filter:none !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero .state-outline-fill,
body.dark.en-primary-detail .state-hero .state-outline-fill,
body.dark-mode.en-primary-detail .state-hero .state-outline-fill,
body.theme-dark.en-primary-detail .state-hero .state-outline-fill{
  fill:rgba(255,255,255,.075) !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup),
body.dark.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup),
body.dark-mode.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup),
body.theme-dark.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup){
  color:#e2e8f0 !important;
  opacity:.58 !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke],
body.dark.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke],
body.dark-mode.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke],
body.theme-dark.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke]{
  stroke:color-mix(in srgb, #e2e8f0 70%, transparent) !important;
}

@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail .state-hero{
    border-color:rgba(255,255,255,.10) !important;
    outline:0 !important;
    box-shadow:0 22px 48px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero::before,
  html:not([data-theme="light"]) body.en-primary-detail .state-hero::after{
    mix-blend-mode:screen !important;
    opacity:.26 !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero .state-outline-wrap{
    opacity:.64 !important;
    filter:none !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero .state-outline-fill{
    fill:rgba(255,255,255,.075) !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero :is(#stateOutlineStrokeGroup,#stateOutlineGlowGroup){
    color:#e2e8f0 !important;
    opacity:.58 !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero svg :is(path,polygon,polyline)[stroke]{
    stroke:color-mix(in srgb, #e2e8f0 70%, transparent) !important;
  }
}

/* ======================================================================
   State hero shell cleanup — 2026-06-23
   Remove the redundant page-head card shell so the state header reads as
   one clean hero surface instead of a card nested inside another card.
   ====================================================================== */
body.en-primary-detail .page-head{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  outline:0 !important;
  padding:0 !important;
  overflow:visible !important;
  border-radius:0 !important;
  margin:clamp(.55rem,1.25vw,1rem) 0 clamp(1rem,1.85vw,1.45rem) !important;
}
body.en-primary-detail .page-head::before,
body.en-primary-detail .page-head::after{
  content:none !important;
  display:none !important;
}
body.en-primary-detail .page-head > .state-hero{
  margin:0 !important;
  width:100% !important;
  max-width:100% !important;
}
html:not([data-theme="dark"]) body.en-primary-detail .page-head{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
html[data-theme="dark"] body.en-primary-detail .page-head,
body.dark.en-primary-detail .page-head,
body.dark-mode.en-primary-detail .page-head,
body.theme-dark.en-primary-detail .page-head{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  outline:0 !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail .page-head{
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    outline:0 !important;
  }
}
@media (max-width:760px){
  body.en-primary-detail .page-head{
    margin-top:.4rem !important;
    margin-bottom:.8rem !important;
  }
  body.en-primary-detail .page-head > .state-hero{
    border-radius:20px !important;
  }
}


/* ======================================================================
   Results-card polish — 2026-06-23
   Lock in the hero/map work, then remove the legacy blue top flair from
   results cards and restore readable light-mode numbers on ordinary rows.
   ====================================================================== */
html body.en-primary-detail :is(.cmep-results-mount,#resultsMount,#resultsMountSenate) :is(.primary-race,.race-result-card,.no-election-result-card)::before,
html body.en-primary-detail :is(.cmep-results-mount,#resultsMount,#resultsMountSenate) :is(.primary-race,.race-result-card,.no-election-result-card)::after{
  content:none !important;
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  background:none !important;
  border:0 !important;
  box-shadow:none !important;
}
html body.en-primary-detail :is(.cmep-results-mount,#resultsMount,#resultsMountSenate) :is(.primary-race,.race-result-card,.no-election-result-card){
  border-top-color:var(--cmep-line) !important;
}
html:not([data-theme="dark"]) body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes){
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  opacity:1 !important;
  text-shadow:none !important;
}
html:not([data-theme="dark"]) body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes{
  color:#475569 !important;
  -webkit-text-fill-color:#475569 !important;
}
html:not([data-theme="dark"]) body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .pct{
  font-weight:950 !important;
}

/* ======================================================================
   Results-card dark-mode number restore — 2026-06-23
   Keep the light-mode readability fix from forcing dark text when the site
   is in OS/browser dark mode without an explicit data-theme attribute.
   ====================================================================== */
html[data-theme="dark"] body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes),
body.dark.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes),
body.dark-mode.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes),
body.theme-dark.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes){
  color:#e5e7eb !important;
  -webkit-text-fill-color:#e5e7eb !important;
  opacity:1 !important;
  text-shadow:none !important;
}
html[data-theme="dark"] body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes,
body.dark.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes,
body.dark-mode.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes,
body.theme-dark.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes{
  color:#cbd5e1 !important;
  -webkit-text-fill-color:#cbd5e1 !important;
}

@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) :is(.primary-right,.pct,.votes){
    color:#e5e7eb !important;
    -webkit-text-fill-color:#e5e7eb !important;
    opacity:1 !important;
    text-shadow:none !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate) .primary-row:not([data-cme-projected]) .votes{
    color:#cbd5e1 !important;
    -webkit-text-fill-color:#cbd5e1 !important;
  }
}

/* ======================================================================
   County-card polish — 2026-06-23
   Keep the locked maps/tooltips/results styling, then remove the legacy
   top accent flare from county result cards and place View all beside the
   county title instead of floating as a separate header control.
   ====================================================================== */
html body.en-primary-detail :is(#countyListCard,#countyListCardSenate,#countyListMount .primary-race,#countyListMountSenate .primary-race)::before,
html body.en-primary-detail :is(#countyListCard,#countyListCardSenate,#countyListMount .primary-race,#countyListMountSenate .primary-race)::after{
  content:none !important;
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  width:0 !important;
  background:none !important;
  border:0 !important;
  box-shadow:none !important;
  opacity:0 !important;
}
html body.en-primary-detail :is(#countyListCard,#countyListCardSenate,#countyListMount .primary-race,#countyListMountSenate .primary-race){
  border-top-color:var(--cmep-line) !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-race > .primary-head{
  display:block !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-race > .primary-head > div:first-child{
  width:100% !important;
  min-width:0 !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  min-width:0 !important;
  width:100% !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row .name{
  flex:1 1 auto !important;
  min-width:0 !important;
  margin:0 !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn{
  flex:0 0 auto !important;
  margin-left:auto !important;
  align-self:center !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  max-width:max-content !important;
  white-space:nowrap !important;
  border-radius:999px !important;
  padding:.42rem .72rem !important;
  min-height:2rem !important;
  font-size:.78rem !important;
  font-weight:950 !important;
  letter-spacing:-.01em !important;
  background:color-mix(in srgb, var(--cmep-panel) 88%, var(--cmep-strong) 4%) !important;
  color:var(--cmep-strong) !important;
  -webkit-text-fill-color:var(--cmep-strong) !important;
  border:1px solid var(--cmep-line) !important;
  box-shadow:none !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn:hover{
  transform:translateY(-1px) !important;
  border-color:color-mix(in srgb, var(--cmep-line) 72%, var(--cmep-strong) 28%) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn{
    background:rgba(15,23,42,.58) !important;
    color:#e5e7eb !important;
    -webkit-text-fill-color:#e5e7eb !important;
    border-color:rgba(148,163,184,.34) !important;
  }
}
html[data-theme="dark"] body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn,
body.dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn,
body.dark-mode.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn,
body.theme-dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn{
  background:rgba(15,23,42,.58) !important;
  color:#e5e7eb !important;
  -webkit-text-fill-color:#e5e7eb !important;
  border-color:rgba(148,163,184,.34) !important;
}
@media (max-width:560px){
  html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row{
    align-items:flex-start !important;
    gap:.55rem !important;
  }
  html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-viewall-btn{
    padding:.38rem .62rem !important;
    font-size:.74rem !important;
  }
}


/* ======================================================================
   County list preview polish — 2026-06-24
   Collapsed county lists should show one complete row, tease the next row
   with a fade, and place the global View all counties control over the
   fade. On mobile, this resolves to one full county card plus a fading
   second card. This does not change map/tooltips/results styling.
   ====================================================================== */
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate){
  position:relative !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded){
  position:relative !important;
  overflow:hidden !important;
  max-height:clamp(355px, 35vw, 500px) !important;
  padding-bottom:5.75rem !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after{
  content:"" !important;
  position:absolute !important;
  left:0 !important;
  right:0 !important;
  bottom:0 !important;
  height:48% !important;
  pointer-events:none !important;
  z-index:4 !important;
  background:linear-gradient(
    to bottom,
    color-mix(in srgb, var(--cmep-panel) 0%, transparent) 0%,
    color-mix(in srgb, var(--cmep-panel) 78%, transparent) 52%,
    var(--cmep-panel) 100%
  ) !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed.is-expanded{
  max-height:none !important;
  overflow:visible !important;
  padding-bottom:0 !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed.is-expanded::after{
  content:none !important;
  display:none !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn{
  position:relative !important;
  z-index:6 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:min(18rem, calc(100% - 2rem)) !important;
  max-width:calc(100% - 2rem) !important;
  margin:-4.65rem auto 1.1rem !important;
  padding:.86rem 1.18rem !important;
  border-radius:999px !important;
  border:1px solid color-mix(in srgb, var(--cmep-line) 70%, var(--cmep-strong) 15%) !important;
  background:color-mix(in srgb, var(--cmep-panel) 94%, #fff 6%) !important;
  color:var(--cmep-strong) !important;
  -webkit-text-fill-color:var(--cmep-strong) !important;
  font-size:.92rem !important;
  font-weight:950 !important;
  letter-spacing:-.015em !important;
  box-shadow:0 18px 42px color-mix(in srgb, var(--cmep-shadow) 78%, transparent) !important;
  cursor:pointer !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn:hover{
  transform:translateY(-1px) !important;
  border-color:color-mix(in srgb, var(--cmep-line) 52%, var(--cmep-strong) 32%) !important;
  box-shadow:0 22px 50px color-mix(in srgb, var(--cmep-shadow) 90%, transparent) !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed.is-expanded + .county-expand-btn{
  margin:1rem auto 0 !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after{
    background:linear-gradient(
      to bottom,
      rgba(15,23,42,0) 0%,
      rgba(15,23,42,.76) 52%,
      rgba(15,23,42,.98) 100%
    ) !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn{
    background:#111827 !important;
    color:#f8fafc !important;
    -webkit-text-fill-color:#f8fafc !important;
    border-color:rgba(148,163,184,.34) !important;
    box-shadow:0 20px 48px rgba(0,0,0,.36) !important;
  }
}
html[data-theme="dark"] body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after,
body.dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after,
body.dark-mode.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after,
body.theme-dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after{
  background:linear-gradient(
    to bottom,
    rgba(15,23,42,0) 0%,
    rgba(15,23,42,.76) 52%,
    rgba(15,23,42,.98) 100%
  ) !important;
}
html[data-theme="dark"] body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn,
body.dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn,
body.dark-mode.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn,
body.theme-dark.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn{
  background:#111827 !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  border-color:rgba(148,163,184,.34) !important;
  box-shadow:0 20px 48px rgba(0,0,0,.36) !important;
}
@media (max-width:700px){
  html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded){
    max-height:430px !important;
    padding-bottom:5.8rem !important;
  }
  html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded)::after{
    height:50% !important;
  }
  html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn{
    min-width:calc(100% - 1rem) !important;
    max-width:calc(100% - 1rem) !important;
    margin-top:-4.9rem !important;
  }
}

/* -------------------------------------------------------------------------
   House card name wrapping + advancer-name polish — 2026-06-24
   -------------------------------------------------------------------------
   Keep this section scoped to the primary state detail House overview. Names
   should wrap between natural name parts first. A first/last/middle part only
   breaks internally if that single part cannot fit on one line by itself.
*/
body.en-primary-detail #view-house .cme-house-tile-name{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:baseline !important;
  gap:0 .24em !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:manual !important;
}
body.en-primary-detail #view-house .cme-house-name-part{
  display:inline-block !important;
  max-width:100% !important;
  min-width:0 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
  hyphens:auto !important;
}

/* Winner names stay bold but do not get the multi-advancer card treatment. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="winner"] .cme-house-tile-name{
  font-size:clamp(1.1rem, 1.7vw, 1.44rem) !important;
  line-height:1.03 !important;
  letter-spacing:-.045em !important;
}

/* Advancer House tiles should use the same visual grammar as the projection
   banner: each advancing candidate is its own compact glass panel with a
   clear action label and a large name. */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name-list{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:.38rem !important;
  min-width:0 !important;
  width:100% !important;
}
body.en-primary-detail #view-house .cme-house-advancer{
  display:flex !important;
  flex-direction:column !important;
  gap:.08rem !important;
  min-width:0 !important;
  max-width:100% !important;
  padding:.34rem .48rem .4rem !important;
  border-radius:14px !important;
  background:rgba(255,255,255,.14) !important;
  border:1px solid rgba(255,255,255,.22) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14) !important;
}
body.en-primary-detail #view-house .cme-house-advancer-action{
  display:block !important;
  color:rgba(255,255,255,.84) !important;
  font-size:.62rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
  letter-spacing:.095em !important;
  text-transform:uppercase !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-advancer .cme-house-tile-name{
  color:#fff !important;
  font-size:clamp(1.08rem, 1.45vw, 1.42rem) !important;
  font-weight:1000 !important;
  line-height:1.02 !important;
  letter-spacing:-.05em !important;
  text-shadow:0 2px 4px rgba(0,0,0,.24) !important;
}

@media (min-width:980px){
  body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name-list:has(.cme-house-advancer:nth-child(2)){
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}
@media (max-width:720px){
  body.en-primary-detail #view-house .cme-house-advancer{
    padding:.38rem .52rem .43rem !important;
  }
  body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-advancer .cme-house-tile-name{
    font-size:1.16rem !important;
  }
}

/* =========================================================
   House advancer card stacking fix
   ---------------------------------------------------------
   Lock projected House advancers into a vertical stack. The
   previous desktop override split two projected advancers into
   side-by-side columns, which made long names and labels cramped.
   ========================================================= */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name-list,
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-name-list:has(.cme-house-advancer:nth-child(2)){
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:.42rem !important;
  width:100% !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-advancer{
  width:100% !important;
  align-items:flex-start !important;
  text-align:left !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-advancer .cme-house-tile-name{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0 .22em !important;
  width:100% !important;
  max-width:100% !important;
}


/* =========================================================
   House advancer glyph/name alignment polish — 2026-06-24
   ---------------------------------------------------------
   The House card already has an advancement pill, so projected
   advancer tiles should emphasize the stacked names and centered
   arrow rather than repeating "Advancing to General" above each
   name.
   ========================================================= */
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .district-submeta{
  align-items:center !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-tile-glyph{
  align-self:center !important;
  margin-top:0 !important;
}
body.en-primary-detail #view-house .cme-house-advancer-action{
  display:none !important;
}
body.en-primary-detail #view-house :is(.house-district-tile,.district-tile)[data-cme-projected-tile="advance"] .cme-house-advancer{
  justify-content:center !important;
}

/* =========================================================
   Candidate-name natural wrapping for results cards/tooltips
   ---------------------------------------------------------
   Apply the House-card wrapping rule to statewide result rows,
   county result rows, and map tooltips: wrap between name parts
   first; only break inside a part when that part cannot fit alone.
   ========================================================= */
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row :is(.primary-cand .n,.candidate-name,.primary-name),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row :is(.ct-name,.candidate-name,.primary-name){
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:baseline !important;
  gap:0 .24em !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:manual !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row :is(.cme-result-name-part,.cme-tooltip-name-part),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row :is(.cme-result-name-part,.cme-tooltip-name-part){
  display:inline-block !important;
  max-width:100% !important;
  min-width:0 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
  hyphens:auto !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row[data-cme-projected] .primary-cand .n,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row[data-cme-projected] .ct-name{
  min-width:0 !important;
}

/* -------------------------------------------------------------------------
   Mobile tooltip no-internal-scroll lock — 2026-06-24
   -------------------------------------------------------------------------

   Older global election-night CSS gave tooltip candidate lists a capped height
   with overflow:auto on mobile. That creates a second vertical scroll area
   inside the county tooltip. On the state primary page, keep the mobile tooltip
   as a single compact bottom sheet with no internal scrolling; the page/viewport
   remains responsible for any movement, not .ct-rows.
*/
@media (max-width:640px){
  body.en-primary-detail > .county-tooltip.mobile-popout,
  body.en-primary-detail .county-tooltip.mobile-popout,
  body.en-primary-detail > .county-tooltip.mobile-popout.show,
  body.en-primary-detail .county-tooltip.mobile-popout.show,
  body.en-primary-detail :is(#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate).mobile-popout,
  body.en-primary-detail :is(#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate).mobile-popout.show{
    max-height:none !important;
    overflow:visible !important;
    overscroll-behavior:contain !important;
    padding:.78rem .82rem .82rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-rows,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-rows,
  body.en-primary-detail :is(#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate).mobile-popout .ct-rows{
    max-height:none !important;
    overflow:visible !important;
    overflow-y:visible !important;
    overscroll-behavior:contain !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-top,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-top{
    margin-bottom:.48rem !important;
    padding-bottom:.48rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-summary,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-summary{
    gap:.32rem !important;
    margin:.46rem 0 .52rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-chip,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-chip{
    min-height:1.22rem !important;
    padding:.18rem .46rem !important;
    font-size:.72rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-row,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-row{
    min-height:0 !important;
    margin:.22rem 0 !important;
    padding:.42rem .52rem !important;
    gap:.5rem !important;
    border-radius:12px !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-title,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-title{
    font-size:1rem !important;
    line-height:1.08 !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-name,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-name{
    font-size:.9rem !important;
    line-height:1.06 !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout :is(.ct-party,.ct-votes),
  body.en-primary-detail .county-tooltip.mobile-popout :is(.ct-party,.ct-votes){
    font-size:.72rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout .ct-pct,
  body.en-primary-detail .county-tooltip.mobile-popout .ct-pct{
    font-size:.96rem !important;
  }

  body.en-primary-detail > .county-tooltip.mobile-popout :is(.tip-link,.ct-view-all,.tooltip-view-all),
  body.en-primary-detail .county-tooltip.mobile-popout :is(.tip-link,.ct-view-all,.tooltip-view-all){
    min-height:2.2rem !important;
    margin-top:.48rem !important;
  }
}

/* =========================================================
   Vote update pill visibility + finite lifetime — 2026-06-24
   ========================================================= */
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change{
  opacity:1 !important;
  min-height:1.35rem !important;
  padding:.24rem .46rem !important;
  border-radius:999px !important;
  font-size:.76rem !important;
  font-weight:950 !important;
  line-height:1 !important;
  letter-spacing:-.01em !important;
  box-shadow:0 3px 10px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.35) !important;
  transition:opacity .22s ease, transform .22s ease !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up{
  color:#166534 !important;
  -webkit-text-fill-color:#166534 !important;
  background:rgba(187,247,208,.92) !important;
  border:1px solid rgba(22,101,52,.34) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down{
  color:#991b1b !important;
  -webkit-text-fill-color:#991b1b !important;
  background:rgba(254,202,202,.92) !important;
  border:1px solid rgba(153,27,27,.32) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row[data-cme-projected] .primary-right .pct-change{
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  background:rgba(255,255,255,.22) !important;
  border-color:rgba(255,255,255,.44) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.26), 0 4px 12px rgba(0,0,0,.16) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.is-fading{
  opacity:0 !important;
  transform:translateY(-2px) scale(.96) !important;
  pointer-events:none !important;
}
@media (prefers-color-scheme:dark){
  body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up{
    color:#bbf7d0 !important;
    -webkit-text-fill-color:#bbf7d0 !important;
    background:rgba(22,101,52,.88) !important;
    border-color:rgba(187,247,208,.34) !important;
  }
  body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down{
    color:#fecaca !important;
    -webkit-text-fill-color:#fecaca !important;
    background:rgba(127,29,29,.88) !important;
    border-color:rgba(254,202,202,.32) !important;
  }
}
html[data-theme="dark"] body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up,
body.dark.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up,
body.dark-mode.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up,
body.theme-dark.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.up{
  color:#bbf7d0 !important;
  -webkit-text-fill-color:#bbf7d0 !important;
  background:rgba(22,101,52,.88) !important;
  border-color:rgba(187,247,208,.34) !important;
}
html[data-theme="dark"] body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down,
body.dark.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down,
body.dark-mode.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down,
body.theme-dark.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-right .pct-change.down{
  color:#fecaca !important;
  -webkit-text-fill-color:#fecaca !important;
  background:rgba(127,29,29,.88) !important;
  border-color:rgba(254,202,202,.32) !important;
}

/* =========================================================
   Natural card-title wrapping — 2026-06-24
   ========================================================= */
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#view-house,#countyListCard,#countyListCardSenate,.state-analytics-card) .card-title{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:baseline !important;
  gap:0 .24em !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:manual !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#view-house,#countyListCard,#countyListCardSenate,.state-analytics-card) .card-title .cme-card-title-part{
  display:inline-block !important;
  max-width:100% !important;
  min-width:0 !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:anywhere !important;
  hyphens:auto !important;
}

/* =========================================================
   Stable refresh cycle — 2026-06-24
   ---------------------------------------------------------
   After the first successful render, live refreshes should update values,
   change pills, and row highlights without replaying card entrance animations.
   ========================================================= */
body.en-primary-detail.cmep-state-rendered-once :is(
  #globalWinnerBanner,
  .winner-banner,
  #resultsMount > .primary-race,
  #resultsMountSenate > .primary-race,
  #countyListMount .primary-race,
  #countyListMountSenate .primary-race,
  #view-house .house-district-tile,
  #view-house .district-tile,
  .race-result-card,
  .county-result-card,
  .no-election-result-card
){
  animation:none !important;
}
body.en-primary-detail.cmep-state-rendered-once :is(
  #resultsMount > .primary-race,
  #resultsMountSenate > .primary-race,
  #countyListMount .primary-race,
  #countyListMountSenate .primary-race,
  #view-house .house-district-tile,
  #view-house .district-tile
){
  opacity:1 !important;
  transform:none !important;
}

/* =========================================================
   Immediate projection paint fallback — 2026-06-24
   ---------------------------------------------------------
   Rendered rows already carry semantic classes before the final normalizer
   annotates them with data-cme-projected. Paint those classes too so full-width
   desktop loads do not wait for a later tab/change event to show projection fill.
   ========================================================= */
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is(.is-winner,.is-advance),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.is-advance){
  border-color:rgba(255,255,255,.32) !important;
  color:#fff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
  box-shadow:var(--cmep-call-shadow) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row.winD,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.winD{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d) 96%, #00111f 4%), color-mix(in srgb, var(--cmep-call-d) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row.winR,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.winR{
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r) 96%, #210000 4%), color-mix(in srgb, var(--cmep-call-r) 70%, #fff 30%)) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row.is-advance,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.is-advance{
  background:linear-gradient(135deg,#475569,#94a3b8) !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is(.is-winner,.is-advance) :is(.primary-cand,.primary-cand .n,.primary-cand .p,.pct,.votes,.pct-wrap),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.is-advance) :is(.ct-name,.ct-party,.p,.ct-pct,.ct-votes){
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}
body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row.is-winner:not(.winD):not(.winR),
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row.is-winner:not(.winD):not(.winR){
  background:linear-gradient(135deg,#475569,#94a3b8) !important;
}

/* =========================================================
   Jump-link hover light-mode readability — 2026-06-24
   ---------------------------------------------------------
   Keep the View Analytics / Jump to Results pills readable on hover in
   light mode only. Dark mode inherits the existing button treatment.
   ========================================================= */
html[data-theme="light"] body.en-primary-detail .jump-link-btn:hover,
html[data-theme="light"] body.en-primary-detail .jump-link-btn:focus-visible,
body.en-primary-detail:not(.dark):not(.dark-mode):not(.theme-dark) .jump-link-btn:hover,
body.en-primary-detail:not(.dark):not(.dark-mode):not(.theme-dark) .jump-link-btn:focus-visible{
  background:linear-gradient(180deg, rgba(241,245,249,.98), rgba(226,232,240,.94)) !important;
  border-color:rgba(100,116,139,.48) !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  text-shadow:none !important;
  box-shadow:0 12px 26px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.88) !important;
}
@media (prefers-color-scheme:light){
  body.en-primary-detail:not(.dark):not(.dark-mode):not(.theme-dark) .jump-link-btn:hover,
  body.en-primary-detail:not(.dark):not(.dark-mode):not(.theme-dark) .jump-link-btn:focus-visible{
    background:linear-gradient(180deg, rgba(241,245,249,.98), rgba(226,232,240,.94)) !important;
    border-color:rgba(100,116,139,.48) !important;
    color:#0f172a !important;
    -webkit-text-fill-color:#0f172a !important;
    text-shadow:none !important;
    box-shadow:0 12px 26px rgba(15,23,42,.14), inset 0 1px 0 rgba(255,255,255,.88) !important;
  }
}
html[data-theme="dark"] body.en-primary-detail .jump-link-btn:hover,
html.dark body.en-primary-detail .jump-link-btn:hover,
body.en-primary-detail.dark .jump-link-btn:hover,
body.en-primary-detail.dark-mode .jump-link-btn:hover,
body.en-primary-detail.theme-dark .jump-link-btn:hover,
html[data-theme="dark"] body.en-primary-detail .jump-link-btn:focus-visible,
html.dark body.en-primary-detail .jump-link-btn:focus-visible,
body.en-primary-detail.dark .jump-link-btn:focus-visible,
body.en-primary-detail.dark-mode .jump-link-btn:focus-visible,
body.en-primary-detail.theme-dark .jump-link-btn:focus-visible{
  color:inherit !important;
  -webkit-text-fill-color:currentColor !important;
}

/* ======================================================================
   State hero district overlay contrast — 2026-06-23
   Keep district overlays visible inside the state hero in dark mode without
   changing the light-mode treatment or the district/analytics maps.
   ====================================================================== */
html[data-theme="dark"] body.en-primary-detail .state-hero .tile-district-fill-path,
body.dark.en-primary-detail .state-hero .tile-district-fill-path,
body.dark-mode.en-primary-detail .state-hero .tile-district-fill-path,
body.theme-dark.en-primary-detail .state-hero .tile-district-fill-path{
  fill:color-mix(in srgb, var(--district-hole-fill, var(--toss-up, #929292)) 84%, white 16%) !important;
  opacity:.92 !important;
  filter:drop-shadow(0 0 10px color-mix(in srgb, var(--district-hole-fill, var(--toss-up, #929292)) 62%, transparent)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero .tile-district-stroke-path,
body.dark.en-primary-detail .state-hero .tile-district-stroke-path,
body.dark-mode.en-primary-detail .state-hero .tile-district-stroke-path,
body.theme-dark.en-primary-detail .state-hero .tile-district-stroke-path{
  stroke:color-mix(in srgb, var(--district-hole-stroke, var(--district-hole-fill, var(--toss-up, #929292))) 72%, white 28%) !important;
  stroke-width:2.1 !important;
  opacity:.98 !important;
  filter:drop-shadow(0 0 8px rgba(255,255,255,.16)) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail .state-hero .tile-district-fill-path{
    fill:color-mix(in srgb, var(--district-hole-fill, var(--toss-up, #929292)) 84%, white 16%) !important;
    opacity:.92 !important;
    filter:drop-shadow(0 0 10px color-mix(in srgb, var(--district-hole-fill, var(--toss-up, #929292)) 62%, transparent)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero .tile-district-stroke-path{
    stroke:color-mix(in srgb, var(--district-hole-stroke, var(--district-hole-fill, var(--toss-up, #929292))) 72%, white 28%) !important;
    stroke-width:2.1 !important;
    opacity:.98 !important;
    filter:drop-shadow(0 0 8px rgba(255,255,255,.16)) !important;
  }
}

/* ======================================================================
   State hero district fill parity — 2026-06-23
   District overlays in the state hero should use Toss-Up gray in both
   themes. This overrides any projection/party-derived inline variable that
   can render as black before projection data resolves.
   ====================================================================== */
body.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in){
  fill:#929292 !important;
  opacity:.50 !important;
  filter:none !important;
}
body.en-primary-detail .state-hero .tile-district-stroke-path{
  stroke:#929292 !important;
  opacity:.95 !important;
  stroke-width:1.9 !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in),
body.dark.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in),
body.dark-mode.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in),
body.theme-dark.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in){
  fill:#929292 !important;
  opacity:.66 !important;
  filter:drop-shadow(0 0 9px rgba(146,146,146,.34)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
}
html[data-theme="dark"] body.en-primary-detail .state-hero .tile-district-stroke-path,
body.dark.en-primary-detail .state-hero .tile-district-stroke-path,
body.dark-mode.en-primary-detail .state-hero .tile-district-stroke-path,
body.theme-dark.en-primary-detail .state-hero .tile-district-stroke-path{
  stroke:#b8bec8 !important;
  opacity:1 !important;
  stroke-width:2.1 !important;
  filter:drop-shadow(0 0 8px rgba(184,190,200,.28)) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-detail .state-hero :is(.tile-district-fill-path,.tile-district-fill-path.fill-in){
    fill:#929292 !important;
    opacity:.66 !important;
    filter:drop-shadow(0 0 9px rgba(146,146,146,.34)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
  }
  html:not([data-theme="light"]) body.en-primary-detail .state-hero .tile-district-stroke-path{
    stroke:#b8bec8 !important;
    opacity:1 !important;
    stroke-width:2.1 !important;
    filter:drop-shadow(0 0 8px rgba(184,190,200,.28)) !important;
  }
}


/* ======================================================================
   Hero district overlay hard fix — 2026-06-23
   House district hero paths are generated as .hero-district-fill-path /
   .hero-district-outline-path, not .tile-district-*. Force Toss-Up gray
   at the actual generated SVG path level so default SVG black never leaks.
   ====================================================================== */
body.en-primary-house-detail .state-hero .hero-district-fill-path,
body.en-primary-house-detail .state-hero .hero-district-fill-path,
body.en-primary-detail .state-hero .hero-district-fill-path{
  fill:#929292 !important;
  stroke:none !important;
  opacity:.52 !important;
  filter:none !important;
}
body.en-primary-house-detail .state-hero .hero-district-outline-path,
body.en-primary-house-detail .state-hero .hero-district-outline-path,
body.en-primary-detail .state-hero .hero-district-outline-path{
  fill:none !important;
  stroke:#929292 !important;
  stroke-width:1.9 !important;
  stroke-linejoin:round !important;
  stroke-linecap:round !important;
  opacity:.98 !important;
}
html[data-theme="dark"] body.en-primary-house-detail .state-hero .hero-district-fill-path,
html.dark body.en-primary-house-detail .state-hero .hero-district-fill-path,
body.dark.en-primary-house-detail .state-hero .hero-district-fill-path,
body.dark-mode.en-primary-house-detail .state-hero .hero-district-fill-path,
body.theme-dark.en-primary-house-detail .state-hero .hero-district-fill-path{
  fill:#929292 !important;
  opacity:.68 !important;
  filter:drop-shadow(0 0 9px rgba(146,146,146,.34)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
}
html[data-theme="dark"] body.en-primary-house-detail .state-hero .hero-district-outline-path,
html.dark body.en-primary-house-detail .state-hero .hero-district-outline-path,
body.dark.en-primary-house-detail .state-hero .hero-district-outline-path,
body.dark-mode.en-primary-house-detail .state-hero .hero-district-outline-path,
body.theme-dark.en-primary-house-detail .state-hero .hero-district-outline-path{
  fill:none !important;
  stroke:#b8bec8 !important;
  opacity:1 !important;
  stroke-width:2.1 !important;
  filter:drop-shadow(0 0 8px rgba(184,190,200,.28)) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.en-primary-house-detail .state-hero .hero-district-fill-path{
    fill:#929292 !important;
    opacity:.68 !important;
    filter:drop-shadow(0 0 9px rgba(146,146,146,.34)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
  }
  html:not([data-theme="light"]) body.en-primary-house-detail .state-hero .hero-district-outline-path{
    fill:none !important;
    stroke:#b8bec8 !important;
    opacity:1 !important;
    stroke-width:2.1 !important;
    filter:drop-shadow(0 0 8px rgba(184,190,200,.28)) !important;
  }
}

/* v6: shared primary-detail surface must occupy the full office-view grid.
   Several legacy page CSS files set .state-grid.office-view.active to a 12-column
   grid. State had a page-specific rule for #electionNightGovernor; House did not,
   causing the House surface to collapse into one desktop grid column while mobile
   looked mostly correct. Keep this neutral so State/House share the same contract. */
body.en-primary-detail .state-grid.office-view.active > .cmep-primary-detail-surface,
body.en-primary-detail .office-view.active > .cmep-primary-detail-surface{
  grid-column:1 / -1 !important;
  width:100% !important;
  min-width:0 !important;
}

body.en-primary-detail .cmep-primary-detail-surface > .grid-2{
  width:100% !important;
  min-width:0 !important;
}


/* v7: House detail now uses the same state-detail generated CSS stack and wrapper.
   These rules harden the shared contract where legacy page CSS still expects #officeViews. */
body.en-primary-detail #officeViews > .state-grid.office-view.active{
  display:grid !important;
  grid-template-columns:repeat(12,minmax(0,1fr)) !important;
  gap:2rem !important;
  width:100% !important;
  min-width:0 !important;
}
body.en-primary-detail #officeViews > .state-grid.office-view.active > .cmep-primary-detail-surface{
  grid-column:1 / -1 !important;
  width:100% !important;
  min-width:0 !important;
}
body.en-primary-house-detail :is(#historyCard,#incumbentMount,#sourcesCard,.cmep-hidden-mount){
  display:none !important;
}
body.en-primary-house-detail #primarySourceAttrib{
  margin-top:.7rem !important;
}
@media (max-width:980px){
  body.en-primary-detail #officeViews > .state-grid.office-view.active{
    grid-template-columns:1fr !important;
    gap:1.2rem !important;
  }
}


/* v8: House detail reads state-scoped Monte Carlo data and should only render
   the state-detail visual sections. Keep legacy safe mounts inert even if old JS
   toggles attributes during hydration. */
body.en-primary-house-detail #electionNightHouse > :is(#summaryRow,#incumbentMount,#historyCard,#sourcesCard,.cmep-hidden-mount){
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}
body.en-primary-house-detail #electionNightHouse > #liveRow,
body.en-primary-house-detail #electionNightHouse > #countyListCard,
body.en-primary-house-detail #electionNightHouse > #analyticsSection,
body.en-primary-house-detail #electionNightHouse > #analysisMapCard,
body.en-primary-house-detail #electionNightHouse > #countyModal{
  grid-column:1 / -1 !important;
  min-width:0 !important;
}

/* v9: screenshot-driven House/state visual parity fixes.
   - The House county modal is a hidden safe mount until opened; without this,
     its title/close button can leak below the analytics map.
   - House district county lists now use the same collapsed county-preview
     behavior as state detail once more than eight localities are shown.
   - The hidden legacy mounts are kept inert even if older hydration code touches
     them after initial render.
*/
body.en-primary-house-detail #countyModal[aria-hidden="true"],
body.en-primary-house-detail #countyModal:not(.is-open):not(.open):not([data-open="true"]){
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
body.en-primary-house-detail #electionNightHouse > :is(#summaryRow,#incumbentMount,#historyCard,#sourcesCard,.cmep-hidden-mount),
body.en-primary-house-detail #electionNightHouse :is(#summaryCard,#districtMapCard,#mapHero,#raceMount,#candMount){
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  min-height:0 !important;
  max-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
}
body.en-primary-house-detail #countyListMount .primary-grid.county-list-collapsed:not(.is-expanded) .county-extra{
  display:block !important;
}
body.en-primary-house-detail #countyListMount .primary-grid.county-list-collapsed:not(.is-expanded) .county-extra:nth-of-type(n+11){
  display:none !important;
}

/* v10: screenshot-driven county preview control alignment.
   The shared county expand control must center like the state page. It was
   inline-flex, so auto margins did not center the House button in all desktop
   layouts. Make it a flex-level box with explicit left/right auto margins. */
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-expand-btn{
  display:flex !important;
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-grid.county-list-collapsed:not(.is-expanded) + .county-expand-btn{
  margin-left:auto !important;
  margin-right:auto !important;
}

/* =========================================================
   v11: shared section-card heading contract
   ---------------------------------------------------------
   The House detail page now shares the state detail CSS stack, but its
   section-card headings were still drifting because generic cohesion rules
   and House-specific load order could leave Live Results Map / County Results /
   District Analytics Map with slightly different font sizing, weight, and
   header alignment. These headings are shared components, so define their
   typography and header layout once for both State and House.
   ========================================================= */
html body.en-primary-detail :is(
  #liveMapCard,
  #liveMapCardSenate,
  #countyListCard,
  #countyListCardSenate,
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header{
  position:relative !important;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:center !important;
  gap:.75rem !important;
  text-align:center !important;
  padding-bottom:.9rem !important;
  margin-bottom:.9rem !important;
  border-bottom:1px solid rgba(148,163,184,.20) !important;
}
html body.en-primary-detail :is(
  #liveMapCard,
  #liveMapCardSenate,
  #countyListCard,
  #countyListCardSenate,
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header > :first-child{
  min-width:0 !important;
  max-width:min(100%, 56rem) !important;
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center !important;
}
html body.en-primary-detail :is(
  #liveMapCard,
  #liveMapCardSenate,
  #countyListCard,
  #countyListCardSenate,
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header .card-title{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  align-items:baseline !important;
  gap:0 .24em !important;
  width:100% !important;
  margin:0 auto !important;
  text-align:center !important;
  font-size:clamp(1.22rem,1.55vw,1.46rem) !important;
  line-height:1.08 !important;
  font-weight:900 !important;
  letter-spacing:-.035em !important;
  color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-detail :is(
  #liveMapCard,
  #liveMapCardSenate,
  #countyListCard,
  #countyListCardSenate,
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header .card-help{
  width:100% !important;
  max-width:64rem !important;
  margin:.25rem auto 0 !important;
  text-align:center !important;
  font-size:.88rem !important;
  line-height:1.34 !important;
  color:var(--text-muted, #aab7c9) !important;
}
html body.en-primary-detail :is(
  #liveMapCard,
  #liveMapCardSenate,
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header > .badge{
  position:absolute !important;
  top:.1rem !important;
  right:0 !important;
  margin:0 !important;
  text-align:right !important;
  font-size:.78rem !important;
  font-weight:800 !important;
  color:var(--text-muted, #aab7c9) !important;
}
html body.en-primary-detail :is(
  #analysisMapCard,
  #analysisMapCardGovernor,
  #analysisMapCardSenate
) > .card-header > div:first-child{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
}
@media (max-width:760px){
  html body.en-primary-detail :is(
    #liveMapCard,
    #liveMapCardSenate,
    #countyListCard,
    #countyListCardSenate,
    #analysisMapCard,
    #analysisMapCardGovernor,
    #analysisMapCardSenate
  ) > .card-header > .badge{
    position:static !important;
    align-self:center !important;
    text-align:center !important;
  }
}

/* =========================================================
   v12: final results-card/control/county-name parity lock
   ---------------------------------------------------------
   Screenshot pass isolated remaining drift to the main results card,
   its refresh control, the live-results-map Reset View control, and
   county-card names. These are shared components, so lock them once for
   State + House rather than keeping House-specific visual exceptions.
   ========================================================= */
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:.85rem !important;
  flex-wrap:nowrap !important;
  padding-bottom:.9rem !important;
  margin-bottom:.9rem !important;
  border-bottom:1px solid var(--cmep-line, rgba(148,163,184,.26)) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
  min-width:0 !important;
  flex:1 1 auto !important;
  width:auto !important;
  max-width:none !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate,.card-title){
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:baseline !important;
  justify-content:flex-start !important;
  gap:0 .24em !important;
  margin:0 !important;
  max-width:none !important;
  text-align:left !important;
  font-size:clamp(1.42rem,1.72vw,1.78rem) !important;
  line-height:1.04 !important;
  font-weight:900 !important;
  letter-spacing:-.045em !important;
  color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  -webkit-text-fill-color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate,.card-title) .cme-card-title-part{
  display:inline-block !important;
  white-space:nowrap !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  gap:.52rem .65rem !important;
  margin-top:.42rem !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
  margin:.34rem 0 0 0 !important;
  font-size:.9rem !important;
  line-height:1.34 !important;
  color:var(--text-muted, var(--cmep-muted, #aab7c9)) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
  appearance:none !important;
  flex:0 0 auto !important;
  align-self:flex-start !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:0 !important;
  max-width:max-content !important;
  min-height:2.05rem !important;
  padding:.42rem .72rem !important;
  margin:0 !important;
  border-radius:999px !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.30)) !important;
  background:var(--bg-card, var(--cmep-panel, #0b1220)) !important;
  color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  -webkit-text-fill-color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  box-shadow:var(--shadow-subtle, 0 8px 20px rgba(2,6,23,.18)) !important;
  font-size:.84rem !important;
  line-height:1 !important;
  font-weight:750 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
  white-space:nowrap !important;
  cursor:pointer !important;
  transition:transform 120ms ease, background-color 120ms ease, border-color 120ms ease !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn):hover{
  transform:translateY(-1px) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn):active{
  transform:translateY(0) !important;
}

/* Live-results map reset button should match the state/detail overlay control.
   Analytics reset was already correct; this locks the live map only. */
html body.en-primary-detail :is(#liveMapCard,#liveMapCardSenate) :is(#mapCounty,#mapCountySenate,.map) > :is(#resetLiveViewBtn,#resetLiveViewBtnSenate,.reset-view-btn){
  position:absolute !important;
  left:14px !important;
  top:14px !important;
  right:auto !important;
  bottom:auto !important;
  z-index:5 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:0 !important;
  max-width:max-content !important;
  padding:.45rem .7rem !important;
  margin:0 !important;
  border-radius:999px !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.30)) !important;
  background:var(--bg-card, var(--cmep-panel, #0b1220)) !important;
  color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  -webkit-text-fill-color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  box-shadow:var(--shadow-soft, 0 12px 28px rgba(2,6,23,.25)) !important;
  font-size:.9rem !important;
  line-height:1 !important;
  font-weight:700 !important;
  white-space:nowrap !important;
  opacity:0 !important;
  pointer-events:none !important;
  transform:translateY(-6px) !important;
  transition:opacity .18s ease, transform .18s ease !important;
}
html body.en-primary-detail :is(#liveMapCard,#liveMapCardSenate) :is(#mapCounty,#mapCountySenate,.map) > :is(#resetLiveViewBtn,#resetLiveViewBtnSenate,.reset-view-btn).show{
  opacity:1 !important;
  pointer-events:auto !important;
  transform:translateY(0) !important;
}
html body.en-primary-detail :is(#liveMapCard,#liveMapCardSenate) :is(#mapCounty,#mapCountySenate,.map) > :is(#resetLiveViewBtn,#resetLiveViewBtnSenate,.reset-view-btn):active{
  transform:translateY(1px) !important;
}

/* County card title typography lock. */
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row .name,
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .primary-race .primary-head .name{
  display:block !important;
  flex:1 1 auto !important;
  min-width:0 !important;
  margin:0 !important;
  font-size:clamp(1.16rem,1.18vw,1.32rem) !important;
  line-height:1.06 !important;
  font-weight:900 !important;
  letter-spacing:-.035em !important;
  color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  -webkit-text-fill-color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row{
  align-items:flex-start !important;
}
html body.en-primary-detail :is(#countyListMount,#countyListMountSenate) .county-title-row .county-viewall-btn{
  margin-top:.08rem !important;
}

/* =========================================================
   v13: final House/state primary detail parity fixes
   ---------------------------------------------------------
   The page screenshots isolated the remaining visible drift to the main
   results-card header layout and stale county coloration after D/R switches.
   This locks the shared results-card header into the same title/status/
   refresh geometry used by the state page while leaving the already-matching
   map, county grid, and analytics sections alone.
   ========================================================= */
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:start !important;
  justify-content:stretch !important;
  gap:.75rem .85rem !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  grid-template-areas:
    "title status"
    "title help" !important;
  align-items:start !important;
  gap:.26rem .85rem !important;
  min-width:0 !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate){
  grid-area:title !important;
  align-self:start !important;
  max-width:100% !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row{
  grid-area:status !important;
  justify-self:end !important;
  align-self:start !important;
  margin-top:.05rem !important;
  text-align:right !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
  grid-area:help !important;
  justify-self:end !important;
  align-self:start !important;
  margin-top:.16rem !important;
  text-align:right !important;
  white-space:nowrap !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
  justify-self:end !important;
}
@media (max-width:760px){
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header,
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row,
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
    justify-self:start !important;
    text-align:left !important;
    white-space:normal !important;
  }
}

/* =========================================================
   v14: House primary detail final visible-drift fixes
   ---------------------------------------------------------
   Fixes remaining House-only drift visible after v13:
   - Results-card title/status/refresh geometry could compress on long House titles.
   - House county modal was not covered by the state modal selectors and could render
     as normal page content at the bottom instead of a centered overlay.
   - House map reset button state and tooltip/modal surfaces are normalized.
   ========================================================= */

/* Results-card header: reserve real space for status/refresh, but allow long titles to wrap like State. */
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
  grid-template-columns:minmax(0,1fr) auto !important;
  column-gap:1rem !important;
  row-gap:.35rem !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
  grid-template-columns:minmax(0,1fr) max-content !important;
  column-gap:.9rem !important;
  min-width:0 !important;
  width:100% !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate){
  min-width:0 !important;
  max-width:min(23rem, 100%) !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
 -wrap-after:auto;
}
html body.en-primary-house-detail #resultsTitle{
  max-width:min(20.5rem, 100%) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row{
  min-width:max-content !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:.42rem !important;
  flex-wrap:nowrap !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-pill{
  flex:0 0 auto !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .last-updated{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
  min-width:max-content !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
  min-width:max-content !important;
  white-space:nowrap !important;
  align-self:start !important;
}

/* Modal contract: State CSS only targeted #electionNightGovernor/#electionNightSenate.
   House uses #electionNightHouse, so give it the exact same overlay behavior. */
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal{
  position:fixed !important;
  inset:0 !important;
  display:none !important;
  z-index:9999 !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal.open,
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal[aria-hidden="false"]{
  display:block !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal[aria-hidden="true"]{
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-backdrop{
  position:absolute !important;
  inset:0 !important;
  background:rgba(2,6,23,.66) !important;
  backdrop-filter:blur(6px) !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-card{
  position:relative !important;
  width:min(760px, calc(100% - 32px)) !important;
  max-height:min(82vh, 900px) !important;
  margin:clamp(28px, 8vh, 72px) auto 0 !important;
  padding:1rem !important;
  border-radius:22px !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.28)) !important;
  background:var(--bg-card, var(--cmep-panel, #0b1220)) !important;
  color:var(--text-main, var(--cmep-text, #e5e7eb)) !important;
  box-shadow:0 24px 80px rgba(2,6,23,.55) !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  padding-bottom:.65rem !important;
  border-bottom:1px solid var(--border-subtle, rgba(148,163,184,.22)) !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-title{
  font-weight:1000 !important;
  font-size:1.05rem !important;
  line-height:1.1 !important;
  letter-spacing:-.02em !important;
  color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-x{
  appearance:none !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.28)) !important;
  border-radius:999px !important;
  background:rgba(148,163,184,.10) !important;
  color:var(--text-strong, #f8fafc) !important;
  width:34px !important;
  height:34px !important;
  display:inline-grid !important;
  place-items:center !important;
  cursor:pointer !important;
}
html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-body{
  padding-top:.85rem !important;
  overflow:auto !important;
  -webkit-overflow-scrolling:touch !important;
  min-height:0 !important;
}
@media (max-width:760px){
  html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) .modal-card{
    width:calc(100% - 16px) !important;
    max-height:calc(100vh - 24px) !important;
    margin:12px auto 0 !important;
    padding:.9rem !important;
  }
}

/* House detail should never show the modal as a normal in-flow county block. */
html body.en-primary-house-detail #countyModal:not(.open):not([aria-hidden="false"]){
  display:none !important;
  position:fixed !important;
  inset:0 !important;
}

/* Keep live-map reset button consistent and hidden until user actually pans/zooms. */
html body.en-primary-house-detail #liveMapCard #resetLiveViewBtn:not(.show){
  opacity:0 !important;
  pointer-events:none !important;
  visibility:visible !important;
}

/* =========================================================
   v15: results-card header restore + modal flair removal
   ---------------------------------------------------------
   v13/v14 over-constrained the House results-card header by nesting a grid
   inside another grid. That made long House titles squeeze the Live/Refresh
   controls. Restore a single, state-style header grid by letting the inner
   wrapper's children participate directly in the header grid.

   Also remove the legacy primary-race top flair inside county modals. The
   modal body reuses .primary-race markup for rows, but it should not inherit
   the results-card decorative strip.
   ========================================================= */
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto auto !important;
  grid-template-areas:
    "title status refresh"
    "title help   refresh" !important;
  align-items:start !important;
  justify-content:stretch !important;
  gap:.24rem .72rem !important;
  padding-bottom:.9rem !important;
  margin-bottom:.9rem !important;
  border-bottom:1px solid var(--cmep-line, var(--border-subtle, rgba(148,163,184,.24))) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
  display:contents !important;
  min-width:0 !important;
  width:auto !important;
  max-width:none !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate){
  grid-area:title !important;
  align-self:start !important;
  justify-self:start !important;
  display:block !important;
  min-width:0 !important;
  max-width:100% !important;
  margin:0 !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  text-align:left !important;
  font-size:clamp(1.34rem,1.6vw,1.72rem) !important;
  line-height:1.02 !important;
  font-weight:950 !important;
  letter-spacing:-.045em !important;
  color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
  -webkit-text-fill-color:var(--text-strong, var(--cmep-strong, #f8fafc)) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsTitle,#resultsTitleSenate) .cme-card-title-part{
  display:inline !important;
  white-space:normal !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row{
  grid-area:status !important;
  justify-self:end !important;
  align-self:start !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:.48rem !important;
  margin:0 !important;
  min-width:max-content !important;
  max-width:none !important;
  white-space:nowrap !important;
  text-align:right !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .last-updated{
  display:inline !important;
  white-space:nowrap !important;
  max-width:none !important;
  overflow:visible !important;
  text-overflow:clip !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
  grid-area:help !important;
  justify-self:end !important;
  align-self:start !important;
  margin:.18rem 0 0 0 !important;
  min-width:max-content !important;
  max-width:none !important;
  white-space:nowrap !important;
  text-align:right !important;
  font-size:.83rem !important;
  line-height:1.2 !important;
  color:var(--text-muted, var(--cmep-muted, #aab7c9)) !important;
}
html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
  grid-area:refresh !important;
  justify-self:end !important;
  align-self:start !important;
  margin:0 !important;
  min-width:max-content !important;
  white-space:nowrap !important;
}
@media (max-width:760px){
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:.55rem !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
    display:block !important;
    width:100% !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row,
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help,
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
    justify-self:start !important;
    align-self:flex-start !important;
    text-align:left !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
    white-space:normal !important;
    min-width:0 !important;
  }
}

/* County modal should reuse candidate rows, not the decorative race-card chrome. */
html body.en-primary-detail :is(#countyModal,#countyModalSenate) .modal-body :is(.primary-race,.race-result-card,.no-election-result-card)::before,
html body.en-primary-detail :is(#countyModal,#countyModalSenate) .modal-body :is(.primary-race,.race-result-card,.no-election-result-card)::after,
html body.en-primary-detail :is(#electionNightHouse,#electionNightGovernor,#electionNightSenate) .modal .modal-body :is(.primary-race,.race-result-card,.no-election-result-card)::before,
html body.en-primary-detail :is(#electionNightHouse,#electionNightGovernor,#electionNightSenate) .modal .modal-body :is(.primary-race,.race-result-card,.no-election-result-card)::after{
  content:none !important;
  display:none !important;
  visibility:hidden !important;
  height:0 !important;
  background:none !important;
  border:0 !important;
  box-shadow:none !important;
}
html body.en-primary-detail :is(#countyModal,#countyModalSenate) .modal-body :is(.primary-race,.race-result-card,.no-election-result-card),
html body.en-primary-detail :is(#electionNightHouse,#electionNightGovernor,#electionNightSenate) .modal .modal-body :is(.primary-race,.race-result-card,.no-election-result-card){
  border-top:0 !important;
  box-shadow:none !important;
}

/* =========================================================
   v16: House results-card inner parity + tooltip candidate restore
   ---------------------------------------------------------
   The House detail page now uses the shared State/House shell, but several
   result-card internals still depended on generated state selectors that only
   target #electionNightGovernor/#electionNightSenate. Mirror those internals to
   #electionNightHouse and restore tooltip candidate rows after removing the
   modal/card decorative top flair.
   ========================================================= */

/* House main race card should use the same inner card contract as State. */
html body.en-primary-house-detail #electionNightHouse .cmep-results-mount{
  display:flex !important;
  flex-direction:column !important;
  gap:1rem !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount > .primary-race,
html body.en-primary-house-detail #electionNightHouse #resultsMount .race-result-card,
html body.en-primary-house-detail #electionNightHouse #resultsMount .county-result-card{
  background:var(--bg-card-subtle, rgba(15,23,42,.52)) !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.22)) !important;
  border-radius:14px !important;
  padding:1rem 1.05rem !important;
  box-shadow:var(--shadow-subtle, 0 10px 26px rgba(2,6,23,.18)) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-head{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  padding:0 !important;
  margin:0 0 .65rem 0 !important;
  border-bottom:0 !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-head > div:first-child{
  min-width:0 !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-head .kicker{
  margin:0 !important;
  font-size:.74rem !important;
  text-transform:uppercase !important;
  letter-spacing:.12em !important;
  font-weight:800 !important;
  line-height:1.15 !important;
  color:var(--text-muted, var(--cmep-muted, #94a3b8)) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-head .name{
  margin:.15rem 0 0 0 !important;
  font-size:.98rem !important;
  font-weight:850 !important;
  line-height:1.16 !important;
  letter-spacing:-.01em !important;
  color:var(--text-strong, #f8fafc) !important;
  -webkit-text-fill-color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-head > div:last-child{
  flex:0 0 auto !important;
  text-align:right !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  gap:.3rem !important;
  min-width:0 !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-meta{
  margin-top:.35rem !important;
  font-size:.84rem !important;
  line-height:1.35 !important;
  color:var(--text-muted, #94a3b8) !important;
  display:flex !important;
  flex-wrap:wrap !important;
  gap:.5rem .85rem !important;
}

/* Call status block: make House render like State instead of plain stacked text. */
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status{
  margin-top:.75rem !important;
  margin-bottom:.2rem !important;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:.8rem !important;
  padding:.72rem .82rem !important;
  border-radius:12px !important;
  border:1px solid rgba(148,163,184,.20) !important;
  background:rgba(148,163,184,.08) !important;
  box-shadow:none !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-left{ min-width:0 !important; }
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-label{
  font-size:.72rem !important;
  text-transform:uppercase !important;
  letter-spacing:.12em !important;
  font-weight:800 !important;
  line-height:1.1 !important;
  color:var(--text-muted, #94a3b8) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-text{
  margin-top:.18rem !important;
  font-size:.95rem !important;
  font-weight:900 !important;
  line-height:1.15 !important;
  letter-spacing:-.01em !important;
  color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-sub{
  margin-top:.18rem !important;
  font-size:.82rem !important;
  line-height:1.35 !important;
  color:var(--text-muted, #94a3b8) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-pill{
  flex:0 0 auto !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:.35rem !important;
  padding:.42rem .68rem !important;
  border-radius:999px !important;
  font-size:.75rem !important;
  font-weight:900 !important;
  line-height:1 !important;
  white-space:nowrap !important;
  border:1px solid rgba(148,163,184,.24) !important;
  background:rgba(148,163,184,.12) !important;
  color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-pill.cs-projected{
  background:rgba(100,196,102,.14) !important;
  border-color:rgba(100,196,102,.28) !important;
  color:var(--projection-green, #64c466) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-pill.cs-awaiting{
  background:rgba(246,206,70,.16) !important;
  border-color:rgba(246,206,70,.30) !important;
  color:var(--text-strong, #f8fafc) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-pill:is(.cs-early,.cs-close){
  background:rgba(148,163,184,.12) !important;
  border-color:rgba(148,163,184,.24) !important;
  color:var(--text-strong, #f8fafc) !important;
}

/* More candidates: use State's compact disclosure chip styling. */
html body.en-primary-house-detail #electionNightHouse #resultsMount details.more-cands{
  margin-top:.6rem !important;
  border:1px solid var(--border-subtle, rgba(148,163,184,.22)) !important;
  background:rgba(148,163,184,.08) !important;
  border-radius:16px !important;
  padding:.55rem .75rem !important;
  box-shadow:none !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount details.more-cands > summary{
  display:list-item !important;
  cursor:pointer !important;
  font-weight:900 !important;
  font-size:.86rem !important;
  line-height:1.15 !important;
  color:var(--text-strong, #f8fafc) !important;
  list-style:none !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount details.more-cands > summary::-webkit-details-marker{ display:none !important; }
html body.en-primary-house-detail #electionNightHouse #resultsMount details.more-cands > summary::before{
  content:"▸" !important;
  display:inline-block !important;
  margin-right:.35rem !important;
  font-size:.74rem !important;
  transform:translateY(-.02em) !important;
  color:var(--text-muted, #94a3b8) !important;
}
html body.en-primary-house-detail #electionNightHouse #resultsMount details.more-cands[open] > summary::before{
  content:"▾" !important;
}

/* Tooltip and modal candidate rows: preserve the candidate layout after removing card flair. */
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-rows{
  display:flex !important;
  flex-direction:column !important;
  gap:.42rem !important;
  margin-top:.62rem !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:.72rem !important;
  padding:.58rem .64rem !important;
  border-radius:12px !important;
  border:1px solid rgba(148,163,184,.16) !important;
  background:rgba(15,23,42,.34) !important;
  min-width:0 !important;
  box-shadow:none !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-left{
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  min-width:0 !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-dot{
  display:inline-block !important;
  flex:0 0 .58rem !important;
  width:.58rem !important;
  height:.58rem !important;
  min-width:.58rem !important;
  min-height:.58rem !important;
  border-radius:999px !important;
  box-shadow:0 0 0 2px rgba(255,255,255,.06) !important;
  opacity:1 !important;
  visibility:visible !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-name{
  color:var(--text-strong, #f8fafc) !important;
  font-weight:900 !important;
  font-size:.9rem !important;
  line-height:1.08 !important;
  letter-spacing:-.015em !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row .p,
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-party{
  color:var(--text-muted, #94a3b8) !important;
  font-size:.74rem !important;
  font-weight:750 !important;
  line-height:1.08 !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-right{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  justify-content:center !important;
  gap:.08rem !important;
  min-width:max-content !important;
  text-align:right !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-pct{
  color:var(--text-strong, #f8fafc) !important;
  font-size:1rem !important;
  font-weight:950 !important;
  line-height:1 !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-votes{
  color:var(--text-muted, #94a3b8) !important;
  font-size:.72rem !important;
  font-weight:750 !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
}

/* Projected tooltip winners keep called-row treatment, while non-projected rows keep normal candidate styling. */
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:is(.is-winner,.winD,.winR,[data-cme-projected="winner"]){
  border-color:rgba(255,255,255,.22) !important;
  color:#fff !important;
  box-shadow:var(--cmep-call-shadow, 0 14px 30px rgba(2,6,23,.20), inset 0 1px 0 rgba(255,255,255,.22)) !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:is(.winD,[data-cme-projection-party="D"]){
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-d, #0076ba) 96%, #00111f 4%), color-mix(in srgb, var(--cmep-call-d, #0076ba) 70%, #fff 30%)) !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:is(.winR,[data-cme-projection-party="R"]){
  background:linear-gradient(135deg, color-mix(in srgb, var(--cmep-call-r, #ee220c) 96%, #210000 4%), color-mix(in srgb, var(--cmep-call-r, #ee220c) 70%, #fff 30%)) !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:is(.is-winner,.winD,.winR,[data-cme-projected="winner"]) :is(.ct-name,.p,.ct-party,.ct-pct,.ct-votes){
  color:#fff !important;
  opacity:1 !important;
  text-shadow:0 1px 2px rgba(0,0,0,.25) !important;
}
html body.en-primary-detail :is(#countyTooltipLive,#countyTooltipAnalysis,#countyTooltipLiveSenate,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate,.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-row:is(.is-winner,.winD,.winR,[data-cme-projected="winner"]) .ct-dot{
  display:inline-block !important;
  visibility:visible !important;
  opacity:1 !important;
}

@media (max-width:760px){
  html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status{
    flex-direction:column !important;
    align-items:flex-start !important;
  }
  html body.en-primary-house-detail #electionNightHouse #resultsMount .primary-call-status .cs-pill{
    align-self:flex-start !important;
  }
}

/* ======================================================================
   House live-map tooltip/result-card parity — 2026-06-24
   Tooltips should use the same compact candidate-row language as the
   results cards: dark row shell, left name/party stack, right pct/votes
   stack, and the same horizontal vote bar immediately below each row.
   ====================================================================== */
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-rows{
  display:block !important;
  margin-top:.62rem !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:.7rem !important;
  width:100% !important;
  min-width:0 !important;
  padding:.54rem .62rem .48rem !important;
  margin:.44rem 0 0 !important;
  border-radius:12px !important;
  border:1px solid rgba(148,163,184,.13) !important;
  background:rgba(15,23,42,.34) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045) !important;
  color:var(--cmep-strong,#f8fafc) !important;
  overflow:hidden !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row + .ct-row{
  margin-top:.44rem !important;
  border-top:1px solid rgba(148,163,184,.13) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-left{
  display:flex !important;
  align-items:center !important;
  min-width:0 !important;
  gap:.52rem !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-left > div{
  min-width:0 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-name{
  display:block !important;
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  font-size:.82rem !important;
  line-height:1.05 !important;
  font-weight:900 !important;
  letter-spacing:-.01em !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) :is(.ct-party,.p){
  display:block !important;
  margin-top:.08rem !important;
  color:rgba(226,232,240,.78) !important;
  -webkit-text-fill-color:rgba(226,232,240,.78) !important;
  font-size:.66rem !important;
  line-height:1.05 !important;
  font-weight:800 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-right{
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  justify-content:center !important;
  min-width:4.25rem !important;
  text-align:right !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-pct{
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  font-size:.92rem !important;
  line-height:1 !important;
  font-weight:950 !important;
  letter-spacing:-.015em !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-votes{
  margin-top:.1rem !important;
  color:rgba(226,232,240,.76) !important;
  -webkit-text-fill-color:rgba(226,232,240,.76) !important;
  font-size:.62rem !important;
  line-height:1.05 !important;
  font-weight:800 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-bar{
  display:block !important;
  width:100% !important;
  height:.32rem !important;
  margin:.32rem 0 .12rem !important;
  border-radius:999px !important;
  overflow:hidden !important;
  background:rgba(148,163,184,.18) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-bar > div{
  display:block !important;
  height:100% !important;
  border-radius:999px !important;
  min-width:2px !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-dot{
  width:.64rem !important;
  min-width:.64rem !important;
  max-width:.64rem !important;
  height:.64rem !important;
  min-height:.64rem !important;
  max-height:.64rem !important;
  border-radius:999px !important;
  box-shadow:0 0 0 2px rgba(255,255,255,.08) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row[data-cme-projected="winner"]{
  border-color:rgba(255,255,255,.16) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), 0 8px 20px rgba(0,0,0,.18) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row[data-cme-projection-party="D"]{
  background:linear-gradient(135deg,rgba(14,165,233,.98),rgba(2,132,199,.92)) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row[data-cme-projection-party="R"]{
  background:linear-gradient(135deg,rgba(239,68,68,.98),rgba(220,38,38,.92)) !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row[data-cme-projected="winner"] .cme-state-row-glyph{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  width:1.1rem !important;
  height:1.1rem !important;
  border-radius:999px !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  background:rgba(255,255,255,.2) !important;
  border:1px solid rgba(255,255,255,.25) !important;
  font-size:.72rem !important;
  font-weight:950 !important;
  line-height:1 !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .ct-row[data-cme-projected="winner"] .ct-dot{
  display:none !important;
}
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .tip-link,
body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate) .tooltip-view-all{
  margin-top:.66rem !important;
}

/* ======================================================================
   Tooltip/result-card parity finalizer — 2026-06-24
   The live-map tooltip should mirror the compact candidate rows used in
   the results cards: no decorative header flair, a dark row shell for each
   candidate, and a horizontal vote bar after each row.
   ====================================================================== */
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-title,.ct-head,.ct-top){
  background:transparent !important;
  background-image:none !important;
  box-shadow:none !important;
  border:0 !important;
  border-bottom:1px solid rgba(148,163,184,.16) !important;
  border-radius:0 !important;
  padding:.08rem 0 .64rem !important;
  margin:0 0 .72rem !important;
  color:var(--text-strong,#f8fafc) !important;
  -webkit-text-fill-color:var(--text-strong,#f8fafc) !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-title,.ct-head,.ct-top)::before,
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-title,.ct-head,.ct-top)::after{
  content:none !important;
  display:none !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row::before,
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row::after{
  content:none !important;
  display:none !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:.72rem !important;
  width:100% !important;
  min-width:0 !important;
  padding:.58rem .66rem .52rem !important;
  margin:.48rem 0 0 !important;
  border:1px solid rgba(148,163,184,.14) !important;
  border-radius:14px !important;
  background:rgba(15,23,42,.36) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045) !important;
  overflow:hidden !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row + .ct-row{
  border-top:1px solid rgba(148,163,184,.14) !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-left{
  display:flex !important;
  align-items:center !important;
  gap:.58rem !important;
  min-width:0 !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-left > div{
  min-width:0 !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-name{
  display:block !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  font-size:.86rem !important;
  line-height:1.05 !important;
  font-weight:950 !important;
  letter-spacing:-.012em !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) :is(.ct-party,.p){
  display:block !important;
  margin-top:.08rem !important;
  color:rgba(226,232,240,.78) !important;
  -webkit-text-fill-color:rgba(226,232,240,.78) !important;
  font-size:.66rem !important;
  line-height:1.05 !important;
  font-weight:800 !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-right{
  min-width:4.4rem !important;
  text-align:right !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  justify-content:center !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-pct{
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  font-size:.98rem !important;
  line-height:1 !important;
  font-weight:950 !important;
  letter-spacing:-.015em !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-votes{
  margin-top:.1rem !important;
  color:rgba(226,232,240,.76) !important;
  -webkit-text-fill-color:rgba(226,232,240,.76) !important;
  font-size:.62rem !important;
  line-height:1.05 !important;
  font-weight:800 !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-bar{
  display:block !important;
  width:100% !important;
  height:.34rem !important;
  margin:.34rem 0 .12rem !important;
  border-radius:999px !important;
  overflow:hidden !important;
  background:rgba(148,163,184,.18) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06) !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-bar > div{
  display:block !important;
  height:100% !important;
  min-width:2px !important;
  border-radius:999px !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.is-winner,.winD,.winR,[data-cme-projected="winner"]){
  border-color:rgba(255,255,255,.18) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), 0 8px 20px rgba(0,0,0,.18) !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.winD,[data-cme-projection-party="D"]){
  background:linear-gradient(135deg,rgba(14,165,233,.98),rgba(2,132,199,.92)) !important;
}
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is(.winR,[data-cme-projection-party="R"]){
  background:linear-gradient(135deg,rgba(239,68,68,.98),rgba(220,38,38,.92)) !important;
}

/* ======================================================================
   v19: projected-winner glyph parity for tooltips/results rows
   Winners use the same checkmark-in-circle projection glyph as the results
   card and suppress the ordinary candidate color dot. Advancers keep their
   candidate color dot because advancement is not the same visual state as a
   winner projection.
   ====================================================================== */
html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) :is(.primary-dot,.ct-dot),
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) .ct-dot{
  display:none !important;
}

html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) .cme-state-row-glyph,
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) .cme-state-row-glyph{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  border-radius:999px !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  background:linear-gradient(135deg,rgba(255,255,255,.30),rgba(255,255,255,.14)) !important;
  border:1px solid rgba(255,255,255,.46) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.32), 0 6px 14px rgba(2,6,23,.20) !important;
  font-weight:1000 !important;
  line-height:1 !important;
  text-shadow:0 2px 4px rgba(0,0,0,.32) !important;
}

html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) .cme-state-row-glyph{
  width:1.62rem !important;
  min-width:1.62rem !important;
  height:1.62rem !important;
  font-size:1.05rem !important;
  letter-spacing:-.035em !important;
}

html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is([data-cme-projected="winner"],.is-winner,.winD,.winR) .cme-state-row-glyph{
  width:2.18rem !important;
  min-width:2.18rem !important;
  height:2.18rem !important;
  font-size:1.42rem !important;
  letter-spacing:-.04em !important;
}

html body.en-primary-detail :is(.cmep-primary-detail-surface,#electionNightGovernor,#electionNightSenate,#electionNightHouse,#countyListMount,#countyListMountSenate) .primary-row:is([data-cme-projected="advance"],.is-advance) :is(.primary-dot,.ct-dot),
html body.en-primary-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout,#countyTooltipLive,#countyTooltipLiveSenate,#countyTooltipAnalysis,#countyTooltipAnalysisGovernor,#countyTooltipAnalysisSenate) .ct-row:is([data-cme-projected="advance"],.is-advance) .ct-dot{
  display:inline-flex !important;
  opacity:1 !important;
}


/* 2026-06-28: mobile live-status alignment pass
   Keep LIVE / Updated text left-aligned on election-night primary, runoff, and special detail pages. */
@media (max-width: 720px){
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    gap:.62rem !important;
    text-align:left !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card > .card-header > div:first-child{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
    text-align:left !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .live-row{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    justify-self:start !important;
    align-self:stretch !important;
    justify-content:flex-start !important;
    align-items:center !important;
    flex-wrap:wrap !important;
    gap:.42rem .5rem !important;
    margin:.28rem 0 0 0 !important;
    text-align:left !important;
    white-space:normal !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .last-updated{
    display:inline-flex !important;
    justify-content:flex-start !important;
    text-align:left !important;
    white-space:nowrap !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card .card-help{
    justify-self:start !important;
    align-self:stretch !important;
    min-width:0 !important;
    max-width:100% !important;
    margin:.28rem 0 0 0 !important;
    text-align:left !important;
    white-space:normal !important;
  }
  html body.en-primary-detail :is(#resultsCard,#resultsCardSenate).cmep-results-card :is(#resultsRefreshBtn,#resultsRefreshBtnSenate,.primary-refresh-btn){
    align-self:flex-start !important;
  }
}

/* -------------------------------------------------------------------------
   Mobile page/card width parity restore — 2026-07-01
   -------------------------------------------------------------------------
   The primary state and House detail pages should use the same near-full-width
   mobile shell as the homepage: a tiny safe-area gutter on the viewport shell,
   then cards consume the full remaining width. Older detail rules reintroduced
   larger nested container gutters, making these cards visibly narrower on phone.
*/
@media (max-width:760px){
  html body.en-primary-detail,
  html body.en-primary-detail *{
    box-sizing:border-box !important;
  }

  html body.en-primary-detail{
    overflow-x:hidden !important;
  }

  html body.en-primary-detail .container{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:max(5px, env(safe-area-inset-left)) !important;
    padding-right:max(5px, env(safe-area-inset-right)) !important;
    padding-top:calc(.75rem + var(--header-offset, 0px)) !important;
  }

  html body.en-primary-detail :is(
    .page-head,
    .state-hero,
    #officeViews,
    .cmep-primary-detail-surface,
    #electionNightGovernor,
    #electionNightSenate,
    #electionNightHouse,
    #view-house,
    #view-senate,
    #view-governor,
    .grid-2,
    .left-col,
    .right-col,
    .district-grid,
    .district-list,
    .cmep-results-mount,
    #resultsMount,
    #resultsMountSenate,
    #countyGrid,
    #countyGridSenate
  ){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  html body.en-primary-detail :is(
    .cmep-primary-detail-surface,
    #electionNightGovernor,
    #electionNightSenate,
    #electionNightHouse
  ) .grid-2{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) !important;
    gap:8px !important;
  }

  html body.en-primary-detail :is(
    .cmep-primary-detail-surface,
    #electionNightGovernor,
    #electionNightSenate,
    #electionNightHouse,
    #view-house,
    #view-senate,
    #view-governor
  ) :is(.card,.cm-card),
  html body.en-primary-detail :is(
    #resultsCard,
    #resultsCardSenate,
    #liveMapCard,
    #liveMapCardSenate,
    #countyListCard,
    #countyListCardSenate,
    #analysisMapCardGovernor,
    #analysisMapCardSenate,
    .state-analytics-card
  ),
  html body.en-primary-detail :is(
    .primary-race,
    .race-result-card,
    .county-result-card,
    .no-election-result-card,
    .district-card,
    .house-district-tile,
    .district-tile
  ){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    justify-self:stretch !important;
  }

  html body.en-primary-detail :is(#countyGrid,#countyGridSenate,.district-grid){
    grid-template-columns:minmax(0, 1fr) !important;
  }
}

@media (max-width:390px){
  html body.en-primary-detail .container{
    padding-left:max(4px, env(safe-area-inset-left)) !important;
    padding-right:max(4px, env(safe-area-inset-right)) !important;
  }
}


/* -------------------------------------------------------------------------
   Mobile detail width parity hardening — 2026-07-04
   -------------------------------------------------------------------------
   Match the homepage/hero/projection width on primary state and House detail
   pages. Legacy generated CSS can leave the active office grid/card section
   with extra nested gutters, making the results card visibly narrower than the
   state header and projection strap. On phone widths, collapse the active
   office view and live rows into a single full-width block and make every card
   consume the same available shell width.
*/
@media (max-width:760px){
  html body.en-primary-detail{
    --cmep-detail-mobile-gutter-left:max(5px, env(safe-area-inset-left));
    --cmep-detail-mobile-gutter-right:max(5px, env(safe-area-inset-right));
    overflow-x:hidden !important;
  }

  html body.en-primary-detail :is(.container,main,#main-content){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:var(--cmep-detail-mobile-gutter-left) !important;
    padding-right:var(--cmep-detail-mobile-gutter-right) !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail :is(.page-head,.state-hero,#alerts,#globalWinnerBanner,#officeViews){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail #officeViews > .state-grid.office-view:not(.active){
    display:none !important;
  }

  html body.en-primary-detail #officeViews > .state-grid.office-view.active{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail #officeViews > .state-grid.office-view.active > :is(.cmep-primary-detail-surface,#electionNightHouse){
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    grid-column:1 / -1 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse,.cmep-primary-detail-surface) > :is(.grid-2,#liveRow,#liveRowSenate,.district-grid),
  html body.en-primary-detail :is(#liveRow,#liveRowSenate,.grid-2,.district-grid){
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    gap:8px !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail :is(
    #resultsCard,#resultsCardSenate,
    #liveMapCard,#liveMapCardSenate,
    #countyListCard,#countyListCardSenate,
    #analysisMapCardGovernor,#analysisMapCardSenate,
    .state-analytics-card,
    .district-card,.district-tile,.house-district-tile,
    .card,.cm-card
  ){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    justify-self:stretch !important;
    align-self:stretch !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail :is(#resultsMount,#resultsMountSenate,.cmep-results-mount,.primary-mount,.primary-grid){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-detail :is(.primary-race,.race-result-card,.county-result-card,.no-election-result-card){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
  }
}

@media (max-width:390px){
  html body.en-primary-detail{
    --cmep-detail-mobile-gutter-left:max(4px, env(safe-area-inset-left));
    --cmep-detail-mobile-gutter-right:max(4px, env(safe-area-inset-right));
  }
}

/* -------------------------------------------------------------------------
   v3 mobile width parity — primary state detail only
   -------------------------------------------------------------------------
   House detail was already correct. The state detail page still had a nested
   results grid/card width that rendered narrower than the state hero and the
   projection banner on phones. Keep every state-detail content band on the
   same mobile shell and neutralize the legacy state results grid gutters.
*/
@media (max-width:760px){
  html body.en-primary-state-detail{
    --cmep-detail-mobile-gutter-left:max(5px, env(safe-area-inset-left));
    --cmep-detail-mobile-gutter-right:max(5px, env(safe-area-inset-right));
  }

  html body.en-primary-state-detail :is(.container,main,#main-content){
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:var(--cmep-detail-mobile-gutter-left) !important;
    padding-right:var(--cmep-detail-mobile-gutter-right) !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(.page-head,.state-hero,#alerts,#globalWinnerBanner,#officeActions,#officeViews){
    width:100% !important;
    max-width:100% !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail #officeViews > :is(#view-governor,#view-senate).state-grid.office-view.active{
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(#electionNightGovernor,#electionNightSenate,.cmep-primary-detail-surface){
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(#liveRow,#liveRowSenate,#electionNightGovernor > .grid-2,#electionNightSenate > .grid-2){
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    padding:0 !important;
    gap:8px !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(
    #resultsCard,#resultsCardSenate,
    #liveMapCard,#liveMapCardSenate,
    #countyListCard,#countyListCardSenate,
    #analysisMapCardGovernor,#analysisMapCardSenate,
    .state-analytics-card
  ){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    justify-self:stretch !important;
    align-self:stretch !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(#resultsMount,#resultsMountSenate,#countyListMount,#countyListMountSenate,.primary-mount,.cmep-results-mount,.primary-grid){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    box-sizing:border-box !important;
  }
}

@media (max-width:390px){
  html body.en-primary-state-detail{
    --cmep-detail-mobile-gutter-left:max(4px, env(safe-area-inset-left));
    --cmep-detail-mobile-gutter-right:max(4px, env(safe-area-inset-right));
  }
}


/* -------------------------------------------------------------------------
   v4 hard state-detail mobile bleed parity
   -------------------------------------------------------------------------
   The House detail page uses the correct phone-width card shell. State detail
   pages can still inherit a narrower nested office/results wrapper. This final
   state-only mobile override centers the results/map/counties/analytics bands
   against the viewport, matching the hero/projection width instead of the
   legacy state-office inner wrapper.
*/
@media (max-width:760px){
  html body.en-primary-state-detail{
    --cmep-state-detail-phone-shell:calc(100vw - 10px);
    overflow-x:hidden !important;
  }

  html body.en-primary-state-detail :is(
    #liveRow,
    #liveRowSenate,
    #resultsCard,
    #resultsCardSenate,
    #liveMapCard,
    #liveMapCardSenate,
    #countyListCard,
    #countyListCardSenate,
    #analysisMapCardGovernor,
    #analysisMapCardSenate,
    .state-analytics-card
  ){
    width:var(--cmep-state-detail-phone-shell) !important;
    max-width:var(--cmep-state-detail-phone-shell) !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(
    #liveRow,
    #liveRowSenate,
    #countyListCard,
    #countyListCardSenate,
    #analysisMapCardGovernor,
    #analysisMapCardSenate,
    .state-analytics-card
  ){
    position:relative !important;
    left:50% !important;
    transform:translateX(-50%) !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  html body.en-primary-state-detail :is(#resultsCard,#resultsCardSenate,#liveMapCard,#liveMapCardSenate){
    justify-self:stretch !important;
    align-self:stretch !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }

  html body.en-primary-state-detail :is(#electionNightGovernor,#electionNightSenate,.cmep-primary-detail-surface,#officeViews,#view-governor,#view-senate){
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }
}

@media (max-width:390px){
  html body.en-primary-state-detail{
    --cmep-state-detail-phone-shell:calc(100vw - 8px);
  }
}

/* -------------------------------------------------------------------------
   v5 FINAL state-detail mobile card width parity
   -------------------------------------------------------------------------
   The House detail template is visually correct on phones. State detail pages
   still have an inner state-office wrapper that can make the Governor/Senate
   live result cards narrower than the hero/projection banner. Do not rely on
   inherited grid/container widths here: place each state live card on the same
   phone shell as the House detail cards by centering it against the viewport.
*/
@media (max-width:760px){
  html body.en-primary-state-detail{
    --cmep-phone-card-shell:calc(100vw - 10px);
    overflow-x:hidden !important;
  }

  html body.en-primary-state-detail :is(.container,main,#main-content,#officeViews,#view-governor,#view-senate,#electionNightGovernor,#electionNightSenate,.cmep-primary-detail-surface){
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(#officeViews,#view-governor,#view-senate,#electionNightGovernor,#electionNightSenate,.cmep-primary-detail-surface,#liveRow,#liveRowSenate){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    padding-left:0 !important;
    padding-right:0 !important;
    box-sizing:border-box !important;
  }

  html body.en-primary-state-detail :is(#liveRow,#liveRowSenate){
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) !important;
    gap:8px !important;
    justify-items:center !important;
  }

  html body.en-primary-state-detail :is(
    #resultsCard,
    #resultsCardSenate,
    #liveMapCard,
    #liveMapCardSenate,
    #countyListCard,
    #countyListCardSenate,
    #analysisMapCardGovernor,
    #analysisMapCardSenate,
    .state-analytics-card
  ){
    width:var(--cmep-phone-card-shell) !important;
    max-width:var(--cmep-phone-card-shell) !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    justify-self:center !important;
    align-self:stretch !important;
    position:relative !important;
    left:50% !important;
    transform:translateX(-50%) !important;
    margin-left:0 !important;
    margin-right:0 !important;
  }
}

@media (max-width:390px){
  html body.en-primary-state-detail{
    --cmep-phone-card-shell:calc(100vw - 8px);
  }
}


/* CMEP 2026-07-04: unified pinned county tooltip behavior.
   Keep mobile popouts inside the viewport and let outside-click JS close pinned
   tooltips consistently on House and State detail pages. */
@media (max-width: 640px){
  html body.en-primary-detail > .county-tooltip.mobile-popout,
  html body.en-primary-detail > .county-tooltip.mobile-popout.show,
  html body.en-primary-state-detail > .county-tooltip.mobile-popout,
  html body.en-primary-state-detail > .county-tooltip.mobile-popout.show,
  html body > .county-tooltip.mobile-popout,
  html body > .county-tooltip.mobile-popout.show{
    position: fixed !important;
    left: max(8px, env(safe-area-inset-left, 0px)) !important;
    right: max(8px, env(safe-area-inset-right, 0px)) !important;
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(48svh, 380px) !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
    transform: none !important;
    box-sizing: border-box !important;
    z-index: 2147483646 !important;
    pointer-events: auto !important;
    display: block !important;
  }
  html body > .county-tooltip.mobile-popout::after{
    display: none !important;
  }
}

@media (min-width: 641px){
  html body.en-primary-detail > .county-tooltip.is-pinned,
  html body.en-primary-state-detail > .county-tooltip.is-pinned{
    z-index: 2147483646 !important;
    pointer-events: auto !important;
  }
}

/* v6 — state detail mobile tooltip parity with House detail.
   Fully constrain state county popouts to the viewport and prevent hidden/stale
   bottom sheets from intercepting mobile taps after dismissal. */
@media (max-width: 640px), (hover: none), (pointer: coarse){
  body.en-primary-state-detail > .county-tooltip.mobile-popout,
  body.en-primary-state-detail > .county-tooltip.mobile-popout.show,
  body.en-primary-state-detail .county-tooltip.mobile-popout,
  body.en-primary-state-detail .county-tooltip.mobile-popout.show{
    position:fixed !important;
    left:10px !important;
    right:10px !important;
    top:auto !important;
    bottom:calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width:auto !important;
    min-width:0 !important;
    max-width:calc(100vw - 20px) !important;
    max-height:min(48vh, 390px) !important;
    overflow:auto !important;
    overscroll-behavior:contain !important;
    transform:none !important;
    z-index:2147483646 !important;
    pointer-events:auto !important;
    box-sizing:border-box !important;
    touch-action:pan-y !important;
  }
  body.en-primary-state-detail > .county-tooltip:not(.show),
  body.en-primary-state-detail .county-tooltip:not(.show){
    pointer-events:none !important;
  }
}

/* =========================================================
   2026-07-04 final: Election Night View All modal must clear injected header
   ---------------------------------------------------------
   The injected homepage-style header is fixed at z-index:10000. Earlier shared
   detail CSS re-declared the county modal at z-index:9999 with ID-scoped
   selectors, which beat the generic header.css override and let the header sit
   above the active modal. Keep the modal in the viewport and above every fixed
   header layer on state, senate, governor, house, runoff, and special detail
   variants.
   ========================================================= */
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) > :is(#countyModal,#countyModalSenate,.modal),
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal.view-all-modal,.cmep-modal){
  position:fixed !important;
  inset:0 !important;
  z-index:2147483000 !important;
  isolation:isolate !important;
}
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) > :is(#countyModal,#countyModalSenate,.modal).open,
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#electionNightGovernor,#electionNightSenate,#electionNightHouse) > :is(#countyModal,#countyModalSenate,.modal)[aria-hidden="false"],
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal.view-all-modal,.cmep-modal).open,
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal.view-all-modal,.cmep-modal)[aria-hidden="false"]{
  display:block !important;
  visibility:visible !important;
  pointer-events:auto !important;
}
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal,.cmep-modal,.view-all-modal) > .modal-backdrop,
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal,.cmep-modal,.view-all-modal) .modal-backdrop{
  position:absolute !important;
  inset:0 !important;
  z-index:0 !important;
}
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal,.cmep-modal,.view-all-modal) > .modal-card,
html body:is(.cmep-election-night-page,.en-primary-detail,.en-primary-state-detail,.en-primary-house-detail,.en-special-house-detail)
  :is(#countyModal,#countyModalSenate,.modal,.cmep-modal,.view-all-modal) .modal-card{
  position:relative !important;
  z-index:1 !important;
}
