* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: system-ui, sans-serif; font-size: 14px; }
#app { display: flex; height: 100%; }

/* ---- Left panel ---- */
#panel {
  width: 380px; min-width: 380px;
  background: #f7f7f7;
  border-right: 1px solid #ddd;
  display: flex; flex-direction: column;
  overflow-y: auto;
}

/* ---- Panel title ---- */
#panel-title {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
#panel-title h2 { font-size: 14px; font-weight: 700; color: #222; }
#panel-title .subtitle { font-size: 11px; color: #777; margin-top: 2px; }
#panel-title .copyright { font-size: 10px; color: #aaa; margin-top: 1px; }

/* ---- Collapsible sidebar sections ---- */
.sidebar-section { border-bottom: 1px solid #ddd; }
.section-header {
  display: flex; flex-direction: column;
  padding: 7px 12px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #555;
  user-select: none; background: #f0f0f0;
}
.section-header:hover { background: #e8e8e8; }
.sec-label {
  padding: 7px 12px;
  font-size: 12px; font-weight: 600; color: #555;
  background: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  display: flex; justify-content: space-between; align-items: center;
}
.sec-header-top {
  display: flex; justify-content: space-between; align-items: center;
}
.sec-arrow { font-size: 10px; color: #999; transition: transform 0.15s; }
.sidebar-section.expanded .sec-arrow { transform: rotate(90deg); }
.section-body { display: none; padding: 8px 10px; }
.sidebar-section.expanded .section-body { display: block; }
.sec-summary { font-size: 12px; color: #333; font-weight: 500; margin-top: 3px; white-space: normal; line-height: 1.3; }
.sidebar-section.expanded .sec-summary { display: none; }

/* ---- Dropdowns ---- */
.ctrl-group { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.ctrl-group:last-child { margin-bottom: 0; }
.ctrl-group label { font-size: 11px; font-weight: 600; color: #666; }
.ctrl-group select {
  width: 100%; padding: 4px 6px; border: 1px solid #ccc;
  border-radius: 4px; background: white; font-size: 12px; cursor: pointer;
}
.ctrl-group select:focus { outline: 2px solid #4a90d9; }
.ctrl-group select:disabled { background: #f0f0f0; color: #aaa; cursor: not-allowed; }

/* ---- Tooltip-indicator icon ----
   Disabled <select>s and tightly-packed grid cells consume hover area and
   suppress the native title-attr tooltip from showing on their parents.
   `.tip` is a small `(?)` glyph placed next to a label that carries the
   title= itself: always discoverable, always hoverable, regardless of
   neighboring disabled controls. */
.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px; height: 13px;
  margin-left: 3px;
  border-radius: 50%;
  background: #c2c9d2;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  line-height: 1;
  user-select: none;
}
.tip:hover { background: #4a90d9; }

/* ---- Traveler profile (always-visible compact section) ---- */
#traveler-section {
  border-bottom: 1px solid #ddd;
  padding: 7px 10px 8px;
  background: #f0f0f0;
}
.traveler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.traveler-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #777;
}
.uc-toggle-strip {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}
.uc-toggle-btn {
  padding: 3px 10px;
  border: none;
  background: white;
  font-size: 11px;
  cursor: pointer;
  color: #555;
  line-height: 1.4;
}
.uc-toggle-btn:hover { background: #f0f4ff; }
.uc-toggle-btn.active { background: #4a90d9; color: white; font-weight: 600; }
.traveler-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
}
.traveler-grid .ctrl-group { min-width: 0; }
.traveler-extras {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.traveler-extras:empty,
.traveler-extras:not(:has(> *:not([style*="display:none"]))) {
  margin-top: 0;
}
#uc-specific-controls { display: none; }
#uc-specific-controls.visible { display: block; }

/* ---- Indicator accordion ---- */
.ind-group { margin-bottom: 4px; border-radius: 4px; overflow: hidden; border: 1px solid #ddd; }
.ind-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #444;
  background: #e8e8e8; user-select: none;
}
.ind-group-header:hover { background: #ddd; }
.ind-group.active > .ind-group-header { background: #d4e8ff; color: #1a4a8a; }
.grp-arrow { font-size: 10px; color: #999; transition: transform 0.15s; }
.ind-group.open > .ind-group-header > .grp-arrow { transform: rotate(90deg); }
.ind-group-body { display: none; padding: 4px 6px 6px; background: #fafafa; }
.ind-group.open > .ind-group-body { display: block; }
.ind-subctrl { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 2px; }
.ind-subctrl label { font-size: 11px; font-weight: 600; color: #666; }
.ind-subctrl select { width: 100%; padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; background: white; font-size: 12px; cursor: pointer; }

.ind-btn {
  display: block; width: 100%; text-align: left;
  padding: 4px 7px; margin-bottom: 2px;
  border: 1px solid #ddd; border-radius: 3px;
  background: white; cursor: pointer; font-size: 11px; color: #444;
}
.ind-btn:last-child { margin-bottom: 0; }
.ind-btn:hover { background: #f0f4ff; }
.ind-btn.active {
  background: #4a90d9; color: white; border-color: #3a7bc8; font-weight: 600;
}

/* ---- Per-group normalization toggle (per km² vs total) ---- */
/* Right-aligned, compact pill pair. width:fit-content + margin-left:auto
   keeps it small without needing a float (and without disturbing the
   block flow of the indicator buttons that follow). */
.norm-toggle {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 0 3px auto;
  width: fit-content;
}
.norm-btn {
  padding: 0 8px;
  border: none;
  background: white;
  font-size: 10px;
  color: #666;
  cursor: pointer;
  line-height: 1.6;
}
.norm-btn + .norm-btn { border-left: 1px solid #ddd; }
.norm-btn:hover { background: #f0f4ff; }
.norm-btn.active { background: #4a90d9; color: white; font-weight: 600; }

/* ---- Origin / destination info (inside the ZTZ-family groups) ---- */
#origin-info, #dest-info {
  font-size: 11px; color: #555;
  padding: 5px 7px; background: #eef3fb; border-radius: 4px;
  border: 1px solid #c0d4f0; margin-top: 6px;
}

/* ---- Zone-to-zone 2D indicator grid ---- */
.ztz-grid {
  display: grid;
  grid-template-columns: 100px repeat(6, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.ztz-hdr {
  text-align: center; font-size: 9px; font-weight: 600;
  color: #888; padding: 1px 2px; line-height: 1.2;
}
.ztz-hdr:first-child { text-align: left; }
.ztz-row-label {
  font-size: 10px; color: #555; padding: 2px 3px 2px 0;
  display: flex; align-items: center; line-height: 1.2;
}
.ztz-btn {
  display: block; width: 100%; text-align: center;
  padding: 3px 1px; border: 1px solid #ddd; border-radius: 3px;
  background: white; cursor: pointer; font-size: 11px; color: #aaa;
  transition: background 0.1s;
}
.ztz-btn:hover:not(:disabled) { background: #f0f4ff; color: #444; }
.ztz-btn.active { background: #4a90d9; color: white; border-color: #3a7bc8; }
.ztz-btn:disabled { background: #f4f4f4; color: #ccc; cursor: not-allowed; border-color: #eee; }

/* ---- Layer toggles ---- */
.layer-toggle-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; cursor: pointer; padding: 2px 0;
}
.layer-toggle-row input[type="checkbox"] { cursor: pointer; flex-shrink: 0; }
.layer-swatch {
  display: inline-block; width: 20px; height: 4px;
  border-radius: 2px; flex-shrink: 0;
}
.transit-freq-legend {
  margin: 2px 0 2px 22px; display: flex; flex-direction: column; gap: 2px;
}
.transit-freq-row {
  display: flex; align-items: center; gap: 5px; font-size: 10px; color: #777;
}
.transit-freq-swatch {
  display: inline-block; width: 14px; height: 3px; border-radius: 1px; flex-shrink: 0;
}

/* ---- Map area ---- */
#map-area { flex: 1; display: flex; flex-direction: column; }
#map { flex: 1; }

/* ---- Info panel (bottom-left) ---- */
#info-panel {
  position: absolute; bottom: 28px; left: 390px;
  background: rgba(255,255,255,0.96); border: 1px solid #ccc;
  border-radius: 6px; padding: 8px 10px; min-width: 230px; max-width: 340px;
  font-size: 12px; z-index: 900; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: none;
}
#info-panel .pn-name { font-weight: 700; margin-bottom: 5px; color: #222; font-size: 13px; }
.pn-row { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.pn-label { color: #666; }
.pn-val { font-weight: 600; color: #222; }
#info-panel .pn-row { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
#info-panel .pn-label { color: #666; }
#info-panel .pn-val { font-weight: 600; color: #222; }
#info-panel .pn-section { margin-top: 5px; padding-top: 4px; border-top: 1px solid #eee; }
#info-panel .pn-mode-table { width: 100%; border-collapse: collapse; }
#info-panel .pn-mode-table th {
  text-align: right; color: #666; font-weight: 500; padding: 1px 4px 3px 4px;
  font-size: 10px; border-bottom: 1px solid #ddd;
}
#info-panel .pn-mode-table th:first-child { text-align: left; }
#info-panel .pn-mode-table td { text-align: right; padding: 2px 4px; color: #444; font-size: 11px; }
#info-panel .pn-mode-table td:first-child { text-align: left; color: #555; }
#info-panel .pn-mode-table tr.pn-optimal td { font-weight: 700; color: #111; }
#info-panel .pn-optimal-badge {
  display: inline-block; font-size: 9px; font-weight: 600;
  color: #fff; background: #4a90d9; border-radius: 3px;
  padding: 0 3px; margin-left: 3px; vertical-align: middle;
}
#info-panel.info-panel--wide { max-width: 500px; }
/* Profile breakdown table */
#info-panel .pn-uc-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
#info-panel .pn-uc-table th {
  text-align: right; color: #555; font-weight: 500; padding: 1px 4px 2px 4px;
  font-size: 10px; border-bottom: 1px solid #ddd; white-space: nowrap;
}
#info-panel .pn-uc-table th:first-child { text-align: left; }
#info-panel .pn-uc-table th.pn-uc-group {
  text-align: center; border-bottom: 1px solid #bbb; padding-bottom: 1px;
  font-size: 10px; color: #444; font-weight: 600;
}
#info-panel .pn-uc-table th.pn-uc-group-spacer { border-bottom: none; }
#info-panel .pn-uc-table td {
  text-align: right; padding: 2px 4px; color: #444; font-size: 11px;
}
#info-panel .pn-uc-table td:first-child { text-align: left; color: #555; white-space: nowrap; }
#info-panel .pn-uc-table tr.pn-uc-total td,
#info-panel .pn-mode-table tr.pn-total-row td {
  font-weight: 600; border-top: 1px solid #ddd; color: #222;
}
#info-panel .pn-uc-table td.pn-uc-sel { font-weight: bold; color: #222; }
#info-panel .pn-uc-table th.pn-uc-sel { font-weight: bold; color: #333; }

/* ---- Legend ---- */
#legend {
  position: absolute; bottom: 28px; right: 12px;
  background: rgba(255,255,255,0.96); border: 1px solid #ccc;
  border-radius: 6px; padding: 8px 10px; z-index: 900;
  font-size: 11px; min-width: 140px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  max-height: 70vh; overflow-y: auto;
}
#legend .leg-title { font-weight: 700; margin-bottom: 5px; color: #333; font-size: 11px; }
#legend #leg-compare-view {
  font-size: 10px; color: #555; font-style: italic;
  margin: -3px 0 5px;
}
#legend #leg-advanced { margin: -2px 0 5px; }
.leg-advanced-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 10px; color: #1a4a8a; text-decoration: underline;
}
.leg-advanced-toggle:hover { color: #0d3266; }
#leg-advanced-body { margin-top: 4px; }
#leg-height-row { margin-bottom: 6px; }
#leg-height-row label {
  font-size: 11px; font-weight: 600; color: #1a4a8a;
}
#leg-height-row #height-slider {
  width: 100%; margin-top: 3px; cursor: pointer;
}
#leg-cap-slider-row {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: #555;
}
#leg-cap-slider-row label { white-space: nowrap; }
#leg-cap-slider { flex: 1; min-width: 60px; cursor: pointer; }
#leg-cap-value {
  font-variant-numeric: tabular-nums;
  width: 48px; text-align: right; color: #333;
  font-size: 10px; padding: 1px 2px;
  border: 1px solid #ccc; border-radius: 2px;
  background: #fff;
}
#leg-cap-value:focus { outline: none; border-color: #1a4a8a; }
#leg-cap-unit { color: #555; font-size: 10px; }
.leg-cap-reset {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 10px; color: #888; text-decoration: underline;
}
.leg-cap-reset:hover { color: #555; }
#legend .leg-bar {
  height: 13px; border-radius: 3px; margin-bottom: 4px;
  background: linear-gradient(to right, #ccc, #ccc);
}
#legend .leg-labels { display: flex; justify-content: space-between; color: #555; }
#legend .leg-divider { border-top: 1px solid #ddd; margin: 5px 0 4px; }
#legend .leg-modes-row {
  display: flex; flex-wrap: wrap;
  gap: 4px 10px;
  padding: 1px 0;
}
#legend .leg-mode-chip {
  display: inline-flex; align-items: center; gap: 5px;
}
#legend .leg-mode-swatch {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 2px; flex-shrink: 0;
}
#legend .leg-mode-label { color: #444; }

.cum-grid { width: 100%; border-collapse: collapse; margin-top: 2px; }
.cum-grid th { font-size: 10px; color: #888; padding: 2px 3px; text-align: center; }
.cum-grid .cum-row-label { font-size: 10px; color: #555; padding: 2px 4px; white-space: nowrap; }
.ind-btn-sm {
  display: block; width: 100%; text-align: center;
  padding: 2px 3px; border: 1px solid #ddd; border-radius: 3px;
  background: white; cursor: pointer; font-size: 10px; color: #444;
}
.ind-btn-sm:hover { background: #f0f4ff; }
.ind-btn-sm.active { background: #4a90d9; color: white; border-color: #3a7bc8; font-weight: 600; }

/* ---- City Snapshot ---- */
#snapshot-digest {
  flex: 1;
  font-size: 10px;
  font-weight: 400;
  color: #888;
  text-align: right;
  padding-right: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.snapshot-stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}
.snapshot-stat-line .lbl { font-weight: 400; color: #555; }
.snapshot-stat-line .val { font-weight: 600; color: #222; }
.snapshot-stat-line .delta-down { font-weight: 600; color: #c0392b; }
.snapshot-stat-line .delta-up   { font-weight: 600; color: #27ae60; }
.snapshot-histogram {
  width: 100%;
  display: block;
  margin-bottom: 4px;
}
.snap-tooltip {
  position: absolute; background: #333; color: #fff; font-size: 10px;
  padding: 3px 6px; border-radius: 3px; pointer-events: none;
  display: none; white-space: nowrap; z-index: 10;
}
.snap-hist-wrapper { position: relative; }
.snap-legend {
  display: flex; gap: 10px; font-size: 10px; color: #555;
  margin-top: 2px; margin-bottom: 6px; flex-wrap: wrap;
}
.snap-legend-item { display: flex; align-items: center; gap: 3px; }
.snap-mode-rows { margin-bottom: 4px; position: relative; }
.snap-mode-row  { display:flex; align-items:center; gap:4px; margin-bottom:2px; }
.snap-mode-lbl  { font-size:9px; color:#888; width:54px; flex-shrink:0;
                  text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.snapshot-modal-bar {
  display: flex;
  height: 22px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.snapshot-modal-bar div {
  transition: width 300ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  white-space: nowrap;
}
.snapshot-subtitle {
  font-size: 10px;
  font-weight: 400;
  color: #888;
}

/* ---- Compare Summary ---- */
.compare-summary-headline {
  background: #fff;
  border: 1px solid #d0d8e6;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.compare-summary-headline .csh-line1 {
  font-size: 10px;
  color: #666;
  letter-spacing: 0.02em;
}
.compare-summary-headline .csh-delta {
  font-size: 18px;
  font-weight: 700;
}
.compare-summary-headline .csh-delta.up   { color: #27ae60; }
.compare-summary-headline .csh-delta.down { color: #c0392b; }
.compare-summary-headline .csh-delta.flat { color: #555; }
.compare-summary-headline .csh-tail {
  font-size: 10px;
  color: #777;
}
.compare-summary-card {
  margin-bottom: 8px;
}
.compare-summary-card .csc-title {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 3px;
}
.compare-summary-card .csc-caption {
  font-size: 10px;
  color: #777;
  margin-top: 3px;
}
.compare-toggles {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 4px 0 4px 0;
}
.compare-toggle {
  font-size: 9px;
  padding: 2px 6px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: white;
  cursor: pointer;
  color: #555;
  user-select: none;
  line-height: 1.4;
}
.compare-toggle:hover { background: #f3f6fb; }
.compare-toggle.on { font-weight: 600; }
.compare-toggle.tint-A { border-color: #888; }
.compare-toggle.tint-A.on { background: #888; color: white; }
.compare-toggle.tint-B { border-color: #2f99a6; }
.compare-toggle.tint-B.on { background: #2f99a6; color: white; }
.compare-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  margin-top: 4px;
}
.compare-stats-table th,
.compare-stats-table td {
  text-align: right;
  padding: 1px 4px;
  border-bottom: 1px solid #eee;
}
.compare-stats-table th { color: #888; font-weight: 600; }
.compare-stats-table td:first-child,
.compare-stats-table th:first-child { text-align: left; color: #666; }
.compare-stats-table tr:last-child td { border-bottom: none; }
.compare-stats-table .delta-up   { color: #27ae60; font-weight: 600; }
.compare-stats-table .delta-down { color: #c0392b; font-weight: 600; }
.compare-uc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.compare-uc-table th {
  color: #888; font-weight: 600;
  padding: 2px 4px;
  border-bottom: 1px solid #ddd;
  text-align: right;
  font-size: 9px;
  letter-spacing: 0.02em;
}
.compare-uc-table th:first-child { text-align: left; }
.compare-uc-row {
  cursor: pointer;
}
.compare-uc-row td {
  padding: 2px 4px;
  border-bottom: 1px solid #f0f0f0;
  text-align: right;
  color: #444;
  font-size: 10px;
}
.compare-uc-row td:first-child {
  text-align: left;
  color: #333;
  white-space: nowrap;
}
.compare-uc-row:hover { background: #f5f8fc; }
.compare-uc-row.left-behind {
  background: #fff5f0;
}
.compare-uc-row.left-behind:hover { background: #ffe9dc; }
.compare-uc-row.active {
  border-left: 3px solid #4a90d9;
  background: #eaf2fb;
}
.compare-uc-row.active:hover { background: #d8e6f5; }
.compare-uc-row .delta-up   { color: #27ae60; font-weight: 600; }
.compare-uc-row .delta-down { color: #c0392b; font-weight: 600; }
.compare-legend {
  display: flex;
  gap: 8px;
  font-size: 9px;
  color: #555;
  margin-top: 2px;
  flex-wrap: wrap;
}
.compare-legend-item {
  display: flex; align-items: center; gap: 3px;
}

/* ---- Legend overlays section ---- */
#legend { max-height: 70vh; overflow-y: auto; }
#legend-overlays { border-bottom: 1px solid #ddd; padding-bottom: 6px; margin-bottom: 6px; }
.leg-section-title {
  cursor: pointer; font-size: 11px; font-weight: 700; color: #555;
  padding: 2px 0 4px; user-select: none;
}
.leg-section-title:hover { color: #333; }
.collapse-arrow { font-size: 10px; color: #999; margin-left: 4px; }

/* ---- 3D toggle button ---- */
#btn-3d-toggle {
  display: block; width: 100%; text-align: left;
  padding: 4px 7px; margin-bottom: 8px;
  border: 1px solid #b0c8e8; border-radius: 3px;
  background: #e8f2ff; cursor: pointer; font-size: 11px; color: #1a4a8a;
  font-weight: 600;
}
#btn-3d-toggle:hover { background: #d0e6ff; }
#btn-3d-toggle.active { background: #4a90d9; color: white; border-color: #3a7bc8; }

/* MapLibre zoom control margin */
.maplibregl-ctrl-top-right { margin-top: 10px; }

/* ---- Scenario picker ---- */
#scenario-picker {
  border-bottom: 1px solid #ddd;
  padding: 7px 10px 8px;
  background: #f0f0f0;
}
.picker-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #777; display: block; margin-bottom: 4px;
}
#scenario-picker select {
  width: 100%; padding: 4px 6px; border: 1px solid #ccc;
  border-radius: 4px; background: white; font-size: 12px; cursor: pointer;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
  min-width: 0;
}

/* ---- Unified scenario table (axes + flat-scenario, Explore + Compare) ----
   CSS grid; axis-name column is capped + wraps so the dropdown columns get
   the bulk of the panel width. In Compare the swap icon is absolute-positioned
   at the seam between Reference and Alternative — no dedicated column means
   the body rows aren't burning width on a blank cell beneath the icon. */
.scenario-table {
  display: grid;
  gap: 4px 6px;
  align-items: center;
  margin-top: 4px;
}
.scenario-table-explore {
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
}
.scenario-table-compare {
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr) minmax(0, 1fr);
}
.scenario-table .st-cell {
  min-width: 0;
}
.scenario-table .st-header {
  font-size: 9px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: #777;
  text-align: center;
}
.scenario-table .st-header.st-axis-name { text-align: left; }
.scenario-table .st-axis-name {
  font-size: 11px; color: #555; font-weight: 600;
  line-height: 1.15;
  padding-right: 4px;
  word-wrap: break-word;
}
.scenario-table .st-header.st-ref {
  position: relative;
}
.scenario-table select {
  width: 100%; padding: 3px 4px; border: 1px solid #ccc;
  border-radius: 4px; background: white; font-size: 10px; cursor: pointer;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
  min-width: 0;
}
.scenario-table select option:disabled { color: #bbb; }
#btn-swap-ab.swap-btn {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 22px; height: 18px; padding: 0;
  border: none; background: transparent;
  font-size: 14px; line-height: 1; color: #888;
  cursor: pointer;
  z-index: 1;
}
#btn-swap-ab.swap-btn:hover { color: #1a4a8a; }

/* ---- Explore/Compare toggle strip ---- */
.mode-toggle-strip {
  display: flex; border: 1px solid #ccc; border-radius: 4px;
  overflow: hidden;
}
#compare-view-toggle { margin-top: 6px; }
#compare-view-toggle .mode-btn:disabled {
  opacity: 0.5; cursor: not-allowed; background: #f5f5f5;
}
#compare-view-toggle .mode-btn:disabled:hover { background: #f5f5f5; }
.scenario-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.mode-btn {
  flex: 1; padding: 4px 8px; border: none;
  background: white; font-size: 11px; cursor: pointer; color: #555;
  font-weight: 600;
}
.mode-btn:hover { background: #f0f4ff; }
.mode-btn.active { background: #4a90d9; color: white; }

