/* Layout: phone = header / map strip / scrolling panel / bottom tabs.
   Desktop (>= 960px) = planning panel on the left, full-height map on the right.
   Palette: azulejo cobalt, Mediterranean teal, saffron, bougainvillea. */
:root {
  --bg: #F1F4F6;
  --surface: #FFFFFF;
  --sunken: #E7ECEF;
  --ink: #0F1E2B;
  --muted: #5A6A76;
  --line: #D9E0E5;
  --accent: #2347B8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3E9FA;
  --morning: #0B8A87;
  --lunch: #C9861A;
  --afternoon: #D9822B;
  --evening: #B13E6A;
  --danger: #B3261E;
  --shadow: 0 1px 2px rgb(15 30 43 / .06), 0 8px 24px -12px rgb(15 30 43 / .18);
  --tiles: saturate(.55) contrast(.95) brightness(1.03);
  --fog: rgba(35, 71, 184, .32);

  /* Bricolage and Figtree have no Cyrillic; Onest takes over for Bulgarian letters. */
  --f-display: "Bricolage Grotesque", "Onest", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --top-h: 60px;
  --tabs-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C131A; --surface: #131D26; --sunken: #0F1820; --ink: #E6EDF2; --muted: #8C9DA9;
    --line: #22313D; --accent: #7F9CFF; --accent-ink: #0C131A; --accent-soft: #1A2547;
    --morning: #3CC2BD; --lunch: #E5AC4C; --afternoon: #F0A35A; --evening: #E07AA2; --danger: #FF8A80;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -14px rgb(0 0 0 / .6);
    --tiles: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.45);
    --fog: rgba(8, 14, 28, .62);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C131A; --surface: #131D26; --sunken: #0F1820; --ink: #E6EDF2; --muted: #8C9DA9;
  --line: #22313D; --accent: #7F9CFF; --accent-ink: #0C131A; --accent-soft: #1A2547;
  --morning: #3CC2BD; --lunch: #E5AC4C; --afternoon: #F0A35A; --evening: #E07AA2; --danger: #FF8A80;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -14px rgb(0 0 0 / .6);
  --tiles: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.45);
  --fog: rgba(8, 14, 28, .62);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--f-mono); font-size: .82em; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "top" "map" "panel";
}
.top {
  grid-area: top;
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--top-h);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 0; padding: 0;
  font: 800 22px/1 var(--f-display); letter-spacing: -.03em;
}
.brand svg { width: 30px; height: 30px; }
.ctx { display: flex; gap: 6px; margin-left: auto; min-width: 0; }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  height: 34px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600;
}
.ctx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }
.ctx-chip .ic { color: var(--muted); }
.ctx-chip:first-child { flex: none; }
.lang-switch {
  display: inline-flex; flex: none; align-items: center; gap: 2px;
  height: 34px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.lang-switch button {
  height: 26px; min-width: 32px; padding: 0 7px; border: 0; border-radius: 999px; background: none;
  font: 700 11.5px/1 var(--f-body); letter-spacing: .04em; color: var(--muted);
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
/* Narrow phones: the hotel chip keeps only its bed icon (its name is on the Stay screen). */
@media (max-width: 420px) { .ctx-chip.hotel span { display: none; } .ctx-chip.hotel { padding: 0 11px; } }
.ctx-chip.hotel span { max-width: 14ch; }
@media (max-width: 420px) { .ctx-chip.hotel span { max-width: 9ch; } }
.ctx-chip.warn { border-style: dashed; color: var(--muted); }

.map-wrap {
  grid-area: map;
  position: relative;
  height: 0; overflow: hidden;
  transition: height .35s cubic-bezier(.2,.7,.2,1);
  border-bottom: 1px solid var(--line);
}
body.show-map .map-wrap { height: 34svh; min-height: 220px; }
#map { position: absolute; inset: 0; background: var(--sunken); }

.panel {
  grid-area: panel;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  min-width: 0; /* a wide child must never widen the panel and make it scroll sideways */
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
.screen-host {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 22px 8px;
  max-width: 640px; margin-inline: auto;
}

.tabs {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 50px; border: 0; background: none; border-radius: var(--r-m);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .ic { stroke-width: 2.2; }
.tab:disabled { opacity: .4; cursor: default; }

@media (min-width: 960px) {
  .app {
    grid-template-columns: minmax(420px, 480px) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: "top map" "panel map";
  }
  .top { border-right: 1px solid var(--line); }
  .map-wrap, body.show-map .map-wrap { height: auto; min-height: 0; border-bottom: 0; }
  .panel { border-right: 1px solid var(--line); padding-bottom: 40px; }
  .tabs {
    position: sticky; top: 0; bottom: auto;
    padding: 8px 16px; border-top: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
  }
  .tab { flex-direction: row; gap: 8px; min-height: 40px; font-size: 14px; }
  .tab .ic { width: 18px; height: 18px; }
  .tab[aria-current="page"] { background: var(--accent-soft); }
  .screen-host { padding-left: 24px; padding-right: 24px; }
}

/* ---------- Type ---------- */
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.display { margin: 0; font: 800 clamp(40px, 11vw, 60px)/.95 var(--f-display); letter-spacing: -.045em; text-wrap: balance; }
.display em { font-style: normal; color: var(--accent); }
h2 { margin: 0; font: 700 30px/1.05 var(--f-display); letter-spacing: -.035em; text-wrap: balance; }
h3 { margin: 0; font: 700 19px/1.2 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.lede { margin: 14px 0 0; color: var(--muted); font-size: 17px; max-width: 46ch; }
.sub { margin: 6px 0 0; color: var(--muted); }
.label { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.section { margin-top: 28px; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; min-height: 54px; font-size: 16px; }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); padding: 0 10px; }
.btn.small { min-height: 36px; padding: 0 13px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.search {
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 16px; margin-top: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.search .spin { width: 18px; height: 18px; }

.results { display: grid; margin-top: 8px; }
.result {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); background: none;
}
.result:last-child { border-bottom: 0; }
.result .ic { color: var(--muted); }
.result b { display: block; font-weight: 600; }
.result small { display: block; color: var(--muted); font-size: 13px; }
.result:hover b { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; padding: 2px 4px 4px; scroll-snap-type: x proximity; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 40px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 600; white-space: nowrap; scroll-snap-align: start;
  transition: background .15s, border-color .15s, color .15s;
}
.chip .ic { color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip[aria-pressed="true"] .ic { color: currentColor; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { color: #0C131A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip[aria-pressed="true"] { color: #0C131A; } }

.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 4px; background: var(--sunken); border-radius: var(--r-m);
}
.seg button {
  min-height: 42px; padding: 4px 8px; border: 0; border-radius: 10px; background: none;
  font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.15;
}
.seg button small { display: block; font-weight: 500; font-size: 11.5px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.field { display: grid; gap: 6px; min-width: 0; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  height: 46px; padding: 0 12px; min-width: 0; width: 100%;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface);
}
.fields { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 10px; }
@media (max-width: 400px) { .fields { grid-template-columns: 1fr 1fr; } .fields .field:last-child { grid-column: span 2; } }
/* Native date pickers refuse to shrink past their own minimum width (worse with larger system
   text), so a fixed 1fr/1fr split can push the second field off screen; auto-fit drops to one
   column instead of overflowing whenever both don't fit. */
.fields.two { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.fields.two .field:last-child { grid-column: auto; }

.toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r-m);
  background: none; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--muted);
}
.toggle .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.toggle[aria-pressed="true"] { border-style: solid; border-color: var(--lunch); color: var(--ink); }
.toggle[aria-pressed="true"] .box { background: var(--lunch); border-color: var(--lunch); color: #fff; }

/* ---------- Where screen ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.city-card {
  position: relative; overflow: hidden;
  display: grid; gap: 2px; align-content: end; text-align: left;
  min-height: 104px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.city-card b { font: 700 19px/1.1 var(--f-display); letter-spacing: -.02em; }
.city-card small { color: var(--muted); font-size: 12.5px; }
.city-card .cc { position: absolute; top: 12px; right: 12px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.city-card::before {
  content: ""; position: absolute; top: -26px; left: -26px; width: 84px; height: 84px; border-radius: 50%;
  background: var(--tint, var(--accent-soft)); opacity: .5;
}
.city-card:hover { border-color: var(--accent); }
.locate-row { margin-top: 12px; }

/* ---------- Plan screen ---------- */
.slots { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; position: relative; }
.slot { position: relative; min-width: 0; padding: 0 0 22px 46px; }
.slot::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line); }
.slot:last-child::before { display: none; }
.slot-ic {
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--slot) 14%, var(--surface)); color: var(--slot);
  border: 1px solid color-mix(in srgb, var(--slot) 35%, transparent);
}
.slot-head { display: flex; align-items: baseline; gap: 10px; min-height: 36px; padding-top: 4px; margin-bottom: 10px; }
.slot-head b { font: 700 18px/1.2 var(--f-display); letter-spacing: -.02em; }
.slot-head .mono { color: var(--muted); }
.slot .chip { --c: var(--slot); }
.slot.lunch-slot { padding-bottom: 22px; }

/* ---------- Day screen ---------- */
.day-head { display: grid; gap: 4px; }
.day-head .row { margin-top: 14px; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 14px; }
.stats b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.tip {
  display: flex; gap: 10px; margin-top: 18px; padding: 12px 14px;
  border-radius: var(--r-m); background: var(--accent-soft); font-size: 14px;
}
.tip .ic { color: var(--accent); margin-top: 2px; }

.timeline { list-style: none; margin: 24px 0 0; padding: 0; }
.tl-home { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.tl-home .dot {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--ink); color: var(--bg);
}
.tl-home b { display: block; font-weight: 700; font-size: 15px; }
.tl-home small { color: var(--muted); }
.leg {
  display: flex; align-items: center; gap: 10px;
  margin-left: 19px; padding: 12px 0 12px 21px;
  border-left: 2px dotted var(--line);
  color: var(--muted); font-size: 13px;
}
.leg .leg-go { border: 0; background: none; padding: 6px 0; font-size: 13px; }
.leg a, .leg .leg-go { margin-left: auto; font-weight: 600; color: var(--accent); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.leg.gap { color: var(--ink); }
.leg.gap .ic { color: var(--lunch); }

.stop { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; }
.stop-num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--slot); color: #fff; font: 700 16px/1 var(--f-display);
  box-shadow: 0 0 0 4px var(--bg);
}
:root[data-theme="dark"] .stop-num { color: #0C131A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stop-num { color: #0C131A; } }
.stop-card {
  min-width: 0; padding: 14px 16px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.stop-card.flash { animation: flash 1.2s ease; }
@keyframes flash { 30% { border-color: var(--slot); box-shadow: 0 0 0 4px color-mix(in srgb, var(--slot) 25%, transparent); } }
.stop-kind { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--slot); }
.stop-kind .mono { margin-left: auto; color: var(--muted); font-weight: 500; }
.stop-card h3 { overflow-wrap: anywhere; }
.alt-name { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.facts li {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 4px 9px; border-radius: 999px; background: var(--sunken); font-size: 12.5px; color: var(--muted);
}
.facts li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts li.hit { background: color-mix(in srgb, var(--slot) 14%, var(--surface)); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.actions .btn { min-height: 34px; padding: 0 12px; font-size: 13px; }
.alts { display: grid; margin-top: 8px; }
.alt {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 0; border-top: 1px solid var(--line); border-radius: 0; font-size: 14px;
}
.alt-show {
  display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0;
  padding: 8px 4px; border: 0; background: none; text-align: left; font-size: 14px; border-radius: var(--r-s);
}
.alt.focused { background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: var(--r-s); }
.alt.focused b { color: var(--ink); }
.alt b { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt .mono { color: var(--muted); }
.alt:hover b { color: var(--accent); }
.empty-stop { color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Ratings and amenities */
.rating { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
.rating .ic { width: 15px; height: 15px; color: #E9A21F; fill: #E9A21F; stroke-width: 1.2; }
.rating b { font-weight: 700; }
.rating small { color: var(--muted); font-size: 12.5px; }
.rating.sm { margin: 0; font-size: 12.5px; }
.rating.sm .ic { width: 13px; height: 13px; }
.amen { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.amen li { display: inline-flex; align-items: center; gap: 6px; }
.amen .ic { width: 17px; height: 17px; color: var(--ink); stroke-width: 1.6; }
.alt { align-items: flex-start; }
.alt-main { display: grid; gap: 3px; flex: 1; min-width: 0; }
.alt-main b { flex: none; }
.alt-meta { display: flex; align-items: center; gap: 10px; min-height: 0; }
.alt-meta:empty { display: none; }
.alt-icons { display: inline-flex; gap: 7px; color: var(--muted); }
.alt-icons:empty { display: none; }
.alt-icons .ic { width: 14px; height: 14px; stroke-width: 1.6; }
.alt .mono { padding-top: 2px; }

/* ---------- Accounts and trips ---------- */
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #0C131A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #0C131A; } }
code { font-family: var(--f-mono); font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--sunken); }
.form-error { margin: 0; padding: 10px 12px; border-radius: var(--r-s); font-size: 14px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.auth { display: grid; gap: 14px; margin-top: 20px; }
.auth .hint { margin: -6px 0 0; }
.auth .btn.big { margin-top: 4px; }

.signin-hint { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.signin-hint .ic { color: var(--accent); }
.signin-hint a { color: var(--accent); font-weight: 600; }

.save-trip {
  display: grid; gap: 12px; margin: 0 0 22px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--r-l);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.save-trip-copy { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.save-trip-copy .ic { color: var(--accent); width: 22px; height: 22px; margin-top: 1px; }
.save-trip-copy b { display: block; color: var(--ink); font: 700 17px/1.25 var(--f-display); letter-spacing: -.01em; }
.account-head + .save-trip { margin-top: 20px; margin-bottom: 0; }

.trip-strip { margin: 0 0 22px; }
.trip-strip-head { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.trip-strip-head .ic { color: var(--accent); }
.trip-strip-head b { color: var(--ink); }
.trip-strip-head a { margin-left: auto; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.date-chips { display: flex; gap: 8px; margin: 12px -4px 0; padding: 2px 4px 4px; overflow-x: auto; scrollbar-width: none; }
.date-chips::-webkit-scrollbar { display: none; }
.date-chip {
  flex: none; display: grid; justify-items: center; gap: 1px; width: 54px; padding: 8px 0 7px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.date-chip small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.date-chip b { font: 700 19px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.date-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); margin-top: 2px; }
.date-chip .dot.on { background: var(--morning); }
.date-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.date-chip[aria-pressed="true"] small, .date-chip[aria-pressed="true"] b { color: var(--bg); }

.account-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  border: 0; border-radius: var(--r-m); background: none; padding: 6px; margin: -6px; text-align: left; font: inherit; color: inherit;
}
.account-head .eyebrow { margin-bottom: 2px; }
.account-head .sub { margin-top: 2px; }
.account-head:hover { background: var(--sunken); }
.account-chevron { margin-left: auto; flex: none; color: var(--muted); transform: scaleX(-1); }
.avatar {
  width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 800 20px/1 var(--f-display); letter-spacing: -.02em;
}
.avatar-img { object-fit: cover; }

/* ---------- Profile screen ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; margin-top: 10px; }
.profile-avatar-wrap { position: relative; width: 108px; height: 108px; margin-bottom: 10px; }
.profile-avatar, .profile-avatar-initials { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; display: block; }
.profile-avatar-initials {
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font: 800 36px/1 var(--f-display); letter-spacing: -.02em;
}
.avatar-edit, .avatar-remove {
  position: absolute; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
}
.avatar-edit { right: -2px; bottom: -2px; width: 36px; height: 36px; }
.avatar-remove { left: -2px; top: -2px; width: 26px; height: 26px; color: var(--muted); }
.profile-head h2 { margin: 4px 0 0; }
.profile-head .sub { margin: 0; }

.stat-hero {
  position: relative; overflow: hidden; margin-top: 22px; padding: 20px;
  border-radius: var(--r-l); color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--evening)));
}
.stat-hero-label { display: block; font-size: 13px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.stat-hero-num { display: block; font: 800 56px/1 var(--f-display); letter-spacing: -.03em; margin-top: 2px; }
.stat-hero-sub { display: block; margin-top: 2px; font-size: 14px; opacity: .9; }
.stat-hero-icons { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; opacity: .55; }
.stat-hero-icons .ic { width: 26px; height: 26px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stat-tile { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); display: grid; gap: 2px; }
.stat-tile .ic { color: var(--accent); width: 20px; height: 20px; }
.stat-tile b { font: 800 24px/1.2 var(--f-display); letter-spacing: -.02em; }
.stat-tile span { color: var(--muted); font-size: 13px; }

.places-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.place-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: left; font: inherit; color: inherit;
}
.place-row:hover { border-color: var(--accent); }
.place-flag { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: var(--sunken); }
.place-flag .ic { color: var(--muted); }
.place-row b { display: block; font-weight: 700; }
.place-row small { color: var(--muted); font-size: 12.5px; }
.place-row .trip-badge { margin-left: auto; flex: none; }
.place-row .account-chevron { margin-left: 2px; }

.explored-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.explored-row {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.explored-row.focused, .explored-row:hover { border-color: var(--c, var(--accent)); }
.explored-ic {
  width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface)); color: var(--c, var(--accent));
}
.explored-row b { display: block; font-weight: 700; }
.explored-row small { color: var(--muted); font-size: 12.5px; }

.group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.group-head .mono { color: var(--muted); }
.empty-note { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-m); color: var(--muted); font-size: 14px; }
.trips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.trip { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); display: grid; gap: 4px; }
.trip.now { border-color: color-mix(in srgb, var(--morning) 55%, var(--line)); }
.trip.past { background: transparent; }
.trip.past h3 { color: var(--muted); }
.trip-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.trip-badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sunken); color: var(--ink); }
.trip.now .trip-badge { background: var(--morning); color: #fff; }
.trip.upcoming .trip-badge { background: var(--accent-soft); color: var(--accent); }
.trip-open-tag { font-size: 12px; font-weight: 600; color: var(--accent); }
.trip-cc { margin-left: auto; color: var(--muted); }
.trip h3 { font-size: 22px; }
.trip-dates { margin: 0; color: var(--muted); font-size: 14px; }
.trip-hotel { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 14px; }
.trip-hotel .ic { color: var(--muted); }
.trip-days { display: flex; gap: 3px; margin-top: 10px; }
.trip-days span { flex: 1; height: 6px; border-radius: 3px; background: var(--sunken); }
.trip-days span.on { background: var(--morning); }
.trip-progress { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.trip .actions { align-items: center; }
.confirm-text { font-size: 13.5px; font-weight: 600; margin-right: auto; }
.account-foot { display: grid; justify-items: start; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.delete-account { display: grid; gap: 12px; width: 100%; padding: 14px; border-radius: var(--r-m); border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line)); }
.delete-account p { margin: 0; font-size: 14px; }

/* ---------- Paid placements ---------- */
.ad-label {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  padding: 2px 8px; margin-bottom: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--lunch) 18%, var(--surface)); color: var(--ink);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.hotel.sponsored { border-color: color-mix(in srgb, var(--lunch) 55%, var(--line)); background: color-mix(in srgb, var(--lunch) 6%, var(--surface)); }
.hotel .rank.ad { display: grid; place-items: start center; color: var(--lunch); }
.hotel .rank.ad .ic { width: 24px; height: 24px; fill: currentColor; stroke-width: 1; }
.hotel .ad-label { grid-column: 2; margin-bottom: 0; }
.sponsor-blurb { grid-column: 1 / -1; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.sponsor {
  display: grid; gap: 6px; margin-top: 12px; padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--lunch) 60%, var(--line)); border-radius: var(--r-m);
  background: color-mix(in srgb, var(--lunch) 6%, var(--surface));
}
.sponsor .ad-label { margin: 0; }
.sponsor-head { display: flex; align-items: baseline; gap: 10px; }
.sponsor-head b { font: 700 16px/1.2 var(--f-display); letter-spacing: -.01em; }
.sponsor-head .mono { margin-left: auto; color: var(--muted); white-space: nowrap; }
.sponsor p { margin: 0; font-size: 13.5px; color: var(--muted); }
.sponsor .row { margin-top: 4px; }

.featured {
  display: grid; gap: 8px; margin-top: 14px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--lunch) 50%, var(--line)); border-radius: var(--r-l);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--lunch) 16%, transparent), transparent 60%),
    var(--surface);
}
.featured-top { display: flex; align-items: center; gap: 10px; }
.featured-top .ad-label { margin: 0; }
.featured-brand { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.featured h3 { font-size: 20px; }
.featured p { margin: 0; font-size: 14px; color: var(--muted); max-width: 52ch; }
.featured-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.featured-facts li {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; background: var(--sunken); font-size: 12.5px; color: var(--ink);
}
.featured-facts .ic { width: 14px; height: 14px; color: var(--muted); }
.featured .row { margin-top: 4px; }

.ad-banner {
  position: fixed; z-index: 25; left: 0; right: 0;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
  min-height: 62px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px -12px rgb(0 0 0 / .35);
}
.ad-tag {
  position: absolute; top: 4px; left: max(12px, env(safe-area-inset-left, 0px));
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.ad-icon {
  width: 38px; height: 38px; flex: none; margin-top: 8px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tint) 16%, var(--surface)); color: var(--tint);
}
.ad-copy { display: grid; min-width: 0; flex: 1; margin-top: 8px; font-size: 12.5px; line-height: 1.3; }
.ad-copy b { font-size: 13.5px; }
.ad-copy span { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-cta { flex: none; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ad-close { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.ad-close:hover { background: var(--sunken); }
body.has-banner .panel { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 86px); }
body.has-banner .toast { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 76px); }
@media (min-width: 960px) {
  .ad-banner { position: sticky; bottom: 0; left: auto; right: auto; margin-top: 24px; padding-inline: 24px; }
  .ad-tag { left: 24px; }
  body.has-banner .panel { padding-bottom: 0; }
  body.has-banner .toast { bottom: 90px; }
}

/* ---------- Directions ---------- */
@media (max-width: 959px) { body.route-mode .map-wrap { height: 46svh; } } /* phones only; desktop map fills its column */
.route-head .back { margin: -10px 0 6px -10px; }
.mode-seg { margin-top: 16px; }
.mode-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.route-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 18px; }
.route-sum b { font: 800 36px/1 var(--f-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.route-sum span { color: var(--muted); font-size: 14px; }
.route-actions { margin-top: 14px; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; }
.step {
  display: flex; align-items: flex-start; gap: 14px; width: 100%;
  padding: 10px; border: 0; border-radius: var(--r-m); background: none; text-align: left;
}
.step:hover { background: var(--sunken); }
.step .turn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--ink); }
.step .turn .ic { width: 20px; height: 20px; }
.step .txt { display: grid; gap: 2px; min-width: 0; padding-top: 7px; font-weight: 600; font-size: 15px; line-height: 1.3; }
.step small { color: var(--muted); font-weight: 500; }
.step.active { background: var(--accent-soft); }
.step.active .turn { background: var(--accent); color: var(--accent-ink); }

/* ---------- Stay screen ---------- */
.hotel-now {
  margin-top: 20px; padding: 18px;
  border-radius: var(--r-l); background: var(--ink); color: var(--bg);
}
.hotel-now .eyebrow { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.hotel-now h3 { font-size: 24px; }
.hotel-now p { margin: 4px 0 0; color: color-mix(in srgb, var(--bg) 75%, transparent); font-size: 14px; }
.hotel-now .row { margin-top: 16px; }
.hotel-now .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.hotel-now .btn.primary { background: var(--bg); color: var(--ink); border-color: var(--bg); }

.hotels { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: rank; }
.hotel {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
}
.hotel .rank { grid-row: span 2; font: 800 26px/1 var(--f-display); color: var(--accent); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hotel .kind { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.hotel .stars { color: var(--lunch); letter-spacing: 1px; }
.hotel .facts, .hotel .actions, .hotel-rating, .hotel-amen { grid-column: 1 / -1; }
.hotel-amen .amen { margin-top: 2px; }
.hotel .facts li.hit { --slot: var(--accent); }
.hotel.selected { border-color: var(--accent); }

/* ---------- States ---------- */
.loading { margin-top: 26px; display: grid; gap: 12px; }
.loading p { margin: 0; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.skel { height: 118px; border-radius: var(--r-l); background: linear-gradient(90deg, var(--sunken), var(--surface), var(--sunken)); background-size: 200% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }
.error {
  margin-top: 22px; padding: 16px; border-radius: var(--r-m);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.error p { margin: 0 0 12px; }
.toast {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 14px);
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
}
@media (min-width: 960px) { .toast { left: 240px; bottom: 24px; } }

/* ---------- Photos ---------- */
.photos {
  display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; padding-bottom: 2px;
}
.photo-thumb {
  flex: none; width: 76px; height: 76px; border-radius: var(--r-s); border: 1px solid var(--line);
  background-color: var(--sunken); background-size: cover; background-position: center; padding: 0; cursor: pointer;
}
.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgb(8 12 18 / .92);
  display: flex; align-items: center; justify-content: center;
}
.lb-img { max-width: min(92vw, 1000px); max-height: 82vh; border-radius: var(--r-m); object-fit: contain; }
.lb-close, .lb-nav {
  position: absolute; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff;
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
}
.lb-close:hover, .lb-nav:hover { background: rgb(255 255 255 / .22); }
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-next-ic { transform: rotate(180deg); }
.lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / .12); color: #fff; font-size: 13px;
}
@media (max-width: 480px) { .lb-nav { width: 38px; height: 38px; } .lb-close { width: 38px; height: 38px; } }

/* ---------- Map markers ---------- */
.leaflet-container { font-family: var(--f-body); background: var(--sunken); }
.leaflet-tile-pane { filter: var(--tiles); }
.mk {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff;
  border: 2px solid #fff; box-shadow: 0 4px 10px rgb(0 0 0 / .25);
  transition: transform .2s ease, background .2s ease;
}
/* The place you're looking at: ink-coloured pin, enlarged, with a saffron ring. */
.mk.sel {
  background: var(--ink); color: var(--bg); transform: rotate(-45deg) scale(1.35);
  box-shadow: 0 0 0 3px #F4B23C, 0 8px 18px rgb(0 0 0 / .4);
}
.mk.sel .ic { color: var(--bg); }

[data-focus].hotel, [data-focus].stop-card { cursor: pointer; }
.hotel.focused, .stop-card.focused { outline: 2px solid var(--ink); outline-offset: 2px; }
.hotel.focused .rank { color: var(--ink); }
.mk span { transform: rotate(45deg); font: 700 13px/1 var(--f-display); }
.mk.home { background: var(--ink); border-radius: 9px; transform: none; }
.mk.home span { transform: none; }
.mk.home .ic { color: var(--bg); width: 16px; height: 16px; }
.mk.center { width: 16px; height: 16px; border-radius: 50%; transform: none; background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
.mk.start { width: 16px; height: 16px; border-radius: 50%; transform: none; background: var(--surface); border: 4px solid var(--ink); }
.mk.user { width: 18px; height: 18px; border-radius: 50%; transform: none; background: #2F7BFF; border: 3px solid #fff; box-shadow: 0 0 0 7px rgb(47 123 255 / .25); }
.mk .ic { width: 14px; height: 14px; color: #fff; }
.leaflet-popup-content-wrapper { border-radius: 12px; background: var(--surface); color: var(--ink); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-popup-content { margin: 10px 14px; font-size: 13.5px; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
/* Sits above the tiles (z-index 200) but below markers and popups (600, 700), and never
   intercepts clicks — only the "explored" map adds this pane. */
.leaflet-fog-pane { z-index: 350; pointer-events: none; }
.fog-canvas { position: absolute; top: 0; left: 0; }
.pin-label {
  padding: 3px 9px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg);
  font: 600 12px/1.3 var(--f-body); box-shadow: var(--shadow);
}
.pin-label::before { display: none; }

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