/* Bookvia — design system (PROJECT.md §12, §13)
   Standard travel-agency register: light warm surfaces, a bounded photo/video
   banner (not a full-screen cinematic backdrop), a real search form as the
   home-screen hero, and the AI assistant as a small floating helper rather
   than the dominant interface. Greige base, navy secondary, warm wood accent. */

:root {
  --bg: #faf7f2;
  --bg-2: #f1ebe1;
  --surface: #ffffff;
  --surface-2: #f6f1e9;
  --hairline: rgba(37, 29, 22, 0.10);
  --hairline-2: rgba(37, 29, 22, 0.16);
  --text: #2b2420;
  --dim: rgba(43, 36, 32, 0.64);
  --faint: rgba(43, 36, 32, 0.42);

  /* warm wood — the one accent: buttons, links, active states */
  --wood: #a3673a;
  --wood-soft: rgba(163, 103, 58, 0.10);
  --wood-line: rgba(163, 103, 58, 0.32);
  --wood-deep: #7d4d28;
  --wood-tint: #c9925c;

  /* slight navy — secondary, used sparingly (icons, info chips) */
  --navy: #35526d;
  --navy-soft: rgba(53, 82, 109, 0.08);
  --navy-deep: #22384c;

  --ok: #3f7a4f;
  --ok-soft: rgba(63, 122, 79, 0.10);
  --warn: #966b2e;
  --warn-soft: rgba(150, 107, 46, 0.10);

  --shadow-sm: 0 1px 2px rgba(30, 24, 18, 0.06);
  --shadow-md: 0 10px 26px rgba(30, 24, 18, 0.09);
  --shadow-lg: 0 22px 54px rgba(30, 24, 18, 0.14);

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --ease: cubic-bezier(0.32, 0.72, 0.24, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: #efe8dc;
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--wood-soft); color: var(--wood-deep); }

/* ---------- app shell ----------
   Under 1024px: mobile app — full bleed, bottom tab bar, floating AI button.
   1024px and up: desktop app — left sidebar, wide content, docked AI panel. */
.device {
  position: relative; z-index: 1;
  width: 100%; max-width: none;
  height: 100svh;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.sidebar { display: none; }

.screen-inner { max-width: 760px; margin: 0 auto; width: 100%; }

@media (min-width: 1024px) {
  body { align-items: stretch; justify-content: stretch; }
  .device { flex-direction: row; height: 100vh; }
  .tabbar { display: none !important; }

  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    width: 252px; flex: 0 0 252px;
    padding: 22px 14px calc(18px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--hairline);
    background: var(--surface);
    z-index: 9;
  }
  .side-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px 22px;
    font-family: "Outfit", sans-serif; font-weight: 700; font-size: 17px; letter-spacing: 0.01em;
  }
  .side-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px; border-radius: 12px;
    font-size: 14px; font-weight: 550; color: var(--dim);
    transition: background .18s var(--ease), color .18s var(--ease);
    text-align: left; width: 100%;
  }
  .side-link svg { opacity: .62; flex: 0 0 auto; }
  .side-link:hover { background: var(--surface-2); color: var(--text); }
  .side-link.active { background: var(--wood-soft); color: var(--wood-deep); }
  .side-link.active svg { opacity: 1; color: var(--wood); }
  .side-ai {
    margin-top: 10px; display: flex; align-items: center; gap: 11px;
    padding: 12px 13px; border-radius: 14px; width: 100%;
    background: var(--navy-soft); border: 1px solid rgba(53,82,109,0.18); color: var(--navy-deep);
    font-family: "Outfit", sans-serif; font-weight: 650; font-size: 14px;
    transition: background .2s var(--ease);
  }
  .side-ai:hover { background: rgba(53, 82, 109, 0.14); }
  .side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hairline); }
  .side-user { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px; width: 100%; }
  .side-user:hover { background: var(--surface-2); }
  .side-user .nm { font-size: 13.5px; font-weight: 600; }
  .side-user .sb { font-size: 11px; color: var(--faint); margin-top: 1px; }

  .topbar { padding: 22px 40px 14px; background: var(--bg); }
  .screen { padding: 4px 40px 60px; }
  .screen-inner { max-width: 1040px; }
  .h1 { font-size: 38px; }
  .hero-band { height: 220px; }
  .search-card { max-width: 760px; }
}

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 6; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 20px 12px;
  gap: 12px;
  background: var(--bg);
}
.topbar-title { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.topbar-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--hairline);
  position: relative; flex: 0 0 auto; transition: background .2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn .badge-dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--wood); border: 1.5px solid var(--surface);
}
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--navy), var(--navy-deep));
  color: #fff;
  font-family: "Outfit", sans-serif; font-weight: 700; font-size: 12.5px;
}
.back-btn { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dim); }

