/* Avianod — aurora glass theme. Light and dark share one set of tokens. */
:root {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Unbounded", var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --grad: linear-gradient(135deg, #6366f1 0%, #a855f7 52%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(99, 102, 241, .16), rgba(236, 72, 153, .12));
  --glow-btn: 0 14px 34px -14px rgba(168, 85, 247, .85);

  color-scheme: light;
  --bg: #f3f4fb;
  --blob-1: rgba(129, 140, 248, .38);
  --blob-2: rgba(236, 72, 153, .20);
  --blob-3: rgba(34, 211, 238, .24);
  --surface: rgba(255, 255, 255, .70);
  --surface-solid: #ffffff;
  --card: rgba(255, 255, 255, .86);
  --card-solid: #ffffff;
  --surface-2: rgba(15, 23, 42, .045);
  --field: #ffffff;
  --border: rgba(15, 23, 42, .09);
  --border-strong: rgba(15, 23, 42, .17);
  --text: #0e1030;
  --muted: #575d80;
  --faint: #8a8fae;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --accent-soft: rgba(124, 58, 237, .11);
  --good: #059669;
  --warn: #b45309;
  --bad: #e11d48;
  --track: rgba(15, 23, 42, .11);
  --shadow: 0 1px 2px rgba(30, 27, 75, .05), 0 14px 34px -18px rgba(30, 27, 75, .28);
  --shadow-lg: 0 30px 60px -30px rgba(76, 29, 149, .40);
  --grid-line: rgba(15, 23, 42, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07081a;
    --blob-1: rgba(99, 102, 241, .34);
    --blob-2: rgba(217, 70, 239, .20);
    --blob-3: rgba(34, 211, 238, .16);
    --surface: rgba(20, 23, 48, .62);
    --surface-solid: #12152e;
    --card: rgba(17, 20, 42, .80);
    --card-solid: #11142b;
    --surface-2: rgba(255, 255, 255, .05);
    --field: rgba(255, 255, 255, .045);
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .18);
    --text: #eef0ff;
    --muted: #a3a8cc;
    --faint: #70759c;
    --accent: #a78bfa;
    --accent-2: #22d3ee;
    --accent-soft: rgba(167, 139, 250, .15);
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #fb7185;
    --track: rgba(255, 255, 255, .11);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 22px 44px -26px rgba(0, 0, 0, .9);
    --shadow-lg: 0 40px 80px -40px rgba(99, 102, 241, .60);
    --grid-line: rgba(255, 255, 255, .04);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07081a;
  --blob-1: rgba(99, 102, 241, .34);
  --blob-2: rgba(217, 70, 239, .20);
  --blob-3: rgba(34, 211, 238, .16);
  --surface: rgba(20, 23, 48, .62);
  --surface-solid: #12152e;
  --card: rgba(17, 20, 42, .80);
  --card-solid: #11142b;
  --surface-2: rgba(255, 255, 255, .05);
  --field: rgba(255, 255, 255, .045);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .18);
  --text: #eef0ff;
  --muted: #a3a8cc;
  --faint: #70759c;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-soft: rgba(167, 139, 250, .15);
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --track: rgba(255, 255, 255, .11);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 22px 44px -26px rgba(0, 0, 0, .9);
  --shadow-lg: 0 40px 80px -40px rgba(99, 102, 241, .60);
  --grid-line: rgba(255, 255, 255, .04);
}

* { box-sizing: border-box; }

