/* ============================================================
   SC Cargo Pro — UI Shell + Component Overrides
   Loads after tokens.css + styles.css. Wins via load order.
   ============================================================ */

/* ── Variable overrides (ui.css loads last — wins over styles.css :root) ── */
:root {
  --font-ui:   'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Lock panel dimensions — styles.css uses responsive min() which shrinks panels */
  --lpanel-w: 340px;
  --rpanel-w: 420px;
}

/* ── Reinstate [hidden] — overridden by .btn display:flex ───── */
[hidden] { display: none !important; }

/* ── Global theme transitions ──────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  transition-property: background-color, border-color, color, fill, stroke, opacity;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}

/* ── Base typography ────────────────────────────────────────── */
html, body {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-0);
  color: var(--text-1);
  overflow: hidden;
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ──────────────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-0);
  overflow: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  max-height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-2);
  padding: 0;
  gap: 0;
  z-index: 60;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 100%;
  border-right: 1px solid var(--line-2);
  flex-shrink: 0;
  justify-content: flex-start;
}

.topbar-brand-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
}

.topbar-brand-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-brand-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  margin-left: 2px;
  opacity: 0.8;
}

.topbar-brand-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  flex-shrink: 0;
}

.topbar-search {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 0 16px;
  height: 100%;
  min-width: 0;
}

.topbar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 10px;
  height: 28px;
  max-width: 360px;
  width: 100%;
  cursor: text;
}

.topbar-search-box:focus-within {
  border-color: var(--accent-dim);
}

.topbar-search-icon {
  color: var(--text-3);
  display: flex;
  flex-shrink: 0;
}

#sc-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-0);
  font-family: var(--font-ui);
  font-size: 12px;
  width: 100%;
  padding: 0;
}

#sc-search-input::placeholder {
  color: var(--text-3);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.topbar-kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-right: 8px;
  margin-left: auto;
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.topbar-btn:hover {
  background: var(--bg-4);
  border-color: var(--line-2);
  color: var(--text-0);
}

.topbar-btn.active {
  background: var(--accent-tint);
  border-color: var(--accent-dim);
  color: var(--accent);
}

/* ── Workbench ──────────────────────────────────────────────── */
.workbench {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Rail nav ───────────────────────────────────────────────── */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--rail-w);
  min-width: var(--rail-w);
  background: var(--bg-2);
  border-right: 1px solid var(--line-2);
  padding: 4px 0;
  gap: 1px;
  z-index: 20;
  overflow: hidden;
  flex-shrink: 0;
}

.rail-spacer { flex: 1; }

/* Rail buttons — keep .sc-rail-tab class for JS switchTab() compat */
.rail-btn,
.sc-rail-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  gap: 2px;
  padding: 0;
  position: relative;
  transition: all var(--t-fast);
  font-family: var(--font-ui);
}

.rail-btn:hover,
.sc-rail-tab:hover {
  background: var(--bg-4);
  color: var(--text-0);
  border-color: var(--line-2);
}

.rail-btn.active,
.sc-rail-tab.active {
  color: var(--accent);
  background: var(--accent-tint);
  border-color: var(--accent-dim);
}

.rail-btn.active::before,
.sc-rail-tab.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 25%;
  bottom: 25%;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.rail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.rail-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.rail-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--accent);
  color: #000;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Left panel (lpanel) ────────────────────────────────────── */
/* Override styles.css position:absolute + translateX slide animation */
#left-panel {
  display: flex;
  flex-direction: column;
  width: 0;
  min-width: 0;
  max-width: var(--lpanel-w);
  overflow: hidden;
  background: var(--bg-2);
  border-right: 1px solid var(--line-2);
  transition: width var(--t-slow), min-width var(--t-slow);
  z-index: 15;
  flex-shrink: 0;
  /* Reset old absolute positioning */
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  right: auto;
  transform: none !important;
  opacity: 1 !important;
  height: auto;
  /* Reset corner bracket decorations */
}

#left-panel::before,
#left-panel::after { content: none !important; }

#left-panel.open {
  width: var(--lpanel-w) !important;
  min-width: var(--lpanel-w) !important;
  flex: 0 0 var(--lpanel-w) !important;
}

/* app.js adds this when setup options drawer is visible */
#left-panel.setup-options-mode {
  height: auto !important;
  bottom: auto !important;
  overflow-y: visible !important;
  max-height: calc(100% - 12px) !important;
  align-self: flex-start !important;
  margin: 6px 0;
}
#left-panel.setup-options-mode .sc-panel-footer {
  display: none !important;
}
#left-panel.setup-options-mode .sc-panel-body {
  flex: 0 0 auto !important;
}

/* Remove old scanlines and chrome */
.sc-scanlines,
.sc-panel-rail,
.sc-panel-search {
  display: none !important;
}

/* Panel body fills remaining height */
.sc-panel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sc-panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Scrollbar */
.sc-panel-content::-webkit-scrollbar { width: 4px; }
.sc-panel-content::-webkit-scrollbar-track { background: transparent; }
.sc-panel-content::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

/* Panel footer */
.sc-panel-footer {
  border-top: 1px solid var(--line-2);
  background: var(--bg-1);
  padding: 8px;
  flex-shrink: 0;
}

/* ── Tab panels ─────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── fp-section → section ────────────────────────────────────── */
.fp-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-1);
}

.fp-section:last-child { border-bottom: none; }

.fp-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 7px;
}

.fp-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.fp-label-row .fp-label { margin: 0; }

.fp-hint {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 6px 0 0;
  display: block !important;
}

/* ── Map wrap ────────────────────────────────────────────────── */
#map-area,
.map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-0);
}

#starmap {
  display: block;
  width: 100%;
  height: 100%;
}

/* No CSS overlay — map.js handles dark/light backgrounds directly */

/* ── Right panel (rpanel / route panel) ─────────────────────── */
/* Override styles.css position:absolute + translateX slide animation */
#route-panel {
  display: flex;
  flex-direction: column;
  width: 0;
  min-width: 0;
  max-width: var(--rpanel-w);
  overflow: hidden;
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  transition: width var(--t-slow), min-width var(--t-slow);
  z-index: 15;
  flex-shrink: 0;
  /* Reset old absolute positioning */
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  right: auto;
  transform: none !important;
  opacity: 1 !important;
  height: auto;
}

#route-panel::before,
#route-panel::after { content: none !important; }

#route-panel.open {
  width: var(--rpanel-w) !important;
  min-width: var(--rpanel-w) !important;
  flex: 0 0 var(--rpanel-w) !important;
}

/* Show close button (styles.css hides it) */
#route-panel .fp-close { display: flex !important; }

.fp-header {
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 38px;
  min-height: 38px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-1);
  gap: 8px;
  flex-shrink: 0;
}

.rpanel-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
}

.right-tab-btn {
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  padding: 3px 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}

.right-tab-btn:hover { background: var(--bg-4); color: var(--text-0); }
.right-tab-btn.active { background: var(--accent-tint); color: var(--accent); }

.fp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.fp-close:hover { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); }