/* ---------- scroll area ---------- */
.screen {
  position: relative; z-index: 5; flex: 1 1 auto;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px 130px;
  background: var(--bg);
}
.screen::-webkit-scrollbar { width: 0; }

/* ---------- typography ---------- */
.h1 { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 30px; line-height: 1.12; letter-spacing: -0.026em; margin: 0; }
.h2 { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -0.018em; margin: 0; }
.h3 { font-family: "Outfit", sans-serif; font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; margin: 0; }
.lede { font-size: 14.5px; line-height: 1.55; color: var(--dim); margin: 8px 0 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: "Outfit", sans-serif; font-size: 10.5px; font-weight: 650;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.eyebrow .pip { width: 5px; height: 5px; border-radius: 50%; background: var(--wood); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- hero band ----------
   A bounded, rounded photo/video banner — a travel-brand moment, not a
   full-screen backdrop. The search card overlaps its bottom edge, the way
   Booking.com/Expedia float a white search form over a header band. */
.hero-band {
  position: relative; margin-top: 6px; height: 176px;
  border-radius: var(--r-lg); overflow: hidden;
}
.hero-band video {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  filter: brightness(0.6) saturate(0.78) contrast(1.03);
}
.hero-band-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30,24,18,0.05) 0%, rgba(30,24,18,0.5) 100%);
}
.hero-band-text {
  position: absolute; left: 20px; right: 20px; bottom: 16px; color: #fff;
}
.hero-band-text .eyebrow { color: rgba(255,255,255,0.82); }
.hero-band-text .eyebrow .pip { background: var(--wood-tint); }
.hero-band-text h1 { color: #fff; font-size: 25px; margin-top: 6px; text-shadow: 0 2px 14px rgba(0,0,0,0.28); }

/* ---------- search card ----------
   The actual home-screen hero: a real search form, overlapping the band. */
.search-card {
  position: relative; margin: -34px auto 0; z-index: 4;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--hairline);
  padding: 8px;
}
.search-tabs { display: flex; gap: 2px; padding: 4px 4px 0; }
.search-tabs button {
  flex: 1 1 auto; padding: 9px 4px; border-radius: 10px 10px 0 0;
  font-family: "Outfit", sans-serif; font-weight: 650; font-size: 12.5px; color: var(--faint);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.search-tabs button.active { color: var(--wood-deep); background: var(--wood-soft); }
.search-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline); border-radius: 12px; overflow: hidden; margin-top: 4px; }
.search-field { background: var(--surface); padding: 11px 14px; }
.search-field.full { grid-column: 1 / -1; }
.search-field label { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.search-field input, .search-field select {
  width: 100%; border: none; outline: none; background: none;
  font-family: "Outfit", sans-serif; font-weight: 600; font-size: 14.5px; color: var(--text);
  padding: 0; appearance: none;
}
.search-field input::placeholder { color: var(--faint); font-weight: 500; }
.search-field select option { background: var(--surface); color: var(--text); }
.search-submit {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 8px; padding: 15px; border-radius: 12px;
  background: var(--wood); color: #fff;
  font-family: "Outfit", sans-serif; font-weight: 700; font-size: 15px;
  transition: background .2s var(--ease), transform .16s var(--ease);
}
.search-submit:active { transform: scale(0.985); background: var(--wood-deep); }

.ai-hint { text-align: center; font-size: 12.5px; color: var(--faint); margin-top: 14px; }
.ai-hint button { color: var(--wood-deep); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }

/* quick actions */
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 22px; }
.quick {
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline);
  padding: 13px 6px 11px; display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 11px; color: var(--dim); transition: background .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.quick:active { background: var(--surface-2); }
.quick svg { opacity: 0.7; color: var(--navy); }

/* suggestion chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline);
  padding: 9px 14px; font-size: 12.5px; color: var(--dim);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chip:active { border-color: var(--wood-line); color: var(--wood-deep); }

/* ---------- generic surfaces ---------- */
.card {
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline);
  padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.card-glass { background: var(--surface); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; align-items: center; gap: 10px; }
