/* State/detail uses the same site-cohesion + election-night detail contract.
   This page-local block only handles the intentional page differences:
   - no primary-party selector in the hero controls
   - the non-live Senate/Governor forecast card and Expected Results Map are siblings,
     so they need the election-night two-column grid placement without a shared file. */
body.cmep-page-state-detail.en-primary-detail #topActions.no-party-selector{
  width:min(100%, 680px) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.55rem !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
body.cmep-page-state-detail.en-primary-detail #topActions.no-party-selector #backBtn,
body.cmep-page-state-detail.en-primary-detail #topActions.no-party-selector #votingBtn{
  justify-self:auto !important;
}
@media (max-width:520px){
  body.cmep-page-state-detail.en-primary-detail #topActions.no-party-selector{
    width:100% !important;
  }
}


/* Mobile office selector: match requested 3-over-2 layout.
   Top row: President / Senate / House. Bottom row: Governor / State Legislature. */
@media (max-width:640px){
  body.cmep-page-state-detail.en-primary-detail #officeActions{
    width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeActions .page-actions-center{
    width:100% !important;
    max-width:100% !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeToggle.segmented{
    width:100% !important;
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:.45rem !important;
    align-items:stretch !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeToggle.segmented .seg-btn{
    width:100% !important;
    min-width:0 !important;
    justify-content:center !important;
    text-align:center !important;
    white-space:nowrap !important;
    padding-inline:.45rem !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeToggle.segmented .seg-btn:nth-child(-n+3){
    grid-column:span 2 !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeToggle.segmented .seg-btn:nth-child(n+4){
    grid-column:span 3 !important;
  }
}
@media (max-width:390px){
  body.cmep-page-state-detail.en-primary-detail #officeToggle.segmented .seg-btn{
    font-size:.78rem !important;
    padding-inline:.32rem !important;
  }
}

/* v22: make the two-row mobile office selector use the full hero control width.
   site-cohesion sets the election-night office toggle to max-content; state/detail
   intentionally overrides that on mobile so the 3-over-2 grid can breathe. */
@media (max-width:640px){
  body.cmep-page-state-detail.cmep-page-election-night-detail.en-primary-detail #officeActions{
    width:100% !important;
    max-width:100% !important;
    display:block !important;
    padding-inline:0 !important;
  }
  body.cmep-page-state-detail.cmep-page-election-night-detail.en-primary-detail #officeActions .page-actions-center{
    width:100% !important;
    max-width:none !important;
    display:block !important;
  }
  body.cmep-page-state-detail.cmep-page-election-night-detail.en-primary-detail #officeToggle,
  body.cmep-page-state-detail.cmep-page-election-night-detail.en-primary-detail #officeToggle.segmented{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    margin-inline:0 !important;
    box-sizing:border-box !important;
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    column-gap:.42rem !important;
    row-gap:.42rem !important;
    justify-content:stretch !important;
    justify-items:stretch !important;
  }
  body.cmep-page-state-detail.cmep-page-election-night-detail.en-primary-detail #officeToggle.segmented .seg-btn{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }
}

/* Desktop: use the exact election-night/state/detail results-card + map-card column contract.
   The live election-night row is:
   .grid-2 { grid-template-columns:minmax(410px,.92fr) minmax(480px,1.08fr); align-items:start; }
   State/detail has different DOM siblings, so this maps those siblings onto that same contract. */
@media (min-width:1041px){
  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map{
    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;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .state-grid.office-view.active{
    grid-column:1 !important;
    grid-row:1 !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    align-items:start !important;
  }

  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .state-grid.office-view.active > .card.cm-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    align-self:start !important;
  }

  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .analytics-card-wrap.is-visible{
    grid-column:2 !important;
    grid-row:1 !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    align-self:start !important;
  }

  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .analytics-card-wrap.is-visible .state-analytics-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 !important;
    align-self:start !important;
  }

  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .analytics-card-wrap.is-visible .jump-link-wrap.bottom{
    display:none !important;
  }
}

