/* Layout: controls on the left, the map in the middle, results/details on the right. Stacks below 1100px. */
:root {
  --bg: #f2f5fb; --surface: #ffffff; --surface-2: #f6f8fd; --ink: #0f1b33; --muted: #66738c; --line: #e2e8f2;
  --accent: #2f5bff; --accent-ink: #ffffff; --accent-soft: #e8eeff; --good: #12805a; --good-soft: #dff5ea;
  --bad: #c2382c; --bad-soft: #fde6e3; --warn: #9a6200; --warn-soft: #fff1d6;
  --origin: #12a36b; --dest: #e0346f; --cand: #2f5bff; --rej: #9aa6bb; --sel: #f59e0b; --forced: #8b5cf6;
  --shadow: 0 1px 2px rgb(15 27 51 / .04), 0 8px 24px -8px rgb(15 27 51 / .14);
  --r: 14px;
  --body: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0a0f1c; --surface: #121a2c; --surface-2: #0f1626; --ink: #e8eefa; --muted: #93a0b8; --line: #23304a;
  --accent: #7f9cff; --accent-ink: #0a0f1c; --accent-soft: #1a2650; --good: #4fd19b; --good-soft: #10301f;
  --bad: #ff8a7d; --bad-soft: #3a1a17; --warn: #f2bd5a; --warn-soft: #362810;
  --origin: #34d399; --dest: #fb7199; --cand: #7f9cff; --rej: #5b6783; --sel: #fbbf24; --forced: #a78bfa;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #121a2c; --surface-2: #0f1626; --ink: #e8eefa; --muted: #93a0b8; --line: #23304a;
  --accent: #7f9cff; --accent-ink: #0a0f1c; --accent-soft: #1a2650; --good: #4fd19b; --good-soft: #10301f;
  --bad: #ff8a7d; --bad-soft: #3a1a17; --warn: #f2bd5a; --warn-soft: #362810;
  --origin: #34d399; --dest: #fb7199; --cand: #7f9cff; --rej: #5b6783; --sel: #fbbf24; --forced: #a78bfa;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -8px rgb(0 0 0 / .5); color-scheme: dark }

* { box-sizing: border-box }
html, body { margin: 0; height: 100% }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--body) }
h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted) }
.muted { color: var(--muted) }
.mono { font-family: var(--mono) }
.pad { padding: 16px }
[hidden] { display: none !important }

.app { display: grid; height: 100dvh; grid-template-columns: 330px minmax(0, 1fr) 400px; grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "side map panel" }
.topbar { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line) }
.topbar .back { text-decoration: none; color: var(--ink); font-size: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-2) }
.brand { display: grid; line-height: 1.2 }
.brand strong { font-size: 16px; font-weight: 800; letter-spacing: -.01em }
.brand span { font-size: 12px }
.top-stats { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end }
.stat-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap }
.stat-chip b { font-variant-numeric: tabular-nums }

.side { grid-area: side; overflow: auto; padding: 12px; display: grid; gap: 12px; align-content: start; border-right: 1px solid var(--line) }
.panel { grid-area: panel; overflow: auto; background: var(--surface); border-left: 1px solid var(--line) }
.map-wrap { grid-area: map; position: relative; min-height: 300px }
#map { position: absolute; inset: 0; background: var(--surface-2) }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow) }
details.card summary { cursor: pointer; font-weight: 700 }
form.card { display: grid; gap: 12px; position: relative }

.field { display: grid; gap: 4px; position: relative }
label { font-size: 12px; font-weight: 600; color: var(--muted) }
input, select { font: 500 14px var(--body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; width: 100%; min-width: 0 }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.hint { margin: 0; font-size: 12px; color: var(--muted) }
.swap { position: absolute; right: 22px; top: 58px; z-index: 2; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0 }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden }
.suggest:empty { display: none }
.suggest button { display: flex; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; background: none; border: 0; color: var(--ink); font: 500 13px var(--body); cursor: pointer }
.suggest button:hover, .suggest button.on { background: var(--accent-soft) }
.suggest .code { font-family: var(--mono); font-weight: 600; min-width: 34px }

button { font: 700 13px var(--body); cursor: pointer }
button.primary { color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: 11px 16px }
button.primary.small { padding: 8px 12px; font-size: 12px }
button.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; box-shadow: var(--shadow) }
button.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600 }
button.chip-btn { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 12px }
button.chip-btn:hover { border-color: var(--accent) }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px }
.seg button { background: none; border: 0; border-radius: 7px; padding: 7px 4px; color: var(--muted); font-size: 12px }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow) }
.seg.small { margin-bottom: 10px }

