/* ---------------------------------------------------------------------------
   Halfway Trips — "Retro Travel Poster" theme (design 57)

   EVERY colour of the site lives in the variables just below — the page, the
   banner, the table, and the map too (app.js reads the map colours from here).
   To re-colour the site, change these values and nothing else.

   The idea: a terracotta banner with soft sun rays, a cream page and map, and
   ONE warm colour — mustard — on everything you click.
--------------------------------------------------------------------------- */

:root {
  /* Page */
  --page: #F5EEE3;          /* page background (also the sea on the map) */
  --ink: #2A1D16;           /* main text */
  --soft: #6A5E56;          /* secondary text */
  --line: #ECE3D6;          /* thin borders */
  --tint: #F6F0E7;          /* light fills (table header, chips) */
  --tint-strong: #FCF5EA;   /* selected-row fill */
  --row-hover: #FBF7F0;
  --accent: #A8461C;        /* terracotta: links, outlines, small highlights */
  --good: #2F7A4A;          /* "Direct", "€23 less" */
  --good-tint: #E3EFDF;     /* behind "€23 less" */
  --pill-border: #E6D9C6;   /* outlines of the currency pill and sort chips */
  --placeholder: #B7A99A;   /* "City or airport" */
  --shadow: 60, 40, 30;     /* colour of the soft shadows (red, green, blue) */

  /* The ONE colour for everything you click (search, Select, Book...) */
  --action: #F2B33D;        /* mustard */
  --action-hover: #E5A32B;
  --action-ink: #2B1608;    /* text on mustard */

  /* Banner: terracotta with soft sun rays and a rising sun (bottom right) */
  --hero-bg:
    repeating-conic-gradient(from 0deg at 84% 125%, rgba(255, 236, 200, 0.10) 0deg 5deg, rgba(255, 236, 200, 0) 5deg 10deg),
    radial-gradient(circle at 84% 125%, #F2B33D 0 13%, rgba(242, 179, 61, 0) 13.3%),
    linear-gradient(160deg, #B5401F 0%, #D9612E 100%);
  --hero-text: #FFF6E6;
  --hero-sub: #FBE0C2;      /* the sentence under the title, the trust line */
  --badge-bg: #F2C14E;      /* "REAL PRICES · REAL DATES" */
  --badge-text: #3A1E10;
  --going-fill: rgba(242, 179, 61, 0.18); /* the "Going to" box once a city is chosen */

  /* Small fills */
  --tag-bg: #F8E2B0;        /* "CHEAPEST" */
  --bar: #EDE0C8;           /* weekend bars */
  --bar-cheap: #F2C878;     /* weekend bars, cheaper half */

  /* Map */
  --map-sea: #F5EEE3;
  --map-land: #FFFDF8;
  --map-borders: rgba(90, 60, 30, 0.15);
  --map-grid: rgba(90, 60, 30, 0.05);

  /* One colour per departure (1st = you, 2nd = them, ... up to 8):
     the dots in the table, the avatars, the routes and pins on the map */
  --c0: #C24A1F; --c1: #5B6B2E; --c2: #D99A2B; --c3: #3F6E8C;
  --c4: #8E4A6B; --c5: #4E7A5A; --c6: #9A6A3A; --c7: #6B5B9A;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --content: min(1312px, calc(100% - 48px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--page);
  line-height: 1.45;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.8; }
button, input, select { font-family: inherit; }


/* ---------- Top navigation ---------- */

.nav {
  position: relative; z-index: 5;
  width: var(--content); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 16px;
}
/* The logo: you (1st colour) and them (2nd colour) meeting at a mustard point */
.logo-a { fill: var(--c0); }
.logo-b { fill: var(--c1); }
.logo-meet { fill: var(--action); }
.logo-route { fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 0.1 5.5; }
.logo-route-a { stroke: var(--c0); }
.logo-route-b { stroke: var(--c1); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -0.3px; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 15px; font-weight: 600; }

.currency-pill {
  position: relative; display: inline-flex; align-items: center;
  border: 1.5px solid var(--pill-border); border-radius: 999px; background: #fff;
}
.currency-pill select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 8px 32px 8px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%232A1D16' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.btn-signin { color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 8px 22px; font-size: 14px; font-weight: 700; }

/* ---------- The banner ---------- */

.hero {
  position: relative; z-index: 10; /* above the results (they slide in under it) and the map */
  width: var(--content); margin: 4px auto 0;
  border-radius: 36px;
  background: var(--hero-bg);
  box-shadow: 0 26px 50px rgba(var(--shadow), 0.28);
  padding: 44px 56px 52px;
}
.hero-content { position: relative; z-index: 2; }

.hero-badge {
  display: inline-block; margin-bottom: 18px; padding: 8px 18px; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-text);
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px;
}
.hero h1 {
  margin: 0 0 12px; max-width: 880px; color: var(--hero-text);
  font-family: var(--font-display); font-size: 56px; line-height: 1.04; font-weight: 600; letter-spacing: -1px;
}
.hero-sub { margin: 0 0 16px; max-width: 700px; color: var(--hero-sub); font-size: 18px; line-height: 1.5; }

/* The three promises under the title */
.headliners { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 26px; padding: 0; list-style: none; }
.headliners li { display: inline-flex; align-items: center; gap: 8px; color: var(--hero-text); font-size: 14px; font-weight: 700; }
.headliners li::before {
  content: "✓"; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 246, 230, 0.22);
  color: var(--badge-bg); font-size: 11px; font-weight: 800;
}

