:root {
  --ground: #F3ECE0;
  --surface: #FCF9F3;
  --surface-2: #EADFCB;
  --line: #D9CBB2;
  --ink: #2B231A;
  --ink-soft: #4A3F33;
  --ink-mute: #7A6B5A;
  --jungle: #2F6B4F;
  --jungle-soft: #D6E7DA;
  --ocean: #1F6F7F;
  --ocean-soft: #CFE4E7;
  --sun: #C9682E;
  --sun-soft: #F5D8C0;
  --sand-soft: #EFE2C8;
  --hero-top: #17383D;
  --hero-bottom: #2F6B4F;
  --hero-text: #F6F1E7;
  --shadow: 0 1px 2px rgba(43,35,26,.08), 0 8px 24px rgba(43,35,26,.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #14181A;
    --surface: #1D2326;
    --surface-2: #262E31;
    --line: #37424A;
    --ink: #EFE7D8;
    --ink-soft: #C8BEAE;
    --ink-mute: #948A7B;
    --jungle: #86B89A;
    --jungle-soft: #1F3328;
    --ocean: #7FBFC9;
    --ocean-soft: #1A3438;
    --sun: #E9A06E;
    --sun-soft: #3D2A1E;
    --sand-soft: #2E2A22;
    --hero-top: #0E1A16;
    --hero-bottom: #1F4A3A;
    --hero-text: #EFE7D8;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --ground: #14181A;
  --surface: #1D2326;
  --surface-2: #262E31;
  --line: #37424A;
  --ink: #EFE7D8;
  --ink-soft: #C8BEAE;
  --ink-mute: #948A7B;
  --jungle: #86B89A;
  --jungle-soft: #1F3328;
  --ocean: #7FBFC9;
  --ocean-soft: #1A3438;
  --sun: #E9A06E;
  --sun-soft: #3D2A1E;
  --sand-soft: #2E2A22;
  --hero-top: #0E1A16;
  --hero-bottom: #1F4A3A;
  --hero-text: #EFE7D8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--ocean); }
button { font: inherit; }
.serif { font-family: "Cormorant Garamond", "Iowan Old Style", Georgia, serif; }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 96px; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(170deg, var(--hero-top), var(--hero-bottom));
  color: var(--hero-text);
  padding: 52px 16px 44px;
  text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.mosaic { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: 128px 128px; gap: 5px; margin: 26px auto 0; max-width: 720px; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,.28); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; background: rgba(255,255,255,.08); }
.mosaic img:first-child { grid-row: 1 / span 2; }
@media (min-width: 640px) { .mosaic { grid-template-rows: 190px 190px; } }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; opacity: .8; }
.names {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500; font-size: clamp(50px, 11vw, 88px); line-height: .95; margin: 12px 0 8px;
}
.names .amp { font-style: italic; font-size: .6em; vertical-align: .15em; opacity: .85; margin: 0 .1em; }
.hero-sub { font-size: 17px; opacity: .92; }
.hero-dates { font-size: 14px; opacity: .75; margin-top: 4px; }
.hero-tag { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 20px; opacity: .9; margin-top: 14px; }
.hero-count { display: none; margin: 22px auto 0; padding: 14px 22px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); max-width: 260px; }
.hero-count.show { display: block; }
.hero-count .n { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 56px; line-height: 1; display: block; }
.hero-count .l { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; opacity: .85; display: block; margin-top: 4px; }

/* ---------- Sticky bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 720px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px; min-height: 52px;
}
.bar-inner .spacer { flex: 1; }
.today {
  display: none; align-items: center; gap: 8px;
  text-decoration: none; color: var(--hero-text); background: var(--jungle);
  border-radius: 999px; padding: 7px 14px 7px 12px; font-weight: 700; font-size: 14px;
  min-height: 36px;
}
.today.show { display: inline-flex; }
.today .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 35%, transparent); }
.today .sub { font-weight: 500; opacity: .85; }
.countdown { display: none; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.countdown.show { display: block; }
.offline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-mute); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px; cursor: default; min-height: 30px;
}
.offline .ind { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.offline.saving .ind { background: var(--sun); }
.offline.saved { color: var(--jungle); border-color: color-mix(in srgb, var(--jungle) 40%, var(--line)); }
.offline.saved .ind { background: var(--jungle); }
.offline.unsupported { display: none; }

/* ---------- Route strip ---------- */
.route { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0 22px; }
.route a {
  min-width: 0; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px;
}
.route a:active { transform: translateY(1px); }
.route .r-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.route .r-nights { font-size: 11.5px; color: var(--ink-mute); line-height: 1.25; }
.route .tone-city { background: var(--ocean-soft); border-color: transparent; }
.route .tone-jungle { background: var(--jungle-soft); border-color: transparent; }
.route .tone-sand { background: var(--sun-soft); border-color: transparent; }