@media (max-width:1040px){
  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map{
    display:block !important;
  }
  body.cmep-page-state-detail.en-primary-detail #officeViews.state-detail-side-map > .analytics-card-wrap.is-visible{
    margin-top:1.2rem !important;
  }
}


/* Senate/Governor content cleanup: make incumbent vs election content visually distinct. */
body.cmep-page-state-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, #fff) 88%, transparent) !important;
  box-shadow:0 10px 26px rgba(15,23,42,.08) !important;
}
body.cmep-page-state-detail .state-detail-incumbent-section{
  padding-bottom:clamp(.75rem,1.3vw,1rem) !important;
}
body.cmep-page-state-detail .state-detail-election-section{
  padding-top:clamp(1rem,1.8vw,1.25rem) !important;
}
body.cmep-page-state-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;
}
body.cmep-page-state-detail .state-detail-section-heading::after{
  content:"";
  height:1px;
  flex:1 1 auto;
  background:var(--border, rgba(148,163,184,.22));
  opacity:.85;
}
body.cmep-page-state-detail .state-detail-subheading{
  margin:.1rem 0 .7rem !important;
  color:var(--text, #0f172a) !important;
  font-size:clamp(1rem,1.4vw,1.15rem) !important;
  line-height:1.15 !important;
  font-weight:900 !important;
  letter-spacing:-.025em !important;
}
body.cmep-page-state-detail .state-detail-election-section .race{
  margin-top:.15rem !important;
}
body.cmep-page-state-detail .state-detail-election-section .chart-wrap,
body.cmep-page-state-detail .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-state-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-state-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;
}


/* 2026-07-07: even Senate/Governor election-section rhythm + root-index pill sizing. */
body.cmep-page-state-detail{
  --state-detail-section-gap:clamp(1rem,1.55vw,1.25rem);
  --home-pill-h:1.72rem;
  --home-pill-h-lg:1.84rem;
  --home-pill-px:.68rem;
  --home-pill-px-lg:.72rem;
  --home-pill-fs:.72rem;
  --home-pill-lh:1;
  --home-pill-weight:850;
}
body.cmep-page-state-detail .state-detail-election-stack{
  display:flex !important;
  flex-direction:column !important;
  gap:var(--state-detail-section-gap) !important;
}
body.cmep-page-state-detail .state-detail-election-unit{
  margin:0 !important;
  min-width:0 !important;
}
body.cmep-page-state-detail .state-detail-election-unit > :first-child{margin-top:0 !important;}
body.cmep-page-state-detail .state-detail-election-unit > :last-child{margin-bottom:0 !important;}
body.cmep-page-state-detail .state-detail-election-section .race,
body.cmep-page-state-detail .state-detail-election-section .chart-wrap,
body.cmep-page-state-detail .state-detail-election-section .model-drivers,
body.cmep-page-state-detail .state-detail-election-section .cand-wrap,
body.cmep-page-state-detail .state-detail-election-section .state-detail-candidate-wrap{
  margin-top:0 !important;
  margin-bottom:0 !important;
}
body.cmep-page-state-detail .state-detail-subheading{
  margin:0 0 .72rem !important;
}
body.cmep-page-state-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) !important;
  padding:.39rem var(--home-pill-px) !important;
  border-radius:999px !important;
  font-size:var(--home-pill-fs) !important;
  line-height:var(--home-pill-lh) !important;
  font-weight:var(--home-pill-weight) !important;
  letter-spacing:.01em !important;
  white-space:nowrap !important;
  box-shadow:none !important;
}
body.cmep-page-state-detail :where(.pill.no-election,.pill.noel-d,.pill.noel-r,.legend-pill.noel-d,.legend-pill.noel-r,.notup-badge){
  min-height:var(--home-pill-h-lg) !important;
  padding:.38rem var(--home-pill-px-lg) !important;
  border-width:2px !important;
}
body.cmep-page-state-detail :where(.majority-pill,.leg-majority){
  min-height:var(--home-pill-h) !important;
  padding:.37rem var(--home-pill-px-lg) !important;
  gap:.34rem !important;
}
body.cmep-page-state-detail :where(.rating-row,.district-top-pills,.model-drivers-pills,.leg-legend,.cl-pills){
  gap:.38rem !important;
}
@media (max-width:720px){
  body.cmep-page-state-detail{
    --state-detail-section-gap:.95rem;
    --home-pill-h:1.64rem;
    --home-pill-h-lg:1.76rem;
    --home-pill-px:.58rem;
    --home-pill-px-lg:.62rem;
    --home-pill-fs:.68rem;
  }
}


