:root {
  --bg: #0a0d12;
  --bg-elev: #0a0d12;
  --ink: #f3f4f7;
  --ink-soft: #a8acb6;
  --muted: #868c98;
  --accent: #ffffff;
  --accent-deep: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.07);
  --ink-read: #d6d9e0;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 999px;
  --transition: 260ms cubic-bezier(.22, .61, .18, 1);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.6);
  --surface: #0f131a;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --mono: "Space Grotesk", -apple-system, sans-serif;
  --map-bg: #070910;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--map-bg);
  -webkit-font-smoothing: antialiased;
}

/* one ink focus ring for every keyboard-reachable control (buttons, pills, the 310 map pins,
   menu options, links) — mouse clicks stay quiet. Inputs keep their own border-focus. */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { position: relative; height: 100dvh; width: 100vw; overflow: hidden; }

#map { position: absolute; inset: 0; background: var(--map-bg); }
#map canvas, .maplibregl-canvas { filter: brightness(.66) contrast(1.12) saturate(.12); }

/* atmosphere — a still neutral vignette + film grain. No neon, no pulse, no drifting fog:
   the map holds like ink on a printed page, not a living HUD. */
.map-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 88% at 50% 42%, rgba(6,8,14,0) 28%, rgba(3,4,9,.42) 66%, rgba(0,1,4,.8) 100%);
}
/* when a visitor asks their OS for stillness, be still — silence every entrance + feedback animation */
@media (prefers-reduced-motion: reduce) {
  .place, .dark-scrim, .dw-card, .dw-finale, .modal-card, .locate-ctrl button.locating { animation: none; }
}
.grain {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .07; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Panel (mobile: bottom sheet) ---- */
.panel {
  position: absolute; z-index: 2;
  left: 0; right: 0; bottom: 60px;
  max-height: 62%;
  background: #0d1016;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden;
}
/* aged-paper material: fine grayscale grain for tooth — flat, uniform, no luminance gradient (no glow/shadow/color).
   Shared by the panel + the icon rail so they read as one continuous surface. */
.panel > *, .rail > * { position: relative; z-index: 1; }
.rail { overflow: hidden; }
.panel::before, .rail::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: .10; mix-blend-mode: screen; /* screen lifts the grain into visible tooth on a near-black surface */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
body.mode-guide .mapbar { display: none; }
.sheet-handle { display: none; }

.brand { display: none; align-items: center; gap: 12px; padding: 20px 24px 14px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.18); color: var(--ink); flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text h1 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1; }
.tagline { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* ---- City selector (top of panel) ---- */
.city-bar { position: relative; flex: 0 0 auto; padding: 14px 24px 4px; }
.city-select {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-full);
  padding: 7px 12px 7px 13px; cursor: pointer; transition: var(--transition);
}
.city-select:hover { border-color: rgba(255,255,255,.3); }
.city-select > svg { width: 15px; height: 15px; stroke-width: 1.8; }
.city-caret { width: 14px; height: 14px; stroke-width: 2; opacity: .65; transition: transform var(--transition); }
.city-select[aria-expanded="true"] .city-caret { transform: rotate(180deg); }
.city-menu {
  position: absolute; z-index: 6; top: calc(100% + 2px); left: 24px; min-width: 230px;
  background: #11151d; border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 8px;
}
.city-menu[hidden] { display: none; }
.city-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink-soft); padding: 9px 11px; border-radius: var(--radius-sm); transition: var(--transition);
}
.city-opt:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.city-opt.current { background: rgba(255,255,255,.05); color: var(--ink); }
.city-count { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: 0 0 auto; }

/* ---- State-chip strip ---- */
.state-chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.state-chips::-webkit-scrollbar { display: none; }
.state-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-full); padding: 6px 14px; cursor: pointer; transition: var(--transition);
}
.state-chip svg { width: 14px; height: 14px; stroke-width: 1.9; }
.state-chip:hover { border-color: rgba(255,255,255,.3); color: var(--ink); }
.state-chip.current { background: var(--accent); color: #0a0d12; border-color: var(--accent); }

.panel-body { position: relative; flex: 1; display: flex; flex-direction: column; padding: 0 24px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#detail { flex: 1; display: flex; flex-direction: column; }

/* ---- Empty state — title-card lockup ---- */
.detail-intro { display: flex; flex-direction: column; flex: 1; padding: 16px 0 8px; text-align: center; }
.intro-mark {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px;
  color: var(--ink); border: 1px solid rgba(255,255,255,.16); border-radius: 50%;
}
.intro-mark svg { width: 23px; height: 23px; stroke-width: 1.5; }
.intro-name {
  font-family: var(--display); font-size: 28px; font-weight: 700;
  letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; line-height: 1;
  margin-bottom: 10px; color: var(--ink);
}
.intro-tag { font-family: var(--display); font-size: 14px; font-weight: 500; color: var(--ink-soft); letter-spacing: .01em; margin-bottom: 20px; }
/* first-open welcome (B+C): verbs line, two doors, tonight's haunts */
.intro-welcome { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 7% 0 10px; }
.intro-verbs { font-size: 15px; line-height: 1.65; color: var(--ink-soft); max-width: 34ch; margin: 14px auto 24px; }
.intro-doors { display: flex; flex-direction: column; gap: 9px; width: 100%; max-width: 290px; }
.intro-doors .locate-cta { width: 100%; margin: 0; justify-content: center; }
.intro-door2 { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); background: transparent; border: 1px dashed rgba(255,255,255,.2); border-radius: var(--radius-full); padding: 12px; cursor: pointer; transition: var(--transition); }
.intro-door2 svg { width: 15px; height: 15px; }
.intro-door2:hover { color: var(--ink); border-color: rgba(255,255,255,.4); border-style: solid; }
.intro-featured { width: 100%; margin-top: 30px; text-align: left; }
.intro-featured .section-label { margin-bottom: 8px; }
.intro-featured .search-result { padding: 11px 9px; }
.intro-featured .sr-name { font-size: 15px; }
.intro-featured .sr-meta { font-size: 12.5px; }
.cities-title { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--ink); }
.intro-rule { width: 34px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); margin-bottom: 20px; }
.intro-prompt { font-size: 15px; font-weight: 500; color: var(--ink-soft); letter-spacing: .01em; }
.intro-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 10px; letter-spacing: .2em; text-transform: uppercase; }

