/* ============================================================
   Heatscape NYC — grey / white glassmorphism
   ============================================================ */
:root {
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-inner: rgba(120, 128, 138, 0.10);
  --ink: #2b3138;
  --ink-soft: #5b6570;
  --ink-faint: #8b949e;
  --hairline: rgba(43, 49, 56, 0.10);
  --accent: #34424f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(30, 38, 46, 0.16), 0 2px 8px rgba(30, 38, 46, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e9ebee;
  overflow: hidden;
}

#app-shell { position: relative; width: 100vw; height: 100vh; }
#map { position: absolute; inset: 0; }

/* ---------- loading modal ---------- */
.loading-modal {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(233, 235, 238, 0.75);
  backdrop-filter: blur(10px);
  transition: opacity 0.35s ease;
}
.loading-modal.hidden { opacity: 0; pointer-events: none; }
.loading-modal__panel {
  display: flex; gap: 18px; align-items: center;
  padding: 26px 34px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.3);
}
.loading-modal__spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(43, 49, 56, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-modal__copy h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.loading-modal__copy p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.loading-modal__note { margin-top: 3px !important; font-size: 11px !important; color: var(--ink-faint) !important; }

/* ---------- panel ---------- */
.panel {
  position: absolute; z-index: 40;
  top: 16px; left: 16px; bottom: 16px;
  width: 392px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.3s ease;
}
.panel.collapsed { transform: translateX(calc(-100% - 32px)); opacity: 0; pointer-events: none; }

.panel__topline {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 20px 20px 14px;
  border-bottom: 1px solid var(--hairline);
}
.panel__title h1 {
  margin: 0; font-family: var(--font-display);
  font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
}
.panel__title h1 span { color: var(--ink-faint); font-weight: 600; }
.panel__eyebrow { margin: 7px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-soft); }

.panel__content { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 14px 14px; }
.panel__content::-webkit-scrollbar { width: 8px; }
.panel__content::-webkit-scrollbar-thumb { background: rgba(43,49,56,0.18); border-radius: 8px; }
.panel__content::-webkit-scrollbar-track { background: transparent; }

.panel__footer { padding: 14px 6px 4px; }
.panel__footer p { margin: 0; font-size: 10.5px; line-height: 1.55; color: var(--ink-faint); }

.panel-open {
  position: absolute; z-index: 39; top: 24px; left: 16px;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.panel-open svg { width: 18px; height: 18px; }

/* ---------- sections ---------- */
.section {
  margin: 12px 6px 0; padding: 14px;
  background: var(--glass-inner);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
}
.section__head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0; margin: 0 0 6px;
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.section__head.static { cursor: default; }
.section__head h3 {
  margin: 0; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-soft);
}
.section__meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-faint); }
.section__meta .chev { width: 15px; height: 15px; transition: transform 0.25s ease; }
.section__head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.section__body { overflow: hidden; max-height: 1200px; transition: max-height 0.35s ease, opacity 0.3s ease; }
.section__body.collapsed { max-height: 0; opacity: 0; }

.hint { margin: 4px 0 10px; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); }

.icon-btn {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.5); color: var(--ink-soft); cursor: pointer;
  transition: background 0.2s ease;
}
.icon-btn:hover { background: rgba(255,255,255,0.85); }
.icon-btn svg { width: 15px; height: 15px; }

.ghost-btn {
  margin-top: 10px; padding: 7px 12px;
  font: 500 11.5px var(--font); color: var(--ink-soft);
  background: rgba(255,255,255,0.55); border: 1px solid var(--hairline);
  border-radius: 9px; cursor: pointer; transition: background 0.2s ease;
}
.ghost-btn:hover { background: rgba(255,255,255,0.9); }

/* ---------- layer chips + legend ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 11px; font: 500 11.5px var(--font);
  color: var(--ink-soft); background: rgba(255,255,255,0.5);
  border: 1px solid var(--hairline); border-radius: 999px;
  cursor: pointer; transition: all 0.18s ease;
}
.chip:hover { background: rgba(255,255,255,0.9); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
select.chip { appearance: none; -webkit-appearance: none; padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235b6570' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; }
select.chip.active {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='white' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* colour scale picker */
.scale-row { margin-top: 12px; }
.scale-row__label { display: block; margin-bottom: 6px; font-size: 10.5px; color: var(--ink-faint); }
.scale-row__label b { color: var(--ink-soft); font-weight: 600; }
.scale-swatches { display: flex; gap: 6px; }
.swatch {
  flex: 1; height: 16px; padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 6px;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(43, 49, 56, 0.12);
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent), 0 2px 8px rgba(30, 38, 46, 0.2);
}

