/* TasteWalk — dark glass panels over our own map.
   The panels stay dark day and night; only the map palette follows Berlin's clock. */
:root {
  --glass: rgba(16, 21, 36, 0.82);
  --glass-2: rgba(255, 255, 255, 0.06);
  --ink: #eef2fb;
  --muted: #98a3bd;
  --line: rgba(255, 255, 255, 0.1);
  --grad: linear-gradient(135deg, #4f8cff, #7c5cff);
  --accent: #4f8cff;
  --route: #ffd166;
  --yes: #34d399;
  --no: #98a3bd;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d1220; color: var(--ink); font: 15px/1.45 var(--sans); }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#map { position: fixed; inset: 0; background: #0d1220; }
html[data-theme="day"] #map { background: #f1ede4; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px;
  background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line);
  font: 800 18px/1 var(--sans); letter-spacing: -0.01em;
}
.brand::before { content: "👟"; font-size: 16px; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chip {
  font-size: 12px; font-weight: 600; white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line);
}
.mode { display: flex; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); padding: 3px; }
.mode button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); }
.mode button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(79, 140, 255, 0.4); }


/* ---------- panels: place card · sidebar · course chips + dock ---------- */
.glass { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line); }
.kicker { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
h2 { font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; }
.blurb { margin: 0 0 8px; color: #d6dcea; font-size: 14px; }
.src { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.src a { color: var(--muted); }
.back { display: block; margin: 0 0 6px; padding-left: 0; }
.why { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-style: italic; }
.link { border: 0; background: none; padding: 6px 4px; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.hint { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }

/* place card — top-left on desktop */
.card {
  position: fixed; z-index: 610; left: 16px; top: 76px; width: 340px;
  max-height: calc(100vh - var(--bottom-h, 160px) - 92px); overflow: auto;
  background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.card-close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10, 14, 24, 0.7); color: var(--ink); font-size: 13px;
}
.gallery { display: flex; height: 160px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--glass-2); }
.gallery::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide small { position: absolute; left: 8px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(10, 14, 24, 0.7); color: var(--ink); font-size: 10px; }
.slide.ig-slide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af); font-weight: 800; font-size: 16px; }
.slide.ig-slide span { font-size: 12px; font-weight: 600; opacity: 0.9; }
.gal-nav { position: absolute; top: 62px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(10, 14, 24, 0.7); color: var(--ink); font-size: 22px; line-height: 1; }
.gal-nav.prev { left: 8px; }
.gal-nav.next { right: 8px; }
.gal-nav[hidden] { display: none; }
.gallery-count { position: absolute; top: 132px; right: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(10, 14, 24, 0.7); font-size: 11px; color: var(--ink); pointer-events: none; }
.card-body { padding: 14px 16px 16px; }
.actions { display: flex; justify-content: center; gap: 18px; margin: 12px 0 2px; }
.act {
  width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--glass-2);
  font-size: 24px; line-height: 1; display: grid; place-items: center; align-content: center; transition: transform 0.08s;
}
.act small { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; margin-top: 2px; }
.act:active { transform: scale(0.94); }
.act.no { color: var(--no); }
.act.yes { color: var(--yes); border-color: var(--yes); box-shadow: 0 0 18px rgba(52, 211, 153, 0.25); }
.act.cam { background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px rgba(79, 140, 255, 0.4); }