/* Author rules beat the user-agent [hidden] rule, and .field is display:flex,
   so hiding a field needs to say so explicitly. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(168, 85, 247, .35); }

.ico {
  width: 1em; height: 1em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------ background */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 100%);
}
.aurora span {
  position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%;
  background: radial-gradient(closest-side, var(--c), transparent);
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { --c: var(--blob-1); top: -32vmax; left: -18vmax; }
.aurora span:nth-child(2) { --c: var(--blob-2); top: -24vmax; right: -26vmax; animation-duration: 34s; animation-delay: -9s; }
.aurora span:nth-child(3) { --c: var(--blob-3); bottom: -38vmax; left: 22vw; animation-duration: 40s; animation-delay: -17s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; min-width: 0; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 19px;
  box-shadow: 0 10px 24px -10px rgba(168, 85, 247, .9);
}
.brand-name { font: 700 18px/1 var(--font-display); letter-spacing: -.02em; }
.brand-tag {
  font-size: 12px; font-weight: 600; color: var(--faint); padding-left: 11px;
  border-left: 1px solid var(--border-strong); white-space: nowrap;
}
.status { display: flex; align-items: center; gap: 8px; min-width: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.pill.on { color: var(--text); }
.pill.on::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.pill.off { border-style: dashed; }
.pill.off::before { background: var(--warn); }

/* EN | RU */
.lang-switch {
  display: inline-flex; flex: 0 0 auto; padding: 3px; gap: 2px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.lang-switch button {
  height: 30px; min-width: 38px; padding: 0 9px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); font: 800 12px var(--font); letter-spacing: .06em;
  transition: background .2s, color .2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active { background: var(--grad); color: #fff; }
/* Until app.js has swapped the English for Russian, show no words at all. */
.i18n-pending [data-i18n] { visibility: hidden; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 17px; cursor: pointer; transition: background .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); transform: rotate(-12deg); }
.icon-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }

/* ---------------------------------------------------------------- layout */
.layout {
  display: grid; grid-template-columns: 388px minmax(0, 1fr);
  gap: 24px; padding: 24px clamp(16px, 3vw, 32px) 56px;
  max-width: 1480px; margin: 0 auto; align-items: start;
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}

/* The form is taller than the viewport once every option is open. A plain
   sticky panel would then pin its top and leave the bottom unreachable, so it
   scrolls within itself. */
.search {
  position: sticky; top: 86px;
  display: flex; flex-direction: column; gap: 0;
  max-height: calc(100vh - 104px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 20px 0;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}

.group { display: flex; flex-direction: column; gap: 12px; padding: 16px 0 18px; }
.group + .group { border-top: 1px solid var(--border); }
.group-title {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font: 700 11.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.group-title .ico { font-size: 15px; color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .label-row > label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field > label small, .label-row > label small { font-weight: 500; color: var(--faint); margin-left: 5px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.field label.inline {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row.single { grid-template-columns: 1fr; }
.row > .field { min-width: 0; }

/* --------------------------------------------------------------- inputs */
input[type=text], input[type=date], input[type=number], select {
  width: 100%; height: 44px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--field); color: var(--text);
  font: 600 14px var(--font);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type=date] { padding-right: 8px; }
input::placeholder { color: var(--faint); font-weight: 500; }
input[type=text]:hover, input[type=date]:hover, input[type=number]:hover, select:hover { border-color: var(--border-strong); }
input[type=text]:focus, input[type=date]:focus, input[type=number]:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8fae' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select option { background: var(--surface-solid); color: var(--text); }

/* chips + type-ahead */
.combo { position: relative; }
.chips {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 50px; padding: 7px 8px 7px 42px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--field);
  cursor: text; transition: border-color .2s, box-shadow .2s;
}
.chips:hover { border-color: var(--border-strong); }
.chips:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chips .lead { position: absolute; left: 14px; top: 16px; font-size: 18px; color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 5px 0 11px;
  border-radius: 10px; background: var(--grad-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--text); font: 800 13px/1 var(--font); letter-spacing: .06em;
  animation: pop .25s var(--ease);
}
.chip button {
  width: 20px; height: 20px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  transition: background .15s, color .15s;
}
.chip button:hover { background: var(--bad); color: #fff; }
.chip.bad {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  color: var(--bad); text-decoration: line-through;
}
.chip-input {
  flex: 1; min-width: 96px; height: 32px !important;
  border: 0 !important; padding: 0 4px !important; background: none !important; box-shadow: none !important;
}
@keyframes pop { from { transform: scale(.8); opacity: 0; } }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow), var(--shadow-lg); padding: 6px;
  max-height: 290px; overflow-y: auto; animation: drop .18s var(--ease);
}
.suggest div {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px;
  cursor: pointer; font-size: 13.5px;
}
.suggest div:hover, .suggest div.sel { background: var(--accent-soft); }
.suggest .code {
  min-width: 48px; text-align: center; padding: 4px 7px; border-radius: 8px;
  background: var(--surface-2); font-weight: 800; font-size: 12.5px; letter-spacing: .06em;
}
.suggest .where { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 9px;
  border: 1px solid transparent; background: none; color: var(--accent);
  font: 700 12px var(--font); cursor: pointer; transition: background .15s, border-color .15s;
}
.ghost-btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.ghost-btn .ico { font-size: 14px; }

.anywhere { display: flex; flex-direction: column; gap: 12px; }

/* segmented control */
.segmented {
  display: flex; gap: 3px; padding: 4px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.segmented button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font: 700 13.5px var(--font); cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 10px -4px rgba(15, 23, 42, .35); }
.segmented button.active .ico { color: var(--accent); }
.segmented.mini { padding: 3px; border-radius: 11px; }
.segmented.mini button { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; white-space: nowrap; }

/* range */
.flex-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.flex-label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.flex-label.center { text-align: center; }
.hint { font-size: 11.5px; font-weight: 700; color: var(--faint); }
input[type=range] {
  -webkit-appearance: none; appearance: none; flex: 1 1 0; min-width: 0; width: 100%;
  height: 6px; margin: 10px 0; border-radius: 99px; cursor: pointer;
  background: var(--grad) 0 / var(--fill, 50%) 100% no-repeat, var(--track);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .35);
  transition: transform .15s var(--ease);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .35);
}
input[type=range]::-moz-range-track { background: transparent; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]:focus { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 40%, transparent); }

/* switches */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto; margin: 0;
  width: 36px; height: 21px; border-radius: 99px; background: var(--track); cursor: pointer;
  transition: background .2s;
}
input[type=checkbox]::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--ease);
}
input[type=checkbox]:checked { background: var(--grad); }
input[type=checkbox]:checked::after { transform: translateX(15px); }
input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.checks { display: flex; flex-direction: column; gap: 10px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.checks label.disabled { opacity: .5; cursor: not-allowed; }
.checks .why { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 2px; }

/* collapsible extras */
.more { border-top: 1px solid var(--border); padding: 4px 0 8px; }
.more summary {
  display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none;
  font: 700 11.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
}
.more summary::-webkit-details-marker { display: none; }
.more summary .ico { font-size: 15px; color: var(--accent); }
.more summary .chev { margin-left: auto; color: var(--faint); transition: transform .25s var(--ease); }
.more[open] summary .chev { transform: rotate(180deg); }
.more summary:hover { color: var(--muted); }
.more-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 10px; }

