/* ==========================================================================
   WornSole — design system
   Warm "travel journal" aesthetic: paper tones, ink type, terracotta accent,
   ticket-stub cards. Logical properties throughout for RTL (Arabic).
   ========================================================================== */

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7da;
  --surface: #fffdf9;
  --surface-2: #faf6ef;
  --ink: #1b1f2a;
  --ink-2: #3a3f4d;
  --muted: #6b6f7b;
  --line: #e3dacb;
  --line-2: #d6cab6;
  --accent: #d9583b;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3db;
  --teal: #1f5f5b;
  --teal-soft: #dcebe8;
  --gold: #c99a2e;
  --good: #2f7d4f;
  --good-soft: #def0e3;
  --warn: #b7791f;
  --warn-soft: #fbefd9;
  --bad: #b23a3a;
  --bad-soft: #f7dfdf;
  --focus: #2b6cb0;
  --shadow-sm: 0 1px 2px rgba(27, 31, 42, .06), 0 1px 1px rgba(27, 31, 42, .04);
  --shadow: 0 6px 24px -8px rgba(27, 31, 42, .18), 0 2px 6px rgba(27, 31, 42, .06);
  --shadow-lg: 0 24px 60px -20px rgba(27, 31, 42, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --container: 1200px;
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12141a;
    --paper-2: #181b22;
    --surface: #1c1f27;
    --surface-2: #22262f;
    --ink: #ece7dd;
    --ink-2: #cfc9bd;
    --muted: #9a9ca6;
    --line: #2d313b;
    --line-2: #3a3f4b;
    --accent: #f07a5c;
    --accent-ink: #1a0f0b;
    --accent-soft: #3a2420;
    --teal: #6fc3bb;
    --teal-soft: #1d3332;
    --good: #6cc08b;
    --good-soft: #1b3124;
    --warn: #e2b252;
    --warn-soft: #362b17;
    --bad: #ef7d7d;
    --bad-soft: #3a1f1f;
    --focus: #7fb2f0;
    --shadow: 0 8px 28px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 16px/1.5 var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px dashed var(--line-2); margin: 2rem 0; }

