/* Impact map — the canvas is the page. Every control floats on it; nothing
   above the map competes with it for width. */

.mapstage {
  /* One number for "how much room the bottom stack takes". Four hand-guessed
     offsets used to approximate this and they disagreed, which is why the help
     button sat on the legend and the scenario drawer sat on the scrubber. */
  --map-bottom: 164px;
  position: relative;
  height: clamp(560px, 78vh, 940px);
  background: var(--surface-3);
  overflow: hidden;
}
/* MapLibre puts `.maplibregl-map { position: relative }` on this element, and
   its stylesheet is injected into <head> *after* ours — same specificity, later
   in the cascade, so a plain `.mapcanvas` rule loses and the div collapses to
   zero height. The descendant selector outranks it; the explicit size is a
   second belt in case the class ever changes. */
.mapstage > .mapcanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* MapLibre's own controls sit bottom-right by default, straight under the
   scrubber; lift them clear of the bottom stack */
.mapcanvas .maplibregl-ctrl-bottom-right,
.mapcanvas .maplibregl-ctrl-bottom-left { bottom: var(--map-bottom); }
.mapcanvas .maplibregl-ctrl-attrib { font-size: 10px; }

.maploading {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 13px;
  z-index: 5;
}
.maploading[hidden] { display: none; }

/* --- floating control cluster, top-left ------------------------------- */
.mapctl {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  max-width: 300px;
}
.mapctl > *:not(.pickwrap) { box-shadow: var(--sh-3); }
.mapctl .mpick { box-shadow: var(--sh-3); }

.mmatch {
  font: 600 12.5px/1 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  padding: 10px 13px;
  cursor: pointer;
  max-width: 290px;
}
.mmatch { font-weight: 500; }

.mseg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  overflow: hidden;
}
.mseg button {
  font: 600 12.5px/1 var(--font);
  padding: 10px 13px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background var(--fast), color var(--fast);
}
.mseg button + button { border-left: 1px solid var(--line); }
.mseg button:hover { background: var(--surface-3); color: var(--ink); }
.mseg button.on { background: var(--accent-soft); color: var(--accent); }

.mtog {
  font: 600 12.5px/1 var(--font);
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 10px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.mtog.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* the city picker, styled for the light control cluster rather than a photo */
.mapctl .pickwrap { position: relative; margin-left: 0; }
.mpick {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: 600 13px/1 var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  padding: 7px 11px 7px 7px;
  cursor: pointer;
  max-width: 290px;
}
.mpick:hover { border-color: var(--ink-3); }
.mpick img { width: 30px; height: 24px; object-fit: cover; border-radius: 6px; flex: none; }
.mpick .mpn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapctl .citymenu {
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: min(430px, 62vw);
  grid-template-columns: 1fr;
  max-height: 50vh;
}

/* the guide — one click away, never uninvited. It rides in the bottom stack
   rather than floating at a guessed offset, so it cannot land on the legend. */
.helpbtn {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--sh-3);
}
.helpbtn:hover, .helpbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.helppanel {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  bottom: var(--map-bottom);
  z-index: 7;
  width: min(430px, calc(100% - 32px));
  overflow-y: auto;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  box-shadow: var(--sh-4);
}
.helppanel[hidden] { display: none; }
.helpdl { margin: var(--sp-4) 0 0; font-size: 12.5px; line-height: 1.6; }
.helpdl dt { font-weight: 700; color: var(--ink); margin-top: var(--sp-4); }
.helpdl dt:first-child { margin-top: 0; }
.helpdl dd { margin: 3px 0 0; color: var(--ink-2); }
.helpdl dd b { color: var(--ink); }

/* --- stat pills, top-right (the reference's black tiles) -------------- */
.mapright {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  transition: right var(--med);
}
.mapstage.panelopen .mapright { right: 376px; }
.mappills { display: flex; gap: var(--sp-2); }
.pill3 {
  min-width: 132px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-2);
  background: rgba(20, 16, 14, 0.86);
  color: #fff;
  box-shadow: var(--sh-3);
  display: grid;
  gap: 2px;
}
.pill3 .p3k {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.66);
}
.pill3 .p3v {
  font-family: var(--display);
  font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 4px;
}
.pill3 .p3v em { font: 500 11px var(--font); font-style: normal; color: rgba(255, 255, 255, 0.6); }
.pill3 .p3d { font-size: 11px; color: rgba(255, 255, 255, 0.62); }

