/* ============================================================
   FaroFlights — brand tokens, themes, components
   Two directions via [data-theme]: "daylight" (minimal) / "warm" (friendly)
   Dark mode via [data-mode="dark"]; density via [data-density]
   ============================================================ */

:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;

  /* deal scale — shared across themes, tuned per mode below */
  --sweet: #16a34a;
  --sweet-bg: #e7f6ec;
  --sweet-ink: #0c5c2c;
  --fair: #d6912a;
  --fair-bg: #fbf0db;
  --fair-ink: #8a5a12;
  --high: #64748b;
  --high-bg: #eef1f5;
  --high-ink: #44505f;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(15,30,25,.06), 0 1px 3px rgba(15,30,25,.05);
  --shadow-2: 0 4px 14px rgba(15,30,25,.08), 0 2px 6px rgba(15,30,25,.05);
  --shadow-3: 0 18px 50px rgba(15,30,25,.16), 0 6px 18px rgba(15,30,25,.10);

  --ease: cubic-bezier(.22,.61,.36,1);

  /* pinned-bar heights — the page scrolls naturally, the top bar and filter
     bar stick, and the map pane offsets itself below them */
  --topbar-h: 63px;
  --filterbar-h: 60px;
}

/* ---------------- DAYLIGHT (clean / minimal) ---------------- */
[data-theme="daylight"] {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --surface-3: #eef2f0;
  --ink: #13211c;
  --ink-2: #475951;
  --ink-3: #7f9189;
  --line: #e4eae7;
  --line-strong: #d2dbd6;
  --accent: #0e9f6e;
  --accent-2: #0b7d57;
  --accent-soft: #e3f5ec;
  --accent-ink: #ffffff;
  --focus: #0e9f6e44;
  --map-shade: rgba(14,159,110,.06);
  --r-card: var(--r-md);
  --r-control: 10px;
}

/* ---------------- WARM (friendly / approachable) ---------------- */
[data-theme="warm"] {
  --bg: #f6ecdf;
  --surface: #fffdf9;
  --surface-2: #f7efe3;
  --surface-3: #f1e6d5;
  --ink: #2c2118;
  --ink-2: #6c5b4b;
  --ink-3: #9a8775;
  --line: #ece0cf;
  --line-strong: #ddcdb6;
  --accent: #ec6240;
  --accent-2: #d44e2d;
  --accent-soft: #fbe6dd;
  --accent-ink: #ffffff;
  --focus: #ec624033;
  --map-shade: rgba(236,98,64,.06);
  --r-card: var(--r-lg);
  --r-control: 13px;
  --shadow-2: 0 6px 18px rgba(120,72,40,.10), 0 2px 8px rgba(120,72,40,.06);
  --shadow-3: 0 22px 56px rgba(120,72,40,.20), 0 8px 22px rgba(120,72,40,.12);
}

/* ---------------- DARK overrides ---------------- */
[data-theme="daylight"][data-mode="dark"] {
  --bg: #0c1411;
  --surface: #121d19;
  --surface-2: #18241f;
  --surface-3: #1e2c26;
  --ink: #eaf2ee;
  --ink-2: #9fb3aa;
  --ink-3: #6f857c;
  --line: #213029;
  --line-strong: #2c4036;
  --accent: #2fd396;
  --accent-2: #29bd85;
  --accent-soft: #15302440;
  --accent-ink: #04140d;
  --sweet: #34d27e; --sweet-bg: #11321f; --sweet-ink: #74e6a4;
  --fair: #e3ad55; --fair-bg: #322713; --fair-ink: #f0c987;
  --high: #8294a6; --high-bg: #1b2630; --high-ink: #aebccb;
  --map-shade: rgba(47,211,150,.08);
}
[data-theme="warm"][data-mode="dark"] {
  --bg: #181009;
  --surface: #211711;
  --surface-2: #2a1e15;
  --surface-3: #33251a;
  --ink: #f7ecdf;
  --ink-2: #c3ab95;
  --ink-3: #937c66;
  --line: #34261a;
  --line-strong: #463424;
  --accent: #f97a55;
  --accent-2: #ef6440;
  --accent-soft: #3a201640;
  --accent-ink: #1a0d06;
  --sweet: #34d27e; --sweet-bg: #11321f; --sweet-ink: #74e6a4;
  --fair: #e3ad55; --fair-bg: #322713; --fair-ink: #f0c987;
  --high: #a08c78; --high-bg: #2a1f16; --high-ink: #cbb59c;
  --map-shade: rgba(249,122,85,.08);
}

/* ---------------- density ---------------- */
[data-density="compact"] { --row-pad: 12px; --gap: 10px; }
[data-density="regular"] { --row-pad: 16px; --gap: 14px; }
[data-density="comfy"]   { --row-pad: 22px; --gap: 18px; }

* { box-sizing: border-box; }
html, body { height: auto; min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* the page never scrolls sideways — one overflowing element must never
     shove the whole app over and leave white space down the side */
  overflow-x: clip;
}
.app { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--surface); }
*::-webkit-scrollbar-track { background: transparent; }

#root { min-height: 100%; }