/* ---------- Schedule groups ---------- */
.group { margin-bottom: 30px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; padding: 0 2px; flex-wrap: wrap; }
.group-name { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 32px; line-height: 1; color: var(--jungle); }
.group-name.tone-city { color: var(--ocean); }
.group-name.tone-sand { color: var(--sun); }
.group-name.tone-air, .group-name.tone-coast, .group-name.tone-home { color: var(--ink-soft); }
.group-dates { font-size: 13px; color: var(--ink-mute); font-weight: 600; letter-spacing: .04em; }
.group-tz { font-size: 12px; color: var(--ink-mute); margin-left: auto; }
.group-tag { width: 100%; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 19px; color: var(--ink-soft); margin-top: -2px; }
.banner { position: relative; display: block; border-radius: 16px; overflow: hidden; margin-bottom: 12px; aspect-ratio: 16 / 8; background: var(--surface-2); text-decoration: none; color: #fff; box-shadow: var(--shadow); }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.65) 100%); }
.banner .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; }
.banner .cap b { display: block; font-size: 17px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.banner .cap i { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 18px; opacity: .95; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.banner .cap small { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }

.days { display: flex; flex-direction: column; gap: 8px; }
.days:empty { display: none; }
.days + .banner { margin-top: 12px; }
.day {
  display: grid; grid-template-columns: 56px 1fr auto 16px; column-gap: 10px; align-items: center;
  text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 14px 12px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.day:hover { border-color: var(--ink-mute); }
.day:active { transform: translateY(1px); }
.day:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.day.is-today { border-color: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft), var(--shadow); }
.day.tone-city { border-left: 4px solid var(--ocean); }
.day.tone-jungle { border-left: 4px solid var(--jungle); }
.day.tone-sand { border-left: 4px solid var(--sun); }
.day.tone-air, .day.tone-coast, .day.tone-home { border-left: 4px solid var(--line); }
.d-date { text-align: center; line-height: 1.05; }
.d-wd { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-mute); }
.d-num { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 34px; color: var(--ink); }
.d-body { min-width: 0; }
.d-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.d-sum { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.d-sum span { white-space: nowrap; }
.d-sum .plane::before { content: "✈ "; opacity: .7; }
.d-sum .bed::before { content: "⌂ "; opacity: .7; }
.d-chev { color: var(--ink-mute); font-size: 20px; line-height: 1; text-align: right; }
.d-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: block; background: var(--surface-2); }
.d-thumb.none { width: 0; height: 52px; }
.d-flags { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.tbd {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sun); background: var(--sun-soft); padding: 1px 7px; border-radius: 4px; vertical-align: middle;
}

/* ---------- Day page ---------- */
.topbar-inner { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px; min-height: 52px; }
.back { text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 0; }
.back::before { content: "←"; font-size: 18px; }
.nav { margin-left: auto; display: flex; gap: 6px; }
.nav > a, .nav > span {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 34px;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav > span { opacity: .4; }
.dayhero { padding: 30px 16px 26px; background: linear-gradient(170deg, var(--hero-top), var(--hero-bottom)); color: var(--hero-text); position: relative; overflow: hidden; }
.dayhero.photo { padding-top: 120px; }
.dayhero.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dayhero.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,20,18,.15) 0%, rgba(10,20,18,.55) 45%, rgba(10,20,18,.88) 100%); }
.dayhero-inner { position: relative; z-index: 1; }
.dayhero .kicker, .dayhero h1, .dayhero .when, .dayhero .tz { text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.dayhero-inner { max-width: 720px; margin: 0 auto; }
.dayhero .kicker { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.dayhero h1 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(36px, 8vw, 52px); line-height: 1.05; margin-top: 8px; }
.dayhero .when { font-size: 16px; opacity: .9; margin-top: 8px; }
.dayhero .tz { font-size: 13px; opacity: .7; margin-top: 2px; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 18px 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card h2 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 26px; line-height: 1.1; margin-bottom: 12px; color: var(--jungle); }
.card h2.ocean { color: var(--ocean); }
.card h2.sun { color: var(--sun); }
.card .sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-mute); margin: -8px 0 12px; }