/* 2026-07-07: white party-context pills should keep party-colored text.
   Applies to incumbent pills on no-election/called cards and legislature majority/no-election legend pills. */
body.cmep-page-state-detail :where(.district-card.called-d,.district-card.no-election-d) :where(.pill.inc-D-pill,.inc-D-pill),
body.cmep-page-state-detail :where(.district-card.called-r,.district-card.no-election-r) :where(.pill.inc-R-pill,.inc-R-pill){
  background:#fff !important;
  border-color:rgba(255,255,255,.92) !important;
  box-shadow:0 1px 2px rgba(15,23,42,.12) !important;
}
body.cmep-page-state-detail :where(.district-card.called-d,.district-card.no-election-d) :where(.pill.inc-D-pill,.inc-D-pill){
  color:var(--solid-d,#0076BA) !important;
}
body.cmep-page-state-detail :where(.district-card.called-r,.district-card.no-election-r) :where(.pill.inc-R-pill,.inc-R-pill){
  color:var(--solid-r,#EE220C) !important;
}

/* State legislature No Election D/R pills must match the Senate legend on the homepage. */
body.cmep-page-state-detail .leg-legend :where(.pill.leg-pill.notup-D),
body.cmep-page-state-detail :where(.pill.noel-d,.legend-pill.noel-d){
  background:var(--solid-d,#0076BA) !important;
  color:#fff !important;
  border:2px solid var(--toss-up,#929292) !important;
  box-shadow:var(--shadow-subtle,0 1px 2px rgba(15,23,42,.08)) !important;
}
body.cmep-page-state-detail .leg-legend :where(.pill.leg-pill.notup-R),
body.cmep-page-state-detail :where(.pill.noel-r,.legend-pill.noel-r){
  background:var(--solid-r,#EE220C) !important;
  color:#fff !important;
  border:2px solid var(--toss-up,#929292) !important;
  box-shadow:var(--shadow-subtle,0 1px 2px rgba(15,23,42,.08)) !important;
}
body.cmep-page-state-detail :where(.pill.majority-D){
  background:var(--bg-card,#fff) !important;
  color:var(--solid-d,#0076BA) !important;
  border:1px solid color-mix(in srgb, var(--solid-d,#0076BA) 34%, var(--border-subtle,rgba(148,163,184,.35))) !important;
  box-shadow:var(--shadow-subtle,0 1px 2px rgba(15,23,42,.08)) !important;
}
body.cmep-page-state-detail :where(.pill.majority-R){
  background:var(--bg-card,#fff) !important;
  color:var(--solid-r,#EE220C) !important;
  border:1px solid color-mix(in srgb, var(--solid-r,#EE220C) 34%, var(--border-subtle,rgba(148,163,184,.35))) !important;
  box-shadow:var(--shadow-subtle,0 1px 2px rgba(15,23,42,.08)) !important;
}
@media (prefers-color-scheme: dark){
  body.cmep-page-state-detail :where(.pill.majority-D,.pill.majority-R){
    background:rgba(255,255,255,.94) !important;
  }
}

/* 2026-07-07: legislature rating legend pills must remain filled, not white.
   Only no-election/majority-context pills get the white party-text treatment. */
body.cmep-page-state-detail .leg-legend :where(.pill.leg-pill.solid-D){
  background:var(--solid-d,#0076BA) !important;
  color:#fff !important;
  border-color:var(--solid-d,#0076BA) !important;
}
body.cmep-page-state-detail .leg-legend :where(.pill.leg-pill.solid-R){
  background:var(--solid-r,#EE220C) !important;
  color:#fff !important;
  border-color:var(--solid-r,#EE220C) !important;
}



/* 2026-07-07: State legislature chambers are the top-level cards.
   No outer State Legislature wrapper; model drivers render as one full-width card underneath. */
body.cmep-page-state-detail #view-legislature .leg-wrap,
body.cmep-page-state-detail #view-legislature .state-detail-leg-drivers-card{
  grid-column:1 / -1 !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}
body.cmep-page-state-detail #view-legislature .state-detail-leg-drivers-card{
  margin-top:clamp(1rem,2vw,1.35rem) !important;
  padding:clamp(1rem,1.8vw,1.35rem) !important;
}
body.cmep-page-state-detail #view-legislature .state-detail-leg-drivers-card .model-drivers{
  margin:0 !important;
}
body.cmep-page-state-detail .leg-chambers-grid{
  display:grid !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  gap:clamp(1rem,2vw,1.35rem) !important;
  align-items:stretch !important;
  margin-top:.85rem !important;
}
body.cmep-page-state-detail .leg-chambers-grid-two{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}
body.cmep-page-state-detail .leg-chambers-grid-single{
  grid-template-columns:minmax(0,1fr) !important;
}
body.cmep-page-state-detail .leg-chamber-card{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  padding:clamp(1rem,1.8vw,1.35rem) !important;
  border-radius:24px !important;
  border:1px solid var(--border,rgba(148,163,184,.22)) !important;
  background:var(--card-bg,#fff) !important;
  box-shadow:var(--shadow-sm,0 10px 28px rgba(15,23,42,.08)) !important;
}
body.cmep-page-state-detail .leg-chambers-grid-single .leg-chamber-card{
  grid-column:1 / -1 !important;
}
body.cmep-page-state-detail .leg-chamber-card-no-election{
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
}
body.cmep-page-state-detail .leg-chamber-card-no-election > .district-card{
  width:100% !important;
  margin:0 !important;
}
body.cmep-page-state-detail .leg-chamber-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:.75rem !important;
  padding-bottom:.85rem !important;
  margin-bottom:1rem !important;
  border-bottom:1px solid var(--border,rgba(148,163,184,.22)) !important;
}
body.cmep-page-state-detail .leg-chamber-title{
  color:var(--text-strong,var(--text,#0f172a)) !important;
  font-size:clamp(1.15rem,1.8vw,1.45rem) !important;
  line-height:1.05 !important;
  font-weight:950 !important;
  letter-spacing:-.035em !important;
}
body.cmep-page-state-detail .leg-chamber-card .section-title.tight{
  margin:.05rem 0 .75rem !important;
  color:var(--text-muted,#64748b) !important;
  font-size:.78rem !important;
  font-weight:900 !important;
  letter-spacing:.13em !important;
  text-transform:uppercase !important;
}
body.cmep-page-state-detail .leg-chamber-card .leg-divider{
  margin:clamp(1rem,1.7vw,1.25rem) 0 !important;
  height:1px !important;
  background:var(--border,rgba(148,163,184,.22)) !important;
}
@media (max-width:1040px){
  body.cmep-page-state-detail .leg-chambers-grid-two{
    grid-template-columns:minmax(0,1fr) !important;
  }
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]) body.cmep-page-state-detail .leg-chamber-card{
    background:rgba(15,23,42,.72) !important;
    border-color:rgba(148,163,184,.22) !important;
    box-shadow:0 18px 36px rgba(0,0,0,.24) !important;
  }
}
html[data-theme="dark"] body.cmep-page-state-detail .leg-chamber-card{
  background:rgba(15,23,42,.72) !important;
  border-color:rgba(148,163,184,.22) !important;
  box-shadow:0 18px 36px rgba(0,0,0,.24) !important;
}


/* 2026-07-07: make state-detail Ratings Changelog mirror the root index presentation. */
body.cmep-page-state-detail .state-detail-changelog{
  margin-top:clamp(1rem,2vw,1.45rem) !important;
}
body.cmep-page-state-detail .state-detail-changelog .cm-card{
  width:100% !important;
}
body.cmep-page-state-detail .state-detail-changelog section{
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .changelog-controls,
body.cmep-page-state-detail .state-detail-changelog .changelog-controls[style]{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  width:100% !important;
  margin:.18rem auto .72rem !important;
  overflow-x:visible !important;
  text-align:center !important;
}
body.cmep-page-state-detail .state-detail-changelog .changelog-controls[style]{
  margin:.12rem auto 1rem !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .changelog-seg button{
  min-height:2.28rem !important;
  padding:.54rem .92rem !important;
  border:1px solid transparent !important;
  border-radius:999px !important;
  background:transparent !important;
  color:var(--text-muted) !important;
  box-shadow:none !important;
  font-size:.82rem !important;
  font-weight:950 !important;
  line-height:1 !important;
  letter-spacing:-.012em !important;
  text-shadow:none !important;
  cursor:pointer !important;
  white-space:nowrap !important;
}
body.cmep-page-state-detail .state-detail-changelog .changelog-seg.changelog-seg-sm button{
  min-height:2.12rem !important;
  padding:.48rem .82rem !important;
  font-size:.78rem !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .changelog-seg button.active,
body.cmep-page-state-detail .state-detail-changelog .changelog-seg button[aria-pressed="true"],
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-stat{text-align:center !important; min-width:64px !important;}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-stat-val.cl-stat-d{color:var(--solid-d,#0076BA) !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-stat-val.cl-stat-r{color:var(--solid-r,#EE220C) !important;}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-stat-div{
  width:1px !important;
  background:var(--border-subtle) !important;
  opacity:.8 !important;
}
body.cmep-page-state-detail .state-detail-changelog #cl-st-sen-body,
body.cmep-page-state-detail .state-detail-changelog #cl-st-hou-body,
body.cmep-page-state-detail .state-detail-changelog #cl-st-gov-body{
  width:100% !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-day-group{
  margin:0 0 18px !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-card:hover{
  transform:translateY(-1px) !important;
  box-shadow:var(--shadow-subtle) !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-dir-d{background:rgba(0,118,186,.12) !important; color:var(--solid-d,#0076BA) !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-dir-r{background:rgba(238,34,12,.12) !important; color:var(--solid-r,#EE220C) !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-race-info{
  flex:1 1 auto !important;
  min-width:0 !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-arrow{
  color:var(--text-muted) !important;
  font-size:.8rem !important;
  font-weight:850 !important;
}
body.cmep-page-state-detail .state-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;
}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.solid-D,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-solid-d{background:var(--solid-d,#0076BA) !important; color:#fff !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.likely-D,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-likely-d{background:var(--likely-d,#55A6CF) !important; color:#fff !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.lean-D,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-lean-d{background:var(--lean-d,#9BD3F0) !important; color:#082840 !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.toss-up,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-toss-up{background:var(--toss-up,#8B8B8B) !important; color:#fff !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.lean-R,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-lean-r{background:var(--lean-r,#FFB199) !important; color:#3d0800 !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.likely-R,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.cl-pill-likely-r{background:var(--likely-r,#FF6F61) !important; color:#fff !important;}
body.cmep-page-state-detail .state-detail-changelog .cl-pill.solid-R,
body.cmep-page-state-detail .state-detail-changelog .cl-pill.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-state-detail:not(.light):not(.light-mode) .state-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-state-detail:not(.light):not(.light-mode) .state-detail-changelog .changelog-seg button.active,
  html:not([data-theme="light"]):not(.light) body.cmep-page-state-detail:not(.light):not(.light-mode) .state-detail-changelog .changelog-seg button[aria-pressed="true"],
  html:not([data-theme="light"]):not(.light) body.cmep-page-state-detail:not(.light):not(.light-mode) .state-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-state-detail .state-detail-changelog .changelog-seg,
html.dark body.cmep-page-state-detail .state-detail-changelog .changelog-seg,
body.cmep-page-state-detail.dark .state-detail-changelog .changelog-seg,
body.cmep-page-state-detail.dark-mode .state-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-state-detail .state-detail-changelog .changelog-seg button.active,
html.dark body.cmep-page-state-detail .state-detail-changelog .changelog-seg button.active,
body.cmep-page-state-detail.dark .state-detail-changelog .changelog-seg button.active,
body.cmep-page-state-detail.dark-mode .state-detail-changelog .changelog-seg button.active,
html[data-theme="dark"] body.cmep-page-state-detail .state-detail-changelog .changelog-seg button[aria-pressed="true"],
html.dark body.cmep-page-state-detail .state-detail-changelog .changelog-seg button[aria-pressed="true"],
body.cmep-page-state-detail.dark .state-detail-changelog .changelog-seg button[aria-pressed="true"],
body.cmep-page-state-detail.dark-mode .state-detail-changelog .changelog-seg button[aria-pressed="true"],
html[data-theme="dark"] body.cmep-page-state-detail .state-detail-changelog .changelog-seg button[aria-selected="true"],
html.dark body.cmep-page-state-detail .state-detail-changelog .changelog-seg button[aria-selected="true"],
body.cmep-page-state-detail.dark .state-detail-changelog .changelog-seg button[aria-selected="true"],
body.cmep-page-state-detail.dark-mode .state-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){
  body.cmep-page-state-detail .state-detail-changelog .changelog-controls,
  body.cmep-page-state-detail .state-detail-changelog .changelog-controls[style]{
    justify-content:center !important;
    overflow-x:visible !important;
    padding-left:0 !important;
    padding-right:0 !important;
    padding-bottom:.12rem !important;
  }
  body.cmep-page-state-detail .state-detail-changelog .changelog-seg{
    flex-wrap:wrap !important;
    justify-content:center !important;
    max-width:100% !important;
  }
  body.cmep-page-state-detail .state-detail-changelog .changelog-seg button{
    flex:0 0 auto !important;
  }
  body.cmep-page-state-detail .state-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;
  }
  body.cmep-page-state-detail .state-detail-changelog .cl-card{
    align-items:flex-start !important;
    gap:9px !important;
    padding:10px 11px !important;
  }
  body.cmep-page-state-detail .state-detail-changelog .cl-pills{
    max-width:48% !important;
  }
}
@media (max-width:420px){
  body.cmep-page-state-detail .state-detail-changelog .cl-card{
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) !important;
  }
  body.cmep-page-state-detail .state-detail-changelog .cl-pills{
    grid-column:2 !important;
    max-width:100% !important;
    justify-content:flex-start !important;
    margin-top:2px !important;
  }
}

/* 2026-07-07: make state-detail win-odds history tooltips match root index chart tooltip behavior. */
body.cmep-page-state-detail .chart-inner{
  position:relative !important;
  overflow:visible !important;
}
body.cmep-page-state-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-state-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-state-detail .chart-tooltip.mobile{
    bottom:calc(env(safe-area-inset-bottom) + 20px) !important;
  }
}
body.cmep-page-state-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-state-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-state-detail .chart-tooltip .tip-d{ color:var(--solid-d,#0076BA) !important; }
body.cmep-page-state-detail .chart-tooltip .tip-r{ color:var(--solid-r,#EE220C) !important; }
body.cmep-page-state-detail .chart-tooltip .tip-i{ color:var(--toss-up,#929292) !important; }
@media (prefers-color-scheme: dark){
  body.cmep-page-state-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-state-detail .chart-tooltip{
    -webkit-backdrop-filter:blur(8px) !important;
    backdrop-filter:blur(8px) !important;
  }
}