.slider { display: grid; gap: 4px }
.slider-head { display: flex; justify-content: space-between; align-items: baseline }
.slider output { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px }
input[type="range"] { padding: 0; background: none; border: 0; accent-color: var(--accent) }
.ticks { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted) }

label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; color: var(--ink); cursor: pointer; line-height: 1.35 }
label.check input { width: auto; margin-top: 2px; accent-color: var(--accent) }
label.check .muted { font-weight: 500; display: block }
.live-status { border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px; background: var(--accent-soft) }
.live-status.err { background: var(--warn-soft); color: var(--warn) }
.live-status .meter { background: color-mix(in srgb, var(--accent) 20%, transparent) }
.badge { font: 700 9.5px var(--body); letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; vertical-align: middle }
.badge.live { background: var(--good-soft); color: var(--good) }
.badge.est { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line) }
.route .est-was { font-size: 11px; color: var(--muted); text-align: right }
.weights { display: grid; gap: 6px; margin-top: 10px }
.weights label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 500 }
.weights input { width: 84px; padding: 5px 8px; text-align: right }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 10px }
.toggles label { display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--ink); cursor: pointer }
.toggles input { width: auto; accent-color: var(--accent) }

.tray { margin-top: 12px; padding: 10px; border-radius: 10px; background: var(--accent-soft); display: grid; gap: 8px }
.tray-head { display: flex; justify-content: space-between; font-size: 12px }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--mono); padding: 3px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line) }
.chip button { background: none; border: 0; color: var(--muted); padding: 0 0 0 2px; font-size: 12px }


/* ---- Calendar: the Flight Search page's date picker (site/index.html), shared look; see js/datePicker.js */
.dp button { font-family: var(--body); cursor: pointer; border: 0; border-radius: 999px }
.dpick:focus-visible { outline: 2px solid var(--accent) !important; outline-offset: -1px }
.dp-head .dp-oneway { width: auto; padding: 0 12px; font: 600 12px var(--body) }
.dpick { font: 500 14px/1.3 var(--body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-height: 40px; text-align: left; width: 100%; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.dpick:hover { filter: none } .dpick:focus-visible { outline: none } .dpick[disabled] { cursor: not-allowed; opacity: 1 }
.dpick .ph { color: var(--muted); font-weight: 500 }
.field:has(.dpick) { cursor: pointer }
.dp { position: absolute; z-index: 2000; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 4px rgb(15 27 51 / .06), 0 24px 48px -16px rgb(15 27 51 / .3); padding: 14px 16px 16px; color: var(--ink) }
.dp[hidden], .dp-back[hidden] { display: none }
.dp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px }
.dp-head > b { flex: 1; font: 700 11px/1.2 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted) }
.dp-head button, .dp-nav { width: 36px; height: 36px; padding: 0; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none }
.dp-head button svg, .dp-nav svg { display: block }
.dp-head button:hover:not([disabled]), .dp-nav:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); filter: none }
.dp-nav[disabled] { opacity: .35; cursor: default }
.dp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; margin-bottom: 12px }
.dp-tab:hover { border-color: var(--accent); filter: none }
.dp-tab { color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: start; gap: 3px; text-align: left; padding: 8px 12px; border-radius: 12px; font: 700 14px/1.2 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.dp-tab small { font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted) }
.dp-tab .ph { color: var(--muted); font-weight: 500 }
.dp-tab[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset }
.dp-tab[aria-pressed="true"] small { color: var(--accent) }
.dp-months { position: relative }
.dp-nav { position: absolute; top: 0; z-index: 1 } .dp-nav.prev { left: 0 } .dp-nav.next { right: 0 }
.dp-months { display: flex; gap: 28px }
.dp-month { width: 280px }
.dp-title { font: 700 15px/36px var(--body); text-align: center; margin: 0 0 8px }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px }
.dp-wk span { font: 700 11px/1 var(--body); color: var(--muted); text-align: center; padding: 6px 0 8px }
.dp-grid button { aspect-ratio: 1; width: 100%; padding: 0; border-radius: 999px; font: 600 14px/1 var(--body); color: var(--ink); background: none; font-variant-numeric: tabular-nums; position: relative }
.dp-grid button:hover:not([disabled]) { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent); filter: none }
.dp-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px }
.dp-grid button[disabled] { color: var(--muted); opacity: .4; cursor: default }
.dp-grid button.in, .dp-grid button.hov { background: var(--accent-soft); border-radius: 0 }
.dp.hovering .dp-grid button.in.act:not(.hov) { background: none }
.dp-grid button.hov:hover { background: var(--accent); color: var(--accent-ink); border-radius: 999px; box-shadow: none }
.dp.hovering:not(.flex) .dp-grid button.sel:not(.hov) { background: none; color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent) }
.dp-grid button.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent) }
.dp-grid button.sel, .dp-grid button.sel:hover, .dp-grid button.end, .dp-grid button.end:hover { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 14px -6px var(--accent) }
.dp-grid button.end { background: color-mix(in srgb, var(--accent) 55%, var(--surface)) }
.dp-grid button.sel.today::after, .dp-grid button.end.today::after { background: var(--accent-ink) }
.dp-back { position: fixed; inset: 0; z-index: 1999; background: rgb(10 15 28 / .45) }
@media (max-width: 640px) {
  .dp { position: fixed; left: 0; right: 0; bottom: 0; top: auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); border-width: 1px 0 0 }
  .dp-months, .dp-month { width: 100% }
  .dp-grid button { font-size: 16px }
  .dpick .flexmark { display: none }
}
.dpick .flexmark { font: 700 10px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 6px; vertical-align: 2px; margin-left: 4px }
.dp-head .dp-mode { display: flex; width: max-content; max-width: 100% }
.dp-head .dp-mode + .dp-close { margin-left: auto }
.dp-mode span { padding: 8px 14px }
.dp-hint { margin: -4px 0 12px; font-size: 13px; color: var(--muted) }