.leg { padding: 12px 0; }
.leg + .leg { border-top: 1px solid var(--line); }
.leg-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.leg-ap { line-height: 1.1; }
.leg-ap.to { text-align: right; }
.leg-code { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 34px; display: block; }
.leg-city { font-size: 12.5px; color: var(--ink-mute); display: block; }
.leg-time { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; display: block; margin-top: 4px; }
.leg-time small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-mute); }
.leg-arrow { color: var(--ink-mute); font-size: 20px; }
.leg-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); }
.leg-meta b { color: var(--ink); font-weight: 700; }
.leg-note { font-size: 13.5px; color: var(--ink-mute); margin-top: 8px; }

.kv { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 7px 14px; font-size: 15px; }
.kv dt { color: var(--ink-mute); font-weight: 600; font-size: 13px; letter-spacing: .02em; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.hotel-name { font-weight: 700; font-size: 18px; line-height: 1.3; }
.hotel-area { font-size: 14px; color: var(--ink-mute); margin-bottom: 12px; }
.stay-photo { display: block; width: calc(100% + 36px); margin: -18px -18px 14px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px 14px 0 0; }
.stay-tag { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 22px; color: var(--jungle); line-height: 1.2; }
.stay-blurb { font-size: 15px; color: var(--ink-soft); margin: 6px 0 14px; }
.stay-switch { font-size: 13.5px; color: var(--sun); font-weight: 700; margin-bottom: 10px; }

.plans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.plans li { padding-left: 16px; position: relative; font-size: 15px; color: var(--ink-soft); }
.plans li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.plans li b { color: var(--ink); }
.plans li.surprise { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 18px; color: var(--sun); }
.plans li.surprise::before { background: var(--sun); box-shadow: 0 0 0 3px var(--sun-soft); }
.empty { font-size: 15px; color: var(--ink-mute); font-style: italic; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin-bottom: 0; }
.card-head .spacer { flex: 1; }
.btn { font: inherit; font-weight: 700; font-size: 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; min-height: 36px; cursor: pointer; }
.btn.small { font-size: 13px; padding: 6px 12px; min-height: 34px; }
.btn.primary { background: var(--jungle); border-color: var(--jungle); color: var(--hero-text); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ocean); outline-offset: 2px; }
.plan-rows { display: flex; flex-direction: column; gap: 8px; }
.plan-row { display: grid; grid-template-columns: 88px 1fr 36px; gap: 6px; align-items: center; }
.plan-row input { font: inherit; font-size: 15px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); color: var(--ink); min-width: 0; }
.plan-row input:focus { outline: 2px solid var(--ocean); outline-offset: 1px; }
.plan-row input[type="time"] { padding: 6px 6px; font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; }
.plan-row input[data-surprise] { color: var(--sun); font-style: italic; }
.pr-del { font: inherit; font-size: 20px; line-height: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ink-mute); border-radius: 10px; min-height: 40px; cursor: pointer; }
.pr-del:hover { color: var(--sun); border-color: var(--sun); }
.plans-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.plans-actions .spacer { flex: 1; }
.pass-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.pass-row input { font: inherit; font-size: 16px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); color: var(--ink); min-width: 0; }
.plans-status { font-size: 13px; color: var(--ink-mute); margin-top: 10px; min-height: 1em; }
.plans-status.ok { color: var(--jungle); }
.plans-status.bad { color: var(--sun); }
@media (max-width: 420px) { .plan-row { grid-template-columns: 76px 1fr 36px; } }
.notes { font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; line-height: 1.45; color: var(--ink); }

.daynav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.daynav > a, .daynav > span {
  text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-height: 60px;
}
.daynav > span { opacity: .35; }
.daynav .next { text-align: right; }
.daynav .lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ink-mute); }
.daynav .ttl { font-weight: 700; font-size: 14px; }

.foot { margin-top: 40px; text-align: center; font-size: 13px; color: var(--ink-mute); }

@media (max-width: 420px) {
  .day { grid-template-columns: 44px 1fr auto 12px; column-gap: 8px; padding: 12px 8px 12px 8px; }
  .d-thumb { width: 46px; height: 46px; }
  .d-num { font-size: 30px; }
  .leg-code { font-size: 28px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .kv dt:first-child { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .day, .route a { transition: none; } }
