/* Light theme: warm cream rather than pure white, the same family as the landing page. */
:root {
  --bg: #efebe2;
  --surface: #fbf9f4;
  --surface-2: #f4f1ea;
  --border: #e3ddd0;
  --text: #16191f;
  --muted: #645f57;
  --accent: #2563eb;
  --accent-soft: #e3ecff;
  --accent-text: #ffffff;
  --route: #2563eb;
  --highlight: #f97316;
  --airport: #3b4658;
  --ret: #0d9488;
  --ret-text: #ffffff;
  /* Map colour split: categorical slots in fixed order, then "Other". */
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  /* Corners: controls get the small radius, cards and popovers the medium one; only icon buttons are round. */
  --r-sm: 4px;
  --r-md: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}

/* Dark theme. index.html sets data-theme before first paint (the saved choice, else the system's); the toggle flips it. */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f232c;
  --border: #2a2f3a;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --accent: #6b9cff;
  --accent-soft: #1d2a47;
  --accent-text: #0f1115;
  --route: #6b9cff;
  --highlight: #fb923c;
  --airport: #a9b2c2;
  --ret: #2dd4bf;
  --ret-text: #0f1115;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  display: flex;
  flex-direction: column;
}

button, input, select { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.brand:hover h1 { color: var(--accent); }
.brand-icon { width: 24px; height: 24px; flex: none; }
.brand-icon .bloom-arcs { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.brand-icon .bloom-dots { fill: var(--accent); }
.brand-icon .bloom-star { fill: var(--highlight); }
.brand h1 { margin: 0; }
/*
 * Hovering the logo (top bar or landing page) relaunches it: the star winds up,
 * then the routes shoot out of it one after another, like new routes on the map
 * (see flyIn in app.js), and each destination pops in as its route arrives.
 */
.brand-icon { overflow: visible; }
.brand-icon .bloom-arcs path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.brand-icon .bloom-dots circle, .brand-icon .bloom-star { transform-box: fill-box; transform-origin: center; }
:is(.brand, .landing-brand):hover .brand-icon .bloom-star { animation: bloom-star .7s cubic-bezier(.3, .7, .4, 1); }
:is(.brand, .landing-brand):hover .brand-icon .bloom-arcs path {
  animation: bloom-arc .55s cubic-bezier(.45, 0, .55, 1) both; animation-delay: calc(var(--i) * 70ms + 120ms);
}
:is(.brand, .landing-brand):hover .brand-icon .bloom-dots circle {
  animation: bloom-dot .4s cubic-bezier(.3, .7, .4, 1.6) both; animation-delay: calc(var(--i) * 70ms + 600ms);
}
.brand-icon :is(.bloom-arcs path, .bloom-dots circle) { --i: 0; }
.brand-icon :is(.bloom-arcs path, .bloom-dots circle):nth-child(2) { --i: 1; }
.brand-icon :is(.bloom-arcs path, .bloom-dots circle):nth-child(3) { --i: 2; }
.brand-icon :is(.bloom-arcs path, .bloom-dots circle):nth-child(4) { --i: 3; }
@keyframes bloom-star {
  0%   { transform: scale(1) rotate(0); }
  20%  { transform: scale(.7) rotate(-15deg); }
  55%  { transform: scale(1.3) rotate(60deg); }
  100% { transform: scale(1) rotate(90deg); }
}
@keyframes bloom-arc { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes bloom-dot { from { transform: scale(0); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .brand-icon :is(.bloom-star, .bloom-arcs path, .bloom-dots circle) { animation: none !important; }
}
/* The name, set like the destination names on the result cards: the landing headline's serif, in plain case. */
.wordmark { font: 400 27px/1 "Instrument Serif", "Iowan Old Style", Georgia, serif; letter-spacing: -.005em; padding-top: 1px; }
.snapshot { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; text-align: right; }

/* Light/dark toggle, top right in the top bar and on the landing page. It shows the mode it switches to. */
.theme-toggle {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun, [data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 400px;
}
.panel { background: var(--surface); overflow-y: auto; min-height: 0; }
.filters { border-right: 1px solid var(--border); padding: 4px 16px 20px; }
.results { border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); }

.mobile-tabs { display: none; }

/* ---------- Filter groups ---------- */
.group { padding: 14px 0; border-bottom: 1px solid var(--border); }
.group:last-of-type { border-bottom: 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.group-label { display: block; font-weight: 600; font-size: 13px; }
.sub-label { font-size: 12px; color: var(--muted); }
.value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hint:empty { display: none; }

/* From: an inline label and the box beside it. */
.route-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; align-items: start; }
.route-picker .group-label { padding-top: 10px; }
#from-combo { grid-column: 2; }

/* Combobox */
.combo { position: relative; }
.combo-box {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  min-height: 38px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  cursor: text;
}
.combo-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-box input { flex: 1; min-width: 44px; border: 0; outline: 0; background: transparent; padding: 4px 2px; }
.token {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--text);
  border-radius: var(--r-sm); padding: 2px 4px 2px 8px; font-size: 13px; white-space: nowrap;
}
.token button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.token button:hover { color: var(--text); }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1000;
  max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.combo-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.combo-list li[aria-selected="true"] { background: var(--accent-soft); }
.combo-list .opt-sub { color: var(--muted); font-size: 12px; }
.combo-list .opt-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.combo-list .empty { color: var(--muted); cursor: default; }

/* Chips / segmented */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  padding: 4px 10px; cursor: pointer; font-size: 13px;
}
.chip .n { color: var(--muted); font-size: 12px; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .8; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; }
.segmented button { border: 0; background: none; padding: 6px; border-radius: calc(var(--r-sm) - 2px); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
.layover { margin-top: 12px; }
/* Stops: a small toggle tag under From, with the layover range below it when on. */
.route-extras { grid-column: 2; grid-row: 2; display: flex; gap: 6px; }
.route-picker .layover { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
.stop-tag {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); background: none; color: var(--muted);
  border-radius: var(--r-sm); padding: 2px 9px 2px 7px; font-size: 12px; cursor: pointer;
}
.stop-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.stop-tag:hover { color: var(--text); border-color: var(--muted); }
.stop-tag[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.stop-tag[aria-pressed="true"]::before { background: currentColor; box-shadow: none; }
.layover[hidden] { display: none; }

.presets { display: flex; gap: 6px; margin-top: 10px; }
.presets .chip { font-size: 12px; padding: 3px 8px; }

/* Range sliders */
.range { position: relative; height: 24px; }
.range .track, .range .fill { position: absolute; top: 10px; height: 4px; border-radius: 2px; }
.range .track { left: 0; right: 0; background: var(--border); }
.range .fill { background: var(--accent); }
.range input, input.single {
  -webkit-appearance: none; appearance: none; background: transparent;
  width: 100%; margin: 0; height: 24px;
}
.range input { position: absolute; inset: 0; pointer-events: none; }
.range input::-webkit-slider-thumb, input.single::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow);
}
.range input::-moz-range-thumb, input.single::-moz-range-thumb {
  pointer-events: auto; cursor: pointer;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
input.single::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--pct, 100%), var(--border) var(--pct, 100%)); }
input.single::-webkit-slider-thumb { margin-top: -7px; }
input.single::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
input.single::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }

/* Airlines checklist */
.checklist { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: var(--r-sm); cursor: pointer; }
.checklist label:hover { background: var(--surface-2); }
.checklist .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.checklist label.zero { opacity: .45; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
/* Airline logo in place of the dot; a dot (centred in the same space) stands in where there's no logo. */
/* Logos are square; with no padding the white only shows through transparent logos (e.g. SAS), never around full-bleed ones (e.g. Norwegian). */
.logo { width: 16px; height: 16px; flex: none; object-fit: contain; border-radius: 3px; background: #fff; }
.logo-dot { margin: 0 3.5px; }
input[type="checkbox"] { accent-color: var(--accent); margin: 0; }

.links { display: flex; gap: 10px; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; }

.text {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); outline: 0;
}
.text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; cursor: pointer; }

.reset {
  width: 100%; margin-top: 12px; padding: 9px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer;
}
.reset:hover { border-color: var(--accent); }

/* ---------- Hover feedback for the filter panel's controls ---------- */
:is(.chip, .segmented button, .stop-tag, .wk-day, .cal-nav, .reset, .link, .more button, .combo-box, .text, .token button, .combo-list li, .checklist label, .toggle) {
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.chip:hover:not([aria-pressed="true"]) {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.chip:hover:not([aria-pressed="true"]) .n { color: inherit; opacity: .75; }
.chip[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }
.segmented button:hover:not([aria-pressed="true"]) { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--accent); }
.wk-day:hover:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1px var(--accent); }
.wk-day[data-row="wdReturn"]:hover:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1px var(--ret); }
.reset:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.link:hover { text-decoration: underline; text-underline-offset: 2px; }
.more button:hover { border-color: var(--accent); color: var(--accent); }
.combo-box:hover:not(:focus-within), .text:hover:not(:focus) { border-color: color-mix(in srgb, var(--muted) 60%, var(--border)); }
.combo-list li:not(.empty):hover:not([aria-selected="true"]) { background: var(--surface-2); }
.token button:hover { color: var(--highlight); }
.toggle:hover { color: var(--accent); }
:is(.chip, .segmented button, .stop-tag, .wk-day, .reset, .more button):active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  :is(.chip, .segmented button, .stop-tag, .wk-day, .reset, .more button):active { transform: none; }
}

/* ---------- Results ---------- */
.result-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.result-list .note { color: var(--muted); padding: 16px 8px; text-align: center; }