.right-panel { display: none; overflow-y: auto; flex: 1; }
.right-panel.active { display: flex; flex-direction: column; }
.right-panel::-webkit-scrollbar { width: 4px; }
.right-panel::-webkit-scrollbar-track { background: transparent; }
.right-panel::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }

/* ── Route Hero ──────────────────────────────────────────────── */
.route-hero {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}

.route-hero-copy { margin-bottom: 12px; }

.route-kicker {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-kicker::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.route-headline {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 6px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.route-brief {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
}

/* Projected profit — stacked label + value */
.route-profit-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-1);
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1px;
}

.route-profit-card .metric-label {
  font-size: 8.5px;
  color: var(--text-3);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-0);
}

.metric-value.amber,
.route-profit-value {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--warn) !important;
  line-height: 1.1;
}

.metric-value.blue  { color: var(--info); }
.metric-value.green { color: var(--good); }

/* ── Route metrics — 2-column grid ───────────────────────────── */
.route-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line-2);
}

.route-metrics-primary {
  border-bottom: 1px solid var(--line-2);
}

.metric-box {
  padding: 9px 12px;
  border-right: 1px solid var(--line-1);
  min-width: 0;
}

.metric-box:nth-child(2n) { border-right: none; }
.metric-box:nth-child(3), .metric-box:nth-child(4) {
  border-top: 1px solid var(--line-1);
}

/* ── Route advanced ───────────────────────────────────────────── */
.route-advanced-details {
  border-bottom: 1px solid var(--line-2);
}

.route-advanced-details > summary {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
  padding: 9px 14px;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.route-advanced-details > summary::-webkit-details-marker { display: none; }
.route-advanced-details > summary::after {
  content: '∨';
  font-size: 10px;
  color: var(--text-3);
}
.route-advanced-details[open] > summary::after { content: '∧'; }

.route-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line-1);
  padding-bottom: 4px;
}

.route-advanced-grid .metric-box { padding: 7px 12px; }
.route-advanced-grid .metric-box:nth-child(2n) { border-right: none; }
.route-advanced-grid .metric-box:nth-child(3),
.route-advanced-grid .metric-box:nth-child(4) { border-top: 1px solid var(--line-1); }

/* ── Route actions ────────────────────────────────────────────── */
.route-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}

/* Override styles.css route-run-btn flex-grow that bloats height */
.route-run-btn,
.route-actions .btn-primary {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* Primary "Start Route" button — accent green even when disabled */
.route-actions .btn-primary,
.route-run-btn {
  background: var(--accent) !important;
  color: #000 !important;
  border-color: var(--accent) !important;
}
.route-actions .btn-primary:disabled,
.route-run-btn:disabled {
  background: var(--accent-tint) !important;
  color: var(--accent) !important;
  border-color: var(--accent-dim) !important;
  opacity: 0.75 !important;
}
.route-actions .btn-primary:not(:disabled):hover,
.route-run-btn:not(:disabled):hover {
  background: var(--accent-hi) !important;
  border-color: var(--accent-hi) !important;
}

/* Secondary action row: smaller ghost buttons */
.route-actions-secondary {
  display: flex;
  gap: 6px;
}

.route-actions-secondary .btn {
  flex: 1;
  font-size: 11px;
  padding: 5px 6px;
}

/* ── Route focus / next ───────────────────────────────────────── */
.route-focus-grid {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
}

.route-focus-card {
  background: var(--bg-3);
  border: 1px solid var(--accent-dim);
  border-radius: var(--r-md);
  padding: 10px 12px;
}

.route-focus-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.route-focus-title {
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 3px;
  font-size: 13px;
}

.route-focus-copy {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── AI analysis ─────────────────────────────────────────────── */
.ai-analysis-box {
  margin: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 10px;
  display: none;
}

.ai-analysis-box.visible { display: block; }

.analysis-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.analysis-text {
  font-size: 12px;
  color: var(--text-1);
  line-height: 1.6;
}

/* ── Timeline section header ─────────────────────────────────── */
.route-section-head {
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--line-1);
}

.route-section-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1px;
}

.route-section-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-0);
}

.route-section-copy {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Route timeline ──────────────────────────────────────────── */
#routeDetails {
  padding: 8px 0;
}

/* Timeline items rendered by app.js */
.tl-item {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  position: relative;
}

.tl-item + .tl-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  width: 1px;
  height: 8px;
  background: var(--line-2);
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 2px solid var(--line-3);
  flex-shrink: 0;
  margin-top: 2px;
}

.tl-dot.pickup { border-color: var(--accent); background: var(--accent-tint); }
.tl-dot.dropoff { border-color: var(--warn); background: var(--warn-tint); }
.tl-dot.current { border-color: var(--info); background: var(--info); }

.tl-body { flex: 1; min-width: 0; }

.tl-kicker {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1px;
}

.tl-title {
  font-weight: 600;
  color: var(--text-0);
  font-size: 12px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-meta {
  font-size: 11px;
  color: var(--text-2);
}

.tl-cargo {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-top: 2px;
}

/* ============================================================
   BOTTOM BAR — Flat single-row layout
   Height stays fixed at --botbar-h for every state (idle, ready,
   calculating, guided). Content adapts inline; no nested boxes.
   Sections auto-hide when empty so the row never looks padded-out.
   ============================================================ */

#bottom-bar {
  display: flex;
  align-items: stretch;
  height: var(--botbar-h);
  min-height: var(--botbar-h);
  max-height: var(--botbar-h);
  background: var(--bg-1);
  border-top: 1px solid var(--line-2);
  padding: 0;
  gap: 0;
  z-index: 50;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
/* Guided mode — keep bar compact; pills fit inline at 56px. */
#bottom-bar.route-dock-guided {
  height: var(--botbar-h);
  min-height: var(--botbar-h);
  max-height: var(--botbar-h);
}

.botbar-divider {
  width: 1px;
  align-self: center;
  height: 24px;
  background: var(--line-2);
  flex-shrink: 0;
  margin: 0;
}

/* ── LEFT: ship/route summary ─────────────────────────────────── */
.sc-bar-ship {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 14px;
  height: 100%;
  border-right: 1px solid var(--line-2);
  background: transparent;
}
.sc-bar-tab { display: none !important; }
.sc-bar-route-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  height: 100%;
  padding: 0;
}
.sc-bar-route-kicker {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
  white-space: nowrap;
}
.sc-bar-route-kicker:empty { display: none; }
.sc-bar-route-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: 0.1px;
  line-height: 1.2;
  white-space: nowrap;
}
.sc-bar-route-copy { display: none; }
.sc-bar-route-meta {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.sc-bar-route-meta:empty { display: none; }

/* ── CENTER: flat dock (kicker + copy + pills + next-stop inline) ─── */
.sc-bar-tabs {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.bottom-route-dock {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 0 14px;
  min-width: 0;
}

.bottom-route-dock-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: 360px;
  flex: 0 1 auto;
  gap: 2px;
  height: 100%;
}
/* Guided mode already shows step/location/progress in the left summary —
   hide the dock's duplicate kicker+copy to free space for pills and Next Stop. */
.bottom-route-dock.is-guided .bottom-route-dock-main {
  display: none;
}
.bottom-route-dock-kicker {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
  white-space: nowrap;
}
.bottom-route-dock-kicker:empty { display: none; }
.bottom-route-dock-copy {
  font-size: 11px;
  color: var(--text-1);
  line-height: 1.3;
  white-space: normal;
}
.bottom-route-dock-copy:empty { display: none; }

.bottom-route-dock-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
}
.bottom-route-dock-actions:empty { display: none; }