/* ---------- The search bar ---------- */

.search-bar {
  position: relative;
  display: flex; align-items: stretch;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 26px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.22);
  padding: 12px 12px 12px 22px;
}
.search-bar .field { position: relative; flex: 1; padding: 10px 20px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.search-bar .field-when { flex: 0 0 auto; min-width: 190px; } /* as wide as its summary needs */

/* "Going to": Anywhere (we find the middle) or a city chosen in advance */
.search-bar .field-going { flex: 0 0 210px; border-radius: 16px; transition: background 0.15s; }
.field-going.has-destination { background: var(--going-fill); }
.going-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; min-height: 20px; }
.search-bar .going-head label { margin: 0; }
.going-row { display: flex; align-items: center; gap: 8px; }
.going-icon { flex: none; display: inline-flex; color: var(--action); }
.field-going.has-destination .going-icon { color: var(--accent); }
.going-row input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0;
  color: var(--ink); font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.going-sub { margin-top: 7px; color: var(--soft); font-size: 12px; font-weight: 700; white-space: nowrap; }

.search-bar label {
  margin-bottom: 4px; color: var(--soft);
  font-size: 11px; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase;
}
.search-bar .field input[type="text"],
.origins { flex: 1; min-width: 0; display: grid; } /* columns set by app.js from the number of departures */
.origin-cell { position: relative; padding: 10px 20px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.origin-cell.has-left { border-left: 1px solid var(--line); }
.origin-cell.has-top { border-top: 1px solid var(--line); }
.origin-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; min-height: 20px; }
.search-bar .origin-head label { margin: 0; white-space: nowrap; }
.origin-remove, .going-clear { width: 20px; height: 20px; border: 0; border-radius: 50%; padding: 0; cursor: pointer; background: transparent; color: var(--soft); font-size: 17px; font-weight: 800; line-height: 1; }
.origin-remove:hover, .going-clear:hover { background: var(--tint); }