/* ============================================================
   App shell — the PAGE scrolls: the search panel scrolls away, the
   top bar and filter chips stick, and the map pane rides along
   ============================================================ */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex: none;
  position: sticky; top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: var(--accent-ink);
  box-shadow: var(--shadow-1);
  position: relative;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 24px; letter-spacing: -.02em;
  color: var(--ink);
}
.brand-name b { color: var(--accent); font-weight: inherit; }
.topbar-spacer { flex: 1; }
.topbar-prog {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px 7px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.topbar-prog .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 11px; }
/* FaroCards tab: distinct accent pill, sits left of the live clock */
.cards-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; transition: .15s var(--ease); }
.cards-btn .dot { background: rgba(255,255,255,.22); color: var(--accent-ink); }
.cards-btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); text-decoration: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); display: grid; place-items: center;
  transition: .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }

/* ============================================================
   Top-of-site data-accuracy disclaimer
   ============================================================ */
.disclaimer {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 22px; background: var(--fair-bg); color: var(--fair-ink);
  border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600;
  line-height: 1.45;
}
.disclaimer > svg { flex: none; margin-top: 2px; }
.disclaimer span { flex: 1; min-width: 0; }
.disclaimer-close {
  flex: none; border: 0; background: none; color: inherit; opacity: .65;
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  margin: -3px -6px -3px 0; transition: .14s var(--ease);
}
.disclaimer-close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ============================================================
   Search bar
   ============================================================ */
.search-wrap { background: var(--surface); border-bottom: 1px solid var(--line); flex: none; z-index: 20; }
/* while an airport/date dropdown is open, lift the search panel above the
   pinned filter bar (z-60) so the menu can't be sliced by it */
.search-wrap:has(.menu) { z-index: 70; position: relative; }
.search-inner { padding: 0 22px 16px; }
.triptype { display: flex; gap: 4px; padding: 12px 0 12px; }
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: var(--r-pill);
  padding: 3px; gap: 2px; border: 1px solid var(--line);
}
.seg button {
  border: 0; background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 600; padding: 7px 15px; border-radius: var(--r-pill);
  transition: .15s var(--ease); white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.searchgrid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.3fr auto auto;
  gap: 8px; align-items: stretch;
}
.field {
  position: relative; background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-control); padding: 9px 14px; display: flex; align-items: center; gap: 11px;
  min-height: 58px; transition: .15s var(--ease); cursor: text;
}
.field:focus-within, .field.active { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.field .ico { color: var(--ink-3); flex: none; }
.field-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.field-label { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field .val {
  border: 0; background: transparent; outline: none; color: var(--ink);
  font-family: inherit; font-size: 16px; font-weight: 600; padding: 0; width: 100%;
}
.field .val.placeholder { color: var(--ink-3); font-weight: 500; }
.field-swap {
  position: absolute; left: auto; right: -19px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 99px; background: var(--surface);
  border: 1.5px solid var(--line-strong); color: var(--ink-2); z-index: 4;
  display: grid; place-items: center; transition: .2s var(--ease);
}
.field-swap:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-50%) rotate(180deg); }

.search-btn {
  border: 0; border-radius: var(--r-control);
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 700; font-size: 15px;
  padding: 0 26px; display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow-2); transition: .15s var(--ease); white-space: nowrap;
}
.search-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--shadow-3); }
.search-btn:active { transform: translateY(0); }

/* dropdown menus */
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); padding: 8px; z-index: 50;
  animation: pop .14s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.menu.wide { min-width: 320px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  cursor: pointer; transition: .12s var(--ease);
}
.menu-item:hover, .menu-item.hl { background: var(--surface-2); }
.menu-item .code { font-weight: 800; font-size: 13px; color: var(--ink); width: 38px; }
.menu-item .nm { font-size: 14px; color: var(--ink); font-weight: 600; }
.menu-item .sub { font-size: 12px; color: var(--ink-3); }
.menu-item .grow { flex: 1; min-width: 0; }
.menu-sec { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px 6px; }

/* calendar */
.cal-head { display: flex; align-items: center; margin-bottom: 4px; }
.cal-wrap { display: flex; gap: 24px; }
.cal-month { flex: 1; }
.cal-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; text-align: center; margin-bottom: 10px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { border: 0; background: transparent; aspect-ratio: 1; border-radius: 9px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); transition: .1s var(--ease); position: relative; }
.cal-day:not(.past):hover { background: var(--surface-2); }
.cal-day.past { color: var(--ink-3); opacity: .4; cursor: default; }
.cal-day.in { background: var(--accent-soft); border-radius: 0; }
.cal-day.dep, .cal-day.ret { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.cal-day.dep { border-radius: 9px 0 0 9px; }
.cal-day.ret { border-radius: 0 9px 9px 0; }

.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 99px; border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 17px; font-weight: 700; display: grid; place-items: center;
}
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Filter bar
   ============================================================ */
.filterbar {
  display: flex; align-items: center; gap: 9px; padding: 11px 22px;
  height: var(--filterbar-h);
  background: var(--surface); border-bottom: 1px solid var(--line); flex: none;
  overflow-x: auto; z-index: 15; scrollbar-width: none;
  /* the search panel scrolls off the page; the filters stop here */
  position: sticky; top: var(--topbar-h);
}
.filterbar::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 13px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600;
  transition: .14s var(--ease); position: relative;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }
.chip .cnt { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 6px; }
.chip .car { color: var(--ink-3); transition: transform .15s var(--ease); }
.chip.open .car { transform: rotate(180deg); }
.filter-spacer { flex: 1; }
.filterbar .clear { color: var(--accent-2); font-weight: 700; font-size: 13px; background: none; border: 0; padding: 8px 6px; white-space: nowrap; }

