:root {
  --bg: #f4ede1;
  --surface: #fffaf2;
  --surface-2: #efe5d4;
  --ink: #1f1b16;
  --ink-2: #5c5348;
  --ink-3: #8a7f71;
  --line: #e2d6c2;
  --lava: #d9481f;
  --lava-soft: #fbe2d6;
  --sea: #0f6f7c;
  --sea-soft: #d6ecee;
  --leaf: #2f7d4f;
  --leaf-soft: #dcefe2;
  --gold: #b9850e;
  --gold-soft: #f8ebc6;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .08);
  --radius: 16px;
  --tabbar-h: 64px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130f;
    --surface: #211d18;
    --surface-2: #2b261f;
    --ink: #f3ece1;
    --ink-2: #c4b8a7;
    --ink-3: #8f8475;
    --line: #3a3229;
    --lava: #ff7a4d;
    --lava-soft: #3d2219;
    --sea: #5cc3cf;
    --sea-soft: #173236;
    --leaf: #6fcf97;
    --leaf-soft: #1b3326;
    --gold: #f0c255;
    --gold-soft: #3a2f14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--sea); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; margin: 0; }

.app { display: flex; flex-direction: column; height: 100dvh; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 28px; line-height: 1; }
.brand h1 { font-size: 22px; line-height: 1.1; }
.brand .sub { margin: 0; font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.status {
  font-size: 12px; font-weight: 700; color: var(--lava);
  background: var(--lava-soft); padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- panes ---------- */
.panes { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; }
.pane-content { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.pane-map { visibility: hidden; }
body.show-map .pane-map { visibility: visible; z-index: 2; }
body.show-map .pane-content { visibility: hidden; }
#map { position: absolute; inset: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); background: var(--surface-2); }

.view { display: none; }
.view.active { display: block; }

/* ---------- tabs ---------- */
.tabs-mobile {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs-mobile button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; font-weight: 500; color: var(--ink-3); cursor: pointer;
}
.tabs-mobile button span { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .7; }
.tabs-mobile button.active { color: var(--ink); font-weight: 700; }
.tabs-mobile button.active span { filter: none; opacity: 1; }
.tabs-desktop { display: none; }

/* ---------- day bar ---------- */
.daybar {
  position: sticky; top: 0; z-index: 3;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px; background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.daybar::-webkit-scrollbar { display: none; }
.daychip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
  border-radius: 14px; padding: 6px 12px 7px; text-align: center; cursor: pointer; min-width: 58px;
}
.daychip .dow { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.daychip .dnum { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.1; }
.daychip .wx { display: block; font-size: 12px; line-height: 1.2; min-height: 14px; }
.daychip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.daychip.active .dow { color: inherit; opacity: .7; }
.daychip.today { box-shadow: 0 0 0 2px var(--lava); }

/* ---------- day ---------- */
.day { padding: 16px; max-width: 720px; margin: 0 auto; }
.day-head .kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lava); margin: 0 0 4px; }
.day-head h2 { font-size: 28px; line-height: 1.15; }
.day-head .area { color: var(--ink-2); font-size: 14px; margin: 4px 0 10px; }
.day-head .summary { margin: 0 0 14px; }
.day-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.wx-row { display: grid; gap: 8px; margin: 0 0 14px; }
.wx-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.wx-card .ico { font-size: 28px; line-height: 1; }
.wx-card .wx-main { flex: 1; min-width: 0; }
.wx-card .wx-loc { font-size: 12px; color: var(--ink-3); }
.wx-card .wx-val { font-weight: 700; }
.wx-card .wx-det { font-size: 12px; color: var(--ink-2); }
.wx-card .wx-src { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; align-self: flex-start; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.step { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 10px; margin-bottom: 12px; }
.step .dot {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: var(--surface); border: 2px solid var(--line);
}
.step .dot b { position: absolute; right: -4px; bottom: -4px; background: var(--ink); color: var(--bg); font: 700 10px/1 var(--font-body); padding: 3px 5px; border-radius: 8px; }
.step .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.step.optional .card { border-style: dashed; box-shadow: none; background: transparent; }
.step.now .card { border-color: var(--lava); box-shadow: 0 0 0 2px var(--lava-soft), var(--shadow); }
.step.done .card { opacity: .55; }
.step .time { font-size: 13px; font-weight: 700; color: var(--lava); font-variant-numeric: tabular-nums; }
.step h3 { font-family: var(--font-body); font-size: 16px; font-weight: 700; line-height: 1.3; margin: 2px 0 4px; }
.step p { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.step .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.thumb { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; margin: 6px 0 8px; display: block; background: var(--surface-2); }

.tags { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 6px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tag.veg { background: var(--leaf-soft); color: var(--leaf); }
.tag.book { background: var(--lava-soft); color: var(--lava); }
.tag.opt { background: transparent; border: 1px dashed var(--ink-3); color: var(--ink-3); }
.tag.mil { background: #e9e2d2; color: #6b5b3e; }
.tag.free { background: var(--sea-soft); color: var(--sea); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.mil { background: #332b1d; color: #d9c49a; } }

.alts { margin-top: 24px; }
.alts h3, .section h3 { font-size: 18px; margin-bottom: 10px; }
.alt {
  border-left: 3px solid var(--sea); background: var(--surface); border-radius: 0 12px 12px 0;
  padding: 10px 12px; margin-bottom: 8px;
}
.alt b { display: block; margin-bottom: 2px; }
.alt p { margin: 0; color: var(--ink-2); font-size: 14px; }
.alt .btn { margin-top: 8px; }

.edit-hint { margin: 28px 0 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- book & info ---------- */
.section { padding: 16px; max-width: 720px; margin: 0 auto; }
.section > h2 { font-size: 26px; margin-bottom: 4px; }
.section > .lead { color: var(--ink-2); margin: 0 0 16px; }
.bk {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.bk input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--leaf); }
.bk.done { opacity: .6; }
.bk.done h4 { text-decoration: line-through; }
.bk h4 { margin: 0 0 2px; font-size: 15px; }
.bk .meta { font-size: 13px; color: var(--ink-2); }
.bk p { margin: 6px 0 8px; font-size: 13px; color: var(--ink-2); }
.pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.pill.booked { background: var(--leaf); color: #fff; }
.pill.required { background: var(--lava); color: #fff; }
.pill.recommended { background: var(--gold-soft); color: var(--gold); }
.pill.optional { background: var(--surface-2); color: var(--ink-3); }

.card-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.flight { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.flight:last-of-type { border-bottom: 0; }
.flight .lbl { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.flight .lbl b { color: var(--ink); }
.flight .end b { display: block; font-family: var(--font-display); font-size: 18px; }
.flight .end span { font-size: 12px; color: var(--ink-2); }
.flight .end.r { text-align: right; }
.flight .arrow { font-size: 20px; color: var(--lava); }
.list { margin: 0; padding-left: 18px; }
.list li { margin-bottom: 6px; }
.food { display: grid; gap: 8px; }
.food div { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.food .v { grid-row: span 2; align-self: start; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; min-width: 52px; text-align: center; }
.food .v.vegan, .food .v.veg { background: var(--leaf-soft); color: var(--leaf); }
.food .v.ask { background: var(--gold-soft); color: var(--gold); }
.food .v.no { background: var(--surface-2); color: var(--ink-3); }
.food span { font-size: 13px; color: var(--ink-2); }
.phrase { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.phrase:last-child { border-bottom: 0; }
.phrase b { display: block; }
.phrase span { font-size: 13px; color: var(--ink-2); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.kv a { font-weight: 700; }

/* ---------- map ---------- */
.map-filter {
  position: absolute; z-index: 500; top: 10px; left: 10px; right: 56px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px;
}
.map-filter::-webkit-scrollbar { display: none; }
.map-filter button {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow);
}
.map-filter button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.map-tools {
  position: absolute; z-index: 5; right: 10px; top: 56px;
  display: flex; flex-direction: column; gap: 8px;
}
.map-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.6); cursor: pointer; font: 700 15px/1 var(--font-body); color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(40, 25, 10, .18);
  transition: transform .15s, background .15s;
}
.map-btn:active { transform: scale(.94); }
.map-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#btn-park[aria-pressed="true"] { background: #2b5fb3; border-color: #2b5fb3; color: #fff; }
#locate { font-size: 20px; }
.legend {
  position: absolute; z-index: 6; right: 62px; top: 56px; max-width: 240px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 13px;
}
.legend div { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.legend .legend-note { display: block; margin-top: 6px; color: var(--ink-3); font-size: 11px; }

.map-filter button { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface) 85%, transparent); }
.map-filter button.active { background: var(--ink); }

/* pins */
.pin-wrap { border: 0; padding: 0; background: none; cursor: pointer; display: block; }
.pin {
  --c: #333;
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  display: grid; place-items: center; border: 2.5px solid #fff;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 60%);
  box-shadow: 0 6px 14px -4px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.08);
  transition: transform .15s;
}
.pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.12); }
.pin span { transform: rotate(45deg); color: #fff; font: 800 14px/1 var(--font-body); text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.pin.emoji span { font-size: 15px; text-shadow: none; }
.pin.gem { border-radius: 7px; width: 32px; height: 32px; }
.pin.dim { opacity: .55; filter: saturate(.5); width: 28px; height: 28px; }
.pin.park { width: 24px; height: 24px; border-radius: 7px; transform: none; border-width: 2px; background: #2b5fb3; }
.pin.park span { transform: none; font-size: 13px; }
.pin-wrap:hover .pin.park { transform: scale(1.12); }
.pin-here { width: 18px; height: 18px; border-radius: 50%; background: #2a7fff; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(42,127,255,.25); }

/* MapLibre chrome */
.maplibregl-popup-content { padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 14px 40px rgba(20,10,0,.3); overflow: hidden; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.maplibregl-popup-close-button { width: 28px; height: 28px; margin: 6px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 18px; line-height: 1; z-index: 2; }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; }
.maplibregl-ctrl-bottom-left { bottom: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.pop { width: 280px; font: 14px/1.45 var(--font-body); }
.pop img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--surface-2); }
.pop .credit { font-size: 9px; color: var(--ink-3); padding: 2px 12px 0; text-align: right; }
.pop .credit a { color: inherit; }
.pop .body { padding: 10px 12px 12px; }
.pop .cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pop .vegtxt { color: var(--leaf); }
.pop h4 { margin: 2px 0 6px; font-family: var(--font-display); font-size: 17px; line-height: 1.2; padding-right: 24px; }
.pop p { margin: 0 0 8px; color: var(--ink-2); font-size: 13px; max-height: 150px; overflow-y: auto; }
.pop .when { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.pop .approx { font-size: 11px; color: var(--ink-3); margin: -2px 0 8px; }
.pop .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pop .btn { color: var(--ink); }
.pop .btn.primary { color: var(--bg); }

/* parking + alternatives inside step cards */
.park-row {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px;
  border-radius: 12px; background: color-mix(in srgb, #2b5fb3 9%, var(--surface)); border: 1px solid color-mix(in srgb, #2b5fb3 25%, var(--line));
}
.park-ico { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; background: #2b5fb3; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.park-txt { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); }
.park-txt b { display: block; font-size: 13px; color: var(--ink); }
.alts-in { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.alts-in summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--lava); list-style: none; }
.alts-in summary::-webkit-details-marker { display: none; }
.alts-in summary::before { content: "↳ "; }
.alts-in[open] summary { margin-bottom: 6px; }
.alt-item { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.alt-item:last-child { border-bottom: 0; padding-bottom: 0; }
.alt-item b { display: block; font-size: 14px; }
.alt-item span { display: block; font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }

/* ---------- desktop: side-by-side ---------- */
@media (min-width: 960px) {
  .panes { display: grid; grid-template-columns: minmax(420px, 520px) 1fr; }
  .pane { position: relative; inset: auto; }
  .pane-content { padding-bottom: 32px; border-right: 1px solid var(--line); }
  .pane-map, body.show-map .pane-map { visibility: visible; }
  body.show-map .pane-content { visibility: visible; }
  #map { bottom: 0; }
  .tabs-mobile { display: none; }
  .tabs-desktop {
    display: flex; gap: 4px; padding: 10px 16px 0; position: sticky; top: 0; z-index: 4; background: var(--bg);
  }
  .tabs-desktop button {
    border: 0; background: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--ink-3);
  }
  .tabs-desktop button.active { background: var(--surface-2); color: var(--ink); font-weight: 700; }
  .daybar { top: 46px; }
}

/* hidden gems */
.gem-card .thumb { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.gem-card h3 { margin: 0 0 4px; }
.gem-why { margin: 0 0 6px; font-weight: 600; color: var(--ink-2); font-size: 13px; }

/* packing list */
.pack { margin: 0 0 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.pack summary { cursor: pointer; font-weight: 700; }
.pack p { margin: 8px 0 6px; font-size: 14px; }
.pack ul { margin: 0; padding-left: 20px; font-size: 14px; }

/* gift photos */
.gift img { display: block; width: 100%; height: 140px; object-fit: cover; border-radius: 10px; }
.gift .gift-credit { display: block; font-size: 10px; color: var(--ink-3); margin: 2px 0 6px; text-decoration: none; }
.food .gift { display: block; }
.food .gift span { display: block; }