/* --- scenario drawer -------------------------------------------------- */
.scenbtn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font: 600 13px/1 var(--font);
  padding: 11px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--sh-3);
}
.scenbtn[hidden] { display: none; }
.scenbtn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scenbtn .scount {
  font-style: normal;
  min-width: 18px; height: 18px;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.scenbtn .scount[hidden] { display: none; }
.scenbtn.on .scount { background: var(--accent-ink); color: var(--accent); }

.scenpanel {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--map-bottom);
  z-index: 6;
  width: min(340px, calc(100% - 32px));
  overflow-y: auto;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-3);
  box-shadow: var(--sh-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.scenpanel[hidden] { display: none; }
.scenhead { display: flex; align-items: center; }
.scenhead h3 { font-size: 16px; flex: 1; }
.scenhead .drop {
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-3);
  color: var(--ink-2); cursor: pointer;
}
.scenblock { display: grid; gap: var(--sp-2); }
.scenblock.muted { opacity: 0.5; }
.scenlabel {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.scenlabel .num { font-family: var(--display); font-size: 15px; color: var(--ink); }
.scenblock input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.scennote { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.scennote b { color: var(--ink-2); }

.lever {
  display: grid;
  gap: 3px;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color var(--fast), background var(--fast);
}
.lever:hover { border-color: var(--ink-3); }
.lever[disabled] { opacity: 0.45; cursor: default; }
.lever[disabled]:hover { border-color: var(--line); }
.lever.on { border-color: var(--accent-line); background: var(--accent-soft); }
.lever .lvtop {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.lever .lvname { flex: 1; line-height: 1.3; }
.lever.on .lvtop svg { color: var(--accent); }
.lever .lvscope { font-size: 11px; color: var(--ink-3); }
.lever .lvscope b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lever .lveff { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 3px; }
.lever .lveff em { font-style: normal; font-size: 11px; font-weight: 700; }

.difftog {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
}
.difftog input { accent-color: var(--accent); width: 16px; height: 16px; }

/* the fitted response is evidence, available rather than in the way */
.scendisc > summary {
  cursor: pointer; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  padding: var(--sp-1) 0; list-style: none;
}
.scendisc > summary::-webkit-details-marker { display: none; }
.scendisc > summary::before { content: "▸ "; color: var(--ink-3); }
.scendisc[open] > summary::before { content: "▾ "; }
.scenlabel em { font-style: normal; font-weight: 500; color: var(--ink-3); font-size: 11px; }

/* popup rows, which update live as the month and the scenario move */
.maplibregl-popup-content .phead { display: flex; align-items: center; gap: 7px; }
.maplibregl-popup-content .pdot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.maplibregl-popup-content .psub {
  color: var(--ink-3); font-size: 11.5px; margin: 2px 0 var(--sp-3);
}
.maplibregl-popup-content .pspark {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.maplibregl-popup-content .psparkhead {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.maplibregl-popup-content .pspark svg { display: block; width: 100%; height: 44px; }
.maplibregl-popup-content .pr {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-4);
  font-variant-numeric: tabular-nums; padding: 3px 0;
}
.maplibregl-popup-content .pr > span:first-child {
  display: flex; align-items: center; gap: 6px; color: var(--ink-3);
}
.maplibregl-popup-content .pr i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.maplibregl-popup-content .pr.on > span:first-child { color: var(--ink-2); font-weight: 600; }
.maplibregl-popup-content .pv { color: var(--ink); font-weight: 600; white-space: nowrap; }
.maplibregl-popup-content .pv u { text-decoration: none; color: var(--ink-3); font-weight: 500; }
.maplibregl-popup-content .pr em { font-style: normal; font-weight: 700; margin-left: 4px; }
.maplibregl-popup-content .pfoot {
  margin-top: var(--sp-2); padding-top: var(--sp-2);
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11px;
}

/* the fitted surge response, shown rather than asserted */
.surgetbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.surgetbl td { padding: 3px 0; color: var(--ink-2); }
.surgetbl th { padding: 0 0 4px; font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  text-align: left; border-bottom: 1px solid var(--line); }
.surgetbl th.num { text-align: right; padding-left: var(--sp-2); }
.surgetbl td:first-child { color: var(--ink); font-weight: 600; }
.surgetbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.surgetbl td.el { color: var(--ink-3); padding-left: var(--sp-3); }
.surgetbl td.r2 { color: var(--ink-3); padding-left: var(--sp-2); }
.surgetbl tr.nearrow td { border-top: 1px solid var(--line); padding-top: 6px; }
.surgetbl tr.nearrow td:first-child { color: var(--accent); }
.scennote code {
  font: 11px var(--mono); background: var(--surface-3);
  padding: 1px 5px; border-radius: 4px;
}

/* --- legend + scrubber: one bottom stack, so the gap is the spacing scale
       rather than two guessed offsets -------------------------------------- */
.mapbottom {
  position: absolute;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3);
}
.maprow { display: flex; align-items: center; gap: var(--sp-3); }
.maplegend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  max-width: 100%;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-3);
  font-size: 11.5px;
  color: var(--ink-2);
}
.maplegend .lgk {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3);
}
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }
.maplegend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.maplegend .ramp { gap: 0; }
.maplegend .ramp i { border-radius: 0; width: 22px; }
.maplegend .ramp i:first-child { border-radius: 3px 0 0 3px; }
.maplegend .ramp i:last-child { border-radius: 0 3px 3px 0; }
.maplegend .lgs { color: var(--ink-3); }