.popover {
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); padding: 16px; min-width: 270px; animation: pop .14s var(--ease);
  color: var(--ink);
}
.popover h4 { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.opt-row { display: flex; align-items: center; gap: 11px; padding: 8px 4px; cursor: pointer; font-size: 14px; font-weight: 600; }
.checkbox {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-strong);
  display: grid; place-items: center; flex: none; transition: .12s var(--ease); color: transparent;
}
.opt-row.on .checkbox { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt-row .badge-dot { width: 9px; height: 9px; border-radius: 99px; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 99px; background: var(--surface-3); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 99px; background: var(--surface); border: 2.5px solid var(--accent); box-shadow: var(--shadow-1); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 99px; background: var(--surface); border: 2.5px solid var(--accent); cursor: grab; }
.range-val { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-top: 9px; color: var(--ink); }
.range-val span:last-child { color: var(--accent-2); }

/* ============================================================
   Main body: results + map/list
   ============================================================ */
.body { display: flex; flex: 1; min-height: 0; }

.results-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 22px 12px;
  flex: none;
}
.results-head .title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.results-head .sub { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.viewtoggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.viewtoggle button { border: 0; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: var(--r-pill); display: flex; align-items: center; gap: 6px; transition: .14s var(--ease); }
.viewtoggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sortsel { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.sortsel select { font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-control); padding: 8px 10px; }

/* layout when map is shown: list left, map right */
.split { display: flex; flex: 1; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; background: var(--bg); transition: width .2s var(--ease); }
.split .list-pane { flex: 0 0 46%; width: 46%; max-width: 620px; min-width: 380px; border-right: 1px solid var(--line); }
.split.full .list-pane { flex: 1 1 100% !important; width: 100% !important; max-width: none !important; min-width: 0 !important; border-right: 0 !important; }
/* z-index:0 makes the map its own stacking context, trapping Leaflet's
   internal marker/control z-indexes inside it so search & filter dropdowns
   always render above the map. The pane is sticky: it parks below the pinned
   bars and stays put while the flights list scrolls with the page */
.map-pane {
  flex: 1; min-width: 0; z-index: 0;
  position: sticky; top: calc(var(--topbar-h) + var(--filterbar-h));
  height: calc(100vh - var(--topbar-h) - var(--filterbar-h));
}

/* the list flows with the document — the page itself is the scroller */
.list-scroll { padding: 8px 18px 24px; }
.list-grid { display: flex; flex-direction: column; gap: var(--gap); }
.split.full .list-scroll { padding: 0 22px 28px; }
.split.full .list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }

/* ============================================================
   Flight card
   ============================================================ */
.fcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--row-pad); display: flex; flex-direction: column; gap: 12px;
  transition: .16s var(--ease); cursor: pointer; position: relative; overflow: hidden;
}
.fcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--tier-c); opacity: 0; transition: .16s var(--ease);
}
.fcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.fcard.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus), var(--shadow-2); }
.fcard:hover::before, .fcard.sel::before { opacity: 1; }
.fcard.sweet { --tier-c: var(--sweet); }
.fcard.fair { --tier-c: var(--fair); }
.fcard.high { --tier-c: var(--high); }