.bottom-route-dock-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  margin-left: auto;
}
.bottom-route-dock-meta:empty { display: none; }
.bottom-route-dock.is-guided .bottom-route-dock-meta {
  display: none;
}

/* ── PICKUP / DROP-OFF GROUPS — inline, no card backgrounds ─── */
.bottom-route-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.bottom-route-group-pickup { color: var(--accent); }
.bottom-route-group-dropoff { color: var(--bad); }
.bottom-route-group-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: currentColor;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.88;
  position: relative;
  padding-left: 10px;
}
.bottom-route-group-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}
.bottom-route-group-list {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  padding-bottom: 2px;
}
.bottom-route-group-list::-webkit-scrollbar { height: 3px; }
.bottom-route-group-list::-webkit-scrollbar-thumb { background: var(--line-3); border-radius: 2px; }
.bottom-route-group-empty {
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: italic;
  color: var(--text-3);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

/* Pills — inline chips with a real checkbox indicator */
.bottom-route-task {
  appearance: none;
  border: 1px solid currentColor;
  background: transparent;
  color: var(--text-0);
  padding: 3px 9px 3px 6px;
  border-radius: 11px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  position: relative;
  line-height: 1;
}
.bottom-route-task-pickup { color: var(--accent); border-color: var(--accent-dim); }
.bottom-route-task-dropoff { color: var(--bad); border-color: rgba(224, 74, 74, 0.35); }
.bottom-route-task::before {
  content: '';
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 2.5px;
  flex-shrink: 0;
  background: transparent;
  transition: background 0.12s, opacity 0.12s, border-color 0.12s;
  opacity: 0.6;
}
.bottom-route-task:hover { background: var(--bg-3); }
.bottom-route-task-pickup:hover { background: var(--accent-tint); }
.bottom-route-task-dropoff:hover { background: var(--bad-tint); }
.bottom-route-task.is-complete {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}
.bottom-route-task.is-complete::before {
  /* Tick is embedded as SVG background — always centred inside the box
     regardless of how padding is scaled by fitRoutePanelChecklist */
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.5l2.5 2.5 4-5' stroke='%2302040a' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 9px 9px no-repeat;
  opacity: 1;
  border-color: var(--accent);
}
/* No separate ::after tick needed — it lives inside ::before now */
.bottom-route-task.is-complete::after { content: none; }
.bottom-route-task-title {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  color: inherit;
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.bottom-route-task-detail { display: none; }

/* Next-stop card — accent-outlined inline pill on the right */
.bottom-route-nav-stack {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
/* Next-stop card — made prominent with stronger border + arrow affordance */
.bottom-route-stop-card {
  appearance: none;
  border: 1px solid var(--line-3);
  background: var(--bg-3);
  font: inherit;
  padding: 6px 14px 6px 12px;
  border-radius: var(--r-sm);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  color: var(--text-1);
  cursor: default;
  min-width: 160px;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
  position: relative;
}
.bottom-route-stop-card::after {
  content: '›';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
  opacity: 0.55;
  transition: transform 0.12s, opacity 0.12s;
}
.bottom-route-stop-card-previous { display: none !important; }
.bottom-route-stop-card-next.is-actionable {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent-dim) inset;
}
.bottom-route-stop-card-next.is-actionable::after { opacity: 1; }
.bottom-route-stop-card-next.is-actionable:hover {
  background: var(--accent);
  color: #000;
  transform: translateX(-1px);
}
.bottom-route-stop-card-next.is-actionable:hover::after {
  transform: translateY(-50%) translateX(2px);
}
.bottom-route-stop-card-next.is-locked {
  opacity: 0.75;
  border-color: var(--line-3);
  background: var(--bg-3);
  color: var(--text-2);
}
.bottom-route-stop-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.85;
  white-space: nowrap;
}
.bottom-route-stop-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  padding-right: 14px; /* leave room for the chevron */
}
.bottom-route-stop-copy { display: none; }

/* ── CENTER-RIGHT: status + progress (shown during calculation) ─── */
#bottom-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 14px;
  height: 100%;
  border-left: 1px solid var(--line-2);
}
.botbar-status-text {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.progress-bar-wrap {
  flex: 1 1 auto;
  height: 3px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
  max-width: 110px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.15s linear;
}
.calc-stats {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-3);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ── RIGHT: keyboard shortcuts ─── */
.sc-bar-shortcuts {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 14px;
  height: 100%;
  border-left: 1px solid var(--line-2);
}
.sc-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.sc-shortcut kbd {
  background: var(--bg-4);
  border: 1px solid var(--line-3);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-2);
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

#sc-status-marquee {
  transform: none !important;
  animation: none !important;
  display: inline;
}

/* ── Map HUD overrides ───────────────────────────────────────── */

/* Hide old status bar (the one floating on the map) */
#sc-status-bar { display: none !important; }

/* Hide old theme toggle (we have one in topbar now) */
#theme-toggle { display: none !important; }

/* Map tools (top-right) — vertical stack */
.sc-map-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 25;
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 4px;
}

[data-theme="light"] .sc-map-icons {
  background: rgba(255, 255, 255, 0.80);
}

.sc-map-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: var(--text-1);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--t-fast);
}

.sc-map-icon-btn:hover {
  background: var(--accent-tint);
  color: var(--accent);
}

.sc-map-icon-btn svg { pointer-events: none; }

/* System selector — bottom-right corner of the map */
#system-selector {
  position: absolute;
  bottom: 12px;
  right: 12px;
  left: auto;
  transform: none;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0;
}

[data-theme="light"] #system-selector {
  background: transparent;
}

/* Map legend — per-type label toggles */
.map-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(10, 12, 16, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  min-width: 172px;
  box-shadow: var(--shadow-panel);
}

[data-theme="light"] .map-legend {
  background: rgba(255, 255, 255, 0.88);
}

.legend-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 10px;
}

.legend-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.legend-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}

.legend-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

[data-theme="light"] .legend-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}

.legend-toggle.active {
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-2);
}

[data-theme="light"] .legend-toggle.active {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--line-2);
}

.legend-toggle:not(.active) {
  opacity: 0.45;
}

.legend-toggle:not(.active) .legend-dot {
  filter: grayscale(0.7);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
}

.legend-label {
  flex: 1;
}

.legend-hide-all {
  display: block;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.legend-hide-all:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-0);
  border-color: var(--accent-dim);
}

[data-theme="light"] .legend-hide-all:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Legacy .legend-item kept for compatibility with older snippets */
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--text-1);
  margin-bottom: 3px;
}

