/* =============================================================================
   Caravan - desert-dusk design system.
   A caravan at twilight: deep violet dusk sky, sunset coral and amber,
   warm sand paper, a gold hairline. Serif display, glowing gradients.
   ========================================================================== */

:root {
  /* Ink & paper */
  --ink: #241d33;
  --ink-2: #5d5570;
  --ink-3: #948da3;
  --paper: #f7f0e4;        /* warm sand */
  --paper-2: #efe5d3;
  --card: #fffdf8;         /* warm white */
  --line: #e8ddc9;         /* warm hairline */
  --line-2: #f0e8d8;

  /* Accents - dusk sky + sunset */
  --ai: #372a63;           /* deep dusk violet (primary) */
  --ai-2: #5c4a99;         /* lighter violet */
  --ai-ink: #241b45;       /* near-night */
  --vermilion: #e2593a;    /* sunset coral */
  --vermilion-2: #c74628;
  --amber: #f09c4a;        /* low sun */
  --sakura: #f3d3c4;       /* peach haze */
  --sakura-deep: #df9d84;
  --matcha: #4e7d5b;       /* oasis green */
  --gold: #b28a34;         /* hairline luxe */
  --gold-soft: #e3c07e;

  /* Signature gradients */
  --g-dusk: linear-gradient(150deg, #4a3a78 0%, #372a63 45%, #241b45 100%);
  --g-sunset: linear-gradient(135deg, #f09c4a 0%, #e2593a 60%, #c74628 100%);
  --g-accent: linear-gradient(90deg, var(--vermilion), var(--amber), var(--gold-soft));

  /* Type */
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Songti SC", "Noto Serif JP", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", Arial, sans-serif;

  /* Form */
  --r-xl: 22px; --r-lg: 18px; --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(36,27,69,.05), 0 10px 26px -14px rgba(36,27,69,.18);
  --shadow-lg: 0 2px 6px rgba(36,27,69,.06), 0 26px 50px -22px rgba(36,27,69,.32);
  --nav-h: 66px;
  --maxw: 760px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* warm dusk wash over sand grain: apricot glow top-left, violet haze top-right */
  background-image:
    radial-gradient(90% 42% at 8% -6%, rgba(240,156,74,.16), rgba(240,156,74,0) 62%),
    radial-gradient(80% 38% at 100% -4%, rgba(92,74,153,.13), rgba(92,74,153,0) 58%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, scroll;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
a { color: var(--ai-2); }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; color: inherit; }
::selection { background: var(--sakura); }

.app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; position: relative; }

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: calc(13px + env(safe-area-inset-top, 0px)) 18px 13px;
  /* opaque dusk band - avoids iOS sticky/backdrop-filter paint glitch */
  background:
    radial-gradient(120% 160% at 92% -40%, rgba(226,89,58,.55), rgba(226,89,58,0) 55%),
    var(--g-dusk);
  background-color: var(--ai-ink);
  color: #f6f1e8;
  border-bottom: 1px solid rgba(227,192,126,.35);
  box-shadow: 0 8px 24px -16px rgba(36,27,69,.55);
}
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.topbar .brand .mark { display: grid; place-items: center; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.topbar .brand .name { font-family: var(--serif); font-size: 18px; font-weight: 600; letter-spacing: .3px; }
.topbar .brand .sub { font-size: 10.5px; color: var(--gold-soft); font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.topbar .whoami {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(246,241,232,.28); border-radius: 999px;
  padding: 4px 12px 4px 4px; font-size: 12.5px; font-weight: 700; color: #f6f1e8;
  box-shadow: none;
}

/* ---- Screens ------------------------------------------------------------- */
.screen { display: none; padding: 20px 18px calc(var(--nav-h) + 30px + var(--safe-b)); }
.screen.active { display: block; animation: rise .4s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px);} to {opacity:1; transform:none;} }

/* Section headers - editorial: kicker rule + serif */
.section-title {
  font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: .2px;
  margin: 8px 2px 14px; position: relative; padding-left: 14px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  background: linear-gradient(180deg, var(--vermilion), var(--amber), var(--gold)); border-radius: 3px;
}
.section-sub { color: var(--ink-2); font-size: 13px; margin: -8px 2px 16px; line-height: 1.5; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 17px 18px; margin-bottom: 15px;
}
.card h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .2px; }