.section-gap { margin-top: 28px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 10.5px; font-weight: 700;
  font-family: "Outfit", sans-serif; letter-spacing: 0.04em;
}
.pill-accent { background: var(--wood-soft); color: var(--wood-deep); border: 1px solid var(--wood-line); }
.pill-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(63,122,79,0.24); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(150,107,46,0.22); }
.pill-quiet { background: var(--surface-2); color: var(--dim); border: 1px solid var(--hairline); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 15px 22px;
  font-family: "Outfit", sans-serif; font-weight: 650; font-size: 14.5px;
  transition: transform .16s var(--ease), box-shadow .3s var(--ease), background .2s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--wood); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:active { background: var(--wood-deep); }
.btn-quiet { background: var(--surface); border: 1px solid var(--hairline-2); color: var(--text); }
.btn-quiet:active { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }

/* ---------- the assistant mark ----------
   Flat, quiet, identity-only. Motion is reserved for genuinely active
   states (listening / thinking) — never decorative. */
.orb {
  position: relative; border-radius: 50%; flex: 0 0 auto;
  background: var(--wood); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.orb-sm { width: 24px; height: 24px; }
.orb-md { width: 32px; height: 32px; }
.orb-lg { width: 60px; height: 60px; }
.orb.thinking { animation: pulse 1.4s ease-in-out infinite; }
.orb.listening { animation: pulse 1.8s ease-in-out infinite; }
.orb.listening::after,
.orb.listening::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid var(--wood-line); animation: ripple 2s ease-out infinite;
}
.orb.listening::before { animation-delay: 1s; }
@keyframes pulse {
  0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); }
}
@keyframes ripple {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1.7); opacity: 0; }
}

/* floating assistant button — small, corner-anchored, not the hero */
.ai-fab {
  position: absolute; z-index: 25;
  right: 18px; bottom: calc(84px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 9px;
  background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 13px 16px 13px 13px;
  box-shadow: var(--shadow-lg);
  transition: transform .18s var(--ease);
}
.ai-fab:active { transform: scale(0.96); }
.ai-fab .orb { background: var(--wood); }
.ai-fab span.lbl { font-family: "Outfit", sans-serif; font-weight: 650; font-size: 13px; }
@media (min-width: 1024px) {
  .ai-fab { bottom: 26px; right: 26px; }
}
body[data-screen="home"] .ai-fab { bottom: calc(94px + env(safe-area-inset-bottom)); }

/* ---------- tab bar (PROJECT.md §7) ---------- */
.tabbar {
  position: relative; z-index: 8; flex: 0 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 9.5px; letter-spacing: 0.03em; color: var(--faint);
  padding: 6px 0; transition: color .2s var(--ease);
}
.tab.active { color: var(--wood-deep); }
.tab.active svg { opacity: 1; color: var(--wood); }
.tab svg { opacity: 0.55; }

/* ---------- AI sheet: a friendly help panel, not a dark chat console ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(30, 24, 18, 0.32);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  max-height: 86%; display: flex; flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  border-radius: 26px 26px 0 0;
  transform: translateY(101%);
  transition: transform .4s var(--ease);
  box-shadow: 0 -20px 50px rgba(30,24,18,0.16);
}
.sheet.open { transform: translateY(0); }

@media (min-width: 1024px) {
  .sheet {
    top: 0; left: auto; right: 0; bottom: 0;
    width: 400px; max-height: none;
    border-radius: 0; border-top: none; border-left: 1px solid var(--hairline);
    transform: translateX(101%);
    transition: transform .4s var(--ease);
    box-shadow: -20px 0 50px rgba(30,24,18,0.10);
  }
  .sheet.open { transform: translateX(0); }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 20px; }
  .scrim { display: none; }
}
.sheet-grab { width: 36px; height: 4px; border-radius: 999px; background: var(--hairline-2); margin: 10px auto 4px; flex: 0 0 auto; }
.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px 12px; flex: 0 0 auto;
  border-bottom: 1px solid var(--hairline);
}
.sheet-head .who { flex: 1 1 auto; min-width: 0; }
.sheet-head .who b { font-family: "Outfit", sans-serif; font-weight: 650; font-size: 14.5px; display: block; }
.sheet-head .who span { font-size: 11px; color: var(--faint); }
.thread { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px 6px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-2); }
.thread::-webkit-scrollbar { width: 0; }

.msg { max-width: 84%; font-size: 14.5px; line-height: 1.5; }
.msg-ai {
  align-self: flex-start; color: var(--text);
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 12px 15px; border-radius: 16px 16px 16px 4px;
}
.msg-me {
  align-self: flex-end; background: var(--wood); color: #fff;
  padding: 12px 15px; border-radius: 16px 16px 4px 16px; font-weight: 500;
}
.msg-note {
  align-self: center; font-size: 11.5px; color: var(--faint);
  background: var(--surface); border: 1px solid var(--hairline);
  padding: 7px 13px; border-radius: 999px; text-align: center; max-width: 92%;
}
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: blink 1.3s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

.sheet-input {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline); background: var(--surface);
}
.sheet-input input {
  flex: 1 1 auto; min-width: 0; background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: 999px; padding: 13px 16px; outline: none; font-size: 14.5px;
}
.sheet-input input:focus { border-color: var(--wood-line); }
.mic-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--wood-soft); border: 1px solid var(--wood-line); color: var(--wood-deep);
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.mic-btn:active { transform: scale(0.94); }
.mic-btn.live { background: var(--wood); color: #fff; border-color: var(--wood); animation: pulse 2s ease-in-out infinite; }
.mic-btn.off { background: var(--surface-2); border-color: var(--hairline); color: var(--faint); }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--wood); color: #fff;
}

/* ---------- dynamic search card inside chat (PROJECT.md §2, §5) ---------- */
.dyn-card {
  align-self: stretch; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--hairline-2);
  overflow: hidden; animation: cardIn .38s var(--ease) both; box-shadow: var(--shadow-sm);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dyn-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 15px; border-bottom: 1px solid var(--hairline);
  font-family: "Outfit", sans-serif; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim);
}
.dyn-head svg { color: var(--wood); }
.dyn-grid { display: grid; grid-template-columns: 1fr 1fr; }
.dyn-field { padding: 12px 15px; border-bottom: 1px solid var(--hairline); border-right: 1px solid var(--hairline); }
.dyn-field:nth-child(2n) { border-right: none; }
.dyn-field.full { grid-column: 1 / -1; border-right: none; }
.dyn-field label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.dyn-field input, .dyn-field select {
  width: 100%; background: none; border: none; outline: none;
  font-family: "Outfit", sans-serif; font-weight: 650; font-size: 15px; letter-spacing: -0.01em;
  padding: 0; appearance: none; color: var(--text);
}
.dyn-field select option { background: var(--surface); color: var(--text); }
.dyn-field.needed { background: var(--wood-soft); }
.dyn-field.needed label { color: var(--wood-deep); }
.dyn-field input::placeholder { color: var(--faint); font-weight: 500; }
.dyn-foot { padding: 12px 14px; }