.legend-item:last-child { margin-bottom: 0; }

/* Map tooltip */
#map-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 17, 22, 0.90);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line-3);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--text-0);
  z-index: 20;
  white-space: nowrap;
}

[data-theme="light"] #map-tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-0);
}

.tt-type {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-2);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Map search overlay */
#map-search-overlay {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--bg-1);
  border: 1px solid var(--line-3);
  border-radius: var(--r-md);
  padding: 8px;
  min-width: 320px;
  box-shadow: var(--shadow-panel);
  display: none;
}

#map-search-overlay.visible { display: block; }

#map-search-overlay input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-0);
  outline: none;
  margin-bottom: 4px;
}

#search-results-list {
  max-height: 240px;
  overflow-y: auto;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
  background: var(--bg-4);
  color: var(--text-1);
  line-height: 1.2;
}

.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(0.97); }

.btn.primary,
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

.btn.primary:hover,
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.btn.ghost,
.btn-ghost {
  background: transparent;
  border-color: var(--line-3);
  color: var(--text-1);
}

.btn.ghost:hover,
.btn-ghost:hover { background: var(--bg-4); border-color: var(--line-3); color: var(--text-0); }

.btn.danger,
.btn-danger {
  background: var(--bad-tint);
  border-color: var(--bad);
  color: var(--bad);
}

.btn.danger:hover,
.btn-danger:hover { background: var(--bad); color: #fff; }

.btn.sm, .btn-sm { padding: 3px 8px; font-size: 11px; }
.btn.full, .btn-full { width: 100%; }
.btn.icon-only, .btn-icon { padding: 4px; width: 26px; height: 26px; }

/* AI button */
.btn-ai {
  background: var(--accent-tint);
  border-color: var(--accent-dim);
  color: var(--accent);
}
.btn-ai:hover { background: var(--accent); color: #000; border-color: var(--accent); }

/* btn-row helper */
.btn-row { display: flex; gap: 6px; }

/* SC route button (panel footer) */
.sc-route-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 36px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--t-fast);
}

.sc-route-btn:hover:not(:disabled) { background: var(--accent-hi); }
.sc-route-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sc-route-btn:active:not(:disabled) { transform: scale(0.98); }

.sc-route-icon { font-size: 14px; }

/* ── Form inputs ─────────────────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-0);
  outline: none;
  width: 100%;
  transition: border-color var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

input::placeholder, select option { color: var(--text-3); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-dim);
  background: var(--bg-4);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237c8797'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

/* ── Route mode cards (priority selector) ─────────────────────── */
.route-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.route-mode-card {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 8px 9px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.route-mode-card:hover { border-color: var(--line-3); background: var(--bg-4); }

.route-mode-card input[type="radio"] {
  display: none;
}

.route-mode-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.route-mode-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 2px;
}

.route-mode-copy {
  display: block;
  font-size: 10px;
  color: var(--text-2);
  line-height: 1.4;
}

/* ── Mission list ────────────────────────────────────────────── */
.mission-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.empty-state,
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  gap: 6px;
}

.empty-icon { font-size: 20px; opacity: 0.5; }

/* ── Scanner ─────────────────────────────────────────────────── */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--line-3);
  border-radius: var(--r-md);
  padding: 20px;
  cursor: pointer;
  transition: all var(--t-fast);
  background: var(--bg-3);
  gap: 5px;
  text-align: center;
}

.drop-zone:hover {
  border-color: var(--accent-dim);
  background: var(--accent-tint);
}

.dz-icon { font-size: 22px; color: var(--text-3); margin-bottom: 4px; }
.dz-text { font-size: 12px; font-weight: 500; color: var(--text-1); }
.dz-sub  { font-size: 10px; color: var(--text-3); }

.preview-image {
  display: block;
  max-width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  margin-top: 8px;
}

.scanner-log {
  background: var(--bg-0);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
  line-height: 1.6;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
}

/* ── AI Chat ─────────────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-msg {
  background: var(--bg-3);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-1);
  line-height: 1.5;
}

.chat-msg.user { background: var(--accent-tint); border: 1px solid var(--accent-dim); }

.msg-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}

.chat-msg.user .msg-label { color: var(--accent); }

.chat-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chat-input-row input { flex: 1; }

/* ── AI key row ───────────────────────────────────────────────── */
.ai-key-row { display: flex; gap: 6px; align-items: center; }
.ai-key-row input { flex: 1; }

/* ── GA settings (hidden store restyle) ──────────────────────── */
.algo-hidden-store {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ── Prices status ───────────────────────────────────────────── */
.prices-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.price-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}

.price-dot.online { background: var(--good); }
.price-dot.offline { background: var(--bad); }

/* ── Ship info readout ───────────────────────────────────────── */
.ship-info {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-2);
}

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible { display: flex; }

/* Graph + entity tree overlays use id-based display logic in JS */
#graph-modal,
#entity-tree-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

#graph-modal.visible,
#entity-tree-modal.visible { display: flex; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--line-3);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-1);
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-0);
  margin: 0;
}

.modal-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--t-fast);
}

.modal-close-btn:hover { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); }

.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; }

/* Graph modal specifics */
.graph-modal { width: 560px; max-width: 95vw; }
.graph-modal-copy { font-size: 11px; color: var(--text-2); margin-bottom: 12px; }
.graph-frame canvas { display: block; max-width: 100%; border-radius: var(--r-sm); }

/* Entity tree modal */
.entity-tree-modal {
  width: 820px;
  max-width: 95vw;
  height: min(80vh, 700px);
}

.entity-tree-layout { display: flex; gap: 0; height: 100%; padding: 0; }

.entity-tree-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border-right: 1px solid var(--line-2);
}

.entity-tree-toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.entity-tree-toolbar-copy {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.entity-tree-toolbar-actions { display: flex; gap: 6px; }

.entity-tree-search {
  font-size: 12px;
  padding: 5px 8px;
}

.entity-tree-root {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.entity-tree-details {
  width: 240px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px;
  font-size: 12px;
  color: var(--text-1);
}

/* ── Toast system ────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: calc(var(--botbar-h) + 10px);
  right: 14px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-3);
  border-left-width: 3px;
  border-radius: var(--r-md);
  padding: 8px 12px;
  box-shadow: var(--shadow-panel);
  min-width: 220px;
  max-width: 340px;
  pointer-events: auto;
  animation: toastIn 0.22s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

.toast.success { border-left-color: var(--good); }
.toast.error   { border-left-color: var(--bad); }
.toast.warn    { border-left-color: var(--warn); }
.toast.info    { border-left-color: var(--info); }

.toast-icon { font-size: 13px; flex-shrink: 0; padding-top: 1px; }
.toast.success .toast-icon { color: var(--good); }
.toast.error   .toast-icon { color: var(--bad); }
.toast.warn    .toast-icon { color: var(--warn); }
.toast.info    .toast-icon { color: var(--info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 12px; color: var(--text-0); margin-bottom: 1px; }
.toast-msg   { font-size: 11px; color: var(--text-2); line-height: 1.4; }

/* ── POI info panel ──────────────────────────────────────────── */
#sc-poi-info {
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
}

.sc-poi-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sc-poi-icon {
  font-size: 20px;
  color: var(--accent);
}

.sc-poi-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-0);
}