/* submit */
.submit-bar {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -20px; padding: 14px 20px 18px;
  background: linear-gradient(to bottom, transparent, var(--surface-solid) 26%);
  border-radius: 0 0 var(--radius) var(--radius);
}
button.primary {
  position: relative; overflow: hidden; width: 100%; height: 54px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 15px; background: var(--grad); color: #fff;
  font: 800 15.5px var(--font); letter-spacing: .01em; cursor: pointer;
  box-shadow: var(--glow-btn); transition: transform .2s var(--ease), box-shadow .2s, filter .2s;
}
button.primary .ico { font-size: 18px; }
button.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-100%);
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 20px 44px -16px rgba(168, 85, 247, .95); }
button.primary:hover::after { transition: transform .8s var(--ease); transform: translateX(100%); }
button.primary:active { transform: translateY(0) scale(.99); }
button.primary:disabled { cursor: progress; filter: saturate(.85); transform: none; }
button.primary:disabled::after { animation: shine 1.3s linear infinite; }
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.form-note { font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 18px; margin-top: 10px; text-align: center; }
.form-note:empty { margin-top: 0; min-height: 0; }
.form-note.error { color: var(--bad); }
.form-note b { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- results */
.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The places panel stays usable while results reload, so toggles can be chained. */
.results.busy > :not(#loading):not(#discovery) { opacity: .4; filter: saturate(.5); pointer-events: none; transition: opacity .3s; }
.muted { color: var(--muted); }

/* hero */
.hero { padding: clamp(8px, 2vw, 20px) 4px 8px; display: flex; flex-direction: column; gap: 22px; animation: rise .6s var(--ease) backwards; }
.eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.eyebrow .ico { color: var(--accent); }
.hero h1 {
  margin: 0; font: 600 clamp(30px, 4.4vw, 54px)/1.08 var(--font-display); letter-spacing: -.035em;
}
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin: 0; max-width: 60ch; font-size: clamp(15px, 1.4vw, 17px); color: var(--muted); font-weight: 500; }

.route-art { width: 100%; max-width: 720px; height: auto; overflow: visible; }
.route-art .arcs path { fill: none; stroke: var(--border-strong); stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; }
.route-art .arc-hl {
  fill: none; stroke: url(#route-grad); stroke-width: 2.6; stroke-linecap: round;
  stroke-dasharray: 640; stroke-dashoffset: 640; animation: draw 2.2s var(--ease) .3s forwards;
}
.route-art .plane { fill: var(--surface-solid); stroke: #a855f7; stroke-width: 1.6; stroke-linejoin: round; }
.route-art .pts circle { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2.2; }
.route-art .pts .pulse {
  fill: none; stroke: #a855f7; stroke-width: 2; transform-box: fill-box; transform-origin: center;
  animation: pulse 2.4s ease-out infinite;
}
.route-art .codes text { font: 800 13px var(--font); fill: var(--muted); letter-spacing: .06em; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(4); opacity: 0; } }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.feature {
  display: flex; flex-direction: column; gap: 6px; padding: 18px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: transform .25s var(--ease), border-color .25s;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.feature .fi {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--grad-soft); color: var(--accent); font-size: 19px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.feature b { font-size: 15px; }
.feature span { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.examples .try { font: 800 11.5px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }
.example {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 700 13px var(--font); cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.example .ico { color: var(--accent); }
.example:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-soft); }
.fineprint { margin: 0; max-width: 72ch; font-size: 13px; color: var(--faint); line-height: 1.6; }
.fineprint strong { color: var(--muted); }

/* loading */
.loading { display: flex; flex-direction: column; gap: 14px; animation: rise .35s var(--ease) backwards; }
.loading-row { display: flex; align-items: center; gap: 14px; }
.loading-text { display: flex; flex-direction: column; gap: 2px; }
.loading-text b { font-size: 14.5px; }
.loading-text span { font: 700 13px var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.radar {
  position: relative; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 20px; background: var(--grad);
}
.radar::before, .radar::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #a855f7;
  animation: ripple 1.8s ease-out infinite;
}
.radar::after { animation-delay: .9s; }
@keyframes ripple { from { transform: scale(1); opacity: .7; } to { transform: scale(1.9); opacity: 0; } }
.progress { position: relative; height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; }
.progress i { position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 4px; background: var(--grad); animation: indet 1.5s var(--ease) infinite; }
@keyframes indet { from { left: -40%; } to { left: 100%; } }

/* summary tiles */
.summary { display: flex; flex-wrap: wrap; gap: 12px; }
.stat {
  flex: 1 1 130px; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 50ms);
}
.stat .ico { font-size: 17px; color: var(--accent); margin-bottom: 4px; }
.stat b { font: 600 21px/1.15 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat span { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat.hl { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow-btn); }
.stat.hl span, .stat.hl .ico { color: rgba(255, 255, 255, .85); }
.timing { flex-basis: 100%; font-size: 12.5px; font-weight: 600; color: var(--faint); padding: 0 4px; font-variant-numeric: tabular-nums; }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.panel-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font: 800 15px var(--font); }
.panel-head h2 .ico { color: var(--accent); font-size: 17px; }
.panel-head .muted { font-size: 12.5px; font-weight: 600; }

/* discovery */
.places-hint { margin: -6px 0 12px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.places-hint b { color: var(--muted); }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
/* Each place is a toggle: included (default) or left out of the results. */
.place {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font: inherit;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  transition: border-color .2s, transform .2s var(--ease), opacity .2s, background .2s;
}
.place:hover { border-color: var(--accent); transform: translateY(-2px); }
.place:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.place.unsure { border-style: dashed; }
.place-check {
  width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px;
  background: var(--grad); color: #fff; font-size: 15px; transition: background .2s, color .2s;
}
.place-check .ico { stroke-width: 2.6; }
.place-text { min-width: 0; }
.place-text b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-text span { font-size: 12px; font-weight: 600; color: var(--muted); }
.place.off { opacity: .55; background: transparent; border-color: var(--border); border-style: dashed; }
.place.off:hover { opacity: .85; }
.place.off .place-text b { text-decoration: line-through; }
.place.off .place-check { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
.places-msg { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--warn); }

/* warnings */
.warnings { display: flex; flex-direction: column; gap: 8px; }
.warn-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  font-size: 13.5px; font-weight: 500;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface-solid));
  border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
}
.warn-item .ico { font-size: 17px; color: var(--warn); margin-top: 1px; }
.warn-item.error { background: color-mix(in srgb, var(--bad) 9%, var(--surface-solid)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.warn-item.error .ico { color: var(--bad); }

/* date heatmap */
.grid { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.grid table { border-collapse: separate; border-spacing: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 8px 10px; border-radius: 9px; text-align: center; white-space: nowrap; }
.grid th { color: var(--muted); font-weight: 700; font-size: 11.5px; position: sticky; left: 0; z-index: 1; }
.grid thead th { position: static; }
.grid tbody th { background: var(--surface-solid); text-align: right; }
.grid td.cell { cursor: pointer; font-weight: 800; background: var(--surface-2); transition: transform .15s var(--ease); }
.grid td.cell:hover { transform: scale(1.07); }
.grid td.cell:focus { outline: none; }
.grid td.cell:focus-visible, .grid td.picked { outline: 2px solid var(--text); outline-offset: 1px; }
.grid td.best { box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.empty { color: var(--faint); }
.pick-note {
  display: flex; gap: 9px; align-items: flex-start; margin: 14px 20px -4px; padding: 10px 12px;
  border-radius: 12px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}
.pick-note .ico { font-size: 16px; color: var(--warn); margin-top: 1px; }
.grid-msg {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-strong);
}

/* sort tabs */
.tabs {
  display: flex; gap: 4px; padding: 5px; border-radius: 16px; width: fit-content; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 9px 15px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font: 700 13.5px var(--font); cursor: pointer; white-space: nowrap;
  transition: color .2s, background .2s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--grad); color: #fff; box-shadow: var(--glow-btn); }

/* --------------------------------------------------------------- offers */
.offers { display: flex; flex-direction: column; gap: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }

.offer {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.offer:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--shadow-lg); }
.offer { scroll-margin-top: 92px; }
/* Picked from the date grid. */
.offer.flash { animation: flash 1.8s var(--ease); }
@keyframes flash {
  0%, 35% { box-shadow: 0 0 0 3px #a855f7, 0 0 40px -6px rgba(168, 85, 247, .8); }
  100%    { box-shadow: var(--shadow); }
}
.offer.top {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--grad) border-box;
  box-shadow: var(--shadow), var(--shadow-lg);
}
.rank {
  display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 -4px 20px;
  padding: 5px 11px; border-radius: 999px; background: var(--grad); color: #fff;
  font: 800 11.5px var(--font); letter-spacing: .04em; box-shadow: var(--glow-btn);
}

.offer-main { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 22px; padding: 18px 20px; }
.legs { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.leg { display: grid; grid-template-columns: 118px minmax(0, 1fr) 118px; gap: 14px; align-items: center; }
.leg + .leg { padding-top: 14px; border-top: 1px dashed var(--border); }
.leg .time { font: 600 22px/1.1 var(--font-display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.leg .city { margin-top: 5px; font-size: 13px; font-weight: 800; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.leg .code { font-size: 12px; font-weight: 600; color: var(--muted); }
.leg .day {
  display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft);
}
.leg .middle { text-align: center; min-width: 0; }
.leg .dur { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.leg .dir { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.leg .right { text-align: right; }
.leg .stops { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.leg .stops.nonstop { color: var(--good); font-weight: 800; }
.leg .carriers { font-size: 11.5px; font-weight: 700; color: var(--faint); margin-top: 2px; letter-spacing: .03em; }

.path {
  position: relative; height: 2px; margin: 11px 6px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), #a855f7 50%, #ec4899);
}
.path::before, .path::after {
  content: ""; position: absolute; top: 50%; left: 0; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--card-solid); border: 2px solid var(--accent-2);
}
.path::after { left: 100%; border-color: #ec4899; }
.path .dot {
  position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--card-solid); border: 2.5px solid var(--warn);
}
.path .pl {
  position: absolute; top: 50%; left: 50%; width: 24px; height: 24px; padding: 3px; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg); background: var(--card-solid); color: #a855f7;
}

.price-box {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  padding-left: 22px; border-left: 1px dashed var(--border-strong);
}
.price-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.price { font: 600 28px/1 var(--font-display); letter-spacing: -.04em; text-align: right; font-variant-numeric: tabular-nums; }
.price small { display: block; margin-top: 6px; font: 600 11.5px/1.4 var(--font); letter-spacing: 0; color: var(--muted); }

.ring {
  position: relative; width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
  font: 800 14px var(--font); cursor: help;
}
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#6366f1, #a855f7 calc(var(--p) * .5%), #ec4899 calc(var(--p) * 1%), var(--track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
}
.ring small { position: absolute; bottom: -16px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }

.book {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 13px;
  background: var(--text); color: var(--bg); text-decoration: none;
  font: 800 14px var(--font); transition: background .2s, color .2s, transform .2s var(--ease), box-shadow .2s;
}
.book:hover { background: var(--grad); color: #fff; transform: translateY(-1px); box-shadow: var(--glow-btn); }
.book.disabled { background: var(--surface-2); color: var(--faint); pointer-events: none; }
.links { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.links .book { height: 38px; font-size: 12.5px; padding: 0 12px; text-align: center; }

.scores { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; }
.score-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); cursor: help;
}
.score-chip .bar { width: 30px; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.score-chip .bar i { display: block; height: 100%; min-width: 2px; border-radius: 3px; }
.score-chip.g i { background: var(--good); }
.score-chip.w i { background: var(--warn); }
.score-chip.b i { background: var(--bad); }
.score-chip.g { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.score-chip.w { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.score-chip.b { border-color: color-mix(in srgb, var(--bad) 50%, var(--border)); color: var(--bad); }
.score-chip.heuristic { border-style: dashed; opacity: .82; }

.flags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; }
.flag { padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.flag.sample { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }

.offer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.more-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 10px; border-radius: 9px;
  border: 0; background: none; color: var(--accent); font: 800 12.5px var(--font); cursor: pointer;
  transition: background .15s;
}
.more-btn:hover { background: var(--accent-soft); }
.more-btn .ico { transition: transform .25s var(--ease); }
.more-btn.open .ico { transform: rotate(180deg); }

.detail { padding: 16px 20px 18px; border-top: 1px solid var(--border); font-size: 13px; animation: fade .3s; }
.detail table { width: 100%; border-collapse: collapse; }
.detail td { padding: 5px 10px 5px 0; vertical-align: top; }
.detail .seg-airport { font-weight: 800; }
.detail .layover {
  color: var(--warn); font-size: 12px; font-weight: 600; padding: 4px 0 4px 14px;
  border-left: 2px dashed color-mix(in srgb, var(--warn) 55%, transparent);
}
.detail pre {
  background: var(--surface-2); border: 1px solid var(--border); padding: 12px; border-radius: 12px;
  overflow: auto; font: 11.5px/1.55 var(--mono); max-height: 340px;
}
.detail h4 { margin: 16px 0 8px; font: 800 11px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.detail h4:first-child { margin-top: 0; }

.empty {
  padding: 44px 24px; text-align: center; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border-strong);
}
.empty h3 { margin: 0 0 6px; font: 600 20px var(--font-display); letter-spacing: -.02em; }
.empty p { margin: 0; color: var(--muted); }

/* skeletons while the first search runs */
.skeleton { pointer-events: none; }
.skeleton i {
  display: block; border-radius: 9px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--border-strong) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.sk-leg { display: grid; grid-template-columns: 96px 1fr 96px; gap: 18px; align-items: center; }
.sk-leg i { height: 38px; }
.sk-leg i:nth-child(2) { height: 6px; }
.skeleton .price-box i:first-child { height: 30px; width: 70%; margin-left: auto; }
.skeleton .price-box i:last-child { height: 44px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 350px minmax(0, 1fr); gap: 18px; }
  .offer-main { grid-template-columns: 1fr; gap: 16px; }
  .price-box {
    flex-direction: row; align-items: center; padding: 14px 0 0;
    border-left: 0; border-top: 1px dashed var(--border-strong);
  }
  .price-head { flex: 1; justify-content: flex-start; flex-direction: row-reverse; align-items: center; }
  .price { text-align: left; }
  .ring small { display: none; }
  .links { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .search { position: relative; top: 0; max-height: none; overflow: visible; }
  .brand-tag { display: none; }
}
@media (max-width: 560px) {
  .layout { padding: 14px 16px 40px; gap: 14px; }
  .topbar { padding: 10px 16px; }
  #pill-providers { display: none; }
  .pill { max-width: 46vw; }
  .search { padding: 4px 16px 0; }
  .submit-bar { margin: 0 -16px; padding: 12px 16px 16px; }
  .row.dates { grid-template-columns: 1fr; }
  .leg { grid-template-columns: 78px minmax(0, 1fr) 78px; gap: 8px; }
  .leg .time { font-size: 18px; }
  .leg .city { font-size: 12px; }
  .offer-main { padding: 16px; }
  .scores, .flags { padding-left: 16px; padding-right: 16px; }
  .offer-foot { padding-left: 16px; flex-wrap: wrap; }
  .rank { margin-left: 16px; }
  .price-box { flex-wrap: wrap; }
  .price { font-size: 24px; }
  .hero h1 br { display: none; }
  .route-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .route-art .plane { display: none; }
  .route-art .arc-hl { stroke-dashoffset: 0; }
}