/* ---------- result cards ---------- */
.result {
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline);
  padding: 15px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  animation: cardIn .35s var(--ease) both;
}
.result.sel { border-color: var(--wood-line); background: var(--wood-soft); }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result .price { font-family: "Outfit", sans-serif; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.result .price small { display: block; font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.leg { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.leg .time { font-family: "Outfit", sans-serif; font-weight: 650; font-size: 16px; }
.leg .track { flex: 1 1 auto; height: 1px; background: var(--hairline-2); position: relative; }
.leg .track::after {
  content: ""; position: absolute; left: 50%; top: -2px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--faint); transform: translateX(-50%);
}
.leg .meta { font-size: 10.5px; color: var(--faint); text-align: center; }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }

.disclaimer {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 11.5px; line-height: 1.5; color: var(--dim);
  background: var(--surface-2); border: 1px solid var(--hairline);
  border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 14px;
}
.disclaimer svg { flex: 0 0 auto; margin-top: 1px; color: var(--wood); }

/* ---------- trip canvas (PROJECT.md §14) ---------- */
.canvas-head { padding: 4px 0 20px; }
.canvas-head .h1 { font-size: 32px; letter-spacing: -0.02em; }
.canvas-rows { border-top: 1px solid var(--hairline); }
.crow {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 2px; border-bottom: 1px solid var(--hairline);
  animation: rowIn .45s var(--ease) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.crow-ico {
  width: 34px; height: 34px; border-radius: 11px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-soft); color: var(--navy);
}
.crow.is-filled .crow-ico { background: var(--wood-soft); color: var(--wood-deep); }
.crow-body { flex: 1 1 auto; min-width: 0; }
.crow-body .k { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.crow-body .v { font-family: "Outfit", sans-serif; font-weight: 650; font-size: 15px; margin-top: 3px; }
.crow.is-empty .crow-body .v { color: var(--faint); font-weight: 500; }

/* ---------- trips / wallet ---------- */
.trip-card {
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-sm);
}
.trip-banner { padding: 18px; }
.trip-banner .h2 { font-size: 24px; }
.seg { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--hairline); }
.seg-ico { width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--navy-soft); color: var(--navy); }
.seg-body { flex: 1 1 auto; min-width: 0; }
.seg-body .a { font-size: 13.5px; font-weight: 600; }
.seg-body .b { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.trip-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--hairline); background: var(--surface-2); }