.pill { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; vertical-align: middle; }
.pill.any    { background: #ece5d8; color: var(--ink-2); }
.pill.draft  { background: var(--sakura); color: #a4462a; }
/* Per-stop colors - assigned by stop order (s0..s5), cycling */
.pill.s0 { background: #ebe6f6; color: #4a3a78; }
.pill.s1 { background: #fbe7dd; color: #b44526; }
.pill.s2 { background: #faeeda; color: #a06018; }
.pill.s3 { background: #e2efe5; color: #3c6b4a; }
.pill.s4 { background: #fbe5ec; color: #a83a5e; }
.pill.s5 { background: #e0edf2; color: #2f6478; }

/* ---- Avatars (photos or initials) --------------------------------------- */
.avatar {
  width: 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center; overflow: hidden;
  background-size: cover; background-position: center center; background-repeat: no-repeat;
  border: 2px solid var(--card); box-shadow: 0 1px 3px rgba(25,26,30,.18); flex: none;
  letter-spacing: .3px;
}
.avatar.lg { width: 58px; height: 58px; font-size: 18px; box-shadow: 0 2px 8px rgba(25,26,30,.20); }
.crew-strip { display: flex; }
.avatar.stack { border-width: 2.5px; }
.avatar.stack:not(:first-child) { margin-left: -14px; }

/* ---- HERO ---------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  color: #f6f1e8; padding: 28px 22px 56px; margin-bottom: 18px;
  background:
    radial-gradient(90% 70% at 82% 88%, rgba(240,156,74,.42), rgba(240,156,74,0) 60%),
    radial-gradient(120% 90% at 85% -25%, rgba(226,89,58,.55), rgba(226,89,58,0) 52%),
    linear-gradient(168deg, #241b45 0%, #372a63 46%, #6c3f63 78%, #a4503f 100%);
  box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero::before { /* stars, upper sky only */
  content: ""; position: absolute; inset: 0 0 40% 0; z-index: -1; opacity: .8;
  background-image:
    radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.6px),
    radial-gradient(rgba(255,255,255,.30) 1px, transparent 1.4px);
  background-size: 96px 74px, 53px 41px;
  background-position: 12px 8px, 30px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
  mask-image: linear-gradient(180deg, #000 40%, transparent);
}
.hero::after { /* dune silhouettes along the bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 760 46' preserveAspectRatio='none'%3E%3Cpath d='M0 46 L0 30 Q140 6 300 24 Q420 37 540 22 Q660 9 760 26 L760 46 Z' fill='%23241b45' opacity='0.55'/%3E%3Cpath d='M0 46 L0 38 Q190 20 380 32 Q570 44 760 34 L760 46 Z' fill='%231a1333' opacity='0.85'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}
.hero .sun { position: absolute; top: 16px; right: 22px; width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #ffd9a0, #f09c4a 58%, #e2593a);
  box-shadow: 0 0 44px 16px rgba(240,156,74,.45), 0 0 90px 40px rgba(226,89,58,.25); }
.hero .kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-soft); }
.hero h1 { font-family: var(--serif); font-size: 42px; line-height: .98; margin: 10px 0 8px; font-weight: 600; letter-spacing: .5px; }
.hero .dates { font-size: 13px; opacity: .9; font-weight: 600; letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 9px; }
.hero .dates::before { content: ""; width: 18px; height: 1px; background: var(--gold-soft); display: inline-block; }
.hero .cities-row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero .city-chip { background: rgba(255,255,255,.09); border: 1px solid rgba(246,241,232,.20);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }

/* Countdown */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 18px 0; }
.count-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  text-align: center; padding: 14px 6px; box-shadow: var(--shadow); }
.count-box .num { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--ai); line-height: 1; }
.count-box .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--ink-3); margin-top: 7px; font-weight: 800; }

.clocks { display: flex; gap: 11px; }
.clock { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px; text-align: center; box-shadow: var(--shadow); }
.clock .place { font-size: 10px; color: var(--ink-3); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.clock .time { font-family: var(--serif); font-size: 23px; font-weight: 600; margin-top: 3px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-tile { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px; box-shadow: var(--shadow); text-align: left; transition: transform .15s ease; }
.quick-tile:active { transform: scale(.98); }
.quick-tile .qi { font-size: 19px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.quick-tile .qt { font-family: var(--serif); font-weight: 600; font-size: 15px; margin-top: 9px; }
.quick-tile .qs { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
/* icon chips cycle through the dusk palette */
.quick-tile:nth-child(6n+1) .qi { background: linear-gradient(135deg,#ebe6f6,#ddd4f0); }
.quick-tile:nth-child(6n+2) .qi { background: linear-gradient(135deg,#fbe7dd,#f8d7c4); }
.quick-tile:nth-child(6n+3) .qi { background: linear-gradient(135deg,#faeeda,#f5e1bd); }
.quick-tile:nth-child(6n+4) .qi { background: linear-gradient(135deg,#e2efe5,#cfe4d4); }
.quick-tile:nth-child(6n+5) .qi { background: linear-gradient(135deg,#fbe5ec,#f6d2de); }
.quick-tile:nth-child(6n+6) .qi { background: linear-gradient(135deg,#e0edf2,#cbe1ea); }
/* a whisper of sunset along each tile's top edge */
.quick-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--g-accent); opacity: .8; }

/* ---- ITINERARY ----------------------------------------------------------- */
.filters { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 8px 15px; font-size: 13px; font-weight: 700; transition: all .15s; }
.chip.active { background: var(--ai); color: #fff; border-color: var(--ai); }

.day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; transition: box-shadow .2s; }
.day.open { box-shadow: var(--shadow-lg); }
.day-head { display: flex; align-items: center; gap: 13px; padding: 14px 15px; }
.day-date { text-align: center; min-width: 52px; padding: 8px 4px 7px; border-radius: 13px;
  background: var(--g-dusk); box-shadow: 0 6px 14px -8px rgba(36,27,69,.65); }
.day-date .d { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1; color: #fff; }
.day-date .m { font-size: 8.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-soft); font-weight: 800; margin-top: 3px; }
.day-head .info { flex: 1; min-width: 0; }
.day-head .info .t { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: .2px; }
.day-head .info .s { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }
.day-head .caret { color: var(--ink-3); transition: transform .25s; font-size: 12px; }
.day.open .day-head .caret { transform: rotate(90deg); }
.day-body { display: none; padding: 2px 18px 10px; }
.day.open .day-body { display: block; animation: rise .3s ease; }
.meetup { display: flex; gap: 8px; align-items: center; background: linear-gradient(180deg,#fbf3ec,#f8ede2); border: 1px solid #eed9c6;
  color: #935224; border-radius: var(--r); padding: 10px 13px; font-size: 12.5px; font-weight: 700; margin: 6px 0 14px; }

.timeline { position: relative; margin-left: 5px; padding-left: 20px; border-left: 1.5px solid var(--line); }
.tl-item { position: relative; padding: 0 0 18px 2px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-item::before { content: ""; position: absolute; left: -27px; top: 3px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--ai-2); box-shadow: 0 0 0 3px var(--card); }
.tl-item.food::before { border-color: var(--vermilion); }
.tl-item.activity::before { border-color: var(--matcha); }
.tl-item.travel::before { border-color: var(--gold); }
.tl-item.rest::before { border-color: var(--sakura-deep); }
.tl-item.meet::before { border-color: var(--vermilion); background: var(--vermilion); }
.tl-time { font-size: 10.5px; font-weight: 800; color: var(--ink-3); letter-spacing: .6px; }
.tl-title { font-weight: 700; font-size: 14px; margin-top: 2px; }
.tl-title .type-emoji { margin-right: 5px; }
.tl-note { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }
.tl-map { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--ai-2);
  margin-top: 6px; text-decoration: none; letter-spacing: .3px; }

/* ---- MAP ----------------------------------------------------------------- */
#map { height: 60vh; min-height: 340px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative; z-index: 0; isolation: isolate; /* contain Leaflet's z-indexes so overlays (More sheet, modals) stay on top */ }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.leaflet-popup-content { font-family: var(--sans); }
.pin-pop b { font-size: 13px; } .pin-pop .pp-note { color: var(--ink-2); font-size: 12px; }

/* ---- Neighborhood guide cards (horizontal scroll per city) --------------- */
.hood-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 14px; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory; }
.hood-scroll::-webkit-scrollbar { display: none; }
.hood-card { flex: 0 0 78%; max-width: 300px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 14px 15px; }
.hood-name { font-family: var(--serif); font-weight: 600; font-size: 16px; letter-spacing: .2px; }
.hood-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.hood-tags span { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.hood-blurb { font-size: 12.5px; color: var(--ink-2); margin-top: 9px; line-height: 1.5; }
.hood-base { font-size: 12px; color: var(--ink); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); line-height: 1.45; }

/* ---- STAYS (hotel options / vote) --------------------------------------- */
.stay-opt { display: flex; gap: 12px; width: 100%; text-align: left; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 10px; transition: all .15s; }
.stay-opt:active { transform: scale(.99); }
.stay-opt.sel { border-color: var(--ai); box-shadow: 0 0 0 2px rgba(30,49,80,.16), var(--shadow); }
.stay-opt-main { flex: 1; min-width: 0; }
.stay-opt-name { font-family: var(--serif); font-weight: 600; font-size: 16.5px; letter-spacing: .2px; }
.stay-opt .rec { font-family: var(--sans); font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--matcha); border: 1px solid var(--matcha); border-radius: 999px; padding: 2px 7px; margin-left: 8px; vertical-align: middle; }
.stay-opt-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.stay-opt-note { font-size: 12.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }
.stay-opt-main .tl-map { margin-top: 8px; }
.stay-check { font-size: 20px; color: var(--ink-3); flex: none; margin-top: 2px; }
.stay-opt.sel .stay-check { color: var(--ai); }

/* ---- CREW ---------------------------------------------------------------- */
.pair-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 15px 17px; margin-bottom: 15px; }
.pair-card .pair-name { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.6px; color: var(--gold); margin-bottom: 12px; }
.person { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.person:first-of-type { border-top: none; }
.person .p-info { min-width: 0; }
.person .p-info .p-name { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .2px; }
.person .p-info .p-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.person .p-meta { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--ink-2); }
.badge-you { font-size: 9px; font-weight: 800; color: #fff; background: var(--vermilion); border-radius: 999px; padding: 2px 7px; margin-left: 7px; vertical-align: middle; letter-spacing: .5px; }

/* ---- Rows ---------------------------------------------------------------- */
.row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line-2); }
.row:first-child { border-top: none; }
.row .r-main { flex: 1; min-width: 0; }
.row .r-title { font-weight: 700; font-size: 14px; }
.row .r-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; line-height: 1.45; }

/* Budget */
.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.balance { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; box-shadow: var(--shadow); }
.balance .bn { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.balance .bv { font-family: var(--serif); font-size: 17px; font-weight: 600; margin-top: 4px; color: var(--ink-3); }
.balance .bv.owed { color: var(--matcha); } .balance .bv.owes { color: var(--vermilion); }
.expense-add { display: grid; gap: 9px; }
.expense-add input:not([type="checkbox"]), .expense-add select, .field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 14px; font-family: inherit; background: #fffdfa; color: var(--ink); }

/* Split-among toggle chips (Budget) */
#exSplit { display: flex; flex-wrap: wrap; gap: 8px; }
.split-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line);
  background: #fffdfa; border-radius: 999px; padding: 5px 13px 5px 5px; font-size: 13px; font-weight: 700;
  color: var(--ink-2); cursor: pointer; user-select: none; }
.split-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.split-chip .avatar { width: 24px; height: 24px; font-size: 9px; border-width: 1.5px; }
.split-chip:has(input:checked) { background: var(--ai); color: #fff; border-color: var(--ai); }
.expense-add input:focus, .expense-add select:focus { outline: none; border-color: var(--ai-2); box-shadow: 0 0 0 3px rgba(52,82,125,.12); }
.btn { border: none; border-radius: var(--r-sm); padding: 13px 16px; font-weight: 800; font-size: 14px; letter-spacing: .2px; transition: transform .12s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--g-sunset); color: #fff; box-shadow: 0 8px 18px -8px rgba(226,89,58,.65); }
.btn.primary:active { filter: brightness(.94); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: transparent; color: var(--vermilion); border: 1px solid var(--sakura-deep); font-size: 12px; padding: 7px 11px; font-weight: 700; }
.btn-row { display: flex; gap: 8px; }

/* Packing / checklist */
.check-cat { font-family: var(--serif); font-size: 13px; font-weight: 600; letter-spacing: .4px; color: var(--gold); text-transform: uppercase; margin: 20px 2px 9px; }
.check { display: flex; align-items: center; gap: 13px; padding: 12px 15px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 8px; box-shadow: var(--shadow); }
.check input { width: 21px; height: 21px; accent-color: var(--ai); flex: none; }
.check label { font-size: 14px; flex: 1; }
.check.done { opacity: .62; } .check.done label { text-decoration: line-through; color: var(--ink-2); }
.progress { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 2px 10px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ai), var(--vermilion)); border-radius: 999px; transition: width .35s ease; }

/* Guide + phrases */
.guide-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 15px 17px; margin-bottom: 12px; }
.guide-card .g-head { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-weight: 600; font-size: 16px; }
.guide-card .g-head span { font-size: 20px; }
.guide-card .g-body { font-size: 13.5px; color: var(--ink-2); margin-top: 9px; line-height: 1.55; }
.phrase { display: flex; align-items: baseline; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.phrase:first-of-type { border-top: none; }
.phrase .p-en { font-weight: 700; font-size: 13.5px; flex: 1; }
.phrase .p-jp { font-size: 16px; font-family: var(--serif); }
.phrase .p-ro { font-size: 11.5px; color: var(--ink-3); min-width: 118px; text-align: right; font-style: italic; }

/* Ideas / voting */
.idea { display: flex; align-items: center; gap: 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 15px; margin-bottom: 10px; }
.idea .i-main { flex: 1; min-width: 0; }
.idea .i-title { font-weight: 700; font-size: 14px; }
.idea .i-note { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.vote button { border: 1px solid var(--line); background: #fffdfa; border-radius: 12px; width: 46px; height: 38px; font-size: 17px; transition: all .15s; }
.vote button.voted { background: var(--vermilion); border-color: var(--vermilion); transform: scale(1.03); }
.vote .vcount { font-size: 10px; font-weight: 800; color: var(--matcha); letter-spacing: .3px; }

/* ---- Vote tallies (avatar chips under options) -------------------------- */
.tally { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.avatar.vchip { width: 22px; height: 22px; font-size: 8px; border-width: 1.5px; }
.tally .avatar.vchip:not(:first-child) { margin-left: -6px; }
.tally-n { font-size: 11px; font-weight: 800; color: var(--matcha); margin-left: 6px; letter-spacing: .3px; }

/* ---- Itinerary RSVP ------------------------------------------------------ */
.rsvp { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rsvp-btn { border: 1px solid var(--line); background: #fffdfa; color: var(--ai); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 800; letter-spacing: .2px; }
.rsvp-btn.on { background: var(--matcha); border-color: var(--matcha); color: #fff; }

/* ---- Booking timeline ---------------------------------------------------- */
.book-check { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line);
  background: #fffdfa; color: #fff; font-size: 15px; font-weight: 800; display: grid; place-items: center;
  margin-top: 1px; transition: all .15s; }
.book-check.on { background: var(--matcha); border-color: var(--matcha); }
.when-chip { font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--gold);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }

/* ---- Photos grid --------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 4px; }
.photo-cell { position: relative; border-radius: var(--r); overflow: hidden; background: var(--paper-2);
  box-shadow: var(--shadow); border: 1px solid var(--line); }
.photo-cell img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 7px; font-size: 11.5px; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.65)); font-weight: 600; }
.photo-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.5); color: #fff; font-size: 13px; display: grid; place-items: center; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- Bottom nav ---------------------------------------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw); z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  background: #fffdf8; /* opaque - avoids iOS backdrop-filter detach glitch on scroll */
  box-shadow: 0 -1px 0 var(--line), 0 -6px 20px -12px rgba(25,26,30,.2);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tab { position: relative; flex: 1; border: none; background: none; padding: 10px 4px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; color: var(--ink-3); font-size: 9.5px; font-weight: 800; letter-spacing: .3px; transition: color .18s; }
.tab .ti { display: grid; place-items: center; height: 24px; }
.tab .ti svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
.tab.active { color: var(--ai); }
.tab.active .ti svg { transform: translateY(-1px) scale(1.05); }
.tab.active::after { content: ""; position: absolute; top: 0; width: 22px; height: 3px; background: var(--g-accent); border-radius: 0 0 4px 4px; }

/* More sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20,20,25,.42); z-index: 60; display: none; }
.sheet-backdrop.open { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: var(--maxw); background: var(--paper);
  border-radius: 24px 24px 0 0; z-index: 61; padding: 10px 18px calc(22px + var(--safe-b));
  transition: transform .3s cubic-bezier(.2,.85,.2,1); box-shadow: var(--shadow-lg); border-top: 1px solid var(--line);
  max-height: 82vh; overflow-y: auto; }
.sheet.open { transform: translateX(-50%) translateY(0); }
.sheet .grab { width: 38px; height: 5px; background: var(--line); border-radius: 999px; margin: 7px auto 16px; }
.sheet h4 { font-family: var(--serif); margin: 0 0 13px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 15px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow); transition: transform .12s; }
.sheet-item:active { transform: scale(.98); }
.sheet-item .si { font-size: 21px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,20,25,.48); z-index: 70; display: none; place-items: center; padding: 22px; }
.modal-backdrop.open { display: grid; animation: fade .2s; }
.modal { background: var(--paper); border-radius: var(--r-xl); width: 100%; max-width: 420px; padding: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal h3 { margin: 0 0 14px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.who-opt { display: flex; align-items: center; gap: 13px; padding: 11px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); margin-bottom: 9px; font-weight: 700; transition: all .15s; }
.who-opt.sel { border-color: var(--ai); box-shadow: 0 0 0 2px rgba(30,49,80,.16); }

.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 26px; }
.foot-note { text-align: center; font-size: 11px; color: var(--ink-3); margin: 26px 0 4px; letter-spacing: .3px; }

@media (min-width: 600px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .sheet-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================================
   Caravan additions - landing, wizard, trip chips
   ========================================================================== */
.wiz-step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.wiz-step-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.wiz-step-dots i.on { background: var(--ai); }
.wiz-label { font-size: 12px; font-weight: 800; color: var(--ink-2); margin: 12px 2px 6px; display: block; }
.trav-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.trav-row input { flex: 1; }
.trav-row .rm { border: 1px solid var(--sakura-deep); color: var(--vermilion); background: none; border-radius: 8px; width: 34px; height: 34px; flex: none; }
.code-big { font-family: var(--serif); font-size: 40px; font-weight: 600; letter-spacing: 8px; text-align: center; color: var(--ai); margin: 10px 0; }
.trip-chip { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; width: 100%; text-align: left; }
.trip-chip .tc-name { font-family: var(--serif); font-weight: 600; font-size: 16px; }
.trip-chip .tc-sub { font-size: 12px; color: var(--ink-2); }


/* ---- Landing mural: one continuous skyline of trip types ------------------- */
/* city → sailboat → beach → wedding arch → golf green → ski peaks             */
.hero-mural { padding-bottom: 112px; }
@media (min-width: 560px) { .hero-mural { padding-bottom: 178px; } }
.hero-mural::after { display: none; } /* mural replaces the dunes */
.hero-mural .mural { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; display: block; pointer-events: none; }

/* ---- Wedding theme: champagne & blush over deep plum ----------------------- */
/* Applied to <body> the moment a wedding is opened (or picked in the wizard). */
.theme-wedding {
  --ai: #5a2743; --ai-2: #8a4a68; --ai-ink: #33142a;
  --vermilion: #c05c74; --vermilion-2: #a4435c; --amber: #d9a75c;
  --gold: #a8863a; --gold-soft: #e6c98a;
  --sakura: #f3d3dd; --sakura-deep: #d898ab;
  --g-dusk: linear-gradient(150deg, #6b2f4e 0%, #4a1e38 45%, #33142a 100%);
  --g-sunset: linear-gradient(135deg, #d9a75c 0%, #c05c74 60%, #a4435c 100%);
  --g-accent: linear-gradient(90deg, #c05c74, #d9a75c, #e6c98a);
}
.theme-wedding .topbar {
  background:
    radial-gradient(120% 160% at 92% -40%, rgba(192,92,116,.6), rgba(192,92,116,0) 55%),
    var(--g-dusk);
  background-color: var(--ai-ink);
}
.theme-wedding .hero {
  background:
    radial-gradient(90% 70% at 82% 88%, rgba(217,167,92,.4), rgba(217,167,92,0) 60%),
    radial-gradient(120% 90% at 85% -25%, rgba(192,92,116,.55), rgba(192,92,116,0) 52%),
    linear-gradient(168deg, #33142a 0%, #4a1e38 46%, #7a3352 78%, #b0526b 100%);
}
.theme-wedding .hero .sun {
  background: radial-gradient(circle at 42% 38%, #ffe9c4, #e6c98a 58%, #d9a75c);
  box-shadow: 0 0 44px 16px rgba(230,201,138,.45), 0 0 90px 40px rgba(192,92,116,.3);
}
.theme-wedding .ai-card {
  background:
    radial-gradient(110% 120% at 90% -20%, rgba(192,92,116,.45), rgba(192,92,116,0) 55%),
    var(--g-dusk);
  border-color: rgba(230,201,138,.5);
}

/* ---- Add-to-home-screen prompt -------------------------------------------- */
.inst-steps { display: grid; gap: 10px; }
.inst-step { display: flex; align-items: flex-start; gap: 11px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 13px; font-size: 13.5px; line-height: 1.45; }
.inst-step .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--g-sunset);
  color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.inst-icon { display: inline-block; color: var(--ai-2); font-weight: 700; }

/* ---- AI setup card (dusk showcase) ---------------------------------------- */
.ai-card { position: relative; overflow: hidden; border: 1px solid rgba(227,192,126,.45);
  background:
    radial-gradient(110% 120% at 90% -20%, rgba(226,89,58,.4), rgba(226,89,58,0) 55%),
    var(--g-dusk);
  color: #f6f1e8; box-shadow: var(--shadow-lg); }
.ai-card h3 { color: #fff; }
.ai-card .section-sub, .ai-card .r-sub { color: rgba(246,241,232,.82); }
.ai-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image: radial-gradient(rgba(255,255,255,.4) 1px, transparent 1.5px);
  background-size: 88px 66px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 80%); }

/* ---- Assistant chat ------------------------------------------------------- */
.chat-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; margin-bottom: 10px;
  font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow); }
.chat-msg.user { margin-left: auto; background: var(--g-dusk); color: #fff; border-bottom-right-radius: 5px; }
.chat-msg.assistant { margin-right: auto; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