/* sidebar — the course's places */
.side {
  position: fixed; z-index: 600; right: 16px; top: 110px; bottom: 40px; width: 330px;
  display: flex; flex-direction: column;
  background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.side-closed .side { display: none; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
.side-head #sideTitle { flex: 1; }
.side-fold { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass-2); }
.side-count { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--glass-2); color: var(--muted); }
.side-list { flex: 1; overflow: auto; padding: 6px; }
.side-note { padding: 0 14px 10px; margin: 6px 0 0; }
.side-open {
  position: fixed; z-index: 600; right: 16px; top: 110px; padding: 8px 12px; border-radius: 12px;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line); font-weight: 700; font-size: 13px;
}
.spot {
  display: grid; grid-template-columns: 48px 1fr auto auto; align-items: center; gap: 10px;
  padding: 8px; border-radius: 14px; cursor: pointer; border: 1px solid transparent;
}
.spot:hover { background: var(--glass-2); }
.spot img, .spot i {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover; display: grid; place-items: center;
  background: var(--glass-2); font-style: normal; font-size: 20px;
}
.spot-text { min-width: 0; }
.spot-text b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-text small { color: var(--muted); font-size: 12px; }
.mini {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass-2);
  font-size: 13px; display: grid; place-items: center;
}
.mini.no { color: var(--no); }
.mini.yes { color: var(--yes); }
.spot.now { border-color: var(--route); background: rgba(255, 209, 102, 0.08); }
.spot.liked .mini.yes { background: var(--yes); color: #062417; border-color: var(--yes); }
.spot.skipped { opacity: 0.45; }
.spot.skipped .mini.no { background: var(--no); color: #0d1220; }
.spot.visited { opacity: 0.6; }

/* bottom: course chips + dock (centred in the space left of the sidebar) */
.bottom {
  position: fixed; z-index: 600; left: 16px; right: 362px; bottom: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.side-closed .bottom { right: 16px; }
.bottom > * { pointer-events: auto; }
.course-bar { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.chip-course {
  flex: none; display: grid; gap: 2px; text-align: center; padding: 10px 16px; border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line);
}
.chip-course b { font-size: 14px; font-weight: 800; }
.chip-course span { font-size: 11px; color: var(--muted); }
.chip-course.on { background: var(--grad); border-color: transparent; box-shadow: 0 6px 20px rgba(79, 140, 255, 0.45); }
.chip-course.on span { color: rgba(255, 255, 255, 0.85); }
.chip-course:disabled { opacity: 0.6; cursor: progress; }
/* desktop: the four chips share the row instead of hiding the last one off the edge */
@media (min-width: 900px) { .chip-course { flex: 0 1 auto; min-width: 0; padding: 10px 12px; } }
.dock {
  display: flex; gap: 6px; padding: 8px; border-radius: 18px; max-width: 100%;
  background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--line);
}
.btn {
  flex: none; padding: 10px 14px; border-radius: 12px; border: 0; background: var(--glass-2);
  font-weight: 700; font-size: 13px; white-space: nowrap;
}
.btn:disabled { opacity: 0.35; cursor: default; }
.btn.primary { width: auto; background: var(--grad); color: #fff; padding: 10px 18px; box-shadow: 0 6px 18px rgba(79, 140, 255, 0.4); }
.mob-only { display: none; }

.recenter {
  position: fixed; left: 16px; bottom: calc(var(--bottom-h, 160px) + 4px); z-index: 600;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(12px); font-size: 18px; color: var(--ink);
}

/* phones: list becomes a drawer above the dock; the card sits above the dock too */
@media (max-width: 899px) {
  .side { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(var(--bottom-h, 150px) - 8px); max-height: 46vh; display: none; }
  .drawer-open .side { display: flex; }
  .side-fold, .side-open { display: none !important; }
  .bottom { left: 8px; right: 8px; bottom: 8px; gap: 8px; }
  .side-closed .bottom { right: 8px; }
  .dock { width: 100%; overflow-x: auto; justify-content: space-between; }
  .btn { padding: 9px 11px; }
  .btn.primary { padding: 9px 12px; }
  .mob-only { display: block; }
  .card { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(var(--bottom-h, 150px) - 8px); max-height: 52vh; }
  .gallery { height: 120px; }
  .gallery-count { top: 92px; }
  .gal-nav { top: 42px; }
  .drawer-open .card { display: none; }
}


/* ---------- map marks ---------- */
.stop { background: none; border: 0; padding: 0; }
.stop b {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #161d2e; border: 2px solid var(--route); font: 800 12px/1 var(--sans); color: var(--route);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
}
.stop.next b { background: var(--route); color: #1a1406; transform: scale(1.2); box-shadow: 0 0 18px rgba(255, 209, 102, 0.8); }
.stop.liked b { background: var(--yes); border-color: var(--yes); color: #062417; box-shadow: 0 0 14px rgba(52, 211, 153, 0.6); }
.stop.skipped b, .stop.visited b { opacity: 0.4; box-shadow: none; }
.you { pointer-events: none; }
.you span {
  display: block; padding: 4px 10px; border-radius: 999px; background: var(--grad); border: 2px solid #fff;
  font: 900 10px/1.2 var(--sans); letter-spacing: 0.06em; color: #fff; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.5);
}

/* ---------- snap & post ---------- */
.modal { position: fixed; inset: 0; z-index: 900; background: rgba(5, 8, 16, 0.6); display: grid; place-items: end center; }
.post-card {
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: #121828; border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
}
.post-card img { width: 100%; max-height: 42vh; object-fit: cover; border-radius: 14px; display: block; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.tag-chip.on { background: var(--grad); border-color: transparent; color: #fff; }
.post-label { display: block; margin: 12px 0 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.post-card textarea, .post-in {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--glass-2);
  font: 14px/1.45 var(--sans); color: var(--ink); resize: vertical;
}
.hint { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.primary { width: 100%; padding: 13px; border: 0; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 700; font-size: 15px; }
.row { display: flex; justify-content: space-between; margin-top: 8px; }

/* ---------- toast + loading ---------- */
.toast {
  position: fixed; left: 50%; top: calc(110px + env(safe-area-inset-top)); z-index: 950; transform: translate(-50%, -8px);
  max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--line); color: var(--ink); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.overlay { position: fixed; inset: 0; z-index: 1000; background: #0d1220; display: grid; place-content: center; text-align: center; gap: 10px; }
.overlay p { color: var(--muted); margin: 0; }
.overlay.hidden { display: none; }
.tap-start { margin-top: 8px; padding: 14px 28px; font-size: 17px; }

/* ---------- consent ---------- */
.consent {
  position: fixed; z-index: 800; left: 50%; top: 76px; transform: translateX(-50%); width: min(460px, calc(100% - 16px));
  padding: 16px 18px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.consent p { margin: 8px 0 12px; font-size: 13px; color: #d6dcea; }
.consent .row { display: flex; justify-content: flex-end; gap: 8px; margin: 0; }
.trip-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.trip-pane .side-list { flex: none; overflow: visible; }   /* the pane scrolls as one: results + saved list */
.trip-pane #tripList { flex: 1; }
.trip-search { display: flex; gap: 6px; padding: 8px 10px 4px; }
.trip-search input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--glass-2); color: var(--ink); font: 14px var(--sans);
}
.trip-search .btn { flex: none; width: auto; padding: 9px 14px; }
.side-note b { color: var(--ink); }
.side-note .link { padding: 0; font-size: 12px; }

/* ---------- sidebar tabs + the guide's log ---------- */
.side-head { padding: 8px 10px; gap: 8px; }
.tabs { flex: 1; display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab {
  flex: none; padding: 7px 10px; border-radius: 10px; border: 0; background: none; color: var(--muted);
  font-weight: 800; font-size: 13px; white-space: nowrap;
}
.tab.on { background: var(--glass-2); color: var(--ink); }
.pane[hidden] { display: none !important; }
.buddy { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px 0; }
.msgs { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px; }
.msg { flex: none; max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.msg.buddy { align-self: flex-start; background: var(--glass-2); border-bottom-left-radius: 4px; }
.msg.typing { align-self: flex-start; color: var(--muted); font-style: italic; background: none; padding: 4px 8px; }
.msg-act { display: inline-block; margin: 8px 6px 0 0; padding: 7px 12px; border-radius: 10px; border: 0; background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; }
.msg-act:disabled { opacity: 0.5; }
.buddy .hint { margin: 2px 0 8px; font-size: 11px; }
.empty { padding: 12px; }
.msg-src { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