/* ---- map overlays */
.map-overlay { position: absolute; z-index: 500; pointer-events: none }
.map-overlay > * { pointer-events: auto }
.top-left { top: 12px; left: 56px; right: 200px }
.top-right { top: 12px; right: 12px; display: flex; gap: 6px }
.top-right select { width: auto; padding: 6px 8px; border-radius: 999px; background: var(--surface) }
.bottom-left { bottom: 22px; left: 12px }
#stageBox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow); font-size: 12px; max-width: 520px; pointer-events: auto }
#stageBox .codes { font-family: var(--mono); color: var(--muted); word-break: break-word }
.legend { background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 11px; display: grid; gap: 3px; pointer-events: auto }
.legend span { display: flex; align-items: center; gap: 6px }
.legend summary { cursor: pointer; font-weight: 700 }
.legend #legend { display: grid; gap: 3px; margin-top: 4px }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; flex: none }
.busy { position: absolute; z-index: 600; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--surface); padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 600 }

.leaflet-container { font: 12px var(--body); background: var(--surface-2) }
.leaflet-tooltip.ap-label { background: none; border: 0; box-shadow: none; padding: 0; font: 600 11px var(--mono); color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface) }
.leaflet-tooltip.ap-label::before { display: none }
.leaflet-tooltip.price-label { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; font: 700 11px var(--body); box-shadow: var(--shadow) }
.leaflet-tooltip.price-label::before { display: none }
.leaflet-tooltip.debug-label { background: none; border: 0; box-shadow: none; padding: 0; font: 500 10px var(--mono); color: var(--muted); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface) }
.leaflet-tooltip.debug-label::before { display: none }
.leaflet-tooltip.conn-tip { font: 12px/1.4 var(--body) }
.band-label { font: 700 11px var(--body); color: var(--accent); white-space: nowrap; text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface) }
.leaflet-popup-content { font: 13px/1.4 var(--body); margin: 10px 12px }
.leaflet-popup-content .menu { display: grid; gap: 6px }
.leaflet-popup-content .menu button { text-align: left }

/* ---- right panel */
.tabs { position: sticky; top: 0; z-index: 5; display: grid; grid-auto-flow: column; background: var(--surface); border-bottom: 1px solid var(--line) }
.tabs button { background: none; border: 0; padding: 12px 6px; color: var(--muted); border-bottom: 2px solid transparent }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent) }
.tab { padding: 12px }
.dir-toggle { display: grid; grid-auto-flow: column; gap: 4px; margin-bottom: 10px }
.dir-toggle button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 6px }
.dir-toggle button.on { color: var(--ink); border-color: var(--accent) }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px }
.compare .box { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--surface-2) }
.compare .box.geo { border-color: color-mix(in srgb, var(--good) 50%, var(--line)) }
.compare .kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted) }
.compare .path { font: 600 12px var(--mono); margin: 4px 0; word-break: break-word }
.compare .big { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums }
.saving-banner { border-radius: 12px; padding: 10px 12px; background: var(--good-soft); color: var(--good); font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px }
.saving-banner.none { background: var(--surface-2); color: var(--muted) }
.why { margin: 0 0 14px; padding-left: 18px; font-size: 12.5px; color: var(--muted) }
.why li { margin: 3px 0 }
.why b { color: var(--ink) }

