/* Sitka Stories Walk — Professional Tour Layout (VoiceMap-inspired) */

:root {
  --forest-950: #0a1612;
  --forest-900: #0f221c;
  --forest-800: #163028;
  --forest-700: #1e4a3f;
  --teal-500: #2a9d8f;
  --teal-400: #3ec9b8;
  --teal-300: #6ee7d8;
  --sand-200: #e8e0d4;
  --sand-100: #f5f0e8;
  --gold-400: #d4a853;
  --gold-300: #e8c47a;
  --header-h: 5.5rem;
  --nav-h: 0px;
  --map-card-h: 33dvh;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  background: var(--forest-950) !important;
  color: var(--sand-100) !important;
  letter-spacing: -0.01em;
  overflow: hidden !important;
}

.font-display {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.ambient-bg, .mist { opacity: 0.15 !important; }

/* ── App shell ── */
.app-shell {
  max-width: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#pageContent {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tour-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(9rem, var(--map-card-h)) minmax(0, 1fr) auto;
  gap: 0.45rem;
  padding: 0 0.75rem 0;
  overflow: hidden;
}

/* ── Brand header ── */
.brand-header {
  flex-shrink: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0.85rem 0.55rem;
  background: linear-gradient(180deg, rgba(6, 16, 13, 0.98) 0%, rgba(10, 22, 18, 0.96) 100%);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(62, 201, 184, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
.brand-logo-wrap {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
}
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.brand-logo-img--ravi {
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.42));
}
.brand-lockup-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}
.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.035em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tour {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(110, 231, 216, 0.88);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.header-guide-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  color: var(--teal-300);
  background: rgba(42, 157, 143, 0.18);
  border: 1px solid rgba(62, 201, 184, 0.32);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}
.header-guide-btn:hover,
.header-guide-btn:focus-visible {
  background: rgba(42, 157, 143, 0.3);
  color: #fff;
  border-color: rgba(110, 231, 216, 0.45);
  outline: none;
}
.header-guide-btn .guide-icon-svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  display: block;
  color: currentColor;
}

.tour-subbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem 0.45rem;
  background: rgba(10, 22, 18, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.tour-subbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.tour-subbar-title {
  font-size: 0.6875rem;
  color: rgba(232, 224, 212, 0.55);
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-header {
  flex-shrink: 0;
  z-index: 40;
  padding: calc(0.5rem + env(safe-area-inset-top, 0px)) 1rem 0.65rem;
  background: rgba(10, 22, 18, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.menu-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 48, 40, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 224, 212, 0.9);
  transition: all 0.2s var(--ease-out);
}
.menu-btn svg { width: 1.25rem; height: 1.25rem; }
.menu-btn:hover, .menu-btn[aria-expanded="true"] {
  color: var(--teal-300);
  border-color: rgba(62, 201, 184, 0.35);
  background: rgba(42, 157, 143, 0.18);
}

.tour-header-center {
  min-width: 0;
  text-align: center;
}
.tour-header-center h1 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.tour-header-center p {
  font-size: 0.625rem;
  color: rgba(232, 224, 212, 0.5);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-install-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(232, 224, 212, 0.92);
  background: rgba(42, 157, 143, 0.16);
  border: 1px solid rgba(62, 201, 184, 0.28);
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}
.header-install-btn:hover,
.header-install-btn:focus-visible {
  background: rgba(42, 157, 143, 0.28);
  border-color: rgba(110, 231, 216, 0.4);
  outline: none;
}
.header-install-btn svg {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.9;
}
.header-install-btn.hidden { display: none !important; }

.tour-install-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  background: rgba(42, 157, 143, 0.1);
  border: 1px solid rgba(62, 201, 184, 0.2);
}
.tour-install-banner p {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: rgba(232, 224, 212, 0.82);
}
.tour-install-banner button {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  color: #041a18;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-500));
  border: none;
}
.tour-install-banner.hidden { display: none !important; }

.header-unlock-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold-400), #b8923f) !important;
  color: var(--forest-950) !important;
  font-weight: 600 !important;
  font-size: 0.625rem !important;
  padding: 0.4rem 0.7rem !important;
  border-radius: 9999px !important;
  border: none !important;
  box-shadow: 0 2px 12px rgba(212, 168, 83, 0.25);
}
.header-unlock-btn.hidden { display: none !important; }

