/* CM Election Predictions — House district/detail static parity with election-night House detail
   This file is the static-page adapter. Shared election-night detail CSS is loaded first; these
   rules preserve forecast data wiring while using the same page chrome and layout contract. */

body.cmep-page-house-district-detail{
  --cmep-card-radius:24px;
  --cmep-inner-radius:18px;
  --cmep-line:var(--border-subtle,rgba(148,163,184,.26));
  --cmep-panel:var(--bg-card,#fff);
  --cmep-panel-soft:color-mix(in srgb,var(--bg-card,#fff) 92%,var(--text-main,#0f172a) 4%);
  --cmep-muted:var(--text-muted,#64748b);
  --cmep-card-shadow:0 18px 42px rgba(15,23,42,.08),inset 0 1px 0 rgba(255,255,255,.14);
  --cmep-card-shadow-dark:0 18px 42px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.08);
}

/* Shared election-night House CSS hides some static forecast blocks by id. Undo that for this page. */
html body.cmep-page-house-district-detail-static :is(#historyCard,#sourcesCard,#incumbentMount,#primarySourceAttrib),
html body.cmep-page-house-district-detail-static #electionNightHouse > :is(#historyCard,#sourcesCard,#incumbentMount){
  display:block !important;
  visibility:visible !important;
}

/* Same width/rhythm contract used by election-night detail pages and state/detail. */
html body.cmep-page-house-district-detail .container{
  width:min(1720px,calc(100vw - 48px)) !important;
  max-width:none !important;
  margin-inline:auto !important;
  padding-top:calc(1.2rem + var(--header-offset,0px)) !important;
  padding-bottom:1.35rem !important;
}
html body.cmep-page-house-district-detail .page-head{
  margin:clamp(.6rem,1.4vw,1.2rem) 0 clamp(1rem,2vw,1.7rem) !important;
}
html body.cmep-page-house-district-detail .state-hero{
  width:100% !important;
  border-radius:28px !important;
  padding:clamp(1.1rem,2vw,1.75rem) !important;
  overflow:hidden !important;
}
html body.cmep-page-house-district-detail .state-name{
  font-size:clamp(2.15rem,4.6vw,4.8rem) !important;
  line-height:.95 !important;
  letter-spacing:-.055em !important;
}
html body.cmep-page-house-district-detail .state-subtitle{
  max-width:72ch !important;
  margin-inline:auto !important;
}
html body.cmep-page-house-district-detail .page-actions{
  justify-content:center !important;
  gap:.7rem !important;
}
html body.cmep-page-house-district-detail #votingBtn{ margin-left:0 !important; }
html body.cmep-page-house-district-detail .back-btn{
  min-height:2.25rem !important;
  border-radius:999px !important;
  font-weight:850 !important;
}

/* Static forecast page uses its own two columns; make them match the House election-night detail surfaces. */
html body.cmep-page-house-district-detail #houseDistrictDetailSurface.layout{
  display:grid !important;
  grid-template-columns:minmax(420px,.92fr) minmax(520px,1.08fr) !important;
  gap:clamp(1rem,2vw,1.45rem) !important;
  align-items:start !important;
  width:100% !important;
}
html body.cmep-page-house-district-detail .left-col,
html body.cmep-page-house-district-detail .right-col{
  display:flex !important;
  flex-direction:column !important;
  gap:clamp(1rem,2vw,1.45rem) !important;
  min-width:0 !important;
}

/* Card chrome mirrors election-night/detail instead of the older static House page. */
html body.cmep-page-house-district-detail .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;
  padding:clamp(1rem,1.8vw,1.45rem) !important;
  min-width:0 !important;
  overflow:hidden !important;
}
@media (prefers-color-scheme:dark){
  html body.cmep-page-house-district-detail .card{ box-shadow:var(--cmep-card-shadow-dark) !important; }
}
html body.cmep-page-house-district-detail .card-header{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:1rem !important;
  padding-bottom:.9rem !important;
  margin-bottom:.9rem !important;
  border-bottom:1px solid var(--cmep-line) !important;
}
html body.cmep-page-house-district-detail .card-title{
  font-size:clamp(1.35rem,2vw,1.9rem) !important;
  line-height:1.02 !important;
  letter-spacing:-.04em !important;
  font-weight:950 !important;
}
html body.cmep-page-house-district-detail .card-help{
  font-size:.95rem !important;
  line-height:1.38 !important;
  color:var(--cmep-muted) !important;
}

/* Inner forecast blocks use the same elevated row/card language as the live detail page. */
html body.cmep-page-house-district-detail :is(.race,.cand-tile,.note,.chart-wrap,.analysis-summary,.attrib){
  border-radius:var(--cmep-inner-radius) !important;
  border:1px solid color-mix(in srgb,var(--cmep-line) 88%,transparent) !important;
  background:var(--cmep-panel-soft) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.06),inset 0 1px 0 rgba(255,255,255,.10) !important;
}
html body.cmep-page-house-district-detail .race{ padding:clamp(.9rem,1.4vw,1.15rem) !important; }
html body.cmep-page-house-district-detail .race-head{ align-items:flex-start !important; gap:.8rem !important; }
html body.cmep-page-house-district-detail .race-name{
  font-size:clamp(1.02rem,1.5vw,1.25rem) !important;
  letter-spacing:-.025em !important;
  font-weight:950 !important;
}
html body.cmep-page-house-district-detail .race-right{
  background:var(--cmep-panel-soft) !important;
  border-radius:999px !important;
  gap:.45rem !important;
}
html body.cmep-page-house-district-detail :is(.rating-pill,.pill){
  min-height:1.55rem !important;
  padding:.32rem .72rem !important;
  font-weight:950 !important;
  letter-spacing:-.01em !important;
}
html body.cmep-page-house-district-detail .prob-row{ gap:.55rem !important; }
html body.cmep-page-house-district-detail .prob-bar{ height:.72rem !important; }
html body.cmep-page-house-district-detail .inc-photo{
  width:82px !important;
  height:102px !important;
  border-radius:16px !important;
}
html body.cmep-page-house-district-detail .inc-name{
  font-size:1.05rem !important;
  font-weight:950 !important;
  letter-spacing:-.02em !important;
}

/* Map stages and reset buttons match the election-night card contract. */
html body.cmep-page-house-district-detail .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;
}
html body.cmep-page-house-district-detail #mapHero{ height:clamp(420px,56vh,620px) !important; }
html body.cmep-page-house-district-detail #mapAnalysisHouse{ height:clamp(420px,52vh,560px) !important; }
html body.cmep-page-house-district-detail .reset-view-btn{
  top:.85rem !important;
  left:.85rem !important;
  right:auto !important;
  z-index:8 !important;
  opacity:0 !important;
  pointer-events:none !important;
  transform:translateY(-6px) !important;
  border-radius:999px !important;
  min-height:2.15rem !important;
  padding:.5rem .8rem !important;
  font-weight:950 !important;
}
html body.cmep-page-house-district-detail .reset-view-btn.show{
  opacity:1 !important;
  pointer-events:auto !important;
  transform:translateY(0) !important;
}
html body.cmep-page-house-district-detail .county-tooltip{
  border-radius:16px !important;
  border:1px solid rgba(148,163,184,.24) !important;
  box-shadow:0 18px 42px rgba(2,6,23,.22) !important;
}

