:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --text: #0b1220;
  --text-2: #334155;
  --muted: #6b7789;
  --line: #e4e8ef;
  --line-strong: #d3d9e3;
  --brand: #2f5bea;
  --brand-dark: #2147c9;
  --brand-soft: #edf2ff;
  --green: #12804a;
  --green-soft: #e3f7ec;
  --amber: #b45309;
  --red: #c02626;
  --field: #ffffff;
  --field-hover: #b7c0cf;
  --topbar: rgba(255, 255, 255, 0.85);
  --track: #eef1f6;
  --good-line: #a7e3c1;
  --hit-bg: #f3fcf7;
  --tip-bg: #fff8e6; --tip-text: #7a4a06; --tip-line: #fde7b0;
  --demo-bg: #fffaeb; --demo-line: #fbe3a4; --demo-icon-bg: #fdecc0; --demo-icon: #92560a;
  --selection: #c7d6ff;
  --backdrop: rgba(11, 18, 32, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.05), 0 2px 8px rgba(11, 18, 32, 0.04);
  --shadow-lg: 0 10px 30px rgba(11, 18, 32, 0.1);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

/* Dark theme: used when the toggle says dark, or says "system" and the computer is in dark mode */
:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #131b2e;
  --text: #e8edf6;
  --text-2: #c3ccdb;
  --muted: #8a96ab;
  --line: #222d44;
  --line-strong: #2f3b55;
  --brand: #6d8cff;
  --brand-dark: #8aa3ff;
  --brand-soft: #1b2650;
  --green: #4ade80;
  --green-soft: #12301f;
  --amber: #fbbf24;
  --red: #f87171;
  --field: #0f1628;
  --field-hover: #42506d;
  --topbar: rgba(11, 17, 32, 0.82);
  --track: #1e2840;
  --good-line: #1f6b43;
  --hit-bg: #10261b;
  --tip-bg: #2a2110; --tip-text: #fcd78a; --tip-line: #4a3a17;
  --demo-bg: #221c0e; --demo-line: #44391a; --demo-icon-bg: #3a2f12; --demo-icon: #fbbf24;
  --selection: #2c3f8a;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="dark"] .btn.primary { color: #0b1120; }
:root[data-theme="dark"] .btn.primary:hover { color: #0b1120; }
:root[data-theme="dark"] .rating { color: #0b1120; }
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .trip-hero,
:root[data-theme="dark"] .thumb,
:root[data-theme="dark"] .item-thumb { filter: saturate(0.9) brightness(0.88); }
:root[data-theme="dark"] .airline-badge { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: color-mix(in srgb, var(--c) 55%, white); }
:root[data-theme="dark"] .route-card::before { filter: brightness(0.9); }

/* Smooth switch between themes */
body, .panel, .sum-card, .stat, .flight, .stay-card, .trip-card, .alert-row, .route-card, .topbar, input, select, textarea {
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: 0.2s;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 2rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0.25rem 0; }
[hidden] { display: none !important; }
.ico { flex: none; display: inline-block; vertical-align: -0.15em; }
::selection { background: var(--selection); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; animation: fade 0.25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(24px, calc((100vw - 1072px) / 2));
  background: var(--topbar);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.logo {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #2f5bea, #14b8a6);
  box-shadow: 0 4px 12px rgba(47, 91, 234, 0.3);
}
.nav { display: flex; gap: 2px; background: var(--bg); padding: 4px; border-radius: 999px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem;
  padding: 7px 14px; border-radius: 999px; transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--brand); background: var(--surface); box-shadow: var(--shadow); }
.nav-badge {
  min-width: 18px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 18px;
}

.disclosure { margin-top: 14px; text-align: center; }
.email-page { max-width: 520px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 28px; }
.email-page h1 { font-size: 1.5rem; }

/* Tracking consent prompt (EU/EEA/UK/CH visitors) */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 45; margin: 0 auto; max-width: 760px;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 16px 18px; animation: pop 0.2s var(--ease);
}
.consent-text { flex: 1; min-width: 240px; }
.consent-text p { color: var(--text-2); margin-top: 4px; }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .btn { min-width: 96px; } /* equal weight: declining is as easy as accepting */
.consent-state { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { margin-bottom: 4px; }
.legal > .muted { margin-bottom: 20px; }
.legal h2 { margin-bottom: 8px; }
.legal ul { margin: 6px 0; padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal p, .legal li { color: var(--text-2); }
.footer a { color: inherit; }
.handoff-note { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 28px; }
a.route-card { text-decoration: none; }
.route-card .route-price .ico { vertical-align: -0.1em; }

.preview-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 9px 20px; font-size: 0.86rem;
  background: var(--tip-bg); color: var(--tip-text); border-bottom: 1px solid var(--tip-line);
}

/* ---------- Loading, errors, data source ---------- */
.skeleton {
  display: block; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--track) 25%, var(--line) 50%, var(--track) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading { display: flex; flex-direction: column; gap: 10px; }
.sk-row { height: 84px; }
.sk-panel { height: 190px; margin-bottom: 16px; }
.sk-card { height: 340px; }
.sk-price { display: inline-block; width: 90px; height: 22px; border-radius: 6px; vertical-align: middle; }
.error-box {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
}
.error-box > div { flex: 1; min-width: 200px; }
.error-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.checking { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.source-pill { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--track); color: var(--text-2); margin-right: 6px; }
.source-pill.live { background: var(--green-soft); color: var(--green); }
.source-pill.test { background: var(--tip-bg); color: var(--tip-text); }
.stay-foot .btn-row { flex-wrap: wrap; justify-content: flex-end; }
.flight .actions { display: flex; flex-direction: column; gap: 6px; }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .spinner { animation: none; }
  main.container, .modal, .toast, .modal-backdrop { animation: none; }
}

.theme-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line-strong);
  padding: 7px 12px; border-radius: 999px; min-width: 92px; justify-content: center;
}
.theme-btn:hover { color: var(--text); border-color: var(--muted); }
.topbar .nav { margin-left: auto; }