/* ---------- listing cards (Explore + Home "Popular destinations") ---------- */
.exp-card {
  border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px;
  border: 1px solid var(--hairline); background: var(--surface); box-shadow: var(--shadow-sm);
}
.exp-top { height: 128px; display: flex; align-items: center; justify-content: center; font-size: 42px; position: relative; }
.exp-top .pill { position: absolute; top: 11px; right: 11px; background: rgba(255,255,255,0.92); color: var(--text); border: none; }
.exp-body { padding: 14px 15px; }

/* ---------- handoff / structured summary ---------- */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; font-weight: 550; }

pre.json {
  margin: 0; padding: 14px; border-radius: var(--r-sm);
  background: var(--navy-deep);
  border: 1px solid rgba(53,82,109,0.4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.65; color: #dce4ea;
  overflow-x: auto; white-space: pre;
}
pre.json::-webkit-scrollbar { height: 0; }

/* ---------- timeline ---------- */
.tl { position: relative; padding-left: 24px; }
.tl::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--hairline-2); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -23px; top: 4px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--hairline-2);
}
.tl-item.done::before { border-color: var(--ok); background: var(--ok); }
.tl-item.now::before { border-color: var(--wood); background: var(--wood); box-shadow: 0 0 0 4px var(--wood-soft); }
.tl-item .t { font-size: 13.5px; font-weight: 600; }
.tl-item .s { font-size: 11.5px; color: var(--faint); margin-top: 3px; line-height: 1.5; }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .orb { margin: 0 auto 18px; }
.toast {
  position: absolute; left: 50%; bottom: 96px; z-index: 60;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px;
  font-family: "Outfit", sans-serif; font-weight: 650; font-size: 13px;
  box-shadow: var(--shadow-lg);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
  max-width: 84%; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.splash {
  position: absolute; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
.splash.gone { opacity: 0; visibility: hidden; }
.splash .wordmark {
  font-family: "Outfit", sans-serif; font-weight: 700; font-size: 15px;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--text);
  animation: fadeUp 1s var(--ease) both .2s;
}
.splash .tag { font-size: 12px; color: var(--faint); animation: fadeUp 1s var(--ease) both .38s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsive content grids ---------- */
.grid-auto { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-row { max-width: 560px; }
}
@media (min-width: 1024px) {
  .grid-auto { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .grid-auto.grid-2up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-card, .result, .exp-card { margin-bottom: 0; }
  .kv { grid-template-columns: 130px 1fr; }
}

/* ---------- segmented control ---------- */
.seg-ctrl {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 999px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.seg-ctrl::-webkit-scrollbar { height: 0; }
.seg-ctrl button {
  flex: 1 1 auto; white-space: nowrap; padding: 9px 14px; border-radius: 999px;
  font-family: "Outfit", sans-serif; font-weight: 600; font-size: 13px; color: var(--dim);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg-ctrl button.active { background: var(--surface); color: var(--wood-deep); box-shadow: var(--shadow-sm); }

/* ---------- document / vault cards ---------- */
.doc-card {
  display: flex; align-items: center; gap: 13px;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline);
  padding: 14px 15px; box-shadow: var(--shadow-sm);
}
.doc-ico {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--wood-soft); color: var(--wood-deep);
}
.doc-body { flex: 1 1 auto; min-width: 0; }
.doc-body .a { font-size: 14px; font-weight: 600; }
.doc-body .b { font-size: 11.5px; color: var(--faint); margin-top: 3px; }

/* ---------- billing ---------- */
.bill-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; font-size: 13.5px; }
.bill-row + .bill-row { border-top: 1px solid var(--hairline); }
.bill-total { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--hairline-2); }
.bill-total .h3 { font-size: 17px; }

/* ---------- admin table ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--hairline); }
.tbl-wrap::-webkit-scrollbar { height: 6px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 99px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 540px; background: var(--surface); }
table.admin th {
  text-align: left; padding: 11px 14px; font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
  border-bottom: 1px solid var(--hairline); background: var(--surface-2);
}
table.admin td { padding: 13px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.admin tr:last-child td { border-bottom: none; }
select.mini {
  padding: 7px 10px; border-radius: 9px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--hairline-2); color: var(--text);
}
select.mini option { background: var(--surface); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