.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.25em; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.6em; height: 1.6em; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2rem, 760px); margin-inline: auto; }
.stack > * + * { margin-block-start: var(--stack, 1rem); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font: 600 .75rem/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .75rem; display: inline-flex; gap: .5rem; align-items: center; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font: 700 1.3rem/1 var(--font-serif); letter-spacing: -.02em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 32px; height: 32px; }
.brand b { color: var(--accent); font-weight: 700; }
.main-nav { display: flex; gap: .25rem; }
.main-nav a { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { background: var(--paper-2); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.header-tools { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.header-tools .menu-toggle { display: none; }

@media (max-width: 820px) {
  .main-nav { display: none; position: absolute; top: var(--header-h); inset-inline: 0; background: var(--surface); flex-direction: column; padding: .75rem 1rem 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .header-tools .menu-toggle { display: inline-flex; }
  .header-tools .btn-label { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font: 600 .95rem/1.1 var(--font-sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  white-space: nowrap;
}
.btn:hover { color: var(--btn-fg); border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); box-shadow: 0 6px 16px -8px var(--accent); }
.btn-primary:hover { --btn-bg: color-mix(in srgb, var(--accent) 88%, black); --btn-bd: var(--btn-bg); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: var(--paper); --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: var(--ink-2); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--paper-2); --btn-bd: transparent; }
.btn-danger { --btn-fg: var(--bad); --btn-bd: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-sm { min-height: 34px; padding: .35rem .8rem; font-size: .875rem; }
.btn-lg { min-height: 54px; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: .35rem; }
.field > span, .label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.input, .select, textarea.input {
  width: 100%; min-height: 46px; padding: .6rem .85rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 2.2rem; }
[dir="rtl"] .select { background-position: 18px 50%, 13px 50%; }
.check { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.check input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--accent); flex: none; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 4vw, 2.25rem); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; gap: 1rem; }
.help { font-size: .85rem; color: var(--muted); }

.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- misc components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.card-link { text-decoration: none; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: .875rem; font-weight: 500; cursor: pointer; color: var(--ink-2); text-decoration: none; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.flash-stack { position: fixed; inset-block-start: calc(var(--header-h) + .75rem); inset-inline-end: 1rem; z-index: 60; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.flash, .toast { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .95rem; animation: slide-in .25s ease; }
.flash-success, .toast-success { border-inline-start: 4px solid var(--good); }
.flash-error, .toast-error { border-inline-start: 4px solid var(--bad); }
.flash-info, .toast-info { border-inline-start: 4px solid var(--teal); }
.flash button { margin-inline-start: auto; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } }

.notice { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--ink); font-size: .92rem; }
.notice .icon { color: var(--teal); margin-top: .1rem; }
.notice-warn { background: var(--warn-soft); }
.notice-warn .icon { color: var(--warn); }
.announcement { background: var(--ink); color: var(--paper); text-align: center; font-size: .9rem; padding: .5rem 1rem; }
.announcement a { color: inherit; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .icon { width: 48px; height: 48px; color: var(--line-2); margin-bottom: .75rem; }
.empty h3 { color: var(--ink); }

.skeleton { background: linear-gradient(90deg, var(--paper-2) 0, var(--surface-2) 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-block, [data-skel] { height: 220px; }
.chart-bar-swatch { background: var(--accent); }
.legend .swatch-teal { background: var(--teal); }
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .5s ease; }
.progress.indeterminate > span { width: 35%; animation: indet 1.2s infinite ease-in-out; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
[dir="rtl"] .progress.indeterminate > span { animation-direction: reverse; }

.tabs { display: flex; gap: .25rem; padding: .3rem; background: var(--paper-2); border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: none; padding: .55rem 1rem; border-radius: 999px; font: 600 .9rem/1.2 var(--font-sans); color: var(--ink-2); cursor: pointer; white-space: nowrap; display: grid; text-align: center; }
.tab small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Popovers / menus */
.popover { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem; min-width: 220px; animation: pop .14s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: var(--radius-sm); text-decoration: none; background: none; border: 0; font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover, .menu-list .active { background: var(--paper-2); color: var(--ink); }
.menu-list .active { font-weight: 700; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > .popover { top: calc(100% + 6px); inset-inline-start: 0; }
.dropdown > .popover[data-align="end"] { inset-inline-start: auto; inset-inline-end: 0; }
.popover.form-grid { padding: 1rem; min-width: 240px; }

dialog.modal { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); width: min(920px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(18, 20, 26, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-body { padding: 1.4rem; overflow: auto; }

/* ---------------------------------------------------------------- hero + search */
.hero { position: relative; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); overflow-x: clip; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(700px 380px at -10% 110%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 60%);
}
.hero-route { position: absolute; inset-inline-end: -40px; top: 10px; width: min(520px, 55vw); opacity: .55; z-index: -1; color: var(--accent); }
[dir="rtl"] .hero-route { transform: scaleX(-1); }
.hero h1 { max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--ink-2); max-width: 54ch; margin-bottom: 2rem; }

.search-panel {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1rem;
}
.search-panel.compact { box-shadow: var(--shadow-sm); padding: .75rem; border-radius: var(--radius); }
.search-options { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.opt-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid transparent; background: var(--paper-2); font: 600 .875rem/1.2 var(--font-sans); color: var(--ink-2); cursor: pointer; }
.opt-btn:hover { border-color: var(--line-2); }
.opt-btn .icon { width: 1.05em; height: 1.05em; }

.search-row { display: grid; grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1.1fr) minmax(0, 1.3fr) auto; gap: 0; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); position: relative; }
.search-row + .search-row { margin-top: .6rem; }
.multi .search-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, .8fr) auto; }
.sf-cell { position: relative; display: flex; flex-direction: column; justify-content: center; padding: .55rem .95rem; min-height: 64px; min-width: 0; }
.sf-cell + .sf-cell::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; border-inline-start: 1px dashed var(--line-2); }
.sf-cell label, .sf-cell .sf-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sf-input { border: 0; background: transparent; padding: .15rem 0 0; font: 600 1.05rem/1.3 var(--font-sans); color: var(--ink); width: 100%; min-width: 0; text-overflow: ellipsis; }
.sf-input:focus { outline: none; }
.sf-input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); font-weight: 500; }
.sf-cell:focus-within { background: var(--surface-2); border-radius: var(--radius); }
.sf-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-swap { align-self: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer; margin-inline: -18px; z-index: 2; color: var(--ink-2); transition: transform .25s ease; }
.sf-swap:hover { transform: rotate(180deg); color: var(--accent); border-color: var(--accent); }
.sf-dates { display: grid; grid-template-columns: 1fr 1fr; cursor: pointer; padding: 0; }
.sf-dates.single { grid-template-columns: 1fr; }
.sf-dates > button { all: unset; display: flex; flex-direction: column; justify-content: center; padding: .55rem .95rem; cursor: pointer; position: relative; min-width: 0; }
.sf-dates > button + button::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; border-inline-start: 1px dashed var(--line-2); }
.sf-dates > button:focus-visible { outline: 2px solid var(--focus); border-radius: var(--radius); }
.sf-date-val { font: 600 1.05rem/1.3 var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-date-val.placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); font-weight: 500; }
.sf-submit { padding: .5rem; display: flex; align-items: center; }
.sf-submit .btn { height: 100%; min-height: 52px; border-radius: calc(var(--radius) - 4px); padding-inline: 1.4rem; }
.sf-remove { align-self: center; margin-inline: .25rem; }
.multi-actions { margin-top: .6rem; display: flex; gap: .5rem; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 900px) {
  .search-row, .multi .search-row { grid-template-columns: 1fr; }
  .sf-cell + .sf-cell::before { inset-block: auto; top: 0; inset-inline: 14px; border-inline-start: 0; border-top: 1px dashed var(--line-2); }
  .sf-swap { position: absolute; inset-inline-end: 18px; top: 46px; margin: 0; transform: rotate(90deg); }
  .sf-swap:hover { transform: rotate(270deg); }
  .sf-submit .btn { width: 100%; }
}