/* --- the scrubber, along the bottom of the map ------------------------ */
.mapscrub {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  box-shadow: var(--sh-3);
}
.tbtn {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.tbtn:hover { background: var(--surface-3); color: var(--ink); }
.tnow {
  font-family: var(--display);
  font-size: 14px; font-weight: 700;
  min-width: 92px; flex: none;
}
.scrubtrack { flex: 1; min-width: 0; display: block; position: relative; }
.scrubsvg { display: block; width: 100%; height: 46px; cursor: pointer; }
/* an axis under the bars, ticked at each January and named from the tick
   rightwards, so the label marks where the year begins rather than its middle */
.scrubax {
  display: block; position: relative; height: 15px;
  margin-top: 2px;
  border-top: 1px solid var(--line-2);
  font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.scrubax span { position: absolute; top: 3px; padding-left: 5px; white-space: nowrap; }
.scrubax span::before {
  content: ""; position: absolute; left: 0; top: -4px;
  width: 1px; height: 6px; background: var(--ink-3); opacity: 0.5;
}

/* --- what sits under the map ------------------------------------------ */
.mapdetail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}
/* the intervention lab is built as one full-width screen (ranked list | answer);
   beside the day chart it wrapped its own header and overlapped its columns */
.mapdetail > #sp-lab { grid-column: 1 / -1; }

.applyrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 24px;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  margin-bottom: var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color var(--fast), background var(--fast);
}
.applyrow:hover { border-color: var(--ink-3); }
.applyrow.on { border-color: var(--accent-line); background: var(--accent-soft); }
.applyrow .arname { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.applyrow .archip {
  font-size: 10.5px; font-weight: 600; padding: 3px 8px;
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-3);
  white-space: nowrap;
}
.applyrow .archip.press { background: var(--accent-soft); color: var(--accent); }
.applyrow .arscope { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.applyrow .arto { color: var(--ink-3); display: grid; place-items: center; }
.applyrow.on .arto { color: var(--accent); }

/* --- map popups inherit the app's card language ----------------------- */
/* Above the legend and the scrubber (both z-index 3), below the drawers, which
   a popup is nudged clear of rather than allowed to fight with. */
.maplibregl-popup { z-index: 5; }
/* the map library adds its own stylesheet at runtime, after this one, and it
   paints popups white; the extra class keeps our themed card on top of it */
.maplibregl-map .maplibregl-popup-content {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  box-shadow: var(--sh-3);
  padding: var(--sp-3) var(--sp-4);
  font: 12px/1.55 var(--font);
}
.maplibregl-popup-content b {
  display: block; font-family: var(--display); font-size: 13px; line-height: 1.3;
}
.maplibregl-popup-content .phead b { margin-bottom: 0; padding-right: 18px; }
.maplibregl-popup-content div { color: var(--ink-2); }
.maplibregl-popup-tip { display: none; }
.maplibregl-map .maplibregl-popup-close-button {
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: var(--r-1);
  color: var(--ink-3);
  font-size: 15px; line-height: 1;
  background: transparent; border: 0; cursor: pointer;
}
.maplibregl-popup-close-button:hover { background: var(--surface-3); color: var(--ink); }

@media (max-width: 1080px) {
  .mapdetail { grid-template-columns: 1fr; }
  .mappills { display: none; }        /* the pills would cover the map at this width */
  .mapstage.panelopen .mapright { right: var(--sp-4); }
}
@media (max-width: 720px) {
  .mapstage { height: clamp(380px, 56vh, 520px); }
  .mapctl { max-width: calc(100% - 32px); }
  .scenpanel { left: var(--sp-4); width: auto; }
}

/* ---- intervention lab ---- */
/* ------------------------------------------------------------- Scenarios */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; }
.slider { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.slider input[type=range] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.slider .sv { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; min-width: 74px; }

table.stbl { border-collapse: collapse; width: 100%; font-size: 13px; margin-top: 10px; }
table.stbl th, table.stbl td {
  text-align: right; padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
table.stbl th:first-child, table.stbl td:first-child { text-align: left; font-variant-numeric: normal; }
table.stbl th { color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.dotc { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 8px; }

/* ------------------------------------------------------------ map iframe */
.frameshell { position: relative; }
.frameshell iframe {
  width: 100%; height: 0; border: 0; display: block;
  background: var(--bg);
  border-radius: 0 0 var(--r-3) var(--r-3);
}
.frameshell iframe.on { height: 1480px; }
.frameph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ink-3); font-size: 13px;
  text-align: center; padding: 0 20px;
}
.frameph[hidden] { display: none; }

@media (max-width: 1180px) {
  .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cmpgrid, .lab, .lab2 { grid-template-columns: 1fr; gap: 22px; }
  .labans { position: static; }
}
@media (max-width: 560px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ======================================================================
   Intervention lab (Scenarios), the lever plays on Compare, and the
   "All 11 hosts" view on the Overview. Same card language as above.
   ====================================================================== */

/* the play cards' effect line, shared by Compare's plays and the lab's levers */
.play .eff { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; }
.play .eff .e b { font-weight: 700; }
.play .foot .lnk { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.play .ev, .lever .ev, .cform .ev, .leverrank .ev {
  display: inline-block; font-size: 10px; font-weight: 500; padding: 1px 6px; margin-left: 6px;
  border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink-3); vertical-align: 2px;
}
.play .ev.mine, .lever .ev.mine, .cform .ev, .leverrank .ev { border-color: var(--c-venue); color: var(--c-venue); }

/* ------------------------------------------------- one screen: pick | answer */
.labhead .hsurge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-right: 6px; }
.labhead .hsurge input[type=range] { width: 110px; accent-color: var(--accent); cursor: pointer; }
.labhead .hsurge b { color: var(--ink); font-size: 13px; min-width: 44px; }
.lab2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.labans { position: sticky; top: 12px; }
.lowhigh { font-size: 12px; color: var(--ink-3); }
.deadlevers { margin-top: 6px; }
.deadlevers summary { font-size: 12.5px; color: var(--ink-3); }
.deadlevers table.rank td { color: var(--ink-3); }

/* one lever's detail, under the answer */
.ldetail { border: 1px solid var(--accent-line); border-radius: var(--r-1); padding: 12px 14px; margin-top: 12px; background: var(--surface-2); font-size: 12.5px; }
.ldetail .dh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ldetail .dh b { font-size: 14px; color: var(--ink); }
.ldetail .dh .tch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ldetail .dh input { margin: 0; accent-color: var(--accent); }
.ldetail .lp { margin: 8px 0 6px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.ldetail .dr { margin-top: 5px; color: var(--ink-2); line-height: 1.5; }
.ldetail .dr b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.ldetail a { color: var(--accent); }
.ldetail .cbtns { display: flex; gap: 6px; margin-top: 10px; }
.ldetail .lnk, .cform .ch .lnk { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.cform .ch { display: flex; align-items: center; gap: 8px; }
.cform .ch .sp { flex: 1; }

/* the pop-over for the organiser's own lever */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(28, 25, 23, 0.45); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modalbox { width: min(720px, 100%); max-height: 90vh; overflow-y: auto; border-radius: var(--r-3); box-shadow: var(--sh-4); }

/* ---------------------------------------------------------- the answer */
.impact { border: 1px solid var(--line); border-radius: var(--r-1); padding: 12px 14px; }
.impact .hl { font-size: 15px; line-height: 1.45; color: var(--ink); }
.impact .hl b { font-weight: 600; }
.impact .empty { padding: 18px 0; }
.cutrow { display: grid; grid-template-columns: 64px 1fr 150px; gap: 10px; align-items: center; margin-top: 10px; font-size: 12px; }
.cutrow .lab { display: block; color: var(--ink-2); font-weight: 600; }
.cutrow .val { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.cutrow .val small { display: block; color: var(--ink-3); font-weight: 400; }
.cutbar svg { display: block; width: 100%; height: 22px; overflow: visible; }
.axis { display: grid; grid-template-columns: 64px 1fr 150px; gap: 10px; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.axis .ticks { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 2px; }
.bylever { margin-top: 14px; }
.bylever h5 { margin: 0 0 6px; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.lvrow { display: grid; grid-template-columns: 1fr 160px; gap: 10px; align-items: center; font-size: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.lvrow .n { color: var(--ink-2); }
.lvrow .n small { color: var(--ink-3); }
.lvrow .bars { display: grid; gap: 3px; }
.lvrow .b { display: grid; grid-template-columns: 40px 1fr 56px; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lvrow .b i { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); position: relative; overflow: hidden; }
.lvrow .b i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--c); border-radius: 3px; }
.numbers { margin-top: 12px; }
.offbox { border: 1px solid var(--line); border-radius: var(--r-1); padding: 10px 12px; margin-top: 12px; }
.offbox .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.offbox .v { font-size: 15px; font-weight: 600; margin-top: 2px; }
.offbox .u { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* ------------------------------------------------- what helps this city */
.leverrank .lead2 { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 14px; max-width: 90ch; }
.leverrank .lead2 b { color: var(--ink); }
.leverrank .tblwrap { overflow-x: auto; margin: 0 -4px; }
table.rank { border-collapse: collapse; width: 100%; font-size: 13px; }
table.rank th, table.rank td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
table.rank th { color: var(--ink-3); font-weight: 500; font-size: 11.5px; white-space: nowrap; }
table.rank th.num, table.rank td.num { text-align: right; font-variant-numeric: tabular-nums; width: 72px; }
table.rank td.tick { width: 28px; padding-right: 0; }
table.rank td.tick input { margin: 0; display: block; cursor: pointer; accent-color: var(--accent); }
table.rank td.n { min-width: 180px; }
table.rank .lname { background: none; border: 0; padding: 0; font: 500 13px/1.3 var(--font); color: var(--ink); cursor: pointer; text-align: left; }
table.rank .lname:hover { color: var(--accent); text-decoration: underline; }
table.rank .when { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
table.rank tr.sel td { background: var(--accent-soft); }
table.rank tr.sel td.hot { background: color-mix(in srgb, var(--c-venue) 22%, transparent); }
table.rank th.hot, table.rank td.hot { background: color-mix(in srgb, var(--c-venue) 14%, transparent); color: var(--ink); font-weight: 600; }
table.rank td.nil { color: var(--ink-3); font-weight: 400; }
table.rank tr.on td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
table.rank tr.on td.hot { background: color-mix(in srgb, var(--c-venue) 22%, transparent); }
table.rank td.reach { color: var(--ink-2); white-space: nowrap; width: 150px; }
table.rank td.cost { color: var(--ink); font-weight: 600; white-space: nowrap; width: 48px; cursor: help; }
table.rank td.cost b { color: var(--ink); font-weight: 600; margin-right: 6px; }
table.rank td.cost small { color: var(--ink-3); font-size: 12px; }
table.rank .tag { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink-3); margin-left: 6px; vertical-align: 1px; }
.leverrank details { margin-top: 10px; }
.leverrank details .note { margin-top: 4px; max-width: 90ch; }

/* ------------------------------------------------------- your own lever */
#sc-customlab { margin-top: 12px; }
.addlever {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 2px dashed var(--ink-3); border-radius: var(--r-1); padding: 12px 14px;
}
.addlever b { display: block; font-size: 14px; font-weight: 700; }
.addlever span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.addlever:hover { border-color: var(--ink); border-style: solid; }
.addlever[hidden] { display: none; }
.cform {
  border: 1px solid var(--ink-2); border-radius: var(--r-1); padding: 12px 14px; background: var(--surface-2);
  display: grid; gap: 9px; font-size: 12px;
}
.cform .ch { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cform .f { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; margin: 0; }
.cform .f > span:first-child { color: var(--ink-2); }
.cform input[type=text], .cform select {
  width: 100%; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px;
}
.cform .tch { display: inline-flex; align-items: center; gap: 5px; margin: 2px 12px 2px 0; cursor: pointer; }
.cform .tch input { margin: 0; }
.cform .segrow { border-top: 1px solid var(--line); padding-top: 8px; }
.cform .segrow[hidden] { display: none; }
.cform .sh { font-weight: 600; margin-bottom: 2px; }
.cform .cols, .cform .pvr { display: grid; grid-template-columns: 76px 72px 72px 72px minmax(120px, 1fr); gap: 6px; align-items: center; }
.cform:not(.range) .cols, .cform:not(.range) .pvr { grid-template-columns: 76px 72px 120px 1fr; }
/* with a range there is no room for the hint beside the boxes, so it goes on its own line under them */
.cform.range .pvr .base { grid-column: 2 / -1; }
.cform.range .cols > span:last-child { display: none; }
.cform .pvr span.un { color: var(--ink-2); font-size: 12px; }
.cform .pvr select.un { width: 100%; font: inherit; font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 4px; }
.cform:not(.range) .onlyrange, .cform:not(.range) .pvr input.lo, .cform:not(.range) .pvr input.hi { display: none; }
.cform .cols { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.cform .pvr { margin-top: 4px; }
.cform .pvr input { width: 100%; font: inherit; font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 6px; font-variant-numeric: tabular-nums; }
.cform .pvr input.bad { border-color: var(--c-energy); box-shadow: 0 0 0 1px var(--c-energy); }
.cform .pvr .rl { color: var(--ink-2); }
.cform .pvr .base { color: var(--ink-3); font-size: 11px; line-height: 1.3; }
.cform .pvr .base b { color: var(--ink); }
.cform .err { color: var(--c-energy); display: grid; gap: 2px; }
.cform .err:empty { display: none; }
.cform .err .warn { color: var(--c-venue); }
.cform .cta2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cform .cta2 .note { margin: 0; }

/* ------------------------------------------- Overview · All 11 hosts */
.pane.allmode > *:not(#ov-all) { display: none !important; }
.allhosts .body { padding: 20px; }
.allkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 20px; }
.akpi { border: 1px solid var(--line); border-radius: var(--r-2); padding: 14px 16px; background: var(--surface-2); display: grid; gap: 4px; }
.akpi .ak { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.akpi .av { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.akpi .au, .akpi .ae { font-size: 11.5px; color: var(--ink-3); }
.citygrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cityopt.all { justify-content: center; font-weight: 600; grid-column: 1 / -1; border: 1px dashed var(--line-2); }
.cityopt.all .cn { color: var(--ink); }
@media (max-width: 1180px) { .allkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .citygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .allkpis, .citygrid { grid-template-columns: 1fr; } .cutrow, .axis { grid-template-columns: 52px 1fr 110px; } }