.tour-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tour-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.tour-brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(42, 157, 143, 0.15);
  border: 1px solid rgba(62, 201, 184, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tour-brand h1 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.tour-brand p {
  font-size: 0.625rem;
  color: rgba(232, 224, 212, 0.5);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tour-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.tour-home-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(22, 48, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 224, 212, 0.8);
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}
.tour-home-btn--labeled {
  width: auto;
  height: auto;
  padding: 0.4rem 0.65rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tour-home-btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.tour-home-btn:hover {
  color: var(--teal-300);
  border-color: rgba(62, 201, 184, 0.3);
  background: rgba(42, 157, 143, 0.15);
}

#unlockBtn {
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold-400), #b8923f) !important;
  color: var(--forest-950) !important;
  font-weight: 600 !important;
  font-size: 0.6875rem !important;
  padding: 0.45rem 0.85rem !important;
  border-radius: 9999px !important;
  border: none !important;
  box-shadow: 0 2px 12px rgba(212, 168, 83, 0.25);
}

.tour-progress-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.tour-progress-track {
  flex: 1;
  height: 3px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

#progressBar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--teal-400));
  border-radius: 9999px;
  transition: width 0.5s var(--ease-out);
}

#progressLabel {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(110, 231, 216, 0.85);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.tour-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.tour-primary-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(110, 231, 216, 0.22);
  background: linear-gradient(180deg, rgba(42, 157, 143, 0.95) 0%, rgba(31, 122, 110, 0.98) 100%);
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 24px rgba(42, 157, 143, 0.22);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
}
.tour-primary-btn:hover {
  border-color: rgba(110, 231, 216, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 10px 28px rgba(42, 157, 143, 0.3);
}
.tour-primary-btn:active { transform: scale(0.985); }

.tour-primary-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.tour-primary-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.1rem;
}

.tour-primary-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tour-primary-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.tour-primary-sub {
  font-size: 0.625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.3;
}

.tour-primary-chevron {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.tour-secondary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.tour-labeled-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.35rem;
  min-height: 3.5rem;
  border-radius: 0.8rem;
  background: rgba(22, 48, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 224, 212, 0.82);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.tour-labeled-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.tour-labeled-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tour-labeled-btn:hover,
.tour-labeled-btn.active {
  background: rgba(42, 157, 143, 0.18);
  border-color: rgba(62, 201, 184, 0.32);
  color: var(--teal-300);
}
.tour-labeled-btn.active {
  box-shadow: 0 0 0 1px rgba(62, 201, 184, 0.15);
}

#statusBar {
  font-size: 0.625rem !important;
  color: rgba(232, 224, 212, 0.4) !important;
  margin-top: 0.45rem !important;
  text-align: left !important;
}

#proximityBar {
  font-size: 0.625rem !important;
  color: rgba(110, 231, 216, 0.65) !important;
  margin-top: 0.15rem !important;
  text-align: left !important;
}

/* ── Map card — 1/3 screen ── */
.map-card-section,
#mapSection {
  grid-row: 2;
  flex: none !important;
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  height: var(--map-card-h) !important;
  min-height: 9rem !important;
  max-height: var(--map-card-h) !important;
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

#mapContainer {
  position: absolute !important;
  inset: 0 !important;
  height: auto !important;
  border-radius: 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38) !important;
  background: var(--forest-900) !important;
  overflow: hidden !important;
}

.tour-panel {
  grid-row: 3;
  flex: none;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0 0.15rem;
}

/* ── Raven guide dock (fills bottom dead space) ── */
.guide-dock {
  grid-row: 4;
  flex: none;
  margin: 0 -0.75rem 0;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 22, 18, 0.98);
  border-top: 1px solid rgba(62, 201, 184, 0.14);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
}

.guide-dock-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(62, 201, 184, 0.2);
  background: linear-gradient(180deg, rgba(22, 48, 40, 0.92) 0%, rgba(15, 34, 28, 0.96) 100%);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s;
}
.guide-dock-btn:hover {
  border-color: rgba(110, 231, 216, 0.32);
  background: linear-gradient(180deg, rgba(30, 74, 63, 0.92) 0%, rgba(18, 42, 36, 0.96) 100%);
}
.guide-dock-btn:active { transform: scale(0.985); }

