:root {
  --bg: #fbf7f0;
  --ink: #23262f;
  --ink-2: #646876;
  --ink-3: #9a9ca6;
  --line: #ebe4d8;
  --coral: #ff8a6b;
  --coral-ink: #c4502f;
  --butter: #ffd66b;
  --butter-ink: #8a6a00;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --pad: max(12px, env(safe-area-inset-left));
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: radial-gradient(120% 90% at 50% 35%, #fffdf8 0%, var(--bg) 60%, #f3ebdd 100%); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; touch-action: none; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; }

/* Floating chrome */
.bar { position: fixed; top: max(10px, env(safe-area-inset-top)); left: var(--pad); right: var(--pad); display: flex; align-items: center; gap: 10px; z-index: 5; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand svg { width: 38px; height: 38px; display: block; filter: drop-shadow(0 2px 0 rgba(35, 38, 47, 0.15)); }
.title { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 8px 6px 14px; box-shadow: 0 3px 0 rgba(35, 38, 47, 0.18); }
.title b { font: 600 16px/1 var(--serif); white-space: nowrap; }
.title select { border: 0; background: #f4eee3; border-radius: 999px; padding: 4px 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.actions { margin-left: auto; display: flex; gap: 8px; }
.round { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 rgba(35, 38, 47, 0.18); }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(35, 38, 47, 0.18); }
.round svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round.has svg { fill: var(--butter); stroke: var(--butter-ink); }
.round i { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--coral); color: #fff; font: 600 11px/19px var(--sans); font-style: normal; }

.legend { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: var(--pad); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; z-index: 4; }
@media (max-width: 1100px) { .legend { display: none; } }
.legend span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px 3px 6px; font-size: 12px; color: var(--ink-2); }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--c); border: 1px solid rgba(35, 38, 47, 0.25); }