/* ---- Place detail ---- */
.place { animation: rise 420ms cubic-bezier(.22,.61,.18,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.place-detail { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); background: none; border: none; cursor: pointer; padding: 4px 0;
  transition: var(--transition);
}
.detail-back svg { width: 14px; height: 14px; stroke-width: 1.7; }
.detail-back:hover { color: var(--ink); }
/* icon-only back on the place detail */
.icon-back { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: -7px; color: var(--ink-soft); background: none; border: none; border-radius: var(--radius-md); cursor: pointer; padding: 0; transition: var(--transition); }
.icon-back svg { width: 20px; height: 20px; stroke-width: 1.8; }
.icon-back:hover { background: rgba(255,255,255,.06); color: var(--ink); }
/* quick add-to-tour toggle at the top of the card — no scrolling needed */
/* place-detail actions: Save (favorite) + Plan (add-to-plan menu) */
.detail-acts { display: flex; align-items: center; gap: 8px; }
.act-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-full); padding: 7px 13px; cursor: pointer; transition: var(--transition);
}
.act-btn svg { width: 14px; height: 14px; stroke-width: 2; }
.act-btn:hover { border-color: rgba(255,255,255,.4); }
.act-save.on { background: var(--accent); color: #0a0d12; border-color: var(--accent); }
.act-save.on svg { fill: #0a0d12; }
.act-plan.on { border-color: rgba(255,255,255,.5); }
.act-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 auto; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; transition: var(--transition); }
.act-icon svg { width: 16px; height: 16px; stroke-width: 1.9; }
.act-icon:hover { border-color: rgba(255,255,255,.4); color: var(--ink); }
.act-icon.on { background: var(--accent); color: #0a0d12; border-color: var(--accent); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(8px); background: #11151d; border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: var(--radius-full); box-shadow: 0 8px 24px rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.act-plan-wrap { position: relative; }
.plan-menu {
  position: absolute; z-index: 7; top: calc(100% + 6px); right: 0; min-width: 200px;
  background: #11151d; border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.55); padding: 6px;
}
.plan-menu[hidden] { display: none; }
.plan-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--ink-soft); padding: 8px 9px; border-radius: var(--radius-sm); transition: var(--transition);
}
.plan-opt:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.plan-opt-check { display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 auto; opacity: 0; }
.plan-opt-check svg { width: 14px; height: 14px; stroke-width: 2.4; }
.plan-opt.on { color: var(--ink); }
.plan-opt.on .plan-opt-check { opacity: 1; }
.plan-opt-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-opt-n { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.plan-opt-new { color: var(--ink); border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; padding-top: 11px; }
.plan-opt-new svg { width: 14px; height: 14px; stroke-width: 2; }

/* Favorites list */
.fav-row { display: flex; align-items: center; gap: 4px; }
.fav-row .search-result { flex: 1; min-width: 0; }
.fav-remove { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; background: none; border: none; cursor: pointer; color: var(--accent); border-radius: var(--radius-md); transition: var(--transition); }
.fav-remove svg { width: 17px; height: 17px; fill: var(--accent); stroke: var(--accent); }
.fav-remove:hover { background: rgba(255,255,255,.06); }

/* Plans list */
.plan-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.plan-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 16px; cursor: pointer; transition: var(--transition); color: var(--ink-soft);
}
.plan-card:hover { border-color: rgba(255,255,255,.3); }
.plan-card > svg { width: 17px; height: 17px; stroke-width: 1.8; flex: 0 0 auto; color: var(--muted); }
.plan-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plan-card-name { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--ink); }
.plan-card-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.new-plan {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px dashed rgba(255,255,255,.22);
  border-radius: var(--radius-full); padding: 13px; cursor: pointer; transition: var(--transition);
}
.new-plan svg { width: 15px; height: 15px; stroke-width: 2; }
.new-plan:hover { border-color: rgba(255,255,255,.45); border-style: solid; }

