:root {
  --bg: #0f1419;
  --bg-elev: #171e26;
  --bg-soft: #1e2732;
  --panel: #1a222c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f6;
  --muted: #9aa8b5;
  --stone: #c4b5a0;
  --green: #6f8f72;
  --green-bright: #8fb894;
  --gold: #d4a84b;
  --blue: #6ea8d9;
  --danger: #d97676;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(111, 143, 114, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(212, 168, 75, 0.12), transparent 50%),
    var(--bg);
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.hidden { display: none !important; }

/* Welcome — faded historical intro */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 70;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #140e09;
  color: #f4efe6;
}
.welcome-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.welcome-slide {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  filter: sepia(0.5) saturate(0.55) contrast(0.92) brightness(0.78);
  transition: opacity 1.8s ease;
}
.welcome-slide.is-on {
  opacity: 1;
  animation: welcome-drift 20s ease-in-out alternate infinite;
}
.welcome-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(28, 18, 10, 0.2) 0%, rgba(20, 14, 10, 0.05) 32%, rgba(12, 9, 7, 0.45) 62%, rgba(8, 6, 5, 0.88) 100%),
    radial-gradient(120% 90% at 50% 36%, transparent 30%, rgba(30, 16, 8, 0.45) 100%);
}
.welcome-grain {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: overlay;
}
.welcome-skip {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 3;
  border: 1px solid rgba(244, 239, 230, 0.28);
  background: rgba(12, 9, 7, 0.35);
  color: #f4efe6;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  opacity: 0;
  animation: welcome-in 0.7s ease 0.6s both;
}
.welcome-skip:hover { background: rgba(12, 9, 7, 0.55); }
.welcome-foreground {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  padding:
    0
    max(22px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.welcome-foreground::-webkit-scrollbar { display: none; }
.welcome-copy,
.welcome-card {
  width: 100%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.welcome-copy { margin-bottom: 18px; }
.welcome-greeting {
  margin: 0 0 10px;
  min-height: 1.15em;
  font-family: var(--display);
  font-weight: 520;
  font-size: clamp(1.55rem, 6vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #f7f1e7;
  opacity: 0;
  animation: welcome-in 1s ease 0.2s both;
}
.welcome-greeting.is-fading #welcome-greeting-text {
  opacity: 0;
  transition: opacity 0.65s ease;
}
#welcome-greeting-text {
  display: inline-block;
  opacity: 1;
  transition: opacity 0.65s ease;
}
.welcome-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.lang-chip {
  border: 1px solid rgba(244, 239, 230, 0.28);
  background: rgba(12, 9, 7, 0.35);
  color: #f4efe6;
  border-radius: 999px;
  padding: 12px 16px;
  min-height: 48px;
  font-size: 1.05rem;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lang-chip:hover { background: rgba(12, 9, 7, 0.55); }
.lang-chip.is-active,
.lang-chip[aria-pressed="true"] {
  background: rgba(228, 210, 176, 0.22);
  border-color: rgba(228, 210, 176, 0.7);
  color: #f7f1e7;
  font-weight: 600;
}
.more-langs {
  margin-top: 12px;
}
.more-langs .lang-chip {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--line);
  font-size: 1.05rem;
  min-height: 48px;
}
.more-langs .lang-chip.is-active,
.more-langs .lang-chip[aria-pressed="true"] {
  background: rgba(196, 154, 78, 0.18);
  border-color: rgba(196, 154, 78, 0.55);
  color: var(--text);
}
.welcome-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: #e4d2b0;
  margin: 0 0 10px;
  opacity: 0;
  animation: welcome-in 1.1s ease 0.45s both;
}
.welcome-copy h1 {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(1.9rem, 7vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 12px;
  color: #f7f1e7;
  overflow-wrap: break-word;
  opacity: 0;
  animation: welcome-in 1.15s ease 1.15s both;
}
.welcome-line {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  color: rgba(244, 239, 230, 0.88);
  font-size: 1.05rem;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: break-word;
  opacity: 0;
}
.welcome-copy .welcome-line:nth-of-type(2) { animation: welcome-in 1.15s ease 2.2s both; }
.welcome-copy .welcome-line:nth-of-type(3) { animation: welcome-in 1.15s ease 3.4s both; }
.welcome-card {
  background: rgba(16, 14, 12, 0.72);
  border: 1px solid rgba(244, 239, 230, 0.14);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: welcome-rise 1s ease 4.8s both;
}
.welcome.is-ready .welcome-greeting,
.welcome.is-ready .welcome-kicker,
.welcome.is-ready .welcome-copy h1,
.welcome.is-ready .welcome-line,
.welcome.is-ready .welcome-card,
.welcome.is-ready .welcome-skip {
  animation: none;
  opacity: 1;
  transform: none;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--green-bright);
  margin: 0 0 12px;
}
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hint {
  margin: 16px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.welcome .hint {
  color: rgba(244, 239, 230, 0.7);
  overflow-wrap: break-word;
}
@keyframes welcome-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes welcome-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes welcome-drift {
  from { transform: scale(1.08) translate3d(1%, 0.4%, 0); }
  to { transform: scale(1) translate3d(-1%, -0.6%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-slide,
  .welcome-greeting,
  .welcome-kicker,
  .welcome-copy h1,
  .welcome-line,
  .welcome-card,
  .welcome-skip {

    animation: none !important;
    transition: none !important;
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 640px) {
  .welcome-greeting { font-size: 1.7rem; }
  .welcome-copy h1 { font-size: 1.85rem; }
  .welcome-line { font-size: 1.02rem; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .btn { width: 100%; text-align: center; }
  .lang-chip { font-size: 1.08rem; padding: 13px 17px; }
}

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.15s ease;
}
.btn:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #7fa383, #5f7d62);
  border-color: transparent;
  color: #0c120e;
  font-weight: 600;
}
.btn.ghost { background: transparent; }
.btn.tiny { padding: 8px 12px; font-size: 0.85rem; }
.btn.danger { color: #ffd0d0; border-color: rgba(217, 118, 118, 0.4); }
.btn.danger:hover { background: rgba(217, 118, 118, 0.15); }

/* Shell */
.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  position: relative;
  min-height: 0;
}
.shell.admin-mode .admin-only { display: flex; }
.admin-only { display: none; }
/* Admin shortcuts in the sidebar only for a logged-in admin */
.admin-ctrl { display: none !important; }
body.admin-session .admin-ctrl { display: inline-flex !important; }
.admin-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin-top: 16px;
}
.admin-login.hidden { display: none !important; }
.near-notice {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 75, 0.45);
  background: rgba(212, 168, 75, 0.1);
  color: var(--text);
}
.near-notice p { margin: 0 0 10px; line-height: 1.5; }

.sidebar {
  background: rgba(15, 20, 25, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 18px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px 8px 10px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  background: linear-gradient(145deg, var(--stone), #8a7a64);
  color: #1a1510;
  letter-spacing: -0.04em;
  font-size: 0.92rem;
}
.brand strong { display: block; font-size: 0.98rem; }
.brand small { color: var(--muted); font-size: 0.75rem; }

.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-btn {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-btn.active {
  background: rgba(111, 143, 114, 0.18);
  color: var(--green-bright);
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.main {
  overflow: auto;
  padding: 28px 28px 48px;
  position: relative;
}
.view { display: none; }
.view.active { display: block; animation: fade 0.25s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.view-head { margin-bottom: 20px; }
.view-head.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.view-head h2 {
  font-family: var(--display);
  font-size: 1.75rem;
  margin: 0 0 6px;
  font-weight: 600;
}
.view-head p { margin: 0; color: var(--muted); }
.section-title {
  margin: 28px 0 12px;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.field.compact { margin: 0; }
.field > span { font-size: 0.78rem; color: var(--muted); }
.field input, .field select, .field textarea, .search {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .search:focus {
  border-color: rgba(143, 184, 148, 0.55);
}
.field.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.search { min-width: 220px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.site-card, .hero-card, .trail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: 0.15s ease;
  overflow: hidden;
}

.card-thumb {
  position: relative;
  margin: -16px -16px 12px;
  height: 140px;
  overflow: hidden;
  background: #0a0e12;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.site-card:hover .card-thumb img { transform: scale(1.05); }
.thumb-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  border: 1px solid rgba(255,255,255,0.2);
}

.media-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 16px;
  background: #0a0e12;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
}
.media-frame.hero-media {
  margin: -24px -24px 16px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  max-height: 280px;
}
.site-image, .site-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0a0e12;
}
.site-video { background: #000; }
.media-frame.has-kenburns .site-image {
  animation: kenburns 14s ease-in-out infinite alternate;
  transform-origin: center center;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}
.media-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 6px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.75);
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  line-height: 1.3;
}
.chip-video {
  background: rgba(212, 168, 75, 0.18) !important;
  color: var(--gold) !important;
}
.detail .media-frame { margin-top: 8px; }
.detail .distance { margin-top: 4px; }
.site-card:hover, .trail-card:hover {
  border-color: rgba(143, 184, 148, 0.35);
  transform: translateY(-2px);
}
.site-card .tier {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
}
.site-card h3, .trail-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 0 0 8px;
  font-weight: 600;
}
.site-card p, .trail-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
}

.hero-card {
  cursor: default;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(111,143,114,0.18), transparent 50%),
    var(--panel);
  min-height: 180px;
}
.hero-card.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}
.hero-card .emoji {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.hero-card h3 {
  font-family: var(--display);
  font-size: 1.6rem;
  margin: 0 0 10px;
}
.hero-card .spoken {
  color: var(--text);
  line-height: 1.55;
  max-width: 70ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.distance {
  color: var(--green-bright);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.partner-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.partner-chip {
  border: 1px solid rgba(212, 168, 75, 0.35);
  background: rgba(212, 168, 75, 0.1);
  color: #f0d59a;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.88rem;
  max-width: 320px;
}
.partner-chip strong { display: block; margin-bottom: 2px; color: var(--gold); }
.partner-chip small { color: var(--muted); }

.partner-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.partner-card {
  border: 1px solid rgba(212, 168, 75, 0.28);
  background: linear-gradient(160deg, rgba(212, 168, 75, 0.12), rgba(26, 34, 44, 0.9));
  border-radius: 16px;
  padding: 14px;
}
.partner-card.featured {
  border-color: rgba(212, 168, 75, 0.55);
  box-shadow: 0 10px 30px rgba(212, 168, 75, 0.12);
  background:
    radial-gradient(600px 180px at 100% 0%, rgba(255, 180, 70, 0.16), transparent 55%),
    linear-gradient(160deg, rgba(212, 168, 75, 0.18), rgba(26, 34, 44, 0.95));
}
.partner-badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1408;
  background: linear-gradient(135deg, #f0d59a, #d4a84b);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  margin-bottom: 8px;
}
.partner-badge.soft {
  background: rgba(255,255,255,0.08);
  color: var(--gold);
  font-weight: 600;
}
.partner-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 2px;
}
.partner-type {
  display: block;
  color: var(--gold);
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.partner-card p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.partner-offer {
  background: rgba(143, 184, 148, 0.14);
  border: 1px solid rgba(143, 184, 148, 0.28);
  color: #d7edd9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.partner-highlights {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.84rem;
}
.partner-highlights li { margin: 3px 0; }
.partner-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}
.partner-why {
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}
.partner-why summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 600;
}
.partner-why ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.excitement {
  display: inline-block;
  margin: 6px 0 4px;
  color: #f0d59a;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.chip-then {
  background: rgba(196, 181, 160, 0.18) !important;
  color: var(--stone) !important;
}
.in-day-note {
  margin-top: 8px !important;
  font-style: italic;
  color: var(--stone) !important;
}

/* Map */
.map-wrap {
  position: relative;
  height: calc(100vh - 180px);
  min-height: 440px;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  overflow: clip; /* never let focus/scrollIntoView scroll the map box */
  background: #0d1218;
}
.map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  z-index: 1;
}
.map-legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot.heritage { background: var(--blue); }
.dot.partner { background: var(--gold); }
.dot.you { background: var(--green-bright); }

.map-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-tool {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(18, 24, 32, 0.88);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: 0.15s ease;
}
.map-tool:hover {
  border-color: rgba(143, 184, 148, 0.45);
  transform: translateY(-1px);
}
.map-tool.active {
  background: rgba(111, 143, 114, 0.35);
  color: var(--green-bright);
  border-color: rgba(143, 184, 148, 0.5);
}
.map-tip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.78);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.78rem;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

/* Map help text: touch vs mouse wording */
.touch-only { display: none; }
@media (hover: none), (pointer: coarse) {
  .touch-only { display: inline; }
  .mouse-only { display: none; }
}

/* MapLibre theming */
.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-group {
  background: rgba(18, 24, 32, 0.92) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
  overflow: hidden;
}
.maplibregl-ctrl-group button {
  background-color: transparent !important;
  border-color: rgba(255,255,255,0.08) !important;
}
.maplibregl-ctrl-group button + button {
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon {
  filter: invert(1) brightness(1.1);
}
.maplibregl-ctrl-attrib {
  background: rgba(12,16,22,0.7) !important;
  color: #9aa8b5 !important;
  font-size: 10px !important;
}
.maplibregl-ctrl-attrib a { color: #b8c8d6 !important; }
.maplibregl-ctrl-scale {
  background: rgba(12,16,22,0.7) !important;
  border-color: rgba(255,255,255,0.25) !important;
  color: #c5d0da !important;
}

.maplibregl-popup.soton-popup .maplibregl-popup-content {
  background: rgba(22, 28, 36, 0.96);
  color: var(--text);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-family: var(--font);
}
.maplibregl-popup.soton-popup .maplibregl-popup-tip {
  border-top-color: rgba(22, 28, 36, 0.96);
}
.maplibregl-popup-close-button {
  color: #c5d0da !important;
  font-size: 18px !important;
  padding: 4px 8px !important;
}
.map-pop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}
.map-pop strong { font-size: 0.95rem; }
.map-pop em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.map-pop-btn {
  margin-top: 4px;
  border: 0;
  background: linear-gradient(135deg, #7fa383, #5f7d62);
  color: #0c120e;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.map-pop-btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
}
.map-pop-btn + .map-pop-btn { margin-top: 2px; }

.map-pop-partner.featured strong {
  font-family: var(--display);
  font-size: 1.05rem;
}
.map-pop-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1408;
  background: linear-gradient(135deg, #f0d59a, #d4a84b);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 6px;
}
.map-pop-offer {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(143, 184, 148, 0.16);
  border: 1px solid rgba(143, 184, 148, 0.28);
  color: #d7edd9;
  font-size: 0.82rem;
  line-height: 1.35;
}
.map-pop-list {
  margin: 8px 0 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}
.map-pop-list li { margin: 2px 0; }
.map-pop-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.maplibregl-popup.soton-popup-featured .maplibregl-popup-content {
  border-color: rgba(212, 168, 75, 0.55);
  background:
    radial-gradient(420px 140px at 100% 0%, rgba(255, 180, 70, 0.16), transparent 60%),
    rgba(22, 28, 36, 0.97);
}

.featured-map-pin {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.featured-map-pin-core {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffe09a, #d4a84b);
  color: #1a1408;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
  border: 2px solid #1a1408;
  z-index: 2;
}
.featured-map-pin-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(212, 168, 75, 0.35);
  animation: pinpulse 1.8s ease-out infinite;
  z-index: 1;
}
@keyframes pinpulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Trails */
.trail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.trail-detail {
  margin-top: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.trail-detail h3 {
  font-family: var(--display);
  margin: 0 0 8px;
}
.trail-stops {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  counter-reset: stop;
}
.trail-stops li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.trail-stops li:hover { color: var(--green-bright); }
.trail-stops li::before {
  counter-increment: stop;
  content: counter(stop);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(111,143,114,0.2);
  color: var(--green-bright);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Detail drawer */
.detail {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background: #12171d; /* solid: nothing behind should show through */
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 50;
  /* The drawer itself doesn't scroll; #detail-body does, so the × stays put */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 0;
  animation: slide 0.22s ease;
}
.detail.hidden { display: none !important; }
#detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 40px;
}
.detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 11, 0.55);
  z-index: 49;
}
@keyframes slide {
  from { transform: translateX(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10; /* always above the photo/video */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.detail .emoji { font-size: 2.6rem; margin-bottom: 8px; }
.detail h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  margin: 0 0 8px;
  padding-right: 40px;
}
.detail .label {
  color: var(--stone);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 6px;
}
.detail p { line-height: 1.55; color: var(--muted); margin: 0; }
.detail p.spoken-text { color: var(--text); }
.detail .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.speaking {
  outline: 2px solid rgba(143, 184, 148, 0.5);
}

/* Admin table */
.admin-table-wrap { overflow: auto; }
table.admin {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
table.admin th, table.admin td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.admin th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(0,0,0,0.2);
}
table.admin tr:last-child td { border-bottom: 0; }
table.admin tr:hover td { background: rgba(255,255,255,0.02); }
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge.on { background: rgba(111,143,114,0.2); color: var(--green-bright); }
.badge.off { background: rgba(217,118,118,0.15); color: #f0b0b0; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 20px;
}
.modal-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-head h3 {
  font-family: var(--display);
  margin: 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

code {
  font-size: 0.85em;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 18px; }
  .map { height: 55vh; }
}

/* ========== Mobile preview (phone frame) ========== */
.mobile-only { display: none !important; }
.desktop-only { display: revert; }

body.mobile-preview,
body.live-walk {
  overflow: auto;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(111, 143, 114, 0.2), transparent 55%),
    #0a0d11;
}

body.mobile-preview .welcome,
body.live-walk .welcome { display: none !important; }

/* Live walk = real phone full screen (no bezel) */
body.live-walk {
  overflow: hidden;
  height: 100%;
}
body.live-walk #mobile-stage { display: none !important; }
body.live-walk #shell.shell {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}
body.live-walk .desktop-only,
body.live-walk .desktop-nav { display: none !important; }
body.live-walk .mobile-only { display: flex !important; }
body.live-walk .sidebar {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding: max(12px, env(safe-area-inset-top)) 12px 8px;
  background: rgba(15, 20, 25, 0.96);
  gap: 0;
}
body.live-walk .mobile-topbar {
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
}
body.live-walk .mobile-topbar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
body.live-walk .brand-mark.sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.8rem;
}
body.live-walk .mobile-topbar strong { display: block; font-size: 0.92rem; }
body.live-walk .mobile-topbar small { color: var(--muted); font-size: 0.72rem; }
body.live-walk .main {
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
body.live-walk .card-grid,
body.live-walk .trail-grid { grid-template-columns: 1fr; }
body.live-walk .map-wrap {
  height: calc(100% - 70px);
  min-height: 280px;
  flex: 1;
}
body.live-walk #view-map.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
body.live-walk .mobile-tabbar {
  display: flex !important;
  justify-content: space-around;
  align-items: stretch;
  gap: 2px;
  padding: 6px 4px calc(12px + env(safe-area-inset-bottom));
  background: rgba(12, 16, 20, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 30;
}
body.live-walk .tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 500;
  border-radius: 10px;
}
body.live-walk .tab-btn .tab-icon { font-size: 1.05rem; line-height: 1.2; }
body.live-walk .tab-btn.active {
  color: var(--green-bright);
  background: rgba(111, 143, 114, 0.12);
}
body.live-walk .detail {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  height: 88%;
  max-height: 88%;
  border-left: 0;
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px 0;
  z-index: 40;
}
body.live-walk #detail-body { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
body.live-walk .detail-backdrop,
body.mobile-preview .detail-backdrop {
  position: absolute;
  z-index: 39;
}
/* Phone layouts: toolbar as a single row along the top so it never covers popups or hides zoom */
body.live-walk .map-toolbar,
body.mobile-preview .map-toolbar {
  top: 8px;
  left: 8px;
  right: 50px;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
}
body.live-walk .maplibregl-popup-content,
body.mobile-preview .maplibregl-popup-content {
  max-height: 34vh;
  overflow-y: auto;
}
body.live-walk .map-tool,
body.mobile-preview .map-tool {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.8rem;
}
body.live-walk .detail-handle {
  display: block !important;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  margin: 2px auto 10px;
}
body.live-walk #btn-more-exit-mobile { display: none !important; }
body.mobile-preview #modal { z-index: 200; }

.mobile-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 32px;
  gap: 14px;
}
.mobile-stage.hidden { display: none !important; }

.mobile-stage-bar {
  width: min(920px, 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 4px 8px;
}
.mobile-stage-bar strong {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
}
.mobile-stage-bar span {
  color: var(--muted);
  font-size: 0.88rem;
}
.mobile-stage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.device-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.device-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}
.device-btn.active {
  background: rgba(143, 184, 148, 0.2);
  color: var(--green-bright);
  font-weight: 600;
}
.mobile-stage-hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
  text-align: center;
}

.phone-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.phone {
  position: relative;
  width: 390px;
  height: 844px;
  max-height: min(844px, calc(100vh - 140px));
  background: #000;
  border-radius: 48px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a3038,
    0 0 0 6px #12161c,
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.phone.device-android {
  border-radius: 36px;
  width: 380px;
  height: 820px;
  max-height: min(820px, calc(100vh - 140px));
  box-shadow:
    0 0 0 2px #3a3f46,
    0 0 0 5px #1a1e24,
    0 30px 80px rgba(0, 0, 0, 0.55);
}
.phone.device-android .phone-notch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #0a0a0a;
  border: 2px solid #1c1c1c;
}
.phone.device-android .phone-home-bar {
  width: 120px;
  height: 4px;
  bottom: 10px;
}

.phone-notch {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 20;
  pointer-events: none;
}
.phone-status {
  position: absolute;
  top: 14px;
  left: 28px;
  right: 28px;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  pointer-events: none;
  letter-spacing: 0.02em;
}
.phone-status-icons { font-size: 0.62rem; opacity: 0.85; }
.phone-home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.35);
  z-index: 20;
  pointer-events: none;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 38px;
  overflow: hidden;
  background: var(--bg);
}
.phone.device-android .phone-screen {
  border-radius: 28px;
}