.guide-dock-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(30, 74, 63, 0.9), rgba(15, 34, 28, 0.95));
  border: 1px solid rgba(62, 201, 184, 0.28);
  color: var(--teal-300);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ravi-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.guide-dock-avatar .ravi-avatar-img {
  border-radius: 0.75rem;
}
.guide-sheet-icon--ravi {
  padding: 0;
  overflow: hidden;
}
.guide-sheet-icon--ravi .ravi-avatar-img {
  border-radius: 0.75rem;
}
.guide-fact-icon {
  padding: 0;
  overflow: hidden;
}
.guide-fact-icon .ravi-avatar-img {
  border-radius: 0.55rem;
}
.ravi-menu-avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.4rem;
  object-fit: cover;
  flex-shrink: 0;
}
.ravi-onboard-img {
  width: 7.5rem;
  height: 7.5rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(62, 201, 184, 0.28);
  background: rgba(10, 22, 18, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ravi-onboard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

.guide-dock-btn-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.guide-dock-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.guide-dock-sub {
  font-size: 0.625rem;
  color: rgba(110, 231, 216, 0.58);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-dock-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgba(110, 231, 216, 0.55);
}

.tour-panel-lead {
  font-size: 0.75rem;
  line-height: 1.45;
  color: rgba(232, 224, 212, 0.55);
  margin-bottom: 0.55rem;
}
.tour-panel-lead strong {
  color: rgba(232, 224, 212, 0.8);
  font-weight: 600;
}
.tour-panel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

#leafletMap {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
  background: #0c1f1a !important;
}

.map-vignette {
  background: radial-gradient(ellipse at center, transparent 58%, rgba(10, 22, 18, 0.28) 100%) !important;
}

/* Map chrome */
.map-chrome {
  position: absolute;
  z-index: 600;
  pointer-events: none;
}
.map-chrome > * { pointer-events: auto; }

.map-chrome-top {
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.map-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(10, 22, 18, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 224, 212, 0.85);
}
.map-pill .pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 8px rgba(62, 201, 184, 0.6);
}
.map-pill.offline .pill-dot { background: #f59e0b; }
.map-pill.offline { border-color: rgba(245, 158, 11, 0.25); }

.map-legend {
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(10, 22, 18, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.5625rem;
  color: rgba(232, 224, 212, 0.7);
  line-height: 1.55;
}
.map-legend-item { display: flex; align-items: center; gap: 0.4rem; }
.map-legend-line {
  width: 16px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--teal-400), var(--teal-500));
}
.map-legend-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-400); border: 1.5px solid #fff;
}
.map-legend-stop {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal-400); border: 1.5px solid #fff;
}

.map-mode-stack {
  display: flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: rgba(10, 22, 18, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.map-mode-btn {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  color: rgba(232, 224, 212, 0.65);
  background: transparent;
  border: none;
  transition: all 0.2s var(--ease-out);
}
.map-mode-btn.active,
.map-mode-btn:hover {
  background: rgba(42, 157, 143, 0.22);
  color: var(--teal-300);
}

#leafletMap .mapboxgl-canvas { outline: none; }
#leafletMap .mapboxgl-ctrl-bottom-left { opacity: 0.65; font-size: 10px; }

.map-zoom-stack {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.map-zoom-btn {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(10, 22, 18, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sand-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s var(--ease-out);
}
.map-zoom-btn:hover { background: rgba(22, 48, 40, 0.95); color: var(--teal-300); }
.recenter-stack-btn { font-size: 0 !important; }
.recenter-stack-btn svg { width: 1rem; height: 1rem; }

#gpsBadge {
  top: auto !important;
  bottom: 1rem !important;
  left: 0.75rem !important;
  border-radius: 10px !important;
  background: rgba(10, 22, 18, 0.9) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
#gpsBadge.gps-live #gpsDot {
  background: var(--teal-400) !important;
  box-shadow: 0 0 8px rgba(62, 201, 184, 0.6);
  animation: pulse-ring 2s ease-in-out infinite;
}

/* Nearest stop — VoiceMap-style bottom card */
.nearest-card {
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  text-align: left;
  z-index: 600;
}
.nearest-card.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#nearestCard {
  position: absolute !important;
  left: 0.75rem !important;
  right: 0.75rem !important;
  bottom: 1rem !important;
  border-radius: 1rem !important;
  background: rgba(10, 22, 18, 0.96) !important;
  border: 1px solid rgba(62, 201, 184, 0.22) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
  padding: 0.85rem 1rem !important;
}
#nearestCard.visible { transform: translateY(0) !important; }

.walk-mode #nearestCard,
.browse-mode.walk-mode #nearestCard {
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
}

#welcomeDock, #bottomNav, #guideFab { display: none !important; }

/* Hide map chrome when menu or sheets block UI */
html.menu-open .map-chrome,
html.menu-open .map-zoom-stack,
html.menu-open #connectionPill {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s var(--ease-out);
}