.fcard-top { display: flex; align-items: center; gap: 10px; }
.airline-badge {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; color: #fff; letter-spacing: -.02em;
}
.fcard-route { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fcard-city { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.fcard-air { font-size: 12px; color: var(--ink-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cabin-tag { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 4px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.deal-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; flex: none;
}
.deal-pill.sweet { background: var(--sweet-bg); color: var(--sweet-ink); }
.deal-pill.fair { background: var(--fair-bg); color: var(--fair-ink); }
.deal-pill.high { background: var(--high-bg); color: var(--high-ink); }

.fcard-mid { display: flex; align-items: center; gap: 10px; }
.timeline { flex: 1; display: flex; align-items: center; gap: 8px; }
.timeline .t { font-size: 14px; font-weight: 700; color: var(--ink); }
/* the bar reserves 18px on the right for the plane, so layover dots on the
   line can never overlap it -- even on narrow cards */
.timeline .bar { align-self: stretch; height: 2px; background: var(--line-strong); position: relative; border-radius: 2px; margin-right: 18px; }
.timeline .bar .stop { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 7px; height: 7px; border-radius: 99px; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline .bar .plane { position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; place-items: center; }
.timeline .meta { font-size: 11px; color: var(--ink-3); font-weight: 600; text-align: center; white-space: nowrap; }

.fcard-bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px dashed var(--line); }
.price { display: flex; flex-direction: column; gap: 1px; }
.price .miles { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.price .miles b { color: var(--tier-c); }
.price .miles .unit { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 3px; }
.price .cash { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-top: 3px; }
.price .typ { font-size: 11px; color: var(--ink-3); text-decoration: line-through; }
.seats-left { font-size: 11px; font-weight: 700; color: var(--fair-ink); }

/* ============================================================
   Map markers
   ============================================================ */
.map-pane .leaflet-container { background: var(--surface-2); font-family: var(--font-ui); }
.mk {
  display: flex; align-items: center; gap: 5px; padding: 5px 9px 5px 6px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-2); border: 1.5px solid var(--tier-c);
  font-weight: 800; font-size: 13px; color: var(--ink); white-space: nowrap; cursor: pointer;
  transition: transform .14s var(--ease); transform-origin: center bottom;
}
.mk:hover { transform: scale(1.08); z-index: 999; }
.mk.sel { transform: scale(1.14); box-shadow: var(--shadow-3); }
.mk .mk-dot { width: 18px; height: 18px; border-radius: 99px; background: var(--tier-c); color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 900; flex: none; }
.mk .mk-unit { font-size: 10px; color: var(--ink-3); }
.mk.sweet { --tier-c: var(--sweet); }
.mk.fair { --tier-c: var(--fair); }
.mk.high { --tier-c: var(--high); }
.mk-home {
  width: 30px; height: 30px; border-radius: 99px; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; box-shadow: var(--shadow-2); border: 2.5px solid var(--surface);
}

.map-legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 500;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 9px;
}
.map-legend .lt { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.map-legend .lr { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.map-legend .lr i { width: 12px; height: 12px; border-radius: 99px; }

.map-toolbar { position: absolute; right: 16px; top: 16px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.map-count {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 500;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  box-shadow: var(--shadow-2); padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.map-count b { color: var(--sweet); }

/* ============================================================
   Detail drawer
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(10,20,16,.4); backdrop-filter: blur(2px); z-index: 2000; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 92vw);
  background: var(--surface); border-left: 1px solid var(--line); z-index: 2001;
  display: flex; flex-direction: column; box-shadow: var(--shadow-3);
  animation: slidein .26s var(--ease);
}
@keyframes slidein { from { transform: translateX(100%); } }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head .close { position: absolute; right: 16px; top: 16px; }
.drawer-scroll { overflow-y: auto; flex: 1; padding: 20px 22px 0; }
/* star + booking actions sit at the END of the itinerary content. Desktop:
   sticky to the drawer's bottom edge (always in reach). Phones override to
   static — scroll the itinerary, the buttons wait at the bottom */
.drawer-foot {
  padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface);
  position: sticky; bottom: 0; margin: 18px -22px 0; z-index: 5;
}

.bignum { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.bignum .unit { font-size: 17px; color: var(--ink-3); margin-left: 5px; }
.sub-cash { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-top: 8px; }

.savings-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--sweet-bg); color: var(--sweet-ink); margin: 18px 0; font-weight: 700;
}
.savings-banner.fair { background: var(--fair-bg); color: var(--fair-ink); }
.savings-banner.high { background: var(--high-bg); color: var(--high-ink); }
.savings-banner .big { font-family: var(--font-display); font-size: 26px; }

.itin { display: flex; gap: 14px; margin: 6px 0; }
.itin-rail { display: flex; flex-direction: column; align-items: center; padding-top: 5px; }
.itin-rail .node { width: 12px; height: 12px; border-radius: 99px; border: 2.5px solid var(--accent); background: var(--surface); }
.itin-rail .line { width: 2px; flex: 1; background: var(--line-strong); min-height: 34px; margin: 2px 0; }
.itin-row { display: flex; justify-content: space-between; gap: 10px; }
.itin-row .ap { font-weight: 800; font-size: 15px; }
.itin-row .pl { font-size: 13px; color: var(--ink-3); }
.itin-row .tm { font-size: 14px; font-weight: 700; white-space: nowrap; }
.itin-layover { font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 6px 0 6px 26px; }

/* ---- segment-by-segment itinerary: one card per flight, layovers between ---- */
.seg-itin { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.seg-leg {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); padding: 12px 14px;
}
.sl-route { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.sl-end.to { text-align: right; }
.sl-tm { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.sl-ap { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-top: 3px; letter-spacing: .02em; }
.sl-city { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.sl-path { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 3px; min-width: 0; }
.sl-dur { font-size: 11px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.sl-line { position: relative; width: 100%; height: 2px; background: var(--line-strong); border-radius: 2px; }
.sl-line::before, .sl-line::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; border-radius: 99px; background: var(--accent); transform: translateY(-50%); }
.sl-line::before { left: 0; }
.sl-line::after { right: 0; }
.sl-plane { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--surface-2); color: var(--accent); padding: 0 5px; display: grid; place-items: center; }
.sl-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.seg-layover {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; margin: 0 10px;
  border-left: 2px dashed var(--line-strong);
  font-size: 12px; color: var(--ink-3); font-weight: 600;
}
.seg-layover svg { flex: none; }
.seg-layover b { color: var(--ink-2); }
.seg-layover.self { color: var(--fair-ink); }
.seg-layover.self b { color: var(--fair-ink); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 18px 0; }
.detail-grid .cell { background: var(--surface); padding: 13px 15px; }
.detail-grid .k { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.detail-grid .v { font-size: 15px; font-weight: 700; color: var(--ink); }

.book-btn {
  width: 100%; border: 0; border-radius: var(--r-control); padding: 15px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: var(--shadow-2); transition: .15s var(--ease);
}
.book-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.book-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }

/* ---- drawer flight summary: boarding-pass style header ---- */
.drawer-head { padding: 18px 22px 20px; }
.fd-airline { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.fd-airline .nm { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.fd-airline .meta { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }

.fd-route { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; }
.fd-end .tm { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--ink); white-space: nowrap; }
.fd-end .code { font-size: 14px; font-weight: 800; color: var(--ink-2); margin-top: 7px; letter-spacing: .02em; }
.fd-end .city { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.fd-end.to { text-align: right; }
.fd-path { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 5px; }
.fd-path .dur { font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.fd-path .line { position: relative; width: 100%; height: 2px; background: var(--line-strong); border-radius: 2px; }
.fd-path .line::before, .fd-path .line::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); transform: translateY(-50%); }
.fd-path .line::before { left: 0; }
.fd-path .line::after { right: 0; }
.fd-path .plane { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--surface); color: var(--accent); padding: 0 6px; display: grid; place-items: center; }
.fd-path .stops { font-size: 11.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.fd-path .stops.nonstop { color: var(--sweet); }

.fd-price { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.fd-price .miles { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.fd-price .miles .unit { font-size: 14px; color: var(--ink-3); font-weight: 700; margin-left: 5px; }
.fd-price .per { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 6px; }
.fd-price .pcol { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.fd-price .fd-tax { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

/* ============================================================
   Empty state + misc
   ============================================================ */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; text-align: center; color: var(--ink-3); }
.empty .em-ico { width: 64px; height: 64px; border-radius: var(--r-lg); background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.empty h3 { font-family: var(--font-display); margin: 0; color: var(--ink); font-size: 18px; }

.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* full-screen map (desktop): the list pane steps aside and the map takes the
   full width below the pinned bars. Clicking a price marker opens the flight
   info drawer; clicking an airport returns to the split view */
@media (min-width: 901px) {
  .split.map-full .list-pane { display: none; }
}

/* responsive: stack map below list on narrow */
@media (max-width: 900px) {
  .updated-chip { display: none; } /* the live clock is decoration — save the room */
  .searchgrid { grid-template-columns: 1fr 1fr; }
  .search-btn { grid-column: 1 / -1; padding: 14px; }
  .map-toolbar { display: none; } /* phones get the floating List/Map button */
  .split { flex-direction: column; }
  /* in column direction the desktop flex-basis (46%) becomes a *height* and
     cuts the list off -- let the list pane fill down to the bottom instead */
  .split .list-pane { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; min-width: 0; border-right: 0; }
  .split.mobile-map .list-pane { display: none; }
  .split:not(.mobile-map) .map-pane { display: none; }
  .mobile-viewswap { display: flex !important; }
}
@media (max-width: 560px) {
  /* --- phone: let the whole page scroll naturally so the search panel
     scrolls up and off, instead of pinning it with an inner-scrolling list --- */
  html, body { height: auto; }
  body { overflow-x: hidden; }
  /* hide the page scrollbar on phones (touch devices use overlay scrollbars
     anyway) so toggling list/map can't change content width and nudge the
     centered floating button */
  html { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .app { display: block; height: auto; min-height: 100dvh; }
  .body { display: block; flex: none; min-height: 0; }
  .split { display: block; }

  /* --- phone top bar: everything must FIT. The admin button (now in the
     avatar menu), the live clock and all text labels leave the bar; what
     stays is icon-sized so brand + 5 controls fit a 360px screen without
     shoving the app sideways --- */
  .topbar { position: sticky; top: 0; height: 56px; padding: 0 10px; gap: 3px; min-width: 0; }
  .topbar .btn-label { display: none; }
  .topbar-prog { display: none; }
  .topbar-prog.top20-btn { display: flex; padding: 0; border: 1px solid var(--line); width: 36px; height: 36px; border-radius: var(--r-control); justify-content: center; background: var(--surface); }
  .topbar-prog.top20-btn .dot { width: 24px; height: 24px; }
  /* FaroCards stays visible on phones as an accent pill WITH its label */
  .topbar-prog.cards-btn { display: flex; padding: 0 12px 0 9px; gap: 6px; height: 36px; width: auto; border-radius: var(--r-control); justify-content: center; align-items: center; background: var(--accent); border-color: var(--accent); }
  .topbar-prog.cards-btn .dot { width: 24px; height: 24px; background: transparent; color: var(--accent-ink); }
  .topbar-prog.cards-btn .btn-label { display: inline; font-size: 13.5px; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
  /* admins: use the avatar menu — the button shoved the bar off-screen.
     Scoped under .topbar so it beats the later base `.signin-btn` display rule
     (equal specificity would otherwise let inline-flex win and re-show it). */
  .topbar .admin-btn { display: none; }
  .signin-btn { padding: 0; width: 36px; height: 36px; border-radius: var(--r-control); justify-content: center; gap: 0; }
  .topbar .icon-btn, .topbar .avatar { width: 36px; height: 36px; }
  .brand { gap: 5px; min-width: 0; flex: none; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  /* show the FaroFlights wordmark on phones too, shrunk from its 24px desktop
     size so it sits alongside the FaroCards pill + controls without run-off
     even on a 360px-wide phone */
  .brand-name { display: inline; font-size: 16px; white-space: nowrap; }

  /* search panel: ordinary flow — scrolls away on scroll-up */
  .search-wrap { z-index: 5; }
  .search-inner { padding: 0 16px 14px; }
  .triptype { padding: 10px 0; }
  .searchgrid { grid-template-columns: 1fr; }
  .field { min-height: 54px; }
  .field-swap { left: auto; right: 16px; top: 100%; transform: translateY(-50%); }
  .field-swap:hover { transform: translateY(-50%) rotate(180deg); }

  /* filter chips stay pinned under the top bar so they're always reachable —
     z-60 puts the bar above every app layer (map overlay is 45) */
  .filterbar { position: sticky; top: 56px; padding: 11px 16px; z-index: 60; }

  /* results header: the floating button owns map/list, so drop the inline
     toggle here — that frees room and stops "84 awards" from being squished */
  .results-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
  .results-head .viewtoggle { display: none; }
  .results-head .title { font-size: 17px; white-space: nowrap; }
  .results-head .sortsel { margin-left: auto; }

  /* list flows into the page (no inner scrollbox → nothing cuts off, and the
     desktop fade mask would wrongly dim the first card here) */
  .list-pane { display: block; width: 100%; max-width: none; min-width: 0; border-right: 0; }
  .list-scroll { overflow: visible; flex: none; padding: 0 16px 120px; -webkit-mask-image: none; mask-image: none; }
  .split.full .list-scroll { overflow: visible; padding: 0 16px 120px; }
  .split.full .list-grid { grid-template-columns: 1fr; }

  /* map mode: full-screen overlay, stable floating button. The map starts
     BELOW the top bar + filter chips (56px + ~58px), and both bars are
     pinned above the overlay (z-60 > map z-45) so filters stay visible
     and usable while the map is open */
  .split.mobile-map .list-pane { display: none; }
  .split:not(.mobile-map) .map-pane { display: none; }
  .split.mobile-map .map-pane { position: fixed; inset: calc(56px + var(--filterbar-h)) 0 0 0; height: auto; z-index: 45; }
  .split.mobile-map .map-legend { display: none; }
  .app.map-open .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; }
  .app.map-open .filterbar { position: fixed; top: 56px; left: 0; right: 0; z-index: 60; }
  .mobile-viewswap { display: flex !important; }

  /* keep dropdowns inside the viewport */
  .search-wrap .menu { min-width: 0 !important; max-width: calc(100vw - 24px); }
  .cal-wrap { flex-direction: column; gap: 14px; }

  /* phones: the star/book actions flow AFTER the itinerary — the user
     scrolls through the flight details and the buttons are at the bottom */
  .drawer-foot { position: static; }

  /* drawers go full-screen on phones — a 92vw panel left a sliver of page
     peeking through and cramped the itinerary */
  .drawer { width: 100vw; max-width: 100vw; border-left: 0; }
  .drawer-head { padding: 16px; }
  .drawer-scroll { padding: 16px 16px 0; }
  .drawer-foot { padding: 14px 16px; margin: 18px -16px 0; }
  .fd-end .tm { font-size: 21px; }
  .fd-price .miles { font-size: 26px; }

  /* modals: a touch wider, never taller than the visible viewport */
  .modal { width: min(440px, calc(100vw - 20px)); padding: 20px; max-height: calc(100dvh - 24px); }

  .disclaimer { padding: 9px 16px; font-size: 12px; }
  .err-banner { margin: 12px 16px 0; }

  /* floating List/Map button: clear the iPhone home indicator */
  .mobile-viewswap { bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
/* floating list/map toggle — centered via margin (NOT transform) so the
   .search-btn :hover/:active translateY can't knock it sideways (no jiggle) */
.mobile-viewswap {
  display: none; position: fixed; bottom: 22px; left: 0; right: 0;
  margin: 0 auto; width: max-content; min-width: 128px; justify-content: center;
  z-index: 70; transform: none; padding: 0 22px; height: 48px;
}

/* ============================================================
   Live-data additions (FaroFlights implementation)
   ============================================================ */
.show-more {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 16px auto 4px; padding: 11px 22px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 700; transition: .14s var(--ease);
}
.show-more:hover { border-color: var(--accent); color: var(--accent-2); }
.fcard-date { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.err-banner {
  margin: 14px 22px 0; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--fair-bg); color: var(--fair-ink); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.itin-skel { display: flex; flex-direction: column; gap: 10px; }

/* "Show all" (results head) + "Retry" (error banner) link-buttons */
.results-head .clear, .err-banner .clear {
  color: var(--accent-2); font-weight: 700; font-size: 13px;
  background: none; border: 0; padding: 5px 9px; white-space: nowrap;
  border-radius: var(--r-pill); cursor: pointer; transition: .14s var(--ease);
}
.results-head .clear:hover, .err-banner .clear:hover { background: var(--accent-soft); }

/* ============================================================
   Accounts, starred flights, notifications
   ============================================================ */
.modal {
  position: fixed; inset: 0; margin: auto; height: max-content;
  width: min(420px, 92vw); max-height: calc(100vh - 32px); overflow-y: auto;
  z-index: 2001; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: 26px;
  animation: pop .18s var(--ease); color: var(--ink);
}
.modal-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.modal-head h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.modal-sub { font-size: 13px; color: var(--ink-3); font-weight: 500; margin: 0 0 18px; }
.modal .seg { display: flex; margin-bottom: 18px; }
.modal .seg button { flex: 1; }
.auth-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 6px; }
.auth-input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 600; outline: none;
  transition: .15s var(--ease);
}
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.modal-submit { width: 100%; justify-content: center; padding: 14px; margin-top: 20px; }
.modal-links { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.modal-link { color: var(--accent-2); font-weight: 700; font-size: 13px; background: none; border: 0; padding: 4px 8px; border-radius: var(--r-pill); transition: .14s var(--ease); }
.modal-link:hover { background: var(--accent-soft); }
.modal-err { background: var(--fair-bg); color: var(--fair-ink); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; margin-top: 14px; }
.modal-ok { background: var(--sweet-bg); color: var(--sweet-ink); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; margin-top: 14px; }
.modal .close { position: absolute; right: 14px; top: 14px; }

/* star button in the flight drawer */
.star-btn {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-control);
  padding: 12px; background: var(--surface); color: var(--ink-2);
  font-weight: 700; font-size: 14px; display: flex; align-items: center;
  justify-content: center; gap: 9px; margin-bottom: 10px; transition: .15s var(--ease);
}
.star-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.star-btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }

/* star + alert side by side in the drawer */
.action-row { display: flex; gap: 9px; margin-bottom: 10px; }
.action-row .star-btn { margin-bottom: 0; flex: 1; min-width: 0; }

/* bell on each flight card */
.bell-btn {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-3); display: grid; place-items: center; transition: .14s var(--ease);
}
.bell-btn:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.bell-btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-2); }

/* alert popup options (gem / custom point value) */
.alert-opt {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  cursor: pointer; margin-top: 10px; transition: .14s var(--ease);
}
.alert-opt:hover { border-color: var(--ink-3); }
.alert-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.alert-opt .radio {
  flex: none; width: 19px; height: 19px; border-radius: 99px; margin-top: 1px;
  border: 2px solid var(--line-strong); background: var(--surface); transition: .12s var(--ease);
}
.alert-opt.on .radio { border-color: var(--accent); border-width: 6px; }
.alert-opt .ao-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.alert-opt .ao-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-top: 2px; }

/* auth/account extras */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-opt { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink-3); }
.modal-divider { height: 1px; background: var(--line); margin: 22px 0 16px; }

/* topbar starred-flights button badge */
.icon-btn { position: relative; }
.star-cnt {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 800; display: grid; place-items: center; padding: 0 4px;
}

/* starred flights panel rows */
.star-row {
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; margin-bottom: 10px;
  transition: .15s var(--ease);
}
.star-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.star-row-top { cursor: pointer; }
.star-row-top { display: flex; align-items: center; gap: 10px; }
.star-route { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; flex: 1; min-width: 0; }
.star-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.star-row .opt-row { padding: 2px 0; font-size: 13px; }
.star-row .checkbox { width: 18px; height: 18px; }
.panel-foot { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.panel-foot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Topbar sign-in button + signed-in avatar
   ============================================================ */
.signin-btn {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 9px 16px; border-radius: var(--r-pill); border: 0;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-1); transition: .15s var(--ease);
}
.signin-btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.avatar {
  width: 38px; height: 38px; border-radius: 99px; border: 0; flex: none;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-family: var(--font-display);
  font-size: 16px; font-weight: 700; display: grid; place-items: center;
  box-shadow: var(--shadow-1); transition: .15s var(--ease);
}
.avatar:hover { filter: brightness(1.08); box-shadow: var(--shadow-2); }

/* ============================================================
   Multi-airport chips in the search fields
   ============================================================ */
.field-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.field-tags input { flex: 1; min-width: 70px; }
.ftag {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.ftag button {
  border: 0; background: none; color: inherit; padding: 0; margin: 0;
  display: grid; place-items: center; opacity: .65; transition: .12s var(--ease);
}
.ftag button:hover { opacity: 1; }
/* scope chip (Explore everywhere / a continent / a country) */
.ftag.scope { background: var(--accent); color: var(--accent-ink); gap: 6px; padding-left: 9px; }
.ftag.scope svg { flex: none; }

/* ============================================================
   Filter option counts + program airline subtext
   ============================================================ */
.opt-cnt {
  flex: none; margin-left: 8px; min-width: 26px; text-align: center;
  font-size: 11.5px; font-weight: 800; color: var(--ink-3);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 7px;
}
.opt-row.on .opt-cnt { color: var(--accent-2); border-color: transparent; background: var(--accent-soft); }
.prog-air { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }

/* ============================================================
   Cabin tag color dot (matches the Cabin filter dots)
   ============================================================ */
.cabin-tag { display: inline-flex; align-items: center; gap: 6px; }
.cabin-dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }

/* ============================================================
   Red-eye icon + next-day arrival date
   ============================================================ */
.redeye {
  display: inline-flex; align-items: center; color: #e25c5c;
  margin-right: 4px; vertical-align: -2px;
}
[data-mode="dark"] .redeye { color: #f08a8a; }
.nextday {
  font-size: 10px; font-weight: 800; color: var(--fair-ink);
  background: var(--fair-bg); border-radius: 5px; padding: 1px 5px;
  margin-left: 5px; white-space: nowrap; vertical-align: 2px;
}

/* drawer extras */
.apcity { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.v-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.fd-price .per.total { color: var(--ink-2); font-weight: 700; }

/* per-person + total pricing on cards */
.price .price-total { font-size: 11.5px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }

/* ============================================================
   Round-trip pairing card (cheapest out + return together)
   ============================================================ */
/* .paircard total is colored by its real sweet/fair/high class (set in PairCard) */
.pair-leg {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); transition: .14s var(--ease);
}
.pair-leg:hover { border-color: var(--accent); background: var(--accent-soft); }
.pair-lbl {
  flex: none; width: 48px; font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
}
.pair-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pair-route { font-size: 14px; font-weight: 800; }
.pair-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pair-miles { flex: none; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.pair-total {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding-top: 11px; border-top: 1px dashed var(--line);
}
.pair-total .lbl { font-size: 12px; font-weight: 700; color: var(--ink-3); }

/* ============================================================
   Background airports revealed while zooming the map
   ============================================================ */
.mk-ap {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px;
  border-radius: var(--r-pill); background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-1);
  font-family: var(--font-ui); font-size: 10px; font-weight: 800;
  color: var(--ink-2); white-space: nowrap; opacity: .82;
  cursor: pointer; transition: .12s var(--ease);
}
.mk-ap:hover { opacity: 1; border-color: var(--accent); color: var(--ink); transform: scale(1.06); }
.mk-ap i { width: 5px; height: 5px; border-radius: 99px; background: var(--ink-3); }

/* ============================================================
   Connecting itineraries (built routes) + no-flights modal
   ============================================================ */
.via-pill {
  display: inline-flex; align-items: center; margin-left: 7px; padding: 1px 7px;
  border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2);
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 800;
  letter-spacing: .02em; vertical-align: 1px;
}
.oj-pill {
  display: inline-flex; align-items: center; margin-left: 7px; padding: 1px 8px;
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-2);
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 800;
  letter-spacing: .02em; vertical-align: 1px;
}
/* open-jaw also colors by its real tier; the open-jaw pill marks the journey type */
/* the leg/pairing tab strip can hold up to 4 tabs — let it scroll on narrow */
.seg.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.seg-scroll::-webkit-scrollbar { display: none; }

/* ============================================================
   Admin console
   ============================================================ */
.admin-btn { background: linear-gradient(160deg, #6366f1, #4f46e5); }
.adm-drawer { width: min(540px, 96vw); }
.adm-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; margin-bottom: 20px;
}
.adm-metric { background: var(--surface); padding: 14px 15px; }
.adm-k { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.adm-v { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.adm-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 5px; }
.adm-h { font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 10px; }
.adm-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; margin-bottom: 14px;
  border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.45;
}
.adm-note svg { flex: none; margin-top: 1px; color: var(--ink-3); }
.adm-user {
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  padding: 13px 14px; margin-bottom: 10px;
}
.adm-user-top { display: flex; align-items: center; gap: 10px; }
.adm-email { font-family: var(--font-display); font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.adm-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: var(--r-pill); background: #4f46e5; color: #fff; font-family: var(--font-ui); font-size: 10px; font-weight: 800; vertical-align: 2px; }
.adm-stars { flex: none; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.adm-meta { font-size: 12px; color: var(--ink-3); font-weight: 600; margin: 3px 0 9px; }
.adm-cred { display: flex; align-items: baseline; gap: 8px; margin-top: 5px; }
.adm-cred-k { flex: none; width: 38px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.adm-cred code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--ink-2); word-break: break-all; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; flex: 1; min-width: 0;
}

/* ============ access gate (invite-only page before the app) ============ */
.gate-page { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.gate-card {
  width: min(420px, 92vw); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: 26px;
  animation: pop .18s var(--ease); color: var(--ink);
}
.gate-input { font-size: 17px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

/* ---- admin: beta access codes ---- */
.adm-code-form { display: grid; grid-template-columns: 1fr 72px 88px auto; gap: 8px; margin: 10px 0 14px; }
.adm-code-form .auth-input { padding: 10px 12px; margin: 0; }
.adm-code { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; }
.adm-code-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.adm-code-val { font-size: 15px; font-weight: 700; letter-spacing: .07em; cursor: copy; font-variant-numeric: tabular-nums; }
.adm-code-status { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.adm-code-status.on { color: var(--sweet-ink); }
.adm-code-revoke { padding: 2px 0; margin-top: 4px; }

/* ---- access-status modal: the code this device is using ---- */
.access-code-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; text-align: center; background: var(--accent-soft); }
.access-code-val { font-size: 22px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--accent); }
.access-code-meta { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 4px; }

/* ---- account settings: dark mode toggle row ---- */
.appearance-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 10px; padding: 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  background: none; color: var(--ink); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: .14s var(--ease);
}
.appearance-row:hover { border-color: var(--accent); color: var(--accent); }

/* "kick me out" row in the access-status modal */
.access-remove { margin-top: 14px; }
.access-remove:hover { border-color: var(--fair-ink); color: var(--fair-ink); }

/* ---- backup mode: budget maxed -> showing last known prices ---- */
.stale-note {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  background: var(--fair-bg); color: var(--fair-ink);
  font-size: 13px; font-weight: 600; line-height: 1.4;
  border-bottom: 1px solid var(--line);
}
.stale-note svg { flex: none; }

/* ---- airline logo chips (colored-initials square is the fallback) ---- */
.airline-badge.logo { background: transparent; border: 0; overflow: hidden; box-shadow: none; }
.airline-badge.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- phone dropdowns: dimmed backdrop + sticky Done bar ---- */
.pop-scrim { position: fixed; inset: 0; background: rgba(8, 16, 12, .34); z-index: 1590; }
.pop-done {
  position: sticky; bottom: -8px; margin: 8px -8px -8px; padding: 8px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.pop-done button {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 12px; border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink);
  font-weight: 800; font-size: 14px; cursor: pointer;
}
@media (min-width: 561px) { .pop-scrim, .pop-done { display: none; } }

/* market-percentile badge: this price vs everything we've observed */
.pct-pill {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sweet-ink); background: var(--sweet-bg);
  border-radius: var(--r-pill); padding: 2px 7px; margin-bottom: 2px;
}