/* When body.mobile-preview, shell is inside phone-screen */
body.mobile-preview .phone-screen > .shell,
body.mobile-preview #shell.shell {
  height: 100%;
  max-height: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: var(--bg);
}

body.mobile-preview .shell {
  display: grid !important;
}

body.mobile-preview .desktop-only,
body.mobile-preview .desktop-nav {
  display: none !important;
}

body.mobile-preview .mobile-only {
  display: flex !important;
}

body.mobile-preview .sidebar {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding: 44px 12px 8px;
  background: rgba(15, 20, 25, 0.96);
  gap: 0;
}

body.mobile-preview .mobile-topbar {
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
}
body.mobile-preview .mobile-topbar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
body.mobile-preview .brand-mark.sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.8rem;
}
body.mobile-preview .mobile-topbar strong {
  display: block;
  font-size: 0.92rem;
}
body.mobile-preview .mobile-topbar small {
  color: var(--muted);
  font-size: 0.72rem;
}

body.mobile-preview .main {
  padding: 12px 14px 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

body.mobile-preview .view-head h2 {
  font-size: 1.35rem;
}
body.mobile-preview .view-head p {
  font-size: 0.82rem;
}
body.mobile-preview .card-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}
body.mobile-preview .trail-grid {
  grid-template-columns: 1fr;
}
body.mobile-preview .hero-card {
  padding: 0 0 16px;
  overflow: hidden;
}
body.mobile-preview .hero-card .distance,
body.mobile-preview .hero-card h3,
body.mobile-preview .hero-card .spoken,
body.mobile-preview .hero-card .hero-actions {
  padding-left: 16px;
  padding-right: 16px;
}
body.mobile-preview .hero-card .distance { padding-top: 12px; }
body.mobile-preview .media-frame.hero-media {
  margin: 0 0 0;
  max-height: 200px;
  aspect-ratio: 16 / 10;
}
body.mobile-preview .map-wrap {
  height: calc(100% - 70px);
  min-height: 300px;
  border-radius: 14px;
  flex: 1;
}
body.mobile-preview .map {
  min-height: 280px;
  height: 100%;
}