.sheet-drag-zone {
  touch-action: none;
  cursor: grab;
  flex-shrink: 0;
}
.sheet-drag-zone:active { cursor: grabbing; }
.sheet-handle-bar {
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
}
.modal-sheet.sheet-dragging {
  transition: none !important;
}

/* Hamburger menu drawer */
.app-menu {
  position: fixed;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.3s;
}
.app-menu.open {
  pointer-events: auto;
  visibility: visible;
}
.app-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.app-menu.open .app-menu-backdrop { opacity: 1; }

.app-menu-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(18.5rem, 86vw);
  background: rgba(10, 22, 18, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  transform: translateX(-104%);
  transition: transform 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.app-menu.open .app-menu-panel { transform: translateX(0); }

.app-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.app-menu-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}
.app-menu-sub {
  font-size: 0.6875rem;
  color: rgba(232, 224, 212, 0.45);
  margin-top: 0.15rem;
}
.app-menu-close {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232, 224, 212, 0.6);
  background: rgba(22, 48, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.app-menu-close svg { width: 1rem; height: 1rem; }

.app-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem 1.25rem;
}
.app-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(232, 224, 212, 0.88);
  text-align: left;
  text-decoration: none;
  border: none;
  background: transparent;
  transition: background 0.2s var(--ease-out), color 0.2s;
}
.app-menu-item svg,
.app-menu-item .guide-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: rgba(110, 231, 216, 0.75);
}
.app-menu-item:hover,
.app-menu-item:active {
  background: rgba(42, 157, 143, 0.12);
  color: #fff;
}
.app-menu-item--accent .guide-icon { color: var(--teal-300); }
.app-menu-item--gold {
  margin-top: 0.5rem;
  background: rgba(212, 168, 83, 0.12);
  border: 1px solid rgba(212, 168, 83, 0.25);
  color: var(--gold-300);
}
.app-menu-item--gold svg { color: var(--gold-300); }
.app-menu-item.hidden,
[data-install-btn].hidden { display: none !important; }

html.menu-open { overflow: hidden !important; }

/* Raven guide icon */
.raven-icon-svg,
.guide-icon-svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--teal-300);
  display: block;
}
.raven-icon-svg--lg,
.guide-icon-svg--lg {
  width: 1.45rem;
  height: 1.45rem;
}
.app-menu-item .raven-icon-svg,
.app-menu-item .guide-icon-svg { color: rgba(110, 231, 216, 0.85); }
.guide-sheet-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(42, 157, 143, 0.15);
  border: 1px solid rgba(62, 201, 184, 0.25);
}
.guide-fact-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(42, 157, 143, 0.15);
  border: 1px solid rgba(62, 201, 184, 0.2);
}
.guide-fact-icon .guide-icon { width: 1.1rem; height: 1.1rem; }

/* Welcome dock — removed */
#welcomeDock {
  display: none !important;
}

.welcome-dock-inner {
  background: rgba(10, 22, 18, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
}

.welcome-dock-inner h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.welcome-dock-inner h2 span { color: var(--teal-300); }

.welcome-dock-inner > p {
  font-size: 0.8125rem;
  color: rgba(232, 224, 212, 0.65);
  margin-top: 0.35rem;
  line-height: 1.45;
}

.welcome-dock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.5625rem;
  font-weight: 500;
  padding: 0.3rem 0.55rem;
  border-radius: 9999px;
  background: rgba(22, 48, 40, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(232, 224, 212, 0.75);
}

.walk-mode #welcomeDock {
  transform: translateY(calc(100% + 1rem));
  opacity: 0;
  pointer-events: none;
}

