/* Shared prediction-arc contract for the election-night House and Senate views. */
.cmep-general-election-page {
  --election-arc-pill-height:1.72rem;
  --election-arc-pill-height-lg:1.84rem;
  --election-arc-pill-padding-x:.68rem;
  --election-arc-pill-padding-x-lg:.72rem;
  --election-arc-pill-font:.72rem;
  --election-arc-majority:var(--flip-gold, var(--majority-yellow, #f6ce46));
}

.cmep-general-election-page .arc-standard-legend {
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:.42rem !important;
  margin:.1rem auto .65rem !important;
  padding:0 !important;
  overflow:visible !important;
}

.cmep-general-election-page .arc-standard-legend .legend-item {
  box-sizing:border-box !important;
  display:inline-flex !important;
  flex:0 0 auto !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:var(--election-arc-pill-height) !important;
  padding:.39rem var(--election-arc-pill-padding-x) !important;
  border:1px solid transparent !important;
  border-radius:999px !important;
  color:#fff !important;
  font-size:var(--election-arc-pill-font) !important;
  font-weight:850 !important;
  line-height:1 !important;
  letter-spacing:.01em !important;
  gap:normal !important;
  white-space:nowrap !important;
  box-shadow:none !important;
}

.cmep-general-election-page .arc-standard-legend .legend-item:is(.leg-no-election-d,.leg-no-election-r) {
  min-height:var(--election-arc-pill-height-lg) !important;
  padding:.38rem var(--election-arc-pill-padding-x-lg) !important;
  border-width:2px !important;
  border-color:var(--toss-up) !important;
}

.cmep-general-election-page .arc-standard-legend .leg-no-election-d { background:var(--solid-d) !important; }
.cmep-general-election-page .arc-standard-legend .leg-no-election-r { background:var(--solid-r) !important; }
.cmep-general-election-page .arc-standard-legend .solid-D { background:var(--solid-d) !important; }
.cmep-general-election-page .arc-standard-legend .likely-D { background:var(--likely-d) !important; }
.cmep-general-election-page .arc-standard-legend .lean-D { background:var(--lean-d) !important; }
.cmep-general-election-page .arc-standard-legend .toss-up { background:var(--toss-up) !important; }
.cmep-general-election-page .arc-standard-legend .lean-R { background:var(--lean-r) !important; }
.cmep-general-election-page .arc-standard-legend .likely-R { background:var(--likely-r) !important; }
.cmep-general-election-page .arc-standard-legend .solid-R { background:var(--solid-r) !important; }

.cmep-general-election-page .arc-standard-legend .legend-item:is(.projected-d,.projected-r) {
  min-height:var(--election-arc-pill-height-lg) !important;
  padding:.38rem var(--election-arc-pill-padding-x-lg) !important;
  border:2px solid var(--projection-green, #64c466) !important;
}
.cmep-general-election-page .arc-standard-legend .projected-d { background:var(--solid-d) !important; }
.cmep-general-election-page .arc-standard-legend .projected-r { background:var(--solid-r) !important; }

/* Flip pills retain the winner's fill and outline the party losing the seat. */
.cmep-general-election-page .arc-standard-legend .legend-item:is(.flip-to-d,.flip-to-r) {
  min-height:var(--election-arc-pill-height-lg) !important;
  padding:.38rem var(--election-arc-pill-padding-x-lg) !important;
  border-width:2px !important;
}
.cmep-general-election-page .arc-standard-legend .flip-to-d { background:var(--solid-d) !important;border-color:var(--solid-r) !important; }
.cmep-general-election-page .arc-standard-legend .flip-to-r { background:var(--solid-r) !important;border-color:var(--solid-d) !important; }

.cmep-general-election-page .arc-standard-legend .majority-pill {
  min-height:var(--election-arc-pill-height) !important;
  padding:.37rem var(--election-arc-pill-padding-x-lg) !important;
  gap:.34rem !important;
  color:var(--text-main) !important;
  background:var(--bg-card) !important;
  border-color:var(--election-arc-majority) !important;
}

.cmep-general-election-page .arc-standard-legend .majority-pill .ring {
  display:inline-block !important;
  flex:0 0 auto !important;
  width:.72rem !important;
  height:.72rem !important;
  margin:0 !important;
  border:2px solid var(--election-arc-majority) !important;
  border-radius:999px !important;
}

.cmep-general-election-page .arc-standard-path-controls {
  position:absolute !important;
  left:50% !important;
  bottom:8% !important;
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:center !important;
  gap:24px !important;
  margin:0 !important;
  padding:0 !important;
  transform:translateX(-50%) !important;
  pointer-events:none !important;
}

.cmep-general-election-page .arc-standard-path-button {
  position:relative !important;
  box-sizing:border-box !important;
  display:flex !important;
  flex:0 0 120px !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  width:120px !important;
  min-width:120px !important;
  height:120px !important;
  min-height:120px !important;
  gap:.16rem !important;
  padding:.76rem !important;
  border:4px solid rgba(255,255,255,.9) !important;
  border-radius:50% !important;
  color:#fff !important;
  box-shadow:var(--shadow-soft) !important;
  font-size:.9rem !important;
  font-weight:900 !important;
  line-height:1.05 !important;
  text-align:center !important;
  white-space:normal !important;
  cursor:pointer !important;
  pointer-events:auto !important;
  transition:transform var(--transition-med, 220ms cubic-bezier(.22,.61,.36,1)), box-shadow var(--transition-med, 220ms cubic-bezier(.22,.61,.36,1)), background-color var(--transition-med, 220ms cubic-bezier(.22,.61,.36,1)), border-color var(--transition-med, 220ms cubic-bezier(.22,.61,.36,1)), color var(--transition-med, 220ms cubic-bezier(.22,.61,.36,1)) !important;
}

.cmep-general-election-page .arc-standard-path-button.path-dem:not(.active) {
  color:#fff !important;
  background:var(--solid-d) !important;
  border-color:rgba(255,255,255,.9) !important;
  box-shadow:0 18px 38px rgba(15,23,42,.08) !important;
}
.cmep-general-election-page .arc-standard-path-button.path-gop:not(.active) {
  color:#fff !important;
  background:var(--solid-r) !important;
  border-color:rgba(255,255,255,.9) !important;
  box-shadow:0 18px 38px rgba(15,23,42,.08) !important;
}
.cmep-general-election-page .arc-standard-path-button:hover:not(:disabled) {
  transform:translateY(-1px) scale(1.02) !important;
  box-shadow:0 22px 45px rgba(15,23,42,.18) !important;
}
.cmep-general-election-page .arc-standard-path-button:disabled { cursor:wait !important; opacity:.58 !important; }

.cmep-general-election-page .arc-standard-path-button .label {
  display:block !important;
  width:100% !important;
  max-width:none !important;
  letter-spacing:.03em !important;
  white-space:normal !important;
  text-align:center !important;
  pointer-events:none !important;
}

.cmep-general-election-page .arc-standard-path-button .close-icon {
  display:none !important;
  position:static !important;
  width:auto !important;
  height:auto !important;
  margin:0 !important;
  font-size:1.26rem !important;
  font-weight:900 !important;
  line-height:.9 !important;
  pointer-events:none !important;
}

.cmep-general-election-page .arc-standard-path-button.active {
  box-shadow:0 0 0 2px rgba(15,23,42,.15) !important;
}
.cmep-general-election-page .arc-standard-path-button.active .label { display:block !important; }
.cmep-general-election-page .arc-standard-path-button.active .close-icon { display:block !important; }
.cmep-general-election-page .arc-standard-path-button.path-dem.active {
  color:var(--solid-d) !important;
  background:color-mix(in srgb,var(--solid-d) 14%,transparent) !important;
  border-color:var(--solid-d) !important;
}
.cmep-general-election-page .arc-standard-path-button.path-gop.active {
  color:var(--solid-r) !important;
  background:color-mix(in srgb,var(--solid-r) 14%,transparent) !important;
  border-color:var(--solid-r) !important;
}

@supports not (background:color-mix(in srgb, red 10%, transparent)) {
  .cmep-general-election-page .arc-standard-path-button.path-dem.active { background:rgba(0,118,186,.12) !important; }
  .cmep-general-election-page .arc-standard-path-button.path-gop.active { background:rgba(238,34,12,.12) !important; }
}

/* Prediction-arc ring contract: 1.5px at rest, strengthening to 1.8px on a path. */
.cmep-general-election-page :where(.seat-dot.is-called,.house-seat-dot.is-called) {
  stroke:var(--projection-green, #64c466) !important;
  stroke-width:1.5px !important;
}

.cmep-general-election-page :where(.seat-dot:is(.dem-path,.gop-path).is-called,.house-seat-dot:is(.dem-path,.gop-path).is-called) {
  stroke:var(--projection-green, #64c466) !important;
  stroke-width:1.8px !important;
}

.cmep-general-election-page :where(.seat-check.is-called,.house-seat-check.is-called) {
  fill:var(--projection-green, #64c466) !important;
}

/* Senate follows the prediction arc, including party-specific markers while VP control is unresolved. */
.cmep-general-election-page .seat-dot.is-majority {
  stroke:var(--election-arc-majority) !important;
  stroke-width:1.5px !important;
}

.cmep-general-election-page .seat-dot.is-majority-dem { stroke:var(--solid-d) !important;stroke-width:2px !important; }
.cmep-general-election-page .seat-dot.is-majority-gop { stroke:var(--solid-r) !important;stroke-width:2px !important; }

.cmep-general-election-page .seat-dot:is(.dem-path,.gop-path).is-majority {
  stroke:var(--election-arc-majority) !important;
  stroke-width:1.8px !important;
}

/* House uses the same resting and active ring weights as the homepage arcs. */
.cmep-general-election-page .house-seat-dot.is-majority {
  stroke:var(--election-arc-majority) !important;
  stroke-width:1.5px !important;
}

.cmep-general-election-page .house-seat-dot:is(.dem-path,.gop-path).is-majority {
  stroke-width:1.8px !important;
}

/* A flip keeps its winning-party fill with the losing party's outline. */
.cmep-general-election-page :is(.seat-dot,.house-seat-dot).is-called.is-flip.called-d { stroke:var(--solid-r) !important;stroke-width:1.5px !important; }
.cmep-general-election-page :is(.seat-dot,.house-seat-dot).is-called.is-flip.called-r { stroke:var(--solid-d) !important;stroke-width:1.5px !important; }
.cmep-general-election-page :is(.seat-dot,.house-seat-dot).is-called.is-flip:is(.dem-path,.gop-path) { stroke-width:1.8px !important; }

/* The live circles now use the prediction arcs' actual cx/cy/r motion contract. */
.cmep-general-election-page .seat-dot {
  cursor:pointer;
  transition:cx 420ms cubic-bezier(.22,.61,.36,1),cy 620ms cubic-bezier(.18,.89,.32,1.18),r 320ms cubic-bezier(.22,.61,.36,1),opacity 150ms ease-out !important;
  will-change:cx,cy,r,opacity;
}

.cmep-general-election-page .seat-dot.cmep-stackflight {
  transition:cx 560ms cubic-bezier(.22,.61,.36,1),cy 920ms cubic-bezier(.18,.89,.32,1.1),r 360ms cubic-bezier(.22,.61,.36,1),opacity 150ms ease-out !important;
}

.cmep-general-election-page .seat-check {
  transition:x 420ms cubic-bezier(.22,.61,.36,1),y 620ms cubic-bezier(.18,.89,.32,1.18),opacity 150ms ease-out;
}

.cmep-general-election-page .seat-dot.cmep-stackflight ~ .seat-check {
  transition:x 560ms cubic-bezier(.22,.61,.36,1),y 920ms cubic-bezier(.18,.89,.32,1.1),opacity 150ms ease-out;
}

.cmep-general-election-page .seat-dot.dem-path { filter:drop-shadow(0 0 5px rgba(0,118,186,.9)); }
.cmep-general-election-page .seat-dot.gop-path { filter:drop-shadow(0 0 5px rgba(238,34,12,.9)); }
.cmep-general-election-page .seat-dot:is(.dem-path,.gop-path):not(.is-hold):not(.is-majority):not(.is-called) { stroke:rgba(255,255,255,.28);stroke-width:.6; }
.cmep-general-election-page .seat-dot.path-muted { opacity:.2;pointer-events:none; }

@media (hover:hover) and (pointer:fine), (any-hover:hover) and (any-pointer:fine) {
  html body.cmep-general-election-page :where(.seat-node,.house-seat-node):is(:hover,:focus-visible) :where(.seat-dot,.house-seat-dot) { r:var(--seat-radius) !important;transform:scale(1.06) !important;filter:drop-shadow(0 0 7px rgba(15,23,42,.18)) !important; }
}

.cmep-general-election-page :where(.senate-mobile-path-card,.house-mobile-path-card)[data-href] { cursor:pointer; }

.cmep-general-election-page #house-arc-tooltip {
  width:auto;
  min-width:220px;
  max-width:min(320px,calc(100vw - 16px));
  padding:.7rem .8rem;
  border:1px solid var(--border-subtle);
  border-radius:18px;
  background:color-mix(in srgb,var(--bg-card) 94%,transparent);
  box-shadow:var(--shadow-soft);
  font-size:.9rem;
  line-height:1.35;
}

.cmep-general-election-page #house-arc-tooltip.mobile {
  width:min(320px,calc(100% - 16px));
  max-width:calc(100% - 16px);
  min-width:0;
  border-radius:20px;
}

@media (max-width:900px), (hover:none), (pointer:coarse) {
  .cmep-general-election-page .arc-standard-path-controls {
    position:static !important;
    flex-direction:row !important;
    gap:16px !important;
    margin:8px 0 .6rem !important;
    transform:none !important;
  }
  .cmep-general-election-page .arc-standard-path-button {
    flex-basis:96px !important;
    width:96px !important;
    min-width:96px !important;
    height:96px !important;
    min-height:96px !important;
    border-width:4px !important;
    font-size:.8rem !important;
  }
  .cmep-general-election-page .arc-standard-path-button .close-icon { font-size:1.12rem !important; }
}

@media (max-width:720px) {
  .cmep-general-election-page {
    --election-arc-pill-height:1.64rem;
    --election-arc-pill-height-lg:1.76rem;
    --election-arc-pill-padding-x:.58rem;
    --election-arc-pill-padding-x-lg:.62rem;
    --election-arc-pill-font:.68rem;
  }
}

@media (max-width:420px) {
  .cmep-general-election-page .arc-standard-path-button {
    flex-basis:84px !important;
    width:84px !important;
    min-width:84px !important;
    height:84px !important;
    min-height:84px !important;
    border-width:3px !important;
    font-size:.75rem !important;
  }
}
