/* One frame and area unit keep the Shapley adjustment at its actual size. */
.cartogram-view{--cartogram-emphasis:var(--ink);display:flex;flex:1 1 0;flex-direction:column;align-self:center;gap:8px;width:100%;max-width:1200px;min-width:0;min-height:0;color:var(--ink)}
.cartogram-view[hidden]{display:none}
.cartogram-phases{flex:0 0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;width:100%;max-width:660px;min-height:44px;margin:0 auto}
.cartogram-phases button{min-width:0;min-height:44px;padding:7px 10px;border:0;border-bottom:2px solid transparent;border-radius:0;background:#fff;color:var(--muted);font-size:13px;line-height:1.25;white-space:nowrap}
.cartogram-phases button:hover{background:var(--blue-faint);color:var(--blue)}
.cartogram-phases button.is-active,.cartogram-phases button[aria-current="step"]{border-bottom-color:var(--blue);background:var(--blue-faint);color:var(--blue);font-weight:600}
.cartogram-key{flex:0 0 auto;display:flex;justify-content:space-between;align-items:baseline;gap:15px;width:100%;padding:0 7px;font-size:12px;line-height:1.4;color:var(--muted)}
.cartogram-measure{color:var(--blue)}
.cartogram-total{white-space:nowrap;font-variant-numeric:tabular-nums}
.cartogram-canvas{flex:1 1 0;min-height:100px;width:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}
.cartogram-map{display:block;width:100%;height:100%;max-height:100%;overflow:visible;font-family:var(--font);--cartogram-label-size:14px}
.cartogram-state{fill:var(--blue-soft,#e9e9e9);stroke:none}
.cartogram-state:hover{fill:#ddd}
.cartogram-state.is-featured{fill:#cfcfcf}
.cartogram-border{fill:none;stroke:var(--blue);stroke-width:.9;stroke-linejoin:miter;vector-effect:non-scaling-stroke;pointer-events:none}
.cartogram-border.is-featured{stroke:var(--cartogram-emphasis);stroke-width:1.7}
.cartogram-baseline{pointer-events:none}
.cartogram-baseline path{opacity:0;fill:none;stroke:var(--rule);stroke-width:1.1;stroke-dasharray:4 3;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cartogram-view[data-phase="2"] .cartogram-baseline path.is-featured{opacity:1;stroke-width:1.6;stroke-dasharray:5 3}
.cartogram-cell-grid,.cartogram-cell-grid path{fill:none;stroke:#fff;stroke-width:.6;vector-effect:non-scaling-stroke;pointer-events:none}
.cartogram-label{font-size:var(--cartogram-label-size);fill:var(--ink);paint-order:stroke;stroke:#fff;stroke-width:2px;stroke-linejoin:round;pointer-events:none}
.cartogram-label-value{font-size:1em;font-weight:400;font-variant-numeric:tabular-nums}
.cartogram-controls{flex:0 0 auto;display:flex;justify-content:center;width:100%;min-height:44px}
.cartogram-actions{display:flex;align-items:center;justify-content:center;gap:18px;min-height:44px}
.cartogram-replay{flex:0 0 auto;min-height:44px;padding:7px 12px;border:1px solid var(--line);border-radius:3px;color:var(--blue);background:#fff;font-size:12px;white-space:nowrap}
.cartogram-replay:hover:not(:disabled){border-color:var(--blue);background:var(--blue-faint)}
.cartogram-replay:disabled{opacity:.4;cursor:default}
/* The controls stay on one 44px row in every stage. */
.stage-shell.is-electoral-map-scene .stage-viz{min-height:0}
.is-presentation .stage-shell.is-electoral-map-scene .cartogram-view{margin:0 auto;flex:1 1 0;max-width:1200px;min-height:0}
.is-presentation .stage-shell.is-electoral-map-scene .scene-equation math{font-size:24px}
.electoral-adjustments{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 24px;font-variant-numeric:tabular-nums}
.electoral-adjustments>span{white-space:nowrap}
@media(max-width:760px){
  .cartogram-view{gap:6px}
  .cartogram-phases{gap:2px}
  .cartogram-phases button{padding:6px 3px;font-size:11px}
  .cartogram-key{min-height:28px;gap:7px;padding:0;font-size:10px;line-height:1.35}
  .cartogram-key .cartogram-total{white-space:normal;text-align:right;max-width:105px}
  .cartogram-actions{gap:10px}
  .cartogram-replay{font-size:11px;padding:6px 8px}
  .cartogram-border{stroke-width:.65}
  .cartogram-border.is-featured{stroke-width:1.5}
  .cartogram-label{stroke-width:1.7px}
  .is-presentation .stage-shell.is-electoral-map-scene .scene-equation math{font-size:22px}
  .is-presentation .stage-shell.is-electoral-map-scene .stage-top{height:30px;min-height:30px}
}
@media(max-width:370px){
  .cartogram-phases button{font-size:10px;padding:6px 2px}
  .cartogram-key{font-size:9px}
  .cartogram-actions{gap:8px}
  .cartogram-replay{font-size:10px}
}
@media(max-height:700px) and (min-width:761px){
  .cartogram-view{gap:5px}
  .cartogram-key,.cartogram-replay{font-size:11px}
}
@media(max-width:760px) and (max-height:650px){
  .is-presentation .stage-shell.is-electoral-map-scene .scene-equation{display:none!important}
  .cartogram-view{gap:5px}
}
@media(prefers-reduced-motion:reduce){.cartogram-view *{transition:none;animation:none}}