.trip {
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.trip:hover { border-color: var(--highlight); }
.trip.active { border-color: var(--highlight); box-shadow: 0 0 0 2px color-mix(in srgb, var(--highlight) 30%, transparent); }
.trip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.plus-day { font-size: 11px; color: var(--highlight); vertical-align: super; margin-left: 1px; }

.trip-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.opt-fc { color: var(--accent); }
.fare { margin-left: auto; color: var(--text); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fare.stale { color: var(--muted); font-weight: 500; }
.fare.model { font-style: italic; font-weight: 400; }
.leg .fare { margin-left: 0; }
.no-num { cursor: help; }
.no-num-note { color: var(--muted); font-style: italic; }

.trip-detail { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.trip.active .trip-detail { display: block; }
.leg { display: grid; grid-template-columns: 52px 1fr; gap: 2px 8px; }
.leg + .leg, .layover-row + .leg { margin-top: 8px; }
.leg .t { font-variant-numeric: tabular-nums; font-weight: 600; }
.leg .sub { color: var(--muted); grid-column: 2; }
.book-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 22px;
  border-radius: var(--r-sm); color: var(--accent); background: var(--accent-soft); overflow: hidden;
  transition: background-color .15s, color .15s;
}
.book-icon:empty { background: none; }
.book-icon:hover, .book-icon:focus-visible { color: var(--accent-text); background: var(--accent); }
.book-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.book-icon svg { width: 26px; height: 20px; overflow: visible; }
.book-icon .runway { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-dasharray: 3 2.5; opacity: .55; }
.book-icon .plane {
  fill: currentColor; transform-box: fill-box; transform-origin: 30% 70%;
  transform: translate(-2px, 2px) rotate(14deg);  /* resting level on the runway */
}
.book-icon:hover .plane, .book-icon:focus-visible .plane { animation: takeoff 1.3s ease-in-out; }
/* Taxi, lift off and climb out of the button, then roll back in from the left. */
@keyframes takeoff {
  0%   { transform: translate(-2px, 2px) rotate(14deg); opacity: 1; }
  25%  { transform: translate(2px, 2px) rotate(14deg); animation-timing-function: ease-in; }
  60%  { transform: translate(22px, -16px) rotate(-6deg); opacity: 1; }
  61%  { transform: translate(-26px, 2px) rotate(14deg); opacity: 0; }
  65%  { opacity: 1; animation-timing-function: ease-out; }
  100% { transform: translate(-2px, 2px) rotate(14deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .book-icon:hover .plane, .book-icon:focus-visible .plane { animation: none; }
}
.layover-row { margin: 8px 0 0 60px; padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); }

.more { text-align: center; padding: 6px; }
.more button { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm); padding: 6px 12px; cursor: pointer; }

/* ---------- Map bits ---------- */
.leaflet-container { font: inherit; background: var(--surface-2); }
/* Light theme: tint Esri's neutral grey tiles toward the cream (land #efefef comes out about #f4f0e8, like --surface-2). */
:root:not([data-theme="dark"]) .leaflet-tile-pane { filter: sepia(.12) brightness(.98); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: var(--r-md); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-tooltip { background: var(--surface); color: var(--text); border-color: var(--border); }
/* Zoom buttons in the theme's colours instead of Leaflet's white. */
.leaflet-bar a { background-color: var(--surface); color: var(--text); border-bottom-color: var(--border); }
.leaflet-bar a:hover, .leaflet-bar a:focus { background-color: var(--surface-2); }
.leaflet-bar a.leaflet-disabled { background-color: var(--surface-2); color: var(--muted); }

/* Route hover card: destination photo with the city over it, then the route and its flight count. */
.leaflet-tooltip.route-tip {
  padding: 0; width: 264px; border: 0; border-radius: var(--r-md); overflow: hidden; white-space: normal;
  box-shadow: 0 0 0 1px var(--border), 0 18px 40px -12px rgba(0, 0, 0, .45);
}
.leaflet-tooltip.route-tip::before { display: none; }
.route-card { position: relative; }
.rc-photo {
  position: relative; height: 148px;
  background: linear-gradient(110deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 60%, var(--border)) 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: rc-shimmer 1.4s linear infinite;
}
.rc-photo:has(img.ready) { animation: none; }
.rc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.rc-photo img.ready { opacity: 1; }
.rc-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(5, 8, 15, .78) 100%);
}
.rc-photo.none, .rc-photo.failed {
  animation: none;
  background: radial-gradient(120% 140% at 85% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
              linear-gradient(160deg, #1b2a4e, #0b1020);
}
.rc-photo.failed img { display: none; }
.rc-place { position: absolute; left: 14px; right: 14px; top: 148px; transform: translateY(-100%); padding-bottom: 10px; color: #fff; }
.rc-city { font: 400 27px/1.05 "Instrument Serif", "Iowan Old Style", Georgia, serif; letter-spacing: -.01em; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.rc-sub { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.rc-body { padding: 11px 14px 12px; }
.rc-route { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.rc-arrow { flex: 1; height: 1px; background: var(--border); position: relative; max-width: 54px; }
.rc-arrow::after {
  content: ""; position: absolute; right: -1px; top: -3px; width: 6px; height: 6px;
  border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg);
}
.rc-names { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-count { margin-top: 9px; font-size: 13px; color: var(--muted); }
.rc-count strong { color: var(--accent); font-size: 18px; font-weight: 700; margin-right: 2px; font-variant-numeric: tabular-nums; }
.rc-hint { margin-top: 3px; font-size: 11px; color: var(--muted); opacity: .8; }
.rc-credit {
  padding: 5px 14px 6px; font-size: 9.5px; color: var(--muted); border-top: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8;
}
@keyframes rc-shimmer { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .rc-photo { animation: none; } .rc-photo img { transition: none; } }
.popup h3 { margin: 0 0 2px; font-size: 14px; }
.popup .sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.popup .actions { display: flex; gap: 6px; }
.popup .actions button {
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  border-radius: var(--r-sm); padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr) 340px; }
}

@media (max-width: 900px) {
  body { height: auto; min-height: 100%; }
  /* Logo and theme toggle on one row, the snapshot line under them. */
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .brand { justify-self: start; }
  .snapshot { grid-column: 1 / -1; grid-row: 2; margin: 0; text-align: left; font-size: 12px; }
  .layout { display: flex; flex-direction: column; }
  .map-wrap { order: -1; height: 42vh; min-height: 260px; flex: none; }
  .mobile-tabs {
    display: grid; grid-template-columns: 1fr 1fr; position: sticky; top: 0; z-index: 600;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .mobile-tabs button { border: 0; background: none; padding: 10px; cursor: pointer; border-bottom: 2px solid transparent; }
  .mobile-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 600; }
  .panel { border: 0; overflow: visible; }
  .results { overflow: visible; }
  .result-list { overflow: visible; }
  .panel[data-hidden="true"] { display: none; }
  .filters { padding: 0 16px 20px; }
  .result-list { padding: 8px 16px; }
}

/* Mobile tab bar sits above the map in DOM; move it below the map on small screens. */
/* The column is the screen width: minmax(0, …) stops one-line card text (cut with an ellipsis) from widening the page. */
@media (max-width: 900px) {
  body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; }
  .topbar { grid-row: 1; }
  .layout { display: contents; }
  .map-wrap { grid-row: 2; }
  .mobile-tabs { grid-row: 3; }
  .filters, .results { grid-row: 4; }
}

/* No focus box around map shapes / map after a mouse click. */
.leaflet-interactive:focus { outline: none; }
.leaflet-container:focus:not(:focus-visible) { outline: none; }

/* ---------- When ---------- */
.when-label { display: block; margin: 12px 0 6px; }
.week-grid { display: grid; grid-template-columns: auto repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; margin-top: 10px; }
.wk-head { text-align: center; font-size: 11px; color: var(--muted); }
.wk-row { font-size: 12px; color: var(--muted); padding-right: 4px; }
.wk-day {
  height: 28px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; padding: 0;
  background: color-mix(in srgb, var(--accent) var(--heat), var(--surface));
}
.wk-day:hover { border-color: var(--accent); }
.wk-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.wk-day[data-row="wdReturn"]:hover { border-color: var(--ret); }
.wk-day[data-row="wdReturn"] { background: color-mix(in srgb, var(--ret) var(--heat), var(--surface)); }
.wk-day[data-row="wdReturn"][aria-pressed="true"] { background: var(--ret); border-color: var(--ret); }
.wk-day[aria-pressed="true"]::after { content: "✓"; color: var(--accent-text); font-size: 13px; }
.wk-day[data-row="wdReturn"][aria-pressed="true"]::after { color: var(--ret-text); }
.wk-day.nodata { border-style: dashed; }
.group[hidden] { display: none; }
.months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.months .chip { height: 28px; padding: 0; text-align: center; white-space: nowrap; }

/* When calendar: a preview of the picked dates (set with Month and Days of the week).
   Leave/come-back days light up, joined by a band for the stay; each week's box leaves it out. */
.cal-preview { margin-top: 14px; padding: 10px 10px 8px; border-radius: var(--r-md); background: var(--surface-2); }
.cal-label { margin-bottom: 4px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: 10.5px; }
.cal-hint { margin-top: 8px; font-size: 11.5px; }
.cal { --stay: color-mix(in srgb, var(--accent) 18%, transparent); user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { font-weight: 600; font-size: 13px; }
.cal-nav {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; line-height: 1; font-size: 15px; padding: 0;
}
.cal-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: 18px repeat(7, 1fr); row-gap: 2px; overflow: hidden; }
.cal-week { display: grid; place-items: center; cursor: pointer; }
.cal-week.off { visibility: hidden; }
.cal-week input { width: 13px; height: 13px; cursor: pointer; }
.cal-grid.fresh .cal-week { animation: cal-cell-in .35s ease-out both; animation-delay: calc(var(--i) * 12ms); }
.cal-day.skipped { text-decoration: line-through; }
.cal-grid.fwd { animation: cal-slide .32s ease-out; }
.cal-grid.back { animation: cal-slide .32s ease-out reverse; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cal-day {
  position: relative; isolation: isolate; height: 30px; display: grid; place-items: center;
  border: 0; padding: 0; background: none; font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: var(--muted); opacity: .45; transition: color .25s var(--d, 0ms), opacity .25s var(--d, 0ms);
}
.cal-grid.fresh .cal-day { animation: cal-cell-in .35s ease-out both; animation-delay: calc(var(--i) * 12ms); }
/* The lit circle... */
.cal-day::before {
  content: ""; position: absolute; z-index: -1; top: 1px; bottom: 1px; left: calc(50% - 14px); width: 28px;
  border-radius: 50%; opacity: 0; transform: scale(.4);
  transition: opacity .2s, transform .2s, background-color .2s;
}
/* ...and the stay band behind it, which sweeps in from the left. */
.cal-day::after {
  content: ""; position: absolute; z-index: -2; top: 4px; bottom: 4px; left: 0; right: 0;
  background: var(--stay); transform: scaleX(0); transform-origin: left;
  transition: transform .28s ease-out var(--d, 0ms);
}
.cal-day[data-kind="window"], .cal-day[data-kind="stay"] { color: var(--text); opacity: 1; }
/* Days from the neighbouring months stay muted unless they're a leave/come-back day. */
.cal-day.adj:not([data-kind="leave"]):not([data-kind="ret"]):not([data-kind="both"]) { color: var(--muted); }
.cal-day[data-kind="stay"]::after { transform: scaleX(1); }
.cal-day[data-band="r"]::after { left: 50%; transform: scaleX(1); }
.cal-day[data-band="l"]::after { right: 50%; transform: scaleX(1); }
.cal-day[data-band="lr"]::after { transform: scaleX(1); }
.cal-day[data-kind="leave"], .cal-day[data-kind="ret"], .cal-day[data-kind="both"] { opacity: 1; font-weight: 600; }
.cal-day[data-kind="leave"] { color: var(--accent-text); }
.cal-day[data-kind="ret"], .cal-day[data-kind="both"] { color: var(--ret-text); }
.cal-day[data-kind="leave"]::before, .cal-day[data-kind="ret"]::before, .cal-day[data-kind="both"]::before {
  opacity: 1; transform: scale(1); animation: cal-pop .45s cubic-bezier(.3, .7, .4, 1) var(--d, 0ms) both;
}
.cal-day[data-kind="leave"]::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.cal-day[data-kind="ret"]::before { background: var(--ret); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ret) 22%, transparent); }
.cal-day[data-kind="both"]::before { background: linear-gradient(135deg, var(--accent) 50%, var(--ret) 50%); }
.cal-day.today:not([data-kind="leave"]):not([data-kind="ret"]):not([data-kind="both"]) { font-weight: 700; color: var(--accent); opacity: 1; }
.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.cal-legend .sw { width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
.cal-legend .sw:first-child { margin-left: 0; }
.cal-legend .sw.leave { background: var(--accent); }
.cal-legend .sw.ret { background: var(--ret); }
.cal-legend .sw.stay { background: var(--stay); border-radius: 3px; width: 16px; }
@keyframes cal-pop {
  0% { transform: scale(.2); opacity: 0; }
  55% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes cal-cell-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes cal-slide { from { opacity: 0; transform: translateX(14px); } }
@media (prefers-reduced-motion: reduce) {
  .cal-grid, .cal-week, .cal-day, .cal-day::before, .cal-day::after { animation: none !important; transition: none !important; }
}

/* ---------- Destination photo cards (one-way and round trip) ---------- */
/* The header sits on the destination's photo under a wash: cream with dark text in the light theme,
   dark with light text in the dark one. The wash is lightest in the middle, between the name and the counts. */
.trip.photo { padding: 0; overflow: hidden; }
.card-hero {
  --muted: #4a453e;  /* a step darker than the page's, since it sits on a photo */
  position: relative; isolation: isolate; padding: 11px 12px 10px;
  color: var(--text); background: var(--surface-2); text-shadow: 0 0 10px rgba(251, 249, 244, .9);
}
.card-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(251, 249, 244, .84) 0%, rgba(251, 249, 244, .56) 50%, rgba(251, 249, 244, .72) 100%);
}
/* Dark theme: re-point the colour tokens at light-on-dark values for everything inside. */
[data-theme="dark"] .card-hero {
  --text: #f5f7fb; --muted: rgba(236, 240, 247, .74); --border: rgba(255, 255, 255, .3);
  --surface: #1c2029; --accent: #9dbbff; --accent-soft: rgba(255, 255, 255, .14); --accent-text: #0f1115;
  --highlight: #fdba74;
  background: #1a1e27; text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .card-hero::before {
  background: linear-gradient(100deg, rgba(9, 11, 18, .9) 0%, rgba(9, 11, 18, .72) 55%, rgba(9, 11, 18, .55) 100%);
}
.card-photo {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.85); opacity: 0; transform: scale(1.02);
  transition: opacity .4s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
[data-theme="dark"] .card-photo { filter: saturate(.75); }
.card-photo.ready { opacity: 1; }
.trip.photo:hover .card-photo, .trip.photo.active .card-photo { transform: scale(1.07); }
.card-hero .book-icon { text-shadow: none; }
.card-hero .fare.stale { color: var(--muted); }

.dest-title { display: flex; flex-direction: column; min-width: 0; }
.dest-city {
  font: 400 23px/1.05 "Instrument Serif", "Iowan Old Style", Georgia, serif; letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dest-sub {
  margin-top: 3px; font-size: 11.5px; color: var(--muted); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip.photo .trip-detail { margin: 0; padding: 10px 12px; border-top: 0; }

/* Round trip: a taller header with the destination and how many flights each way. */
.dest .card-hero { padding: 16px 14px; }
.dest .dest-city { font-size: 27px; }
.dest-row { display: flex; align-items: flex-end; gap: 12px; }
.dest-row .dest-title { flex: 1; }
.dest-stat {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  font-size: 11.5px; color: var(--muted); white-space: nowrap; line-height: 1.25;
}
.dest-stat strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; margin-right: 2px; }
@media (prefers-reduced-motion: reduce) {
  .card-photo { transition: none; transform: none !important; }
}

.pick-summary { padding: 8px 10px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 12.5px; }
.dir-head { margin: 12px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.opt {
  display: grid; grid-template-columns: 34px 1fr auto 34px; gap: 0 8px; align-items: baseline;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer;
}
.opt:hover { border-color: var(--highlight); }
.opt.picked { border-color: var(--highlight); background: color-mix(in srgb, var(--highlight) 12%, transparent); }
.opt.clash { opacity: .45; }
.opt-day { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.opts.dated .opt { grid-template-columns: 74px 1fr auto 34px; }
.opt-time { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt-dur { font-size: 12px; color: var(--muted); text-align: right; }
.opt .book-icon { grid-column: 4; grid-row: 1 / span 2; align-self: center; }
.opt-flight { grid-column: 2 / 4; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
/* The picked one-way flight's legs, right under its row. */
.opt-detail { list-style: none; margin: -2px 0 4px; padding: 8px 10px; border-radius: 0 0 var(--r-sm) var(--r-sm); background: var(--surface-2); }
.opt.picked:has(+ .opt-detail) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

/* ---------- Landing page ---------- */
.landing {
  --l-bg: #f4f1ea;
  --l-ink: #12151d;
  --l-muted: #6a6f7b;
  --l-line: rgba(18, 21, 29, .12);
  --l-field: #fbf9f4;
  --l-field-border: rgba(18, 21, 29, .16);
  --l-pop: #fbf9f4;
  --l-hover: #f1ede4;
  --l-accent: #2554d8;
  --l-accent-text: #ffffff;
  --l-arc: #2554d8;
  --l-origin: #e8590c;
  --l-dot: rgba(18, 21, 29, .28);
  --l-land: rgba(18, 21, 29, .045);
  --l-coast: rgba(18, 21, 29, .1);
  /* Only the suggestion list floats; the search field sits flat on the page. */
  --l-shadow: 0 12px 32px -12px rgba(18, 21, 29, .25);
  --l-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  position: fixed; inset: 0; z-index: 5000;
  display: none;
  color: var(--l-ink);
  background: var(--l-bg);
  overflow: hidden;
}
[data-theme="dark"] .landing {
  --l-bg: #0a0e19;
  --l-ink: #eef1f7;
  --l-muted: #8a93a6;
  --l-line: rgba(238, 241, 247, .1);
  --l-field: #121726;
  --l-field-border: rgba(255, 255, 255, .14);
  --l-pop: #121726;
  --l-hover: #1b2235;
  --l-accent: #7ea3ff;
  --l-accent-text: #0a0e19;
  --l-arc: #7ea3ff;
  --l-origin: #ffa85c;
  --l-dot: rgba(238, 241, 247, .3);
  --l-land: rgba(238, 241, 247, .035);
  --l-coast: rgba(238, 241, 247, .09);
  --l-shadow: 0 16px 40px -16px rgba(0, 0, 0, .7);
}
.show-landing body { overflow: hidden; }
.show-landing .landing { display: block; animation: landing-in .6s cubic-bezier(.2, .7, .2, 1) both; }
.landing.leaving { animation: landing-out .45s cubic-bezier(.6, 0, .4, 1) both; pointer-events: none; }
@keyframes landing-in { from { opacity: 0; } }
@keyframes landing-out { to { opacity: 0; transform: scale(1.03); } }

/*
 * Route map: framed to the right on wide screens, behind everything (faded) on small ones.
 * The land runs on past the frame across the whole page and fades out towards every edge,
 * and under the headline, so the map has no box around it.
 */
.landing-map {
  position: absolute; inset: 0;
  --fade-x: linear-gradient(90deg, transparent 8%, rgba(0, 0, 0, .3) 30%, #000 54%);
  --fade-edges: radial-gradient(ellipse 46% 62% at 66% 50%, #000 52%, rgba(0, 0, 0, .45) 78%, transparent 100%);
  -webkit-mask-image: var(--fade-x), var(--fade-edges);
  mask-image: var(--fade-x), var(--fade-edges);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.landing-map svg { position: absolute; top: 6%; left: 38%; width: 59.5%; height: 88%; overflow: visible; }
.landing-map .dot { fill: var(--l-dot); }
.landing-map .dot.dest { fill: var(--l-arc); opacity: .9; transition: opacity .4s; }
.landing-map .land { fill: var(--l-land); stroke: var(--l-coast); stroke-width: .6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/*
 * Width (--w, in screen pixels) and opacity per route, from showNetwork(); --px is one screen
 * pixel in map units. Not vector-effect: non-scaling-stroke, which would measure the
 * pathLength-based dash in screen pixels too and stop each arc short of its destination.
 */
.landing-map .arc {
  fill: none; stroke: var(--l-arc); stroke-linecap: round; stroke-width: calc(var(--w) * var(--px, 1px));
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: arc-draw 1.1s cubic-bezier(.3, .6, .2, 1) forwards;
}
.landing-map .arcs.fading { opacity: 0; transition: opacity .5s; }
.landing-map .origin-ring { fill: none; stroke: var(--l-origin); stroke-width: 1.5; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; }
.landing-map .origin-dot { fill: var(--l-origin); }
.landing-map .plane { fill: var(--l-arc); stroke: var(--l-bg); stroke-width: .5; paint-order: stroke; }
.landing-map .origin-label { font: 600 7px/1 var(--font); fill: var(--l-ink); letter-spacing: .02em; paint-order: stroke; stroke: var(--l-bg); stroke-width: 2.5px; stroke-linejoin: round; }
.landing-map .origin-sub { font: 500 4.6px/1 var(--font); fill: var(--l-muted); paint-order: stroke; stroke: var(--l-bg); stroke-width: 2px; stroke-linejoin: round; }
@keyframes arc-draw { to { stroke-dashoffset: 0; } }
@keyframes ring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

.landing-inner {
  position: relative; z-index: 2; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 28px clamp(16px, 5vw, 72px);
  max-width: 1440px; margin: 0 auto;
}
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.landing-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.landing-brand .brand-icon .bloom-arcs { stroke: var(--l-accent); }
.landing-brand .brand-icon .bloom-dots { fill: var(--l-accent); }
.landing-brand .brand-icon .bloom-star { fill: var(--l-origin); }
.landing-close {
  display: none; align-items: center; gap: 8px;
  border: 1px solid var(--l-line); background: var(--l-field); color: var(--l-ink);
  border-radius: var(--r-sm); padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.landing-close span { font-size: 16px; line-height: 1; color: var(--l-muted); }
.landing-close:hover { border-color: var(--l-accent); }
.landing.reopened .landing-close { display: inline-flex; }
.landing-actions { display: flex; align-items: center; gap: 8px; }
.landing .theme-toggle { border-color: var(--l-line); background: var(--l-field); color: var(--l-ink); }
.landing .theme-toggle:hover { border-color: var(--l-accent); color: var(--l-accent); }

.landing-hero { align-self: center; width: min(620px, 100%); padding: 24px 0 40px; }
.landing-title {
  margin: 0 0 34px; font: 400 clamp(46px, 7.2vw, 96px)/.96 var(--l-serif); letter-spacing: -.02em;
  text-wrap: balance;
}

.landing-search {
  position: relative; z-index: 5; display: flex; align-items: center; gap: 4px;
  height: 66px; padding: 0 7px 0 18px;
  background: var(--l-field); border: 1px solid var(--l-field-border); border-radius: var(--r-md);
  transition: border-color .2s, box-shadow .2s;
}
/* Focus: the border turns accent and doubles to 2px, no halo. */
.landing-search:focus-within { border-color: var(--l-accent); box-shadow: 0 0 0 1px var(--l-accent); }
/* The same orange dot and ring that marks the starting airport on the map. */
.landing-pin { width: 18px; height: 18px; flex: none; }
.landing-pin .pin-dot { fill: var(--l-origin); }
.landing-pin .pin-ring { fill: none; stroke: var(--l-origin); stroke-width: 1.5; opacity: .45; }
.landing-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--l-ink);
  font-size: 18px; padding: 0 10px; letter-spacing: -.005em;
}
.landing-search input::placeholder { color: var(--l-muted); opacity: .8; }
.landing-go {
  flex: none; height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-sm); cursor: pointer;
  background: var(--l-ink); color: var(--l-bg); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 10px; transition: transform .15s, background .2s;
}
.landing-go span { transition: transform .2s; }
.landing-go:hover { background: var(--l-accent); color: var(--l-accent-text); }
.landing-go:hover span { transform: translateX(3px); }
.landing-go:active { transform: scale(.98); }

.landing-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 10;
  margin: 0; padding: 6px; list-style: none; max-height: min(420px, 50vh); overflow-y: auto;
  background: var(--l-pop); border: 1px solid var(--l-field-border); border-radius: var(--r-md); box-shadow: var(--l-shadow);
  animation: list-in .18s ease-out;
}
@keyframes list-in { from { opacity: 0; transform: translateY(-4px); } }
.landing-list li {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 9px 12px 9px 9px; border-radius: var(--r-sm); cursor: pointer;
}
.landing-list li[aria-selected="true"] { background: var(--l-hover); }
.landing-list .code {
  height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  font: 600 12.5px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em;
  background: color-mix(in srgb, var(--l-accent) 12%, transparent); color: var(--l-accent);
}
.landing-list .code.country { font-family: var(--font); font-size: 17px; }
.landing-list .name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.landing-list .name mark { background: none; color: inherit; font-weight: 700; }
.landing-list .sub { font-size: 12.5px; color: var(--l-muted); }
.landing-list .meta { font-size: 12.5px; color: var(--l-muted); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.landing-list .meta strong { display: block; color: var(--l-ink); font-size: 14px; font-weight: 600; }
.landing-list .empty { display: block; color: var(--l-muted); cursor: default; padding: 14px; }

/* Popular starting points as a line of plain links, comma-separated. */
.landing-popular { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; margin-top: 22px; min-height: 34px; font-size: 14px; }
.landing-popular .label { color: var(--l-muted); margin-right: 8px; }
.landing-popular button {
  border: 0; background: none; padding: 2px 0; color: var(--l-ink); font-size: inherit; cursor: pointer;
  text-decoration: underline 1px color-mix(in srgb, var(--l-ink) 28%, transparent); text-underline-offset: 4px;
  transition: color .2s, text-decoration-color .2s;
  animation: chip-in .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 45ms + 150ms);
}
.landing-popular button:not(:last-child)::after { content: ","; display: inline-block; margin-right: .4em; color: var(--l-muted); }
.landing-popular button:hover, .landing-popular button.active { color: var(--l-accent); text-decoration-color: currentColor; }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px); } }

.landing-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--l-line); font-size: 13px; color: var(--l-muted);
}
.landing-stats { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.landing-stats strong { color: var(--l-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.landing-skip { border: 0; background: none; padding: 0; color: var(--l-ink); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.landing-skip span { display: inline-block; transition: transform .2s; }
.landing-skip:hover { color: var(--l-accent); }
.landing-skip:hover span { transform: translateX(3px); }
.landing :focus-visible { outline: 2px solid var(--l-accent); outline-offset: 3px; }
.landing-search input:focus-visible { outline: 0; }

@media (max-width: 900px) {
  .landing-map {
    width: 100%; opacity: .45;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 75%, transparent 100%);
  }
  .landing-map svg { top: 4%; left: 0; width: 100%; height: 92%; }
  .landing-hero { padding-bottom: 24px; }
}

@media (max-width: 560px) {
  .landing-inner { padding: 20px 16px; }
  .landing-title { margin-bottom: 26px; }
  .landing-search { height: 58px; padding-left: 16px; }
  .landing-search input { font-size: 16px; padding: 0 8px; }
  .landing-go { height: 46px; padding: 0 16px; font-size: 0; gap: 0; }
  .landing-go span { font-size: 18px; }
  .landing-list li { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .landing-list .code { height: 36px; font-size: 11.5px; }
  .landing-list .meta span { display: none; }
  .landing-foot { font-size: 12px; }
  .landing-stats { gap: 2px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .landing, .landing *, .landing *::before { animation: none !important; transition: none !important; }
  .landing-map .arc { stroke-dashoffset: 0; }
}

/* ---------- Booking button: slides up at the bottom of the results once a selection is complete ---------- */
.results { position: relative; }
.book-bar {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0; transform: translateY(16px); visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, .9, .3, 1.15), visibility 0s .3s;
}
.book-bar.show {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .2s ease, transform .35s cubic-bezier(.2, .9, .3, 1.15), visibility 0s;
}
.bb-go {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-text); text-decoration: none;
  box-shadow: 0 0 0 4px var(--surface), 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: filter .15s ease, box-shadow .15s ease;
}
.bb-go:hover { filter: brightness(1.07); }
.bb-go:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.bb-go .logo { width: 22px; height: 22px; border-radius: var(--r-sm); padding: 2px; }
.bb-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bb-label { font-weight: 650; font-size: 14px; }
.bb-sub { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-ext { font-size: 16px; transition: transform .15s ease; }
.bb-go:hover .bb-ext { transform: translate(2px, -2px); }
/* Room below the last card so the button never hides it. */
.has-book-bar .result-list { padding-bottom: 76px; }
.has-book-bar:has(.bb-go + .bb-go) .result-list { padding-bottom: 136px; }
/* Stacked layout: the page scrolls, so the button sticks to the bottom of the screen within the results. */
@media (max-width: 900px) {
  .book-bar { position: sticky; left: auto; right: auto; bottom: 12px; margin: 0 16px; }
  .book-bar:not(.show) { display: none; }
  .has-book-bar .result-list, .has-book-bar:has(.bb-go + .bb-go) .result-list { padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .book-bar, .book-bar.show { transform: none; }
  .bb-ext { transition: none; }
}