body.mobile-preview .map-tip {
  font-size: 0.68rem;
  padding: 6px 8px;
  bottom: 8px;
}
/* Only style map as flex column when it is the active tab — never force it visible */
body.mobile-preview #view-map.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
body.mobile-preview #view-map .view-head {
  margin-bottom: 10px;
  flex-shrink: 0;
}
body.mobile-preview #view-sites.active,
body.mobile-preview #view-trails.active,
body.mobile-preview #view-near.active,
body.mobile-preview #view-more.active {
  display: block;
}
body.mobile-preview .search {
  width: 100%;
  min-width: 0;
}
body.mobile-preview .view-head.row {
  flex-direction: column;
  align-items: stretch;
}

/* Bottom tab bar */
body.mobile-preview .mobile-tabbar {
  display: flex !important;
  justify-content: space-around;
  align-items: stretch;
  gap: 2px;
  padding: 6px 4px 18px;
  background: rgba(12, 16, 20, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  z-index: 30;
}
body.mobile-preview .tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 500;
  border-radius: 10px;
}
body.mobile-preview .tab-btn .tab-icon {
  font-size: 1.05rem;
  line-height: 1.2;
}
body.mobile-preview .tab-btn.active {
  color: var(--green-bright);
  background: rgba(111, 143, 114, 0.12);
}