/* Rating changelog: use universal pill behavior; do not let legacy static styles recolor text. */
html body.cmep-page-house-district-detail #cl-dist-wrap .card-header{
  justify-content:center !important;
  text-align:center !important;
}
html body.cmep-page-house-district-detail .cl-controls{ margin-bottom:1rem !important; }
html body.cmep-page-house-district-detail .cl-entry{
  border-radius:14px !important;
  background:var(--cmep-panel-soft) !important;
  border-color:var(--cmep-line) !important;
}
html body.cmep-page-house-district-detail .cl-pill{ color:#fff !important; }

@media (max-width:980px){
  html body.cmep-page-house-district-detail .container{
    width:100% !important;
    max-width:none !important;
    padding-left:12px !important;
    padding-right:12px !important;
    box-sizing:border-box !important;
  }
  html body.cmep-page-house-district-detail #houseDistrictDetailSurface.layout{ grid-template-columns:1fr !important; }
  html body.cmep-page-house-district-detail .card{
    border-radius:22px !important;
    padding:1rem !important;
  }
  html body.cmep-page-house-district-detail .card-title{
    font-size:clamp(1.22rem,6vw,1.55rem) !important;
  }
  html body.cmep-page-house-district-detail :is(.map,#mapHero,#mapAnalysisHouse){
    min-height:360px !important;
    height:380px !important;
  }
}
@media (max-width:560px){
  html body.cmep-page-house-district-detail .container{
    padding-left:10px !important;
    padding-right:10px !important;
  }
  html body.cmep-page-house-district-detail .state-hero{ padding:1rem .75rem !important; }
  html body.cmep-page-house-district-detail .page-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    width:100% !important;
  }
  html body.cmep-page-house-district-detail .back-btn{
    width:100% !important;
    justify-content:center !important;
  }
  html body.cmep-page-house-district-detail .race-head{ gap:.7rem !important; }
  html body.cmep-page-house-district-detail .race-right{ width:100% !important; }
  html body.cmep-page-house-district-detail .prob-row{ align-items:stretch !important; }
  html body.cmep-page-house-district-detail .prob-label-r{ margin-left:0 !important; }
  html body.cmep-page-house-district-detail :is(.map,#mapHero,#mapAnalysisHouse){
    min-height:315px !important;
    height:330px !important;
  }
}

