:root {
  --bg: #05070B;
  --deep-surface: #0B0F17;
  --panel: rgba(255,255,255,0.035);
  --panel-border: rgba(255,255,255,0.08);
  --text: #E9EDF5;
  --toned: #d6d2c8;
  --muted: #8C93A3;
  --beam: #DDE8FF;
  --cold-blue: #7DA7FF;
  --cyan: #39E6E6;
  --amber: #FFB86B;
  --magenta: #E45C91;
  --success: #3FE6A5;
  --warning: #F5A45D;

  --font-display: "Cormorant Garamond", serif;
  --font-ui: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  width: 100%; height: 100%;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ============ LANDING ============ */
.landing {
  position: relative;
  width: 100%; height: 100vh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.9s ease;
}
.landing.leaving { opacity: 0; pointer-events: none; }

.landing-map {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  animation: mapFadeIn 1.6s ease-out 0.3s forwards;
}
@keyframes mapFadeIn { to { opacity: 1; } }

.light-beam {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 2px;
  height: 0;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--beam) 35%, var(--beam) 60%, transparent);
  box-shadow: 0 0 60px 8px rgba(221,232,255,0.55), 0 0 140px 30px rgba(125,167,255,0.25);
  animation: beamGrow 1.4s ease-out 0.9s forwards;
  pointer-events: none;
}
@keyframes beamGrow { to { height: 120%; } }

.landing-content {
  position: relative;
  z-index: 4;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: -6vh;
}

.landing-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 92px;
  letter-spacing: 0.04em;
  color: #F4F1EA;
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 1s ease-out 2.0s forwards;
}
.landing-subtitle {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.9s ease-out 2.4s forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.cta-button {
  margin-top: 10px;
  padding: 13px 34px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, #FFFFFF, #E9EDF5);
  color: #0B0F17;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.03em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp 0.8s ease-out 2.8s forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(233,237,245,0.25);
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard {
  width: 100%; height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  animation: fadeUp 0.7s ease-out forwards;
}

.topbar {
  height: 56px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--deep-surface);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--beam); font-size: 16px; }
.brand-name { font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--text); }

.search-wrap {
  position: relative;
  width: 380px;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 40px 8px 14px;
  outline: none;
}
.search-input::placeholder { color: var(--muted); }
.search-kbd {
  position: absolute; right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.icon-btn { cursor: pointer; opacity: 0.8; }
.org-select { font-size: 12.5px; color: var(--muted); cursor: pointer; }

/* Breadcrumb in top bar */
.topbar-breadcrumb { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-left: 28px; }
.topbar-breadcrumb .crumb { cursor: pointer; }
.topbar-breadcrumb .crumb:hover { color: var(--text); }
.topbar-breadcrumb .crumb.current { color: var(--text); font-weight: 600; }
.topbar-breadcrumb .sep { opacity: 0.5; }

/* Dataset switcher (compact, replaces the big browser column) */
.dataset-switch { display: flex; gap: 6px; }
.ds-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  border: 1px solid var(--panel-border); background: var(--panel);
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.ds-pill.selected { color: var(--text); border-color: rgba(125,167,255,0.4); box-shadow: inset 0 0 0 1px rgba(125,167,255,0.15); }
.ds-pill.disabled { opacity: 0.45; cursor: default; }
.ds-pill .dot { width: 6px; height: 6px; border-radius: 50%; }

.dash-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 0;
}

/* Analysis grid: 3D map hero (left) + UHUS detail panel (far right) */
.analysis-grid {
  display: grid;
  /* wide panel so Insights sits beside Detail without either squeezing (the map gives up the width) */
  grid-template-columns: minmax(320px, 1fr) 772px;
  gap: 1px;
  background: var(--panel-border);
  min-height: 0;
}
@media (max-width: 1560px) { .analysis-grid { grid-template-columns: minmax(300px, 1fr) 720px; } }
/* too narrow for side-by-side → fall back to a single narrow panel (panels stack) */
@media (max-width: 1180px) { .analysis-grid { grid-template-columns: minmax(280px, 1fr) 424px; } }
/* The right column follows how many panels are open — closing them all leaves just the
   48px rail so the map takes the width. Declared last so it beats the queries above. */
.analysis-grid.pcount-0 { grid-template-columns: minmax(320px, 1fr) 69px; }
.analysis-grid.pcount-1 { grid-template-columns: minmax(320px, 1fr) 436px; }
.analysis-grid.pcount-2 { grid-template-columns: minmax(320px, 1fr) 772px; }
.analysis-grid.pcount-3 { grid-template-columns: minmax(320px, 1fr) 1090px; }
@media (max-width: 1560px) {
  .analysis-grid.pcount-1 { grid-template-columns: minmax(300px, 1fr) 412px; }
  .analysis-grid.pcount-2 { grid-template-columns: minmax(300px, 1fr) 720px; }
  .analysis-grid.pcount-3 { grid-template-columns: minmax(300px, 1fr) 980px; }
}
/* stacked below this width, so one column regardless of how many are open */
@media (max-width: 1180px) {
  .analysis-grid.pcount-1,
  .analysis-grid.pcount-2,
  .analysis-grid.pcount-3 { grid-template-columns: minmax(280px, 1fr) 424px; }
  .analysis-grid.pcount-0 { grid-template-columns: minmax(280px, 1fr) 69px; }
}
.panel-cell {
  background: var(--deep-surface);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  position: relative;
}
.cell-header {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.11em; color: var(--muted);
}
.cell-hint { font-weight: 400; letter-spacing: 0; opacity: 0.7; font-size: 10px; }
.cell-body { flex: 1 1 auto; min-height: 0; padding: 4px 14px 12px; display: flex; flex-direction: column; }
.back-btn {
  background: transparent; border: 1px solid var(--panel-border); border-radius: 6px;
  color: var(--cyan); font-size: 11px; padding: 3px 10px; cursor: pointer; letter-spacing: 0;
}
.back-btn:hover { border-color: rgba(57,230,230,0.5); }

/* Side nav */
.side-nav {
  background: var(--deep-surface);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 14px 8px;
  gap: 4px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 10px 4px;
  cursor: pointer;
  color: var(--muted);
  text-align: center;
}
.nav-item .nav-icon { font-size: 16px; }
.nav-item .nav-label b { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: 0.01em; }
.nav-item .nav-label small { display: block; font-size: 8px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.nav-item.active {
  color: var(--cold-blue);
  background: rgba(125,167,255,0.08);
  box-shadow: inset 2px 0 0 var(--cold-blue);
}
.nav-item.active .nav-label small { color: rgba(125,167,255,0.7); }
.nav-spacer { flex: 1; }

/* 3D map hero cell: map stage (fills) + timeline strip below */
.atlas-canvas { padding: 0; overflow: hidden; position: relative; display: flex; flex-direction: column; min-height: 0; }
.map-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; }
#map canvas { outline: none; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { display: none !important; }
/* cool blue-black atmosphere, contrasting the warm amber/red data glow */
.map-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(10,16,28,0) 0%, rgba(6,10,20,0.35) 72%, rgba(3,5,10,0.6) 100%),
    linear-gradient(180deg, rgba(8,14,26,0.18), rgba(3,5,10,0.32));
}

/* Time-flow bottom strip */
.timeline {
  flex: 0 0 130px; display: flex; flex-direction: column; gap: 4px;
  padding: 8px 14px 10px; border-top: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(9,13,22,0.9), rgba(6,9,16,0.94));
}
.timeline.hidden { display: none; }
/* Transport (play/speed/reset) only appears in time mode (.time-live). In Static the
   strip still shows its graph + readout as context; the rail's Animate is the way in. */
.timeline:not(.time-live) .tl-play,
.timeline:not(.time-live) .tl-speeds,
.timeline:not(.time-live) .tl-reset { display: none; }
.tl-controls { display: flex; align-items: center; gap: 10px; }
.tl-play {
  width: 30px; height: 30px; border-radius: 50%; flex: none; cursor: pointer;
  border: 1px solid rgba(255,190,90,0.4); background: rgba(255,175,70,0.14);
  color: #FFD27A; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.tl-play:hover { background: rgba(255,175,70,0.24); }
.tl-play.playing { color: #FFE9C2; }
.tl-speeds { display: flex; gap: 3px; }
.tl-speeds button, .tl-reset {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 6px;
  color: var(--muted); font-size: 11px; padding: 4px 8px; cursor: pointer;
}
.tl-speeds button.active { color: var(--text); border-color: rgba(255,190,90,0.4); }
.tl-reset { margin-left: 2px; }
.tl-readout { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.tl-readout b { color: var(--text); }
.tl-chart { flex: 1 1 auto; min-height: 0; }
/* Draggable day-scrubber under the graph — moves the 3D map + graph cursor. */
.tl-scrub {
  flex: none; width: 100%; height: 14px; margin: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.tl-scrub::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,190,90,0.5), rgba(255,255,255,0.12));
}
.tl-scrub::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.tl-scrub::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -5px;
  width: 13px; height: 13px; border-radius: 50%; background: #FFD27A;
  border: 1px solid rgba(0,0,0,0.4); box-shadow: 0 0 6px rgba(255,190,90,0.5);
}
.tl-scrub::-moz-range-thumb {
  width: 13px; height: 13px; border: 1px solid rgba(0,0,0,0.4); border-radius: 50%;
  background: #FFD27A; box-shadow: 0 0 6px rgba(255,190,90,0.5);
}

/* floating map control panel */
.map-control {
  /* one constant width for every dataset/panel state — the panel must not resize
     as you move between datasets (Layer-Set editor or classic controls) */
  position: absolute; top: 16px; left: 16px; z-index: 6; width: 320px;
  background: linear-gradient(180deg, rgba(14,18,28,0.66), rgba(9,12,20,0.82));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 12px;
  padding: 14px; backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.05);
}
/* The legend is right-anchored now, so the left control panel can run nearly
   full height; it still scrolls internally if the layer list overflows. */
.map-control { max-height: calc(100% - 32px); overflow-y: auto; }