/* Detail as bottom sheet on mobile */
body.mobile-preview .detail {
  position: absolute;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  height: 88%;
  max-height: 88%;
  border-left: 0;
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px 0;
  animation: sheet-up 0.28s ease;
  z-index: 40;
}
body.mobile-preview #detail-body { padding-bottom: 36px; }
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
body.mobile-preview .detail-handle {
  display: block !important;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  margin: 2px auto 10px;
}
body.mobile-preview .detail-close {
  top: 12px;
  right: 12px;
}
body.mobile-preview .detail .media-frame {
  aspect-ratio: 16 / 11;
  max-height: 200px;
}
body.mobile-preview .detail h2 {
  font-size: 1.35rem;
}
body.mobile-preview .detail .actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, rgba(18,23,29,0.95) 30%);
  padding: 12px 0 4px;
  margin-top: 8px;
}
body.mobile-preview .detail .actions .btn {
  flex: 1;
  justify-content: center;
  text-align: center;
}

/* More panel */
.more-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.more-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}
.more-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.more-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.more-card strong { font-size: 0.95rem; }
.more-card span { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.visited-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visited-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(143, 184, 148, 0.1);
  border: 1px solid rgba(143, 184, 148, 0.2);
  font-size: 0.88rem;
}
.visited-list li span {
  color: var(--muted);
  font-size: 0.75rem;
}

.admin-showcase {
  background:
    radial-gradient(700px 220px at 100% 0%, rgba(255, 180, 70, 0.16), transparent 55%),
    var(--panel);
  border: 1px solid rgba(212, 168, 75, 0.4);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 8px;
}
.admin-showcase h3 {
  font-family: var(--display);
  margin: 6px 0 8px;
  font-size: 1.4rem;
}
.admin-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 800px) {
  .admin-showcase-grid { grid-template-columns: 1fr; }
}

/* Scale phone slightly on smaller desktop windows */
@media (max-height: 900px) {
  .phone {
    transform: scale(0.92);
    transform-origin: top center;
  }
}
@media (max-height: 800px) {
  .phone {
    transform: scale(0.82);
    transform-origin: top center;
  }
}

/* ---- Round 2: accessibility heading, settings toggle, install hint, notch ---- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}
.toggle-row > span { display: grid; gap: 4px; }
.toggle-row strong { color: var(--text); }
.toggle-row .more-note { margin: 0; }
.toggle-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle-row input[type="checkbox"]:checked { background: var(--green); }
.toggle-row input[type="checkbox"]:checked::after { transform: translateX(20px); background: #fff; }
.toggle-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }

.install-hint {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #1a222c;
  border: 1px solid rgba(196, 181, 160, 0.35);
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
}
.install-hint img { border-radius: 10px; flex: none; }
.install-hint-text { display: grid; gap: 2px; font-size: 0.85rem; flex: 1; min-width: 0; }
.install-hint-text span { color: var(--muted); line-height: 1.35; }
.install-hint-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.share-glyph {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.15em;
}

/* iPhone notch / rounded corners (viewport-fit=cover).
   The welcome overlay handles its own safe area. */