.sc-poi-type {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sc-poi-section-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 3px;
}

.sc-poi-jurisdiction {
  font-size: 12px;
  color: var(--text-1);
  margin-bottom: 6px;
}

.sc-poi-desc {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Route history ─────────────────────────────────────────────── */
#route-history-list { padding: 8px; }

.history-card {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px;
  margin-bottom: 6px;
  transition: border-color var(--t-fast);
}

.history-card:hover { border-color: var(--line-3); }

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.history-date {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-2);
}

.history-actions { display: flex; gap: 4px; }

.history-stats {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

/* ── Ship search picker ───────────────────────────────────────── */
.ship-search-picker {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: 4px;
}

.ship-search-head {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-1);
}

.ship-search-helper {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#shipSearchInput {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--line-1);
}

.ship-search-results { max-height: 180px; overflow-y: auto; }

.ship-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-1);
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
  gap: 8px;
}

.ship-search-result:last-child { border-bottom: none; }
.ship-search-result:hover { background: var(--bg-4); }
.ship-search-result.active { background: var(--accent-tint); }

.ship-search-result-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.ship-search-result-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ship-search-result-meta {
  font-size: 10px;
  color: var(--text-2);
}

.ship-search-result-cargo {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.ship-search-empty {
  padding: 12px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

/* ── Start location picker ────────────────────────────────────── */
.start-location-system-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.start-location-system-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-4);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 10px;
  font-family: var(--font-ui);
  cursor: pointer;
  color: var(--text-1);
  transition: all var(--t-fast);
}

.start-location-system-tab.active {
  background: var(--accent-tint);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.start-location-system-tab-count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
  background: var(--bg-3);
  border-radius: 6px;
  padding: 0 4px;
}

.start-location-selected {
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.start-location-selected.empty {
  background: transparent;
  border-color: var(--line-1);
}

.start-location-selected-empty { font-size: 11px; color: var(--text-3); }
.start-location-selected-label { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.start-location-selected-name  { font-size: 12px; font-weight: 600; color: var(--text-0); }
.start-location-selected-meta  { font-size: 10px; color: var(--text-2); margin-top: 1px; }

.start-location-list { max-height: 280px; overflow-y: auto; }

.start-location-body-card {
  border-bottom: 1px solid var(--line-1);
}

.start-location-body-card.nested { margin-left: 8px; }

.start-location-body-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 12px;
  color: var(--text-1);
}

.start-location-body-summary::-webkit-details-marker { display: none; }

.start-location-body-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.start-location-body-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.start-location-body-name { font-weight: 500; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-location-body-meta { font-size: 9.5px; color: var(--text-2); }
.start-location-body-count { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); flex-shrink: 0; }

.start-location-body-content { padding-bottom: 4px; }

.start-location-subgroup { margin-bottom: 4px; }
.start-location-subgroup-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 4px 12px 2px; }

.start-location-action-list { display: flex; flex-direction: column; }

.start-location-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 11.5px;
  color: var(--text-1);
  transition: background var(--t-fast);
}

.start-location-action:hover { background: var(--bg-4); }
.start-location-action.active { background: var(--accent-tint); color: var(--accent); }

.start-location-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.start-location-action-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.start-location-action-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.start-location-action-meta { font-size: 9.5px; color: var(--text-2); }
.start-location-action-type { font-family: var(--font-mono); font-size: 8.5px; color: var(--text-3); flex-shrink: 0; }

.start-location-empty { padding: 12px; font-size: 11px; color: var(--text-3); text-align: center; }

.start-location-section { margin-bottom: 6px; }
.start-location-section-header { padding: 6px 8px 2px; }
.start-location-section-title { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); font-weight: 600; }
.start-location-section-copy  { font-size: 10px; color: var(--text-3); margin-top: 1px; }

/* Route tools menu */
.route-tools-menu { position: relative; }
.route-tools-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}
.route-tools-menu > summary::-webkit-details-marker,
.route-tools-menu > summary::marker { display: none; content: ''; }
.route-tools-menu[open] > summary {
  background: var(--bg-4);
  border-color: var(--line-3);
  color: var(--text-0);
}

.route-tools-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-2);
  border: 1px solid var(--line-3);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-panel);
  padding: 6px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}

.route-tools-popover .btn {
  justify-content: flex-start;
  height: 30px;
  min-height: 30px;
}


/* ── Setup Options Drawer ────────────────────────────────────── */
.setup-options-drawer {
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.setup-options-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  border: none;
  background: transparent;
}

.setup-options-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setup-options-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-0);
  letter-spacing: 0.02em;
  line-height: 1.12;
  margin: 0;
  text-transform: uppercase;
}
.setup-options-title span { color: var(--accent); }

.setup-options-description {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 2px;
}

