:root {
  --bg-void: hsl(216, 28%, 7%);
  --bg-panel: hsl(215, 23%, 11%);
  --bg-elevated: hsl(215, 20%, 15%);
  --bg-card: hsl(215, 21%, 13%);
  --bg-hover: hsl(215, 19%, 18%);
  --border-subtle: hsla(212, 24%, 76%, 0.11);
  --border-strong: hsla(212, 24%, 76%, 0.22);

  --text-primary: hsl(210, 25%, 95%);
  --text-secondary: hsl(214, 16%, 68%);
  --text-muted: hsl(215, 13%, 50%);

  --accent-amber: hsl(38, 92%, 54%);
  --accent-amber-soft: hsla(38, 92%, 54%, 0.16);
  --accent-cyan: hsl(199, 89%, 56%);
  --accent-cyan-soft: hsla(199, 89%, 56%, 0.15);
  --accent-emerald: hsl(158, 64%, 48%);
  --accent-emerald-soft: hsla(158, 64%, 48%, 0.16);
  --accent-coral: hsl(8, 80%, 60%);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.hidden {
  display: none !important;
}

#app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* Top Bar */
#top-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  min-height: 52px;
  background: linear-gradient(180deg, hsl(215, 23%, 13%), var(--bg-panel));
  border-bottom: 1px solid var(--border-subtle);
  z-index: 30;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-amber);
}

.brand-titles h1 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 2px;
}

.route-inputs {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1 1 620px;
  min-width: 480px;
  max-width: 1180px;
}

.route-inputs #swap-addresses-btn {
  width: 26px;
  height: 30px;
}

.addr-field-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}

.addr-dot {
  position: absolute;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
}

.origin-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 0 2px hsla(158, 64%, 48%, 0.25);
}

.dest-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 0 2px hsla(199, 89%, 56%, 0.25);
}

.addr-field-wrap > input:not([type="checkbox"]) {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 26px;
  background: var(--bg-void);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12.5px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.addr-field-wrap > input:not([type="checkbox"]):focus {
  outline: none;
  border-color: var(--accent-amber);
  background: hsl(216, 26%, 9%);
}

.addr-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 310px;
  max-height: 310px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.62);
  z-index: 80;
}

.addr-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px 4px;
  background: hsla(216, 25%, 10%, 0.88);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 9.2px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.addr-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
}

.addr-clear-btn:hover {
  color: var(--accent-coral);
  background: hsla(8, 80%, 60%, 0.14);
}

.addr-option-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
}

.addr-option-row:last-child {
  border-bottom: none;
}

.addr-option-row:hover,
.addr-option-row.kbd-active {
  background: var(--bg-hover);
}

.addr-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.addr-option:focus {
  outline: none;
}