/* starter tours */
.tour-view .section-label { margin: 16px 0 8px; }
.tour-view .yours-label { margin-top: 24px; }
.starter-use { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line); border-radius: var(--radius-full); padding: 5px 11px; transition: var(--transition); }
.plan-card.starter:hover .starter-use { color: #0a0d12; background: var(--accent); border-color: var(--accent); }
.starter-hint { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 14px 0 4px; }

/* operator credit: "by [Operator]" on a starter card, attribution row in the tour */
.plan-card-by { font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft); letter-spacing: .04em; margin-top: 2px; }
.tour-credit { font-size: 12.5px; color: var(--muted); margin: -10px 0 16px; line-height: 1.5; }
.tour-credit-name { color: var(--ink-soft); font-weight: 600; }
.tour-credit-link { color: var(--ink); text-decoration: none; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,.25); }
.tour-credit-link:hover { border-bottom-color: var(--ink); }

/* "Add stops from favorites" picker (inline, inside a tour) */
.add-wrap { width: 100%; }
.add-stops.on { border-style: solid; border-color: rgba(255,255,255,.4); }
.add-menu { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px; max-height: 240px; overflow-y: auto; }
.add-menu[hidden] { display: none; }
.add-empty { font-size: 13px; color: var(--muted); padding: 14px; text-align: center; line-height: 1.5; }

/* Plan detail header: back · editable name · delete */
.plan-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.plan-title {
  flex: 1; min-width: 0; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  color: var(--ink); background: transparent; border: none; border-bottom: 1px solid transparent; padding: 2px 0; transition: var(--transition);
}
.plan-title:hover { border-bottom-color: rgba(255,255,255,.14); }
.plan-title:focus { outline: none; border-bottom-color: rgba(255,255,255,.4); }
.plan-del { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: var(--muted); background: none; border: none; border-radius: var(--radius-md); cursor: pointer; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; transition: var(--transition); }
.plan-del svg { width: 16px; height: 16px; stroke-width: 1.8; }
.plan-del:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.plan-del.confirm { width: auto; padding: 0 11px; color: #ff7a7a; border: 1px solid rgba(255,122,122,.5); }
/* starter/operator tours: removable from your list, but not a destructive delete */
.plan-del.soft.confirm { color: var(--ink-soft); border-color: rgba(255,255,255,.28); }
.plan-title[readonly] { cursor: default; }
.plan-title[readonly]:hover { border-bottom-color: transparent; }

.place-kicker {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-soft); display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.place-kicker svg { width: 14px; height: 14px; stroke-width: 1.6; }
.place h2 { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; color: var(--ink); }
.place-story { font-family: var(--serif); font-size: 17px; line-height: 1.8; margin-top: 16px; color: var(--ink-read); }
.place-addr { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-top: 18px; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; text-decoration: none; transition: var(--transition); }
.place-addr svg { width: 13px; height: 13px; stroke-width: 1.6; flex: 0 0 auto; color: var(--muted); }
.place-addr:hover { color: var(--ink); }
.addr-street { flex: 1; min-width: 0; }
.addr-go { flex: 0 0 auto; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-size: 10px; }
.place-addr:hover .addr-go { color: var(--ink-soft); }

/* hide the city scope pill while a place is open (its location is in the kicker) */
.panel.place-open .city-bar { display: none; }

/* sources */
.sources { margin-top: 18px; }
.sources-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-full); padding: 7px 13px; cursor: pointer; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 7px;
}
.sources-pill:hover { color: var(--ink); border-color: rgba(255,255,255,.2); }
.src-caret { display: inline-block; transition: transform var(--transition); }
.sources-pill.open .src-caret { transform: rotate(90deg); }
.sources-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sources-list[hidden] { display: none; }
.sources-list a { font-size: 13px; color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: baseline; gap: 7px; line-height: 1.4; transition: var(--transition); }
.sources-list a::before { content: "↗"; color: var(--muted); font-size: 11px; }
.sources-list a:hover { color: var(--ink); }