/* Progress bar */
.setup-options-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setup-options-progress-track {
  height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.setup-options-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 2px;
  transition: width 0.28s ease;
  box-shadow: 0 0 8px rgba(33,198,155,0.35);
}
.setup-options-progress-fill.is-complete {
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  box-shadow: 0 0 10px rgba(33,198,155,0.5);
}
.setup-options-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-options-progress-percent {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Step cards */
.setup-options-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setup-options-step-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.setup-options-step-card:hover {
  background: var(--bg-4);
  border-color: var(--line-3);
  transform: translateX(1px);
}
.setup-options-step-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.setup-options-step-card.is-complete {
  border-color: var(--accent-dim);
  background: var(--accent-tint);
}
.setup-options-step-index {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.setup-options-step-card.is-complete .setup-options-step-index {
  background: var(--accent);
  color: #02040a;
  border-color: var(--accent);
}
.setup-options-step-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.setup-options-step-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-options-step-value {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setup-options-step-card.is-complete .setup-options-step-value {
  color: var(--text-0);
  font-weight: 500;
}
.setup-options-step-chevron {
  font-size: 18px;
  color: var(--text-3);
  line-height: 1;
  transition: transform var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.setup-options-step-card:hover .setup-options-step-chevron {
  color: var(--accent);
  transform: translateX(2px);
}
.setup-options-step-card.is-complete .setup-options-step-chevron {
  color: var(--accent);
}

/* Start-a-new-run button (above the step list) */
.setup-options-new-run {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  border: 1px dashed var(--line-3);
  border-radius: var(--r-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  color: var(--text-1);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.setup-options-new-run:hover {
  background: var(--bg-4);
  border-color: var(--accent-dim);
  color: var(--text-0);
}
.setup-options-new-run:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.setup-options-new-run-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--accent);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  flex-shrink: 0;
}
.setup-options-new-run:hover .setup-options-new-run-icon {
  border-color: var(--accent-dim);
}
.setup-options-new-run-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.setup-options-new-run-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.setup-options-new-run-sub {
  font-size: 10.5px;
  color: var(--text-2);
  line-height: 1.3;
}

/* Smart CTA */
.setup-options-cta {
  margin-top: 2px;
  border-radius: var(--r-md);
  height: 44px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  border-color: var(--accent);
  color: #02040a;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.setup-options-cta:hover:not(:disabled) {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(33,198,155,0.28);
}
.setup-options-cta::after,
.setup-options-cta::before { content: none !important; }
.setup-options-cta.is-calculate {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent-hi);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25), 0 0 24px rgba(33,198,155,0.18);
}
.setup-options-cta.is-calculate:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(33,198,155,0.45);
}
.setup-options-cta.is-calculate .setup-options-cta-label::before {
  content: '▶';
  margin-right: 8px;
  font-size: 9px;
  vertical-align: 1px;
  color: #02040a;
  opacity: 0.8;
}
.setup-options-cta-label {
  font-family: var(--font-ui);
  font-weight: 700;
}

/* Footer — quiet reset link */
.setup-options-footer {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  border-top: 1px dashed var(--line-1);
}
.setup-options-reset-btn {
  width: auto !important;
  background: transparent !important;
  border-color: transparent !important;
  color: var(--text-3) !important;
  font-size: 10px !important;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px !important;
  height: auto !important;
  transition: color var(--t-fast), background var(--t-fast);
}
.setup-options-reset-btn:hover:not(:disabled) {
  color: var(--bad) !important;
  background: rgba(224,74,74,0.08) !important;
}
.setup-options-footer .btn:hover {
  background: transparent !important;
}

/* Setup options mode (panel shows drawer) */
#left-panel.setup-options-mode .sc-panel-content { overflow-y: auto; }

/* Rail tab icons (app.js injects sc-nav-icon) */
.sc-nav-icon { display: flex; align-items: center; justify-content: center; }
.sc-nav-icon-rail svg { width: 18px; height: 18px; }
.sc-nav-icon-bar svg { width: 14px; height: 14px; }

.sc-rail-tab-text {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 1px;
}

/* Pull tabs (app.js creates these inside #map-area) — persistent labeled handles */
#left-panel-pull-tab,
#route-panel-pull-tab {
  position: absolute;
  top: 50%;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-height: 120px;
  padding: 10px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  opacity: 0.92;
  transition: opacity var(--t-fast), background var(--t-fast), border-color var(--t-fast), left var(--t-mid), right var(--t-mid), color var(--t-fast);
  font-family: var(--font-mono);
  color: var(--text-1);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

/* Remove legacy grip-dots pseudo element */
#left-panel-pull-tab::before,
#route-panel-pull-tab::before { content: none; }

#left-panel-pull-tab { left: 0; border-left: none; border-radius: 0 var(--r-md) var(--r-md) 0; }
#route-panel-pull-tab { right: 0; left: auto; border-right: none; border-radius: var(--r-md) 0 0 var(--r-md); }
/* Panels are relative flex children, so the tab naturally shifts with the panel's edge. */

#left-panel-pull-tab:hover,
#route-panel-pull-tab:hover {
  opacity: 1;
  background: var(--bg-3);
  border-color: var(--accent-dim);
  color: var(--accent-hi);
}

/* Vertical label reads along the spine of the tab */
#left-panel-pull-tab .panel-pull-tab-label,
#route-panel-pull-tab .panel-pull-tab-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1;
  white-space: nowrap;
  font-variant: normal;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  pointer-events: auto;
  opacity: 1;
}

#left-panel-pull-tab.is-open .panel-pull-tab-label,
#route-panel-pull-tab.is-open .panel-pull-tab-label {
  color: var(--accent);
}

/* Setup flow sections — app.js adds collapsible behavior */
.fp-section-collapsible { }

.fp-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  transition: color var(--t-fast);
  gap: 8px;
}

.fp-section-toggle:hover { color: var(--text-0); }
.fp-section-toggle-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.fp-section-toggle-kicker { font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.fp-section-toggle-title { font-size: 12px; font-weight: 600; color: var(--text-0); }
.fp-section-toggle-summary { font-size: 10px; color: var(--accent); flex-shrink: 0; }
.fp-section-toggle-icon { font-size: 14px; color: var(--text-2); flex-shrink: 0; }

.fp-section-content { padding: 4px 0 8px; }
.fp-section.collapsed .fp-section-content { display: none; }
.fp-section.collapsed .fp-section-toggle-icon { content: '＋'; }

.fp-section-hidden { display: none !important; }
.fp-label-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Setup flow modal — compact sidebar step cards */
.setup-flow-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  margin-bottom: 0;
}
.setup-flow-step::after {
  content: '›';
  font-size: 16px;
  color: var(--text-3);
  line-height: 1;
  transition: color var(--t-fast), transform var(--t-fast);
}
.setup-flow-step:hover {
  background: var(--bg-4);
  border-color: var(--line-3);
  transform: translateX(1px);
}
.setup-flow-step:hover::after {
  color: var(--accent);
  transform: translateX(2px);
}
.setup-flow-step.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}
.setup-flow-step.active::after { color: var(--accent); }
.setup-flow-step.is-complete {
  border-color: var(--accent-dim);
}
.setup-flow-step.is-complete::after {
  content: '✓';
  font-size: 11px;
  color: var(--good);
}
.setup-flow-step-index {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
}
.setup-flow-step.active .setup-flow-step-index {
  color: var(--accent);
  border-color: var(--accent);
}
.setup-flow-step.is-complete .setup-flow-step-index {
  background: var(--accent);
  color: #02040a;
  border-color: var(--accent);
}
.setup-flow-step-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.setup-flow-step-title {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-0);
  line-height: 1.2;
}

/* Mission intake merged UI */
.mission-intake-drop-zone { margin-bottom: 8px; }
.mission-intake-actions { display: flex; gap: 6px; margin: 8px 0; }
.mission-intake-action { flex: 1; }

/* Comparison table ─────────────────────────────────────────── */
.compare-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.compare-table th, .compare-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-1); text-align: left; }
.compare-table th { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); background: var(--bg-3); }
.compare-table .highlight-better { color: var(--good); font-weight: 600; }

/* ── About / Disclaimer modal ────────────────────────────────── */
.modal.about-modal {
  width: min(480px, calc(100vw - 40px));
  max-width: min(480px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
}
.about-modal-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px;
}
.about-modal-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.about-modal-title {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.about-modal-version {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.about-modal-copy {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.6;
  margin: 0;
}
.about-modal-copy-muted {
  color: var(--text-2);
  font-size: 11.5px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-1);
  margin-top: 4px;
}

/* ── Scrollbar polish (global) ───────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Mobile responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    /* Panel widths kept fixed — panels slide over on narrow viewports instead */
    --rail-w: 44px;
  }

  .topbar-brand-name { display: none; }
  .sc-bar-shortcuts { display: none; }

  #left-panel.open { position: absolute; top: 0; left: var(--rail-w); height: 100%; z-index: 30; box-shadow: var(--shadow-panel); }
  #route-panel.open { position: absolute; top: 0; right: 0; height: 100%; z-index: 30; box-shadow: var(--shadow-panel); }
}

