:root {
  --ui-ink: #25222a;
  --ui-muted: #746f79;
  --ui-border: #e4e1e7;
  --ui-surface: rgba(255,255,255,.97);
  --ui-subtle: #f7f6f8;
  --ui-purple: #60458d;
  --ui-purple-soft: #f3eff8;
  --ui-shadow: 0 10px 30px rgba(35,30,40,.12), 0 1px 3px rgba(35,30,40,.09);
  --ui-shadow-raised: 0 16px 44px rgba(35,30,40,.20), 0 2px 5px rgba(35,30,40,.10);
  --ui-radius: 14px;
}
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, BlinkMacSystemFont,
  "Segoe UI", sans-serif; color: var(--ui-ink); -webkit-font-smoothing: antialiased; }
#map { position: absolute; inset: 0; background: #ECECEA; }

.app-status { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 15; display: flex; align-items: center; gap: 8px; max-width: min(560px, 78vw);
  padding: 8px 10px; border: 1px solid #b8c9d6; border-radius: 8px; background: #f5fbff;
  box-shadow: 0 1px 5px rgba(0,0,0,.18); color: #29475a; font-size: 12px; }
.app-status.ready { border-color: #b8d8bf; background: #f4fbf5; color: #285c33; }
.app-status.warning { border-color: #e5c46f; background: #fff9e8; color: #6f5211; }
.app-status.error { border-color: #e09b9b; background: #fff3f3; color: #8b2222; }
.app-status button { border: 1px solid currentColor; border-radius: 4px; background: transparent;
  color: inherit; cursor: pointer; font-size: 11px; padding: 2px 6px; }
#app-status-close { border: none; font-size: 16px; padding: 0 2px; }
.app-status.loading::before, .data-status.loading::before { content: ""; flex: none; width: 10px; height: 10px;
  box-sizing: border-box; border: 2px solid rgba(96,69,141,.22); border-top-color: var(--ui-purple);
  border-radius: 50%; animation: ui-spin .8s linear infinite; }
.data-status.loading { display: flex; align-items: center; gap: 7px; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
#mobile-toolbar { display: none; }

.measure-readout { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 16; display: flex; align-items: center; gap: 8px; max-width: min(520px, 72vw);
  padding: 7px 9px 7px 11px; border: 1px solid #bca9d5; border-radius: 8px;
  background: rgba(255,255,255,.97); box-shadow: 0 2px 8px rgba(0,0,0,.22); color: #4a3560; }
.measure-readout.hidden { display: none; }
.measure-copy { display: flex; flex-direction: column; min-width: 170px; line-height: 1.2; }
#measure-value { font-size: 12px; }
#measure-help { margin-top: 2px; color: #777; font-size: 9px; }
.measure-readout button { border: 1px solid #c8bce0; border-radius: 5px; background: #f7f4fb;
  color: #563d82; cursor: pointer; font-size: 10px; font-weight: 700; padding: 4px 7px; }
.measure-readout button:hover, .measure-readout button:focus-visible { background: #eee8f7; }
#map.measure-active .maplibregl-canvas { cursor: crosshair !important; }
.maplibregl-ctrl button.map-measure-btn { display: flex; align-items: center; justify-content: center; }
.maplibregl-ctrl button.map-measure-btn svg { width: 21px; height: 21px; fill: none;
  stroke: #333; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.maplibregl-ctrl button.map-measure-btn.active { background: #6a51a3; }
.maplibregl-ctrl button.map-measure-btn.active svg { stroke: #fff; }

.panel {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  width: 258px; box-sizing: border-box; background: var(--ui-surface); padding: 14px 15px;
  border: 1px solid rgba(224,220,227,.92); border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(12px) saturate(1.04);
  /* Never run into the bottom-left choropleth legend: bound + scroll. */
  max-height: calc(100vh - 260px); overflow-y: auto;
}
.panel h1 { font-size: 15px; line-height: 1.2; margin: 0 0 3px; letter-spacing: -.01em; }
.panel-title-row { display: flex; align-items: flex-start; gap: 6px; }
.panel-title-row h1 { flex: 1; }
.panel-title-actions { display: flex; align-items: center; gap: 4px; }
#theme-toggle { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--ui-border); border-radius: 7px;
  background: var(--ui-subtle); color: var(--ui-muted); cursor: pointer; }
#theme-toggle:hover, #theme-toggle:focus-visible { border-color: #a997c1;
  background: var(--ui-purple-soft); color: var(--ui-purple); }
#theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] #theme-toggle .theme-icon-moon { display: none; }
html[data-theme="dark"] #theme-toggle .theme-icon-sun { display: block; }
#controls-close { display: none; border: none; background: #f2f2f2; border-radius: 4px;
  cursor: pointer; color: #555; font-size: 18px; line-height: 1; padding: 2px 6px; }
.panel .sub { font-size: 11px; color: var(--ui-muted); margin: 0 0 11px; }
.data-status { margin: 6px 0 3px; padding: 6px 8px; border-left: 3px solid #b5a2cc;
  border-radius: 5px; background: var(--ui-purple-soft); color: #5b4868;
  font-size: 9.5px; line-height: 1.35; }
.overview-btn { width: 100%; margin: 6px 0 2px; padding: 6px 9px; border: 1px solid #c8bce0;
  border-radius: 7px; background: #fff; color: #563d82; font-size: 11px;
  font-weight: 700; cursor: pointer; }
.overview-btn:hover { background: #eee8f7; }
.overview-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; }
.overview-row .overview-btn { width: auto; min-height: 32px; }
.overview-icon-group { display: inline-flex; align-items: center; gap: 5px; }
.overview-icon-btn { position: relative; flex: none; width: 32px; height: 32px; margin: 6px 0 2px;
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d4d0db;
  border-radius: 7px; background: #fff; color: #756a80; cursor: pointer; }
.overview-icon-btn:hover, .overview-icon-btn:focus-visible { border-color: #a896c1; background: #f4f0f8;
  color: #563d82; }
.overview-icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#review-dot { display: none; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px;
  border-radius: 50%; background: #c98223; box-shadow: 0 0 0 1px #fff; }
.review-icon-btn.has-priority #review-dot { display: block; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.utility-rail { position: fixed; top: 12px; left: 280px; z-index: 3;
  display: flex; flex-direction: column; gap: 7px; }
.utility-tool { position: relative; width: 40px; height: 40px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; border: 1px solid rgba(210,205,215,.96);
  border-radius: 10px; background: var(--ui-surface); box-shadow: 0 4px 14px rgba(35,30,40,.13);
  color: #6e6377; cursor: pointer; }
.utility-tool, #theme-toggle, .overview-btn, .overview-icon-btn, .rank-ctrl,
.detail-save, #detail-close { transition: transform .14s ease, background-color .14s ease,
  border-color .14s ease, color .14s ease, box-shadow .14s ease; }
.utility-tool:hover, .utility-tool:focus-visible { border-color: #a997c1;
  background: var(--ui-purple-soft); color: var(--ui-purple); transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(35,30,40,.15); }
.utility-tool.active { border-color: var(--ui-purple); background: var(--ui-purple); color: #fff; }
.utility-tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.utility-tool::after { content: attr(data-label); position: absolute; top: 50%; left: calc(100% + 8px);
  z-index: 5; transform: translateY(-50%) translateX(-3px); opacity: 0; pointer-events: none;
  padding: 4px 7px; border-radius: 5px; background: #332d38; color: #fff;
  font-size: 10px; font-weight: 650; white-space: nowrap; transition: opacity .12s, transform .12s; }
.utility-tool:hover::after, .utility-tool:focus-visible::after { opacity: 1;
  transform: translateY(-50%) translateX(0); }
.utility-label { display: none; }
#shortlist-count { position: absolute; top: -5px; right: -5px; display: inline-flex;
  align-items: center; justify-content: center; min-width: 17px; height: 17px; box-sizing: border-box;
  padding: 0 4px; border: 2px solid #fff; border-radius: 9px; background: var(--ui-purple);
  color: #fff; font-size: 8px; font-weight: 800; }
.utility-tool.active #shortlist-count { background: #fff; color: var(--ui-purple); }
.panel label { display: block; font-size: 13px; cursor: pointer; margin: 3px 0; }
.panel input[type="checkbox"], .panel input[type="radio"] { accent-color: var(--ui-purple); }
/* Location search — camera-only control (like "Zoom to selection"). */
#loc-form { margin: 0 0 6px; position: relative; }
#loc-input { width: 100%; box-sizing: border-box; font-size: 12px;
  padding: 7px 9px; border: 1px solid #cbc7ce; border-radius: 7px; background: #fff; }
/* Autocomplete dropdown: overlays the controls below the input. */
#loc-ac { position: absolute; top: 100%; left: 0; right: 0; z-index: 6;
  background: #fff; border: 1px solid #bbb; border-radius: 0 0 6px 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,.2); max-height: 165px; overflow-y: auto; }
#loc-ac.hidden { display: none; }
.loc-ac-item { font-size: 11px; padding: 5px 7px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-ac-item:hover, .loc-ac-item.active { background: #e8f0fe; }
#loc-msg { font-size: 11px; color: #b00020; margin: 3px 0 4px; }
#loc-msg.hidden { display: none; }
/* Search-result pin: near-black teardrop DOM marker — deliberately unlike any
   data marker (station-format dots, blue EV dots, teal build diamonds). */
.loc-pin { cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.loc-pin svg { display: block; }
.legend { position: absolute; bottom: 16px; left: 12px; z-index: 1;
  background: var(--ui-surface); padding: 10px 12px; border: 1px solid rgba(224,220,227,.9);
  border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); font-size: 12px; backdrop-filter: blur(12px); }
.legend h2 { font-size: 12px; margin: 0 0 6px; }
.legend .row { display: flex; align-items: center; margin: 2px 0; }
.legend .swatch { width: 16px; height: 12px; margin-right: 8px; border: 1px solid #999; }
.legend .bar { width: 160px; height: 12px; border: 1px solid #999;
  background: linear-gradient(90deg,#fde0dd,#fa9fb5,#f768a1,#c51b8a,#7a0177); }
.legend .scaleticks { display: flex; justify-content: space-between; width: 162px; color:#666; }
/* EV legend: equal-width color bands (one per non-linear stop), labelled with the
   ACTUAL % threshold at each. Low-end stops get the same width as high-end ones, so
   early-year spread (0-15%) is legible even though the scale stays fixed 0->72%. */
#legend-ev .bar { background: linear-gradient(90deg,
  #feebe2 0%, #fcc5c0 16.66%, #fa9fb5 33.33%, #f768a1 50%,
  #dd3497 66.66%, #ae017e 83.33%, #7a0177 100%); }
#legend-ev .scaleticks { font-size: 8px; }
.slider-box {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1; background: var(--ui-surface); padding: 10px 16px; border: 1px solid rgba(224,220,227,.9);
  border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); text-align: center; min-width: 240px;
  backdrop-filter: blur(12px);
}
.slider-box .timeline-row { display: grid; grid-template-columns: 150px 240px;
  align-items: start; gap: 10px; }
.slider-box .timeline-scale { width: 240px; min-width: 0; }
.slider-box .yr { display: block; padding-top: 2px; font-size: 15px; font-weight: 600;
  line-height: 1.15; text-align: left; white-space: nowrap; }
.slider-box .ends { display: flex; justify-content: space-between;
  font-size: 10px; color: #888; width: 240px; }
/* SINGLE slider track: the forecast region (>=2025) is marked WITHIN the track —
   grey observed | tinted+hatched forecast. The split point depends on the state's
   earliestYear (per-state slider min), so it's a CSS variable set by setState():
   --obs-pct = (2024 - min)/(2035 - min), --fc-pct = 100% - that. Defaults = WA/2017. */
.slider-box input[type=range] { -webkit-appearance: none; appearance: none;
  --obs-pct: 38.9%; --fc-pct: 61.1%;
  width: 240px; height: 9px; border-radius: 5px; background: transparent; cursor: pointer;
  margin: 3px 0; }
.slider-box input[type=range]::-webkit-slider-runnable-track { height: 9px; border-radius: 5px;
  background-image:
    repeating-linear-gradient(45deg, rgba(177,0,38,.5), rgba(177,0,38,.5) 2px, transparent 2px, transparent 5px),
    linear-gradient(90deg, #cfcfcf 0 var(--obs-pct), #f6cbc7 var(--obs-pct) 100%);
  background-repeat: no-repeat, no-repeat;
  background-size: var(--fc-pct) 100%, 100% 100%;
  background-position: right center, left center; }
.slider-box input[type=range]::-moz-range-track { height: 9px; border-radius: 5px;
  background-image:
    repeating-linear-gradient(45deg, rgba(177,0,38,.5), rgba(177,0,38,.5) 2px, transparent 2px, transparent 5px),
    linear-gradient(90deg, #cfcfcf 0 var(--obs-pct), #f6cbc7 var(--obs-pct) 100%);
  background-repeat: no-repeat, no-repeat;
  background-size: var(--fc-pct) 100%, 100% 100%;
  background-position: right center, left center; }
.slider-box input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; margin-top: -3px; border-radius: 50%;
  background: #555; border: 2px solid #fff; box-shadow: 0 0 0 1px #999; }
.slider-box input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%;
  background: #555; border: 2px solid #fff; box-shadow: 0 0 0 1px #999; }
.slider-box.forecast input[type=range]::-webkit-slider-thumb { background: #b10026; }
.slider-box.forecast input[type=range]::-moz-range-thumb { background: #b10026; }
.slider-box.forecast .yr { color: #b10026; }
#yr-tag { font-size: 11px; font-weight: 600; color: #b10026; margin-left: 6px; }
#forecast-badge { background: #b10026; color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px; vertical-align: middle; letter-spacing: .05em; }
/* Integrated demand-scenario control by the slider. */
.slider-box .pace-ctl { margin-top: 9px; display: flex; align-items: center;
  justify-content: center; gap: 8px; transition: opacity .15s; }
.slider-box .pace-ctl.disabled { opacity: .35; pointer-events: none; }
.slider-box .pace-lbl { font-size: 11px; color: #555; font-weight: 600; }
.slider-box .seg { display: inline-flex; border: 1px solid #d9b3b0;
  border-radius: 6px; overflow: hidden; }
.slider-box .seg button { border: none; border-right: 1px solid #eccfcc; background: #fff;
  color: #b10026; font-size: 11px; font-weight: 600; padding: 3px 11px; cursor: pointer; }
.slider-box .seg button:last-child { border-right: none; }
.slider-box .seg button.active { background: #b10026; color: #fff; }
/* Thin map-border accent in forecast mode (chrome signal, never over the data). */
#map-frame { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border: 0 solid #b10026; transition: border-width .15s; }
body.forecast-mode #map-frame { border-width: 4px; }
/* --- Grouped, collapsible layer controls (persistent groups, master toggles) --- */
.panel .global { font-size: 13px; margin: 0 0 4px; }
.panel .group { border-top: 1px solid var(--ui-border); margin-top: 7px; padding-top: 6px; }
.panel .group-head { display: flex; align-items: center; gap: 6px; cursor: pointer;
  min-height: 27px; border-radius: 7px; margin: -3px -5px; padding: 3px 5px; }
.panel .group-head:hover { background: var(--ui-purple-soft); }
.panel .group-head .master { margin: 0; flex: none; }
.panel .group-title { font-size: 13px; font-weight: 650; flex: 1; cursor: pointer;
  user-select: none; }
.panel .group.expanded > .group-head .group-title { color: var(--ui-purple); }
.panel .group-title:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
.rank-row:focus-visible, #loc-ac [role="option"]:focus-visible {
  outline: 2px solid #0077bb; outline-offset: 2px;
}
.panel .caret { font-size: 10px; color: #888; cursor: pointer; width: 12px;
  text-align: center; user-select: none; }
.panel .group-body { display: none; margin: 6px 0 3px 2px; }
.panel .group.expanded > .group-body { display: block; }
.panel .group.off .group-title,
.panel .group.off .group-body { opacity: .4; }      /* greyed when master off */
.panel .group.off .group-body { pointer-events: none; }
.panel .group-body label { display: flex; align-items: center; font-size: 12px; margin: 3px 0; }
.panel .group-body input { margin: 0 6px 0 0; flex: none; }
.panel .group-body .sub-head { font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: #999; margin: 7px 0 2px; }
.panel .group-body .dot { width: 12px; height: 12px; border-radius: 50%;
  margin-right: 7px; border: 1px solid #fff; box-shadow: 0 0 0 1px #999; flex: none; }
.panel .group-body .supply-symbol { width: 11px; height: 11px; border-radius: 2px;
  margin-right: 7px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #777; flex: none; }
.panel .group-body .note { font-size: 10px; color: #888; margin-top: 6px; line-height: 1.35; }
.control-key { margin-top: 7px; color: var(--ui-muted); font-size: 9.5px; line-height: 1.35; }
.control-key.emphasis { padding: 6px 7px; border-radius: 6px; background: var(--ui-subtle);
  color: #5d5265; font-weight: 650; }
.method-note { margin-top: 7px; border: 1px solid var(--ui-border); border-radius: 7px;
  background: #fff; color: #625b67; font-size: 9.5px; line-height: 1.4; }
.method-note summary { position: relative; padding: 6px 23px 6px 8px; color: #665578;
  font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.method-note summary::-webkit-details-marker { display: none; }
.method-note summary::after { content: "+"; position: absolute; top: 4px; right: 8px;
  color: #8b7a9c; font-size: 13px; font-weight: 500; }
.method-note[open] summary::after { content: "−"; }
.method-note[open] summary { border-bottom: 1px solid var(--ui-border); }
.method-note > div { padding: 7px 8px 8px; }
.method-note.evidence-note { border-color: #ddd5e8; background: #fcfbfd; }
.opportunity-type-filter { margin: 1px 0 8px; border: 1px solid var(--ui-border);
  border-radius: 7px; background: var(--ui-surface); }
.opportunity-type-filter > summary { display: flex; align-items: center; gap: 5px;
  padding: 6px 8px; list-style: none; color: #5d5265; font-size: 10px;
  font-weight: 750; cursor: pointer; }
.opportunity-type-filter > summary::-webkit-details-marker { display: none; }
.opportunity-type-filter > summary::after { content: "+"; margin-left: auto;
  color: #8b7a9c; font-size: 13px; font-weight: 500; }
.opportunity-type-filter[open] > summary::after { content: "−"; }
.opportunity-type-filter > summary span { color: var(--ui-purple); font-size: 9px;
  font-weight: 700; }
.opportunity-type-body { padding: 4px 7px 7px; border-top: 1px solid var(--ui-border); }
.panel .group-body .opportunity-type-body label { display: grid;
  grid-template-columns: 14px 12px minmax(0,1fr) auto; gap: 5px; margin: 4px 0;
  color: var(--ui-ink); font-size: 10px; }
.panel .group-body .opportunity-type-body input { margin: 0; }
.opportunity-type-body label > b { color: var(--ui-muted); font-size: 9px;
  font-variant-numeric: tabular-nums; font-weight: 700; }
.opportunity-type-swatch { width: 8px; height: 8px; transform: rotate(45deg);
  border: 2px solid currentColor; border-radius: 1px; background: transparent; }
.opportunity-type-swatch.type-site_candidate { color: #2e7d48; background: #2e7d48; }
.opportunity-type-swatch.type-interchange_opportunity { color: #3e6f9d; }
.opportunity-type-swatch.type-competitor_white_space { color: #0d9488; }
.opportunity-type-swatch.type-undersupplied_market { color: #b56b16; }
.opportunity-type-swatch.type-corridor_gap { color: #6b7280; }
.opportunity-type-actions { display: flex; gap: 5px; margin-top: 6px; }
.opportunity-type-actions button { flex: 1; padding: 3px 5px; border: 1px solid var(--ui-border);
  border-radius: 5px; background: var(--ui-subtle); color: var(--ui-ink);
  font-size: 9px; font-weight: 700; cursor: pointer; }
.opportunity-type-actions button:hover, .opportunity-type-actions button:focus-visible {
  border-color: #b9a8d1; color: var(--ui-purple); }
/* Bounded legend card (matches the legend boxes' style) — keeps long notes
   visually contained instead of running into adjacent legends. */
.panel .group-body .note-card { background: #fafafa; border: 1px solid #ddd;
  border-radius: 6px; padding: 6px 8px; margin: 8px 0 2px; font-size: 10px;
  color: #666; line-height: 1.4; }
/* Traffic-roads legend: line swatch (width encodes AADT band) + label. */
.panel .rd-legend label { display: flex; align-items: center; font-size: 12px; margin: 3px 0; }
.panel .rd-legend .rl { width: 24px; margin-right: 8px; border-radius: 1px; flex: none; }
/* Brand/county multi-select (searchable checkbox popover). */
.panel .msel { position: relative; margin: 3px 0; }
.panel .msel-btn { width: 100%; text-align: left; font-size: 11px; padding: 6px 8px;
  border: 1px solid #d0ccd3; border-radius: 6px; background: #fff; cursor: pointer; }
.panel .msel-btn .msel-label { color: #6a51a3; font-weight: 600; }
.panel .msel-pop { position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  margin-top: 2px; background: #fff; border: 1px solid #ccc; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); padding: 6px; max-height: min(260px, 45vh);
  display: flex; flex-direction: column; }
.panel .msel-pop.hidden { display: none; }
.panel .msel-search { width: 100%; box-sizing: border-box; font-size: 11px; padding: 3px 5px;
  border: 1px solid #ddd; border-radius: 4px; margin-bottom: 4px; }
.panel .msel-actions { display: flex; gap: 6px; margin-bottom: 4px; }
.panel .msel-actions button { flex: 1; font-size: 10px; padding: 2px; cursor: pointer;
  border: 1px solid #ccc; border-radius: 3px; background: #f7f7f7; }
.panel .msel-actions button.msel-done { border-color: #6a51a3; color: #5b438b;
  background: #f3f0f9; font-weight: 700; }
.panel .msel-list { max-height: 158px; overflow-y: auto; min-height: 0; }
.panel .msel-list label { display: flex; align-items: center; font-size: 11px; margin: 2px 0; }
.panel .msel-list input { margin: 0 6px 0 0; flex: none; }
.panel .msel-none { font-size: 11px; color: #999; padding: 4px; }
.panel .zoom-btn { width: 100%; margin: 5px 0 2px; font-size: 11px; padding: 6px;
  cursor: pointer; border: 1px solid #9dcce6; color: #176b94; background: #f5fbfe;
  border-radius: 6px; font-weight: 650; }
.panel .zoom-btn:hover { background: #e0f3ff; }
/* Radius presets (static mode): reuse the segmented-button look inside the panel. */
.panel .seg { display: inline-flex; border: 1px solid #ccc; border-radius: 6px;
  overflow: hidden; margin: 3px 0; }
.panel .seg.hidden { display: none; }
.panel .seg button { border: none; border-right: 1px solid #ddd; background: #fff;
  color: #555; font-size: 11px; font-weight: 600; padding: 3px 12px; cursor: pointer; }
.panel .seg button:last-child { border-right: none; }
.panel .seg button.active { background: #6a51a3; color: #fff; }
/* Scoring weight + radius sliders. */
.panel .group-body label.wt { display: flex; align-items: center; gap: 7px; font-size: 11px; margin: 4px 0; }
.panel .group-body label.wt input[type=range] { flex: 1; min-width: 0; margin: 0; }
.panel .group-body label.wt > span { width: 42px; text-align: right; color: #555;
  font-variant-numeric: tabular-nums; flex: none; }
.advanced-controls { margin-top: 8px; border-top: 1px solid var(--ui-border); }
.advanced-controls > summary { position: relative; display: flex; flex-direction: column; gap: 1px;
  padding: 9px 22px 7px 3px; border-radius: 7px; list-style: none; cursor: pointer; }
.advanced-controls > summary::-webkit-details-marker { display: none; }
.advanced-controls > summary:hover { background: var(--ui-purple-soft); }
.advanced-controls > summary::after { content: "+"; position: absolute; top: 11px; right: 5px;
  color: #887c90; font-size: 14px; font-weight: 500; line-height: 1; }
.advanced-controls[open] > summary::after { content: "−"; }
.advanced-controls > summary span { color: #4f4854; font-size: 12px; font-weight: 700; }
.advanced-controls > summary small { color: #918a95; font-size: 8.5px; font-weight: 500; }
.advanced-controls[open] > summary span { color: var(--ui-purple); }
.advanced-body > .group:first-child { margin-top: 2px; }
/* One right-side workspace for station and opportunity results. */
#panel-stack { position: absolute; top: 12px; right: 12px; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-end;
  max-height: calc(100vh - 40px); transition: right .2s ease, opacity .16s ease; }
body.detail-open #panel-stack { right: 418px; }
.results-dock { width: 342px; max-height: min(66vh, 680px); min-height: 0;
  display: flex; flex-direction: column; overflow: visible;
  background: var(--ui-surface); border: 1px solid rgba(224,220,227,.9);
  border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); backdrop-filter: blur(12px);
  transition: width .18s ease; }
.results-dock.hidden { display: none; }
.results-toolbar { position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 5px; min-height: 42px; padding: 6px; box-sizing: border-box;
  border-bottom: 1px solid var(--ui-border); }
.results-tabs { min-width: 0; display: flex; flex: none; gap: 3px; }
.results-tab { min-width: 0; display: inline-flex; flex: none; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: var(--ui-muted); padding: 6px 7px; font-size: 10px; font-weight: 750;
  line-height: 1; cursor: pointer; white-space: nowrap; }
.results-tab:hover, .results-tab:focus-visible { background: var(--ui-purple-soft);
  color: var(--ui-purple); }
.results-tab.active { border-color: #cec1df; background: var(--ui-purple-soft);
  color: var(--ui-purple); }
.results-tab-count { display: inline-flex; flex: none; align-items: center; justify-content: center;
  min-width: 26px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: rgba(96,69,141,.1); font-size: 8px; font-weight: 800; white-space: nowrap; }
.results-tab.active .results-tab-count { background: var(--ui-purple); color: #fff; }
.results-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.rank-ctrl { width: 25px; height: 25px; display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; border: none; background: #f2f2f2; border-radius: 6px; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0; color: #555; }
.rank-ctrl:hover, .rank-ctrl:focus-visible { background: #e8e2ef; color: #563d82;
  transform: translateY(-1px); }
.results-icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.results-more { position: relative; }
.results-more > summary { list-style: none; font-size: 12px; letter-spacing: .04em; }
.results-more > summary::-webkit-details-marker { display: none; }
.results-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 8;
  width: 164px; padding: 5px; border: 1px solid var(--ui-border); border-radius: 8px;
  background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.results-menu button { width: 100%; border: 0; border-radius: 5px; background: transparent;
  color: var(--ui-ink); padding: 7px 8px; text-align: left; font-size: 10px; cursor: pointer; }
.results-menu button:hover, .results-menu button:focus-visible { background: var(--ui-purple-soft);
  color: var(--ui-purple); }
.rank-panel.results-pane { width: auto; min-height: 0; max-height: none; flex: 1;
  display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: 0 0 12px 12px;
  background: transparent; box-shadow: none; backdrop-filter: none; }
.results-pane.hidden { display: none; }
.results-pane-title { display: flex; align-items: baseline; gap: 3px; padding: 8px 12px 0; }
.results-pane-title b { font-size: 12px; }
.rank-count { font-family: inherit; font-size: 12px; font-weight: 400; color: #888; }
.rank-sub { font-family: inherit; font-size: 10px; font-weight: 400; color: #888;
  padding: 5px 12px 0; }
.rank-rows { overflow-y: auto; padding: 3px 0; min-height: 0; }
.rank-empty { padding: 12px; font-size: 12px; color: #888; line-height: 1.5; }
.rank-row { position: relative; display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 6px 11px; cursor: pointer;
  transition: background-color .12s ease, box-shadow .12s ease; }
.rank-row:hover { background: #f3f0f9; box-shadow: inset 0 0 0 1px rgba(96,69,141,.05); }
.rank-row.selected { background: #eee8f7; box-shadow: inset 0 0 0 1px rgba(96,69,141,.12); }
.rank-row.selected::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 0;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--ui-purple); }
.rk-total { flex: none; width: 30px; height: 30px; border-radius: 6px; color: #fff;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.rk-main { min-width: 0; flex: 1; }
.rk-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-cty { color: #888; font-weight: 400; font-size: 10px; }
.rk-comp { color: #666; font-size: 10px; margin-top: 1px; }
.shortlist-toggle { margin-left: auto; flex: none; width: 26px; height: 26px; border: none;
  border-radius: 50%; background: transparent; color: #6a51a3; font-size: 18px;
  line-height: 1; cursor: pointer; }
.shortlist-toggle:hover, .shortlist-toggle.active { background: #eee8f7; }
.evidence-chip { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 10px;
  background: #e8f5f2; color: #08766d; font-size: 9px; font-weight: 700; white-space: nowrap; }
.evidence-chip.grade-a { background: #e6f5ea; color: #256b37; }
.evidence-chip.grade-b { background: #e8f1fa; color: #315f88; }
.evidence-chip.grade-c, .evidence-chip.grade-d, .evidence-chip.grade-u {
  background: #f4f0e8; color: #765a25; }
.opportunity-kind { display: inline-flex; align-items: center; padding: 1px 6px;
  border: 1px solid #d8d1df; border-radius: 10px; background: #f5f2f8;
  color: #554a62; font-size: 9px; font-weight: 700; line-height: 1.35;
  vertical-align: 1px; white-space: nowrap; }
.opportunity-kind.kind-site_candidate { background: #e8f5eb; border-color: #b8d9c0; color: #256b37; }
.opportunity-kind.kind-interchange_opportunity { background: #eaf2fb; border-color: #bfd2e8; color: #315f88; }
.opportunity-kind.kind-competitor_white_space { background: #e8f6f3; border-color: #b7ded7; color: #08766d; }
.opportunity-kind.kind-undersupplied_market { background: #fff3e2; border-color: #e8cea6; color: #805112; }
.opportunity-kind.kind-corridor_gap { background: #f1f2f4; border-color: #d0d3d8; color: #555c66; }
.opportunity-reason { color: #5d5269; font-weight: 600; }
.opportunity-readiness { margin-top: 9px; padding: 9px 10px; border: 1px solid #ded7e7;
  border-left: 3px solid #b56b16; border-radius: 8px; background: #fbfafc; }
.opportunity-readiness.ready { border-left-color: #2e7d48; background: #f7fbf8; }
.opportunity-readiness > div:not(.opportunity-blockers) { display: grid;
  grid-template-columns: minmax(120px,.42fr) minmax(0,1fr); gap: 10px; padding: 3px 0; }
.opportunity-readiness span { color: var(--ui-muted); font-size: 9px; font-weight: 650; }
.opportunity-readiness b { color: var(--ui-ink); font-size: 10px; line-height: 1.35; }
.opportunity-blockers { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--ui-border);
  color: #775824; font-size: 9px; line-height: 1.4; }
.opportunity-blockers.ready { color: #2f6f3d; }
/* View-state visibility + sizing. */
.results-pane.rv-list .rank-table-wrap { display: none; }
.results-pane.rv-table .rank-rows { display: none; }
.results-dock.rv-table { width: 660px; max-width: calc(100vw - 292px); }
.results-dock.collapsed { width: 178px; }
.results-dock.collapsed .results-pane,
.results-dock.collapsed .results-tab:not(.active),
.results-dock.collapsed #results-view-btn,
.results-dock.collapsed #results-focus-btn,
.results-dock.collapsed .results-more { display: none; }
.results-dock.collapsed .results-toolbar { border-bottom: 0; }
.results-dock.collapsed .results-tabs { flex: 1; }
.results-dock.collapsed .results-tab.active { flex: 1; pointer-events: none; }
.rank-table-wrap { overflow: auto; min-height: 0; }
table#rank-table { border-collapse: collapse; width: 100%; font-size: 11px; }
#rank-table th, #rank-table td { padding: 4px 8px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid #f0f0f0; }
#rank-table th { position: sticky; top: 0; background: #f7f7f7; cursor: pointer;
  user-select: none; font-weight: 600; z-index: 1; }
#rank-table th.num, #rank-table td.num { text-align: right; }
#rank-table th.sorted { color: #6a51a3; background: #efeaf7; }
#rank-table tbody tr { cursor: pointer; }
#rank-table tbody tr:hover { background: #f3f0f9; }
#rank-table tbody tr.selected { background: #eee8f7; box-shadow: inset 3px 0 0 var(--ui-purple); }
.rk-tbtotal { color: #fff; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
#focus-exit { display: none; position: fixed; top: 12px; left: 12px; z-index: 30;
  border: 1px solid #c8bce0; border-radius: 9px; background: var(--ui-surface);
  box-shadow: var(--ui-shadow); color: var(--ui-purple); padding: 8px 11px;
  font-size: 11px; font-weight: 750; cursor: pointer; }
body.focus-map #focus-exit { display: block; }
body.focus-map .panel,
body.focus-map .legend,
body.focus-map .slider-box,
body.focus-map #panel-stack,
body.focus-map #mobile-toolbar,
body.focus-map #detail-panel,
body.focus-map .app-status { display: none !important; }
/* About / methodology modal. */
#about-btn { border: none; background: none; color: #6a51a3; font-size: 14px;
  cursor: pointer; padding: 0 2px; vertical-align: middle; }
.about-overlay { position: absolute; inset: 0; z-index: 20;
  background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.about-overlay.hidden { display: none; }
.about-modal { background: #fff; border-radius: 10px; width: 560px; max-width: 92vw;
  max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 4px 24px rgba(0,0,0,.35); }
.about-head { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid #eee; font-size: 14px; }
#about-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #888; }
.about-body { overflow-y: auto; padding: 6px 18px 14px; font-size: 12px; line-height: 1.5; }
.about-body h3 { font-size: 12px; margin: 12px 0 3px; color: #6a51a3; }
.about-body ul { margin: 3px 0; padding-left: 18px; }
.about-body p { margin: 3px 0; }

/* Persistent station / opportunity details. */
#detail-panel { position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 12;
  width: 386px; box-sizing: border-box; display: flex; flex-direction: column;
  background: var(--ui-surface); border: 1px solid rgba(224,220,227,.95); border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-raised); backdrop-filter: blur(14px) saturate(1.04);
  transform: translateX(calc(100% + 28px)); visibility: hidden;
  transition: transform .2s ease, visibility 0s linear .2s; }
body.detail-open #detail-panel { transform: translateX(0); visibility: visible;
  transition: transform .2s ease; }
.detail-head, .workspace-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 15px 12px; border-bottom: 1px solid #e8e8e8; }
.detail-head h2, .workspace-head h2 { margin: 2px 0 0; font-size: 17px; line-height: 1.2; }
.detail-eyebrow { color: #6a51a3; font-size: 9px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; }
#detail-close, #markets-close, #compare-close, #review-close { flex: none; width: 32px; height: 32px;
  border: none; border-radius: 6px; background: #f2f2f2; color: #555; font-size: 22px;
  line-height: 1; cursor: pointer; }
#detail-close:hover, #detail-close:focus-visible { background: var(--ui-purple-soft);
  color: var(--ui-purple); transform: rotate(3deg); }
.detail-nav { flex: none; display: flex; gap: 5px; min-width: 0; overflow-x: auto;
  padding: 7px 10px; border-bottom: 1px solid var(--ui-border); background: var(--ui-surface);
  scrollbar-width: none; overscroll-behavior-x: contain; }
.detail-nav::-webkit-scrollbar { display: none; }
.detail-nav.hidden { display: none; }
.detail-nav button { flex: none; border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ui-muted); padding: 5px 8px; font-size: 9px;
  font-weight: 750; line-height: 1; cursor: pointer; white-space: nowrap; }
.detail-nav button:hover, .detail-nav button:focus-visible { border-color: #cfc4df;
  background: var(--ui-purple-soft); color: var(--ui-purple); }
.detail-nav button.active { border-color: #c8bce0; background: var(--ui-purple-soft);
  color: var(--ui-purple); box-shadow: inset 0 0 0 1px rgba(96,69,141,.05); }
#detail-body { min-height: 0; overflow-y: auto; padding: 12px 15px 18px;
  overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-color: #c9c1d2 transparent;
  scrollbar-width: thin; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 9px; }
.detail-sub { color: #666; font-size: 11px; line-height: 1.4; }
.detail-save { flex: none; border: 1px solid #c8bce0; border-radius: 6px; background: #f7f4fb;
  color: #563d82; padding: 5px 8px; font-size: 10px; font-weight: 700; cursor: pointer; }
.detail-section { border-top: 1px solid var(--ui-border); padding: 13px 0 4px; }
#detail-body > .detail-section:first-of-type { border-top: 0; padding-top: 4px; }
.detail-section h3 { margin: 0 0 7px; color: #563d82; font-size: 11px;
  letter-spacing: .055em; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 7px; }
.detail-metric { padding: 8px 9px; border: 1px solid #eeebef; border-radius: 9px;
  background: #f8f7f9; min-width: 0; transition: border-color .14s ease, background-color .14s ease; }
.detail-metric:hover { border-color: #ded5e8; background: #fbfafd; }
.detail-metric.wide { grid-column: 1 / -1; }
.detail-metric .metric-label { display: block; color: #777; font-size: 9px; line-height: 1.2; }
.detail-metric strong { display: block; margin-top: 2px; font-size: 12px; line-height: 1.25;
  overflow-wrap: anywhere; }
.scenario-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.scenario-year { border: 1px solid #e3dfe6; border-radius: 9px; padding: 8px 6px;
  background: #fff; text-align: center; transition: border-color .14s ease, transform .14s ease; }
.scenario-year:hover { border-color: #cfc4df; transform: translateY(-1px); }
.scenario-year span { display: block; color: #777; font-size: 9px; }
.scenario-year b { display: block; margin-top: 2px; font-size: 11px; }
.detail-copy { color: #555; font-size: 11px; line-height: 1.5; }
.detail-subhead { margin: -2px 0 7px; color: #777; font-size: 10px; line-height: 1.35; }
.detail-warning { margin-top: 6px; padding: 7px 8px; border-left: 3px solid #d97706;
  background: #fff7ed; color: #76450a; font-size: 11px; line-height: 1.4; }
.detail-disclaimer { margin-top: 7px; color: #888; font-size: 9px; line-height: 1.4; }
.detail-note { margin-top: 8px; border-top: 1px solid #eeeaf0; color: #777;
  font-size: 9px; line-height: 1.45; }
.detail-note summary { position: relative; padding: 7px 20px 3px 0; color: #6c6074;
  font-weight: 700; cursor: pointer; list-style: none; }
.detail-note summary::-webkit-details-marker { display: none; }
.detail-note summary::after { content: "+"; position: absolute; right: 3px; color: #8d8095;
  font-size: 12px; font-weight: 500; }
.detail-note[open] summary::after { content: "−"; }
.detail-note-copy { padding: 2px 0 4px; }
.estimate-quality-section { margin-top: 4px; padding: 10px; border: 1px solid #ded5eb;
  border-radius: 8px; background: #fbfafd; }
.estimate-quality-head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 7px; }
.estimate-quality-head h3 { margin: 0; }
.estimate-agreement { display: inline-flex; align-items: center; border-radius: 11px;
  padding: 3px 7px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.estimate-agreement.strong { background: #e6f5ea; color: #256b37; }
.estimate-agreement.moderate { background: #e8f1fa; color: #315f88; }
.estimate-agreement.limited { background: #fff1dd; color: #805112; }
.estimate-agreement.low { background: #fbe8e8; color: #8f3030; }
.estimate-agreement.unknown { background: #eeeeee; color: #666; }
.estimate-evidence-label { margin: 8px 0 4px; color: #777; font-size: 8px;
  font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.estimate-evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.estimate-evidence-chip { display: flex; align-items: center; justify-content: space-between;
  gap: 5px; padding: 5px 6px; border-radius: 6px; font-size: 8px; background: #f2f2f2; }
.estimate-evidence-chip span { color: #666; }
.estimate-evidence-chip strong { font-size: 8px; text-align: right; }
.estimate-evidence-chip.strong { background: #edf7f0; color: #256b37; }
.estimate-evidence-chip.partial { background: #eef3f8; color: #315f88; }
.estimate-evidence-chip.limited { background: #fff3e2; color: #805112; }
.estimate-evidence-chip.unknown { background: #f1f1f1; color: #666; }
.estimate-limitation { margin-top: 6px; padding: 6px 7px; border-left: 3px solid #b99045;
  background: #fffaf0; color: #66502a; font-size: 9px; line-height: 1.4; }
.v3-review-section { margin-top: 4px; padding: 10px; border: 1px solid #ded5eb;
  border-radius: 8px; background: #fbf9fd; }
.v3-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.v3-review-head h3 { margin-bottom: 2px; }
.agreement-chip { display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 26px; height: 26px; border-radius: 13px; color: #fff; font-size: 11px; font-weight: 800; }
.agreement-chip.grade-a { background: #2f7d42; }
.agreement-chip.grade-b { background: #697b31; }
.agreement-chip.grade-c { background: #b66a12; }
.agreement-chip.grade-d { background: #a53535; }
.agreement-chip.grade--- { background: #777; }
.v3-review-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.v3-review-flags span { padding: 3px 6px; border-radius: 9px; background: #fff1dd;
  color: #805112; font-size: 8px; font-weight: 700; }
.v3-review-clear { margin-top: 7px; color: #397146; font-size: 9px; }
.provenance-list { display: grid; gap: 6px; }
.provenance-row { display: grid; grid-template-columns: 92px minmax(0,1fr) auto; gap: 8px;
  align-items: baseline; padding: 7px 8px; border-radius: 7px; background: #f7f7f7; font-size: 10px; }
.provenance-field { color: #666; font-weight: 700; }
.provenance-source { min-width: 0; overflow-wrap: anywhere; }
.provenance-vintage { color: #777; white-space: nowrap; }

/* Optional dark interface. Map/data colors remain untouched so the analytical
   symbology means the same thing in either mode. */
html[data-theme="dark"] {
  color-scheme: dark;
  --ui-ink: #f1edf4;
  --ui-muted: #aaa4af;
  --ui-border: #454148;
  --ui-surface: rgba(31,29,34,.97);
  --ui-subtle: #29272c;
  --ui-purple: #c3a9ee;
  --ui-purple-soft: #3a3048;
  --ui-shadow: 0 10px 30px rgba(0,0,0,.38), 0 1px 3px rgba(0,0,0,.32);
}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .legend,
html[data-theme="dark"] .rank-panel,
html[data-theme="dark"] #detail-panel,
html[data-theme="dark"] .workspace-modal,
html[data-theme="dark"] .about-modal,
html[data-theme="dark"] .slider-box,
html[data-theme="dark"] .measure-readout { background: var(--ui-surface); color: var(--ui-ink); }
html[data-theme="dark"] .detail-head,
html[data-theme="dark"] .workspace-head,
html[data-theme="dark"] .results-toolbar { border-color: var(--ui-border); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] #loc-input,
html[data-theme="dark"] #loc-ac,
html[data-theme="dark"] .msel-pop,
html[data-theme="dark"] .msel-btn { background: #27242a; border-color: #504b54; color: var(--ui-ink); }
html[data-theme="dark"] .loc-ac-item:hover,
html[data-theme="dark"] .loc-ac-item.active,
html[data-theme="dark"] .rank-row:hover,
html[data-theme="dark"] .workspace-table tbody tr:hover,
html[data-theme="dark"] .validation-table tbody tr:hover,
html[data-theme="dark"] .evidence-table tbody tr:hover { background: #3a3048; }
html[data-theme="dark"] .panel .msel-actions button {
  background: #343139; border-color: #5b5560; color: #eeeaf2; }
html[data-theme="dark"] .panel .msel-actions button:hover,
html[data-theme="dark"] .panel .msel-actions button:focus-visible {
  background: #453b50; border-color: #8d79ac; color: #fff; }
html[data-theme="dark"] .panel .msel-actions button.msel-done {
  background: #3a3048; border-color: #b99de5; color: #e8ddf7; }
html[data-theme="dark"] .rank-row.selected,
html[data-theme="dark"] #rank-table tbody tr.selected { background: #413450; }
html[data-theme="dark"] #controls-close,
html[data-theme="dark"] #detail-close,
html[data-theme="dark"] #markets-close,
html[data-theme="dark"] #opportunity-evidence-close,
html[data-theme="dark"] #compare-close,
html[data-theme="dark"] #review-close,
html[data-theme="dark"] .rank-ctrl { background: #363239; color: #d7d1dc; }
html[data-theme="dark"] .detail-metric,
html[data-theme="dark"] .estimate-quality-section,
html[data-theme="dark"] .v3-review-section,
html[data-theme="dark"] .review-kpi,
html[data-theme="dark"] .validation-kpi,
html[data-theme="dark"] .validation-history-card,
html[data-theme="dark"] .evidence-kpi,
html[data-theme="dark"] .evidence-coverage > div { background: #29262d; border-color: #47414c; }
html[data-theme="dark"] .scenario-year,
html[data-theme="dark"] .workspace-table .review-table tr { background: #29262d; border-color: #47414c; }
html[data-theme="dark"] .provenance-row,
html[data-theme="dark"] .estimate-evidence-chip { background: #29262d; }
html[data-theme="dark"] .workspace-note { background: #342d3d; color: #cabddd; }
html[data-theme="dark"] .data-status { background: #382f44; color: #d8c9e8;
  border-left-color: #9b7fc2; }
html[data-theme="dark"] .workspace-table th,
html[data-theme="dark"] .compare-table th,
html[data-theme="dark"] .validation-table th,
html[data-theme="dark"] .evidence-table th,
html[data-theme="dark"] #rank-table th { background: #2b282e; color: #d4cfd7; }
html[data-theme="dark"] .workspace-table td,
html[data-theme="dark"] .compare-table td,
html[data-theme="dark"] .validation-table td,
html[data-theme="dark"] .evidence-table td,
html[data-theme="dark"] #rank-table td { border-color: #403b43; }
html[data-theme="dark"] .detail-sub,
html[data-theme="dark"] .detail-copy,
html[data-theme="dark"] .detail-subhead,
html[data-theme="dark"] .rank-sub,
html[data-theme="dark"] .rk-comp,
html[data-theme="dark"] .rk-cty,
html[data-theme="dark"] .workspace-tools label,
html[data-theme="dark"] #markets-summary,
html[data-theme="dark"] #validation-summary,
html[data-theme="dark"] #opportunity-evidence-summary,
html[data-theme="dark"] #review-summary { color: var(--ui-muted); }
html[data-theme="dark"] .evidence-kpi strong,
html[data-theme="dark"] .evidence-coverage b { color: var(--ui-ink); }
html[data-theme="dark"] .detail-section h3,
html[data-theme="dark"] .validation-section h3,
html[data-theme="dark"] .about-body h3,
html[data-theme="dark"] .detail-eyebrow { color: #c3a9ee; }
html[data-theme="dark"] .opportunity-kind { background: #35313a; border-color: #57505f; color: #d8d0df; }
html[data-theme="dark"] .opportunity-kind.kind-site_candidate { background: #243a2b; border-color: #3f664a; color: #a9d9b4; }
html[data-theme="dark"] .opportunity-kind.kind-interchange_opportunity { background: #273544; border-color: #46627f; color: #b4cde7; }
html[data-theme="dark"] .opportunity-kind.kind-competitor_white_space { background: #233b38; border-color: #3e6d67; color: #a8d9d2; }
html[data-theme="dark"] .opportunity-kind.kind-undersupplied_market { background: #423521; border-color: #705936; color: #e7c892; }
html[data-theme="dark"] .opportunity-kind.kind-corridor_gap { background: #303238; border-color: #565a63; color: #c8cbd1; }
html[data-theme="dark"] .opportunity-type-filter { background: #29262d; }
html[data-theme="dark"] .opportunity-type-filter > summary { color: #d4cfd7; }
html[data-theme="dark"] .opportunity-type-actions button { background: #35313a; color: #d7d1dc; }
html[data-theme="dark"] .opportunity-reason { color: #c7b9d8; }
html[data-theme="dark"] .opportunity-readiness { background: #2e2924; border-color: #5a4b38;
  border-left-color: #d09948; }
html[data-theme="dark"] .opportunity-readiness.ready { background: #263229;
  border-color: #415746; border-left-color: #5eaa70; }
html[data-theme="dark"] .opportunity-blockers { color: #dfbf8a; }
html[data-theme="dark"] .opportunity-blockers.ready { color: #acd6b5; }
html[data-theme="dark"] .detail-save,
html[data-theme="dark"] .workspace-tools button,
html[data-theme="dark"] .measure-readout button { background: #3a3048; border-color: #6e5a88; color: #d7c5f1; }
html[data-theme="dark"] .detail-note { border-color: var(--ui-border); color: #aaa4af; }
html[data-theme="dark"] .detail-note summary { color: #c6bdcc; }
html[data-theme="dark"] .maplibregl-popup-content,
html[data-theme="dark"] .maplibregl-popup-close-button { background: #252229; color: #f1edf4; }
html[data-theme="dark"] .maplibregl-popup-tip { border-top-color: #252229; }
html[data-theme="dark"] .maplibregl-ctrl-group { background: #2b282e; }
html[data-theme="dark"] .maplibregl-ctrl-group button { filter: invert(.88); }

/* Markets and comparison workspaces. */
.workspace-overlay { position: fixed; inset: 0; z-index: 25; display: flex;
  align-items: center; justify-content: center; padding: 24px; box-sizing: border-box;
  background: rgba(24,24,24,.42); }
.workspace-overlay.hidden { display: none; }
.workspace-modal { width: min(1120px, 96vw); max-height: 90vh; display: flex; flex-direction: column;
  border-radius: 12px; background: #fff; box-shadow: 0 5px 30px rgba(0,0,0,.35); }
.workspace-tools { display: flex; align-items: end; gap: 12px; padding: 10px 15px; }
.workspace-tools label { color: #666; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.workspace-tools select, .workspace-tools input { display: block; margin-top: 3px; padding: 6px 8px;
  border: 1px solid #ccc; border-radius: 5px; background: #fff; font-size: 12px; }
.workspace-tools button { border: 1px solid #c8bce0; border-radius: 5px; background: #f7f4fb;
  color: #563d82; padding: 6px 9px; font-size: 11px; font-weight: 700; cursor: pointer; }
.workspace-tools button.danger-lite { margin-left: auto; border-color: #e2c7c7; background: #fff8f8; color: #8a3333; }
.workspace-search { flex: 1; }
.workspace-search input { width: 100%; box-sizing: border-box; }
#markets-summary { color: #666; font-size: 11px; white-space: nowrap; }
#validation-summary { color: #666; font-size: 11px; white-space: nowrap; }
#review-summary { color: #666; font-size: 11px; white-space: nowrap; }
.review-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px;
  padding: 0 15px 9px; }
.review-kpi { padding: 7px 8px; border: 1px solid #e7e3eb; border-radius: 7px;
  background: #faf9fb; }
.review-kpi span { display: block; color: #777; font-size: 8px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.review-kpi strong { display: block; margin-top: 2px; color: #433653; font-size: 14px; }
.workspace-note { padding: 7px 15px; background: #f7f4fa; color: #665871;
  font-size: 10px; line-height: 1.4; }
.workspace-table, #compare-body { min-height: 0; overflow: auto; padding: 0 15px 15px; }
.workspace-table table, .compare-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.workspace-table th, .workspace-table td, .compare-table th, .compare-table td {
  padding: 7px 8px; border-bottom: 1px solid #ededed; text-align: left; white-space: nowrap; }
.workspace-table th, .compare-table th { position: sticky; top: 0; z-index: 1;
  background: #f7f7f7; color: #555; cursor: pointer; }
.workspace-table th.num, .workspace-table td.num, .compare-table td.num { text-align: right; }
.workspace-table tbody tr { cursor: pointer; }
.workspace-table tbody tr:hover { background: #f3f0f9; }
.workspace-table th.sorted { color: #6a51a3; background: #eee8f7; }
.validation-modal { width: min(1240px, 97vw); }
.validation-body { min-height: 0; overflow: auto; padding: 12px 15px 18px; }
.validation-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.validation-kpi { padding: 10px 11px; border: 1px solid #e7e3eb; border-radius: 8px;
  background: #faf9fb; }
.validation-kpi span { display: block; color: #756e79; font-size: 9px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.validation-kpi strong { display: block; margin-top: 3px; color: #2d2632; font-size: 18px; }
.validation-kpi small { display: block; margin-top: 2px; color: #777; font-size: 9px; line-height: 1.3; }
.validation-section { margin-top: 14px; }
.validation-section h3 { margin: 0 0 6px; color: #563d82; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; }
.validation-section-note { margin: -2px 0 7px; color: #777; font-size: 10px; line-height: 1.4; }
.validation-history-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.validation-history-card { border: 1px solid #e5e5e5; border-radius: 7px; padding: 8px 9px;
  background: #fff; }
.validation-history-card span { display: block; color: #777; font-size: 9px; }
.validation-history-card strong { display: block; margin-top: 2px; font-size: 14px; }
.validation-history-card small { display: block; margin-top: 2px; color: #777; font-size: 9px; }
.validation-table-wrap { overflow: auto; border: 1px solid #e8e8e8; border-radius: 7px; }
.validation-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.validation-table th,.validation-table td { padding: 6px 7px; border-bottom: 1px solid #ededed;
  text-align: left; white-space: nowrap; }
.validation-table th { position: sticky; top: 0; z-index: 1; background: #f7f7f7;
  color: #555; cursor: pointer; }
.validation-table th.num,.validation-table td.num { text-align: right; }
.validation-table th.sorted { color: #6a51a3; background: #eee8f7; }
.validation-table tbody tr { cursor: pointer; }
.validation-table tbody tr:hover { background: #f3f0f9; }
.validation-flag { display: inline-block; margin: 1px 2px 1px 0; padding: 2px 5px;
  border-radius: 8px; background: #f1eef5; color: #5d4d6e; font-size: 8px; font-weight: 700; }
.validation-flag.high { background: #fde8e8; color: #8c2424; }
.validation-flag.review { background: #fff1dd; color: #8a5311; }
.validation-flag.good { background: #eaf6ec; color: #2f6d3a; }
.validation-flag.grade-a { background: #eaf6ec; color: #2f6d3a; }
.validation-flag.grade-b { background: #eef2df; color: #5c6b2d; }
.validation-flag.grade-c { background: #fff1dd; color: #8a5311; }
.validation-flag.grade-d { background: #fde8e8; color: #8c2424; }
.validation-driver { color: #4f3b6f; font-weight: 700; }
.evidence-modal { width: min(1180px, 97vw); }
.evidence-body { min-height: 0; overflow: auto; padding: 12px 15px 18px; }
.evidence-kpis { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.evidence-kpi { min-width: 0; padding: 10px 11px; border: 1px solid #e7e3eb;
  border-radius: 8px; background: #faf9fb; }
.evidence-kpi span { display: block; color: #756e79; font-size: 9px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.evidence-kpi strong { display: block; margin-top: 3px; color: #2d2632; font-size: 18px; }
.evidence-kpi small { display: block; margin-top: 2px; color: #777; font-size: 9px;
  line-height: 1.3; }
.evidence-coverage { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px;
  margin: 10px 0; }
.evidence-coverage > div { padding: 7px 9px; border: 1px solid #e7e3eb; border-radius: 7px;
  background: #fff; }
.evidence-coverage span { display: block; color: #777; font-size: 8px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.evidence-coverage b { display: block; margin-top: 2px; color: #443750; font-size: 11px; }
.evidence-table-wrap { overflow: auto; border: 1px solid #e8e8e8; border-radius: 7px; }
.evidence-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.evidence-table th,.evidence-table td { padding: 7px 8px; border-bottom: 1px solid #ededed;
  text-align: left; white-space: nowrap; vertical-align: top; }
.evidence-table th { position: sticky; top: 0; z-index: 1; background: #f7f7f7; color: #555; }
.evidence-table th.num,.evidence-table td.num { text-align: right; }
.evidence-table tbody tr { cursor: pointer; }
.evidence-table tbody tr:hover { background: #f3f0f9; }
.evidence-table .evidence-next { min-width: 260px; max-width: 360px; white-space: normal; line-height: 1.35; }
.evidence-status { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 9px;
  background: #f1eef5; color: #5d4d6e; font-size: 8px; font-weight: 800; white-space: nowrap; }
.evidence-status.near_gate { background: #fff0d8; color: #875014; }
.evidence-status.unassessed { background: #fce8e8; color: #8c2929; }
.evidence-status.review { background: #edf0f5; color: #4f5d70; }
.evidence-status.passed { background: #e6f4e9; color: #2f6d3a; }
#opportunity-evidence-summary { color: #666; font-size: 10px; white-space: nowrap; }
.credibility-table { min-width: 1180px; }
.credibility-table td { vertical-align: top; }
.credibility-table td small,.credibility-station small { display: block; margin-top: 2px;
  color: #777; font-size: 8px; font-weight: 400; line-height: 1.3; }
.credibility-station { min-width: 155px; }
.credibility-reasons { min-width: 255px; max-width: 330px; white-space: normal !important; }
.release-assessment { padding: 10px 11px; border: 1px solid #e3d8c8; border-radius: 9px;
  background: #fffaf2; }
.release-assessment.ready { border-color: #cce3d1; background: #f5fbf6; }
.release-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.release-head h3 { margin-bottom: 3px; }
.release-head p { margin: 0; max-width: 720px; color: #5f5863; font-size: 10px; line-height: 1.4; }
.release-status { flex: none; max-width: 230px; padding: 5px 8px; border-radius: 10px;
  background: #fff0d8; color: #875014; font-size: 9px; font-weight: 800; text-align: center; }
.release-assessment.ready .release-status { background: #e6f4e9; color: #2f6d3a; }
.release-gates { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 6px; margin-top: 9px; }
.release-gate { min-width: 0; padding: 7px 8px; border: 1px solid #ead5b9; border-radius: 7px; background: #fff; }
.release-gate.pass { border-color: #cee5d3; }
.release-gate > span { display: block; color: #777; font-size: 8px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; }
.release-gate strong { display: block; margin-top: 3px; color: #333; font-size: 12px; line-height: 1.25; }
.release-gate small { display: block; color: #777; font-size: 8px; }
.release-gate em { display: block; margin-top: 3px; color: #935a18; font-size: 8px; font-style: normal; }
.release-gate.pass em { color: #347141; }
.release-advisory { margin: 8px 0 0; }
.compare-group-title { margin: 14px 0 5px; font-size: 12px; color: #563d82; }
.compare-remove { border: none; border-radius: 4px; background: #f4eeee; color: #8a3333;
  cursor: pointer; padding: 3px 6px; }
.compare-empty { padding: 28px 12px; color: #777; font-size: 12px; text-align: center; }
.compare-annotation { min-width: 190px; white-space: normal !important; }
.compare-annotation input, .compare-annotation textarea, .review-note { display: block; width: 100%;
  box-sizing: border-box; border: 1px solid #d2d2d2; border-radius: 4px; padding: 5px 6px;
  margin: 2px 0 5px; font: inherit; background: #fff; }
.compare-annotation textarea { min-height: 48px; resize: vertical; }
.review-issue { display: inline-block; margin: 1px 3px 1px 0; padding: 2px 5px;
  border-radius: 9px; background: #fff1dd; color: #8a5311; font-size: 9px; font-weight: 700; }
.review-issue.resolved { background: #eaf6ec; color: #2f6d3a; }
.review-status { font-weight: 700; color: #765a25; }
.review-status.reviewed { color: #256b37; }
.review-action { border: 1px solid #ccc; border-radius: 4px; background: #fff; padding: 4px 6px;
  font-size: 10px; cursor: pointer; white-space: nowrap; }
/* Score-component tooltips: dotted underline hints there's a hover explanation. */
.rk-comp span[title], #rank-table th[title] { text-decoration: underline dotted #bbb; cursor: help; }
.hidden { display: none; }
.maplibregl-popup { max-width: min(380px, calc(100vw - 32px)) !important; }
.maplibregl-popup-content { font-size: 12px; line-height: 1.5; padding: 10px 10px 10px 12px; }
.maplibregl-popup-content b { font-size: 13px; }
.maplibregl-popup-close-button { z-index: 2; width: 28px; height: 28px;
  background: rgba(255,255,255,.94); border-radius: 0 8px 0 6px; }
.station-popup-body { max-height: min(58vh, 520px); overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable; padding-right: 18px; }
.station-popup-body:focus-visible { outline: 2px solid #0077bb; outline-offset: -2px; }

/* Preserve a clean three-column workspace on smaller laptops. The drawer and
   control card compact slightly; utility shortcuts recede while a target is
   open. Below 1000px the results dock yields to the detail drawer until close. */
@media (min-width: 721px) and (max-width: 1180px) {
  .panel { width: 246px; padding-inline: 13px; }
  .utility-rail { left: 270px; transition: opacity .14s ease; }
  #detail-panel { width: 360px; }
  body.detail-open #panel-stack { right: 384px; }
  body.detail-open .utility-rail { opacity: 0; pointer-events: none; }
}
@media (min-width: 721px) and (max-width: 1000px) {
  body.detail-open #panel-stack { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (max-width: 720px) {
  .review-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .review-modal { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .review-modal .workspace-tools { flex-wrap: wrap; align-items: end; gap: 7px; }
  .review-modal .workspace-tools label { flex: 1 1 150px; }
  .review-modal .workspace-tools select { width: 100%; }
  #review-summary { order: 3; flex: 1 0 100%; white-space: normal; }
  #review-body { padding: 0 10px 12px; }
  .review-table, .review-table tbody { display: block; width: 100%; }
  .review-table thead { display: none; }
  .workspace-table .review-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 8px 10px; margin: 9px 0; padding: 10px; box-sizing: border-box;
    border: 1px solid #e5e0e9; border-radius: 9px; background: #fff; cursor: default; }
  .workspace-table .review-table td { display: block; width: auto; min-width: 0;
    padding: 0; border: 0; white-space: normal; }
  .workspace-table .review-table td:first-child,
  .workspace-table .review-table td:nth-child(3),
  .workspace-table .review-table td:nth-child(6),
  .workspace-table .review-table .review-open-cell { grid-column: 1 / -1; }
  .review-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block;
    margin-bottom: 3px; color: #777; font-size: 8px; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; }
  .review-table .review-note { min-height: 44px; margin-bottom: 0; resize: vertical; }
  .review-table .review-open-cell .review-action { width: 100%; min-height: 36px;
    border-color: #bca9d5; background: #f7f4fb; color: #563d82; font-weight: 700; }
  #mobile-toolbar { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 14;
    display: grid; grid-template-columns: auto auto minmax(0,1fr) auto; align-items: center; gap: 5px;
    pointer-events: none; }
  #mobile-toolbar button, #mobile-summary { pointer-events: auto; border: 1px solid #d4d4d4;
    border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
  #mobile-toolbar button { min-height: 40px; padding: 7px 8px; color: #4a3560;
    font-weight: 700; cursor: pointer; }
  #mobile-toolbar button.active { background: #6a51a3; border-color: #6a51a3; color: #fff; }
  #mobile-summary { min-width: 0; padding: 6px 8px; text-align: center; color: #444;
    font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .measure-readout { top: 58px; left: 10px; right: 10px; transform: none; max-width: none;
    box-sizing: border-box; }
  .measure-copy { min-width: 0; flex: 1; }

  .app-status { top: 58px; max-width: calc(100vw - 44px); width: max-content; }
  .panel { display: none; position: fixed; top: 58px; left: 10px; right: 10px; bottom: 10px;
    z-index: 13; width: auto; max-width: none; max-height: none; box-sizing: border-box; padding: 14px 16px;
    border-radius: 10px; }
  body.mobile-controls-open .panel { display: block; }
  #controls-close { display: block; }
  .utility-rail { position: static; display: grid; grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 5px; margin: 8px 0 3px; padding: 6px; border: 1px solid var(--ui-border);
    border-radius: 10px; background: var(--ui-subtle); }
  .utility-tool { width: 100%; height: 43px; flex-direction: column; gap: 1px; border: 0;
    border-radius: 7px; background: transparent; box-shadow: none; }
  .utility-tool::after { display: none; }
  .utility-tool svg { width: 17px; height: 17px; }
  .utility-label { display: block; font-size: 7.5px; font-weight: 700; line-height: 1; }
  #shortlist-count { top: 1px; right: calc(50% - 19px); }

  #panel-stack { display: none; position: fixed; top: 58px; left: 10px; right: 10px;
    bottom: 10px; z-index: 13; max-height: none; align-items: stretch; }
  body.mobile-rank-open #panel-stack { display: flex; }
  .results-dock, .results-dock.rv-table, .results-dock.collapsed { width: 100%; max-width: none;
    height: 100%; max-height: none; }
  .results-toolbar { flex: none; gap: 4px; }
  .results-tabs { overflow-x: auto; scrollbar-width: none; }
  .results-tabs::-webkit-scrollbar { display: none; }
  .results-tab { padding-inline: 6px; font-size: 9px; }
  .results-actions { gap: 2px; }
  .rank-ctrl { width: 25px; height: 25px; }
  .rank-panel.results-pane { width: 100%; max-width: none; max-height: none; flex: 1; }
  .results-dock.collapsed .results-pane.active { display: flex; }
  .results-dock.collapsed .results-tab:not(.active) { display: inline-flex; }
  .results-dock.collapsed #results-view-btn,
  .results-dock.collapsed #results-focus-btn,
  .results-dock.collapsed .results-more { display: inline-flex; }
  .results-dock.collapsed .results-toolbar { border-bottom: 1px solid var(--ui-border); }
  .results-dock.collapsed .results-tab.active { flex: none; pointer-events: auto; }
  .rank-table-wrap table { min-width: 650px; }

  .slider-box { left: 10px; right: 10px; bottom: 10px; transform: none; min-width: 0;
    padding: 8px 10px; }
  .slider-box .timeline-row { display: block; }
  .slider-box .timeline-scale { width: 100%; }
  .slider-box .yr { margin-bottom: 2px; text-align: center; }
  .slider-box input[type=range], .slider-box .ends { width: 100%; }
  .slider-box .pace-ctl { margin-top: 5px; }
  .slider-box .seg button { padding: 4px 10px; }
  .legend { display: none; }
  .maplibregl-ctrl-bottom-right { bottom: 105px; }
  body.mobile-controls-open .slider-box, body.mobile-rank-open .slider-box { display: none; }
  body.mobile-controls-open .app-status, body.mobile-rank-open .app-status { display: none; }
  body.mobile-controls-open .maplibregl-ctrl-bottom-right,
  body.mobile-rank-open .maplibregl-ctrl-bottom-right { display: none; }
  body.detail-open .slider-box { display: none; }
  body.detail-open .maplibregl-ctrl-bottom-right { display: none; }
  body.measure-mode .slider-box { display: none; }
  body.measure-mode .maplibregl-ctrl-bottom-right { bottom: 10px; }
  body.detail-open #panel-stack { right: 10px; }
  #focus-exit { top: 10px; left: 10px; }
  #detail-panel { top: 64px; right: 0; left: 0; bottom: 0; width: auto; height: auto;
    max-height: calc(100vh - 64px); border-radius: 14px 14px 0 0;
    transform: translateY(calc(100% + 12px)); }
  body.detail-open #detail-panel { transform: translateY(0); }
  #detail-body { padding-bottom: 24px; }
  .workspace-overlay { padding: 10px; align-items: stretch; }
  .workspace-modal { width: 100%; max-height: none; }
  .workspace-tools { flex-wrap: wrap; gap: 8px; }
  .workspace-search { min-width: 160px; }
  #markets-summary { width: 100%; }
  #validation-summary { width: 100%; }
  .workspace-table, #compare-body { padding: 0 8px 12px; }
  .workspace-table table:not(.review-table), .compare-table { min-width: 820px; }
  .validation-body,.evidence-body { padding: 10px 8px 14px; }
  .validation-kpis,.validation-history-grid,.evidence-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .evidence-coverage { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .evidence-table { min-width: 980px; }
  #opportunity-evidence-summary { width: 100%; white-space: normal; }
  .release-head { display: block; }
  .release-status { display: inline-block; max-width: none; margin-top: 7px; }
  .release-gates { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .validation-table { min-width: 1100px; }
  .about-modal { width: calc(100vw - 24px); max-width: none; max-height: 88vh; }
  .about-body { font-size: 13px; }
}

@media (min-width: 721px) {
  .map-measure-control { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important;
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body * { visibility: hidden !important; }
  #compare-overlay, #compare-overlay * { visibility: visible !important; }
  #compare-overlay { position: static; display: block !important; padding: 0; background: #fff; }
  #compare-overlay .workspace-modal { width: 100%; max-height: none; box-shadow: none; }
  #compare-close, .compare-tools, .compare-remove { display: none !important; }
  #compare-body { overflow: visible; padding: 0 10px; }
  .compare-table { font-size: 9pt; }
  .compare-table th { position: static; }
  .compare-annotation input, .compare-annotation textarea { border: none; padding: 0; resize: none; }
}