/* nearby haunts */
.section-label { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.nearby { margin-top: 28px; }
.nearby-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; border-top: 1px solid var(--line); padding: 12px 2px; cursor: pointer;
  font-family: inherit; color: var(--ink-soft); transition: var(--transition);
}
.nearby-row:last-child { border-bottom: 1px solid var(--line); }
.nearby-ic {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); color: var(--ink); transition: var(--transition);
}
.nearby-ic svg { width: 15px; height: 15px; stroke-width: 1.7; }
.nearby-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby-dist { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-soft); letter-spacing: .04em; flex: 0 0 auto; }
.nearby-row:hover .nearby-ic { border-color: rgba(255,255,255,.3); color: var(--ink); }
.nearby-row:hover .nearby-name { color: #fff; }

/* primary action — pinned to panel bottom */
.place-actions { margin-top: auto; padding-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.go-btn {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: none;
  border: 1px solid rgba(255,255,255,.16); background: transparent;
  padding: 14px 18px; border-radius: var(--radius-md); cursor: pointer; font-family: inherit; transition: var(--transition);
}
.go-btn svg { width: 16px; height: 16px; stroke-width: 1.7; }
.go-btn:hover { background: var(--accent); color: #0a0d12; border-color: var(--accent); }
.go-btn:hover svg { stroke-width: 2; }
.go-btn.added { background: var(--accent); color: #0a0d12; border-color: var(--accent); }

.panel-foot { position: relative; padding: 13px 24px 18px; border-top: 1px solid var(--line); }
.ver { font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: center; display: block; letter-spacing: .2em; text-transform: uppercase; }

/* ---- Filter bar ---- */
/* map bar: location pill + type Filter, co-located on the map */
.mapbar { position: absolute; z-index: 3; top: 16px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); display: flex; gap: 8px; align-items: center; }
.filterbar { position: relative; }
.locbar { position: relative; flex: 0 0 auto; }
.loc-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: #0f131a; border: 1px solid var(--line);
  border-radius: var(--radius-full); height: 46px; padding: 0 12px 0 14px; cursor: pointer; box-shadow: var(--shadow-card); transition: var(--transition); white-space: nowrap;
}
.loc-toggle svg { width: 15px; height: 15px; stroke-width: 1.8; flex: 0 0 auto; }
.loc-toggle .loc-caret { width: 13px; height: 13px; opacity: .55; }
.loc-toggle:hover { border-color: rgba(255,255,255,.3); }
.loc-toggle[aria-expanded="true"] .loc-caret { transform: rotate(180deg); }
.loc-menu {
  position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; min-width: 210px; max-height: 52vh; overflow-y: auto;
  background: #11151d; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 8px; scrollbar-width: none;
}
.loc-menu::-webkit-scrollbar { display: none; }
.loc-menu[hidden] { display: none; }
.loc-name { display: inline-flex; align-items: center; gap: 8px; }
.loc-name svg { width: 14px; height: 14px; stroke-width: 1.9; }
/* collapsed by default to a single chip; expands to the full pill row on tap */
.filter-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: #0f131a; border: 1px solid var(--line);
  border-radius: var(--radius-full); height: 46px; padding: 0 15px; cursor: pointer; box-shadow: var(--shadow-card); transition: var(--transition);
}
.filter-toggle svg { width: 15px; height: 15px; stroke-width: 1.8; }
.filter-toggle:hover { border-color: rgba(255,255,255,.3); }
.filter-toggle.active { background: var(--pc, var(--accent)); color: #0a0d12; border-color: var(--pc, var(--accent)); }
.filterbar.open .filter-toggle { display: none; }
.filterbar:not(.open) .filterbar-inner { display: none; }
.filterbar-inner {
  display: flex; align-items: center; gap: 2px;
  background: #0f131a; border: 1px solid var(--line);
  border-radius: var(--radius-full); box-shadow: var(--shadow-card); height: 46px; padding: 0 7px; overflow-x: auto; scrollbar-width: none;
}
.filterbar-inner::-webkit-scrollbar { display: none; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; height: 38px; min-width: 38px; padding: 0 10px;
  justify-content: center; border: none; background: none; color: var(--ink-soft); border-radius: var(--radius-full); cursor: pointer;
  font-family: inherit; transition: background var(--transition), color var(--transition), padding var(--transition);
}
.pill svg { width: 19px; height: 19px; stroke-width: 1.6; color: var(--pc, currentColor); }
.pill-label { display: none; font-size: 13px; font-weight: 600; white-space: nowrap; letter-spacing: .01em; }
.pill:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.pill.active { background: var(--pc, var(--accent)); color: #0a0d12; padding: 0 16px 0 13px; }
.pill.active svg { stroke-width: 1.9; color: #0a0d12; }
.pill.active .pill-label { display: inline; }
.pill-sep { flex: 0 0 auto; width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ---- Nav rail (mobile: bottom tab bar) ---- */
.rail {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 60px;
  display: flex; align-items: center; justify-content: center; gap: 24px;
  background: #0d1016; border-top: 1px solid var(--line);
}
.rail-logo { display: none; }
.rail-btn[hidden] { display: none; }
.rail-btn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 72px; height: 48px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-tab-label { font-size: 11px; font-weight: 600; }
.rail-btn.active { color: var(--ink); }
.rail-btn:hover { color: var(--ink); }
.rail-btn:focus { outline: none; }
.rail-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail-badge {
  position: absolute; top: 2px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  font-family: var(--mono); font-size: 9px; font-weight: 600; line-height: 16px; text-align: center;
  color: #0a0d12; background: var(--accent); border-radius: 999px; display: none;
}
.rail-badge.show { display: block; }

/* ---- Tour view — a ghost-walk itinerary ---- */
.tour-view { display: flex; flex-direction: column; flex: 1; padding-top: 16px; }
.place-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.place-top h2 { font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: -.01em; }
.place-close { flex-shrink: 0; border: none; background: none; cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 4px; border-radius: var(--radius-sm); transition: var(--transition); }
.place-close:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.tour-stats { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); letter-spacing: .06em; text-transform: uppercase; margin: 6px 0 4px; }

.tour-route { position: relative; display: flex; flex-direction: column; margin-top: 16px; }
.tour-stop { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 0; }
/* the inked trail linking the stamps — a confident fine dash, same family as the map route */
.tour-stop:not(.last)::before { content: ""; position: absolute; left: 16px; top: calc(50% + 18px); height: calc(100% - 36px); width: 1.5px; z-index: 0;
  background: repeating-linear-gradient(to bottom, rgba(243,244,247,.5) 0 2px, transparent 2px 4px); } /* dashes live in the gap only, clear of the rings */
.tour-stamp {
  position: relative; z-index: 1; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(243,244,247,.4); background: transparent; color: var(--ink); /* a drawn ink ring on the paper — grain shows through, not a flat black disc */
  font-family: var(--display); font-size: 15px; font-weight: 600;
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: var(--transition);
}
.tour-stamp svg { width: 18px; height: 18px; }
.tour-stamp:hover { border-color: rgba(255,255,255,.4); color: var(--ink); }
.tour-stop.visited .tour-stamp { background: var(--accent); border-color: var(--accent); color: #0a0d12; transform: rotate(-8deg); }
.tour-stop-body { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 3px; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.tour-name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-stop.visited .tour-name { color: var(--ink-soft); }
.tour-stop-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-remove { flex: 0 0 auto; width: 26px; height: 26px; border: none; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; border-radius: var(--radius-sm); display: grid; place-items: center; transition: var(--transition); }
.tour-remove:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.tour-actions { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.tour-maps-link { display: block; margin-top: 14px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; transition: var(--transition); }
.tour-maps-link:hover { color: var(--ink); }

.tour-empty { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; padding: 24px 0; }
.tour-empty-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); color: var(--ink); margin-bottom: 18px; }
.tour-empty-mark svg { width: 22px; height: 22px; stroke-width: 1.5; }
.tour-empty-title { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.tour-empty-sub { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 250px; }

/* ---- Markers ---- */
.marker { will-change: transform; cursor: pointer; transition: opacity var(--transition); }
body.clusters-pending .marker { opacity: 0; pointer-events: none; }
/* saved tour stops get a crisp ring (not a glow) while you're in the guide / walk */
body.mode-guide .marker.in-tour .pin,
.app.walking .marker.in-tour .pin {
  border-color: #fff;
  box-shadow: 0 0 0 2px #0d1016, 0 0 0 4px #fff, 0 4px 12px rgba(0,0,0,.6);
}
/* during the in-map walk preview, dim everything not on the route */
.app.walking .marker:not(.in-tour) { display: none; }
.pin {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #141a26; color: var(--pc, #c2c8d2);
  border: 1.5px solid var(--pc, rgba(255,255,255,.34));
  box-shadow: 0 0 0 2px #0d1016, 0 2px 6px rgba(0,0,0,.55); cursor: pointer; padding: 0;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}
.pin svg { width: 15px; height: 15px; stroke-width: 1.9; }
.pin:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 2px #0d1016, 0 6px 14px rgba(0,0,0,.6); }
.pin.active { background: var(--pc, #f3f4f7); color: #0a0d12; border-color: #fff; transform: scale(1.16); box-shadow: 0 0 0 2px #0d1016, 0 6px 14px rgba(0,0,0,.55); }
.marker.hidden { display: none; }
/* viewing a single crawl: spotlight its stops, fade the rest right back so only the route reads */
body.crawl-view .marker.in-tour { opacity: 1 !important; } /* the crawl's stops always show, even if clustered/pending */
body.crawl-view .marker.in-tour.clustered { display: grid; }
body.crawl-view .marker:not(.in-tour) { opacity: .12 !important; pointer-events: none; } /* !important beats MapLibre's inline marker opacity */

/* ===== build a crawl: numbered route pins + the build panel ===== */
.marker.in-build .pin { border-color: #fff; box-shadow: 0 0 0 2px #0d1016, 0 0 0 3px #fff, 0 4px 12px rgba(0,0,0,.6); }
.pin-num {
  position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  display: grid; place-items: center; border-radius: 999px; background: #fff; color: #0a0d12;
  font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 1; box-shadow: 0 0 0 2px #0d1016;
}
.build-sub { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; margin: -6px 0 16px 40px; }
.build-empty { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  padding: 13px 14px; border: 1px dashed rgba(255,255,255,.14); border-radius: var(--radius-md); margin-bottom: 14px; }
.build-empty svg { width: 17px; height: 17px; flex: 0 0 auto; }
.build-route { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.build-stop { display: flex; align-items: center; gap: 12px; padding: 7px 2px; }
.build-num { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid rgba(243,244,247,.7);
  display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 12px; color: var(--ink); }
.build-name { flex: 1; min-width: 0; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 1px; }
.build-type { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.build-x { width: 26px; height: 26px; flex: 0 0 auto; border: none; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 50%; transition: var(--transition); }
.build-x:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.build-near-label { margin: 0 0 8px; }
.build-cands { display: flex; flex-direction: column; gap: 2px; }
.build-cand { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 8px 2px; color: var(--ink-soft); font-family: inherit; border-radius: var(--radius-sm); transition: var(--transition); }
.build-cand:hover { background: rgba(255,255,255,.04); }
.build-cand:hover .build-cand-add { border-color: rgba(255,255,255,.5); color: var(--ink); }
.build-cand-ic { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); }
.build-cand-ic svg { width: 15px; height: 15px; }
.build-cand-name { flex: 1; min-width: 0; font-family: var(--display); font-size: 14px; font-weight: 600; color: var(--ink); display: flex; flex-direction: column; gap: 1px; }
.build-cand-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-cand-add { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); color: var(--ink-soft); transition: var(--transition); }
.build-cand-add svg { width: 15px; height: 15px; }
.build-actions { margin-top: 16px; }
.seal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: #0a0d12; background: var(--ink); border: none; border-radius: var(--radius-full); padding: 14px; cursor: pointer; transition: var(--transition); }
.seal-btn svg { width: 16px; height: 16px; }
.seal-btn:hover { background: #fff; }
.seal-btn:disabled { background: transparent; color: var(--muted); border: 1px dashed rgba(255,255,255,.16); cursor: default; }

/* ---- You are here + proximity ---- */
.user-dot {
  width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #0a0d12;
  box-shadow: 0 0 0 4px rgba(255,255,255,.16); position: relative;
}

.locate-ctrl button { display: grid; place-items: center; color: var(--ink-soft); }
.locate-ctrl button svg { width: 18px; height: 18px; stroke-width: 1.8; }
.locate-ctrl button:hover { color: var(--ink); }
.locate-ctrl button.located { color: #fff; }
.locate-ctrl button.locating { animation: locpulse 1s ease-in-out infinite; }
@keyframes locpulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.locate-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  border: 1px solid rgba(255,255,255,.16); background: transparent;
  padding: 11px 18px; border-radius: var(--radius-full); cursor: pointer; transition: var(--transition);
}
.locate-cta svg { width: 16px; height: 16px; stroke-width: 1.8; }
.locate-cta:hover { background: var(--accent); color: #0a0d12; border-color: var(--accent); }
.geo-msg { font-size: 12px; color: var(--muted); margin-top: 14px; max-width: 240px; line-height: 1.5; }
.loc-approx { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }

.nearest-line {
  display: flex; align-items: center; gap: 12px; margin-top: 24px; width: 100%; max-width: 280px; text-align: left;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 12px 14px; cursor: pointer; font-family: inherit; transition: var(--transition);
}
.nearest-line:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
.nearest-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink); }
.nearest-ic svg { width: 16px; height: 16px; stroke-width: 1.6; }
.nearest-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nearest-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.nearest-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearest-dist { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); letter-spacing: .04em; flex: 0 0 auto; }

.kicker-dist { color: var(--muted); margin-left: 6px; letter-spacing: .12em; }

.maplibregl-ctrl-attrib { display: none; }
.maplibregl-ctrl-group { background: #11151d; border: 1px solid var(--line) !important; box-shadow: 0 8px 24px rgba(0,0,0,.55) !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4) opacity(.65); }

/* ---- Desktop: floating rail + panel ---- */
@media (min-width: 860px) {
  .rail {
    top: 18px; bottom: 18px; left: 18px; right: auto; width: 60px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 14px 0;
    border-top: none; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  }
  .rail-logo { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink); margin-bottom: 10px; cursor: pointer; border-radius: var(--radius-md); transition: var(--transition); }
  .rail-logo:hover { background: rgba(255,255,255,.06); }
  .rail-logo svg { width: 22px; height: 22px; }
  .rail-btn { width: 44px; height: 44px; flex-direction: row; }
  .rail-btn:not(.active):hover { background: rgba(255,255,255,.045); color: var(--ink); }
  .rail-btn.active { background: var(--accent-soft); color: var(--ink); }
  .rail-tab-label { display: none; }
  .rail-badge { top: 2px; right: 5px; }
  .panel {
    top: 18px; bottom: 18px; left: 90px; right: auto; width: 372px; max-height: none;
    border-radius: var(--radius-lg); border-top: 1px solid rgba(255,255,255,.12);
  }
  .mapbar { top: auto; bottom: 26px; left: calc(50% + 230px); }
  .loc-menu { top: auto; bottom: calc(100% + 6px); } /* opens upward — the bar sits near the bottom on desktop */
}

/* ---- Mobile: the panel is a draggable bottom sheet (peek / half / full) ---- */
@media (max-width: 859px) {
  .panel {
    height: var(--sheet-h, 52vh); max-height: none; bottom: 56px;
    transition: height 300ms cubic-bezier(.22, .61, .18, 1);
  }
  .panel.dragging { transition: none; }
  .rail { height: 56px; }
  .sheet-handle {
    display: flex; align-items: center; justify-content: center; height: 24px; flex: 0 0 auto;
    cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
  }
  .sheet-handle::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); transition: var(--transition); }
  .sheet-handle:active { cursor: grabbing; }
  .sheet-handle:active::before { background: rgba(255,255,255,.45); width: 46px; }
  .city-bar { padding-top: 4px; }
  .detail-intro { padding: 4px 0 12px; }
  .intro-mark { width: 38px; height: 38px; margin-bottom: 11px; }
  .intro-mark svg { width: 18px; height: 18px; }
  .intro-name { font-size: 20px; letter-spacing: .22em; text-indent: .22em; margin-bottom: 6px; }
  .intro-tag { font-size: 12.5px; margin-bottom: 11px; }
  .locate-cta { margin-top: 15px; }
  .panel-body { padding-bottom: 8px; }
  /* thumb-friendly: bigger pins + your dot on touch screens */
  .pin { width: 40px; height: 40px; }
  .pin svg { width: 18px; height: 18px; }
  .user-dot { width: 18px; height: 18px; }
  .nearby-row, .search-result { padding-top: 11px; padding-bottom: 11px; }
  .pill { height: 40px; min-width: 40px; }
}

/* ---- Intro search + lockup ---- */
.intro-search { position: relative; display: flex; align-items: center; margin: 0 0 6px; flex: 0 0 auto; }
.intro-search > svg { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.intro-search input { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: var(--radius-full); padding: 10px 14px 10px 38px; outline: none; transition: var(--transition); }
.intro-search input::placeholder { color: var(--muted); }
.intro-search input:focus { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
#introBody { flex: 1; display: flex; flex-direction: column; }
.intro-lockup { margin: auto 0; display: flex; flex-direction: column; align-items: center; padding: 14px 0; }
.search-results { display: flex; flex-direction: column; gap: 5px; padding-top: 6px; }
.search-result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; border-radius: var(--radius-md); padding: 10px 9px; cursor: pointer; font-family: inherit; transition: var(--transition); }
.search-result:hover { background: rgba(255,255,255,.06); }
.search-result:hover .sr-ic { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.06); }
.sr-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); color: var(--ink); transition: var(--transition); }
.sr-ic svg { width: 15px; height: 15px; stroke-width: 1.7; }
.sr-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sr-dist { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-soft); flex: 0 0 auto; }
.near-you { display: flex; flex-direction: column; }
.near-you .section-label { margin: 4px 0 8px; }
.sr-name { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-meta { font-family: var(--font); font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-none { color: var(--muted); font-size: 14px; text-align: center; margin: 24px 0; }

/* ---- City picker: search + grouped list ---- */
.city-search { width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; outline: none; margin-bottom: 6px; }
.city-search::placeholder { color: var(--muted); }
.city-search:focus { border-color: rgba(255,255,255,.28); }
.city-list { max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.city-group { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 11px 4px; }
.city-none { color: var(--muted); font-size: 13px; padding: 12px 11px; }

/* ---- Clustered markers hidden (the cluster bubble shows instead) ---- */
.marker.clustered { display: none; }

/* ---- Tour: multi-city note ---- */
.tour-note { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; line-height: 1.4; }
.tour-note svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* ---- Location browser (in-panel, two-level: states → cities) ---- */
.locations { display: flex; flex-direction: column; flex: 1; padding-top: 8px; }
.locations .detail-back { align-self: flex-start; margin-bottom: 12px; }
.loc-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-top: 4px; }
.loc-rows { display: flex; flex-direction: column; gap: 7px; }
.loc-state-row, .loc-city-row, .loc-all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 13px 15px; cursor: pointer; font-family: inherit; transition: var(--transition);
}
.loc-state-row:hover, .loc-city-row:hover, .loc-all:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
.loc-state-row.current, .loc-city-row.current { border-color: rgba(255,255,255,.4); }
.loc-state-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.loc-state-name { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.loc-state-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.loc-arrow { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.loc-city-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.loc-city-meta, .loc-c-count { font-family: var(--mono); font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.loc-all { margin-bottom: 8px; }
.loc-all > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 14px; }
.loc-all svg { width: 15px; height: 15px; }
.loc-up { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0 0 12px; }
.loc-up:hover { color: var(--ink); }
.loc-up svg { width: 14px; height: 14px; }

/* ---- Dark Walk: immersive one-haunt-at-a-time mode ---- */
body.dark-walk .rail,
body.dark-walk .panel,
body.dark-walk .mapbar { display: none; }
body.dark-walk #map canvas,
body.dark-walk .maplibregl-canvas { filter: brightness(.42) contrast(1.12) saturate(.18); transition: filter .8s ease; }
.dark-scrim {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 40%, rgba(2,3,6,0) 16%, rgba(2,3,6,.5) 58%, rgba(0,0,0,.94) 100%);
  animation: dwfog 1.4s ease both;
}
.dark-scrim[hidden] { display: none; }
@keyframes dwfog { from { opacity: 0; } to { opacity: 1; } }
.darkwalk { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; pointer-events: none; }
.darkwalk[hidden] { display: none; }
.darkwalk > * { pointer-events: auto; }
.dw-exit {
  position: absolute; top: 18px; right: 20px; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; transition: var(--transition);
}
.dw-exit svg { width: 18px; height: 18px; stroke-width: 2; }
.dw-exit:hover { color: var(--ink); background: rgba(255,255,255,.12); }
.dw-count {
  position: absolute; top: 26px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft);
}
.dw-card {
  margin: auto auto 5vh; width: min(560px, 92vw); max-height: 50vh; display: flex; flex-direction: column;
  background: rgba(10,13,18,.84); backdrop-filter: blur(7px); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 26px 22px; box-shadow: 0 24px 70px rgba(0,0,0,.65);
  animation: dwrise .85s cubic-bezier(.22,.61,.18,1) both;
}
.dw-kicker, .dw-name, .dw-next { flex: 0 0 auto; }
.dw-story::-webkit-scrollbar { display: none; }
@keyframes dwrise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.dw-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.dw-name { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin-bottom: 15px; line-height: 1.05; }
.dw-story { font-family: var(--serif); font-size: 17px; line-height: 1.85; color: var(--ink-read); margin-bottom: 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.dw-next {
  width: 100%; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: #0a0d12; background: var(--accent); border: none; border-radius: var(--radius-full); padding: 14px; cursor: pointer; transition: var(--transition);
}
.dw-next:hover { opacity: .9; }
.dw-finale { margin: auto; text-align: center; width: min(460px, 90vw); animation: dwrise 1s both; }
.dw-finale-mark { font-size: 46px; margin-bottom: 14px; line-height: 1; }
.dw-finale-title { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.dw-finale-sub { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 26px; }
.dw-finale .dw-next { width: auto; padding: 14px 30px; }
/* current haunt rings bright; the rest recede into the dark */
body.dark-walk .marker { opacity: .2; transition: opacity .6s ease; }
body.dark-walk .marker.dw-here { opacity: 1; }
body.dark-walk .marker.dw-here .pin { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.16), 0 2px 12px rgba(0,0,0,.7); }

/* "Explore more" + featured-tours modal */
.explore-more {
  display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 4px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); background: none; border: none; cursor: pointer; transition: var(--transition);
}
.explore-more:hover { color: var(--ink); }
.explore-more svg { width: 14px; height: 14px; stroke-width: 2; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-scrim { position: absolute; inset: 0; background: rgba(2,3,6,.72); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; width: min(520px, 92vw); max-height: 80vh; display: flex; flex-direction: column;
  background: #0d1016; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: dwrise .4s cubic-bezier(.22,.61,.18,1) both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; flex: 0 0 auto; }
.modal-head h2 { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; transition: var(--transition); flex: 0 0 auto; }
.modal-close:hover { color: var(--ink); background: rgba(255,255,255,.12); }
.modal-close svg { width: 17px; height: 17px; stroke-width: 2; }
.modal-list { display: flex; flex-direction: column; gap: 8px; padding: 6px 18px 20px; overflow-y: auto; scrollbar-width: none; }
.modal-list::-webkit-scrollbar { display: none; }
/* bottom-of-rail icons (contact / feature) */
.rail-foot { margin-top: auto; }
/* contact + feature popup forms */
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 22px 22px; overflow-y: auto; scrollbar-width: none; }
.modal-body::-webkit-scrollbar { display: none; }
.modal-sub { font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.field { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; outline: none; transition: var(--transition); }
.field::placeholder { color: var(--muted); }
.field:focus { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.06); }
textarea.field { resize: vertical; min-height: 92px; line-height: 1.55; }
.modal-submit { width: 100%; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #0a0d12; background: var(--accent); border: none; border-radius: var(--radius-full); padding: 14px; cursor: pointer; transition: var(--transition); }
.modal-submit:hover { opacity: .9; }
.modal-submit:disabled { opacity: .55; cursor: default; }
.modal-status { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 2px; }
.pkg-list { display: flex; flex-direction: column; gap: 8px; }
.pkg { display: flex; flex-direction: column; gap: 3px; text-align: left; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; transition: var(--transition); }
.pkg:hover { border-color: rgba(255,255,255,.25); }
.pkg.on { border-color: var(--accent); background: rgba(255,255,255,.07); }
.pkg-name { font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--ink); }
.pkg-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
/* stamp demo — ink seal pressed on aged paper */
.stamp-paper {
  position: relative; display: grid; place-items: center; padding: 30px 18px; overflow: hidden;
  background: radial-gradient(120% 130% at 50% 26%, #efe7d6, #e4dac4 66%, #d2c6ac 100%);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 70px rgba(110,88,55,.42), inset 0 0 0 1px rgba(110,88,55,.16);
}
.stamp-paper::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .45; background-size: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
.stamp { width: 100%; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 1px 0 rgba(90,60,40,.16)); }
.stamp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stamp-cell { display: flex; flex-direction: column; gap: 7px; }
.stamp-cell .stamp-paper { padding: 12px; }
.stamp-tile { border-radius: var(--radius-md); overflow: hidden; line-height: 0; box-shadow: 0 2px 16px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.05); }
.stamp-tile .stamp { display: block; width: 100%; height: auto; }
.stamp-cell figcaption { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: center; }

/* ============================================================
   Warm "oxblood" theme — live preview behind ?theme=oxblood
   (persists; ?theme=noir reverts). Keeps the cool #0a0d12 base + white
   ink; swaps the accent to the wax-seal oxblood and warms the map floor.
   The base CSS above is UNTOUCHED — default visitors see no change until
   this is promoted into :root. Scoped overrides only.
   ============================================================ */
body.theme-oxblood {
  --accent: #a8392c;                 /* the wax-seal oxblood — warmth already in the brand */
  --accent-deep: #c4503d;            /* lighter, for hover-brighten on a dark UI */
  --accent-soft: rgba(168,57,44,.16);
  --map-bg: #0d0a06;                 /* warm-black map floor */
}
/* warm the desaturated ink tiles toward candle/lantern light — pins stay ink */
body.theme-oxblood #map canvas,
body.theme-oxblood .maplibregl-canvas { filter: brightness(.6) contrast(1.12) saturate(.3) sepia(.32) hue-rotate(-14deg); }
/* cream text on the warm accent fills — near-black would muddy on oxblood */
body.theme-oxblood .state-chip.current,
body.theme-oxblood .act-save.on,
body.theme-oxblood .act-icon.on,
body.theme-oxblood .go-btn:hover,
body.theme-oxblood .go-btn.added,
body.theme-oxblood .pill.active,
body.theme-oxblood .filter-toggle.active,
body.theme-oxblood .rail-badge,
body.theme-oxblood .plan-card.starter:hover .starter-use,
body.theme-oxblood .tour-stop.visited .tour-stamp,
body.theme-oxblood .dw-next,
body.theme-oxblood .modal-submit,
body.theme-oxblood .locate-cta:hover { color: #f6ece0; }
body.theme-oxblood .act-save.on svg { fill: #f6ece0; }
body.theme-oxblood .pill.active svg { color: #f6ece0; }
/* the "Seal this crawl" CTA ties to the wax-seal oxblood */
body.theme-oxblood .seal-btn { background: var(--accent); color: #f6ece0; }
body.theme-oxblood .seal-btn:hover { background: var(--accent-deep); }