body.live-walk #shell.shell {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ---------- Premium unlock ---------- */
.btn.is-locked { opacity: 0.92; }
.lock-ico { font-size: 0.85em; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.media-frame.media-locked { position: relative; }
.media-lock-btn {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 14, 18, 0.78);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.media-lock-btn:hover { background: rgba(10, 14, 18, 0.92); }
.media-frame.media-locked .media-credit { padding-left: 0; }
.trail-card { position: relative; }
.trail-card.is-locked { cursor: pointer; }
.trail-card.is-locked h3 { padding-right: 96px; }
.lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(212, 168, 75, 0.16);
  color: #f1d38c;
  border: 1px solid rgba(212, 168, 75, 0.35);
}
.premium-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  text-align: left;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 75, 0.35);
  background: linear-gradient(135deg, rgba(212, 168, 75, 0.14), rgba(111, 143, 114, 0.1)), var(--panel);
  color: var(--text);
}
.premium-banner > div { display: grid; gap: 4px; }
.premium-banner span { color: var(--muted); font-size: 0.88rem; line-height: 1.4; }
.premium-banner .btn { flex: none; }
button.premium-banner { cursor: pointer; font: inherit; }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: end center;
  padding: 12px;
}
@media (min-width: 700px) { .sheet-backdrop { place-items: center; } }
.sheet-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: 22px;
  padding: 24px 22px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-card h2 { font-family: var(--display); font-size: 1.45rem; margin: 0 0 8px; padding-right: 36px; }