@media (max-width: 480px) {
  :root { --topbar-h: 46px; }

  .topbar-search { display: none; }
  .rail { width: 44px; min-width: 44px; }
  .rail-label { display: none; }

  .modal { max-width: 95vw; }
  .entity-tree-modal { flex-direction: column; height: 85vh; }
  .entity-tree-panel { border-right: none; border-bottom: 1px solid var(--line-2); }
  .entity-tree-details { width: 100%; border-top: 1px solid var(--line-2); }
}

/* ── Route mode fallback (no :has() support) ──────────────────── */
@supports not selector(:has(*)) {
  .route-mode-card input[type="radio"]:checked + .route-mode-title {
    color: var(--accent);
  }
}

/* ── Remove old decorative elements ──────────────────────────── */
/* scanlines and corner brackets already suppressed; keep marquee DOM for JS compat */

/* ── Setup flow helpers (used by ui.js renderLocationSearchPicker) */
.location-search-picker { margin-bottom: 4px; }
.location-search-input { margin-bottom: 4px; }
.location-search-system-tabs { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.location-search-selected { margin-bottom: 4px; }
.location-search-results { max-height: 220px; overflow-y: auto; }
.setup-flow-empty { padding: 10px; font-size: 11px; color: var(--text-3); text-align: center; }

.setup-flow-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-1);
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-ui);
  transition: background var(--t-fast);
  gap: 8px;
}

.setup-flow-result-card:hover { background: var(--bg-4); }
.setup-flow-result-card.active { background: var(--accent-tint); }

.setup-flow-result-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.setup-flow-result-title { font-size: 12px; font-weight: 500; color: var(--text-0); }
.setup-flow-result-meta  { font-size: 10px; color: var(--text-2); }
.setup-flow-result-pill  { font-size: 9px; font-family: var(--font-mono); color: var(--text-3); background: var(--bg-4); border-radius: 8px; padding: 1px 6px; flex-shrink: 0; }

/* ── Badge count ─────────────────────────────────────────────── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--accent);
  color: #000;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

/* ── Cargo row in missions ────────────────────────────────────── */
.cargo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line-1);
  font-size: 12px;
}

.cargo-row:last-child { border-bottom: none; }
.location-entry { font-size: 12px; color: var(--text-1); }

/* ── GA algo hidden store — position fix ─────────────────────── */
#route-search-launcher-data {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

/* ── RIGHT PANEL — guided stop checklist (moved from bottom bar) ─── */
#routeDetails {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.route-panel-checklist {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.route-panel-checklist-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.route-panel-checklist-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.route-panel-checklist-title {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.2;
}
.route-panel-checklist-copy {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.5;
}
.route-panel-checklist-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.route-panel-checklist-actions .bottom-route-group {
  overflow: hidden;
  min-height: 0;
}
.route-panel-checklist-actions .bottom-route-group-list {
  flex-wrap: wrap;
  overflow: hidden !important;
  max-height: none !important;
}
.route-panel-checklist-actions .bottom-route-stop-card {
  margin-top: auto !important;
}
.route-panel-checklist-actions .bottom-route-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.route-panel-checklist-actions .bottom-route-group-label {
  padding-left: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
}
.route-panel-checklist-actions .bottom-route-group-label::before {
  width: 8px;
  height: 8px;
}
.route-panel-checklist-actions .bottom-route-group-list {
  flex-wrap: wrap;
  gap: 8px;
}
.route-panel-checklist-actions .bottom-route-group-empty {
  font-size: 11px;
  padding: 10px 14px;
  border: 1px dashed var(--line-3);
  border-radius: var(--r-md);
  text-align: center;
}
.route-panel-checklist-actions .bottom-route-task {
  padding: 10px 16px 10px 14px;
  border-radius: 24px;
  border-width: 1.5px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  gap: 10px;
  min-height: 42px;
  width: auto;
  cursor: pointer;
  align-items: center;
}
.route-panel-checklist-actions .bottom-route-task::before {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-radius: 3px;
}
.route-panel-checklist-actions .bottom-route-task.is-complete::after {
  left: 13.5px;
  width: 4px;
  height: 8px;
  border-width: 0 2px 2px 0;
}
.route-panel-checklist-actions .bottom-route-task-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.25;
  flex: 0 0 auto;
}
.route-panel-checklist-actions .bottom-route-stop-card {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 12px 32px 12px 14px;
}
.route-panel-checklist-actions .bottom-route-stop-title {
  font-size: 14px;
}

/* Transit / interstellar step — wormhole glyph replaces pickups/dropoffs */
.route-panel-checklist-actions.is-transit {
  align-items: center;
  gap: 14px;
}
.route-transit-wormhole {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 0 2px;
}
.wormhole-svg {
  width: 120px;
  height: 120px;
  display: block;
  filter: drop-shadow(0 0 18px rgba(0, 210, 155, 0.5));
  transform-origin: 60px 60px;
  animation: wormhole-rotate 9s linear infinite;
}
.wormhole-core {
  animation: wormhole-pulse 2.6s ease-in-out infinite;
  transform-origin: 60px 60px;
}
/* ── 8-arm vortex glyph ──────────────────────────────────── */
.whirl-arm {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
}
/* Arms fade in opacity + thin out so the vortex reads as spinning depth */
.whirl-arm.w1 { stroke-width: 3.8; opacity: 1.00; }
.whirl-arm.w2 { stroke-width: 3.4; opacity: 0.84; }
.whirl-arm.w3 { stroke-width: 3.0; opacity: 0.68; }
.whirl-arm.w4 { stroke-width: 2.6; opacity: 0.52; }
.whirl-arm.w5 { stroke-width: 2.2; opacity: 0.38; }
.whirl-arm.w6 { stroke-width: 1.8; opacity: 0.26; }
.whirl-arm.w7 { stroke-width: 1.4; opacity: 0.15; }
.whirl-arm.w8 { stroke-width: 1.0; opacity: 0.07; }
.route-transit-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
}
@keyframes wormhole-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes wormhole-swirl {
  from { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.04); }
  to   { transform: rotate(360deg) scale(1); }
}
@keyframes wormhole-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50%      { transform: scale(1.12); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wormhole-svg, .wormhole-core,
  .timeline-stage-jump .timeline-stage-dot { animation: none; }
}