.legend { margin-top: 12px; }
.legend__bar { height: 9px; border-radius: 6px; border: 1px solid rgba(43,49,56,0.10); }
.legend__labels { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10.5px; color: var(--ink-faint); }
.legend__cats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.legend__cat { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-soft); }
.legend__cat i { width: 11px; height: 11px; border-radius: 3.5px; flex: none; }

/* ---------- weights ---------- */
.wgroup { margin-bottom: 4px; border-bottom: 1px solid var(--hairline); padding: 6px 0; }
.wgroup:last-of-type { border-bottom: none; }
.wrow { display: grid; grid-template-columns: 118px 1fr 34px 20px; align-items: center; gap: 8px; }
.wrow label { font-size: 12px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow output { font-size: 11px; color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; }
.wrow .subchev { width: 16px; height: 16px; border: none; background: none; padding: 0; color: var(--ink-faint); cursor: pointer; }
.wrow .subchev svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.wrow .subchev[aria-expanded="true"] svg { transform: rotate(180deg); }
.wsub { margin: 4px 0 4px 8px; padding-left: 10px; border-left: 2px solid var(--hairline); display: none; }
.wsub.open { display: block; }
.wsub .wrow { grid-template-columns: 128px 1fr 42px; }
.wsub .wrow label { font-size: 11px; font-weight: 400; color: var(--ink-soft); }

/* A category has no slider of its own: its weight is the sum of the indicator
   sliders beneath it, so the middle cell of the row is a readout rather than a
   control. It occupies the same grid track a slider would, which keeps every
   label, value and chevron in one column down the panel. */
.wrow--cat .wtotal { display: block; height: 16px; padding: 5px 0; cursor: help; }
.wrow--cat .wtotal__track {
  display: block; height: 6px; border-radius: 999px;
  background: var(--hairline); overflow: hidden;
}
.wrow--cat .wtotal__track i {
  display: block; height: 100%; border-radius: 999px;
  transition: width 0.18s ease;
}
.wrow--cat output { color: var(--ink-soft); font-weight: 600; }
.wrow--cat.is-dead label,
.wrow--cat.is-dead output { opacity: 0.55; }
.wsub .wrow.is-dead label,
.wsub .wrow.is-dead output { opacity: 0.5; }

/* ---------------------------------------------------- weighting basis */
.wpreset { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 2px 0 10px; }
.wpreset__btn {
  display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; text-align: left;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  background: rgba(255,255,255,0.55); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); transition: background .15s, border-color .15s, color .15s;
}
.wpreset__btn span { font-size: 10px; font-weight: 400; color: var(--ink-faint); line-height: 1.35; }
.wpreset__btn:hover { background: rgba(255,255,255,0.85); }
.wpreset__btn.is-active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.wpreset__btn.is-active span { color: rgba(255,255,255,0.72); }
.wpreset__btn.hidden { display: none; }