.sheet-card .eyebrow { margin-bottom: 6px; }
.unlock-lead { color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.feature-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; }
.feature-list li.hl { background: rgba(143, 184, 148, 0.1); outline: 1px solid rgba(143, 184, 148, 0.3); }
.feature-list .feat-ico { font-size: 1.3rem; line-height: 1.2; }
.feature-list strong { display: block; }
.feature-list small { color: var(--muted); font-size: 0.85rem; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.price-now { font-size: 1.8rem; font-weight: 700; color: var(--text); }
.price-now.sm { font-size: 1rem; }
.price-was { color: var(--muted); font-size: 1.05rem; }
.price-note { color: var(--stone); font-size: 0.82rem; flex-basis: 100%; }
.pay-btn { width: 100%; padding: 14px 18px; font-size: 1.02rem; }
.pay-note { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 8px 0 4px; }
.unlock-msg { min-height: 1.2em; color: #f3c0a0; font-size: 0.88rem; margin: 6px 0; }
.linkish { background: none; border: 0; color: var(--green-bright); text-decoration: underline; cursor: pointer; padding: 6px 0; }
.restore-form { display: grid; gap: 10px; margin-top: 6px; }
.restore-form input { text-transform: uppercase; letter-spacing: 0.08em; }
.demo-flag {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #7a1d17;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.code-box {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  margin: 6px 0 10px;
  border-radius: 12px;
  border: 1px dashed rgba(212, 168, 75, 0.55);
  background: rgba(212, 168, 75, 0.08);
}
.code-box span { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }
.code-box strong { font-size: 1.25rem; letter-spacing: 0.08em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.code-inline { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); letter-spacing: 0.04em; }
.more-card-btn { text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.more-card-btn:hover { border-color: rgba(255, 255, 255, 0.2); }
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 95;
  max-width: min(460px, calc(100vw - 24px));
  padding: 12px 16px;
  border-radius: 14px;
  background: #26303b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.4;
}
.muted-sm { color: var(--muted); font-size: 0.82rem; }
.admin-premium { margin-top: 28px; }
.admin-premium-head h3 { font-family: var(--display); margin: 0 0 4px; }
.comp-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.comp-form .field { flex: 1 1 200px; margin: 0; }

/* ---------- Cruise mode ---------- */
.cruise-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #1f2a36;
  border: 1px solid rgba(255, 164, 92, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-size: 0.88rem;
}
.cruise-bar > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.35; }
.cruise-bar .cb-clock { font-variant-numeric: tabular-nums; font-size: 1rem; }
.cruise-bar[data-phase="soon"] { border-color: #ffc857; }
.cruise-bar[data-phase="headback"],
.cruise-bar[data-phase="overdue"] {
  background: #6e1a14;
  border-color: #ff8a80;
  color: #fff;
  animation: cruisePulse 1.6s ease-in-out infinite;
}
.cruise-bar[data-phase="headback"] .btn,
.cruise-bar[data-phase="overdue"] .btn { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
@keyframes cruisePulse { 50% { box-shadow: 0 0 0 4px rgba(255, 138, 128, 0.35); } }
@media (prefers-reduced-motion: reduce) { .cruise-bar { animation: none !important; } }
.cruise-fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.cruise-fieldset legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.terminal-list { display: grid; gap: 8px; }
.terminal-opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}
.terminal-opt:has(input:checked) { border-color: var(--green-bright); background: rgba(143, 184, 148, 0.08); }
.terminal-opt input { margin-top: 4px; accent-color: var(--green-bright); }
.terminal-text { display: grid; gap: 3px; }
.terminal-text small { color: var(--muted); font-size: 0.84rem; }
.walk-flag { color: #ffc98f; font-size: 0.82rem; font-weight: 600; }
p.walk-flag { margin: 6px 0 0; }
.seg { display: flex; gap: 8px; }
.seg-opt { flex: 1; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
}
.seg-opt input:checked + span { border-color: var(--green-bright); background: rgba(143, 184, 148, 0.16); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.cruise-aboard input[type="time"] { max-width: 180px; }
.cruise-disclaimer { color: var(--stone); font-size: 0.84rem; line-height: 1.45; margin: 14px 0 0; }
.cruise-countdown {
  text-align: center;
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 164, 92, 0.16), rgba(110, 168, 217, 0.08)), var(--panel);
  border: 1px solid rgba(255, 164, 92, 0.35);
  margin-bottom: 14px;
}
.cruise-countdown .label { color: var(--stone); font-size: 0.85rem; }
.cruise-clock { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; margin: 4px 0; }
.cruise-headback { color: var(--text); font-size: 0.95rem; }
.cruise-countdown[data-phase="headback"],
.cruise-countdown[data-phase="overdue"] { background: #6e1a14; border-color: #ff8a80; }
.cruise-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.cruise-summary strong { color: var(--text); }
.terminal-info {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.terminal-info p { color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.cruise-stops { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.cruise-stops li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.cruise-stops li:has(.cs-btn) { padding: 0; }
.cs-btn {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cs-btn:hover { background: rgba(255, 255, 255, 0.03); }
.cs-btn:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 2px; }
.cs-text { display: grid; gap: 2px; }
.cruise-stops .num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffa45c;
  color: #1a0e04;
  font-weight: 700;
  font-size: 0.85rem;
}
.cruise-stops .cs-terminal .num { background: #ffffff; }
.cruise-stops strong { display: block; }
.cruise-stops small { color: var(--muted); font-size: 0.83rem; }
.terminal-teaser { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.terminal-teaser li { padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px dashed var(--line); }
.sheet-card .demo-flag { margin-right: 44px; }
@media (max-height: 900px) {
  .feature-list { gap: 4px; margin-bottom: 10px; }
  .feature-list li { padding: 6px 8px; }
  .unlock-lead { margin-bottom: 8px; }
  .sheet-card h2 { font-size: 1.3rem; }
}

/* Location helper: large, easy-to-read text */
.loc-card { font-size: 1.12rem; }
.loc-card h2 { font-size: 1.7rem; line-height: 1.2; }
.loc-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; }
.loc-lead { font-size: 1.22rem; line-height: 1.5; color: var(--text); margin: 0 0 14px; }
.loc-small { font-size: 1.05rem; line-height: 1.5; color: var(--muted); margin: 0 0 18px; }
.loc-device { font-size: 1rem; font-weight: 700; color: var(--gold); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.loc-steps { margin: 0 0 20px; padding-left: 1.6em; }
.loc-steps li { font-size: 1.15rem; line-height: 1.6; margin-bottom: 14px; padding-left: 4px; }
.loc-steps li::marker { font-weight: 700; color: var(--green-bright); }
.loc-path { font-weight: 700; color: var(--text); background: rgba(143, 184, 148, 0.14); border-radius: 6px; padding: 0 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.loc-big { display: block; width: 100%; font-size: 1.25rem; padding: 16px 20px; min-height: 58px; }
.loc-link { display: block; margin: 12px auto 0; font-size: 1.15rem; padding: 12px 16px; min-height: 48px; }
/* Keep "Try again" in reach while the steps scroll */
.loc-actions { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 0 -22px calc(-20px - env(safe-area-inset-bottom)); padding: 14px 22px calc(12px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.loc-actions .loc-link { margin-top: 6px; }

/* Refresh location: Near button, "Updating your location…" pill, pull-down hint */
.refresh-loc-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0 0 14px;
  font-size: 1.12rem;
  font-weight: 700;
}
.loc-updating,
.pull-hint {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(14px + env(safe-area-inset-top));
  z-index: 96;
  width: max-content;
  max-width: min(460px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 14px 20px;
  border-radius: 999px;
  background: #1f3a5a;
  border: 1px solid rgba(110, 168, 217, 0.55);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}
.loc-updating.done { background: #25432a; border-color: rgba(143, 184, 148, 0.6); }
.loc-updating.warn { background: #4a3a1c; border-color: rgba(212, 168, 75, 0.6); border-radius: 18px; }
.pull-hint { background: #26303b; border-color: rgba(255, 255, 255, 0.18); }
.pull-hint.ready { background: #1f3a5a; border-color: rgba(110, 168, 217, 0.55); }
.loc-updating.hidden,
.pull-hint.hidden { display: none; }

/* ========== Phase 2: languages + every phone/tablet size ========== */
/* "Narration in English" note under Listen when another language is chosen */
.narr-note {
  margin: 8px 0 4px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.4;
}
/* Long German/Polish words must wrap instead of pushing the page sideways */
.view-head h2,
.view-head p,
.hero-card,
.more-card,
.site-card,
.trail-card,
.btn,
.chip,
.map-pop,
.sheet-card,
.cruise-bar,
#detail-body { overflow-wrap: anywhere; word-break: normal; hyphens: auto; }
.btn { white-space: normal; }
/* Bigger, easier-to-read bottom tabs (text wraps to two lines rather than being cut off) */
body.live-walk .tab-btn {
  font-size: 0.78rem;
  line-height: 1.15;
  min-height: 52px;
  justify-content: center;
  text-align: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
body.live-walk .tab-btn .tab-icon { font-size: 1.25rem; }
body.live-walk .tab-btn span:not(.tab-icon) { max-width: 100%; }
/* Tablets / wide touch screens (incl. Android "Desktop site"): keep the phone layout readable */
@media (min-width: 700px) {
  body.live-walk .view:not(#view-map) {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }
  body.live-walk .card-grid,
  body.live-walk .trail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.live-walk .detail {
    max-width: 760px;
    margin: 0 auto;
  }
  body.live-walk .mobile-tabbar { justify-content: center; }
  body.live-walk .tab-btn { flex: 0 1 150px; font-size: 0.9rem; }
  /* aspect-ratio + max-height was shrinking the hero photo to ~500px wide */
  body.live-walk .media-frame.hero-media {
    aspect-ratio: auto;
    max-height: none;
    height: clamp(220px, 38vw, 360px);
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  body.live-walk .media-frame.hero-media { height: 52vh; }
  body.live-walk #detail-body .media-frame { aspect-ratio: auto; height: 58vh; }
}
/* Phones turned sideways / short screens: compact the bars so content still fits */
@media (max-height: 500px) and (orientation: landscape) {
  body.live-walk .sidebar { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 2px; }
  body.live-walk .mobile-topbar { padding: 2px 4px 4px; }
  body.live-walk .mobile-tabbar { padding: 2px 4px calc(4px + env(safe-area-inset-bottom)); }
  body.live-walk .tab-btn { flex-direction: row; gap: 6px; min-height: 40px; padding: 4px; }
  body.live-walk .tab-btn .tab-icon { font-size: 1.05rem; }
  body.live-walk .detail { height: 94%; max-height: 94%; }
  .welcome-copy { margin-bottom: 10px; }
  .welcome-greeting { font-size: 1.4rem; margin-bottom: 4px; }
  .welcome-copy h1 { font-size: 1.6rem; margin-bottom: 6px; }
  .welcome-line { font-size: 0.98rem; margin-bottom: 4px; }
  .welcome-card { padding: 12px 14px; }
  .welcome-langs { gap: 6px; margin-bottom: 10px; }
  .lang-chip { min-height: 44px; padding: 8px 12px; }
  .welcome-actions { flex-direction: row; }
  .welcome-actions .btn { width: auto; flex: 1 1 200px; }
  .welcome-foreground { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* ========== 7-day pass ========== */
.pass-ended {
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(232, 120, 90, 0.55);
  background: rgba(232, 120, 90, 0.14);
  color: #ffd9cc;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.pass-ended strong { display: block; color: #ffb59e; font-size: 1.05rem; margin-bottom: 2px; }
.pass-ended span { display: block; }
.pass-until {
  display: block;
  margin: 4px 0 10px;
  color: #bfe3c4;
  font-weight: 600;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.pass-extend { margin-top: 14px; }
.pass-extend .btn { width: 100%; }

/* ========== Review fixes (2026-10-07) ========== */
/* One story text per place */
.detail p.story-text { color: var(--text); font-size: 1.06rem; line-height: 1.6; margin-top: 4px; }

/* Photo credit: its own readable line; the film lock button sits top-left so it never covers it */
.media-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.media-credit { font-size: 0.72rem; pointer-events: auto; }
/* top-left: clear of the credit (bottom) and of the story's × (top-right) */
.media-lock-btn {
  left: 12px;
  right: auto;
  bottom: auto;
  top: 12px;
  min-height: 44px;
  max-width: calc(100% - 24px);
}
.media-frame.media-locked .media-credit { padding-left: 10px; }

/* Map pop-ups never wider than the screen */
.maplibregl-popup-content { max-width: calc(100vw - 40px); box-sizing: border-box; }

/* Browse without GPS: start-place picker on Near */
.near-explore { margin: 0 0 14px; }
.near-explore > span { font-size: 0.95rem; color: var(--text); font-weight: 600; }
.near-explore select { min-height: 52px; font-size: 1.05rem; width: 100%; }
#fake-location-mobile { min-height: 52px; font-size: 1.05rem; }

/* Sites list */
.card-dist { color: var(--green-bright); font-weight: 600; font-size: 0.92rem; margin: -2px 0 6px; }
.empty-search {
  padding: 18px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 1.02rem;
  line-height: 1.45;
}
.empty-search p { margin: 0 0 6px; }
.empty-search p:last-child { margin: 0; color: var(--muted); }

/* ---- Bottom tabs: always visible, never under system bars, ≥48 px targets ---- */
body.live-walk .mobile-tabbar {
  position: relative;
  z-index: 45; /* above the story sheet (40) and its backdrop (39) */
  padding-left: max(4px, env(safe-area-inset-left));
  padding-right: max(4px, env(safe-area-inset-right));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
body.live-walk .tab-btn {
  min-height: 52px;
  min-width: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
body.live-walk .tab-btn:focus-visible { outline: 3px solid var(--green-bright); outline-offset: -3px; }
body.live-walk .tab-btn.active { font-weight: 700; }
body.live-walk .tab-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--green-bright);
}
/* The story sheet stops above the tab bar, so the tabs stay visible and tappable */
body.live-walk .detail {
  bottom: var(--tabbar-h, 72px);
  height: calc(88% - var(--tabbar-h, 72px));
  max-height: calc(88% - var(--tabbar-h, 72px));
  min-height: 200px;
}
body.live-walk #detail-body { padding-bottom: 28px; }
body.live-walk .detail-backdrop { bottom: var(--tabbar-h, 72px); }
/* Toasts and the home-screen hint sit just above the tabs */
body.live-walk .toast { bottom: calc(var(--tabbar-h, 72px) + 12px); }
body.live-walk .install-hint { bottom: calc(var(--tabbar-h, 72px) + 12px); }
@media (max-height: 500px) and (orientation: landscape) {
  body.live-walk .tab-btn { min-height: 48px; }
  body.live-walk .mobile-tabbar { padding-bottom: max(2px, env(safe-area-inset-bottom)); }
  body.live-walk .detail {
    height: calc(96% - var(--tabbar-h, 52px));
    max-height: calc(96% - var(--tabbar-h, 52px));
    min-height: 0;
  }
}
/* Short screens in portrait too (e.g. the keyboard is open for search, or very large text):
   compact top bar and one-line tabs, so the search box and the tabs both stay visible */
@media (max-height: 460px) {
  body.live-walk .sidebar { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 2px; }
  body.live-walk .mobile-topbar { padding: 2px 4px 4px; }
  body.live-walk #mobile-loc-label { display: none; }
  body.live-walk .mobile-tabbar { padding-top: 2px; padding-bottom: max(2px, env(safe-area-inset-bottom)); }
  body.live-walk .tab-btn { flex-direction: row; gap: 4px; min-height: 48px; padding: 4px 2px; }
  body.live-walk .tab-btn .tab-icon { font-size: 1.05rem; }
}
@media (max-height: 460px) and (orientation: portrait) {
  body.live-walk .tab-btn .tab-icon { display: none; }
}
/* Large text settings: tab labels grow, but are capped so a word is never split across lines on a small phone */
body.live-walk .tab-btn { font-size: min(0.78rem, 16px); }
body.live-walk .tab-btn .tab-icon { font-size: min(1.25rem, 24px); }
@media (min-width: 700px) {
  body.live-walk .tab-btn { font-size: min(0.9rem, 20px); }
}
/* The home-screen hint wraps its buttons under the text when text is large */
.install-hint { flex-wrap: wrap; max-height: 60vh; overflow-y: auto; }
.install-hint-text { flex: 1 1 180px; }
.install-hint-actions { flex-direction: row; flex-wrap: wrap; }
@media (max-height: 500px) {
  body.live-walk .tab-btn .tab-icon { font-size: min(1.05rem, 20px); }
}

/* ---------- Photo gallery in a story (2026-10-07 photos) ---------- */
.photo-gallery { margin: 18px 0 6px; }
.gallery-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 10px;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}
.gallery-item { flex: 0 0 auto; width: min(46vw, 210px); scroll-snap-align: start; }
.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--panel);
}
.gallery-cap {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 8px 10px 10px;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--text);
}
.gallery-thumb:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.photo-viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--tabbar-h, 0px); /* stops above the bottom tabs so they stay usable */
  z-index: 65;
  display: flex;
  flex-direction: column;
  background: #05080b;
  color: var(--text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.photo-viewer.hidden { display: none !important; }
.pv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 4px 16px;
  flex: 0 0 auto;
}
.pv-count { font-size: 1.05rem; color: var(--muted); }
.pv-close {
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.pv-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
}
.pv-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 52px;
  min-height: 64px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}
.pv-prev { left: 6px; }
.pv-next { right: 6px; }
.photo-viewer.single .pv-nav { display: none; }
.pv-close:focus-visible, .pv-nav:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pv-info {
  flex: 0 0 auto;
  max-height: 40%;
  overflow-y: auto;
  padding: 12px 18px calc(14px + var(--pv-pad-b, 0px));
}
.pv-caption { margin: 0 0 8px; font-size: 1.3rem; line-height: 1.35; color: #fff; }
.pv-credit { margin: 0; font-size: 0.95rem; line-height: 1.4; color: var(--muted); }
.pv-credit a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
/* No tab bar (desktop / welcome): keep clear of the home bar */
body:not(.live-walk) .photo-viewer { --pv-pad-b: env(safe-area-inset-bottom); }
@media (orientation: landscape) and (max-height: 500px) {
  .photo-viewer { flex-direction: column; }
  .pv-top { padding-top: 2px; padding-bottom: 0; }
  .pv-close { min-width: 48px; min-height: 48px; font-size: 1.7rem; }
  .pv-info { padding-top: 4px; padding-bottom: 6px; max-height: 32%; }
  .pv-caption { font-size: 1.2rem; margin-bottom: 2px; }
  .pv-credit { font-size: 0.85rem; }
}
@media (min-width: 900px) {
  .gallery-item { width: 220px; }
}

/* Stuck-map fix (r16): on phones the map must never be taller than its box (the desktop
   min-height of 420px made it spill over the bottom tabs; iOS Safari does not always clip a
   WebGL map inside a rounded box), and there is a big Back button. */
.map-back { display: none; }
body.live-walk .map-wrap,
body.mobile-preview .map-wrap {
  isolation: isolate;
  -webkit-mask-image: linear-gradient(#000, #000);
  mask-image: linear-gradient(#000, #000);
}
body.live-walk .map,
body.mobile-preview .map {
  min-height: 0;
  height: 100%;
}
body.live-walk .map-wrap {
  height: auto;
  flex: 1 1 0;
  min-height: 200px;
}
body.live-walk #view-map .map-head-text,
body.mobile-preview #view-map .map-head-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
}
body.live-walk #view-map .map-head-text > p,
body.mobile-preview #view-map .map-head-text > p {
  flex-basis: 100%;
}
body.live-walk .map-back,
body.mobile-preview .map-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  min-width: 52px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  color: #0c1014;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  flex: 0 0 auto;
}
body.live-walk .map-back:focus-visible,
body.mobile-preview .map-back:focus-visible {
  outline: 3px solid #ffc857;
  outline-offset: 3px;
}

/* ========== Welcome: invite people to use location (r17) ========== */
.gps-head {
  margin: 4px 0 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  color: #f7f1e7;
  overflow-wrap: break-word;
}
.gps-benefits {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.gps-benefits li {
  position: relative;
  padding-left: 30px;
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.35;
  color: rgba(244, 239, 230, 0.94);
  overflow-wrap: break-word;
}
.gps-benefits li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 0;
  font-weight: 800;
  color: #9fd4a6;
}
.welcome .btn.gps-go {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(116, 186, 128, 0.35);
  white-space: normal;
}
.welcome .hint.gps-privacy {
  margin: 10px 0 2px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(244, 239, 230, 0.82);
}
.gps-skip {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 2px 0 0;
  padding: 10px 8px;
  border: 0;
  background: none;
  color: rgba(244, 239, 230, 0.72);
  font: inherit;
  font-size: 1rem;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gps-skip:focus-visible { outline: 3px solid #ffc857; outline-offset: 2px; border-radius: 8px; }
/* Same quiet link inside the location sheet */
.loc-skip { color: var(--muted); font-size: 1.05rem; margin-top: 6px; }
.loc-privacy { font-size: 1rem; line-height: 1.45; color: var(--muted); margin: 12px 0 0; text-align: center; }
/* Short phones: tighten the welcome so the whole card fits without scrolling */
@media (max-height: 760px) {
  .welcome-copy .welcome-line:nth-of-type(3) { display: none; }
  .welcome-kicker { display: none; }
  .welcome-copy { margin-bottom: 12px; }
  .welcome-greeting { margin-bottom: 6px; }
  .welcome-kicker { margin-bottom: 6px; }
  .welcome-copy h1 { margin-bottom: 8px; }
  .welcome-card { padding: 14px 14px 10px; }
  .welcome-langs { gap: 6px; margin-bottom: 10px; }
  .lang-chip { min-height: 44px; padding: 9px 12px; font-size: 1rem; }
  .welcome-foreground { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
}
@media (max-height: 600px) {
  .welcome-kicker { display: none; }
  .welcome-greeting { font-size: 1.45rem; }
  .gps-head { font-size: 1.18rem; }
  .gps-benefits li { font-size: 1rem; margin-bottom: 4px; }
  .welcome .btn.gps-go { min-height: 52px; }
}
/* Near / Map: gentle invitation when browsing without location */
.gps-nudge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(159, 212, 166, 0.35);
  border-radius: 14px;
  background: rgba(116, 186, 128, 0.1);
}
.gps-nudge.hidden { display: none; }
.gps-nudge p { flex: 1 1 180px; margin: 0; font-size: 1.05rem; line-height: 1.4; color: var(--text); }
.gps-nudge .btn { flex: 0 0 auto; min-height: 48px; font-size: 1.05rem; font-weight: 700; }
.gps-nudge-compact { margin: 0 0 8px; padding: 8px 10px; flex-wrap: nowrap; flex-shrink: 0; }
.gps-nudge-compact p { font-size: 0.98rem; line-height: 1.3; }
.gps-nudge-compact .btn { min-height: 44px; padding: 8px 14px; }
/* Very narrow, short phones (320 px wide): drop the intro line so the choice stays in view */
@media (max-width: 360px) and (max-height: 760px) {
  .welcome-copy .welcome-line { display: none; }
  .gps-head { margin-top: 0; }
  .gps-benefits { margin-bottom: 10px; }
}
/* Map: just one compact button, so the map stays big */
.gps-nudge-compact { padding: 0; border: 0; background: none; }
.gps-nudge-compact .btn { width: 100%; }

/* ========== Venue card / popup (Tsunami Beach Bars), plain venue, no ad framing (r18) ========== */
.venue-hours { margin: 6px 0 0; font-size: 1rem; line-height: 1.4; color: var(--muted); }
.venue-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.venue-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft, rgba(255,255,255,0.06));
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
.venue-link:focus-visible { outline: 3px solid #ffc857; outline-offset: 2px; }
.venue-pop .venue-links { gap: 6px; }
.venue-pop .venue-link { min-height: 44px; padding: 6px 12px; font-size: 0.98rem; }
.venue-pop strong { display: block; font-family: var(--display); font-size: 1.15rem; }
.venue-pop em { display: block; font-size: 1rem; line-height: 1.35; margin-top: 2px; }
.venue-pop .venue-hours { font-size: 0.95rem; }
.venue-pop .map-pop-meta { font-size: 0.95rem; }

/* Map tip fades away so it doesn't cover place names (r19) */
.map-tip { transition: opacity 0.6s ease; }
.map-tip.is-gone { opacity: 0; pointer-events: none; }

/* Advertiser small print (Tsunami card + bottom of More), 12 Oct */
.advertise-line { margin: 10px 0 0; text-align: right; font-size: 0.72rem; line-height: 1.3; opacity: 0.8; }
.advertise-line a { color: var(--muted, #9aa7b3); text-decoration: underline; }

/* Launch package 13 Oct: free vs Premium line */
.free-vs-premium { flex-basis: 100%; display: block; margin-top: 6px; font-size: 0.8rem; line-height: 1.4; color: var(--muted, #9aa7b3); }

/* r24: iPhone Safari's floating toolbar (iOS 26) must never cover the bottom tabs.
   Full-height layout uses dvh (vh fallback); on iPhone Safari (not the home-screen app) the
   shell follows the visible viewport height measured in app.js (--app-h), and the tabs keep
   their home-indicator padding. The r16 map clipping and r19 tab-bar rules are unchanged. */
body.live-walk { height: 100vh; height: 100dvh; }
/* The phone-width rule "min-height: 100vh" (the LARGE viewport, i.e. as if the browser bars were
   hidden) beat the dvh height and pushed the tabs under Safari's toolbar: the live shell never
   grows past the visible screen. */
body.live-walk #shell.shell { min-height: 0; }
html.ios-browser body.live-walk,
html.ios-browser body.live-walk #shell.shell {
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
}
body.live-walk .mobile-tabbar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }

/* r31 practical pins (station) */
.map-pop-practical p { margin: 4px 0 6px; font-size: 0.85rem; line-height: 1.35; }
/* r32: map popups sit above the map credits */
.maplibregl-popup { z-index: 3; }

/* Paid film + narration: shown only if the phone blocked the story's audio (r43) */
.tap-to-hear { position: sticky; top: 8px; z-index: 5; display: block; margin: 0 auto 10px; font-size: 0.95rem; }

/* Review prompt (r46): gentle card at the end of a stop page */
.review-prompt { margin: 18px 0 8px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); }
.review-prompt .review-title { font-weight: 600; margin: 0 0 4px; }
.review-prompt p { margin: 0 0 10px; }
.review-prompt .review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-prompt .review-actions a { text-decoration: none; }

/* Free taster (r48) */
.taster-note { margin: 10px 0 4px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); font-size: 0.95rem; }
.taster-upsell { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }

/* r50: review card floats above the tab bar so it is always seen */
.review-prompt.review-float { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-h, 0px) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 85; margin: 0; max-width: 520px; margin-inline: auto; background: #1d2430; box-shadow: 0 10px 30px rgba(0,0,0,0.45); }