.addr-opt-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.addr-opt-icon {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.addr-opt-icon.recent-icon {
  color: var(--accent-amber);
}

.addr-opt-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.addr-opt-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.addr-opt-tag.recent-tag {
  color: var(--accent-amber);
  font-weight: 700;
}

.addr-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.addr-remove-btn:hover {
  color: var(--accent-coral);
  background: hsla(8, 80%, 60%, 0.14);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.trip-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.ctrl-select {
  height: 32px;
  padding: 0 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

.compact-select {
  height: 26px;
  font-size: 11px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.toggle-chip.active {
  background: var(--accent-amber-soft);
  border-color: hsla(38, 92%, 54%, 0.45);
  color: var(--accent-amber);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease;
}

.action-btn:hover {
  background: var(--bg-hover);
}

.copy-link-btn {
  border-color: hsla(199, 89%, 56%, 0.42);
  color: var(--accent-cyan);
}

.copy-link-btn.copied {
  background: var(--accent-emerald-soft);
  border-color: hsla(158, 64%, 48%, 0.55);
  color: var(--accent-emerald);
}

@keyframes spinSync360 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refresh-btn {
  border-color: hsla(158, 64%, 48%, 0.44);
  color: var(--accent-emerald);
}

.refresh-btn.syncing svg {
  animation: spinSync360 0.85s linear infinite;
}

.refresh-btn.synced {
  background: var(--accent-emerald-soft);
  border-color: hsla(158, 64%, 48%, 0.6);
  color: var(--accent-emerald);
}

.hud-equip-line {
  font-family: var(--font-mono);
  font-size: 9.8px;
  color: var(--accent-cyan);
  margin-top: 2px;
  line-height: 1.3;
}

.card-equip-line {
  font-family: var(--font-mono);
  font-size: 9.8px;
  color: hsl(199, 72%, 72%);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta-badge {
  font-family: var(--font-mono);
  font-size: 8.8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.delta-badge.drop {
  background: hsla(158, 64%, 48%, 0.18);
  color: var(--accent-emerald);
}

.delta-badge.rise {
  background: hsla(8, 80%, 60%, 0.18);
  color: var(--accent-coral);
}

.delta-badge.new-route {
  background: hsla(158, 64%, 48%, 0.22);
  border: 1px solid hsla(158, 64%, 48%, 0.48);
  color: var(--accent-emerald);
}

.diff-toggle-btn {
  border-color: hsla(38, 92%, 54%, 0.45);
  color: var(--accent-amber);
  padding: 0 8px;
}

/* Passed / Departed Flight Card & Section Divider */
.sidebar-section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  margin: 6px 0 4px;
  background: hsla(215, 22%, 14%, 0.85);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-coral);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.itin-card.is-passed {
  opacity: 0.62;
  background: hsla(216, 24%, 10%, 0.78);
  border-style: dashed;
}

.itin-card.is-passed:hover,
.itin-card.is-passed.boarded {
  opacity: 0.96;
  border-style: solid;
}

.passed-pill {
  font-family: var(--font-mono);
  font-size: 8.8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: hsla(8, 80%, 60%, 0.16);
  border: 1px solid hsla(8, 80%, 60%, 0.36);
  color: hsl(8, 86%, 68%);
  white-space: nowrap;
}

.passed-pill.tight-now {
  background: hsla(38, 92%, 54%, 0.18);
  border-color: hsla(38, 92%, 54%, 0.45);
  color: var(--accent-amber);
}

.passed-pill.is-cancelled {
  background: hsla(0, 84%, 56%, 0.24);
  border-color: hsla(0, 84%, 62%, 0.68);
  color: #fecaca;
  letter-spacing: 0.04em;
}

.passed-pill.is-soldout {
  background: hsla(24, 88%, 52%, 0.2);
  border-color: hsla(24, 90%, 60%, 0.62);
  color: #fed7aa;
  letter-spacing: 0.04em;
}

.itin-card.is-cancelled {
  opacity: 0.88;
  background: linear-gradient(180deg, hsla(0, 78%, 46%, 0.14), hsla(216, 24%, 10%, 0.92));
  border-color: hsla(0, 82%, 58%, 0.58);
  border-style: solid;
}

.itin-card.is-soldout {
  opacity: 0.84;
  background: linear-gradient(180deg, hsla(24, 78%, 42%, 0.12), hsla(216, 24%, 10%, 0.9));
  border-color: hsla(24, 76%, 54%, 0.46);
  border-style: dashed;
}

.itin-card.is-soldout:hover,
.itin-card.is-soldout.boarded {
  opacity: 0.98;
  border-style: solid;
}

.itin-card.is-cancelled .card-total-price,
.itin-card.is-cancelled.boarded .card-total-price {
  color: #fca5a5;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.itin-card.is-soldout .card-total-price,
.itin-card.is-soldout.boarded .card-total-price {
  color: #fdba74;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.card-price-was {
  text-decoration: line-through;
  opacity: 0.78;
}

.op-pill {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.op-pill.op-ok {
  background: hsla(158, 64%, 48%, 0.14);
  border: 1px solid hsla(158, 64%, 48%, 0.38);
  color: hsl(158, 72%, 66%);
}

.op-pill.op-delay {
  background: hsla(38, 92%, 54%, 0.18);
  border: 1px solid hsla(38, 92%, 54%, 0.48);
  color: hsl(38, 96%, 68%);
}

.card-cancel-banner,
.card-soldout-banner {
  margin: 5px 0 4px;
  padding: 5px 7px;
  border-radius: 5px;
  background: hsla(0, 78%, 44%, 0.18);
  border: 1px solid hsla(0, 82%, 60%, 0.48);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #fecaca;
}

.card-soldout-banner {
  background: hsla(24, 84%, 44%, 0.16);
  border-color: hsla(24, 88%, 58%, 0.48);
  color: #fed7aa;
}

.filter-chip.toggle-passed,
.filter-chip.toggle-unavail {
  border-style: dashed;
}

.filter-chip.toggle-passed.active {
  background: hsla(8, 80%, 60%, 0.16);
  border-color: hsla(8, 80%, 60%, 0.48);
  border-style: solid;
  color: hsl(8, 86%, 70%);
}

.filter-chip.toggle-unavail.active {
  background: hsla(24, 88%, 52%, 0.18);
  border-color: hsla(24, 90%, 60%, 0.56);
  border-style: solid;
  color: #fed7aa;
}

/* Live Sync Diff Changelog Popover */
.sync-diff-panel {
  position: fixed;
  top: 56px;
  right: 14px;
  width: 420px;
  max-width: calc(100vw - 28px);
  max-height: 430px;
  display: flex;
  flex-direction: column;
  background: hsla(216, 26%, 9%, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.68);
  z-index: 90;
  overflow: hidden;
}

.sdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.sdp-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-emerald);
}

.sdp-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: hsla(215, 22%, 12%, 0.7);
}

.sdp-stat {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.sdp-stat.st-new { color: var(--accent-emerald); background: var(--accent-emerald-soft); }
.sdp-stat.st-drop { color: var(--accent-cyan); background: var(--accent-cyan-soft); }
.sdp-stat.st-rise { color: var(--accent-amber); background: var(--accent-amber-soft); }
.sdp-stat.st-gone { color: hsl(8, 86%, 70%); background: hsla(8, 80%, 60%, 0.15); }

.sdp-body {
  padding: 8px 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sdp-group-title {
  font-family: var(--font-mono);
  font-size: 9.2px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.sdp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.sdp-item.clickable {
  cursor: pointer;
}

.sdp-item.clickable:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
}

.sdp-item-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.sdp-item-code {
  font-weight: 700;
  color: var(--text-primary);
}

.sdp-item-sub {
  font-size: 9px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sdp-item-right {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.sdp-foot {
  padding: 6px 12px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 9.2px;
  color: var(--text-muted);
}

/* Deep-Link Pills & HUD Action Bar */
.hud-links-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 7px;
  margin-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.deep-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}

.deep-link-pill:hover {
  background: var(--bg-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.deep-link-pill.primary-book {
  background: var(--accent-amber-soft);
  border-color: hsla(38, 92%, 54%, 0.5);
  color: var(--accent-amber);
}

.deep-link-pill.primary-book:hover {
  background: hsla(38, 92%, 54%, 0.25);
}

.inline-mini-link {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.mini-ext-link {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-decoration: none;
}

.mini-ext-link:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.card-links-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid hsla(212, 24%, 76%, 0.07);
}

.card-ext-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Main Split Stage */
#main-stage {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#map-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  background: var(--bg-void);
  overflow: hidden;
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#map-canvas:active {
  cursor: grabbing;
}

#camera-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: hsla(215, 24%, 10%, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
}

.cam-btn {
  padding: 5px 9px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cam-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.cam-btn.active {
  background: var(--bg-elevated);
  color: var(--accent-amber);
}

.cam-divider {
  width: 1px;
  align-self: stretch;
  margin: 3px 2px;
  background: var(--border-strong);
}

.auto-step-btn.on {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
  border: 1px solid hsla(158, 64%, 48%, 0.42);
}

.auto-step-btn.on.framing {
  box-shadow: inset 0 0 0 1px hsla(158, 64%, 48%, 0.35);
}

/* Live Traveler HUD */
#me-hud {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 318px;
  padding: 11px 12px;
  background: hsla(215, 24%, 10%, 0.91);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.hud-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.me-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.phase-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.hud-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.hud-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 7px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.tel-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tel-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tel-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.highlight-cyan {
  color: var(--accent-cyan);
}

.hud-uber-strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.uber-leg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.uber-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.out-tag {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.in-tag {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan);
}

.uber-detail {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-cost-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 7px;
}

.cost-breakdown {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.cost-total {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-amber);
}

.hud-note {
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-muted);
}

#map-legend {
  position: absolute;
  bottom: 10px;
  left: 12px;
  display: flex;
  gap: 12px;
  padding: 5px 10px;
  background: hsla(215, 24%, 10%, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
}

.sw-me { background: var(--accent-amber); height: 4px; }
.sw-uber-out { background: var(--accent-emerald); }
.sw-uber-in { background: var(--accent-cyan); }
.sw-other { background: hsla(210, 20%, 75%, 0.45); }

/* Right Itinerary Sidebar */
#itinerary-sidebar {
  width: 396px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
}

.sidebar-top {
  padding: 9px 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-chip {
  padding: 3px 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.filter-chip:hover {
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent-cyan-soft);
  border-color: hsla(199, 89%, 56%, 0.45);
  color: var(--accent-cyan);
}

.sort-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.sort-row-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.sidebar-flight-search {
  width: 108px;
  height: 24px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  outline: none;
  transition: border-color 0.14s ease, width 0.14s ease;
}

.sidebar-flight-search::placeholder {
  color: var(--text-muted);
}

.sidebar-flight-search:focus {
  border-color: var(--accent-cyan);
  width: 122px;
}

.count-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#itinerary-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.itin-card {
  padding: 9px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.itin-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.itin-card.boarded {
  background: linear-gradient(180deg, hsla(38, 92%, 54%, 0.10), var(--bg-card));
  border-color: hsla(38, 92%, 54%, 0.55);
}

.card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  row-gap: 3px;
  min-width: 0;
}

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

.card-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
}

.itin-card.boarded .card-tag {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.card-total-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.itin-card.boarded .card-total-price {
  color: var(--accent-amber);
}

.card-route-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.card-door-span {
  color: var(--text-primary);
  font-weight: 600;
}

/* Proportional Phase Mini-Bar inside Card */
.phase-bar {
  display: flex;
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-void);
  margin-bottom: 5px;
  gap: 1px;
}

.pb-uber-out { background: var(--accent-emerald); }
.pb-buf,
.pb-lay {
  background: repeating-linear-gradient(
    -45deg,
    hsla(214, 22%, 58%, 0.55),
    hsla(214, 22%, 58%, 0.55) 2px,
    hsla(215, 24%, 28%, 0.72) 2px,
    hsla(215, 24%, 28%, 0.72) 4px
  );
}
.pb-fly { background: var(--accent-cyan); }
.pb-uber-in { background: var(--accent-emerald); }

.card-meta-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.board-pill-btn {
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.itin-card.boarded .board-pill-btn {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: hsl(216, 28%, 8%);
}

.missed-warn {
  color: var(--accent-coral);
  font-weight: 600;
}

/* Bottom Q*bert Time Scrubber & Gantt Dock */
#scrubber-dock {
  height: 290px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-strong);
  z-index: 25;
}

#scrubber-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 4px;
  gap: 10px;
}

.transport-left,
.speed-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 11px;
  background: var(--accent-amber);
  border: none;
  border-radius: 5px;
  color: hsl(216, 28%, 8%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.play-btn:hover {
  filter: brightness(1.08);
}

.mini-btn,
.speed-btn {
  height: 25px;
  padding: 0 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.mini-btn:hover,
.speed-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.accent-outline {
  border-color: hsla(38, 92%, 54%, 0.45);
  color: var(--accent-amber);
}

.cost-lens-btn.active {
  background: hsla(158, 64%, 48%, 0.16);
  border-color: hsla(158, 64%, 48%, 0.48);
  color: var(--accent-emerald);
}

.whatif-btn {
  border-color: hsla(8, 80%, 60%, 0.35);
}

.whatif-btn.active {
  background: hsla(8, 80%, 60%, 0.18);
  border-color: hsla(8, 80%, 60%, 0.55);
  color: hsl(8, 90%, 70%);
}

.whatif-roll-group {
  display: inline-flex;
  align-items: center;
  height: 25px;
  border-radius: 4px;
  border: 1px solid hsla(270, 76%, 68%, 0.48);
  background: hsla(270, 76%, 68%, 0.13);
  overflow: hidden;
  flex-shrink: 0;
}

.whatif-roll-group.is-off {
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
}

.whatif-roll-select {
  height: 23px;
  padding: 0 6px;
  background: transparent;
  border: none;
  color: #e9d5ff;
  font-family: var(--font-mono);
  font-size: 10.2px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.whatif-roll-group.is-off .whatif-roll-select {
  color: var(--text-secondary);
}

.whatif-roll-select option {
  background: #0f1621;
  color: #f1f5f9;
}

.whatif-reroll-btn,
.whatif-clear-btn {
  height: 23px;
  padding: 0 6px;
  border: none;
  border-left: 1px solid hsla(270, 76%, 68%, 0.30);
  border-radius: 0;
  background: transparent;
  color: #d8b4fe;
  font-size: 11.5px;
  line-height: 1;
}

.whatif-roll-group.is-off .whatif-reroll-btn {
  border-left-color: var(--border-subtle);
  color: var(--text-secondary);
}

.whatif-reroll-btn:hover,
.whatif-clear-btn:hover {
  background: hsla(270, 76%, 68%, 0.26);
  color: #ffffff;
}

.export-pdf-btn {
  border-color: hsla(38, 92%, 54%, 0.42);
  color: var(--accent-amber);
}

.export-pdf-btn:hover {
  background: var(--accent-amber-soft);
  border-color: var(--accent-amber);
  color: #fde68a;
}

.export-pdf-btn.exported {
  border-color: hsla(158, 64%, 48%, 0.6);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

body.whatif-active #scrubber-dock {
  height: 344px;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: block;
}

.hud-whatif-summary {
  margin-top: 6px;
  padding: 5px 7px;
  border-radius: 5px;
  background: hsla(8, 80%, 60%, 0.10);
  border: 1px solid hsla(8, 80%, 60%, 0.30);
  font-family: var(--font-mono);
  font-size: 9.4px;
  line-height: 1.38;
  color: hsl(24, 92%, 82%);
}

.speed-btn.active {
  background: var(--accent-cyan-soft);
  border-color: hsla(199, 89%, 56%, 0.45);
  color: var(--accent-cyan);
}

.clock-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.clock-sep {
  color: var(--text-muted);
}

.pt-zone {
  color: var(--accent-cyan);
}

.slider-wrap {
  padding: 2px 166px 4px 186px;
}

#time-slider {
  width: 100%;
  height: 5px;
  accent-color: var(--accent-amber);
  cursor: pointer;
}

#gantt-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

#gantt-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.gantt-tooltip {
  position: absolute;
  z-index: 45;
  pointer-events: none;
  min-width: 215px;
  max-width: 320px;
  padding: 7px 9px;
  background: hsla(216, 28%, 8%, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.42;
  color: var(--text-primary);
}

.gt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 10.5px;
  margin-bottom: 3px;
}

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

.gt-cost {
  color: var(--accent-amber);
  font-weight: 700;
}

.gt-sub {
  color: var(--text-secondary);
  font-size: 9.5px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 13, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  width: 480px;
  max-width: 94vw;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

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

.modal-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.form-field input,
.form-field select {
  height: 32px;
  padding: 0 8px;
  background: var(--bg-void);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 12.5px;
}

  .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
  }

  /* ---------------- UX Polish: Resizable Dock, Fit-Trip, Compact HUD, Risk Badges & Laptop Floor ---------------- */
  #scrubber-dock {
    position: relative;
  }

  .dock-resizer {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    z-index: 38;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dock-resizer::after {
    content: '';
    width: 46px;
    height: 3px;
    border-radius: 2px;
    background: hsla(212, 24%, 76%, 0.24);
    transition: background 0.14s ease, width 0.14s ease;
  }

  .dock-resizer:hover::after,
  body.resizing-dock .dock-resizer::after {
    width: 72px;
    background: var(--accent-amber);
  }

  body.resizing-dock {
    cursor: ns-resize !important;
    user-select: none;
  }

  .fit-trip-btn {
    border-color: hsla(199, 89%, 56%, 0.36);
    color: var(--accent-cyan);
  }

  .fit-trip-btn.active {
    background: var(--accent-cyan-soft);
    border-color: hsla(199, 89%, 56%, 0.65);
    color: hsl(199, 95%, 74%);
  }

  .hud-right-badges {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .card-tag:empty {
    display: none;
  }

  /* Active Boarded Card Inline Ground & PETC Drawer (replaces floating #me-hud) */
  .card-ground-drawer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 5px 0 4px;
    padding: 5px 7px;
    border-radius: 5px;
    background: hsla(216, 26%, 9%, 0.72);
    border: 1px solid hsla(212, 24%, 76%, 0.14);
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--text-secondary);
  }

  .card-ground-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .card-ground-left {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cg-pill {
    font-size: 8.4px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .cg-out {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
  }

  .cg-in {
    background: var(--accent-cyan-soft);
    color: var(--accent-cyan);
  }

  .card-ground-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .card-pet-line {
    margin-top: 2px;
    padding-top: 3px;
    border-top: 1px dashed hsla(212, 24%, 76%, 0.12);
    font-size: 9px;
    color: hsl(214, 18%, 64%);
  }

  /* Sidebar What-If Risk Badge Row */
  .card-risk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 4px 0 3px;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
  }

  .card-risk-row.risk-low {
    background: hsla(158, 64%, 48%, 0.11);
    border: 1px solid hsla(158, 64%, 48%, 0.28);
    color: hsl(158, 72%, 66%);
  }

  .card-risk-row.risk-med {
    background: hsla(38, 92%, 54%, 0.12);
    border: 1px solid hsla(38, 92%, 54%, 0.32);
    color: hsl(38, 95%, 68%);
  }

  .card-risk-row.risk-high {
    background: hsla(8, 80%, 60%, 0.14);
    border: 1px solid hsla(8, 80%, 60%, 0.38);
    color: hsl(8, 90%, 74%);
  }

  .route-inputs {
    min-width: 520px;
  }

  .addr-field-wrap {
    min-width: 155px;
  }

  @media (max-width: 1960px) {
    #top-bar {
      gap: 7px;
      padding: 6px 10px;
    }
    .brand-sub,
    .trip-controls .ctrl-label,
    .btn-text-secondary {
      display: none;
    }
    .trip-controls {
      gap: 4px;
    }
    .action-btn,
    .toggle-chip {
      padding: 0 7px;
      font-size: 10px;
    }
  }

  @media (max-width: 1380px) {
    #top-bar {
      flex-wrap: wrap;
      row-gap: 6px;
    }
    .route-inputs {
      flex: 1 1 680px;
      min-width: 420px;
      max-width: none;
    }
    .trip-controls {
      margin-left: auto;
    }
  }

  @media (max-width: 1100px) {
    .route-inputs {
      min-width: 300px;
    }
    #itinerary-sidebar {
      width: 330px;
    }
  }

  .form-field-full {
    grid-column: 1 / -1;
  }

  /* ---------------- Generalized Query Builder & Leave / Arrive Time-Window UI ---------------- */
  .window-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 9px;
    background: var(--bg-void);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10.6px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 238px;
    transition: background 0.14s ease, border-color 0.14s ease;
  }

  .window-pill-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-amber);
  }

  .tw-mode-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .tw-mode-badge.mode-leave {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
  }

  .tw-mode-badge.mode-arrive {
    background: var(--accent-cyan-soft);
    color: var(--accent-cyan);
  }

  .tw-range-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .query-modal-card {
    width: 680px;
    max-width: 95vw;
    padding: 18px 20px;
  }

  .modal-subtitle {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
  }

  .qb-route-stack {
    margin-bottom: 12px;
  }

  .qb-addr-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
  }

  .qb-addr-field {
    flex: 1;
    min-width: 0;
  }

  .qb-addr-field .addr-field-wrap > input:not([type="checkbox"]) {
    padding-left: 26px;
  }

  .qb-swap-btn {
    height: 34px;
    width: 34px;
    margin-bottom: 0;
  }

  .qb-window-section {
    padding: 12px;
    background: hsla(216, 26%, 9%, 0.78);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .qb-window-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }

  .qb-sec-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
  }

  .qb-mode-seg {
    display: inline-flex;
    padding: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    gap: 2px;
  }

  .qb-seg-btn {
    height: 27px;
    padding: 0 11px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
  }

  .qb-seg-btn:hover {
    color: var(--text-primary);
  }

  .qb-seg-btn[data-wmode="leave"].active {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
  }

  .qb-seg-btn[data-wmode="arrive"].active {
    background: var(--accent-cyan-soft);
    color: var(--accent-cyan);
  }

  .qb-datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .qb-dt-pair {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 6px;
  }

  .qb-tz-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-elevated);
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 9px;
  }

  .qb-quick-spans {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .qb-scope-banner {
    padding: 7px 9px;
    border-radius: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 10.2px;
    line-height: 1.42;
    color: var(--text-secondary);
  }

  .qb-options-grid {
    margin-bottom: 10px;
  }

  .qb-examples-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }

  .qb-error-msg {
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 5px;
    background: hsla(8, 80%, 60%, 0.15);
    border: 1px solid hsla(8, 80%, 60%, 0.42);
    color: hsl(8, 88%, 74%);
    font-family: var(--font-mono);
    font-size: 10.5px;
  }

  .qb-submit-btn {
    height: 31px;
    padding: 0 15px;
  }

  .sidebar-empty-state {
    margin: 10px 4px;
    padding: 14px 12px;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ses-title {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .ses-sub {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-secondary);
  }

  .ses-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
  }

  @media (max-width: 720px) {
    .qb-addr-row {
      flex-direction: column;
      align-items: stretch;
    }
    .qb-swap-btn {
      align-self: center;
      transform: rotate(90deg);
    }
    .qb-datetime-grid {
      grid-template-columns: 1fr;
    }
  }

  /* ---------------- Mobile Responsive Shell & Touch Canvas Ergonomics (<= 860px) ---------------- */
  #map-canvas,
  #gantt-canvas,
  #dock-resizer {
    touch-action: none;
  }

  .mobile-view-bar {
    display: none;
  }

  .modal-card {
    max-height: 92dvh;
    overflow-y: auto;
  }

  @media (max-width: 860px) {
    #app-shell {
      height: 100dvh;
    }

    #top-bar {
      flex-wrap: wrap;
      gap: 6px;
      padding: 6px 8px;
      min-height: 0;
    }

    .brand-block {
      gap: 6px;
    }

    .brand-titles h1 {
      font-size: 12px;
    }

    #time-window-btn {
      flex: 1;
      min-width: 0;
      max-width: none;
      height: 30px;
      padding: 0 8px;
      font-size: 10.2px;
    }

    .trip-controls {
      margin-left: 0;
      gap: 4px;
    }

    .trip-controls .control-group,
    #open-profile-btn,
    #add-flight-btn,
    #export-pdf-btn,
    #toggle-diff-btn {
      display: none !important;
    }

    #pet-toggle-btn,
    #refresh-flights-btn,
    #copy-link-btn {
      height: 30px;
      padding: 0 7px;
      font-size: 10px;
    }

    #copy-link-label {
      display: none;
    }

    .route-inputs {
      order: 3;
      flex: 1 1 100%;
      width: 100%;
      min-width: 0;
      max-width: none;
      gap: 4px;
    }

    .addr-field-wrap {
      min-width: 0;
    }

    .addr-field-wrap > input:not([type="checkbox"]) {
      height: 30px;
      font-size: 11.5px;
      padding-left: 22px;
    }

    .addr-dot {
      left: 8px;
      width: 6.5px;
      height: 6.5px;
    }

    #swap-addresses-btn {
      width: 28px;
      height: 28px;
    }

    .addr-dropdown {
      min-width: 240px;
      max-width: 92vw;
    }

    .mobile-view-bar {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      height: 35px;
      flex-shrink: 0;
      background: var(--bg-panel);
      border-bottom: 1px solid var(--border-strong);
      z-index: 28;
    }

    .mob-tab-btn {
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      color: var(--text-secondary);
      font-family: var(--font-mono);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      cursor: pointer;
      transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
    }

    .mob-tab-btn.active {
      color: var(--accent-amber);
      border-bottom-color: var(--accent-amber);
      background: hsla(38, 92%, 54%, 0.08);
    }

    /* Mobile View 1: Flights (default) */
    body:not([data-mob-view]) #map-stage,
    body[data-mob-view="flights"] #map-stage,
    body:not([data-mob-view]) #scrubber-dock,
    body[data-mob-view="flights"] #scrubber-dock {
      display: none !important;
    }

    body:not([data-mob-view]) #itinerary-sidebar,
    body[data-mob-view="flights"] #itinerary-sidebar {
      width: 100% !important;
      flex: 1;
      border-left: none;
    }

    /* Mobile View 2: Map + Live Playback Scrubber */
    body[data-mob-view="map"] #itinerary-sidebar {
      display: none !important;
    }

    body[data-mob-view="map"] #scrubber-dock {
      height: auto !important;
      padding-bottom: 6px;
    }

    body[data-mob-view="map"] #dock-resizer,
    body[data-mob-view="map"] #gantt-wrap {
      display: none !important;
    }

    /* Mobile View 3: Full-Height Gantt Timeline */
    body[data-mob-view="timeline"] #main-stage,
    body[data-mob-view="timeline"] #dock-resizer {
      display: none !important;
    }

    body[data-mob-view="timeline"] #scrubber-dock {
      flex: 1;
      height: auto !important;
      min-height: 0;
      border-top: none;
    }

    #scrubber-controls {
      flex-wrap: wrap;
      padding: 6px 8px 4px;
      gap: 5px;
    }

    .transport-left {
      order: 2;
      flex: 1 1 100%;
      width: 100%;
      flex-wrap: wrap;
      overflow: visible;
      gap: 4px;
    }

    .transport-left .play-btn,
    .transport-left .mini-btn {
      height: 25px;
      padding: 0 6.5px;
      font-size: 9.8px;
    }

    body[data-mob-view="map"] .slider-wrap {
      padding: 3px 12px 4px 12px;
    }

    body[data-mob-view="timeline"] .slider-wrap {
      padding: 3px 54px 4px 100px;
    }

    #map-legend {
      left: 8px;
      bottom: 8px;
      padding: 3px 7px;
      gap: 7px;
      font-size: 9px;
      max-width: calc(100% - 118px);
    }

    #map-legend .leg-item:last-child {
      display: none;
    }

    .clock-readout {
      order: 1;
      font-size: 10px;
      padding: 2px 7px;
    }

    .speed-group {
      order: 1;
      margin-left: auto;
      gap: 3px;
    }

    .speed-btn {
      padding: 0 6px;
      font-size: 9.8px;
    }

    .speed-group .ctrl-label,
    #step-back-btn,
    #step-fwd-btn {
      display: none;
    }

    #camera-bar {
      top: 8px;
      left: 8px;
      right: 8px;
      width: fit-content;
      max-width: calc(100% - 16px);
      overflow-x: auto;
    }

    .query-modal-card {
      padding: 14px 12px;
      width: 96vw;
    }

    .qb-options-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 560px) {
    #refresh-flights-label {
      display: none;
    }
  }

  /* ---------------- Expandable Inline Top Time-Window & Quick-Route Drawer ---------------- */
  #top-bar {
    gap: 8px;
  }

  .route-inputs {
    min-width: 280px;
  }

  .addr-field-wrap {
    min-width: 0;
  }

  .trip-controls {
    gap: 5px;
  }

  .window-pill-btn {
    width: 224px;
    min-width: 224px;
    max-width: 224px;
    padding: 0 9px;
    gap: 6px;
    font-variant-numeric: tabular-nums;
  }

  .window-pill-btn .tw-mode-badge {
    min-width: 44px;
    text-align: center;
  }

  #refresh-flights-btn {
    min-width: 124px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
  }

  .tw-chevron {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.16s ease, color 0.16s ease;
  }

  .window-pill-btn[aria-expanded="true"] {
    border-color: hsla(38, 92%, 54%, 0.65);
    background: hsl(216, 26%, 9%);
  }

  .window-pill-btn[aria-expanded="true"] .tw-chevron {
    transform: rotate(180deg);
    color: var(--accent-amber);
  }

  .tw-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }

  .tw-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 348px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.74);
    padding: 10px;
    z-index: 88;
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .tw-popover.collapsed {
    display: none !important;
  }

  .tw-pop-top {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
  }

  .tw-pop-top .qb-tz-tag {
    margin-left: auto;
    font-size: 9.5px;
    padding: 2px 6px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .tw-pop-close {
    width: 24px;
    height: 24px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .tw-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .tw-preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 40px;
    padding: 0 4px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: var(--bg-void);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease;
  }

  .tw-preset-btn:hover {
    background: hsl(216, 26%, 13%);
    border-color: hsla(38, 92%, 54%, 0.55);
  }

  .tw-preset-btn.active {
    border-color: var(--accent-amber);
    background: hsla(38, 92%, 54%, 0.14);
  }

  .twp-main {
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
  }

  .twp-sub {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.1;
    white-space: nowrap;
  }

  .tw-preset-btn.active .twp-sub {
    color: hsl(38, 95%, 72%);
  }

  .tw-custom-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }

  .tw-custom-row {
    display: grid;
    grid-template-columns: 38px 1fr 106px;
    align-items: center;
    gap: 6px;
  }

  .tw-custom-lbl {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
  }

  .tw-custom-row input[type="date"],
  .tw-custom-row input[type="time"] {
    height: 30px;
    padding: 0 7px;
    background: var(--bg-void);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11.2px;
    color-scheme: dark;
  }

  .tw-custom-row input[type="date"]:focus,
  .tw-custom-row input[type="time"]:focus {
    outline: none;
    border-color: var(--accent-amber);
  }

  .tw-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
  }

  .tw-cancel-btn {
    height: 31px;
    padding: 0 12px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .tw-apply-btn {
    flex: 1;
    height: 31px;
    font-size: 11.5px;
    font-weight: 700;
    justify-content: center;
  }

  .tw-popover .qb-error-msg {
    margin-top: 2px;
    padding: 5px 8px;
    font-size: 11px;
  }

  @media (max-width: 860px) {
    .window-pill-btn {
      width: auto;
      min-width: 0;
      max-width: none;
    }
    .tw-popover {
      position: fixed;
      top: 52px;
      left: 8px;
      right: 8px;
      width: auto;
    }
  }

  /* ---------------- Streamlined Airport-First Quick Launcher & Mobile Split Map+Results ---------------- */
  body[data-cold-start="true"] #top-bar,
  body[data-cold-start="true"] #window-drawer,
  body[data-cold-start="true"] #mobile-view-bar,
  body[data-cold-start="true"] #itinerary-sidebar,
  body[data-cold-start="true"] #dock-resizer,
  body[data-cold-start="true"] #scrubber-dock,
  body[data-cold-start="true"] #camera-bar,
  body[data-cold-start="true"] #map-legend {
    display: none !important;
  }

  body[data-cold-start="true"] #main-stage,
  body[data-cold-start="true"] #map-stage {
    display: flex !important;
    flex: 1;
    width: 100%;
    height: 100%;
  }

  .quick-launcher {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 10, 17, 0.56);
    backdrop-filter: blur(3px);
  }

  .quick-launcher.hidden {
    display: none !important;
  }

  .ql-card {
    width: min(468px, 94vw);
    max-height: 92dvh;
    overflow-y: auto;
    background: linear-gradient(180deg, hsl(216, 26%, 12%), hsl(215, 25%, 9.5%));
    border: 1px solid hsla(212, 26%, 72%, 0.22);
    border-radius: 12px;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.72);
    padding: 20px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .ql-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .ql-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .ql-brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: var(--text-primary);
    line-height: 1.1;
  }

  .ql-brand-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  .ql-field-lbl {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 5px;
  }

  .ql-airports-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 8px;
  }

  .ql-ap-field {
    min-width: 0;
  }

  .ql-ap-box {
    position: relative;
    background: var(--bg-void);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 11px 7px;
    transition: border-color 0.15s ease, background 0.15s ease;
  }

  .ql-ap-box:focus-within {
    border-color: var(--accent-amber);
    background: hsl(216, 26%, 8.5%);
  }

  .ql-code-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.15;
    padding: 0;
  }

  .ql-code-input::placeholder {
    color: hsla(214, 18%, 62%, 0.34);
    font-weight: 700;
  }

  .ql-code-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 15px;
  }

  .ql-code-sub.resolved {
    color: var(--accent-emerald);
    font-weight: 500;
  }

  .ql-ap-dropdown {
    left: -1px;
    right: auto;
    min-width: min(300px, 84vw);
    max-height: 250px;
  }

  .ql-ap-field:last-child .ql-ap-dropdown {
    left: auto;
    right: -1px;
  }

  .ql-swap-btn {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    border-radius: 8px;
  }

  .ql-ride-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .ql-ride-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: transparent;
    border: none;
    padding: 2px 0;
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
  }

  .ql-ride-toggle:hover {
    text-decoration: underline;
  }

  .ql-ride-arrow {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.14s ease;
  }

  .ql-ride-toggle[aria-expanded="true"] .ql-ride-arrow {
    transform: rotate(90deg);
  }

  .ql-ride-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: hsla(216, 28%, 7.5%, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
  }

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

  .ql-clear-ride-btn {
    height: 30px;
    padding: 0 8px;
    flex-shrink: 0;
  }

  .ql-when-section {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .ql-when-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .ql-when-hdr .ql-field-lbl {
    margin-bottom: 0;
  }

  .ql-wmode-seg {
    display: inline-flex;
    padding: 2px;
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    gap: 2px;
  }

  .ql-wmode-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .ql-wmode-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
  }

  .ql-date-pills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .ql-date-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: var(--bg-void);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.14s ease, background 0.14s ease;
  }

  .ql-date-pill:hover {
    background: var(--bg-hover);
  }

  .ql-date-pill.active {
    border-color: var(--accent-amber);
    background: hsla(38, 92%, 54%, 0.13);
  }

  .qdp-main {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
  }

  .ql-date-pill.active .qdp-main {
    color: var(--accent-amber);
  }

  .qdp-sub {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: var(--text-muted);
  }

  .ql-custom-date-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-void);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
  }

  .ql-custom-date-panel input[type="date"],
  .ql-custom-date-panel input[type="time"] {
    height: 32px;
    padding: 0 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    color-scheme: dark;
  }

  .ql-custom-times {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .ql-checks {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .ql-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: hsla(216, 25%, 9%, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
  }

  .ql-check-row:hover {
    border-color: var(--border-strong);
  }

  .ql-check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: hsl(38, 92%, 54%);
    flex-shrink: 0;
    cursor: pointer;
  }

  .ql-check-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
  }

  .ql-check-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .ql-check-sub {
    font-size: 10.8px;
    color: var(--text-secondary);
    line-height: 1.3;
  }

  .ql-submit-btn {
    width: 100%;
    height: 46px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .ql-cta-arrow {
    font-size: 16px;
    line-height: 1;
  }

  .ql-try-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 2px;
  }

  .ql-try-lbl {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
  }

  .ql-try-btn {
    background: transparent;
    border: none;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .ql-try-btn:hover {
    color: var(--accent-amber);
    background: hsla(38, 92%, 54%, 0.1);
  }

  .ql-try-dot {
    color: var(--text-muted);
    font-size: 11px;
  }

  .add-ride-banner-btn {
    background: transparent;
    border: 1px dashed hsla(199, 89%, 56%, 0.45);
    border-radius: 5px;
    padding: 3px 7px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 9.8px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
  }

  .add-ride-banner-btn:hover {
    background: hsla(199, 89%, 56%, 0.1);
  }

  @media (max-width: 860px) {
    .quick-launcher {
      padding: 0;
      align-items: stretch;
      background: var(--bg-void);
      backdrop-filter: none;
    }

    .ql-card {
      width: 100%;
      max-width: none;
      min-height: 100dvh;
      max-height: none;
      border: none;
      border-radius: 0;
      box-shadow: none;
      padding: 16px 16px 28px;
      gap: 15px;
    }

    .ql-code-input {
      font-size: 24px;
    }

    .ql-submit-btn {
      height: 50px;
      font-size: 15px;
    }

    /* Once routes load on mobile: sleek 1-row top bar + immediate Map-over-Results split! */
    #top-bar .route-inputs {
      display: none !important;
    }

    #window-drawer {
      display: none !important;
    }

    body:not([data-cold-start="true"]):not([data-mob-view]) #main-stage,
    body:not([data-cold-start="true"])[data-mob-view="flights"] #main-stage {
      flex-direction: column !important;
    }

    body:not([data-cold-start="true"]):not([data-mob-view]) #map-stage,
    body:not([data-cold-start="true"])[data-mob-view="flights"] #map-stage {
      display: block !important;
      flex: 0 0 215px !important;
      height: 215px !important;
      min-height: 190px !important;
      width: 100% !important;
      border-bottom: 1px solid var(--border-strong);
    }

    body:not([data-cold-start="true"]):not([data-mob-view]) #map-stage #camera-bar,
    body:not([data-cold-start="true"])[data-mob-view="flights"] #map-stage #camera-bar {
      display: none !important;
    }

    body:not([data-cold-start="true"]):not([data-mob-view]) #itinerary-sidebar,
    body:not([data-cold-start="true"])[data-mob-view="flights"] #itinerary-sidebar {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      width: 100% !important;
    }
  }

  /* ---------------- Compound Endpoint Pickers: [ Coarse Airport Anchor | Fine Exact Ride Address ] ---------------- */
  .compound-endpoint {
    height: 34px;
    background: var(--bg-void);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 0 3px 0 3px;
    gap: 4px;
    flex: 1 1 0;
    transition: flex-grow 0.16s ease, border-color 0.15s ease, background 0.15s ease;
  }

  .compound-endpoint:focus-within {
    flex-grow: 2.05;
    border-color: var(--accent-amber);
    background: hsl(216, 26%, 9%);
  }

  .compound-endpoint > input:not([type="checkbox"]) {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 5px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    font-size: 12px;
  }

  .compound-endpoint > input:not([type="checkbox"])::placeholder {
    color: hsla(199, 75%, 68%, 0.72);
    font-size: 11.5px;
  }

  #top-bar .compound-endpoint .addr-dropdown {
    min-width: 372px;
    max-height: 320px;
  }

  .addr-dropdown,
  .ap-pop-list {
    scrollbar-width: thin;
    scrollbar-color: hsla(212, 24%, 65%, 0.28) transparent;
  }

  .addr-dropdown::-webkit-scrollbar,
  .ap-pop-list::-webkit-scrollbar {
    width: 6px;
  }

  .addr-dropdown::-webkit-scrollbar-track,
  .ap-pop-list::-webkit-scrollbar-track {
    background: transparent;
  }

  .addr-dropdown::-webkit-scrollbar-thumb,
  .ap-pop-list::-webkit-scrollbar-thumb {
    background: hsla(212, 24%, 65%, 0.28);
    border-radius: 3px;
  }

  .anchor-chip-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 25px;
    padding: 0 6px;
    background: hsl(216, 25%, 14%);
    border: 1px solid hsla(212, 26%, 72%, 0.24);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10.6px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.14s ease, background 0.14s ease;
  }

  .anchor-chip-btn:hover,
  .anchor-chip-btn[aria-expanded="true"] {
    background: hsl(216, 26%, 18%);
    border-color: var(--accent-amber);
  }

  .anchor-chip-btn .addr-dot {
    position: static;
    width: 7px;
    height: 7px;
    flex-shrink: 0;
  }

  .anchor-code-txt {
    line-height: 1;
  }

  .anchor-caret {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1;
  }

  .ride-inline-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
  }

  .ride-inline-clear:hover {
    color: var(--accent-coral);
    background: hsla(8, 80%, 60%, 0.16);
  }

  .anchor-popover {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 288px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.72);
    padding: 9px;
    z-index: 88;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .ap-pop-hdr {
    font-family: var(--font-mono);
    font-size: 9.2px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-muted);
  }

  .ap-pop-input {
    width: 100%;
    height: 30px !important;
    padding: 0 9px !important;
    background: var(--bg-void) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 5px !important;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11.5px !important;
  }

  .ap-pop-list {
    max-height: 185px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    background: hsla(216, 28%, 8%, 0.75);
  }

  .ap-pop-nearby {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1px solid hsla(212, 24%, 65%, 0.16);
    background: hsla(216, 26%, 11%, 0.85);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.14s ease, border-color 0.14s ease;
  }

  .ap-pop-nearby:hover {
    background: hsla(216, 26%, 15%, 0.95);
    border-color: hsla(38, 92%, 54%, 0.45);
  }

  .ap-pop-nearby input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin: 0;
    padding: 0 !important;
    border-radius: 4px !important;
    border: 1.5px solid hsla(212, 26%, 72%, 0.5) !important;
    background: var(--bg-void) !important;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease, border-color 0.12s ease;
  }

  .ap-pop-nearby input[type="checkbox"]::before {
    content: "";
    width: 9px;
    height: 5.5px;
    border-left: 2px solid #0b1017;
    border-bottom: 2px solid #0b1017;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform 0.11s ease;
  }

  .ap-pop-nearby input[type="checkbox"]:checked {
    background: var(--accent-amber) !important;
    border-color: var(--accent-amber) !important;
  }

  .ap-pop-nearby input[type="checkbox"]:checked::before {
    transform: translateY(-1px) rotate(-45deg) scale(1);
  }

  .ap-pop-nearby input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent-amber);
    outline-offset: 2px;
  }

  /* User-Booked Flight Badge & 1-Click Inline Fare Override on NO SEATS Cards */
  .op-pill.op-booked {
    background: hsla(160, 84%, 39%, 0.22);
    border: 1px solid hsla(160, 84%, 45%, 0.55);
    color: #6ee7b7;
  }

  .mini-ext-link.booked-trigger-btn {
    color: #6ee7b7;
    border-color: hsla(160, 84%, 45%, 0.45);
    background: hsla(160, 84%, 39%, 0.14);
    font-weight: 700;
  }

  .mini-ext-link.booked-trigger-btn:hover {
    background: hsla(160, 84%, 39%, 0.26);
    border-color: #34d399;
    color: #a7f3d0;
  }

  .booked-fare-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 5px 0 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: hsla(216, 30%, 8%, 0.92);
    border: 1px solid hsla(160, 84%, 45%, 0.45);
  }

  .booked-fare-lbl {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #a7f3d0;
    white-space: nowrap;
  }

  .booked-fare-input {
    width: 66px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
  }

  .booked-fare-input:focus {
    outline: none;
    border-color: #34d399;
  }

  .booked-fare-save {
    height: 24px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid hsla(160, 84%, 45%, 0.65);
    background: hsla(160, 84%, 39%, 0.24);
    color: #a7f3d0;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
  }

  .booked-fare-save:hover {
    background: hsla(160, 84%, 39%, 0.36);
  }

  .booked-fare-cancel {
    height: 24px;
    padding: 0 7px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    cursor: pointer;
  }

  /* Quick Flight # Autofill Strip in Add Custom Flight Modal */
  .cf-lookup-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    background: hsla(216, 28%, 9%, 0.85);
    border: 1px solid var(--border-subtle);
  }

  .cf-lookup-bar input {
    width: 170px;
    height: 30px;
    padding: 0 9px;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .cf-lookup-status {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-secondary);
  }

  .cf-lookup-status.is-ok {
    color: #6ee7b7;
  }

  .cf-lookup-status.is-err {
    color: #fca5a5;
  }