/* nav-driven overlay panels: hidden until a side-nav item is hovered/pinned */
.nav-overlay { display: none; }
.nav-overlay.show { display: block; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--panel-border);
}
.panel-head .panel-name { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; color: var(--text); }
.panel-head .panel-state {
  font-size: 8px; font-weight: 700; letter-spacing: 0.12em; color: var(--cyan);
  padding: 2px 6px; border: 1px solid rgba(57,230,230,0.3); border-radius: 5px;
}
#mc-nav-content .nav-info-stat {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
#mc-nav-content .nav-info-stat b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }
#mc-nav-content .nav-info-line { font-size: 11px; color: var(--muted); margin: 2px 0 10px; }
#mc-nav-content .compact-row {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted);
  padding: 6px; border-radius: 6px; cursor: pointer;
}
#mc-nav-content .compact-row:hover { background: rgba(255,255,255,0.04); color: var(--text); }
#mc-nav-content .compact-row .badge {
  margin-left: auto; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 5px;
}
/* Library: project-first tree (compact folder + dataset rows) */
#mc-nav-content .project-row {
  font-size: 12px; font-weight: 600; color: var(--text); padding: 6px 7px; border-radius: 6px; cursor: pointer;
  border: 1px solid transparent;
}
#mc-nav-content .project-row:hover, #mc-nav-content .project-row.active {
  background: rgba(57,230,230,0.08); border-color: rgba(57,230,230,0.22); color: #fff;
}
#mc-nav-content .lib-tree { margin-top: 6px; }
#mc-nav-content .folder-head {
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 9px 0 3px; padding-left: 4px;
}
#mc-nav-content .dataset-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--muted); padding: 5px 7px 5px 12px; border-radius: 6px; cursor: pointer;
}
#mc-nav-content .dataset-row:hover { background: rgba(255,255,255,0.04); color: var(--text); }
#mc-nav-content .dataset-row .ftype {
  flex: 0 0 auto; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 4px;
}
/* keep the side-nav active item highlighted while its overlay is open */
.side-nav .nav-item.active { color: #fff; }
.side-nav .nav-item.active .nav-icon { color: var(--cyan); }

/* top toolbar: quick base-layer toggle pills, to the right of the control panel */
.map-toolbar {
  /* compact vertical strip at the top-left; slides to the right of the overlay
     panel when one is pinned (see .map-stage.panel-pinned below) */
  position: absolute; top: 16px; left: 16px; z-index: 5;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  background: linear-gradient(180deg, rgba(14,18,28,0.86), rgba(9,12,20,0.82));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 10px;
  padding: 6px; backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
/* when a nav overlay panel is pinned open, move the toolbar to the right of it.
   (No CSS transition here: deck.gl's constant repaint keeps a `left` transition
   stuck mid-flight, so it would pin the toolbar at its start position.) */
/* clears the pinned panel (16px gutter + 320px panel + 16px gap) — constant, so the
   toolbar never shifts when switching datasets */
.map-stage.panel-pinned .map-toolbar { left: 352px; }
.map-toolbar button {
  background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border);
  border-radius: 7px; color: var(--muted); font-size: 11px; font-family: var(--font-ui);
  padding: 6px 11px; cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
  text-align: center;
}
/* divider between base layers and the OSM context overlays */
.map-toolbar .tb-sep { height: 1px; background: var(--panel-border); margin: 3px 1px; flex: none; }
.map-toolbar button:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.map-toolbar button.on {
  color: #fff; border-color: rgba(125,167,255,0.55);
  background: rgba(125,167,255,0.16); box-shadow: 0 0 14px rgba(125,167,255,0.22);
}
/* Reset pill: separated from the layer toggles, amber accent */
.map-toolbar .tb-reset {
  margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--panel-border); border-radius: 7px;
  color: var(--amber); background: rgba(255,184,107,0.08); border-color: rgba(255,184,107,0.28);
}
.map-toolbar .tb-reset:hover { color: #fff; background: rgba(255,184,107,0.18); border-color: rgba(255,184,107,0.5); }
.mc-title { font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em; color: var(--muted); margin: 10px 0 7px; }
.mc-title:first-child { margin-top: 0; }
.mc-subtitle { font-size: 8.5px; font-weight: 600; letter-spacing: 0.14em; color: rgba(255,255,255,0.32); margin: 11px 0 5px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* layer list */
.layer-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; }
.layer-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px;
  font-size: 11.5px; color: var(--muted); cursor: pointer;
}
.layer-row:hover { background: rgba(255,255,255,0.03); }
.layer-row input { accent-color: var(--cold-blue); margin: 0; }
.layer-row .lyr-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; opacity: 0.4; }
.layer-row:has(input:checked) { color: var(--text); }
.layer-row:has(input:checked) .lyr-dot { opacity: 1; box-shadow: 0 0 8px currentColor; }
.seg button {
  flex: 1 1 auto; min-width: 44px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--panel-border); border-radius: 6px; color: var(--muted);
  font-size: 10px; padding: 5px 4px; cursor: pointer; transition: all 0.15s ease;
}
.seg button:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.seg button.active {
  color: #fff; border-color: rgba(125,167,255,0.6);
  background: rgba(125,167,255,0.16); box-shadow: 0 0 14px rgba(125,167,255,0.25);
}
.shap-feature-filter {
  margin: 9px 0 12px; padding: 9px;
  border: 1px solid rgba(255,255,255,0.09); border-radius: 8px;
  background: rgba(255,255,255,0.025);
}
.shap-feature-filter[hidden] { display: none; }
.shap-filter-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--toned); font-size: 8.5px; font-weight: 700; letter-spacing: 0.12em; }
.shap-filter-actions { display: flex; gap: 3px; }
.shap-filter-actions button {
  padding: 2px 5px; border: 1px solid var(--panel-border); border-radius: 4px;
  background: rgba(255,255,255,0.04); color: var(--muted); font: inherit; letter-spacing: 0;
  cursor: pointer;
}
.shap-filter-actions button:hover { color: #fff; border-color: rgba(255,255,255,0.22); }
.shap-filter-note { margin: 5px 0 8px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.shap-filter-group { border-top: 1px solid rgba(255,255,255,0.055); }
.shap-filter-group summary {
  display: flex; align-items: center; justify-content: space-between; gap: 5px;
  padding: 6px 0; color: var(--text); font-size: 9.5px; cursor: pointer; list-style: none;
}
.shap-filter-group summary::-webkit-details-marker { display: none; }
.shap-filter-group summary label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.shap-filter-group summary small { color: var(--muted); font-size: 8.5px; font-variant-numeric: tabular-nums; }
.shap-feature-filter input { margin: 0; accent-color: var(--cold-blue); }
.shap-filter-vars { display: flex; flex-direction: column; gap: 4px; padding: 0 0 7px 18px; }
.shap-filter-vars label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; line-height: 1.25; cursor: pointer; }
.shap-filter-vars label:has(input:checked) { color: var(--toned); }
#grain-seg button[hidden] { display: none; }
/* vertical target-area stack: Seoul on its own row, Gu/Dong each paired with a picker */
.target-stack { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.target-row { display: flex; gap: 5px; align-items: stretch; }
.target-btn {
  background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border);
  border-radius: 6px; color: var(--muted); font-size: 10.5px; padding: 6px 8px;
  cursor: pointer; transition: all 0.15s ease;
}
.target-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.target-btn.active {
  color: #fff; border-color: rgba(125,167,255,0.6);
  background: rgba(125,167,255,0.16); box-shadow: 0 0 14px rgba(125,167,255,0.25);
}
.target-stack > .target-btn { width: 100%; text-align: center; }
.target-row .target-btn { flex: 0 0 54px; text-align: center; }
.target-row select {
  flex: 1 1 auto; min-width: 0; background: var(--deep-surface); color: var(--toned);
  border: 1px solid var(--panel-border); border-radius: 7px; padding: 6px 7px;
  font-size: 11px; outline: none; font-family: var(--font-ui); cursor: pointer;
}
.target-row select:hover { border-color: rgba(255,255,255,0.18); }
.mc-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; }
.mc-field label { font-size: 9.5px; letter-spacing: 0.08em; color: var(--muted); }
.mc-field select {
  background: var(--deep-surface); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 7px; padding: 6px 7px; font-size: 11px; outline: none; font-family: var(--font-ui);
}
.mc-slider { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.mc-slider label { font-size: 9.5px; letter-spacing: 0.06em; color: var(--muted); display: flex; justify-content: space-between; }
.mc-slider label span { font-family: var(--font-mono); color: var(--text); }
.mc-slider input[type=range] { accent-color: var(--cyan); width: 100%; }
.mc-toggles { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.mc-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text); cursor: pointer; }
.mc-toggle input { accent-color: var(--cold-blue); }
.mc-field[data-hidden], .mc-slider[data-hidden] { display: none; }