/* People per departure: little avatars in that traveller's colour */
.people { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.avatars { display: inline-flex; }
.avatar {
  width: 20px; height: 20px; margin-left: -6px; border-radius: 50%; border: 2px solid #fff;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--who, var(--c0)); color: #fff;
}
.avatar:first-child { margin-left: 0; }
.avatar-more { background: var(--tint); color: var(--accent); font-size: 9px; font-weight: 800; }
.people-text { color: var(--soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.people-btn {
  width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
  background: #fff; color: var(--accent); font-size: 14px; font-weight: 800; line-height: 1;
}
.people-btn[data-delta="-1"] { margin-left: auto; }
.people-btn:hover:not(:disabled) { border-color: var(--accent); }
.people-btn:disabled { opacity: 0.35; cursor: default; }

/* Under the bar: the small "+ Add a departure" box and the trust line */
.bar-extras { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.add-departure {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; cursor: pointer;
  border: 1px dashed rgba(255, 255, 255, 0.6); border-radius: 12px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 13px; font-weight: 800;
}
.add-departure:hover { background: rgba(255, 255, 255, 0.2); }
.add-departure small { color: rgba(255, 255, 255, 0.75); font-size: 11px; font-weight: 600; }
.bar-hint { color: var(--hero-sub); font-size: 13px; font-weight: 700; }

.origin-cell input[type="text"] {
  border: 0; outline: 0; background: transparent; width: 100%; padding: 0;
  color: var(--ink); font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.search-bar input::placeholder { color: var(--placeholder); font-weight: 600; }

/* Narrow departure cells (several side by side): a little tighter, so the names still fit */
@media (min-width: 861px) {
  .origins.is-dense .origin-cell { padding: 10px 14px; }
  .origins.is-dense .origin-cell input[type="text"] { font-size: 16px; }
  .origins.is-dense .people-text { display: none; } /* the avatars already show how many */
}

/* Medium screens: departures on the first row of the bar, the rest on a second row */
@media (min-width: 861px) and (max-width: 1320px) {
  .search-bar { flex-wrap: wrap; }
  .search-bar .origins { flex: 0 0 100%; }
  .search-bar .divider-origins { flex: 0 0 100%; width: auto; height: 1px; margin: 4px 0; }
  .search-bar .field-going, .search-bar .field-when { flex: 1 1 0; }
}
.divider { width: 1px; margin: 8px 0; background: var(--line); }
.when-button {
  border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; white-space: nowrap;
  color: var(--ink); font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.search-btn {
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  border: 0; border-radius: 18px; padding: 0 30px; cursor: pointer;
  background: var(--action); color: var(--action-ink); font-size: 16px; font-weight: 800;
  box-shadow: 0 10px 22px rgba(242, 179, 61, 0.35);
}
.search-btn:hover:not(:disabled) { background: var(--action-hover); }
.search-btn:disabled { opacity: 0.6; cursor: progress; }

/* Autocomplete dropdown */
.suggestions {
  list-style: none; margin: 0; padding: 0;
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 360px; z-index: 40;
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(var(--shadow), 0.28);
}
.suggestions:empty { display: none; }
.suggestions li { padding: 11px 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggestions li:last-child { border-bottom: 0; }
.suggestions li:hover, .suggestions li.active { background: var(--tint-strong); }
.suggestions .code { font-weight: 800; color: var(--accent); }
.suggestions .detail { color: var(--soft); font-size: 13px; }

/* "When" pop-up */
.when-popover {
  position: absolute; top: calc(100% + 16px); right: -8px; width: 380px; z-index: 40;
  background: #fff; border-radius: 22px; padding: 20px;
  box-shadow: 0 24px 54px rgba(var(--shadow), 0.3);
}
.when-popover label { margin: 0 0 6px; display: block; }
.toggle-group { display: flex; gap: 18px; margin-bottom: 14px; }
.toggle-group .toggle-option { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; }
.pop-field { margin-bottom: 14px; }
.pop-field select, .pop-field input[type="number"], .date-row input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 600;
}
.date-row { display: flex; align-items: center; gap: 8px; }
.date-row span { color: var(--soft); font-size: 13px; }
.check-option { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); cursor: pointer; }
.check-option input { margin-top: 3px; accent-color: var(--accent); }
.check-option small { color: var(--soft); font-weight: 600; }
.pop-done { width: 100%; border: 0; border-radius: 14px; padding: 12px; background: var(--action); color: var(--action-ink); font-size: 15px; font-weight: 800; cursor: pointer; }

/* ---------- Results: the table box (left, tucked under the banner) + the map (right) ---------- */

.results-grid {
  position: relative; z-index: 2;
  width: var(--content); margin: -44px auto 0; /* slides 44px under the banner */
  display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 32px; align-items: start;
}

.table-box {
  position: relative; z-index: 1; margin-left: 24px; padding-top: 44px; /* the part hidden under the banner */
  background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(var(--shadow), 0.16);
}
.table-top { padding: 26px 24px 18px; }
.table-top h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.5px; }
.table-top p { margin: 0 0 16px; color: var(--soft); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--pill-border); border-radius: 999px; padding: 8px 16px; cursor: pointer;
  background: transparent; color: var(--ink); font-size: 13px; font-weight: 800;
}
.chip.is-selected { background: var(--ink); border-color: var(--ink); color: #fff; }

/* "Everyone lands within [−] 3 h [+]" — the arrival-time rule, next to the results */
.gap-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 0 24px 16px; padding: 10px 14px; border-radius: 14px; background: var(--tint); border: 1px solid var(--line);
}
.gap-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 800; cursor: help; }
.stepper { display: inline-flex; align-items: center; gap: 10px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button {
  width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--tint); color: var(--ink); font-size: 15px; font-weight: 800; line-height: 1;
}
.stepper button:hover:not(:disabled) { background: var(--action); color: var(--action-ink); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper b { min-width: 34px; text-align: center; font-family: var(--font-display); font-size: 15px; }
.gap-hint { color: var(--soft); font-size: 12.5px; }
.gap-more { margin-left: auto; border: 0; padding: 0; background: none; cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 800; }
.gap-more:hover { text-decoration: underline; }

.table-head, .row {
  display: grid; grid-template-columns: 36px 160px minmax(0, 1fr) 104px; column-gap: 16px; align-items: center;
  padding: 0 24px;
}
.table-head { padding-top: 11px; padding-bottom: 11px; background: var(--tint); color: var(--soft); font-size: 11px; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase; }
.table-head .right { text-align: right; }

.row { padding-top: 20px; padding-bottom: 20px; border-top: 1px solid var(--line); background: #fff; cursor: pointer; }
.row:hover { background: var(--row-hover); }
.row.is-selected { background: var(--tint-strong); }
.rank {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--ink); font-family: var(--font-display); font-size: 16px; font-weight: 700;
}
.row.is-selected .rank { background: var(--action); color: var(--action-ink); }

.dest-city { font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.1; }
.dest-country { margin-top: 2px; color: var(--soft); font-size: 12px; }
.dest-dates { margin-top: 6px; font-size: 13px; font-weight: 800; }
.dest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; color: var(--soft); font-size: 12px; }
.code-chip { border-radius: 999px; padding: 2px 8px; background: var(--tint); color: var(--ink); font-size: 11px; font-weight: 800; letter-spacing: 0.8px; }
.tag { border-radius: 999px; padding: 2px 8px; background: var(--tag-bg); color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: 0.8px; }

.traveler + .traveler { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.traveler-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-0 { background: var(--c0); } .dot-1 { background: var(--c1); } .dot-2 { background: var(--c2); } .dot-3 { background: var(--c3); }
.dot-4 { background: var(--c4); } .dot-5 { background: var(--c5); } .dot-6 { background: var(--c6); } .dot-7 { background: var(--c7); }
.traveler-sub { color: var(--soft); font-size: 12px; font-weight: 600; }
.who { color: var(--soft); font-size: 11px; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase; }
.traveler-price { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.traveler-meta { color: var(--soft); font-size: 12px; }
.direct { color: var(--good); font-weight: 700; }
.times { margin-top: 3px; color: var(--soft); font-size: 13px; }
.times strong { color: var(--ink); font-weight: 800; }
.times sup { color: var(--accent); font-size: 10px; font-weight: 800; }
.gap-note { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--soft); font-size: 12px; }
.gap-note b { color: var(--ink); }

/* "Book on Aviasales" — one per traveller (on the trip page), since each
   person buys their own ticket from their own airport. */
.book-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 13px;
  background: #fff; color: var(--accent);
  font-size: 12px; font-weight: 800; letter-spacing: 0.2px; text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.book-btn:hover { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.book-btn:disabled { cursor: progress; opacity: 0.7; } /* while the link is being fetched */
.book-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.book-arrow { font-size: 11px; }

.total-cell { text-align: right; }
.total { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; }
.total-sub { margin: 3px 0 10px; color: var(--soft); font-size: 11px; }
.select-btn {
  display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 4px; padding: 9px 14px; cursor: pointer;
  background: var(--action); color: var(--action-ink); font-size: 13px; font-weight: 800;
}
.select-btn:hover { background: var(--action-hover); }

.warning {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 0 24px 16px; padding: 12px 16px; border-radius: 14px;
  background: #FFF3E0; color: #7A4410; font-size: 13px; line-height: 1.45;
}
.warning button { flex-shrink: 0; border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer; background: var(--action); color: var(--action-ink); font-size: 13px; font-weight: 800; }

.state-message { padding: 36px 24px; color: var(--soft); font-size: 15px; line-height: 1.6; border-top: 1px solid var(--line); }
.state-message.is-error { color: #A8431F; }
.inline-retry { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.table-note { margin: 0; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--tint); color: var(--soft); font-size: 12px; }

/* ---------- One destination: the weekends strip, the other days, the trip ---------- */

.trip { border-top: 1px solid var(--line); padding-top: 18px; }
.weeks { display: flex; gap: 2px; margin: 0 16px; overflow-x: auto; }
.wk {
  flex: 1 0 62px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; border-radius: 16px; padding: 10px 2px; cursor: pointer;
  background: transparent; color: var(--ink); font: inherit;
}
.wk:hover { background: var(--row-hover); }
.wk.is-selected { background: var(--tint-strong); box-shadow: inset 0 0 0 2px var(--accent); }
.wk-tag { height: 16px; color: var(--good); font-size: 10px; font-weight: 800; letter-spacing: 0.8px; }
.wk-price { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.wk.is-selected .wk-price { color: var(--accent); }
.wk-empty .wk-price { color: var(--placeholder); }
.wk-bar-area { width: 100%; height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.wk-bar { width: 30px; border-radius: 10px 10px 4px 4px; background: var(--bar); }
.wk.is-cheap .wk-bar { background: var(--bar-cheap); }
.wk.is-selected .wk-bar { background: var(--accent); }
.wk-empty .wk-bar { height: 40px; border: 1px dashed var(--line); background: repeating-linear-gradient(135deg, var(--tint) 0 5px, #fff 5px 10px); }
.wk-dates { color: var(--soft); font-size: 12px; font-weight: 800; line-height: 1.25; text-align: center; white-space: nowrap; }
.wk-dates span { font-weight: 600; }
.wk.is-selected .wk-dates { color: var(--ink); }
.strip-note { margin: 6px 24px 20px; color: var(--soft); font-size: 12px; }

.trip-section { border-top: 1px solid var(--line); padding-top: 20px; }
.block-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 24px 12px; }
.block-title strong { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.block-title span { color: var(--soft); font-size: 13px; }
.trip-insight { margin: 0 24px 14px; padding: 10px 14px; border-radius: 12px; background: var(--tag-bg); color: var(--ink); font-size: 13px; }

.alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0 24px 20px; }
.alt {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; cursor: pointer;
  background: #fff; color: var(--ink); font: inherit;
}
.alt:hover { border-color: var(--pill-border); background: var(--row-hover); }
.alt.is-selected { border: 2px solid var(--accent); padding: 13px 15px; background: var(--tint-strong); }
.alt.is-off { cursor: default; background: #fff; opacity: 0.55; }
.alt.is-off:hover { border-color: var(--line); }
.alt-days { font-size: 14px; font-weight: 800; }
.alt-dates { color: var(--soft); font-size: 12px; }
.alt-bottom { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 6px; margin-top: 6px; }
.alt-price { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.alt-why { color: var(--soft); font-size: 12px; font-weight: 700; }
.badge { border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-less { background: var(--good-tint); color: var(--good); }
.badge-more { background: var(--tint); color: var(--accent); }
.badge-plain { background: var(--tint); color: var(--soft); }

.trip-box {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 18px; align-items: center;
  margin: 0 24px 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--tint-strong);
}
.trip-box-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.trip-box-title strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.trip-box-title .nights { color: var(--soft); font-size: 12px; }

/* ---------- The trip page (after "Select"): book the flights, where to stay ---------- */

.trip-page { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; padding-top: 64px; margin-left: 24px; }
.back-link { align-self: flex-start; border: 0; padding: 4px 0; background: none; cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 800; }
.back-link:hover { text-decoration: underline; }
.tp-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px;
  border-radius: 30px; padding: 30px 32px; color: var(--hero-text);
  background: var(--hero-bg);
  box-shadow: 0 24px 60px rgba(var(--shadow), 0.2);
}
.tp-head .hero-badge { margin-bottom: 14px; }
.tp-head h2 { margin: 0; font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1.05; letter-spacing: -0.8px; }
.tp-country { margin-top: 4px; color: var(--hero-sub); font-size: 15px; }
.tp-when { margin-top: 14px; font-size: 16px; font-weight: 700; }
.tp-total { text-align: right; }
.tp-total strong { display: block; font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1; }
.tp-total span { color: var(--hero-sub); font-size: 13px; }

.tp-card { padding: 24px; background: #fff; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(var(--shadow), 0.14); }
.tp-card h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.tp-sub { margin: 0 0 14px; color: var(--soft); font-size: 14px; }
.tp-flight { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); }
.tp-route { margin-top: 4px; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.tp-legs { margin-top: 6px; color: var(--soft); font-size: 13px; line-height: 1.7; }
.tp-legs strong { color: var(--ink); font-weight: 800; }
.tp-legs sup { color: var(--accent); font-size: 10px; font-weight: 800; }
.tp-buy { text-align: right; }
.tp-price { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; }
.tp-price-sub { margin: 3px 0 10px; color: var(--soft); font-size: 12px; }
.book-btn.is-primary { padding: 10px 18px; border-color: var(--action); background: var(--action); color: var(--action-ink); font-size: 14px; }
.book-btn.is-primary:hover { border-color: var(--action-hover); background: var(--action-hover); }
.tp-disclosure { margin: 14px 0 0; color: var(--soft); font-size: 12px; }
.tp-placeholder {
  padding: 22px; border: 1.5px dashed var(--pill-border); border-radius: 20px;
  background: var(--tint-strong); color: var(--soft); font-size: 14px; text-align: center;
}

/* ---------- The map: behind the whole page on wide screens ---------- */

.map-col { min-width: 0; }
/* It fills the window and stays put while you scroll; the page sits on top of
   it, so you see (and drag) it in the open space right of the results. */
.map-layer { position: fixed; inset: 0; z-index: 0; }
#map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.map-layer.is-dragging #map, .map-layer.is-dragging #map .dest-dot { cursor: grabbing; }
#map .dest-dot { cursor: pointer; }
#map .dest-dot:hover .dot-core { r: 7.5; }
#map .dot-label {
  font-family: var(--font-body); font-size: 12px; font-weight: 800; fill: var(--ink);
  paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round;
  opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
#map .dest-dot:hover .dot-label { opacity: 1; }
#map-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.map-label {
  position: absolute; z-index: 3; border-radius: 999px; padding: 7px 14px; white-space: nowrap;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 800;
  box-shadow: 0 8px 18px rgba(var(--shadow), 0.18);
}
.map-label.is-dest { background: var(--action); color: var(--action-ink); }
.map-ui { position: absolute; right: 24px; bottom: 24px; z-index: 4; display: flex; align-items: flex-end; gap: 10px; }
.map-hint {
  border-radius: 999px; padding: 8px 14px; background: #fff; color: var(--ink); white-space: nowrap;
  font-size: 12px; font-weight: 700; box-shadow: 0 6px 16px rgba(var(--shadow), 0.16);
}
.map-reset {
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
  background: #fff; color: var(--accent); font: inherit; font-size: 12px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(var(--shadow), 0.16);
}
.map-zoom { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 6px 16px rgba(var(--shadow), 0.16); }
.map-zoom button { width: 36px; height: 34px; border: 0; background: #fff; cursor: pointer; color: var(--ink); font-size: 19px; font-weight: 700; line-height: 1; }
.map-zoom button + button { border-top: 1px solid var(--line); }
.map-zoom button:hover:not(:disabled) { background: var(--row-hover); color: var(--accent); }
.map-zoom button:disabled { color: var(--placeholder); cursor: default; }
/* Phones only (see the end of this file): the "Map" button, and the way back
   and place card of the full-screen map */
.map-toggle, .map-close, .map-card { display: none; }

.page-footer {
  position: relative; z-index: 3; width: var(--content); margin: 72px auto 0; padding: 28px 16px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); color: var(--soft); font-size: 13px;
  background: var(--page);
}
.footer-links { display: flex; gap: 24px; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1180px) {
  .results-grid { grid-template-columns: minmax(0, 1fr); }
  .table-box, .trip-page { margin-left: 0; }
  /* The map becomes a block under the results */
  .map-layer { position: relative; inset: auto; height: 440px; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(var(--shadow), 0.12); overflow: hidden; }
  .map-ui { right: 14px; bottom: 14px; }
}

@media (max-width: 860px) {
  :root { --content: calc(100% - 32px); } /* 16px on each side */

  /* Top bar on one line: logo, currency, sign in. ("How it works" and
     "Destinations" come back once they lead to real pages.) */
  .nav { padding: 16px 2px; gap: 10px; }
  .brand { gap: 8px; font-size: 19px; }
  .brand svg { width: 36px; height: 26px; }
  .nav-links { gap: 8px; }
  .nav-links > a:not(.btn-signin) { display: none; }
  .currency-pill select { padding: 7px 28px 7px 12px; font-size: 13px; }
  .btn-signin { padding: 7px 14px; font-size: 13px; }
  .brand, .btn-signin { white-space: nowrap; }

  /* Less text before the search: the title and one line, then the search; the
     badge goes, and the three promises move under the search, smaller */
  .hero { padding: 24px 16px 52px; border-radius: 26px; }
  .hero-content { display: flex; flex-direction: column; }
  .hero-badge { display: none; }
  .hero h1 { margin-bottom: 6px; font-size: 32px; }
  .hero-sub { margin-bottom: 16px; font-size: 15px; }
  .bar-extras { order: 1; }
  .headliners { order: 2; gap: 6px 12px; margin: 14px 0 0; }
  .headliners li { gap: 6px; font-size: 12px; }
  .headliners li::before { width: 15px; height: 15px; font-size: 9px; }

  /* The search bar as a compact grid: the departures two per row (app.js),
     then "When" (narrower, left) and "Going to" (wider, right), then the button across */
  .search-bar { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); padding: 6px; border-radius: 20px; }
  .search-bar .origins { grid-column: 1 / -1; grid-row: 1; }
  .search-bar .divider-origins { grid-column: 1 / -1; grid-row: 2; width: auto; height: 1px; margin: 0 10px; }
  .search-bar .field-when { grid-column: 1; grid-row: 3; min-width: 0; border-right: 1px solid var(--line); }
  .search-bar .field-going { grid-column: 2; grid-row: 3; }
  .search-btn { grid-column: 1 / -1; grid-row: 4; }
  .search-bar .divider:not(.divider-origins) { display: none; }
  .search-bar .field, .origin-cell { padding: 8px 10px; }
  .search-bar label { font-size: 10px; letter-spacing: 0.6px; }
  .origin-cell input[type="text"], .going-row input, .when-button { font-size: 15px; }
  .when-button { white-space: normal; line-height: 1.25; }
  .people { gap: 6px; margin-top: 5px; }
  .people-text { display: none; } /* the avatars already show how many */
  .going-sub { margin-top: 5px; font-size: 11px; }
  .search-btn { justify-content: center; margin-top: 6px; padding: 13px; border-radius: 14px; font-size: 15px; }
  /* Dropdowns can be wider than their half of the bar, and stay on screen */
  .suggestions { min-width: 0; width: min(340px, calc(100vw - 48px)); }
  .origin-cell.has-left .suggestions, .field-going .suggestions { left: auto; right: 0; } /* fields on the right open leftwards */
  .when-popover { left: 0; right: auto; width: min(380px, calc(100vw - 48px)); }
  .bar-extras { gap: 10px; margin-top: 12px; }
  .bar-hint { font-size: 12px; }

  /* Results: compact rows — the place and its total side by side, one short
     line per traveller. The exact flight times are on the trip page ("Select"). */
  .table-top { padding: 22px 16px 14px; }
  .table-top h2 { font-size: 26px; }
  .chip { padding: 7px 13px; font-size: 12px; }
  .gap-bar { margin: 0 16px 14px; }
  .table-head { display: none; }
  .row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas: "rank dest total" "rank journeys journeys";
    column-gap: 10px; row-gap: 10px; padding: 16px;
  }
  .row .rank { grid-area: rank; align-self: start; width: 30px; height: 30px; font-size: 14px; }
  .row .dest { grid-area: dest; }
  .row .journeys { grid-area: journeys; }
  .row .total-cell { grid-area: total; }
  .row .dest-city { font-size: 20px; }
  .row .total { font-size: 22px; }
  .row .total-sub { margin: 2px 0 8px; }
  .row .select-btn { padding: 8px 12px; }
  .row .times, .row .gap-note { display: none; }
  .row .traveler + .traveler { margin-top: 6px; padding-top: 6px; }
  .trip-box .total-cell { text-align: left; }
  .gap-more { margin-left: 0; }
  .trip-box { grid-template-columns: minmax(0, 1fr); }
  .tp-head { padding: 24px; }
  .tp-head h2 { font-size: 34px; }
  .tp-total { text-align: left; }
  .tp-flight { grid-template-columns: minmax(0, 1fr); }
  .tp-buy { text-align: left; }
  .alts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-hint { display: none; }
  .page-footer { flex-direction: column; align-items: flex-start; }

  /* The map: not under the list (nobody would scroll that far) — the "Map"
     button at the bottom of the screen opens it full screen instead */
  .map-col { display: none; }
  .map-toggle {
    position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer;
    background: var(--ink); color: #fff; font: inherit; font-size: 14px; font-weight: 800;
    box-shadow: 0 10px 26px rgba(var(--shadow), 0.35);
  }
  body.map-open { overflow: hidden; }
  body.map-open .results-grid { z-index: 100; } /* above the banner and the top bar */
  body.map-open .map-col { display: block; }
  body.map-open .map-layer { position: fixed; inset: 0; z-index: 60; height: auto; border: 0; box-shadow: none; }
  body.map-open #map { touch-action: none; }
  body.map-open .map-ui { top: 14px; right: 14px; bottom: auto; }
  body.map-open .map-close {
    position: absolute; top: 14px; left: 14px; z-index: 5; display: inline-flex;
    border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
    background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 800;
    box-shadow: 0 6px 16px rgba(var(--shadow), 0.2);
  }
  body.map-open .map-card {
    position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; display: block;
    padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 14px 34px rgba(var(--shadow), 0.25);
  }
  body.map-open .map-card:empty { display: none; }
  .mc-title { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.15; }
  .mc-title span { color: var(--soft); font-family: var(--font-body); font-size: 13px; font-weight: 600; }
  .mc-sub { margin-top: 3px; color: var(--soft); font-size: 13px; }
  .mc-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
  .mc-bottom strong { font-family: var(--font-display); font-size: 24px; }
  .mc-hint { margin-top: 8px; color: var(--soft); font-size: 12px; }
}

/* The narrowest phones (e.g. 320px): a smaller top bar so it stays on one line */
@media (max-width: 380px) {
  .brand { gap: 6px; font-size: 16px; }
  .brand svg { width: 30px; height: 22px; }
  .nav-links { gap: 6px; }
  .currency-pill select { padding: 6px 24px 6px 10px; background-position: right 8px center; }
  .btn-signin { padding: 6px 10px; }
  .hero h1 { font-size: 29px; }
}