/* v39: final typography parity and rating-colored district hero overlay. */
html body.cmep-page-house-district-detail .state-hero .hero-district-fill-path{
  fill:var(--district-color,var(--toss-up,#929292)) !important;
  opacity:.50 !important;
  filter:drop-shadow(0 0 7px color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 42%,transparent)) drop-shadow(0 1px 2px rgba(15,23,42,.18)) !important;
}
html body.cmep-page-house-district-detail .state-hero .hero-district-outline-path{
  stroke:color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 78%,var(--text-main,#111827) 22%) !important;
  stroke-width:2.05 !important;
  opacity:1 !important;
}
html[data-theme="dark"] body.cmep-page-house-district-detail .state-hero .hero-district-fill-path,
html.dark body.cmep-page-house-district-detail .state-hero .hero-district-fill-path,
body.dark.cmep-page-house-district-detail .state-hero .hero-district-fill-path,
body.dark-mode.cmep-page-house-district-detail .state-hero .hero-district-fill-path,
body.theme-dark.cmep-page-house-district-detail .state-hero .hero-district-fill-path{
  fill:var(--district-color,var(--toss-up,#929292)) !important;
  opacity:.68 !important;
  filter:drop-shadow(0 0 9px color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 46%,transparent)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
}
html[data-theme="dark"] body.cmep-page-house-district-detail .state-hero .hero-district-outline-path,
html.dark body.cmep-page-house-district-detail .state-hero .hero-district-outline-path,
body.dark.cmep-page-house-district-detail .state-hero .hero-district-outline-path,
body.dark-mode.cmep-page-house-district-detail .state-hero .hero-district-outline-path,
body.theme-dark.cmep-page-house-district-detail .state-hero .hero-district-outline-path{
  stroke:color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 70%,#fff 30%) !important;
  stroke-width:2.1 !important;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 34%,transparent)) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-house-district-detail .state-hero .hero-district-fill-path{
    fill:var(--district-color,var(--toss-up,#929292)) !important;
    opacity:.68 !important;
    filter:drop-shadow(0 0 9px color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 46%,transparent)) drop-shadow(0 1px 2px rgba(0,0,0,.42)) !important;
  }
  html:not([data-theme="light"]) body.cmep-page-house-district-detail .state-hero .hero-district-outline-path{
    stroke:color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 70%,#fff 30%) !important;
    stroke-width:2.1 !important;
    filter:drop-shadow(0 0 8px color-mix(in srgb,var(--district-color,var(--toss-up,#929292)) 34%,transparent)) !important;
  }
}

/* Static-only forecast modules: align text scale/weight with the election-night detail system. */
html body.cmep-page-house-district-detail .state-prefix{
  font-size:clamp(.78rem,1vw,.95rem) !important;
  letter-spacing:.18em !important;
  font-weight:950 !important;
  text-transform:uppercase !important;
}
html body.cmep-page-house-district-detail .state-subtitle,
html body.cmep-page-house-district-detail .card-help,
html body.cmep-page-house-district-detail .note,
html body.cmep-page-house-district-detail .attrib{
  font-size:.95rem !important;
  line-height:1.38 !important;
}
html body.cmep-page-house-district-detail .race-name,
html body.cmep-page-house-district-detail .inc-name{
  font-size:clamp(1.05rem,1.35vw,1.28rem) !important;
  line-height:1.04 !important;
  letter-spacing:-.035em !important;
  font-weight:1000 !important;
}
html body.cmep-page-house-district-detail :is(.rating-pill,.pill){
  font-size:.78rem !important;
  line-height:1 !important;
  font-weight:950 !important;
}
html body.cmep-page-house-district-detail .prob-label{
  font-size:.78rem !important;
  font-weight:850 !important;
  line-height:1.1 !important;
}
html body.cmep-page-house-district-detail .cand-title,
html body.cmep-page-house-district-detail .model-drivers-label,
html body.cmep-page-house-district-detail .analysis-summary-kicker{
  font-size:.72rem !important;
  letter-spacing:.18em !important;
  font-weight:950 !important;
  text-transform:uppercase !important;
}
html body.cmep-page-house-district-detail .driver-pill{
  font-size:.78rem !important;
  font-weight:850 !important;
  line-height:1.15 !important;
}
html body.cmep-page-house-district-detail .model-drivers-no-polling,
html body.cmep-page-house-district-detail .inc-cred,
html body.cmep-page-house-district-detail .analysis-summary-sub{
  font-size:.88rem !important;
  line-height:1.35 !important;
  font-weight:750 !important;
}
html body.cmep-page-house-district-detail .analysis-summary-badge{
  font-size:.95rem !important;
  font-weight:1000 !important;
  line-height:1 !important;
}
html body.cmep-page-house-district-detail .county-tooltip .ct-head,
html body.cmep-page-house-district-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;
  font-weight:1000 !important;
}
html body.cmep-page-house-district-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-name{
  font-size:.95rem !important;
  font-weight:950 !important;
  line-height:1.05 !important;
}
html body.cmep-page-house-district-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) :is(.ct-party,.ct-votes){
  font-size:.78rem !important;
  font-weight:850 !important;
}
html body.cmep-page-house-district-detail :is(.county-tooltip,.maplibregl-popup-content,.mobile-popout) .ct-pct{
  font-size:1.04rem !important;
  font-weight:1000 !important;
  letter-spacing:-.03em !important;
}
@media (max-width:720px){
  html body.cmep-page-house-district-detail .race-name,
  html body.cmep-page-house-district-detail .inc-name{
    font-size:1.12rem !important;
  }
}

/* v40: merge static House detail cards and move supplemental modules into the state/detail contract. */
html body.cmep-page-house-district-detail #houseDistrictDetailSurface.layout{
  grid-template-columns:minmax(440px,.94fr) minmax(560px,1.06fr) !important;
  margin-bottom:clamp(1rem,2vw,1.45rem) !important;
}
html body.cmep-page-house-district-detail .house-district-left-card{
  display:flex !important;
  flex-direction:column !important;
  gap:0 !important;
  padding:0 !important;
}
html body.cmep-page-house-district-detail .district-card-section{
  display:block !important;
  padding:clamp(1rem,1.8vw,1.45rem) !important;
  min-width:0 !important;
}
html body.cmep-page-house-district-detail .district-card-section + .district-card-section{
  border-top:1px solid var(--cmep-line) !important;
}
html body.cmep-page-house-district-detail .house-district-left-card .card-header{
  margin-bottom:.7rem !important;
  padding-bottom:.7rem !important;
}
html body.cmep-page-house-district-detail .house-district-left-card .card-help{
  margin-bottom:.85rem !important;
}
html body.cmep-page-house-district-detail #historyCard .chart-wrap{
  margin-top:0 !important;
}
html body.cmep-page-house-district-detail #analyticsCardHouse{
  margin-top:0 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog,
html body.cmep-page-house-district-detail .district-detail-sources{
  width:100% !important;
  max-width:none !important;
  margin-inline:0 !important;
  padding:0 !important;
  box-sizing:border-box !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog{
  margin-top:clamp(1rem,2vw,1.45rem) !important;
}
html body.cmep-page-house-district-detail .district-detail-sources{
  margin-top:clamp(1rem,2vw,1.45rem) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cm-card,
html body.cmep-page-house-district-detail .district-detail-sources .card{
  width:100% !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog section{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog h2{
  margin:0 0 .22rem !important;
  font-size:clamp(1.32rem,2vw,1.72rem) !important;
  font-weight:950 !important;
  letter-spacing:-.04em !important;
  line-height:1.05 !important;
  color:var(--text-strong) !important;
  text-align:center !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog-sub{
  margin:0 auto 1rem !important;
  color:var(--text-muted) !important;
  font-size:.9rem !important;
  font-weight:760 !important;
  line-height:1.32 !important;
  text-align:center !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-controls,
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-controls[style]{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  width:100% !important;
  margin:.18rem auto .92rem !important;
  overflow-x:visible !important;
  text-align:center !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg{
  display:inline-flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:.28rem !important;
  padding:.28rem !important;
  border:1px solid var(--border-subtle) !important;
  border-radius:999px !important;
  background:color-mix(in srgb, var(--bg-card) 90%, var(--text-strong) 4%) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.68), 0 8px 22px rgba(15,23,42,.06) !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button{
  min-height:2.12rem !important;
  padding:.48rem .82rem !important;
  border:1px solid transparent !important;
  border-radius:999px !important;
  background:transparent !important;
  color:var(--text-muted) !important;
  box-shadow:none !important;
  font-size:.78rem !important;
  font-weight:950 !important;
  line-height:1 !important;
  letter-spacing:-.012em !important;
  text-shadow:none !important;
  cursor:pointer !important;
  white-space:nowrap !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button:hover:not(:disabled){
  transform:none !important;
  background:color-mix(in srgb, var(--bg-card) 82%, var(--text-strong) 6%) !important;
  border-color:var(--border-subtle) !important;
  color:var(--text-strong) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button.active,
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-pressed="true"],
html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-selected="true"]{
  background:var(--text-strong) !important;
  border-color:var(--text-strong) !important;
  color:var(--bg-card) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.14) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog #cl-dist-body{
  width:100% !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-msg{
  text-align:center !important;
  color:var(--text-muted) !important;
  padding:24px 0 !important;
  font-size:.88rem !important;
  font-weight:760 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-day-group{
  margin:0 0 18px !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-day-label{
  font-size:.7rem !important;
  font-weight:900 !important;
  text-transform:uppercase !important;
  letter-spacing:.08em !important;
  color:var(--text-muted) !important;
  margin:0 0 7px !important;
  padding:0 2px !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-entry{
  background:var(--bg-page) !important;
  border:1px solid var(--border-subtle) !important;
  border-radius:14px !important;
  padding:9px 12px !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  margin:0 0 6px !important;
  text-decoration:none !important;
  color:inherit !important;
  min-width:0 !important;
  box-shadow:none !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-entry:hover{
  transform:translateY(-1px) !important;
  box-shadow:var(--shadow-subtle) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:17px !important;
  height:17px !important;
  min-width:17px !important;
  border-radius:50% !important;
  font-size:.58rem !important;
  font-weight:900 !important;
  flex-shrink:0 !important;
  line-height:1 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir.d{background:rgba(0,118,186,.12) !important; color:var(--solid-d,#0076BA) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir.r{background:rgba(238,34,12,.12) !important; color:var(--solid-r,#EE220C) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-info{
  flex:1 1 auto !important;
  min-width:0 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-name{
  font-weight:900 !important;
  font-size:.86rem !important;
  color:var(--text-strong) !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  line-height:1.16 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-sub{
  font-size:.7rem !important;
  color:var(--text-muted) !important;
  margin-top:1px !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  line-height:1.16 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pills{
  display:flex !important;
  align-items:center !important;
  gap:.38rem !important;
  flex:0 0 auto !important;
  min-width:0 !important;
  flex-wrap:wrap !important;
  justify-content:flex-end !important;
  row-gap:4px !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-arr{
  color:var(--text-muted) !important;
  font-size:.8rem !important;
  font-weight:850 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill{
  box-sizing:border-box !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:var(--home-pill-h,1.72rem) !important;
  padding:.39rem var(--home-pill-px,.66rem) !important;
  border-radius:999px !important;
  font-size:var(--home-pill-fs,.72rem) !important;
  line-height:var(--home-pill-lh,1) !important;
  font-weight:var(--home-pill-weight,850) !important;
  letter-spacing:.01em !important;
  white-space:nowrap !important;
  box-shadow:none !important;
  border:0 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.solid-d{background:var(--solid-d,#0076BA) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.likely-d{background:var(--likely-d,#55A6CF) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.lean-d{background:var(--lean-d,#9BD3F0) !important; color:#082840 !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.toss-up{background:var(--toss-up,#8B8B8B) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.lean-r{background:var(--lean-r,#FFB199) !important; color:#3d0800 !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.likely-r{background:var(--likely-r,#FF6F61) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.solid-r{background:var(--solid-r,#EE220C) !important; color:#fff !important;}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]):not(.light) body.cmep-page-house-district-detail:not(.light):not(.light-mode) .district-detail-changelog .changelog-seg{
    box-shadow:inset 0 1px 0 rgba(255,255,255,.07), 0 10px 26px rgba(0,0,0,.22) !important;
  }
  html:not([data-theme="light"]):not(.light) body.cmep-page-house-district-detail:not(.light):not(.light-mode) .district-detail-changelog .changelog-seg button.active,
  html:not([data-theme="light"]):not(.light) body.cmep-page-house-district-detail:not(.light):not(.light-mode) .district-detail-changelog .changelog-seg button[aria-pressed="true"],
  html:not([data-theme="light"]):not(.light) body.cmep-page-house-district-detail:not(.light):not(.light-mode) .district-detail-changelog .changelog-seg button[aria-selected="true"]{
    background:var(--text-strong) !important;
    border-color:var(--border-subtle) !important;
    color:#020617 !important;
  }
}
html[data-theme="dark"] body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg,
html.dark body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg,
body.cmep-page-house-district-detail.dark .district-detail-changelog .changelog-seg,
body.cmep-page-house-district-detail.dark-mode .district-detail-changelog .changelog-seg{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07), 0 10px 26px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button.active,
html.dark body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button.active,
body.cmep-page-house-district-detail.dark .district-detail-changelog .changelog-seg button.active,
body.cmep-page-house-district-detail.dark-mode .district-detail-changelog .changelog-seg button.active,
html[data-theme="dark"] body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-pressed="true"],
html.dark body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-pressed="true"],
body.cmep-page-house-district-detail.dark .district-detail-changelog .changelog-seg button[aria-pressed="true"],
body.cmep-page-house-district-detail.dark-mode .district-detail-changelog .changelog-seg button[aria-pressed="true"],
html[data-theme="dark"] body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-selected="true"],
html.dark body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg button[aria-selected="true"],
body.cmep-page-house-district-detail.dark .district-detail-changelog .changelog-seg button[aria-selected="true"],
body.cmep-page-house-district-detail.dark-mode .district-detail-changelog .changelog-seg button[aria-selected="true"]{
  background:var(--text-strong) !important;
  border-color:var(--border-subtle) !important;
  color:#020617 !important;
}
@media (max-width:720px){
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-entry{
    align-items:flex-start !important;
    flex-wrap:wrap !important;
  }
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-pills{
    width:100% !important;
    justify-content:flex-start !important;
    padding-left:27px !important;
  }
  html body.cmep-page-house-district-detail .district-detail-changelog .changelog-seg{
    max-width:100% !important;
  }
}
@media (max-width:980px){
  html body.cmep-page-house-district-detail .district-card-section{
    padding:1rem !important;
  }
}

/* v41: House district static left card now mirrors state/detail Senate/Governor left card. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard.house-district-left-card{
  padding:clamp(1rem,1.8vw,1.45rem) !important;
  display:block !important;
  gap:0 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-title-row{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:1rem !important;
  margin:0 0 clamp(.9rem,1.6vw,1.25rem) !important;
  padding:0 !important;
  border:0 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-h2{
  margin:0 !important;
  color:var(--text-strong,var(--text-main,#0f172a)) !important;
  font-size:clamp(1.35rem,2vw,1.9rem) !important;
  line-height:1.02 !important;
  letter-spacing:-.04em !important;
  font-weight:950 !important;
}
html body.cmep-page-house-district-detail .state-detail-info-section{
  margin:clamp(.9rem,1.6vw,1.25rem) 0 0 !important;
  padding:clamp(.9rem,1.6vw,1.1rem) !important;
  border:1px solid var(--border,rgba(148,163,184,.22)) !important;
  border-radius:22px !important;
  background:color-mix(in srgb,var(--card-bg,var(--bg-card,#fff)) 88%,transparent) !important;
  box-shadow:0 10px 26px rgba(15,23,42,.08) !important;
}
html body.cmep-page-house-district-detail .state-detail-incumbent-section{
  padding-bottom:clamp(.75rem,1.3vw,1rem) !important;
}
html body.cmep-page-house-district-detail .state-detail-election-section{
  padding-top:clamp(1rem,1.8vw,1.25rem) !important;
}
html body.cmep-page-house-district-detail .state-detail-section-heading{
  display:flex !important;
  align-items:center !important;
  gap:.75rem !important;
  margin:0 0 .85rem !important;
  color:var(--text-muted,#64748b) !important;
  font-size:.78rem !important;
  line-height:1.1 !important;
  font-weight:900 !important;
  letter-spacing:.14em !important;
  text-transform:uppercase !important;
}
html body.cmep-page-house-district-detail .state-detail-section-heading::after{
  content:"";
  height:1px;
  flex:1 1 auto;
  background:var(--border,rgba(148,163,184,.22));
  opacity:.85;
}
html body.cmep-page-house-district-detail .state-detail-subheading{
  margin:0 0 .72rem !important;
  color:var(--text,var(--text-main,#0f172a)) !important;
  font-size:clamp(1rem,1.4vw,1.15rem) !important;
  line-height:1.15 !important;
  font-weight:900 !important;
  letter-spacing:-.025em !important;
}
html body.cmep-page-house-district-detail .state-detail-election-stack{
  display:flex !important;
  flex-direction:column !important;
  gap:clamp(1rem,1.55vw,1.25rem) !important;
}
html body.cmep-page-house-district-detail .state-detail-election-unit{
  margin:0 !important;
  min-width:0 !important;
}
html body.cmep-page-house-district-detail .state-detail-election-unit > :first-child{margin-top:0 !important;}
html body.cmep-page-house-district-detail .state-detail-election-unit > :last-child{margin-bottom:0 !important;}
html body.cmep-page-house-district-detail .state-detail-election-section :is(.race,.chart-wrap,.model-drivers,.cand-wrap,.state-detail-candidate-wrap){
  margin-top:0 !important;
  margin-bottom:0 !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-house-district-detail .state-detail-info-section{
    background:rgba(15,23,42,.62) !important;
    border-color:rgba(148,163,184,.22) !important;
    box-shadow:0 16px 34px rgba(0,0,0,.22) !important;
  }
}
html[data-theme="dark"] body.cmep-page-house-district-detail .state-detail-info-section,
html.dark body.cmep-page-house-district-detail .state-detail-info-section,
body.cmep-page-house-district-detail.dark .state-detail-info-section,
body.cmep-page-house-district-detail.dark-mode .state-detail-info-section{
  background:rgba(15,23,42,.62) !important;
  border-color:rgba(148,163,184,.22) !important;
  box-shadow:0 16px 34px rgba(0,0,0,.22) !important;
}
html body.cmep-page-house-district-detail .state-detail-candidate-wrap{
  display:grid !important;
  gap:.75rem !important;
}
html body.cmep-page-house-district-detail #modelDriversMount:empty{display:none !important;}
html body.cmep-page-house-district-detail .house-district-left-card .card-header,
html body.cmep-page-house-district-detail .district-card-section + .district-card-section{
  border:0 !important;
}

/* v41: District changelog uses the same state/detail card/stats markup. */
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stats{
  align-self:center !important;
  display:flex;
  justify-content:center !important;
  align-items:stretch !important;
  gap:16px !important;
  margin:.2rem auto 1rem !important;
  padding:.7rem 1rem !important;
  background:var(--bg-page) !important;
  border:1px solid var(--border-subtle) !important;
  border-radius:14px !important;
  max-width:max-content !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat{text-align:center !important; min-width:64px !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat-val{
  font-size:1.25rem !important;
  font-weight:950 !important;
  color:var(--text-strong) !important;
  letter-spacing:-.03em !important;
  line-height:1 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat-val.cl-stat-d{color:var(--solid-d,#0076BA) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat-val.cl-stat-r{color:var(--solid-r,#EE220C) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat-label{
  font-size:.65rem !important;
  font-weight:850 !important;
  color:var(--text-muted) !important;
  text-transform:uppercase !important;
  letter-spacing:.06em !important;
  margin-top:.18rem !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-stat-div{
  width:1px !important;
  background:var(--border-subtle) !important;
  opacity:.8 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-state-msg{
  text-align:center !important;
  color:var(--text-muted) !important;
  padding:24px 0 !important;
  font-size:.88rem !important;
  font-weight:760 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-card{
  background:var(--bg-page) !important;
  border:1px solid var(--border-subtle) !important;
  border-radius:14px !important;
  padding:9px 12px !important;
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  margin:0 0 6px !important;
  text-decoration:none !important;
  color:inherit !important;
  min-width:0 !important;
  box-shadow:none !important;
  transition:transform var(--transition-fast,120ms ease), box-shadow var(--transition-fast,120ms ease), border-color var(--transition-fast,120ms ease) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-card:hover{
  transform:translateY(-1px) !important;
  box-shadow:var(--shadow-subtle) !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir-badge{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:17px !important;
  height:17px !important;
  min-width:17px !important;
  border-radius:50% !important;
  font-size:.58rem !important;
  font-weight:900 !important;
  flex-shrink:0 !important;
  line-height:1 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir-d{background:rgba(0,118,186,.12) !important; color:var(--solid-d,#0076BA) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-dir-r{background:rgba(238,34,12,.12) !important; color:var(--solid-r,#EE220C) !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-race-info{flex:1 1 auto !important; min-width:0 !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-race-name{
  font-weight:900 !important;
  font-size:.86rem !important;
  color:var(--text-strong) !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  line-height:1.16 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-race-sub{
  font-size:.7rem !important;
  color:var(--text-muted) !important;
  margin-top:1px !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  overflow-wrap:anywhere !important;
  line-height:1.16 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-arrow{
  color:var(--text-muted) !important;
  font-size:.8rem !important;
  font-weight:850 !important;
}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.solid-D,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-solid-d{background:var(--solid-d,#0076BA) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.likely-D,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-likely-d{background:var(--likely-d,#55A6CF) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.lean-D,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-lean-d{background:var(--lean-d,#9BD3F0) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.toss-up,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-toss-up{background:var(--toss-up,#8B8B8B) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.lean-R,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-lean-r{background:var(--lean-r,#FFB199) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.likely-R,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-likely-r{background:var(--likely-r,#FF6F61) !important; color:#fff !important;}
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.solid-R,
html body.cmep-page-house-district-detail .district-detail-changelog .cl-pill.cl-pill-solid-r{background:var(--solid-r,#EE220C) !important; color:#fff !important;}
@media (max-width:720px){
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-stats{
    display:grid !important;
    grid-template-columns:1fr 1px 1fr 1px 1fr !important;
    gap:.5rem !important;
    width:100% !important;
    max-width:100% !important;
    padding:.62rem .7rem !important;
  }
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-card{
    align-items:flex-start !important;
    gap:9px !important;
    padding:10px 11px !important;
    flex-wrap:wrap !important;
  }
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-pills{
    max-width:48% !important;
  }
}
@media (max-width:420px){
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-card{
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) !important;
  }
  html body.cmep-page-house-district-detail .district-detail-changelog .cl-pills{
    grid-column:2 !important;
    max-width:100% !important;
    justify-content:flex-start !important;
    margin-top:2px !important;
  }
}

/* v42: exact left-card header/subsection parity with state/detail Senate/Governor card. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard.house-district-left-card{
  padding:clamp(1rem,1.8vw,1.45rem) !important;
  display:block !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-title-row{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex-wrap:wrap !important;
  gap:.55rem .75rem !important;
  margin:0 0 .72rem !important;
  padding:0 0 .72rem !important;
  border:0 !important;
  border-bottom:1px solid rgba(148,163,184,.20) !important;
  text-align:center !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-title-row > *{
  min-width:0 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-h2{
  margin-left:auto !important;
  margin-right:auto !important;
  text-align:center !important;
  font-size:clamp(1.05rem,1.25vw,1.35rem) !important;
  line-height:1.1 !important;
  font-weight:950 !important;
  letter-spacing:-.03em !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #houseDistrictForecastBadge{
  flex:0 0 auto !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-info-section{
  margin:clamp(.9rem,1.6vw,1.25rem) 0 0 !important;
  padding:clamp(.9rem,1.6vw,1.1rem) !important;
  border:1px solid var(--border,rgba(148,163,184,.22)) !important;
  border-radius:22px !important;
  background:color-mix(in srgb,var(--card-bg,var(--bg-card,#fff)) 88%,transparent) !important;
  box-shadow:0 10px 26px rgba(15,23,42,.08) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-incumbent-section{
  padding-bottom:clamp(.75rem,1.3vw,1rem) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-election-section{
  padding-top:clamp(1rem,1.8vw,1.25rem) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-section-heading{
  display:flex !important;
  align-items:center !important;
  gap:.75rem !important;
  width:100% !important;
  margin:0 0 .85rem !important;
  padding:0 !important;
  border:0 !important;
  color:var(--text-muted,#64748b) !important;
  font-size:.78rem !important;
  line-height:1.1 !important;
  font-weight:900 !important;
  letter-spacing:.14em !important;
  text-transform:uppercase !important;
  text-align:left !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-section-heading::after{
  content:"" !important;
  display:block !important;
  height:1px !important;
  flex:1 1 auto !important;
  min-width:24px !important;
  background:var(--border,rgba(148,163,184,.22)) !important;
  opacity:.85 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-subheading{
  margin:.1rem 0 .7rem !important;
  color:var(--text,var(--text-main,#0f172a)) !important;
  font-size:clamp(1rem,1.4vw,1.15rem) !important;
  line-height:1.15 !important;
  font-weight:900 !important;
  letter-spacing:-.025em !important;
  text-align:left !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-election-stack{
  display:flex !important;
  flex-direction:column !important;
  gap:clamp(1rem,1.55vw,1.25rem) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-election-section .race{
  margin-top:.15rem !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-election-section .chart-wrap,
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-election-section .model-drivers{
  margin-top:clamp(1rem,1.5vw,1.25rem) !important;
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-info-section{
    background:rgba(15,23,42,.62) !important;
    border-color:rgba(148,163,184,.22) !important;
    box-shadow:0 16px 34px rgba(0,0,0,.22) !important;
  }
}
html[data-theme="dark"] body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-info-section,
html.dark body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-info-section,
body.cmep-page-house-district-detail.dark #houseDistrictForecastCard .state-detail-info-section,
body.cmep-page-house-district-detail.dark-mode #houseDistrictForecastCard .state-detail-info-section{
  background:rgba(15,23,42,.62) !important;
  border-color:rgba(148,163,184,.22) !important;
  box-shadow:0 16px 34px rgba(0,0,0,.22) !important;
}

/* v43: Incumbent section exact state/detail person-row parity. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount{
  margin-top:.65rem !important;
  margin-bottom:.75rem !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-row{
  display:flex !important;
  align-items:center !important;
  gap:.75rem !important;
  padding-top:.75rem !important;
  margin-top:.55rem !important;
  border-top:1px solid var(--border-subtle,var(--border,rgba(148,163,184,.22))) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo{
  width:64px !important;
  height:64px !important;
  border-radius:16px !important;
  object-fit:cover !important;
  object-position:var(--portrait-x,50%) var(--portrait-y,22%) !important;
  border:1px solid var(--border-subtle,var(--border,rgba(148,163,184,.22))) !important;
  background:var(--bg-card,#fff) !important;
  flex:0 0 auto !important;
  display:block !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo.is-logo,
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo.portrait-logo{
  object-fit:contain !important;
  object-position:center !important;
  padding:7px !important;
  box-sizing:border-box !important;
  background:var(--bg-card,#fff) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo.portrait-landscape{ --portrait-y:28%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo.portrait-tall{ --portrait-y:16%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-photo.portrait-square{ --portrait-y:22%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-meta{
  min-width:0 !important;
  display:flex !important;
  flex-direction:column !important;
  gap:.1rem !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-name{
  font-weight:850 !important;
  letter-spacing:-.01em !important;
  color:var(--text-strong,var(--text-main,#0f172a)) !important;
  line-height:1.15 !important;
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  flex-wrap:wrap !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-sub{
  font-size:.85rem !important;
  color:var(--text-muted,#64748b) !important;
  line-height:1.25 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-cred{
  font-size:.75rem !important;
  color:var(--text-muted,#64748b) !important;
  margin-top:.2rem !important;
  line-height:1.25 !important;
  font-weight:inherit !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #incumbentMount .person-cred a{ color:inherit !important; }

/* v44: D/R Nominees section parity with state/detail candidate tiles. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap{
  border:1px solid var(--border-subtle,var(--border,rgba(148,163,184,.22))) !important;
  border-radius:18px !important;
  padding:.65rem .75rem !important;
  background:var(--bg-card,#fff) !important;
  display:block !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-grid{
  display:flex !important;
  gap:12px !important;
  align-items:stretch !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-tile{
  flex:1 1 0 !important;
  min-width:0 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-tile .person-row{
  margin-top:0 !important;
  padding-top:0 !important;
  border-top:none !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row{
  display:grid !important;
  grid-template-columns:64px minmax(0,1fr) !important;
  align-items:center !important;
  column-gap:.75rem !important;
  row-gap:.42rem !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row > .person-photo{
  grid-column:1 !important;
  grid-row:1 / span 2 !important;
  width:64px !important;
  height:64px !important;
  border-radius:16px !important;
  object-fit:cover !important;
  object-position:var(--portrait-x,50%) var(--portrait-y,22%) !important;
  border:1px solid var(--border-subtle,var(--border,rgba(148,163,184,.22))) !important;
  background:var(--bg-card,#fff) !important;
  flex:0 0 auto !important;
  display:block !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-photo.is-logo,
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-photo.portrait-logo{
  object-fit:contain !important;
  object-position:center !important;
  padding:7px !important;
  box-sizing:border-box !important;
  background:var(--bg-card,#fff) !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-photo.portrait-landscape{ --portrait-y:28%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-photo.portrait-tall{ --portrait-y:16%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-photo.portrait-square{ --portrait-y:22%; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row > .person-meta{
  display:contents !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-name{
  grid-column:2 !important;
  grid-row:1 !important;
  min-width:0 !important;
  font-weight:850 !important;
  letter-spacing:-.01em !important;
  color:var(--text-strong,var(--text-main,#0f172a)) !important;
  line-height:1.15 !important;
  display:flex !important;
  align-items:center !important;
  gap:.5rem !important;
  flex-wrap:wrap !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-sub{
  grid-column:2 !important;
  grid-row:2 !important;
  min-width:0 !important;
  font-size:.85rem !important;
  color:var(--text-muted,#64748b) !important;
  line-height:1.25 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-cred{
  grid-column:1 / -1 !important;
  grid-row:auto !important;
  margin-top:.18rem !important;
  padding-top:.38rem !important;
  border-top:1px solid var(--border-subtle,rgba(148,163,184,.24)) !important;
  overflow-wrap:anywhere !important;
  font-size:.75rem !important;
  color:var(--text-muted,#64748b) !important;
  line-height:1.25 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-cred a{ color:inherit !important; }
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row:not(:has(.person-sub)) > .person-photo{
  grid-row:1 !important;
}
@media (max-width:520px){
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-grid{
    flex-direction:column !important;
  }
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row{
    grid-template-columns:56px minmax(0,1fr) !important;
    column-gap:.65rem !important;
  }
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .person-row > .person-photo{
    width:56px !important;
    height:56px !important;
  }
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap{
    background:rgba(15,23,42,.62) !important;
    border-color:rgba(148,163,184,.22) !important;
  }
}
html[data-theme="dark"] body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap,
html.dark body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap,
body.cmep-page-house-district-detail.dark #houseDistrictForecastCard .state-detail-candidate-wrap,
body.cmep-page-house-district-detail.dark-mode #houseDistrictForecastCard .state-detail-candidate-wrap{
  background:rgba(15,23,42,.62) !important;
  border-color:rgba(148,163,184,.22) !important;
}

/* v45: D/R Nominees parity with state/detail — candidates live inside one shared nominees panel, not separate cards. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap{
  border:1px solid var(--border-subtle,var(--border,rgba(148,163,184,.22))) !important;
  border-radius:18px !important;
  padding:.65rem .75rem !important;
  background:var(--bg-card,#fff) !important;
  box-shadow:none !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-grid{
  display:flex !important;
  gap:12px !important;
  align-items:stretch !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-tile,
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-tile:is(:hover,:focus,:focus-within){
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 !important;
  outline:0 !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-tile .person-row{
  margin-top:0 !important;
  padding-top:0 !important;
  border-top:0 !important;
}
@media (max-width:520px){
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap .cand-grid{
    flex-direction:column !important;
    gap:12px !important;
  }
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap{
    background:rgba(15,23,42,.62) !important;
    border-color:rgba(148,163,184,.22) !important;
  }
}
html[data-theme="dark"] body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap,
html.dark body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-candidate-wrap,
body.cmep-page-house-district-detail.dark #houseDistrictForecastCard .state-detail-candidate-wrap,
body.cmep-page-house-district-detail.dark-mode #houseDistrictForecastCard .state-detail-candidate-wrap{
  background:rgba(15,23,42,.62) !important;
  border-color:rgba(148,163,184,.22) !important;
}


/* v46: remove Race Summary label spacing and align all House district pills to the root/home standardized pill contract. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard .state-detail-odds-unit > .state-detail-subheading{
  display:none !important;
}
html body.cmep-page-house-district-detail :where(
  .pill,
  .legend-pill,
  .legend .legend-item,
  .rating-pill,
  .race-rating-pill,
  .party-pill,
  .badge,
  .tag,
  .chip,
  .ct-chip,
  .cl-pill,
  .driver-pill,
  .notup-badge
){
  box-sizing:border-box !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:var(--home-pill-h,1.72rem) !important;
  padding:.39rem var(--home-pill-px,.68rem) !important;
  border-radius:999px !important;
  font-size:var(--home-pill-fs,.72rem) !important;
  line-height:var(--home-pill-lh,1) !important;
  font-weight:var(--home-pill-weight,850) !important;
  letter-spacing:.01em !important;
  white-space:nowrap !important;
  box-shadow:none !important;
}
html body.cmep-page-house-district-detail :where(.rating-row,.district-top-pills,.model-drivers-pills,.cl-pills,.race-right,.person-name){
  gap:.38rem !important;
}
html body.cmep-page-house-district-detail :where(.pill.solid-D,.rating-pill.solid-D,.cl-pill.solid-D,.cl-pill.cl-pill-solid-d){
  background:var(--solid-d,#0076BA) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.likely-D,.rating-pill.likely-D,.cl-pill.likely-D,.cl-pill.cl-pill-likely-d){
  background:var(--likely-d,#00A2FF) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.lean-D,.rating-pill.lean-D,.cl-pill.lean-D,.cl-pill.cl-pill-lean-d){
  background:var(--lean-d,#56C1FF) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.toss-up,.rating-pill.toss-up,.cl-pill.toss-up,.cl-pill.cl-pill-toss-up){
  background:var(--toss-up,#929292) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.lean-R,.rating-pill.lean-R,.cl-pill.lean-R,.cl-pill.cl-pill-lean-r){
  background:var(--lean-r,#FF968D) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.likely-R,.rating-pill.likely-R,.cl-pill.likely-R,.cl-pill.cl-pill-likely-r){
  background:var(--likely-r,#FF644E) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.solid-R,.rating-pill.solid-R,.cl-pill.solid-R,.cl-pill.cl-pill-solid-r){
  background:var(--solid-r,#EE220C) !important;
  border-color:transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.held-D,.pill.inc-D-pill){
  background:var(--solid-d,#0076BA) !important;
  border:1px solid transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.held-R,.pill.inc-R-pill){
  background:var(--solid-r,#EE220C) !important;
  border:1px solid transparent !important;
  color:#fff !important;
}
html body.cmep-page-house-district-detail :where(.pill.held-none,.pill.inc-O-pill,.rating-pill.rating-none){
  background:var(--bg-card,#fff) !important;
  color:var(--text-muted,#64748b) !important;
  border:1px solid var(--border-subtle,rgba(148,163,184,.35)) !important;
  box-shadow:none !important;
}
html body.cmep-page-house-district-detail :where(.pill-flip,.flip-pill,.pivotal-pill,.majority-pill,.pivotal-race,.flip-cell){
  background:#fbbf24 !important;
  color:#000 !important;
  border-color:transparent !important;
}
html body.cmep-page-house-district-detail .state-detail-odds-unit .race{
  margin-top:0 !important;
}
@media (max-width:720px){
  html body.cmep-page-house-district-detail{
    --home-pill-h:1.64rem;
    --home-pill-h-lg:1.76rem;
    --home-pill-px:.58rem;
    --home-pill-px-lg:.62rem;
    --home-pill-fs:.68rem;
  }
}

/* v47: title typography parity with state/detail Senate/Governor cards. */
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-title-row{
  align-items:baseline !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  flex-wrap:wrap !important;
  margin-bottom:.75rem !important;
  padding:0 !important;
  border:0 !important;
  border-bottom:0 !important;
  text-align:left !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-h2,
html body.cmep-page-house-district-detail #houseDistrictForecastCard #houseDistrictForecastTitle{
  margin:0 !important;
  flex:1 1 auto !important;
  text-align:left !important;
  color:var(--text-strong,var(--cmep-text,#0f172a)) !important;
  font-size:1.25rem !important;
  line-height:1.12 !important;
  font-weight:800 !important;
  letter-spacing:-.02em !important;
}
html body.cmep-page-house-district-detail #houseDistrictForecastCard #houseDistrictForecastBadge{
  margin:0 !important;
  flex:0 0 auto !important;
}
html body.cmep-page-house-district-detail :is(.card-title,#cl-dist-title,.analysis-frost-title){
  color:var(--text-strong,var(--cmep-text,#0f172a)) !important;
  font-size:1.25rem !important;
  line-height:1.12 !important;
  font-weight:800 !important;
  letter-spacing:-.02em !important;
}
html body.cmep-page-house-district-detail #cl-dist-title{
  margin:0 !important;
}
html body.cmep-page-house-district-detail .state-detail-subheading{
  font-weight:800 !important;
  letter-spacing:-.02em !important;
}
@media (max-width:720px){
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-title-row{
    align-items:center !important;
  }
  html body.cmep-page-house-district-detail #houseDistrictForecastCard .card-h2,
  html body.cmep-page-house-district-detail #houseDistrictForecastCard #houseDistrictForecastTitle,
  html body.cmep-page-house-district-detail :is(.card-title,#cl-dist-title,.analysis-frost-title){
    font-size:1.25rem !important;
  }
}


/* v50: House win-odds history tooltip parity with state/detail. */
body.cmep-page-house-district-detail .chart-inner{
  position:relative !important;
  overflow:visible !important;
}
body.cmep-page-house-district-detail .chart-tooltip{
  position:absolute !important;
  pointer-events:none !important;
  z-index:30 !important;
  min-width:200px !important;
  max-width:min(280px, calc(100% - 16px)) !important;
  padding:.55rem .65rem !important;
  border-radius:14px !important;
  border:1px solid var(--border-subtle) !important;
  background:rgba(255,255,255,.92) !important;
  color:#111827 !important;
  box-shadow:var(--shadow-soft) !important;
  transform:translate(-50%, -115%);
  opacity:0;
  transition:opacity 120ms ease;
  overflow:visible !important;
}
body.cmep-page-house-district-detail .chart-tooltip.mobile{
  position:fixed !important;
  left:50% !important;
  right:auto !important;
  top:auto !important;
  bottom:20px !important;
  width:min(320px, calc(100% - 16px)) !important;
  max-width:calc(100% - 16px) !important;
  min-width:0 !important;
  transform:translateX(-50%) !important;
  border-radius:16px !important;
}
@supports (padding-bottom: env(safe-area-inset-bottom)){
  body.cmep-page-house-district-detail .chart-tooltip.mobile{
    bottom:calc(env(safe-area-inset-bottom) + 20px) !important;
  }
}
body.cmep-page-house-district-detail .chart-tooltip .tip-date{
  font-weight:850 !important;
  font-size:.86rem !important;
  letter-spacing:-.01em !important;
  margin:0 0 .25rem !important;
  color:inherit !important;
}
body.cmep-page-house-district-detail .chart-tooltip .tip-row{
  display:flex !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  font-size:.84rem !important;
  font-weight:700 !important;
  margin:.12rem 0 !important;
}
body.cmep-page-house-district-detail .chart-tooltip .tip-d{ color:var(--solid-d,#0076BA) !important; }
body.cmep-page-house-district-detail .chart-tooltip .tip-r{ color:var(--solid-r,#EE220C) !important; }
@media (prefers-color-scheme: dark){
  body.cmep-page-house-district-detail .chart-tooltip{
    background:rgba(2,6,23,.86) !important;
    color:#e5e7eb !important;
    border-color:rgba(148,163,184,.28) !important;
    box-shadow:0 18px 44px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.045) !important;
  }
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
  body.cmep-page-house-district-detail .chart-tooltip{
    -webkit-backdrop-filter:blur(8px) !important;
    backdrop-filter:blur(8px) !important;
  }
}

/* v66: use the election-night/primary/house mobile card and map contract directly. */
html body.cmep-page-house-district-detail :is(
  #houseDistrictDetailSurface,
  .left-col,
  .right-col,
  #houseDistrictForecastCard,
  #analyticsCardHouse,
  #mapHero,
  #mapAnalysisHouse
){
  min-width:0 !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

html body.cmep-page-house-district-detail :is(#mapHero,#mapAnalysisHouse){
  display:block !important;
  position:relative !important;
  width:100% !important;
  overflow:hidden !important;
}

@media (max-width:720px){
  html body.cmep-page-house-district-detail .container{
    width:min(100% - 22px,1720px) !important;
    max-width:none !important;
    padding-left:0 !important;
    padding-right:0 !important;
    margin-inline:auto !important;
  }

  html body.cmep-page-house-district-detail #houseDistrictDetailSurface.layout{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    max-width:100% !important;
    gap:1rem !important;
  }

  html body.cmep-page-house-district-detail :is(.left-col,.right-col){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  html body.cmep-page-house-district-detail :is(
    #houseDistrictForecastCard,
    .right-col > .card,
    #analyticsCardHouse
  ){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-left:0 !important;
    margin-right:0 !important;
    justify-self:stretch !important;
    box-sizing:border-box !important;
    border-radius:20px !important;
    padding:.92rem !important;
    overflow:hidden !important;
  }

  html body.cmep-page-house-district-detail :is(.race,.race-head,.race-name,.analysis-summary,.analysis-summary-copy,.analysis-summary-badge){
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }

  html body.cmep-page-house-district-detail .race{
    width:100% !important;
    overflow:hidden !important;
  }

  html body.cmep-page-house-district-detail .race-name{
    overflow-wrap:anywhere !important;
  }

  html body.cmep-page-house-district-detail .analysis-summary{
    width:100% !important;
    overflow:hidden !important;
  }

  html body.cmep-page-house-district-detail :is(.map,#mapHero,#mapAnalysisHouse){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:330px !important;
    height:330px !important;
    overflow:hidden !important;
  }
}

@media (max-width:430px){
  html body.cmep-page-house-district-detail .analysis-summary{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:.7rem !important;
  }

  html body.cmep-page-house-district-detail .analysis-summary-badge{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    justify-content:center !important;
    white-space:normal !important;
    text-align:center !important;
    overflow-wrap:anywhere !important;
  }
}

/* 2026-07-26: collapse the detail surface before tablet-width columns overflow.
   This must remain after the desktop v40 grid rule above. */
@media (max-width:1180px){
  html body.cmep-page-house-district-detail #houseDistrictDetailSurface.layout{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    max-width:100% !important;
    gap:1rem !important;
  }

  html body.cmep-page-house-district-detail #houseDistrictDetailSurface :is(.left-col,.right-col){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }
}