/* per-layer controls: independent color + height/size variables */
.layer-row { flex-wrap: wrap; }
.lyr-ctrls {
  flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: 5px; padding: 4px 0 2px 22px;
}
.lyr-ctrls .lyr-var {
  width: 100%; min-width: 0; background: var(--deep-surface); color: var(--muted);
  border: 1px solid var(--panel-border); border-radius: 5px;
  font-size: 9.5px; padding: 2px 3px; outline: none; cursor: pointer; font-family: var(--font-ui);
}
.lyr-ctrls .lyr-var:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.lyr-ctrls .lyr-radius { grid-column: 1 / -1; width: 100%; accent-color: var(--cyan); cursor: pointer; }
/* ---------- footer metadata bar (one-line status strip under the map) ---------- */
.uhus-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(16px, 2.4vw, 44px);
  height: 34px; min-height: 34px; padding: 0 14px; margin: 2px 2px 0;
  border-top: 1px solid var(--panel-border);
  color: var(--muted); white-space: nowrap; position: relative;
  font-size: 10.5px; cursor: pointer;
}
.uhus-footer .footer-status, .uhus-footer .footer-meta, .uhus-footer .footer-layers {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; position: relative; min-width: 0;
}
.uhus-footer .footer-status { flex: 0 0 auto; }
.uhus-footer .status-dot { width: 7px; height: 7px; border-radius: 999px; background: #75d7b1; box-shadow: 0 0 10px rgba(117,215,177,.7); flex: none; }
.uhus-footer .status-text { color: var(--text); opacity: .82; font-size: 10.5px; }
.uhus-footer .meta-label {
  color: rgba(255,255,255,.34); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  font-family: var(--font-mono); flex: none;
}
.uhus-footer .meta-value { color: rgba(255,255,255,.6); font-size: 10.4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uhus-footer .meta-value.strong { color: var(--text); }
.uhus-footer .meta-value.amber { color: var(--amber); }
.uhus-footer .footer-meta.view { flex: 0 1 230px; }
.uhus-footer .footer-meta.scope { flex: 0 1 240px; }
.uhus-footer .footer-layers { flex: 0 0 auto; }
.uhus-footer .layer-cluster { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 100%; }
.uhus-footer .layer-dots { display: inline-flex; align-items: center; gap: 7px; }
.uhus-footer .layer-dot {
  width: 9px; height: 9px; border-radius: 999px; background: var(--c);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c), transparent 50%);
  border: 1px solid rgba(255,255,255,.16); flex: none;
}
.uhus-footer .layer-more { color: rgba(255,255,255,.4); font-family: var(--font-mono); font-size: 9px; }
.uhus-footer .layer-tooltip, .uhus-footer .footer-summary {
  position: absolute; bottom: 30px; padding: 11px; opacity: 0; pointer-events: none;
  border: 1px solid var(--panel-border); border-radius: 9px;
  background: linear-gradient(180deg, rgba(20,26,38,.97), rgba(10,14,22,.97));
  box-shadow: 0 22px 52px rgba(0,0,0,.55); backdrop-filter: blur(20px);
  transform: translateY(5px); transition: opacity .16s ease, transform .16s ease; z-index: 30;
}
.uhus-footer .layer-tooltip { left: 0; width: 252px; }
.uhus-footer .layer-cluster:hover .layer-tooltip { opacity: 1; pointer-events: auto; transform: translateY(0); }
.uhus-footer .tooltip-title {
  display: flex; justify-content: space-between; margin-bottom: 8px;
  color: rgba(255,255,255,.6); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
}
.uhus-footer .tooltip-title span:last-child { color: var(--amber); }
.uhus-footer .layer-list { display: grid; gap: 6px; }
.uhus-footer .footer-layer-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.uhus-footer .layer-name { color: rgba(255,255,255,.66); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uhus-footer .layer-role { color: rgba(255,255,255,.32); font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; }
.uhus-footer .footer-summary { right: 0; width: 340px; }
.uhus-footer.open .footer-summary { opacity: 1; pointer-events: auto; transform: translateY(0); }
.uhus-footer .summary-grid { display: grid; gap: 8px; }
.uhus-footer .summary-row { display: grid; grid-template-columns: 78px 1fr; gap: 10px; align-items: baseline; }
.uhus-footer .summary-key { color: rgba(255,255,255,.35); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; }
.uhus-footer .summary-val { color: rgba(255,255,255,.7); font-size: 10.4px; line-height: 1.3; }
/* responsive: hide labels first, then lower-priority items */
@media (max-width: 1180px) { .uhus-footer .footer-meta .meta-label, .uhus-footer .footer-layers .meta-label { display: none; } }
@media (max-width: 980px)  { .uhus-footer .footer-meta.join { display: none; } }
@media (max-width: 820px)  { .uhus-footer .footer-meta.scope { display: none; } }
@media (max-width: 660px)  { .uhus-footer .footer-meta.period { display: none; } }

/* spatial box (target area + granularity), floating left of the right panel */
/* right rail: stacks the spatial box + selection dropdowns, left of the panel */
.right-rail {
  position: absolute; top: 16px; right: 16px; z-index: 6; width: 172px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100% - 32px); overflow-y: auto;
}
/* both boxes share the same card look; they flow inside the rail */
.spatial-box, .dropdown-box {
  position: static; width: 100%;
  background: linear-gradient(180deg, rgba(14,18,28,0.9), rgba(9,12,20,0.86));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 12px;
  padding: 12px; backdrop-filter: blur(24px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.spatial-box .sb-title, .dropdown-box .sb-title { font-size: 9px; font-weight: 700; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 11px; }
.spatial-box .sb-group, .dropdown-box .sb-group { margin-bottom: 11px; }
.spatial-box .sb-group:last-child, .dropdown-box .sb-group:last-child { margin-bottom: 0; }
.spatial-box .sb-group > label, .dropdown-box .sb-group > label { display: block; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
/* secondary hint clarifying each spatial control's job (camera vs draw unit) */
.sb-hint { text-transform: none; letter-spacing: 0; color: rgba(255,255,255,0.28); font-weight: 400; }
.spatial-box .seg { margin-bottom: 0; }
/* .spatial-box .sb-group > label {color: var(--toned); } */
/* dropdown selects match the mc-field select styling */
.dropdown-box select {
  width: 100%; background: var(--deep-surface); color: var(--toned);
  border: 1px solid var(--panel-border); border-radius: 7px; padding: 6px 7px;
  font-size: 11px; outline: none; font-family: var(--font-ui); cursor: pointer;
}
.dropdown-box select:hover { border-color: rgba(255,255,255,0.18); }

/* hover card: emphasise the currently-visualized variable */
.region-tooltip .rt-row.rt-active { color: var(--text); }
.region-tooltip .rt-row.rt-active b { color: var(--cyan); }

/* kepler-style discrete color legend (grouped swatches + numeric ranges) */
/* sits to the left of the right rail (spatial + select boxes), top-aligned with it */
.map-legend {
  position: absolute; top: 16px; right: 200px; z-index: 5;
  background: linear-gradient(180deg, rgba(14,18,28,0.9), rgba(9,12,20,0.86));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 10px;
  padding: 10px 12px; backdrop-filter: blur(20px);
  min-width: 200px; max-width: 240px; max-height: calc(100% - 32px); overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
/* one-line "reading the map" caption, bottom-left of the map */
.map-caption {
  position: absolute; left: 16px; bottom: 16px; z-index: 5;
  max-width: min(48%, 460px);
  background: linear-gradient(180deg, rgba(14,18,28,0.9), rgba(9,12,20,0.86));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 10px;
  padding: 8px 12px; backdrop-filter: blur(20px);
  font-size: 11px; line-height: 1.4; color: var(--muted);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.map-caption b { color: var(--text); font-weight: 600; }
.map-caption:empty { display: none; }
/* SHAP per-dong waterfall card (bottom-right; shown on dong-click under the SHAP dataset) */
.shap-waterfall {
  position: absolute; right: 16px; bottom: 16px; z-index: 6; width: 232px;
  background: linear-gradient(180deg, rgba(14,18,28,0.92), rgba(9,12,20,0.9));
  border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px 12px;
  backdrop-filter: blur(20px); box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.shap-waterfall.hidden { display: none; }
.shap-waterfall .wf-head { font-size: 10px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.04em; }
.shap-waterfall .wf-head b { color: var(--text); }
.shap-waterfall .wf-rows { display: flex; flex-direction: column; gap: 4px; }
.shap-waterfall .wf-row { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 6px; }
.shap-waterfall .wf-label { font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shap-waterfall .wf-track { position: relative; height: 9px; background: rgba(255,255,255,0.04); border-radius: 2px; }
.shap-waterfall .wf-track::before { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; border-left: 1px dashed rgba(255,255,255,0.18); }
.shap-waterfall .wf-bar { position: absolute; top: 0; height: 9px; border-radius: 2px; }
.shap-waterfall .wf-bar.pos { background: #e45c91; }
.shap-waterfall .wf-bar.neg { background: #7da7ff; }
.shap-waterfall .wf-foot { font-size: 8.5px; color: var(--muted); text-align: center; margin-top: 7px; }
/* Overview guided-tour spotlight (blur everything, highlight the focused panel) */
.tour-blur { filter: blur(6px) brightness(0.55) saturate(0.75) !important; transition: filter .6s ease, transform .6s ease !important; }
.tour-focus { position: relative; z-index: 99999; filter: none !important; transform: scale(0.97); border-radius: 10px; box-shadow: 0 0 0 1.5px rgba(234,168,85,0.85), 0 0 18px rgba(234,168,85,0.25) !important; transition: filter .6s ease, transform .6s ease, box-shadow .6s ease !important; }
/* Overview guided-tour caption (bottom-centre, video-style subtitles) */
.tour-caption {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 100001;
  width: min(64%, 740px);
  background: linear-gradient(180deg, rgba(10,14,22,0.9), rgba(8,11,18,0.94));
  border: 1px solid rgba(255,255,255,0.12); border-radius: 12px;
  padding: 14px 18px 10px; backdrop-filter: blur(20px); box-shadow: 0 24px 70px rgba(0,0,0,0.6);
}
.tour-caption.hidden { display: none; }
.tour-sub { font-size: 14px; line-height: 1.55; color: #eef2f9; }
.tour-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,0.08); }
.tour-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; color: var(--muted); font-size: 12px; padding: 4px 9px; cursor: pointer; transition: all .15s ease; }
.tour-btn:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.1); }
.tour-count { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: 4px; }
.tour-close { margin-left: auto; }
/* sector-view switcher — bottom-centre of the map (gated: hidden unless the data has sectors) */
.sector-view.hidden { display: none !important; }
.sector-view {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 3px;
  padding: 5px 7px;
  background: linear-gradient(180deg, rgba(14,18,28,0.9), rgba(9,12,20,0.86));
  border: 1px solid rgba(255,255,255,0.09); border-radius: 10px;
  backdrop-filter: blur(20px); box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.sector-view .sv-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 4px; }
.sector-view button { font-family: var(--font-ui); font-size: 10.5px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: .15s ease; }
.sector-view button:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sector-view button.active { color: var(--text); background: rgba(255,184,107,0.1); border-color: rgba(255,184,107,0.35); }
.map-legend .lg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.map-legend .lg-title { font-size: 11px; font-weight: 600; color: var(--text); }
.map-legend .lg-collapse { background: none; border: none; color: var(--muted); font-size: 11px; line-height: 1; padding: 2px; cursor: pointer; transition: transform 0.18s ease; }
.map-legend.collapsed .lg-collapse { transform: rotate(-90deg); }
.map-legend.collapsed .lg-body { display: none; }
.map-legend .lg-body { display: flex; flex-direction: column; margin-top: 8px; }
/* one block per distinct variable — hairline separated */
.map-legend .lg-block { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--panel-border); }
.map-legend .lg-block:first-child { padding-top: 2px; border-top: none; }
.map-legend .lg-var { font-size: 10.5px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.map-legend .lg-var .lg-up { color: var(--accent, #ffb86b); font-weight: 700; }
/* chips naming which layers this encoding drives */
.map-legend .lg-chips { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.map-legend .lg-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--muted); letter-spacing: 0.02em; }
.map-legend .lg-cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 5px var(--c); flex: 0 0 auto; }
/* continuous gradient + endpoint labels */
.map-legend .lg-gradient { height: 10px; border-radius: 3px; border: 1px solid rgba(255,255,255,0.14); }
.map-legend .lg-ends { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* height glyph — ascending bars */
.map-legend .lg-hglyph { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.map-legend .lg-hglyph i { flex: 1; background: linear-gradient(180deg, rgba(255,184,107,0.9), rgba(255,184,107,0.25)); border-radius: 1px; }
.map-legend .lg-hglyph i:nth-child(1) { height: 30%; } .map-legend .lg-hglyph i:nth-child(2) { height: 48%; }
.map-legend .lg-hglyph i:nth-child(3) { height: 66%; } .map-legend .lg-hglyph i:nth-child(4) { height: 84%; }
.map-legend .lg-hglyph i:nth-child(5) { height: 100%; }
/* categorical swatch list */
.map-legend .lg-groups { display: flex; flex-direction: column; gap: 4px; }
.map-legend .lg-grow { display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--muted); }
.map-legend .lg-swatch { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); flex: 0 0 auto; }
.map-legend .lg-empty { font-size: 9.5px; color: var(--muted); font-style: italic; padding: 4px 0; }

/* chart-type toggle (WHY 2D/3D/surface) */
.cell-tools { display: flex; align-items: center; gap: 8px; }
.chart-toggle { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 6px; overflow: hidden; }
.chart-toggle button {
  background: transparent; border: none; color: var(--muted);
  font-size: 10px; padding: 3px 8px; cursor: pointer; letter-spacing: 0;
}
.chart-toggle button.active { background: rgba(57,230,230,0.14); color: var(--cyan); }

/* ---------- fixed Insights column (editorial-scientific charts) ---------- */
.ins-col-sub { font-size: 10px; color: rgba(140,147,163,0.78); font-weight: 500; letter-spacing: 0.02em; }
.ins-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0; padding: 4px 16px 14px; }

/* editorial figure: kicker + title + finding sentence + chart + caption */
.ins-fig { padding: 14px 0 15px; border-bottom: 1px solid rgba(255,255,255,0.045); }
.ins-fig:last-child { border-bottom: none; }
.fig-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.fig-kicker { font-family: var(--font-mono); font-size: 7.6px; font-weight: 500; letter-spacing: 0.15em; color: rgba(140,147,163,0.74); flex: 0 0 auto; }
.fig-title { font-size: 12.4px; font-weight: 500; color: rgba(233,237,245,0.88); margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.fig-finding { font-size: 11.2px; line-height: 1.55; color: rgba(140,147,163,0.88); margin: 0 0 10px; font-weight: 400; }
.fig-finding b { color: rgba(233,237,245,0.9); font-weight: 500; }
.fig-finding .hot { color: rgba(125,167,255,0.94); font-weight: 500; }
.fig-finding .cool { color: rgba(228,92,145,0.92); font-weight: 500; }
.fig-finding .heat { color: rgba(245,164,93,0.92); font-weight: 500; }
.fig-chart { width: 100%; }
.fig-caption { font-size: 9px; line-height: 1.45; color: rgba(255,255,255,0.3); margin: 8px 0 0; font-family: var(--font-mono); font-weight: 400; }
/* region-view compact figure header reuse */
.detail-insights .ins-fig { border-bottom: none; padding-top: 4px; }

/* KPI figure at the top of the Insights column — reuses Detail panel metric-blocks */
.ins-kpi-fig { padding-top: 12px; }
.ins-kpi-grid { margin-top: 2px; }
.insights-view .metric-block { min-height: 62px; border-radius: 8px; background: rgba(255,255,255,0.024); border-color: rgba(255,255,255,0.07); }
.insights-view .metric-block.primary { border-color: rgba(57,230,230,0.12); background: linear-gradient(180deg, rgba(57,230,230,0.045), rgba(255,255,255,0.016)); }
.insights-view .metric-key { font-size: 8.8px; font-weight: 500; letter-spacing: 0.09em; color: rgba(140,147,163,0.82); }
.insights-view .metric-sub { color: rgba(140,147,163,0.62); font-size: 9.8px; }
.ins-kpi-grid .metric-value { font-family: var(--font-mono); font-size: 16px; font-weight: 500; letter-spacing: -0.025em; color: rgba(233,237,245,0.9); }
.ins-kpi-grid .metric-value.neg { color: rgba(125,167,255,0.94); }
.ins-kpi-grid .metric-value.pos { color: rgba(228,92,145,0.9); }

/* ---- RHSI dashboard widgets (shared, also used inside panel-host) ---- */
.ins-widget { display: flex; flex-direction: column; gap: 9px; }
.iw-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.iw-title { font-size: 12.5px; font-weight: 700; letter-spacing: 0.005em; color: var(--text); }
.iw-sub { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iw-cap { font-size: 9.5px; line-height: 1.4; color: var(--muted); }
.iw-cap b { color: var(--text); font-weight: 600; }
/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi { background: rgba(255,255,255,0.028); border: 1px solid var(--panel-border); border-radius: 9px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.kpi-k { font-size: 8.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); line-height: 1.25; min-height: 21px; }
.kpi-v { font-size: 20px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.kpi-badge { position: absolute; top: 9px; right: 10px; font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 5px; }
.kpi-note { font-size: 8.5px; color: rgba(255,255,255,0.4); line-height: 1.3; }
.kpi-badge.neg, .corr-val.neg, .ht-row .neg, .msi-card b.neg, .explain-line.neg b, .msi-card .neg { color: var(--cold-blue); }
.kpi-badge.pos, .corr-val.pos, .ht-row .pos, .msi-card b.pos, .explain-line.pos b, .msi-card .pos { color: var(--magenta); }
.kpi-badge.neg { background: rgba(125,167,255,0.14); }
.kpi-badge.pos { background: rgba(228,92,145,0.14); }
/* Most-sensitive industry */
.msi-head { display: flex; align-items: center; gap: 9px; }
.msi-rank { font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--success); background: rgba(63,230,165,0.12); border: 1px solid rgba(63,230,165,0.3); border-radius: 5px; padding: 2px 7px; }
.msi-name { font-size: 16px; font-weight: 700; color: var(--text); }
.msi-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.msi-card { background: rgba(255,255,255,0.028); border: 1px solid var(--panel-border); border-radius: 9px; padding: 8px 9px; text-align: center; }
.msi-card.accent { background: rgba(125,167,255,0.08); border-color: rgba(125,167,255,0.28); }
.msi-lab { font-size: 8px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.msi-card b { font-size: 15px; font-family: var(--font-mono); color: var(--text); }
.msi-card span { display: block; font-size: 9px; color: var(--muted); margin-top: 1px; }
/* Correlation / SHAP bars */
.corr-list { display: flex; flex-direction: column; gap: 6px; }
.corr-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 8px; }
.corr-name { font-size: 10px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corr-track { height: 7px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.corr-bar { display: block; height: 100%; border-radius: 4px; }
.corr-bar.pos { background: linear-gradient(90deg, rgba(228,92,145,0.5), var(--magenta)); }
.corr-bar.neg { background: linear-gradient(90deg, rgba(125,167,255,0.5), var(--cold-blue)); }
.corr-val { font-size: 10px; font-family: var(--font-mono); text-align: right; }
/* Retail-group heat response */
.rg-wrap { display: flex; align-items: center; gap: 12px; }
.rg-donut { width: 78px; height: 78px; border-radius: 50%; flex: 0 0 auto; position: relative; }
.rg-hole { position: absolute; inset: 24%; border-radius: 50%; background: var(--deep-surface); }
.heat-table { flex: 1 1 auto; min-width: 0; font-size: 10px; }
.ht-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 0.8fr 0.7fr; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ht-row.ht-head { color: var(--muted); font-size: 8px; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--panel-border); }
.ht-row span { text-align: right; font-family: var(--font-mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.ht-row .ht-name { text-align: left; font-family: var(--font-ui); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ht-row .ht-name i { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }
/* How-to-read explanation card */
.iw-explain { background: rgba(125,167,255,0.05); border: 1px solid rgba(125,167,255,0.18); border-radius: 10px; padding: 12px; gap: 7px; }
.explain-formula { font-size: 10.5px; font-family: var(--font-mono); color: var(--text); background: rgba(255,255,255,0.03); border-radius: 6px; padding: 7px 9px; line-height: 1.4; }
.explain-line { font-size: 11px; color: var(--muted); }
.explain-line b { font-weight: 700; }
.explain-note { font-size: 9.5px; line-height: 1.45; color: rgba(255,255,255,0.42); }
.insights-reopen {
  position: absolute; top: 16px; left: 300px; z-index: 7;
  background: linear-gradient(180deg, rgba(14,18,28,0.9), rgba(9,12,20,0.86));
  border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text);
  font-family: var(--font-ui); font-size: 11px; padding: 7px 12px; cursor: pointer;
  backdrop-filter: blur(24px); box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.insights-reopen:hover { border-color: rgba(255,255,255,0.22); }
/* mini bar in the hover tooltip */
.region-tooltip .rt-mini { margin-top: 8px; }
.region-tooltip .rt-mini-label { font-size: 9.5px; color: var(--muted); margin-bottom: 3px; }

.region-tooltip {
  position: absolute;
  z-index: 4; /* above the map, but BELOW the floating UI panels (5–7) so it never covers them */
  pointer-events: none; /* purely informational; never intercept the cursor */
  min-width: 190px;
  background: linear-gradient(180deg, rgba(17,22,33,0.97), rgba(11,15,24,0.96));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 12px 14px;
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0,0,0,0.7);
  transform: translate(-50%, -110%);
  transition: opacity 0.2s ease;
}
.region-tooltip .rt-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.region-tooltip .rt-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 2px 0; }
.region-tooltip .rt-row b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }
.region-tooltip .rt-link { display: block; margin-top: 8px; font-size: 11px; color: var(--cold-blue); text-decoration: none; }
.region-tooltip .rt-sep { height: 1px; margin: 7px 0; background: rgba(255,255,255,0.09); }

/* HSI summary (hero stats) */
.hsi-summary { padding: 0; }
.hsi-body { flex: 1 1 auto; min-height: 0; padding: 6px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.hsi-headline { display: flex; align-items: baseline; gap: 10px; }
.hsi-big { font-size: 30px; font-family: var(--font-mono); font-weight: 500; line-height: 1; }
.hsi-big.sensitive { color: var(--cold-blue); }
.hsi-big.resilient { color: var(--magenta); }
.hsi-caption { font-size: 11px; color: var(--muted); }
.hsi-split { display: flex; gap: 8px; }
.hsi-stat {
  flex: 1; border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px 10px;
  background: rgba(255,255,255,0.02);
}
.hsi-stat .num { font-family: var(--font-mono); font-size: 17px; }
.hsi-stat .num.mag { color: var(--magenta); }
.hsi-stat .num.blue { color: var(--cold-blue); }
.hsi-stat .lbl { font-size: 10px; color: var(--muted); margin-top: 2px; }
.hsi-charts { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.hsi-chart-block { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.hsi-hist { flex: 1 1 auto; min-height: 80px; }
.hsi-hist-label { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 2px; }

/* Ranking list rows (industry detail) */
.rank-list { flex: 1 1 auto; overflow-y: auto; font-size: 12px; }
.rank-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.rank-num { width: 14px; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; }
.rank-name { flex: 0 0 96px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar-wrap { flex: 1; height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--cold-blue); }
.rank-val { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); width: 52px; text-align: right; }

/* Detail view inside an analytical panel: chart on top, list/aux below */
.detail-split { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.detail-chart { flex: 1 1 auto; min-height: 0; }
.detail-aux { flex: 0 0 auto; max-height: 46%; overflow-y: auto; }
.detail-note { font-size: 10.5px; color: var(--muted); }

/* Exploration path */
.exploration-path {
  flex: 0 0 auto;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: rgba(11,15,23,0.85);
  border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
}
.ep-step {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid transparent;
}
.ep-step .ep-num { font-family: var(--font-mono); font-size: 9.5px; opacity: 0.7; }
.ep-step.active {
  color: var(--cyan);
  border-color: rgba(57,230,230,0.4);
  box-shadow: 0 0 16px rgba(57,230,230,0.15);
}
.ep-step.done { color: var(--text); }
.ep-arrow { color: var(--muted); font-size: 11px; }
.ep-spacer { flex: 1; }
.ep-update-btn {
  padding: 7px 16px;
  border-radius: 7px;
  background: var(--text);
  color: #0B0F17;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ UHUS RIGHT PANEL (Detail + Recommend tabs) ============ */
.panel-host { background: var(--deep-surface); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 9px; min-height: 0; min-width: 0; padding: 12px 12px 12px 9px; }
.panel-rail { display: flex; flex-direction: column; gap: 6px; }
.rail-tab { position: relative; width: 48px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--panel-border); border-radius: 8px; background: rgba(255,255,255,0.02); color: var(--muted); font-size: 8.6px; letter-spacing: 0.02em; cursor: pointer; transition: .15s ease; }
.rail-tab svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.rail-tab:hover { color: var(--text); border-color: rgba(125,167,255,0.3); }
.rail-tab.active { color: var(--text); border-color: rgba(255,184,107,0.35); background: rgba(255,184,107,0.06); }
.rail-tab.active svg { color: var(--amber); }
.uhus-tab-badge { position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid rgba(255,184,107,0.2); background: rgba(255,184,107,0.06); color: var(--amber); font-family: var(--font-mono); font-size: 7.5px; }

/* The rail tabs are independent toggles, so any combination of panels can be open and
   whichever are open share the width. Closing them all collapses the column. */
.panel-content { min-width: 0; min-height: 0; display: flex; flex-direction: row; gap: 9px; }
.panel-content > section { flex: 1 1 0; min-height: 0; min-width: 0; display: none; flex-direction: column; }
.panel-host.open-detail .panel-wrap,
.panel-host.open-insights .insights-view,
.panel-host.open-library .library-view { display: flex; }
/* fixed left-to-right order regardless of which are open: Insights · Detail · Library */
.panel-host .insights-view { order: 1; }
.panel-host .panel-wrap { order: 2; }
.panel-host .library-view { order: 3; }
/* nothing open → hide the content and leave just the rail */
.panel-host.panels-empty .panel-content { display: none; }
/* narrow screens: stack the open panels vertically instead of side by side */
@media (max-width: 1180px) {
  .panel-content { flex-direction: column; }
  .panel-content > section { flex: 1 1 auto; }
}

/* left-rail spine: collapsed stage ticks that expand into a dataset list on hover */
.rail-spine { position: relative; flex: 1 1 auto; min-height: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
/* UHUS home button — click to return to the project overview + its insights */
.spine-home { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 6px 0 9px; margin-bottom: 6px; border: 0; border-bottom: 1px solid var(--panel-border); background: transparent; color: var(--cyan); font-size: 13px; cursor: pointer; transition: color .15s ease; }
.spine-home > span { font-family: var(--font-mono); font-size: 7.4px; letter-spacing: 0.14em; color: var(--muted); }
.spine-home:hover { color: #fff; }
.spine-home:hover > span { color: var(--text); }
.spine-collapsed { display: flex; flex-direction: column; align-items: center; gap: 14px; transition: opacity .15s ease; }
.rail-spine:hover .spine-collapsed { opacity: 0.12; }
.spine-cg { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spine-cg-title { writing-mode: vertical-rl; font-family: var(--font-mono); font-size: 7.6px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.spine-cg-count { font-family: var(--font-mono); font-size: 8px; color: rgba(255,184,107,0.75); }
.spine-full { position: absolute; top: 0; right: calc(100% + 6px); width: 240px; max-height: 100%; overflow-y: auto; scrollbar-width: thin; padding: 12px 14px; background: rgba(10,16,26,0.94); border: 1px solid var(--panel-border); border-radius: 9px; box-shadow: 0 22px 60px rgba(0,0,0,0.55); backdrop-filter: blur(18px); opacity: 0; pointer-events: none; transform: translateX(6px); transition: opacity .16s ease, transform .16s ease; z-index: 40; }
.rail-spine:hover .spine-full { opacity: 1; pointer-events: auto; transform: none; }
.spine-grp { font-family: var(--font-mono);  text-align: right;  font-size: 8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.spine-grp:first-child { margin-top: 0; }
.spine-ds { display: block; width: 100%; text-align: right; padding: 5px 0; border: 0; background: transparent; color: rgba(237,242,251,0.7); font-family: var(--font-mono); font-size: 10px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spine-ds:hover { color: var(--amber); }
.spine-ds.disabled { color: rgba(237,242,251,0.32); cursor: default; }

/* Library tab: dataset tree grouped by stage */
.lib-tree { display: flex; flex-direction: column; }
.lib-group { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.lib-group:first-child { margin-top: 0; }
.lib-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; }
.lib-row:hover { background: rgba(57,230,230,0.05); }
.lib-row.disabled { cursor: default; opacity: 0.5; }
.lib-name { font-family: var(--font-mono); font-size: 10.6px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-badge { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); flex: 0 0 auto; }

.choice-note { display: flex; justify-content: space-between; padding: 8px 2px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.choice-note strong { color: var(--text); font-weight: 500; }
.panel-host .panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--panel-border); border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)); overflow: hidden; }
.insights-view { min-height: 0; }
.insights-view .ins-body { flex: 1 1 auto; min-height: 0; }
.panel-host .panel-header { height: 40px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--panel-border); background: rgba(125,167,255,0.03); }
.panel-host .panel-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.panel-host .menu { color: rgba(255,184,107,0.6); }
.panel-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }

.panel-body .divider { height: 1px; background: var(--panel-border); margin: 15px 0; }
.panel-body .section-title { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.panel-body .section-title span:last-child { color: rgba(255,184,107,0.55); letter-spacing: 0.08em; }

.title-block { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start; }
.title-block .icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; color: var(--cyan); border: 1px solid rgba(57,230,230,0.2); background: rgba(57,230,230,0.05); }
.title-block .icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.55; }
.name-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.name { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.badge { flex: none; height: 20px; padding: 0 8px; display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; color: rgba(210,241,255,0.85); background: rgba(57,230,230,0.06); border: 1px solid rgba(57,230,230,0.2); font-size: 10px; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.desc { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.back-btn { height: 27px; margin-bottom: 12px; padding: 0 10px; display: inline-flex; align-items: center; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; color: var(--muted); font-size: 10.5px; cursor: pointer; }
.back-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.lineage-box { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.015); border-radius: 8px; padding: 10px; }
.lineage-row { display: grid; grid-template-columns: 1fr 16px 1fr 16px 1fr 16px 1fr; align-items: stretch; gap: 5px; margin-bottom: 10px; }
.lineage-step { min-height: 50px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; padding: 8px 7px; text-align: left; color: var(--muted); cursor: pointer; font-family: inherit; }
.lineage-step:hover { border-color: rgba(125,167,255,0.25); color: var(--text); }
.lineage-step.active { color: #E3F7FF; border-color: rgba(57,230,230,0.3); background: rgba(57,230,230,0.06); }
.step-title { display: block; font-size: 10.5px; margin-bottom: 4px; }
.step-sub { display: block; font-size: 8.6px; color: rgba(140,147,163,0.7); line-height: 1.2; }
.lineage-step.active .step-sub { color: rgba(204,236,255,0.55); }
.arrow { display: grid; place-items: center; color: rgba(140,147,163,0.4); font-size: 11px; }
/* relationship diagram — how the datasets connect (inputs → outcome ← explanation) */
.lin-flow { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 4px 0 2px; }
.lin-tier { display: flex; gap: 8px; justify-content: center; width: 100%; }
.lin-node { flex: 1 1 0; min-width: 0; max-width: 172px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.025); border-radius: 8px; padding: 8px 10px; cursor: pointer; text-align: left; font-family: inherit; transition: .15s ease; }
.lin-node:hover { border-color: rgba(57,230,230,0.32); background: rgba(57,230,230,0.05); transform: translateY(-1px); }
.lin-node.outcome { border-color: rgba(255,184,107,0.4); background: rgba(255,184,107,0.07); }
.lin-node.outcome:hover { border-color: rgba(255,184,107,0.6); }
/* sustained selected state — the node whose card is expanded below the diagram */
.lin-node.active { border-color: rgba(57,230,230,0.7); background: rgba(57,230,230,0.11); box-shadow: 0 0 0 1px rgba(57,230,230,0.28); }
.lin-node.outcome.active { border-color: rgba(255,184,107,0.75); background: rgba(255,184,107,0.14); box-shadow: 0 0 0 1px rgba(255,184,107,0.32); }
.lin-role { font-family: var(--font-mono); font-size: 7.8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lin-node.outcome .lin-role { color: rgba(255,184,107,0.82); }
.lin-name { font-size: 11.5px; font-weight: 600; color: var(--text); margin-top: 3px; }
.lin-file { font-family: var(--font-mono); font-size: 8.4px; color: rgba(233,237,245,0.4); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lin-meta { display: flex; flex-wrap: wrap; gap: 4px 5px; align-items: center; margin-top: 7px; }
.lin-val { font-size: 9.6px; line-height: 1.42; color: var(--muted); margin-top: 6px; }
/* inline compact card that expands under the diagram when a node is selected */
.lin-detail { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--panel-border); }
.lin-detail:empty { display: none; }
.lin-detail .title-block { margin-top: 0; }
.lin-detail .lin-groups-title { margin-top: 12px; }
.lin-fulldetail {
  display: block; margin: 10px 0 0 auto; padding: 5px 12px; cursor: pointer;
  background: rgba(57,230,230,0.08); border: 1px solid rgba(57,230,230,0.32); border-radius: 7px;
  color: var(--cyan); font-family: var(--font-ui); font-size: 10.5px; transition: .15s ease;
}
.lin-fulldetail:hover { background: rgba(57,230,230,0.16); border-color: rgba(57,230,230,0.55); color: #fff; }
.lin-edge { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 5px 0; color: var(--muted); font-family: var(--font-mono); font-size: 8.2px; letter-spacing: 0.03em; }
.lin-arrow { width: 13px; height: 13px; stroke: rgba(140,147,163,0.55); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.lin-key { color: rgba(57,230,230,0.6); }
.ds-stage-tag { margin-left: auto; font-family: var(--font-mono); font-size: 7.6px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(140,147,163,0.6); border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 5px; }
/* "On the 3D map" preview inside a dataset detail */
.map-tells { font-size: 11.5px; line-height: 1.5; color: var(--text); margin: 0 0 10px; }
.map-ramp { height: 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.14); margin-bottom: 4px; }
.map-ends { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9px; color: var(--muted); margin-bottom: 10px; }
.map-enc { display: flex; flex-wrap: wrap; gap: 6px; }
.map-enc span { font-family: var(--font-mono); font-size: 9px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); color: var(--muted); }
.stage-detail { border-top: 1px solid var(--panel-border); padding-top: 10px; }
.stage-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stage-name { color: var(--text); font-size: 12px; }
.stage-note { color: var(--muted); font-size: 10.2px; line-height: 1.35; margin-top: 3px; }
.stage-count { color: rgba(255,184,107,0.7); font-size: 9px; font-family: var(--font-mono); text-transform: uppercase; white-space: nowrap; }

.dataset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.dataset-mini { min-height: 78px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; padding: 8px; cursor: pointer; transition: .15s ease; }
.dataset-mini:hover { border-color: rgba(57,230,230,0.25); background: rgba(57,230,230,0.03); transform: translateY(-1px); }
.dataset-mini-top { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; margin-bottom: 4px; }
.dataset-mini-icon { width: 22px; height: 22px; display: grid; place-items: center; color: rgba(233,237,245,0.85); }
.dataset-mini-icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.dataset-mini strong { display: block; color: var(--text); font-size: 10.6px; line-height: 1.18; margin-bottom: 4px; }
.dataset-mini span { display: block; color: var(--muted); font-size: 9.2px; line-height: 1.3; }
.dataset-mini .tag { margin-top: 6px; height: 17px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: 3px; border: 1px solid rgba(255,184,107,0.16); background: rgba(255,184,107,0.04); color: rgba(255,184,107,0.7); font-size: 8.2px; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-mono); }

.variable-focus { display: grid; gap: 6px; margin-bottom: 9px; }
.var-row { min-height: 35px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid var(--panel-border); background: linear-gradient(90deg, rgba(57,230,230,0.05), rgba(255,255,255,0.015)); border-radius: 6px; }
.var-row.clickable { cursor: pointer; transition: .15s ease; }
.var-row.clickable:hover { border-color: rgba(57,230,230,0.25); transform: translateY(-1px); }
.var-name { font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.var-role { height: 18px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: 3px; color: rgba(206,240,255,0.82); background: rgba(57,230,230,0.07); border: 1px solid rgba(57,230,230,0.18); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 24px; padding: 0 8px; display: inline-flex; align-items: center; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 5px; color: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { border-color: rgba(57,230,230,0.25); color: var(--text); }
.chip.more { color: rgba(255,184,107,0.7); border-color: rgba(255,184,107,0.16); background: rgba(255,184,107,0.04); }

.topic-list { display: grid; gap: 8px; }
.topic { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; overflow: hidden; }
.topic.clickable { cursor: pointer; }
.topic.clickable:hover { border-color: rgba(57,230,230,0.22); }
.topic-head { min-height: 34px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 0 10px; }
.topic-name { color: var(--text); font-size: 11.5px; }
.topic-count { color: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.topic-body { padding: 0 10px 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.key-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.metric-block { min-height: 64px; padding: 10px; border-radius: 6px; border: 1px solid var(--panel-border); background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)); }
.metric-block.primary { border-color: rgba(57,230,230,0.14); background: radial-gradient(circle at 88% 12%, rgba(57,230,230,0.08), transparent 42%), linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.018)); }
.metric-key { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-value { color: var(--text); font-size: 12.5px; line-height: 1.25; }
.metric-sub { display: block; margin-top: 5px; color: rgba(140,147,163,0.7); font-size: 10.2px; }

.technical-rows { border-top: 1px solid var(--panel-border); }
.tech-row { min-height: 30px; display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: center; border-bottom: 1px solid var(--panel-border); font-size: 11.5px; }
.tech-key { color: var(--muted); font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }
.tech-value { color: var(--text); text-align: right; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.category-card { min-height: 66px; padding: 8px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; cursor: pointer; transition: .15s ease; }
.category-card:hover { border-color: rgba(57,230,230,0.22); transform: translateY(-1px); }
.category-card strong { display: block; color: var(--text); font-size: 10.6px; line-height: 1.18; margin-bottom: 5px; }
.category-card span { display: block; color: var(--muted); font-size: 9.2px; line-height: 1.3; }
.category-card .tag { margin-top: 6px; height: 17px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: 3px; border: 1px solid rgba(255,184,107,0.16); background: rgba(255,184,107,0.04); color: rgba(255,184,107,0.7); font-size: 8.2px; text-transform: uppercase; font-family: var(--font-mono); }

.views { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.view { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; color: var(--muted); font-size: 11px; }
.view svg { width: 14px; height: 14px; color: rgba(140,147,163,0.5); stroke: currentColor; fill: none; stroke-width: 1.6; flex: none; }
.view.active { color: #DFF5FF; border-color: rgba(57,230,230,0.24); background: rgba(57,230,230,0.06); }
.view.active svg { color: var(--cyan); }

.tag-form { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; overflow: hidden; }
.tag-form-row { min-height: 32px; display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--panel-border); font-size: 10.7px; }
.tag-form-row:last-child { border-bottom: 0; }
.tag-form-key { color: var(--muted); font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; }
.tag-form-value { color: var(--text); text-align: right; line-height: 1.3; }
.tag-form-value.mono { font-family: var(--font-mono); font-size: 10px; }
.columns-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.column-pill { min-height: 28px; display: flex; align-items: center; padding: 0 8px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 5px; color: var(--muted); font-size: 9.6px; font-family: var(--font-mono); }
.relation-card { border: 1px solid var(--panel-border); background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.012)); border-radius: 6px; padding: 12px; }
.relation-flow { display: grid; grid-template-columns: 1fr 20px 1fr 20px 1fr; gap: 6px; align-items: center; }
.relation-node { min-height: 40px; display: grid; place-items: center; text-align: center; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; color: var(--muted); font-size: 10.4px; line-height: 1.2; padding: 0 4px; }
.relation-node.active { color: #E3F7FF; border-color: rgba(57,230,230,0.22); background: rgba(57,230,230,0.05); }
.relation-arrow { color: rgba(140,147,163,0.4); text-align: center; font-size: 12px; }

.cta { margin-top: 16px; width: 100%; height: 40px; border-radius: 8px; border: 1px solid rgba(57,230,230,0.26); color: rgba(210,241,255,0.86); background: rgba(57,230,230,0.06); font-size: 12px; font-weight: 500; cursor: pointer; }
.cta:hover { background: rgba(57,230,230,0.1); }
/* ---- Project Detail: source-dataset catalog (borderless, grouped by stage) ---- */
.ds-note { display: flex; align-items: center; gap: 6px; font-size: 9.6px; color: var(--muted); letter-spacing: 0.02em; margin: 0 0 12px; }
.ds-note svg { width: 12px; height: 12px; stroke: #8f9bb3; fill: none; stroke-width: 1.7; flex: 0 0 auto; }
.ds-legend { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 12px; font-size: 8.4px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.ds-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ds-sq { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.ds-catalog { display: flex; flex-direction: column; }
.ds-stage { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 4px; }
.ds-stage:first-child { margin-top: 0; }
.ds-stage-name { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); }
.ds-stage-sub { font-size: 8.4px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.ds-item { padding: 9px 8px; border-radius: 6px; }              /* no gridlines — spacing separates rows */
.ds-item.clickable { cursor: pointer; transition: background .15s ease; }
.ds-item.clickable:hover { background: rgba(57,230,230,0.045); }
.ds-meta { display: inline-flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.ds-unit { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.ds-unit svg { width: 12px; height: 12px; fill: none; stroke-width: 1.8; flex: 0 0 auto; }
.ds-unit.sp { color: #A9B4C6; } .ds-unit.sp svg { stroke: #A9B4C6; }
.ds-unit.tm { color: var(--amber); } .ds-unit.tm svg { stroke: var(--amber); }
.ds-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; }
.ds-name { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 10.6px; color: var(--text); word-break: break-all; line-height: 1.3; }
.ds-tags { display: flex; flex-wrap: wrap; gap: 5px; flex: 0 0 auto; }
.ds-tag { font-family: var(--font-mono); font-size: 8.4px; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 20px; }
.ds-val { margin-top: 7px; font-size: 9.6px; line-height: 1.45; color: var(--muted); }
.ds-val b { color: var(--text); font-weight: 600; }
.ds-val i { color: rgba(233,237,245,0.8); font-style: italic; }
.ds-src { display: inline-block; margin-top: 3px; font-family: var(--font-mono); font-size: 8px; color: rgba(233,237,245,0.32); letter-spacing: 0.03em; }
/* variable-group colours — same kind shares a colour */
.ds-tag.t-wx { color: var(--cold-blue); background: rgba(125,167,255,0.12); }
.ds-tag.t-sl { color: var(--success); background: rgba(63,230,165,0.12); }
.ds-tag.t-rt { color: var(--cyan); background: rgba(57,230,230,0.12); }
.ds-tag.t-ft { color: #b49bff; background: rgba(167,139,250,0.14); }
.ds-tag.t-ix { color: var(--amber); background: rgba(255,184,107,0.12); }
.ds-tag.t-geo { color: #9aa6bd; background: rgba(143,155,179,0.12); }
.ds-sq.t-wx { background: var(--cold-blue); } .ds-sq.t-sl { background: var(--success); }
.ds-sq.t-ft { background: #b49bff; } .ds-sq.t-ix { background: var(--amber); }

.click-hint { margin-top: 8px; color: rgba(255,184,107,0.6); font-size: 9.5px; text-align: center; }
.small-note { margin-top: 10px; color: rgba(140,147,163,0.55); font-size: 10px; text-align: center; line-height: 1.4; }
.tag-section-note { color: rgba(255,184,107,0.6); font-size: 9.8px; line-height: 1.4; margin-top: 8px; }

/* Recommend Set view */
.uhus-recommend-view { border: 1px solid var(--panel-border); border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)); overflow: hidden; }
.uhus-recommend-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px; }
.uhus-r-title { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.uhus-r-title span:last-child { color: rgba(255,184,107,0.55); }
.uhus-r-grid { display: grid; gap: 8px; }
.uhus-r-card { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 8px; padding: 11px; cursor: pointer; transition: .15s ease; }
.uhus-r-card:hover { border-color: rgba(57,230,230,0.22); }
.uhus-r-card.active { border-color: rgba(255,184,107,0.3); background: rgba(255,184,107,0.05); }
.uhus-r-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: start; margin-bottom: 9px; }
.uhus-r-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--cyan); border: 1px solid rgba(57,230,230,0.18); background: rgba(57,230,230,0.05); }
.uhus-r-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.uhus-r-name { color: var(--text); font-size: 12px; margin-bottom: 3px; }
.uhus-r-desc { color: var(--muted); font-size: 9.6px; line-height: 1.35; }
.uhus-r-type { color: rgba(255,184,107,0.7); font-size: 8.4px; text-transform: uppercase; font-family: var(--font-mono); white-space: nowrap; }
.uhus-r-pair { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.uhus-r-pill { padding: 3px 8px; border-radius: 4px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); color: var(--text); font-size: 9.4px; font-family: var(--font-mono); }
.uhus-r-arrow { color: var(--muted); }
.uhus-r-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.uhus-r-chip { padding: 3px 7px; border-radius: 4px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); color: var(--muted); font-size: 9px; }
.uhus-r-chip.primary { color: #DFF5FF; border-color: rgba(57,230,230,0.24); background: rgba(57,230,230,0.06); }
.uhus-r-divider { height: 1px; background: var(--panel-border); margin: 14px 0; }
.uhus-r-compare { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.015); border-radius: 8px; padding: 11px; }
.uhus-r-flow { display: grid; grid-template-columns: 1fr 20px 1fr; gap: 6px; align-items: center; margin-bottom: 10px; }
.uhus-r-node { min-height: 42px; display: grid; place-items: center; text-align: center; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; }
.uhus-r-node-label { color: var(--muted); font-size: 8.6px; text-transform: uppercase; letter-spacing: 0.08em; }
.uhus-r-node-value { color: var(--text); font-size: 10px; font-family: var(--font-mono); margin-top: 3px; }
.uhus-r-x { text-align: center; color: var(--muted); }
.uhus-r-keyrow { display: grid; grid-template-columns: 108px 1fr; gap: 10px; min-height: 28px; align-items: center; border-top: 1px solid var(--panel-border); font-size: 10.5px; }
.uhus-r-key { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: 0.07em; }
.uhus-r-value { color: var(--text); text-align: right; }
.uhus-r-output-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uhus-r-output { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02); border-radius: 6px; padding: 9px; }
.uhus-r-output strong { display: block; color: var(--text); font-size: 11px; margin-bottom: 4px; }
.uhus-r-output span { display: block; color: var(--muted); font-size: 9.2px; line-height: 1.35; }
.uhus-r-output .tag { margin-top: 7px; height: 16px; display: inline-flex; align-items: center; padding: 0 6px; border-radius: 3px; border: 1px solid rgba(255,184,107,0.16); background: rgba(255,184,107,0.04); color: rgba(255,184,107,0.7); font-size: 8px; text-transform: uppercase; font-family: var(--font-mono); }

/* ── Layer-Set panel (right rail; Sales + RHSI) ─────────────────────────────
   Semantic Structure → Representation → Variable control that replaces the
   color/height dropdowns for datasets whose engine can express the taxonomy. */
#layerset-panel[hidden] { display: none; }
.ls-inner { display: flex; flex-direction: column; gap: 7px; }
.ls-row-l { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.ls-fam { display: flex; flex-direction: column; gap: 3px; }
.ls-fam-l { font-size: 8px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); opacity: 0.8; }
.ls-seg { display: flex; gap: 4px; }
.ls-seg-wrap { flex-wrap: wrap; }
.ls-b { flex: 1; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 7px;
  color: var(--muted); padding: 6px 3px 5px; cursor: pointer; transition: all .15s ease; font-family: var(--font-ui); }
.ls-b i { font-style: normal; font-size: 13px; line-height: 1; }
.ls-b span { font-size: 8.5px; letter-spacing: 0.02em; }
.ls-b:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.ls-b.on { color: #fff; border-color: rgba(125,167,255,0.6); background: rgba(125,167,255,0.16); box-shadow: 0 0 14px rgba(125,167,255,0.22); }
.ls-b.ls-dis { opacity: 0.4; cursor: not-allowed; }
.ls-b.ls-dis:hover { color: var(--muted); border-color: var(--panel-border); }
.ls-select { width: 100%; background: rgba(255,255,255,0.03); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 6px 7px; font-size: 12px; font-family: var(--font-ui); }
.ls-select:hover { border-color: rgba(255,255,255,0.2); }
.ls-hint { font-size: 10px; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.ls-hint-warn { color: rgba(255,184,107,0.75); }

/* (panel width is constant — see .map-control above; no per-dataset resizing) */

/* paged full editor (map panel): preset pager + page card (prototype3 kepler-toned look) */
.ls-pager { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.ls-tab { position: relative; font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 7px; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03); color: var(--muted); cursor: pointer; font-family: var(--font-ui); transition: all .15s ease; }
.ls-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.18); }
.ls-tab.on { color: #fff; border-color: rgba(125,167,255,0.6); background: rgba(125,167,255,0.16); box-shadow: 0 0 14px rgba(125,167,255,0.22); }
.ls-tab.ls-dis { opacity: 0.4; cursor: not-allowed; }
.ls-tab-saved { padding-right: 20px; }
.ls-tabx { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: 0.6; padding: 0 2px; }
.ls-tabx:hover { opacity: 1; color: var(--magenta, #E45C91); }
/* page card */
.ls-card { border: 1px solid rgba(125,167,255,0.28); background: rgba(125,167,255,0.05); border-radius: 10px; overflow: hidden; }
.ls-card-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--panel-border); }
.ls-card-body { display: flex; flex-direction: column; gap: 8px; padding: 9px 10px 11px; }
.ls-headsp { flex: 1; }
/* #1 structure badge + preset/custom tag + group note */
.ls-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 8.5px; font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 8px; border-radius: 5px; }
.ls-badge i { font-style: normal; font-size: 10px; }
.ls-badge.s-single { background: rgba(125,167,255,0.14); color: #9fb0cf; }
.ls-badge.s-total { background: rgba(120,200,160,0.12); color: #9dbbad; }
.ls-badge.s-across { background: rgba(255,184,107,0.13); color: #c6ac8c; }
.ls-badge.s-within { background: rgba(168,130,220,0.14); color: #b7a7d0; }
.ls-badge.s-comparison { background: rgba(200,140,165,0.14); color: #b79aa7; }
.ls-gnote { font-size: 10px; color: var(--muted); }
.ls-tag { font-size: 8px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em;
  border: 1px solid var(--panel-border); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
/* #1 read-as label */
.ls-readas { font-size: 11px; color: var(--muted); border-top: 1px dashed var(--panel-border); padding-top: 6px; }
.ls-readas b { color: var(--cold-blue); text-transform: capitalize; }
.ls-i { margin-left: 3px; cursor: help; opacity: 0.65; }
/* #3 appearance section */
.ls-app { display: flex; flex-direction: column; gap: 7px; }
.ls-arow { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text); }
.ls-arow > span:first-child { min-width: 62px; color: var(--muted); }
.ls-mini { flex: 1; height: 16px; accent-color: var(--cold-blue); cursor: pointer; }
.ls-arow input[type=checkbox] { accent-color: var(--cold-blue); }
.ls-apsp { flex: 1; }
.ls-swrow { display: flex; gap: 5px; flex: 1; }
.ls-swrow .ls-sw { flex: 1; min-width: 0; }
.ls-scaleseg { flex: 1; }
.ls-b3 { flex: 1; font-size: 9.5px; padding: 4px 3px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03); color: var(--muted); cursor: pointer; font-family: var(--font-ui); }
.ls-b3.on { color: #fff; border-color: rgba(125,167,255,0.55); background: rgba(125,167,255,0.14); }
.ls-dim { opacity: 0.5; }
.ls-coming { font-size: 8px; font-family: var(--font-mono); color: #c6ac8c; border: 1px solid rgba(198,172,140,0.3); border-radius: 4px; padding: 0 4px; flex: none; }

/* Single = group of variable-layers (composite) */
.ls-layers { display: flex; flex-direction: column; gap: 6px; }
.ls-layer { display: flex; align-items: center; gap: 6px; }
/* each layer row: representation (design) + variable + remove */
.ls-lchan { flex: 0 0 104px; min-width: 0; }
.ls-lvar { flex: 1; min-width: 0; }
/* right-rail compact variable rows: the layer's design icon + its variable */
.ls-cicon { flex: none; width: 16px; text-align: center; font-size: 12px; color: var(--muted); }
.ls-lx { flex: none; width: 24px; height: 28px; border-radius: 6px; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03); color: var(--muted); cursor: pointer; font-size: 14px; }
.ls-lx:hover:not(:disabled) { color: var(--magenta, #E45C91); border-color: rgba(228,92,145,0.5); }
.ls-lx:disabled { opacity: 0.3; cursor: default; }
.ls-addlayer { align-self: flex-start; background: none; border: 1px dashed var(--panel-border); color: var(--muted);
  font-size: 11px; padding: 5px 10px; border-radius: 7px; cursor: pointer; margin-top: 2px; }
.ls-addlayer:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }
.ls-sw { flex: 1; min-width: 34px; height: 20px; border-radius: 6px; border: 1px solid var(--panel-border); cursor: pointer; padding: 0; }
.ls-sw:hover { border-color: rgba(255,255,255,0.35); }
.ls-sw.on { border-color: var(--cold-blue); box-shadow: 0 0 0 1px var(--cold-blue); }
.ls-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.ls-act { flex: 1; font-size: 11px; padding: 7px; border-radius: 7px; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.04); color: var(--text); cursor: pointer; font-family: var(--font-ui); }
.ls-act:hover { border-color: var(--cold-blue); color: #fff; }

/* Save-as modal + toast (shared look with the map-control) */
.ls-modal-ov { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(6,9,14,0.6); backdrop-filter: blur(4px); }
.ls-modal { width: 300px; max-width: 86vw; background: linear-gradient(180deg, rgba(18,23,34,0.98), rgba(11,15,24,0.98));
  border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px; }
.ls-modal-t { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 11px; }
.ls-modal-in { width: 100%; background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--panel-border);
  border-radius: 7px; padding: 9px 10px; font-size: 13px; font-family: var(--font-ui); }
.ls-modal-in:focus { outline: none; border-color: var(--cold-blue); }
.ls-modal-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.ls-modal-btns button { border-radius: 7px; padding: 7px 14px; font-size: 12px; cursor: pointer; border: 1px solid var(--panel-border); }
.ls-modal-cancel { background: rgba(255,255,255,0.04); color: var(--muted); }
.ls-modal-ok { background: rgba(125,167,255,0.18); color: #fff; border-color: rgba(125,167,255,0.5); }
.ls-toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 12px); z-index: 210;
  background: rgba(125,167,255,0.16); border: 1px solid rgba(125,167,255,0.5); color: #eaf0ff;
  font-size: 12px; padding: 9px 16px; border-radius: 9px; opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.ls-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── download notice: large lazy layers (3D buildings) ─────────────────────── */
.download-notice {
  position: absolute; left: 50%; bottom: 26px; transform: translate(-50%, 10px); z-index: 30;
  min-width: 250px; padding: 11px 14px; border-radius: 11px; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(16,21,32,0.96), rgba(10,14,22,0.97));
  border: 1px solid rgba(125,167,255,0.35); box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  transition: opacity .2s ease, transform .2s ease;
}
.download-notice.show { opacity: 1; transform: translate(-50%, 0); }
.download-notice.dn-error { border-color: rgba(255,184,107,0.45); }
.dn-row { display: flex; align-items: center; gap: 10px; }
.dn-text { display: flex; flex-direction: column; gap: 2px; }
.dn-title { font-size: 12px; font-weight: 600; color: var(--text); }
.dn-sub { font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); }
.dn-spin { width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid rgba(125,167,255,0.25); border-top-color: var(--cold-blue);
  animation: dn-rot .8s linear infinite; }
.dn-error .dn-spin { animation: none; border-color: rgba(255,184,107,0.5); border-top-color: var(--amber); }
@keyframes dn-rot { to { transform: rotate(360deg); } }
.dn-bar { margin-top: 9px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dn-bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--cold-blue); transition: width .2s ease; }
/* unknown total (gzipped stream) → sweep instead of a real percentage */
.dn-bar.dn-indet i { width: 40% !important; animation: dn-sweep 1.1s ease-in-out infinite; }
@keyframes dn-sweep { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
/* toolbar button while its layer is downloading */
.map-toolbar button.tb-loading { color: var(--cold-blue); border-color: rgba(125,167,255,0.45); opacity: 0.75; }

/* numeric read-out beside each Appearance slider (curved sliders need a visible value) */
.ls-aval { flex: none; min-width: 30px; text-align: right; font-family: var(--font-mono);
  font-size: 9.5px; color: var(--muted); }

/* ============ CREDITS OVERLAY ============ */
/* Full-screen about/credits page opened from the side-nav (senseable.mit.edu style). */
.credits-overlay {
  position: fixed; inset: 0; z-index: 100002;
  display: flex; align-items: stretch; justify-content: center;
  animation: creditsFade .3s ease-out;
}
.credits-overlay.hidden { display: none !important; }
@keyframes creditsFade { from { opacity: 0; } to { opacity: 1; } }

.credits-scrim {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(11,18,32,0.6), rgba(3,5,10,0.86) 70%), rgba(3,5,10,0.9);
  backdrop-filter: blur(14px);
}
.credits-close {
  position: fixed; top: 22px; right: 26px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border);
  color: var(--muted); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(20px); transition: all .18s ease;
}
.credits-close:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.1); transform: rotate(90deg); }

.credits-scroll { position: relative; z-index: 1; width: 100%; overflow-y: auto; }
.credits-inner {
  max-width: 940px; margin: 0 auto;
  padding: clamp(64px, 12vh, 140px) 32px 80px;
  opacity: 0; transform: translateY(14px);
  animation: creditsRise .7s cubic-bezier(.2,.7,.2,1) .08s forwards;
}
@keyframes creditsRise { to { opacity: 1; transform: translateY(0); } }

.credits-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cold-blue); margin-bottom: 18px;
}
.credits-title {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(46px, 7vw, 86px); letter-spacing: 0.02em;
  color: #F4F1EA; margin: 0 0 22px; line-height: 1.02;
}
.credits-lede {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(19px, 2.3vw, 26px); line-height: 1.55;
  color: var(--toned); max-width: 720px; margin: 0 0 clamp(46px, 7vh, 76px);
}

/* shared small-caps section heading (Team / Data Sources / Built With) */
.credits-h {
  font-family: var(--font-ui); font-weight: 600; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 16px;
}

/* Team — role → name rows */
.credits-people {
  padding-top: 40px; border-top: 1px solid var(--panel-border);
  margin-bottom: 44px;
}
.credits-roles { margin: 0; }
.cr-row {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px;
  align-items: baseline; padding: 11px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.cr-row:first-child { border-top: none; }
.cr-row dt {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
}
.cr-row dd { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--text); }
.cr-fill { color: var(--amber); font-style: italic; opacity: 0.85; }

.credits-cols {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 40px;
}
.credits-block h2 {
  font-family: var(--font-ui); font-weight: 600; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 16px;
}
.credits-block ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.credits-block li { display: flex; flex-direction: column; gap: 2px; }
.cr-role {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.34);
}
.cr-name { font-size: 14.5px; line-height: 1.45; color: var(--text); }

.credits-foot {
  margin-top: clamp(48px, 8vh, 80px); padding-top: 28px;
  border-top: 1px solid var(--panel-border);
}
.credits-foot p { font-size: 13px; line-height: 1.7; color: var(--muted); max-width: 720px; margin: 0 0 14px; }
.credits-copy { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: rgba(255,255,255,0.3); }

@media (max-width: 720px) {
  .credits-cols { grid-template-columns: 1fr; gap: 30px; }
  .cr-row { grid-template-columns: 1fr; gap: 3px; }
}
