/* A permanent inset within the visualization frame, outside the interactive canvas.
   Equal in every mode: labels, geography, hover targets and controls stay unobscured. */
.cm-map-frame{position:relative;box-sizing:border-box;padding-bottom:54px;min-width:0;}
.cm-map-frame[hidden]{display:none!important;}
html body .cm-map-summary{
  position:absolute;right:10px;bottom:8px;z-index:2;display:inline-flex;align-items:stretch;
  max-width:calc(100% - 20px);margin:0;padding:0;overflow:hidden;border-radius:999px;
  border:1px solid var(--border-subtle,rgba(148,163,184,.28));
  box-shadow:0 3px 10px rgba(15,23,42,.10);white-space:nowrap;pointer-events:none;
  font-family:inherit;font-weight:850;line-height:1.15;letter-spacing:0;
}
html body .cm-map-summary[hidden]{display:none!important;}
.cm-map-summary-lead{display:flex;align-items:center;padding:10px 12px;background:#334155;color:#f8fafc;font-size:11px;letter-spacing:.025em;}
.cm-map-summary-result{display:flex;align-items:center;justify-content:center;min-width:78px;padding:9px 16px;font-size:16px;font-variant-numeric:tabular-nums;background:var(--text-muted,#64748b);color:#fff;}
.cm-map-summary[data-party="D"] .cm-map-summary-result{background:var(--solid-d,#0076ba);}
.cm-map-summary[data-party="R"] .cm-map-summary-result{background:var(--solid-r,#ee220c);}
@media(max-width:480px){
  .cm-map-frame{padding-bottom:48px;}
  html body .cm-map-summary{right:6px;bottom:7px;max-width:calc(100% - 12px);}
  .cm-map-summary-lead{font-size:9px;padding:9px 8px;letter-spacing:.01em;}
  .cm-map-summary-result{font-size:13px;min-width:62px;padding:8px 10px;}
}
.cm-map-frame{
  border:1px solid var(--border-subtle,rgba(148,163,184,.24));border-radius:18px;
  background:var(--bg-card-subtle,rgba(248,250,252,.65));
}
html body .cm-map-frame > .map{margin:0!important;border:0!important;border-radius:17px 17px 0 0!important;box-shadow:none!important;}
/* The existing remaining-vote key wraps on narrow screens. Reserve its full
   two-line footprint in every pane, including the invisible Results legend. */
@media(max-width:480px){
  .cmep-map-pane .analysis-legend,.cmep-map-pane .cmep-legend-reserve{min-height:48px;}
}

/* Remaining-vote key shares the reserved summary footer, never the gradient row. */
html body .cm-map-summary[data-mode="remaining"] .cm-map-summary-lead{
  gap:8px;align-items:center;padding:9px 12px;font-size:11px;
  text-transform:none;letter-spacing:0;
  color:var(--text-strong,#0f172a);background:var(--bg-card,#fff);
}
html body .cm-map-summary[data-mode="remaining"] .cm-map-summary-lead::before{
  content:"";width:10px;height:10px;flex:0 0 10px;border-radius:50%;background:rgba(34,197,94,.92);
}
html body .cm-map-summary[data-mode="remaining"] .cm-map-summary-result{display:none;}