/* Autocomplete */
.ac-list { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; width: max(100%, 360px); max-width: calc(100vw - 2rem); z-index: 55; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; list-style: none; margin: 0; max-height: 420px; overflow: auto; }
.ac-item { display: flex; gap: .75rem; align-items: center; padding: .6rem .7rem; border-radius: var(--radius-sm); cursor: pointer; }
.ac-item[aria-selected="true"], .ac-item:hover { background: var(--paper-2); }
.ac-item.sub { padding-inline-start: 2.6rem; }
.ac-item .icon { color: var(--muted); }
.ac-main { flex: 1; min-width: 0; }
.ac-name { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-meta { font-size: .8rem; color: var(--muted); }
.ac-code { font: 700 .8rem/1 var(--font-mono); color: var(--ink-2); background: var(--paper-2); padding: .3rem .45rem; border-radius: 6px; }
.ac-empty { padding: .9rem; color: var(--muted); font-size: .9rem; }

/* Passengers popover */
.pax-row { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: .6rem .5rem; }
.pax-row + .pax-row { border-top: 1px solid var(--line); }
.pax-row small { display: block; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; gap: .6rem; }
.stepper output { min-width: 1.5ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }

/* Date picker */
.datepicker { position: absolute; z-index: 56; top: calc(100% + 6px); inset-inline-end: 0; width: min(720px, calc(100vw - 1.5rem)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1rem 1.1rem 1.1rem; }
.dp-head { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; flex-wrap: wrap; }
.dp-months { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.dp-month h4 { text-align: center; font-size: 1rem; margin-bottom: .5rem; font-family: var(--font-sans); font-weight: 700; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { font-size: .72rem; text-align: center; color: var(--muted); font-weight: 600; padding: .3rem 0; }
.dp-day { aspect-ratio: 1 / 1.05; border: 0; background: none; border-radius: 10px; cursor: pointer; display: grid; place-content: center; gap: 1px; font: 600 .9rem/1 var(--font-sans); color: var(--ink); position: relative; padding: 0; }
.dp-day small { font-size: .62rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.dp-day:hover:not(:disabled) { background: var(--paper-2); }
.dp-day:disabled { color: color-mix(in srgb, var(--muted) 45%, transparent); cursor: default; }
.dp-day.low small { color: var(--good); }
.dp-day.high small { color: var(--bad); }
.dp-day.in-range { background: var(--accent-soft); border-radius: 0; }
.dp-day.start, .dp-day.end { background: var(--accent); color: var(--accent-ink); }
.dp-day.start small, .dp-day.end small { color: var(--accent-ink); }
.dp-day.start { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.dp-day.end { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.dp-day.today::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.dp-foot { display: flex; gap: .75rem; align-items: center; justify-content: space-between; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dp-legend { display: flex; gap: .9rem; font-size: .8rem; color: var(--muted); }
.dp-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: .3rem; }
@media (max-width: 700px) {
  .datepicker { position: fixed; inset: auto 0 0 0; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; overflow: auto; }
  .dp-months { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- deal + destination cards */
.dest-card { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.dest-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: inherit; }
.dest-art { height: 110px; position: relative; display: grid; place-items: end start; padding: .9rem 1rem; color: #fff; font: 700 1.5rem/1 var(--font-serif); background: var(--teal); overflow: hidden; }
.dest-art span { position: relative; z-index: 1; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.dest-art svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .35; }
.dest-body { padding: .9rem 1rem 1rem; display: grid; gap: .35rem; }
.dest-price { font: 700 1.25rem/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.dest-price small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.art-0 { background: linear-gradient(135deg, #1f5f5b, #2f8a7f); }
.art-1 { background: linear-gradient(135deg, #d9583b, #e8915f); }
.art-2 { background: linear-gradient(135deg, #2b3a67, #496a9a); }
.art-3 { background: linear-gradient(135deg, #8a5a2b, #c99a2e); }
.art-4 { background: linear-gradient(135deg, #5a2d5e, #9a4f8a); }
.art-5 { background: linear-gradient(135deg, #2f6d3a, #6aa860); }

.feature { display: grid; gap: .6rem; }
.feature .feature-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.feature:nth-child(2) .feature-icon { background: var(--teal-soft); color: var(--teal); }
.feature:nth-child(3) .feature-icon { background: var(--warn-soft); color: var(--warn); }
.feature:nth-child(4) .feature-icon { background: var(--good-soft); color: var(--good); }

.route-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; list-style: none; padding: 0; margin: 0; }
.route-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.route-list a:hover { border-color: var(--accent); color: inherit; }
.route-list .price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .75rem 0 0; color: var(--ink-2); }

/* ---------------------------------------------------------------- results */
.results-top { padding-block: 1rem; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.results-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.75rem; padding-block: 1.5rem 3rem; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 1rem); display: grid; gap: 1.1rem; max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; padding-inline-end: .25rem; }
.filter-group { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.filter-group h3 { font: 700 .8rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; display: flex; justify-content: space-between; }
.filter-group .check { font-size: .92rem; padding-block: .2rem; justify-content: space-between; }
.filter-group .check span:first-of-type { flex: 1; }
.filter-group .check em { font-style: normal; color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.range { width: 100%; accent-color: var(--accent); }
.range-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.filters-toggle { display: none; }
@media (max-width: 960px) {
  .results-layout { grid-template-columns: 1fr; }
  .filters { position: fixed; inset: 0; z-index: 70; background: var(--surface); padding: 1rem 1.25rem 6rem; max-height: none; transform: translateX(-100%); transition: transform .25s ease; }
  [dir="rtl"] .filters { transform: translateX(100%); }
  .filters.open { transform: none; }
  .filters-toggle { display: inline-flex; }
  .filters-close { display: inline-flex !important; }
}
.filters-close { display: none !important; }

.date-strip { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: stretch; margin-bottom: 1rem; }
.date-strip-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.ds-day { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: .5rem .25rem; text-align: center; cursor: pointer; text-decoration: none; display: grid; gap: .15rem; font-size: .8rem; color: var(--ink-2); }
.ds-day strong { font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-day.current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.ds-day.cheapest strong { color: var(--good); }
.ds-day:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 640px) { .date-strip-days { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ds-day:nth-child(1), .ds-day:nth-child(7) { display: none; } }

.insight { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.insight-dot { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); }
.insight.low .insight-dot { background: var(--good-soft); color: var(--good); }
.insight.high .insight-dot { background: var(--bad-soft); color: var(--bad); }
.insight.typical .insight-dot { background: var(--warn-soft); color: var(--warn); }
.insight h3 { margin: 0 0 .2rem; font-size: 1.05rem; font-family: var(--font-sans); }
.insight p { margin: 0; font-size: .9rem; color: var(--muted); }
.price-meter { position: relative; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--good), var(--gold) 50%, var(--bad)); margin-top: .5rem; max-width: 320px; }
[dir="rtl"] .price-meter { background: linear-gradient(-90deg, var(--good), var(--gold) 50%, var(--bad)); }
.price-meter i { position: absolute; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); margin-inline-start: -7px; }
@media (max-width: 640px) { .insight { grid-template-columns: auto 1fr; } .insight .insight-actions { grid-column: 1 / -1; } }

.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.results-count { font-size: .9rem; color: var(--muted); }
.group-title { font: 700 .8rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 1.5rem 0 .75rem; display: flex; align-items: center; gap: .75rem; }
.group-title::after { content: ""; flex: 1; border-top: 1px dashed var(--line-2); }

/* Ticket-stub itinerary card */
.itin {
  --notch: 11px;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: .75rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
.itin:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.itin.best { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.itin-main { padding: 1rem 1.25rem; min-width: 0; cursor: pointer; }
.itin-stub { position: relative; padding: 1rem 1.25rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: .45rem; text-align: end; border-inline-start: 2px dashed var(--line-2); }
.itin-stub::before, .itin-stub::after { content: ""; position: absolute; inset-inline-start: calc(-1 * var(--notch) - 1px); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.itin-stub::before { top: calc(-1 * var(--notch) - 1px); clip-path: inset(50% 0 0 0); }
.itin-stub::after { bottom: calc(-1 * var(--notch) - 1px); clip-path: inset(0 0 50% 0); }
.itin-price { font: 700 1.5rem/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.itin-price-sub { font-size: .78rem; color: var(--muted); }
.itin-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .6rem; }
.leg { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.leg + .leg { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.carrier-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; font: 700 .75rem/1 var(--font-mono); color: var(--ink-2); }
.carrier-logo img { width: 100%; height: 100%; object-fit: contain; }
.leg-times { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: .8rem; align-items: center; }
.leg-time { font: 700 1.2rem/1.1 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.leg-time sup { font-size: .65rem; color: var(--accent); margin-inline-start: 2px; font-weight: 700; }
.leg-code { font-size: .8rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.leg-line { display: grid; gap: .25rem; text-align: center; font-size: .78rem; color: var(--muted); min-width: 0; }
.leg-line .track { position: relative; height: 2px; background: var(--line-2); border-radius: 2px; }
.leg-line .track i { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); margin-inline-start: -4px; }
.leg-line .track::after { content: ""; position: absolute; inset-inline-end: -2px; top: -4px; border: 5px solid transparent; border-inline-start: 7px solid var(--line-2); }
[dir="rtl"] .leg-line .track::after { border-inline-start-color: var(--line-2); }
.leg-line .stops-direct { color: var(--good); font-weight: 600; }
.leg-airline { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-dur { text-align: end; font-size: .85rem; color: var(--ink-2); white-space: nowrap; }
.itin-details { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 1.1rem 1.25rem; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.timeline { list-style: none; margin: 0 0 1rem; padding: 0; position: relative; }
.tl-seg { display: grid; grid-template-columns: 70px 20px 1fr; gap: .6rem; }
.tl-time { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; font-size: .95rem; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 8px; bottom: -8px; width: 2px; background: var(--line-2); }
.tl-rail i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink-2); background: var(--surface); margin-top: 5px; z-index: 1; }
.tl-seg.end .tl-rail::before { display: none; }
.tl-body { padding-bottom: 1rem; font-size: .92rem; }
.tl-body .muted { font-size: .82rem; }
.tl-layover { margin: 0 0 1rem 98px; padding: .55rem .8rem; border-radius: var(--radius-sm); background: var(--paper-2); font-size: .85rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
[dir="rtl"] .tl-layover { margin: 0 98px 1rem 0; }
.offers { display: grid; gap: .5rem; }
.offer { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.offer-agent { display: flex; align-items: center; gap: .6rem; font-weight: 600; min-width: 0; }
.offer-agent img { width: 56px; height: 28px; object-fit: contain; }
.offer-price { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .itin { grid-template-columns: 1fr; }
  .itin-stub { border-inline-start: 0; border-top: 2px dashed var(--line-2); flex-direction: row; justify-content: space-between; align-items: center; text-align: start; }
  .itin-stub::before, .itin-stub::after { display: none; }
  .leg { grid-template-columns: 36px minmax(0, 1fr); }
  .leg-dur { grid-column: 2; text-align: start; }
  .carrier-logo { width: 34px; height: 34px; }
  .leg-time { font-size: 1.05rem; }
  .offer { grid-template-columns: 1fr auto; }
  .offer .btn { grid-column: 1 / -1; }
}
.results-skeleton .itin { height: 120px; border: 0; }
.load-more { display: flex; justify-content: center; margin-top: 1rem; }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart-dot.sel { fill: var(--accent); }
.chart-band { fill: color-mix(in srgb, var(--good) 10%, transparent); }
.chart-bar { fill: var(--accent); }
.chart-s1 { fill: var(--teal); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); padding: .35rem .6rem; border-radius: 8px; font-size: .8rem; white-space: nowrap; transform: translate(-50%, -120%); }
.chart-wrap { position: relative; }
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .35rem; vertical-align: -1px; }
.spark { width: 120px; height: 34px; }
.spark path { fill: none; stroke: var(--teal); stroke-width: 2; }

.grid-table { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: .85rem; }
.grid-table th { font-weight: 600; color: var(--muted); padding: .4rem; white-space: nowrap; font-size: .78rem; }
.grid-table td { text-align: center; padding: 0; }
.grid-table td a, .grid-table td span { display: block; padding: .6rem .3rem; border-radius: 8px; background: var(--paper-2); text-decoration: none; font-variant-numeric: tabular-nums; font-weight: 600; }
.grid-table td a:hover { outline: 2px solid var(--accent); color: inherit; }
.grid-table td.low a { background: var(--good-soft); color: var(--good); }
.grid-table td.high a { background: var(--bad-soft); color: var(--bad); }
.grid-table td.sel a { outline: 2px solid var(--ink); }
.grid-table td.none span { color: var(--muted); font-weight: 400; }
.grid-scroll { overflow-x: auto; }

/* ---------------------------------------------------------------- explore */
.explore-shell { display: grid; grid-template-columns: 400px minmax(0, 1fr); height: calc(100vh - var(--header-h)); }
.explore-panel { overflow: auto; border-inline-end: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; }
.explore-controls { padding: 1rem; display: grid; gap: .75rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.explore-controls .row { gap: .5rem; }
.explore-max { width: 100%; }
.explore-controls .search-row { grid-template-columns: 1fr; }
[data-explore-status] { padding: .5rem 1rem 0; margin: 0; }
.explore-list { list-style: none; margin: 0; padding: .5rem; display: grid; gap: .4rem; }
.explore-item { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .75rem .85rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.explore-item:hover, .explore-item.active { border-color: var(--accent); }
.explore-item h3 { font-size: 1.05rem; margin: 0; }
.explore-item .price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }
.explore-item .meta { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); display: flex; gap: .75rem; flex-wrap: wrap; }
.explore-item .actions { grid-column: 1 / -1; display: none; gap: .5rem; margin-top: .4rem; flex-wrap: wrap; }
.explore-item.active .actions { display: flex; }
#map { width: 100%; height: 100%; background: var(--paper-2); }
.price-pin { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 8px; font: 700 12px/1.2 var(--font-sans); white-space: nowrap; box-shadow: var(--shadow-sm); transform: translate(-50%, -50%); display: inline-block; cursor: pointer; }
.price-pin.cheap { background: var(--good); color: #fff; border-color: var(--good); }
.price-pin.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); z-index: 1000; }
.origin-pin { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 4px solid var(--surface); box-shadow: 0 0 0 3px var(--ink); transform: translate(-50%, -50%); }
.leaflet-div-icon.ws-icon { background: none; border: 0; }
.leaflet-container { font-family: var(--font-sans); }
@media (max-width: 900px) {
  .explore-shell { grid-template-columns: 1fr; grid-template-rows: 45vh auto; height: auto; }
  .explore-panel { order: 2; border: 0; }
  #map { order: 1; height: 45vh; }
}

/* ---------------------------------------------------------------- SEO route page */
.route-hero { padding-block: 2.5rem 2rem; }
.route-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.route-arc { display: flex; align-items: center; gap: 1rem; font: 700 1.05rem/1 var(--font-sans); color: var(--ink-2); margin-bottom: 1rem; }
.route-arc svg { flex: 1; max-width: 220px; height: 40px; color: var(--accent); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin-block: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat-value { font: 700 1.5rem/1.2 var(--font-sans); margin-top: .35rem; font-variant-numeric: tabular-nums; }
.month-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; align-items: end; height: 220px; padding-top: 1.5rem; }
.month-bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .4rem; height: 100%; text-decoration: none; }
.month-bar .bar { width: 100%; border-radius: 8px 8px 3px 3px; background: color-mix(in srgb, var(--teal) 70%, transparent); min-height: 6px; position: relative; transition: background .15s; }
.month-bar.cheapest .bar { background: var(--accent); }
.month-bar:hover .bar { background: var(--ink); }
.month-bar .val { font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.month-bar .mon { font-size: .75rem; color: var(--muted); }
@media (max-width: 640px) { .month-bars { grid-template-columns: repeat(6, minmax(0, 1fr)); height: auto; } .month-bar { height: 160px; } }
.deal-table { width: 100%; border-collapse: collapse; }
.deal-table th, .deal-table td { padding: .75rem .5rem; border-bottom: 1px solid var(--line); text-align: start; font-size: .92rem; }
.deal-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.deal-table td.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.airline-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.airline-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .7rem .35rem .35rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.airline-chip img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------------------------------------------------------------- account */
.page-head { padding-block: 2rem 1.25rem; }
.alert-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 1.25rem; align-items: center; }
.alert-route { font: 700 1.15rem/1.2 var(--font-serif); }
.alert-price { text-align: end; }
.alert-price strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; display: block; }
@media (max-width: 720px) { .alert-card { grid-template-columns: 1fr; } .alert-price { text-align: start; } }
.verify-banner { margin-bottom: 1.25rem; }
.side-nav { display: grid; gap: .25rem; }
.side-nav a { padding: .6rem .8rem; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; display: flex; gap: .6rem; align-items: center; }
.side-nav a:hover { background: var(--paper-2); }
.side-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* Auth */
.auth-shell { display: grid; place-items: center; padding: 3rem 1rem; }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { font-size: 2rem; }
.auth-alt { text-align: center; margin-top: 1.25rem; font-size: .95rem; }

/* ---------------------------------------------------------------- admin */
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.admin-nav { border-inline-end: 1px solid var(--line); padding: 1.25rem .75rem; background: var(--paper-2); }
.admin-nav h2 { font: 700 .75rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding-inline: .8rem; margin-bottom: .75rem; }
.admin-main { padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
.data-table th { background: var(--surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table form { display: inline; }
.pager { display: flex; gap: .5rem; margin-top: 1rem; justify-content: center; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { border: 0; border-bottom: 1px solid var(--line); }
  .admin-nav .side-nav { grid-auto-flow: column; overflow-x: auto; }
}

/* ---------------------------------------------------------------- legal / prose */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-inline-start: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.placeholder-note { border: 1px dashed var(--warn); background: var(--warn-soft); padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1.5rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--ink); color: color-mix(in srgb, var(--paper) 80%, transparent); padding-block: 3rem 2rem; margin-top: 3rem; font-size: .92rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer-grid h4 { font: 700 .78rem/1 var(--font-sans); text-transform: uppercase; letter-spacing: .12em; color: var(--paper); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer .brand { color: var(--paper); margin-bottom: .75rem; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; font-size: .85rem; }
.footer-prefs { display: flex; gap: .5rem; flex-wrap: wrap; }
.footer-prefs .select { min-height: 36px; padding-block: .3rem; background-color: transparent; color: var(--paper); border-color: rgba(255, 255, 255, .25); width: auto; font-size: .88rem; }
.footer-prefs .select option { color: #1b1f2a; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (prefers-color-scheme: dark) { .site-footer { background: #0b0c10; } }

/* Cookie banner */
.cookie-banner { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 1100; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.1rem 1.25rem; display: grid; gap: .8rem; }
.cookie-banner p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.cookie-banner .row { justify-content: flex-end; }

/* Error page */
.error-page { text-align: center; padding-block: 5rem; }
.error-code { font: 700 clamp(5rem, 18vw, 9rem)/1 var(--font-serif); color: var(--accent); letter-spacing: -.04em; }

/* Go (POST redirect) */
.go-page { display: grid; place-items: center; min-height: 60vh; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .filters, .cookie-banner, .search-panel { display: none !important; }
  body { background: #fff; }
}

/* ---------------------------------------------------------------- utilities */
.grow { flex: 1; }
.mt-sm { margin-top: .5rem; }
.justify-end { justify-content: flex-end; }
.h3 { font-size: 1.2rem; }
.dp-legend .lg-low { background: var(--good); }
.dp-legend .lg-high { background: var(--bad); }
.skeleton-row { height: 76px; list-style: none; }
.sf-swap + .sf-cell { padding-inline-start: 1.7rem; }
@media (max-width: 900px) { .sf-swap + .sf-cell { padding-inline-start: .95rem; } }
@media (max-width: 700px) { .hero-route { display: none; } }