.wev {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px;
  margin: -1px 0 7px 0; padding-left: 1px; font-size: 10px; line-height: 1.4;
}
.wev__eff { font-weight: 600; font-variant-numeric: tabular-nums; cursor: help; }
.wev__eff.pos { color: #E05E3D; }

.wev__primary {
  font-weight: 600; font-variant-numeric: tabular-nums; color: #577590;
  padding: 0 4px; border-radius: 4px; background: rgba(87,117,144,0.10);
  cursor: help;
}
.wev__ci { font-weight: 400; color: var(--ink-faint); margin-left: 2px; }
.wev__meta { color: var(--ink-faint); }
.wev__muted { color: var(--ink-faint); font-style: italic; }
.wev__tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag {
  padding: 1px 5px; border-radius: 999px; font-size: 9px; font-weight: 600;
  letter-spacing: 0.01em; background: rgba(87,117,144,0.13); color: #577590;
  cursor: help; white-space: nowrap;
}
.tag--warn { background: rgba(201,162,39,0.16); color: #97781a; }

.cnote {
  margin: 0 0 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  background: rgba(67,170,139,0.08); border: 1px solid rgba(67,170,139,0.22);
  font-size: 10.5px; line-height: 1.5; color: var(--ink-soft);
}
.cnote.hidden { display: none; }
.cnote__row { display: grid; grid-template-columns: 78px 1fr; gap: 8px; margin-bottom: 3px; }
.cnote__row b { font-weight: 600; color: var(--ink); }
.cnote__row--wide { margin-top: 6px; }
.cnote__caveat { margin: 6px 0 0; font-size: 10px; color: var(--ink-faint); }

/* attribution-by-category bars in the Shapley summary */
.cshares { display: flex; flex-direction: column; gap: 2px; }
.cshare {
  display: grid; grid-template-columns: 6px minmax(0, 1fr) 34px 36px 30px;
  align-items: center; gap: 4px; font-size: 9.5px; line-height: 1.4;
}
.cshare__dot { width: 6px; height: 6px; border-radius: 50%; }
.cshare__label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cshare__bar {
  height: 4px; border-radius: 999px; background: rgba(0,0,0,0.07); overflow: hidden;
}
.cshare__bar i { display: block; height: 100%; border-radius: 999px; }
.cshare__num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.cshare__w { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.cshare.is-dead .cshare__label,
.cshare.is-dead .cshare__num { opacity: 0.6; }
.cshare.is-dead .cshare__w { color: #b8462c; font-weight: 600; }

/* category-level attribution line under a category slider */
.wev--cat { margin: 3px 0 6px; opacity: 0.92; }

.var__eff {
  margin-top: 2px; font-size: 9.5px; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; cursor: help;
}
.var__eff--zero { font-style: italic; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: rgba(43,49,56,0.14); border-radius: 4px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--accent);
  box-shadow: 0 1px 4px rgba(30,38,46,0.25); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--accent);
  box-shadow: 0 1px 4px rgba(30,38,46,0.25); cursor: grab;
}

/* ---------- selected cell ---------- */
.empty-state { display: flex; gap: 12px; align-items: flex-start; padding: 6px 2px; }
.empty-state svg { width: 30px; height: 30px; flex: none; color: var(--ink-faint); margin-top: 2px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--ink-faint); }
.hidden { display: none !important; }

.cell-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cell-head h4 { margin: 0; font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.cell-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-faint); }
.score-badge {
  flex: none; min-width: 62px; padding: 8px 10px 7px; text-align: center;
  border-radius: 12px; color: #fff; background: #999;
  box-shadow: 0 4px 14px rgba(30,38,46,0.22);
}
.score-badge span { display: block; font-size: 20px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.score-badge label { display: block; margin-top: 3px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }

.gate-note {
  margin: 4px 0 8px; padding: 8px 10px; font-size: 11px; line-height: 1.45;
  color: #7c5a13; background: rgba(255, 214, 110, 0.28);
  border: 1px solid rgba(179, 137, 40, 0.25); border-radius: 9px;
}

.block-label {
  display: flex; align-items: baseline; gap: 8px;
  margin: 14px 0 7px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft);
}
.block-label__hint { font-size: 10px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }

/* interventions */
.iv {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline); border-radius: 10px;
}
.iv--top { border-width: 1.5px; background: rgba(255,255,255,0.8); }
.iv__rank { flex: none; width: 21px; height: 21px; border-radius: 7px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.iv__body { flex: 1; min-width: 0; }
.iv__label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.iv__label b { font-size: 12.5px; font-weight: 600; }
.iv__label span { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.iv__desc { margin: 3px 0 5px; font-size: 11px; line-height: 1.45; color: var(--ink-soft); }
.iv__bar { height: 4px; border-radius: 4px; background: rgba(43,49,56,0.10); overflow: hidden; }
.iv__bar i { display: block; height: 100%; border-radius: 4px; }

/* categories accordion */
.cat { margin-bottom: 6px; background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; }
.cat__head {
  display: grid; grid-template-columns: 12px 1fr 74px 15px; align-items: center; gap: 9px;
  width: 100%; padding: 9px 11px; background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.cat__dot { width: 10px; height: 10px; border-radius: 3.5px; }
.cat__name { font-size: 12.5px; font-weight: 600; }
.cat__scorewrap { display: flex; align-items: center; gap: 6px; }
.cat__minibar { flex: 1; height: 4px; border-radius: 4px; background: rgba(43,49,56,0.10); overflow: hidden; }
.cat__minibar i { display: block; height: 100%; border-radius: 4px; }
.cat__num { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; width: 22px; text-align: right; }
.cat__head .chev { width: 14px; height: 14px; color: var(--ink-faint); transition: transform 0.22s ease; }
.cat__head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.cat__body { display: none; padding: 2px 11px 10px; }
.cat__body.open { display: block; }

.var { display: grid; grid-template-columns: 1fr 88px; gap: 4px 10px; padding: 5px 0; border-top: 1px dashed var(--hairline); }
.var:first-child { border-top: none; }
.var__name { font-size: 11.5px; color: var(--ink); }
.var__raw { font-size: 10.5px; color: var(--ink-faint); }
.var__pct { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.var__bar { height: 5px; border-radius: 4px; background: rgba(43,49,56,0.10); position: relative; overflow: hidden; }
.var__bar i { display: block; height: 100%; border-radius: 4px; }
.var__pcttxt { font-size: 9.5px; color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- diagram ---------- */
.diagram-mini {
  height: 250px; border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.5); border: 1px solid var(--hairline);
  position: relative; cursor: grab;
}
.diagram-mini:active { cursor: grabbing; }
.diagram-mini svg, .diagram-full svg { display: block; width: 100%; height: 100%; }

.diagram-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.diagram-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-soft); }
.diagram-legend i { width: 8px; height: 8px; border-radius: 50%; }

/* nodes / links */
.dg-link { fill: none; stroke-width: 1.4; opacity: 0.5; transition: opacity 0.3s ease, stroke-width 0.3s ease; }
.dg-link.pos { stroke: #46525e; }
.dg-link.neg { stroke: #c25b4e; stroke-dasharray: 5 4; }
.dg-link.dim { opacity: 0.10; }
.dg-link.flow {
  opacity: 0.95; stroke-width: 2.4;
  stroke-dasharray: 7 6;
  animation: dgflow 0.9s linear infinite;
}
.dg-link.neg.flow { stroke-dasharray: 7 6; }
@keyframes dgflow { to { stroke-dashoffset: -13; } }
.diagram-paused .dg-link.flow { animation-play-state: paused; }

.dg-node { cursor: pointer; }
.dg-node circle { stroke: #fff; stroke-width: 1.6; transition: opacity 0.3s ease, r 0.3s ease; }
.dg-node text {
  font-family: var(--font); font-size: 10.5px; font-weight: 500; fill: #313842;
  paint-order: stroke; stroke: rgba(255,255,255,0.85); stroke-width: 3px; stroke-linejoin: round;
  transition: opacity 0.3s ease;
}
.dg-node.dim circle { opacity: 0.18; }
.dg-node.dim text { opacity: 0.22; }
.dg-node.active circle { stroke: #ffffff; stroke-width: 2.2; filter: drop-shadow(0 0 7px rgba(255,140,0,0.75)); }
.dg-node.active text { font-weight: 700; }
.dg-pulse { fill: none; stroke-width: 2; opacity: 0; pointer-events: none; }
.dg-node.active .dg-pulse { animation: dgpulse 1.8s ease-out infinite; }
@keyframes dgpulse {
  0% { opacity: 0.75; r: 12; }
  100% { opacity: 0; r: 30; }
}
.dg-marker-pos { fill: #46525e; }
.dg-marker-neg { fill: #c25b4e; }

/* ---------- fullscreen overlay ---------- */
.diagram-overlay {
  position: absolute; inset: 0; z-index: 55;
  display: flex; flex-direction: column;
  background: rgba(236, 238, 241, 0.82);
  backdrop-filter: blur(24px) saturate(1.3);
}
.diagram-overlay__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px 12px;
}
.diagram-overlay__bar h2 { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.diagram-overlay__bar p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.diagram-overlay__actions { display: flex; gap: 8px; align-items: center; }
.diagram-overlay__actions .ghost-btn { margin-top: 0; }
.diagram-full { flex: 1; margin: 0 20px 16px; border-radius: var(--radius);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow); overflow: hidden; cursor: grab; }
.diagram-full:active { cursor: grabbing; }
.diagram-full .dg-node text { font-size: 12px; }
.diagram-overlay__readout {
  position: absolute; right: 34px; bottom: 34px; max-width: 330px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
  font-size: 12px; line-height: 1.55; color: var(--ink-soft);
}
.diagram-overlay__readout h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--ink); }
.diagram-overlay__readout ul { margin: 4px 0 0; padding-left: 16px; }
.diagram-overlay__readout li { margin-bottom: 3px; }

/* ---------- tooltip ---------- */
.tooltip {
  position: absolute; z-index: 45; pointer-events: none;
  padding: 8px 11px; border-radius: 10px;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  box-shadow: 0 8px 26px rgba(30,38,46,0.18);
  backdrop-filter: blur(14px);
  font-size: 11.5px; color: var(--ink); max-width: 230px;
}
.tooltip b { display: block; font-size: 12px; margin-bottom: 2px; }
.tooltip span { color: var(--ink-faint); font-size: 10.5px; }

/* ---------- map credits ---------- */
.maplibregl-ctrl-attrib { font-size: 10px !important; background: rgba(255,255,255,0.6) !important; }

@media (max-width: 640px) {
  .panel { width: calc(100vw - 24px); top: 12px; left: 12px; bottom: 12px; }
}