/* Clock */
.clock { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); width: min(640px, calc(100% - 24px)); background: #fff; border: 1.5px solid var(--ink); border-radius: 22px; padding: 10px 12px 8px; box-shadow: 0 4px 0 rgba(35, 38, 47, 0.18); z-index: 5; }
.days { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 6px; }
.days::-webkit-scrollbar { display: none; }
.days button { flex: 1 0 auto; border: 0; background: none; border-radius: 12px; padding: 4px 8px; cursor: pointer; line-height: 1.1; }
.days button small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.days button b { font: 600 17px/1.15 var(--serif); }
.days button.on { background: var(--ink); color: #fff; }
.days button.on small { color: rgba(255, 255, 255, 0.7); }
.scrub { display: flex; align-items: center; gap: 10px; }
.play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--coral); display: grid; place-items: center; cursor: pointer; }
.play svg { width: 18px; height: 18px; fill: #fff; }
.play.on { background: var(--ink); }
.track { position: relative; flex: 1; height: 38px; }
.ticks { position: absolute; left: 9px; right: 9px; top: 6px; height: 8px; }
.ticks i { position: absolute; top: 0; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--c); opacity: 0.9; }
#time { position: absolute; inset: 14px 0 0; width: 100%; height: 20px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
#time::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #f0e9dd; }
#time::-moz-range-track { height: 6px; border-radius: 3px; background: #f0e9dd; }
#time::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 0 rgba(35, 38, 47, 0.2); }
#time::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
#clock { flex: none; width: 64px; text-align: right; font: 600 20px/1 var(--serif); font-variant-numeric: tabular-nums; }
.summary { margin: 6px 2px 0; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Labels in the scene */
.tag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font: 600 11.5px/1 var(--sans); padding: 5px 8px; border-radius: 999px; background: #fff; border: 1.5px solid var(--ink); box-shadow: 0 2px 0 rgba(35, 38, 47, 0.15); pointer-events: auto; cursor: pointer; }
.tag.building { background: var(--ink); color: #fff; border-color: var(--ink); font-size: 11px; letter-spacing: 0.04em; cursor: default; pointer-events: none; }
.tag em { font-style: normal; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.tag.landmark { background: rgba(255, 255, 255, 0.82); border: 1px solid #c9bfae; color: var(--ink-2); font-weight: 500; font-size: 11px; box-shadow: none; pointer-events: none; }
.tag.pin { background: var(--butter); border-color: var(--butter-ink); color: #3d2f00; }
.tag.step { background: var(--coral); border-color: var(--coral-ink); color: #fff; min-width: 22px; text-align: center; }

/* Sheet */
.sheet { position: fixed; z-index: 8; right: var(--pad); top: calc(max(10px, env(safe-area-inset-top)) + 54px); bottom: 170px; width: min(400px, calc(100% - 24px)); background: #fff; border: 1.5px solid var(--ink); border-radius: 22px; box-shadow: 0 4px 0 rgba(35, 38, 47, 0.18); display: flex; flex-direction: column; overflow: hidden; animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.grab { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #f4eee3; cursor: pointer; z-index: 2; }
.grab::before, .grab::after { content: ""; position: absolute; left: 9px; top: 14px; width: 12px; height: 2px; background: var(--ink); border-radius: 1px; transform: rotate(45deg); }
.grab::after { transform: rotate(-45deg); }
#sheetBody { overflow-y: auto; padding: 16px 16px 20px; flex: 1; overscroll-behavior: contain; touch-action: pan-y; }
.sheet h2 { font: 600 21px/1.2 var(--serif); margin: 0 36px 4px 0; letter-spacing: -0.01em; }
.sheet .where { color: var(--ink-2); font-size: 13px; margin-bottom: 12px; }
.sheet h3 { font: 600 11px/1 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 16px 0 8px; }
.item { display: grid; grid-template-columns: 6px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item .bar-c { align-self: stretch; border-radius: 3px; background: var(--c); }
.item .t { font-weight: 600; line-height: 1.35; }
.item .m { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.item button.link { border: 0; background: none; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.item button.link:hover .t { text-decoration: underline; }
.badge { display: inline-block; font: 600 10.5px/1 var(--sans); padding: 3px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.badge.oral { background: #ffe6de; color: var(--coral-ink); }
.badge.spot { background: var(--ink); color: #fff; }
.star { border: 0; background: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.star svg { width: 19px; height: 19px; fill: none; stroke: #c9c4bb; stroke-width: 1.7; stroke-linejoin: round; }
.star.on svg { fill: var(--butter); stroke: var(--butter-ink); }
.find { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--bg); font-size: 15px; outline: none; }
.find:focus { border-color: var(--ink); }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.toggles button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.toggles button.on { border-color: var(--ink); font-weight: 600; }
.more { display: block; width: 100%; margin-top: 10px; border: 1px dashed var(--line); background: none; border-radius: 12px; padding: 8px; cursor: pointer; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: 13px; }
.detail { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.detail a { color: var(--coral-ink); font-weight: 600; text-decoration: none; margin-right: 10px; }
.walk { margin: 2px 0 2px 16px; font-size: 12px; color: var(--coral-ink); }
.cta { display: inline-block; margin-top: 10px; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 600; cursor: pointer; }

/* Intro */
.intro { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(251, 247, 240, 0.55); backdrop-filter: blur(3px); padding: 20px; }
.intro-card { max-width: 400px; background: #fff; border: 1.5px solid var(--ink); border-radius: 24px; padding: 22px 22px 18px; box-shadow: 0 5px 0 rgba(35, 38, 47, 0.18); animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.intro-card h1 { font: 600 24px/1.15 var(--serif); margin: 0 0 10px; }
.intro-card p { margin: 0 0 10px; color: var(--ink-2); }
.intro-card button { background: var(--coral); color: #fff; border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 600; cursor: pointer; box-shadow: 0 3px 0 var(--coral-ink); margin: 4px 0 12px; }
.intro-card small { display: block; color: var(--ink-3); font-size: 11.5px; }

@media (max-width: 640px) {
  .brand { display: none; }
  .bar { gap: 8px; }
  .title { min-width: 0; padding: 5px 6px 5px 12px; }
  .title b { font-size: 14px; }
  .title select { max-width: 112px; }
  .round { width: 40px; height: 40px; }
  .legend { display: none; }
  .tag { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .tag.landmark { font-size: 10px; padding: 3px 6px; }
  .sheet { left: 8px; right: 8px; width: auto; top: auto; bottom: 0; height: 62vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .clock { bottom: max(8px, env(safe-area-inset-bottom)); }
  body.sheet-open .clock { display: none; }
}
