/* ---------- Tokens ---------- */
:root {
  --ink: #1c1b33;
  --ink-2: #2b2950;
  --paper: #fbf6ee;
  --card: #ffffff;
  --line: #ece4d6;
  --muted: #6e6a80;
  --saffron: #f0a23b;
  --saffron-soft: #fdf0dc;
  --lotus: #e0607e;
  --lotus-soft: #fbe6ec;
  --sea: #188a8d;
  --sea-soft: #def3f2;
  --leaf: #4e9a52;
  --leaf-soft: #e5f3e3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 27, 51, .06), 0 6px 20px rgba(28, 27, 51, .06);
  --tabbar-h: 64px;
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app {
  max-width: 760px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view { animation: none; } }

.wrap { padding: 0 16px; }
.section { margin: 22px 0 10px; }
.section h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -.01em;
}
.section h2 small { font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }

.page-head { padding: 22px 16px 6px; }
.page-head h1 {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -.02em;
}
.page-head p { margin: 6px 0 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--saffron-soft); color: #8a5510;
  white-space: nowrap;
}
.pill.sea { background: var(--sea-soft); color: #0c5d60; }
.pill.lotus { background: var(--lotus-soft); color: #a3304c; }
.pill.leaf { background: var(--leaf-soft); color: #2f6b33; }
.pill.grey { background: #efedf3; color: var(--muted); }

.alert {
  display: flex; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--saffron-soft);
  color: #6b430c;
  font-size: 13.5px;
}
.alert.lotus { background: var(--lotus-soft); color: #8e2a43; }
.alert b { font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(240, 162, 59, .45), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(224, 96, 126, .35), transparent 60%),
    linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  padding: calc(28px + env(safe-area-inset-top)) 20px 26px;
  border-radius: 0 0 28px 28px;
}
.hero::after {
  content: "";
  position: absolute; inset: auto -40px -60px auto;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .18);
}
.hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; font-weight: 600; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 13vw, 68px);
  line-height: .95;
  margin: 8px 0 6px;
  letter-spacing: -.03em;
}
.hero h1 span { color: var(--saffron); }
.hero .sub { opacity: .85; font-size: 15px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero .meta .pill { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 500; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.countdown div {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 10px 4px 8px;
  text-align: center;
}
.countdown b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }
.status-line { margin-top: 18px; font-size: 15px; }
.status-line b { color: var(--saffron); }

/* ---------- Clocks ---------- */
.clocks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -18px; position: relative; z-index: 2; }
.clock { padding: 12px 14px; }
.clock .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.clock .time { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clock .tz { font-size: 11.5px; color: var(--muted); }

/* ---------- Next up ---------- */
.next { display: flex; gap: 14px; align-items: flex-start; }
.next .ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--saffron-soft);
}
.next .when { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.next .what { font-weight: 600; font-size: 16px; margin-top: 2px; }
.next .in { font-size: 13px; color: var(--sea); font-weight: 600; margin-top: 4px; }

/* ---------- Route strip ---------- */
.route { display: flex; align-items: center; overflow-x: auto; gap: 0; padding: 4px 2px 8px; scrollbar-width: none; }
.route::-webkit-scrollbar { display: none; }
.route .stop { flex: none; text-align: center; min-width: 74px; }
.route .dot { width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 6px; background: var(--saffron); box-shadow: 0 0 0 4px var(--saffron-soft); }
.route .stop.home .dot { background: var(--ink); box-shadow: 0 0 0 4px #e3e1ee; }
.route .city { font-weight: 600; font-size: 14px; }
.route .n { font-size: 12px; color: var(--muted); }
.route .bar { flex: 1 0 22px; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); margin-bottom: 30px; }

/* ---------- Crew ---------- */
.crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.crew .p { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.crew .nm { font-weight: 600; font-size: 14px; line-height: 1.2; }
.crew .full { font-size: 11.5px; color: var(--muted); line-height: 1.25; }

/* ---------- Checklist ---------- */
.check { list-style: none; margin: 0; padding: 0; }
.check li + li { border-top: 1px solid var(--line); }
.check label { display: flex; gap: 12px; padding: 12px 2px; cursor: pointer; align-items: flex-start; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; border: 2px solid #cfc7b8; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--leaf); border-color: var(--leaf); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check input:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }
.check .t { font-weight: 600; font-size: 14.5px; }
.check input:checked ~ div .t { text-decoration: line-through; color: var(--muted); }
.check .s { font-size: 12.5px; color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: var(--leaf); width: 0; transition: width .3s; }

/* ---------- Day cards ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--paper) 80%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on small { color: rgba(255, 255, 255, .7); }
.chip.today:not(.on) { border-color: var(--saffron); }

.day { padding: 0; overflow: hidden; scroll-margin-top: 60px; }
.day summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.day summary::-webkit-details-marker { display: none; }
.day .num {
  flex: none; width: 50px; height: 54px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line);
  display: grid; place-content: center; text-align: center; line-height: 1;
}
.day .num b { font-family: var(--display); font-size: 22px; }
.day .num span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.day.is-today .num { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.day.is-today .num span { color: rgba(255, 255, 255, .85); }
.day.is-past { opacity: .72; }
.day .hd { flex: 1; min-width: 0; }
.day .dt { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.day .tt { font-weight: 700; font-size: 16px; line-height: 1.25; margin-top: 1px; }
.day .chev { flex: none; width: 22px; height: 22px; transition: transform .2s; color: var(--muted); }
.day[open] .chev { transform: rotate(180deg); }
.day .body { padding: 0 16px 16px; }

.tl { list-style: none; margin: 4px 0 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 62px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl li { display: grid; grid-template-columns: 52px 22px 1fr; gap: 0 8px; align-items: start; padding: 7px 0; position: relative; }
.tl .tm { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tl .tm.exact { color: var(--ink); }
.tl .mk { width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; z-index: 1; }
.tl li.k-flight .mk { border-color: var(--sea); background: var(--sea-soft); }
.tl li.k-hotel .mk { border-color: var(--lotus); background: var(--lotus-soft); }
.tl li.k-boat .mk, .tl li.k-sight .mk, .tl li.k-show .mk { border-color: var(--saffron); background: var(--saffron-soft); }
.tl .tx { font-size: 14.5px; font-weight: 500; line-height: 1.35; padding-top: 1px; }
.tl .tx small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.tl .tx button.lnk { all: unset; cursor: pointer; color: var(--sea); font-size: 12px; font-weight: 600; margin-left: 2px; }
.tl .tz { font-size: 10px; display: block; font-weight: 600; color: var(--sea); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.day .stay { margin-top: 12px; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--paper); font-size: 13.5px; }
.day .stay b { font-weight: 600; }
.day .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn:focus-visible, .chip:focus-visible, .day summary:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

/* ---------- Flights ---------- */
.flight { padding: 0; overflow: hidden; }
.flight .top { padding: 14px 16px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.flight .al { font-weight: 700; }
.flight .al small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.flight .legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 4px 16px 14px; }
.flight .end .code { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.flight .end .time { font-size: 20px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.flight .end .date { font-size: 12.5px; color: var(--muted); }
.flight .end .ap { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.flight .end.r { text-align: right; }
.flight .mid { text-align: center; color: var(--muted); font-size: 12px; }
.flight .mid .plane { font-size: 18px; display: block; color: var(--sea); }
.flight .mid .line { width: 64px; height: 2px; margin: 4px auto; background: repeating-linear-gradient(90deg, var(--sea) 0 5px, transparent 5px 9px); }
.flight .perf {
  position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 14px;
}
.flight .perf::before, .flight .perf::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.flight .perf::before { left: -25px; }
.flight .perf::after { right: -25px; }
.flight .btm { padding: 12px 16px 16px; }
.flight .bags { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.flight .bags div { background: var(--paper); border-radius: 10px; padding: 8px 10px; }
.flight .bags b { display: block; font-size: 15px; }
.flight .bags span { font-size: 11.5px; color: var(--muted); }
.flight .stack { margin-top: 10px; }
.flight.done { opacity: .6; }

.hotel { display: flex; gap: 14px; align-items: flex-start; }
.hotel .ico { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--lotus-soft); display: grid; place-items: center; font-size: 22px; }
.hotel .nm { font-weight: 700; font-size: 16px; }
.hotel .stars { color: var(--saffron); letter-spacing: 1px; font-size: 13px; }
.hotel .dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
.hotel .dates div { background: var(--paper); border-radius: 10px; padding: 7px 10px; }
.hotel .dates b { display: block; font-size: 14px; }
.hotel .dates span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---------- Map ---------- */
.view-map { display: flex; flex-direction: column; }
.view-map .chips { position: static; padding-top: 12px; }
#map {
  height: 56vh; min-height: 320px;
  margin: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 1;
}
.map-list { margin-top: 12px; }
.map-list button {
  all: unset; box-sizing: border-box;
  display: flex; width: 100%; gap: 12px; align-items: center;
  padding: 10px 4px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.map-list button:last-child { border-bottom: 0; }
.map-list button:focus-visible { outline: 2px solid var(--sea); border-radius: 8px; }
.map-list .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.map-list .nm { font-weight: 600; font-size: 14px; }
.map-list .ar { font-size: 12px; color: var(--muted); }

.pin {
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: grid; place-items: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.pin b { transform: rotate(45deg); color: #fff; font-size: 11px; font-family: var(--body); }
.leaflet-popup-content { font-family: var(--body); font-size: 13px; margin: 10px 14px; }
.leaflet-popup-content b { font-size: 14px; }
.leaflet-popup-content a { font-weight: 600; }

/* ---------- Money ---------- */
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.totals .card { padding: 14px; }
.totals .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.totals .val { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.totals .hint { font-size: 12px; color: var(--muted); }
.totals .card.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.totals .card.dark .lbl, .totals .card.dark .hint { color: rgba(255, 255, 255, .7); }

.bar-split { display: flex; height: 12px; border-radius: 8px; overflow: hidden; margin: 6px 0 10px; }
.bar-split i:nth-child(1) { background: var(--saffron); }
.bar-split i:nth-child(2) { background: var(--sea); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--saffron); }
.legend span:nth-child(2)::before { background: var(--sea); }

.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.conv label { font-size: 12px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
.conv input, .rate input {
  width: 100%;
  font: inherit; font-size: 20px; font-weight: 700;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.conv input:focus, .rate input:focus { outline: 2px solid var(--sea); border-color: transparent; }
.conv .sw { padding-bottom: 12px; font-size: 18px; color: var(--muted); }
.rate { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.rate input { width: 86px; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

ul.plain { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
ul.plain li { margin: 3px 0; }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 26px 16px 8px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 600;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { stroke: var(--lotus); }

@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 16px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); height: var(--tabbar-h); padding-bottom: 0; }
  #app { padding-bottom: 110px; }
  .hero { border-radius: 0 0 32px 32px; padding-left: 32px; padding-right: 32px; }
  #map { height: 62vh; }
}