/* ── BOTTOM BAR — SpaceX-style stop timeline (conveyor belt) ───── */
.bottom-route-timeline-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.bottom-route-timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
  padding: 6px 0;
  width: max-content;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.timeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 80px;
  width: 80px;
  padding: 0 4px;
}
.timeline-stage-num {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1;
  transition: color 0.35s ease, font-weight 0.35s ease;
}
.timeline-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line-3);
  background: var(--bg-1);
  flex-shrink: 0;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.timeline-stage-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: normal;
  line-height: 1.1;
  text-align: center;
  width: 100%;
  max-width: 76px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.35s ease, font-weight 0.35s ease;
}
.timeline-stage.state-done .timeline-stage-num { color: var(--accent); }
.timeline-stage.state-done .timeline-stage-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.timeline-stage.state-done .timeline-stage-label { color: var(--accent); }
.timeline-stage.state-current .timeline-stage-num { color: var(--accent); font-weight: 800; }
.timeline-stage.state-current .timeline-stage-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint), 0 0 10px var(--accent);
}
.timeline-stage.state-current .timeline-stage-label { color: var(--text-0); font-weight: 700; }
.timeline-stage.state-pending .timeline-stage-dot { background: var(--bg-1); border-color: var(--line-3); }
.timeline-stage.state-pending .timeline-stage-label { color: var(--text-3); }
.timeline-connector {
  flex: 0 0 28px;
  width: 28px;
  align-self: center;
  height: 2px;
  background: var(--line-3);
  transition: background 0.45s ease;
  position: relative;
  overflow: hidden;
}
.timeline-connector.state-current {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 100%);
}
.timeline-connector.state-current::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: timeline-flow 1.6s linear infinite;
}
@keyframes timeline-flow {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .timeline-connector.state-current::after { animation: none; }
}
.timeline-connector.state-done { background: var(--accent); }
.timeline-connector.state-current { background: var(--accent); }

/* ── Jump stages — purple accent + animated vortex dot ───────
   Mini whirlpool: 5-arm pinwheel in 10×10 SVG, arms are Q-bezier
   strokes with round caps. The dot element itself rotates via CSS
   animation so the glyph spins without JS.
   Arm coords (center 5,5, r_inner=1.2, r_outer=4, sweep 80° CW):
     0: M5 3.8  Q6.93 2.7,  8.94 4.3
     1: M6.14 4.63 Q7.78 6.12, 6.88 8.53
     2: M5.71 5.97 Q4.79 7.99, 2.22 7.88
     3: M4.29 5.97 Q2.09 5.73, 1.4  3.25
     4: M3.86 4.63 Q3.41 2.45, 5.56 1.04
──────────────────────────────────────────────────────────────── */

/* pending / default */
.timeline-stage-jump .timeline-stage-num   { color: #8b5cf6; }
.timeline-stage-jump .timeline-stage-label { color: #8b5cf6; }
.timeline-stage-jump .timeline-stage-dot {
  border-color: #5b21b6;
  background: #1e1b4b
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 3.8Q6.93 2.7,8.94 4.3' fill='none' stroke='%238b5cf6' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M6.14 4.63Q7.78 6.12,6.88 8.53' fill='none' stroke='%238b5cf6' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M5.71 5.97Q4.79 7.99,2.22 7.88' fill='none' stroke='%238b5cf6' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M4.29 5.97Q2.09 5.73,1.4 3.25' fill='none' stroke='%238b5cf6' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M3.86 4.63Q3.41 2.45,5.56 1.04' fill='none' stroke='%23c4b5fd' stroke-width='.85' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 8px 8px no-repeat;
  animation: wormhole-rotate 4.5s linear infinite;
  transform-origin: center;
}
/* done */
.timeline-stage-jump.state-done .timeline-stage-num   { color: #7c3aed; }
.timeline-stage-jump.state-done .timeline-stage-label { color: #7c3aed; }
.timeline-stage-jump.state-done .timeline-stage-dot {
  background: #6d28d9
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 3.8Q6.93 2.7,8.94 4.3' fill='none' stroke='%23ede9fe' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M6.14 4.63Q7.78 6.12,6.88 8.53' fill='none' stroke='%23ede9fe' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M5.71 5.97Q4.79 7.99,2.22 7.88' fill='none' stroke='%23ddd6fe' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M4.29 5.97Q2.09 5.73,1.4 3.25' fill='none' stroke='%23ddd6fe' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M3.86 4.63Q3.41 2.45,5.56 1.04' fill='none' stroke='%23c4b5fd' stroke-width='.85' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 8px 8px no-repeat;
  border-color: #7c3aed;
}
/* current — spins faster + purple glow */
.timeline-stage-jump.state-current .timeline-stage-num   { color: #a78bfa; font-weight: 800; }
.timeline-stage-jump.state-current .timeline-stage-label { color: #e9d5ff; font-weight: 700; }
.timeline-stage-jump.state-current .timeline-stage-dot {
  background: #4c1d95
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 3.8Q6.93 2.7,8.94 4.3' fill='none' stroke='%23e9d5ff' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M6.14 4.63Q7.78 6.12,6.88 8.53' fill='none' stroke='%23e9d5ff' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M5.71 5.97Q4.79 7.99,2.22 7.88' fill='none' stroke='%23c4b5fd' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M4.29 5.97Q2.09 5.73,1.4 3.25' fill='none' stroke='%23c4b5fd' stroke-width='.85' stroke-linecap='round'/%3E%3Cpath d='M3.86 4.63Q3.41 2.45,5.56 1.04' fill='none' stroke='%23a78bfa' stroke-width='.85' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 8px 8px no-repeat;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.22), 0 0 10px rgba(139,92,246,0.55);
  animation-duration: 2.5s; /* faster spin when active */
}
/* Connectors adjacent to a jump stage turn purple */
.timeline-connector.is-jump.state-current { background: #7c3aed; }

/* ============================================================
   Route panel reskin — match planning drawer aesthetic
   ============================================================ */
#right-panel-route {
  padding: 0;
  gap: 0;
}

#right-panel-route .route-hero {
  padding: 16px 14px 10px;
  background: transparent;
  border-bottom: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#right-panel-route .route-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0;
}

#right-panel-route .route-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#right-panel-route .route-headline {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-0);
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0;
}

#right-panel-route .route-brief {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-top: 4px;
}

/* Projected profit card (sits inside the drawer-style hero) */
#right-panel-route .route-profit-card {
  margin-top: 10px;
  padding: 11px 14px;
  border-top: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Metric grid — re-styled as cards like the step list */
#right-panel-route .route-metrics,
#right-panel-route .route-metrics-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 14px 12px;
  border-bottom: none;
}

#right-panel-route .metric-box {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color var(--t-fast), background var(--t-fast);
}

#right-panel-route .metric-box:hover {
  border-color: var(--line-3);
  background: var(--bg-3);
}

#right-panel-route .route-advanced-details {
  margin: 0 14px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-2);
  overflow: hidden;
}

#right-panel-route .route-advanced-details > summary {
  padding: 10px 14px;
}

#right-panel-route .route-advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px 10px 10px;
}

#right-panel-route .route-advanced-grid .metric-box {
  padding: 8px 10px;
}

/* Actions block — Recalculate CTA first, secondary ghost buttons under */
#right-panel-route .route-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 12px;
}

.route-recalc-btn {
  width: 100%;
  border: none;
  cursor: pointer;
}

/* Hide the old Start/Full/Overview row when the recalc CTA is displayed above */
.route-recalc-btn + #routeRunButton,
.route-recalc-btn ~ #routeFullButton,
.route-recalc-btn ~ #routeOverviewButton,
.route-recalc-btn ~ .route-tools-menu {
  /* leave defaults — they remain functional below the CTA */
}
.timeline-connector.is-jump.state-done    { background: #6d28d9; }