.route { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface) }
.route:hover { border-color: var(--accent) }
.route.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft) }
.route .bar { border-radius: 4px }
.route .path { font: 600 13px var(--mono); word-break: break-word }
.route .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px }
.route .price { font-weight: 800; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums }
.route .save { font-size: 11px; font-weight: 700; text-align: right }
.route .tag { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--forced); letter-spacing: .04em }
.save.pos { color: var(--good) } .save.neg { color: var(--bad) }
.section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px }

.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px }
.flag { font: 700 9.5px var(--body); letter-spacing: .03em; padding: 2px 6px; border-radius: 6px; background: var(--warn-soft); color: var(--warn) }
.flag.hi { background: var(--bad-soft); color: var(--bad) }

.detail h2 { margin: 0; font-size: 20px; letter-spacing: -.01em }
.detail .sub { color: var(--muted); font-size: 13px; margin: 2px 0 12px }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; margin: 0 0 12px }
.kv dt { color: var(--muted) }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600 }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 }
.stats div { background: var(--surface-2); border-radius: 10px; padding: 8px; display: grid }
.stats small { color: var(--muted); font-size: 11px }
.stats b { font-size: 15px; font-variant-numeric: tabular-nums }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px }
.meter i { display: block; height: 100% }
.reason { border-left: 3px solid var(--accent); background: var(--surface-2); padding: 8px 10px; border-radius: 0 8px 8px 0; font-size: 13px; margin-bottom: 12px }
.reason.rej { border-left-color: var(--rej) }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px }
.role { font: 700 10px var(--body); text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; color: #fff; vertical-align: middle }

.leg { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 2px; background: var(--surface) }
.leg-top { display: flex; justify-content: space-between; font-weight: 700 }
.leg-top .mono { font-weight: 600 }
.leg small { color: var(--muted) }
.conn { margin: 4px 0 4px 18px; padding: 6px 10px; border-left: 2px dashed var(--line); font-size: 12px; color: var(--muted) }
.conn.self { border-left-color: var(--warn) }
.lcc { font: 700 9px var(--body); padding: 1px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: 4px; vertical-align: middle }

table.dbg { width: 100%; border-collapse: collapse; font-size: 11.5px }
table.dbg th { text-align: left; font-weight: 700; color: var(--muted); padding: 5px 4px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; position: sticky; top: 42px; background: var(--surface) }
table.dbg td { padding: 4px; border-bottom: 1px solid var(--line); vertical-align: top }
table.dbg td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
table.dbg tr { cursor: pointer }
table.dbg tr:hover td { background: var(--surface-2) }
table.dbg tr.rej td { color: var(--muted) }
.funnel { display: grid; gap: 4px; margin-bottom: 14px }
.funnel .f { display: grid; grid-template-columns: 150px 1fr 54px; gap: 8px; align-items: center; font-size: 12px }
.funnel .f i { display: block; height: 10px; border-radius: 4px; background: var(--accent); min-width: 2px }
.funnel .f b { text-align: right; font-variant-numeric: tabular-nums }
.dbg-filter { display: flex; gap: 6px; margin-bottom: 8px }
.dbg-filter select { width: auto; padding: 5px 8px; font-size: 12px }
.log-stage { margin-bottom: 12px; font-size: 12px }
.log-stage h4 { margin: 0 0 4px; font-size: 12px }
.log-stage .edges { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.6 }
.ok { color: var(--good) } .no { color: var(--bad) }

@media (max-width: 1100px) {
  .app { height: auto; grid-template-columns: 1fr; grid-template-rows: auto 62vh auto auto; grid-template-areas: "top" "map" "panel" "side" }
  .side, .panel { overflow: visible; border: 0 }
  .top-left { right: 12px; left: 12px; top: 56px }
  .brand span { display: none }
}
@media (max-width: 520px) {
  .compare { grid-template-columns: 1fr }
  .stats { grid-template-columns: repeat(2, 1fr) }
  .funnel .f { grid-template-columns: 110px 1fr 44px }
  .top-stats { display: none }
}

/* Changing airports by road: a step of its own, not a flight */
.ground { color: var(--warn); white-space: nowrap }
.ground-step { margin: 2px 0 6px; padding: 6px 8px; border-left: 3px dashed var(--warn); background: var(--surface-2); border-radius: 6px; font-size: 12px }

/* Routes a single ticket beats */
details.beaten > summary { cursor: pointer; list-style: revert }
details.beaten .route { opacity: .75 }

/* Nearby departure days */
.dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: thin }
.dates .date { flex: 0 0 auto; min-width: 72px; display: grid; gap: 1px; justify-items: center; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit }
.dates .date small { font-size: 11px; color: var(--muted) }
.dates .date b { font-size: 13px; font-variant-numeric: tabular-nums }
.dates .date i { font-size: 10px; color: var(--muted); font-style: normal }
.dates .date.low b { color: var(--good) }
.dates .date.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft) }