.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--line); }

/* ---------- Hero + search ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(20, 184, 166, 0.35), transparent 50%),
    linear-gradient(135deg, #172a74, #2f5bea 60%, #3b82f6);
  color: #fff; border-radius: 24px; padding: 36px 32px 30px; margin-bottom: 32px;
  box-shadow: 0 12px 32px rgba(47, 91, 234, 0.22);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.25;
  background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.hero-stays {
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(251, 191, 36, 0.25), transparent 50%),
    linear-gradient(135deg, #0b3b3a, #0f766e 60%, #14b8a6);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.22);
}
.hero h1 { font-size: 2.2rem; position: relative; z-index: 1; }
.hero p { opacity: 0.88; margin: 6px 0 22px; position: relative; z-index: 1; max-width: 560px; }
.search {
  position: relative; z-index: 1;
  display: grid; gap: 10px; align-items: end;
  background: var(--surface); color: var(--text); padding: 14px; border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.search-flights { grid-template-columns: 1.5fr auto 1.5fr 1.1fr 0.6fr 1fr auto; }
.search-stays { grid-template-columns: 1.5fr 1fr 1fr 0.7fr auto; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); text-transform: none; letter-spacing: normal;
  padding: 0 12px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--field); width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--field-hover); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.15); }
.search .btn.primary { height: 44px; padding: 0 20px; }
.swap {
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line-strong); background: var(--field); border-radius: 50%; width: 36px; height: 36px;
  cursor: pointer; margin-bottom: 4px; transition: transform 0.25s var(--ease), color 0.15s;
}
.swap:hover { color: var(--brand); border-color: var(--brand); transform: rotate(180deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(47, 91, 234, 0.3); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 0.84rem; }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.glass { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: #fff; backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(255, 255, 255, 0.28); color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.icon-btn {
  display: inline-grid; place-items: center;
  border: none; background: transparent; cursor: pointer;
  width: 34px; height: 34px; border-radius: 9px; color: var(--muted); transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.btn-row { display: flex; gap: 8px; align-items: center; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Panels & shared ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.panel-head.spaced { margin: 4px 0 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }
.h-icon { display: flex; align-items: center; gap: 9px; }
.h-icon .ico { color: var(--brand); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.back:hover { color: var(--brand); }
.sub { margin: 16px 0 10px; font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.big { font-size: 1.3rem; letter-spacing: -0.01em; }
.good { color: var(--green); }
.warn { color: var(--amber); }
.bad { color: var(--red); }
.loc { display: flex; align-items: center; gap: 5px; }
.tip { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--tip-bg); color: var(--tip-text); border: 1px solid var(--tip-line); }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.big-empty { padding: 56px 20px; }
.big-empty h3 { color: var(--text); margin: 12px 0 4px; font-size: 1.1rem; }
.empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); }
.empty-line { padding: 10px 0 2px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.gray { background: var(--bg); color: var(--muted); }

/* ---------- Popular routes / destinations ---------- */
.route-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.route-card {
  font: inherit; text-align: left; cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.route-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, hsl(var(--h) 65% 50%), hsl(calc(var(--h) + 50) 70% 60%));
}
.route-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.route-cities { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.route-cities .ico { color: var(--muted); }
.route-price { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.route-price strong { color: var(--text); font-size: 1.2rem; }
.dest .route-cities { font-size: 1.15rem; }
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 4px 4px; }
.feature > .ico { color: var(--brand); background: var(--brand-soft); border-radius: 12px; padding: 10px; width: 42px; height: 42px; }

/* ---------- Cheaper days ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-btn {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; color: var(--text-2);
  padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.78rem;
  transition: border-color 0.15s, transform 0.15s;
}
.day-btn strong { font-size: 1rem; color: var(--text); }
.day-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.day-btn.low { background: var(--green-soft); border-color: var(--good-line); }
.day-btn.low strong { color: var(--green); }
.day-btn.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.day-btn.active strong { color: var(--brand); }

/* ---------- Summary + stats ---------- */
.summary, .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.sum-card, .stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.sum-card strong, .stat strong { font-size: 1.5rem; letter-spacing: -0.02em; }
.sum-card .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-label { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sum-label .ico { color: var(--brand); }
.stat .progress { margin-top: 10px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); padding: 6px 14px; border-radius: 999px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
label.inline { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; text-transform: none; letter-spacing: normal; font-size: 0.85rem; color: var(--text-2); }
label.inline select { width: auto; height: 36px; padding: 0 8px; }
label.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Flights ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.flight {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; display: grid; grid-template-columns: 1.15fr 2fr 0.9fr auto; gap: 20px; align-items: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.flight:hover { box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.flight.is-cheapest { border-color: var(--good-line); }
.airline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.airline-badge {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); font-weight: 800; font-size: 0.85rem;
}
.route-line { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.rl-end { display: flex; flex-direction: column; }
.rl-end:last-child { text-align: right; }
.rl-end strong { font-size: 1.05rem; }
.rl-end sup { color: var(--red); font-size: 0.68rem; margin-left: 2px; }
.rl-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.rl-mid span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rl-track {
  position: relative; width: 100%; height: 2px; background: var(--line-strong); border-radius: 2px;
  display: flex; justify-content: space-evenly; align-items: center;
}
.rl-track::before, .rl-track::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%);
  background: var(--surface); border: 2px solid var(--muted);
}
.rl-track::before { left: -2px; }
.rl-track::after { right: -2px; }
.rl-track i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--surface); }
.price { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.price strong { font-size: 1.35rem; letter-spacing: -0.02em; }

/* ---------- Stays ---------- */
.stay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.stay-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.stay-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.thumb {
  height: 140px; position: relative; overflow: hidden; color: #fff; padding: 12px 14px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.25), transparent 40%),
    linear-gradient(135deg, hsl(var(--h) 50% 36%), hsl(calc(var(--h) + 30) 58% 52%));
  display: flex; flex-direction: column; justify-content: space-between;
}
.thumb-icon { position: absolute; right: -6px; bottom: -14px; opacity: 0.2; }
/* Real hotel photo over the colored background; a dark fade keeps the labels readable */
.thumb-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.has-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), transparent 40%, rgba(0,0,0,0.45)); }
.thumb.has-photo > .type, .thumb.has-photo > .thumb-text, .thumb.has-photo > .corner { z-index: 1; }
.thumb .type { align-self: flex-start; background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(4px); font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; position: relative; }
.thumb-text { font-weight: 650; font-size: 0.88rem; position: relative; }
.stars { letter-spacing: 2px; }
.stars span { opacity: 0.35; }
.corner { position: absolute; top: 12px; right: 12px; }
.stay-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.stay-title { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 2px; }
.stay-title h3 { font-size: 1.02rem; }
.rating { flex: none; background: var(--brand); color: #fff; font-weight: 750; font-size: 0.85rem; padding: 4px 8px; border-radius: 9px 9px 9px 3px; }
.amenities { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.amenities span { font-size: 0.72rem; font-weight: 600; background: var(--bg); color: var(--text-2); padding: 3px 9px; border-radius: 999px; }
.stay-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; border-top: 1px solid var(--line); }

/* ---------- Trips ---------- */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.trip-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; color: inherit; text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.trip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.trip-top, .trip-hero {
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(135deg, hsl(var(--h) 55% 30%), hsl(calc(var(--h) + 30) 60% 46%));
}
.trip-top { height: 96px; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; }
.trip-city { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.countdown { font-size: 0.75rem; font-weight: 700; background: rgba(0, 0, 0, 0.22); padding: 3px 10px; border-radius: 999px; }
.trip-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 5px; }
.trip-body h3 { font-size: 1.08rem; }
.counts { display: flex; gap: 14px; color: var(--text-2); }
.counts span { display: inline-flex; align-items: center; gap: 5px; }
.counts .ico { color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #14b8a6); border-radius: 999px; }
.progress.over span { background: linear-gradient(90deg, #f97316, #ef4444); }

.trip-hero {
  border-radius: 24px; padding: 32px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.trip-hero h1 { font-size: 2.2rem; margin: 8px 0 2px; }
.trip-hero p { opacity: 0.9; }
.trip-hero .trip-city { font-size: 0.9rem; opacity: 0.95; }
.item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.panel-head + .item { border-top: none; }
.item-main { flex: 1; min-width: 0; }
.item-right { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.item-right strong { font-size: 1.05rem; }
.item-thumb {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 50% 42%), hsl(calc(var(--h) + 35) 58% 58%));
}
.itinerary { display: flex; flex-direction: column; gap: 0; margin-top: 14px; }
.day { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; padding: 10px 0; position: relative; }
.day + .day { border-top: 1px dashed var(--line); }
.day-label { display: flex; flex-direction: column; padding-top: 8px; padding-left: 18px; position: relative; }
.day-label::before { content: ""; position: absolute; left: 0; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Alerts ---------- */
.demo { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--demo-bg); border-color: var(--demo-line); box-shadow: none; }
.demo-text { display: flex; gap: 12px; align-items: flex-start; }
.demo-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--demo-icon-bg); color: var(--demo-icon); }
.alert-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px;
  display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 18px; align-items: center;
}
.alert-row.hit { border-color: var(--good-line); background: linear-gradient(90deg, var(--hit-bg), var(--surface) 40%); }
.alert-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.alert-row.hit .alert-icon { background: var(--green-soft); color: var(--green); }
.alert-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.alert-chart { color: var(--brand); }
.alert-row.hit .alert-chart { color: var(--green); }
.alert-price { display: flex; flex-direction: column; align-items: flex-end; min-width: 130px; }

/* ---------- Modal + toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade 0.15s ease;
}
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 470px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); animation: pop 0.2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.modal-body { padding: 14px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-body .new-trip { display: flex; flex-direction: column; gap: 14px; padding: 14px; background: var(--bg); border-radius: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  box-shadow: var(--shadow-lg); animation: pop 0.2s var(--ease);
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .search-flights { grid-template-columns: 1fr auto 1fr; }
  .search-flights label:nth-of-type(n + 3) { grid-column: span 1; }
  .search-flights label:nth-of-type(3) { grid-column: 1 / 2; }
  .search-flights label:nth-of-type(4) { grid-column: 2 / 4; }
  .search-flights label:nth-of-type(5), .search-flights .btn { grid-column: span 3; }
  .search-stays { grid-template-columns: 1fr 1fr; }
  .search-stays label:first-child, .search-stays .btn { grid-column: span 2; }
  .flight { grid-template-columns: 1fr auto; gap: 14px; }
  .flight .route-line { grid-column: 1 / -1; grid-row: 2; }
  .flight .actions { grid-column: 1 / -1; }
  .flight .actions .btn { width: 100%; }
  .alert-row { grid-template-columns: auto 1fr auto; }
  .alert-chart { display: none; }
  .route-grid, .feature-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  h1, .hero h1, .trip-hero h1 { font-size: 1.6rem; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .topbar .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .theme-btn { min-width: 0; }
  .nav a { padding: 7px 10px; font-size: 0.85rem; gap: 5px; }
  .hero, .trip-hero { padding: 22px 18px; border-radius: 20px; }
  .stats, .route-grid, .feature-row { grid-template-columns: 1fr; }
  .summary { gap: 8px; }
  .summary .sum-card { padding: 12px; }
  .summary .sum-card strong { font-size: 1.15rem; }
  .summary .sum-label { font-size: 0.66rem; letter-spacing: 0.02em; }
  .summary .sum-label .ico, .summary .sum-card .small { display: none; }
  .days { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .day-btn { flex: 0 0 84px; scroll-snap-align: start; }
  .day { grid-template-columns: 1fr; gap: 6px; }
  .alert-row { grid-template-columns: auto 1fr; }
  .alert-price, .alert-row > .btn-row { grid-column: 2; align-items: flex-start; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .footer { flex-direction: column; }
}