/* Audio strip — in-flow above map, tour only */
#miniPlayer.audio-strip {
  grid-row: 1;
  flex: none;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  max-width: none;
  margin: 0;
  z-index: 1 !important;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-height 0.35s var(--ease-out), opacity 0.3s, margin 0.35s;
}
.app-shell:not(.tour-started) #miniPlayer.audio-strip {
  display: none !important;
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}
#miniPlayer.audio-strip.visible {
  display: block !important;
  max-height: 5.5rem;
  opacity: 1;
  pointer-events: auto;
  margin-bottom: 0.15rem;
}
#miniPlayer.audio-strip[hidden] {
  display: none !important;
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
}
.mini-player-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(10, 22, 18, 0.97) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(62, 201, 184, 0.22) !important;
  border-radius: 1rem !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55) !important;
  padding: 0.7rem 0.85rem !important;
}
#miniPlayer #miniPlayBtn {
  width: 2.75rem !important;
  height: 2.75rem !important;
  border-radius: 50% !important;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal-500), #1f7a6e) !important;
  box-shadow: 0 4px 16px rgba(42, 157, 143, 0.4);
  border: none;
}
.mini-open-btn,
.mini-stop-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 48, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 224, 212, 0.75);
}
.mini-stop-btn:hover, .mini-open-btn:hover { color: var(--teal-300); }
#miniPlayer .audio-progress {
  height: 5px !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, 0.14) !important;
}
#miniPlayer .audio-progress::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  background: var(--teal-400) !important;
}

.welcome-guide-btn {
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.25), rgba(30, 74, 63, 0.4));
  border: 1px solid rgba(62, 201, 184, 0.3);
  color: var(--teal-300);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 0.875rem;
  transition: all 0.2s var(--ease-out);
}
.welcome-guide-btn:hover { background: rgba(42, 157, 143, 0.32); }

.welcome-home-link {
  display: block;
  margin-top: 0.65rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(232, 224, 212, 0.45);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.welcome-home-link:hover { color: var(--teal-300); }

/* nearest card stays on map — no fixed mini player overlap */

.sitka-tooltip {
  background: rgba(10, 22, 18, 0.96) !important;
  border: 1px solid rgba(62, 201, 184, 0.25) !important;
  color: var(--sand-100) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.6875rem !important;
  font-weight: 500 !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

.stop-marker:hover, .stop-marker.active {
  transform: scale(1.12) translateY(-5px) !important;
  filter: drop-shadow(0 8px 20px rgba(62, 201, 184, 0.4)) !important;
}
.marker-badge {
  width: 40px !important;
  height: 40px !important;
  border-width: 2.5px !important;
}

#bottomNav { display: none !important; }

/* Story & list sheets */
.modal-sheet {
  border-top-left-radius: var(--radius-xl) !important;
  border-top-right-radius: var(--radius-xl) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: var(--forest-900) !important;
  max-height: 88vh !important;
}

#storyModal #modalImage {
  margin-left: 1rem !important;
  margin-right: 1rem !important;
  height: 10rem !important;
  border-radius: 1rem !important;
}

#audioPlayer {
  margin-left: 1rem !important;
  margin-right: 1rem !important;
  border-radius: 1rem !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(22, 48, 40, 0.45) !important;
}

#listModal .list-item {
  border-radius: 0.875rem;
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
}
#listModal .list-item:active { background: rgba(42, 157, 143, 0.12) !important; }

.guide-fact-bubble {
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
  left: 0.75rem !important;
  right: 0.75rem !important;
}
.geo-toast {
  top: calc(var(--header-h) + 1.75rem + env(safe-area-inset-top, 0px)) !important;
}



#mapContainer.sheet-open .map-chrome,
#mapContainer.sheet-open .map-zoom-stack {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Hide legacy sections */
#heroSection, #tourControls, #mapHelperText { display: none !important; }

@media (min-width: 420px) {
  .app-shell { max-width: 28rem !important; margin-left: auto; margin-right: auto; }
  .geo-toast, .app-menu-panel { max-width: 28rem; }
  .app-menu-panel { left: max(0px, calc(50% - 14rem)); }
}