/* ============================================
   PEAKFLOW - Professional Outdoor App Styles
   ============================================ */

/* CSS Custom Properties - Bergkönig Dark+Gold Style */
:root {
  /* Brand Colors - Dark + Gold (wie bergkoenig.app) */
  --color-primary: #c9a84c;
  --color-primary-light: #dcc06e;
  --color-primary-dark: #a8893a;
  --color-accent: #c9a84c;
  --color-accent-light: #dcc06e;
  --color-danger: #ef4444;
  --color-snow: #93c5fd;
  --color-snow-light: #dbeafe;
  --color-snow-heavy: #ffffff;
  --primary: #c9a84c;

  /* Surfaces - Dark by default (wie Bergkönig) */
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2e2e2e;
  --bg-glass: rgba(26, 26, 26, 0.92);
  --bg-glass-hover: rgba(36, 36, 36, 0.95);
  --bg-header: #111111;

  /* Text */
  --text-primary: #f0ece2;
  --text-secondary: #a09a8c;
  --text-tertiary: #6b6560;
  --text-inverse: #1a1a1a;

  /* Borders */
  --border-color: #3a3632;
  --border-color-light: #2e2a26;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 14px rgba(201, 168, 76, 0.2);

  /* Layout */
  --header-height: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sidebar-width: 380px;
  --footer-height: 28px;
  --elevation-height: 180px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* iOS-Native-App: Safe-Area passt sich AUTOMATISCH an jedes Modell an.
   env(safe-area-inset-top) liefert pro Gerät den exakten Wert:
   Dynamic Island ~59px, Notch ~47px, iPhone SE/ältere ~20px (nur Statusleiste).
   KEIN fester Mindestwert mehr (der polsterte kleinere Modelle über).
   Voraussetzung: viewport-fit=cover (wird auf iOS per Script gesetzt) → dann ist
   env korrekt befüllt; der Abstand ist exakt so groß wie die Kamera/Uhr-Zone, nie mehr. */
html.ios-app {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Android braucht KEINE Sonderbehandlung: ohne viewport-fit=cover hält das System
   Status-/Navigationsleiste frei, --safe-top/--safe-bottom sind dort von selbst 0 (wie bis v19).
   Safe-Area greift nur auf iOS (env() liefert dort Notch/Home-Indikator). */

/* Light Mode override (wenn jemand explizit hell will) */
[data-theme="light"] {
  --color-primary: #a8893a;
  --color-primary-light: #c9a84c;
  --color-primary-dark: #8a6f2a;

  --bg-primary: #faf8f4;
  --bg-secondary: #f0ece2;
  --bg-tertiary: #e6e0d4;
  --bg-glass: rgba(250, 248, 244, 0.92);
  --bg-glass-hover: rgba(250, 248, 244, 0.96);
  --bg-header: #1a1a1a;

  --text-primary: #1a1a1a;
  --text-secondary: #5a5550;
  --text-tertiary: #8a8580;

  --border-color: #d8d2c8;
  --border-color-light: #e6e0d4;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.10);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.12);
}

/* Dark Mode = default, so "dark" theme just reinforces */
[data-theme="dark"] {
  --color-primary: #dcc06e;
  --bg-primary: #141414;
  --bg-secondary: #1e1e1e;
  --bg-header: #0a0a0a;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* iOS Safari/WKWebView: Eingabefelder >=16px -> verhindert das automatische
   Reinzoomen beim Fokussieren (sonst bleibt die Seite nach Login verzoomt:
   Karte zu gross, Menue abgeschnitten). !important schlaegt inline-styles. */
input, textarea, select {
  font-size: 16px !important;
}

/* ============================================
   Header
   ============================================ */
.header {
  height: calc(var(--header-height) + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--safe-top) 16px 0;
  background: var(--bg-header, #111111);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  z-index: 100;
  color: #f0ece2;
  position: relative;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header__logo {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.header__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-primary);
}

.header__search {
  flex: 1;
  max-width: 480px;
  position: relative;
  transition: all 0.25s ease;
  z-index: 10;
}
.header__search--expanded {
  max-width: none;
  flex: 3;
  z-index: 100;
}

.header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.header__search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.header__search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.12);
}

.header__search-input::placeholder {
  color: var(--text-tertiary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto; /* drückt Trail + Zahnrad immer in die rechte Ecke (jede Bildschirmgröße) */
}

.header__btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header__btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--color-primary);
}

.header__btn--emergency {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.header__btn--emergency:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--color-danger);
}

/* Profile Select Dropdown */
.profile-select {
  height: 36px;
  padding: 0 30px 0 10px;            /* rechts Platz für eigenen Pfeil -> keine Überlappung */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;                  /* nativen Pfeil aus, eigenen setzen */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  min-width: 140px;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.profile-select:focus {
  outline: 2px solid var(--primary, #c9a84c);
  outline-offset: 1px;
}
.profile-select optgroup {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary, #888);
  padding: 4px 0;
}
.profile-select option {
  font-weight: 600;
  color: var(--text-primary, #fff);
  padding: 4px 8px;
}

.profile-toggle__btn.active {
  background: var(--color-primary);
  filter: none;
}

.profile-toggle__btn:not(.active):hover {
  background: var(--bg-tertiary);
}

/* Bergkönig Link */
.header__link-bk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 10px;
  text-decoration: none !important;
  background: #0d0d0d;
  border: 1px solid rgba(201,168,76,0.25);
  transition: all 0.3s;
  flex-shrink: 0;
}
.header__link-bk:hover {
  border-color: rgba(201,168,76,0.5);
  box-shadow: 0 0 12px rgba(201,168,76,0.12);
}
.header__link-bk-name {
  font-family: 'Georgia', serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.bk-gold { color: #c9a84c; }
.bk-light { color: #e8dcc8; }
.header__link-bk-sub {
  color: #666;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.3;
}

/* Login Button */
/* User icon: white = not logged in (like "Peak"), gold = logged in (like "flow") */
.header__user-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}
.header__user-icon:hover { transform: scale(1.1); border-color: #fff; color: #fff; }
.header__user-icon--active {
  background: rgba(201,168,76,0.15);
  border-color: #c9a84c;
  color: #c9a84c;
}
.header__user-icon--active:hover { border-color: #d4b65e; color: #d4b65e; }
/* Keep old login styles for compatibility */
.header__btn-login { display: none; }
.header__login-text { display: none; }
.header__login-main { display: none; }
.header__login-sub { display: none; }

/* User Menu Dropdown */
.user-menu { position: relative; }
.user-menu__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
}
.user-menu__item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.user-menu__item:hover {
  background: var(--bg-tertiary);
}
.user-menu__logout {
  color: var(--color-danger);
  border-top: 1px solid var(--border-color);
}

/* ============================================
   App Layout
   ============================================ */
.app-layout {
  display: flex;
  height: calc(100vh - var(--header-height) - var(--safe-top) - var(--footer-height));
}

/* ============================================
   Sidebar
   ============================================ */
/* Eingeklappte Seitenleiste (nur Desktop). Seitenleiste 380 px + Touren-Panel 360 px
   belegen sonst ueber die Haelfte eines 1280er Bildschirms — Rueckmeldung aus dem Test:
   "brauchen schon fast den halben Monitor". Das Touren-Panel haengt per
   calc(var(--sidebar-width) + 12px) an der Breite und rutscht automatisch mit. */
@media (min-width: 860px) {
  .sidebar.sidebar--zu { width: 0; border-right: none; }
  .sidebar.sidebar--zu > *:not(#sidebarGriff) { display: none; }
  body.sidebar-zu { --sidebar-width: 0px; }
}
/* Am FENSTER verankert, nicht in der Seitenleiste: .sidebar hat overflow:hidden,
   dort wurde der Griff an der Kante abgeschnitten und war unsichtbar. */
#sidebarGriff {
  position: fixed; top: 50%; left: var(--sidebar-width, 380px); transform: translateY(-50%);
  width: 18px; height: 62px; border: 1px solid var(--border-color); border-left: none;
  border-radius: 0 8px 8px 0; background: var(--bg-secondary); color: var(--text-tertiary);
  display: none; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; z-index: 200; padding: 0;
  box-shadow: 2px 0 6px rgba(0,0,0,.18);
}
#sidebarGriff:hover { color: var(--color-primary, #c9a84c); }
@media (min-width: 860px) { #sidebarGriff { display: flex; } }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
  z-index: 70;
  z-index: 50;
  position: relative;
}

.sidebar__tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar__tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.sidebar__tab:hover {
  color: var(--text-secondary);
}

.sidebar__tab.active {
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar__tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

.sidebar__panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.sidebar__panel.active {
  display: block;
}

.sidebar__section {
  margin-bottom: 20px;
}

.sidebar__heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.sidebar__empty {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

/* ============================================
   POI List Items
   ============================================ */
.poi-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.poi-item:hover {
  background: var(--bg-tertiary);
}

.poi-item__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.poi-item__icon--summit { background: transparent; }
.poi-item__icon--hut { background: transparent; }
.poi-item__icon--pass { background: transparent; }

.poi-item__info {
  flex: 1;
  min-width: 0;
}

.poi-item__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-item__meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.poi-item__elevation {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ============================================
   POI Detail Panel
   ============================================ */
.poi-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 60;
  overflow-y: auto;
  animation: slideInRight var(--transition-base);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.poi-detail__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.poi-detail__close:hover {
  background: var(--bg-glass-hover);
}

.poi-detail__hero {
  height: 0px;
  display: none;
}

.poi-detail__hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-primary));
}

.poi-detail__content {
  padding: 16px 20px 20px;
  margin-top: 0;
  position: relative;
}

.poi-detail__type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.poi-detail__type--summit { background: rgba(201, 168, 76, 0.15); color: #a8893a; }
.poi-detail__type--hut { background: rgba(201, 168, 76, 0.10); color: #8a7530; }
.poi-detail__type--pass { background: rgba(100, 120, 140, 0.15); color: #5a6a7a; }

[data-theme="dark"] .poi-detail__type--summit { background: rgba(201, 168, 76, 0.25); color: #dcc06e; }
[data-theme="dark"] .poi-detail__type--hut { background: rgba(201, 168, 76, 0.20); color: #c9a84c; }
[data-theme="dark"] .poi-detail__type--pass { background: rgba(150, 170, 190, 0.25); color: #a0b0c0; }

.poi-detail__name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  line-height: 1.1;
}

.poi-detail__elevation {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.poi-detail__difficulty {
  margin-bottom: 16px;
}

.poi-detail__description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Hut Info */
.hut-info__item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.hut-info__item strong {
  color: var(--text-primary);
}

#hutWebsite {
  margin-top: 12px;
  margin-bottom: 16px;
}

/* Pass Info */
.pass-info__connects {
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Weather in POI Detail */
.poi-detail__weather {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.poi-detail__weather h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.weather-loading {
  color: var(--text-tertiary);
  font-size: 12px;
}

.weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weather-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-item__icon {
  font-size: 20px;
}

.weather-item__value {
  font-size: 15px;
  font-weight: 600;
}

.weather-item__label {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Sunrise/Sunset */
.poi-detail__sun {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sun-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Route Planner
   ============================================ */
.route-planner__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Route Finder */
.route-finder { margin-bottom: 8px; }
.route-finder__toggle {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-color);
  border-radius: 8px; background: var(--bg-glass); cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--color-primary);
  transition: all 0.2s; font-family: inherit;
}
.route-finder__toggle:hover { border-color: var(--color-primary); }
.route-finder__toggle.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.route-finder__panel { padding: 10px 0; }
.route-finder__label { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin: 8px 0 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.route-finder__chips { display: flex; gap: 4px; flex-wrap: wrap; }
.rf-chip {
  padding: 6px 10px; border: 1px solid var(--border-color); border-radius: 16px;
  background: var(--bg-glass); cursor: pointer; font-size: 12px;
  color: var(--text-primary); transition: all 0.15s; font-family: inherit;
}
.rf-chip:hover { border-color: var(--color-primary); }
.rf-chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); font-weight: 600; }
.route-finder__search-btn {
  width: 100%; padding: 10px; margin-top: 10px; border: none; border-radius: 8px;
  background: var(--color-primary); color: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit; transition: all 0.2s;
}
.route-finder__search-btn:hover { opacity: 0.9; transform: scale(1.01); }
.route-finder__search-btn:disabled { opacity: 0.5; cursor: wait; }
.route-finder__results { margin-top: 10px; }
.route-finder__loading { display: flex; align-items: center; gap: 8px; padding: 12px; font-size: 13px; color: var(--text-secondary); }
.rf-spinner { width: 16px; height: 16px; border: 2px solid var(--border-color); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rf-result {
  padding: 10px; margin-bottom: 6px; border: 2px solid var(--border-color);
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.rf-result:hover { transform: scale(1.01); }
.rf-result__header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rf-result__color { width: 12px; height: 12px; border-radius: 50%; }
.rf-result__name { font-weight: 600; font-size: 13px; flex: 1; }
.rf-result__stats { display: flex; gap: 12px; font-size: 11px; color: var(--text-secondary); }
.rf-result__btn {
  margin-top: 6px; padding: 6px 12px; border: 1px solid var(--color-primary);
  border-radius: 6px; background: transparent; color: var(--color-primary);
  cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit;
}
.rf-result__btn:hover { background: var(--color-primary); color: #fff; }

.route-planner__hint {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 32px 0;
}

/* Route planner start screen */
.route-start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 16px;
  text-align: center;
  gap: 6px;
}
.route-start-screen__visual {
  margin-bottom: 4px;
  opacity: 0.9;
}
.route-start-screen__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.route-start-screen__sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
}
/* ── Route signup card ───────────────────────────────────────────────────── */
.route-signup-card {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px 10px;
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.04) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.route-signup-card:hover {
  border-color: rgba(201,168,76,0.5);
  background: linear-gradient(135deg, rgba(201,168,76,0.13) 0%, rgba(201,168,76,0.06) 100%);
}
.route-signup-card__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.route-signup-card__features {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
}
.route-signup-card__features li {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.route-signup-card__check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,168,76,0.15);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  color: var(--color-primary);
}
.route-signup-card__btn {
  width: 100%;
  padding: 9px 14px;
  background: var(--color-primary);
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.route-signup-card__btn:hover {
  background: var(--color-primary-light, #d4b060);
  transform: translateY(-1px);
}

.route-start-screen__cta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 12px;
  background: var(--color-primary-15, rgba(201,168,76,0.12));
  border: 1px solid var(--color-primary-30, rgba(201,168,76,0.25));
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.route-start-screen__cta:hover {
  background: var(--color-primary-25, rgba(201,168,76,0.2));
}
.route-start-screen__cta.hidden { display: none; }

.start-picker { padding: 8px 0; }
.start-picker__locations { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.start-picker__loc-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border-color);
  border-radius: 8px; background: var(--bg-glass); cursor: pointer;
  font-size: 14px; color: var(--text-primary); width: 100%;
  transition: all 0.2s;
}
.start-picker__loc-btn:first-child {
  border-color: var(--color-primary);
  background: rgba(201,168,76,0.1);
}
.start-picker__loc-btn:hover { border-color: var(--color-primary); transform: scale(1.01); }
.start-picker__loc-btn .loc-icon { font-size: 18px; }
.start-picker__loc-btn .loc-name { flex: 1; font-weight: 500; }
.start-picker__loc-btn .loc-active {
  font-size: 10px; color: var(--color-primary); font-weight: 600;
  background: rgba(201,168,76,0.15); padding: 2px 6px; border-radius: 4px;
}
.start-picker__map-btn {
  width: 100%; padding: 10px; border: 2px dashed var(--border-color);
  border-radius: 8px; background: transparent; cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
  transition: all 0.2s;
}
.start-picker__map-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Route Stats */
.route-stats__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-card__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.stat-card__value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Kennzahlen einheitlich in der Markenfarbe.
   Vorher hatte jede ihre eigene (Distanz blau, Dauer gold, Aufstieg gruen, Abstieg orange).
   Rueckmeldung aus dem Test: "die vier Farben braucht man eigentlich nicht, mir reicht ein
   einziges Feld mit den 4 Angaben in 1 Farbe." Die Farben trugen keine Bedeutung — sie
   unterschieden nur, was ohnehin beschriftet ist, und brachen mit dem Schwarz-Gold der App. */
.route-stats__grid .stat-card { border-top: 2px solid var(--color-primary, #c9a84c); }

/* Fahrzeit-Zeile unter den Kennzahlen. Bewusst als eigene Zeile und nicht als
   fuenfte Kachel: gefahrene Zeit ist etwas anderes als gegangene, und die Kacheln
   oben sollen weiter nur die eigene Leistung zeigen. */
.route-stats__fahrt {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 6px; padding: 7px 11px;
  border-radius: 9px;
  background: rgba(47, 127, 214, .10);
  border: 1px solid rgba(47, 127, 214, .28);
  font-size: 12.5px; color: var(--text-secondary, #5a5550);
}
.route-stats__fahrt .rf-ic { flex: 0 0 auto; font-size: 13px; }
.route-stats__fahrt .rf-txt { flex: 1; min-width: 0; color: var(--text-primary, #1a1a1a); }
.route-stats__fahrt .rf-lin { color: var(--text-secondary, #5a5550); font-size: 11.5px; }
.route-stats__fahrt .rf-sum { flex: 0 0 auto; font-weight: 700; font-size: 11.5px; white-space: nowrap; }
.route-stats__fahrt.hidden { display: none; }

/* Zeitabfolge der Fahrt: wo einsteigen, wo umsteigen, wo ankommen. Zugeklappt bleibt
   die Zusammenfassung sichtbar — aufgeklappt steht jede Haltestelle mit Uhrzeit da. */
.route-stats__fahrt { flex-direction: column; align-items: stretch; gap: 0; }
.route-stats__fahrt .bf-kopf {
  display: flex; align-items: baseline; gap: 8px;
  background: none; border: 0; padding: 0; margin: 0; width: 100%;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.route-stats__fahrt .bf-pfeil { flex: 0 0 auto; font-size: 9px; transition: transform .18s; opacity: .7; }
.route-stats__fahrt.offen .bf-pfeil { transform: rotate(180deg); }

/* Immer sichtbare Kurzfassung Einstieg -> Ausstieg. Verschwindet, sobald die volle
   Liste aufgeklappt ist (sonst stuende dieselbe Angabe doppelt da). */
.route-stats__fahrt .bf-quick {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 7px;
  margin-top: 6px; font-size: 12px; color: var(--text-primary, #1a1a1a);
}
.route-stats__fahrt.offen .bf-quick { display: none; }
.route-stats__fahrt .bf-quick .q-h { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
.route-stats__fahrt .bf-quick .q-t { font-variant-numeric: tabular-nums; font-weight: 800; color: #2f7fd6; }
[data-theme="dark"] .route-stats__fahrt .bf-quick .q-t { color: #6db2f0; }
.route-stats__fahrt .bf-quick .q-ar { opacity: .5; font-weight: 700; }
.route-stats__fahrt .bf-quick .q-um {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: #a8500a;
  background: rgba(168, 80, 10, .12); border-radius: 999px; padding: 1px 7px;
}
[data-theme="dark"] .route-stats__fahrt .bf-quick .q-um { color: #e0a45c; }

.route-stats__fahrt .bf-liste {
  display: none; list-style: none; margin: 8px 0 0; padding: 8px 0 0;
  border-top: 1px solid rgba(47, 127, 214, .25);
}
.route-stats__fahrt.offen .bf-liste { display: block; }
.route-stats__fahrt .bf-liste li {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 4px 8px;
  align-items: baseline; padding: 4px 0; font-size: 12px;
}
.route-stats__fahrt .bf-t { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text-primary, #1a1a1a); }
.route-stats__fahrt .bf-n { color: var(--text-primary, #1a1a1a); overflow-wrap: anywhere; }
.route-stats__fahrt .bf-w { grid-column: 2; font-size: 11px; color: var(--text-secondary, #5a5550); }
.route-stats__fahrt .bf-l {
  grid-row: 1 / span 2; grid-column: 3; align-self: center;
  min-width: 22px; padding: 1px 6px; border-radius: 6px;
  background: #2f7fd6; color: #fff; font: 800 10.5px Inter, sans-serif; text-align: center;
}
.route-stats__fahrt .bf-l:empty { background: none; }
/* Einstieg und Ankunft hervorheben — dazwischen sitzt man im Fahrzeug. */
.route-stats__fahrt .bf-ein .bf-n,
.route-stats__fahrt .bf-an .bf-n { font-weight: 700; }
.route-stats__fahrt .bf-um .bf-w { color: #a8500a; font-weight: 600; }
[data-theme="dark"] .route-stats__fahrt .bf-um .bf-w { color: #e0a45c; }
.route-stats__grid .stat-card .stat-card__value { color: var(--color-primary, #c9a84c); }

/* Difficulty Badge */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.difficulty-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.difficulty-badge--easy { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.difficulty-badge--easy .difficulty-badge__dot { background: #22c55e; }

.difficulty-badge--moderate { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.difficulty-badge--moderate .difficulty-badge__dot { background: #f59e0b; }

.difficulty-badge--hard { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.difficulty-badge--hard .difficulty-badge__dot { background: #ef4444; }

.difficulty-badge--expert { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }
.difficulty-badge--expert .difficulty-badge__dot { background: #8b5cf6; }

/* Route Color Legend */
.route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 11px;
}

.route-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.route-legend__color {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Snow Warning */
.snow-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(147, 197, 253, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-snow);
  margin-bottom: 12px;
}

[data-theme="light"] .snow-warning {
  color: #1d4ed8;
}

/* Packing List */
.packing-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.packing-list__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.packing-list__items {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.packing-list__items li {
  padding: 4px 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Route Actions */
.route-planner__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

/* ============================================
   Saved Route Items
   ============================================ */
.saved-route {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.saved-route:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.saved-route__name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.saved-route__meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
}

.saved-route__actions {
  float: right;
  display: flex;
  gap: 4px;
}

.saved-route__edit,
.saved-route__delete {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.saved-route__edit:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.saved-route__delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* ============================================
   Map
   ============================================ */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map {
  width: 100%;
  height: 100%;
}

/* MapLibre overrides */
.maplibregl-ctrl-attrib {
  display: none !important;
}

/* ============================================
   Map Toolbar
   ============================================ */
/* Undo waypoint button */
.map-undo-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 10;
  transition: all var(--transition-fast);
}
/* Rot hiess hier "gefaehrlich" — Rueckgaengig ist aber die harmloseste Aktion
   der Leiste. Jetzt in Peakflow-Gold wie die uebrigen Tourwerkzeuge. */
.map-undo-btn:hover, .map-undo-btn:active {
  background: var(--color-primary);
  color: #17181c;
  transform: scale(1.05);
}

/* Route action buttons overlay on map */
.map-route-actions {
  position: absolute;
  top: 16px;
  left: 72px;
  right: 58px; /* nicht unter die rechten Karten-Buttons laufen */
  display: flex;
  gap: 4px;
  z-index: 10;
  /* Umbruch statt Scrollbalken: bei wenig Platz rutscht ein Knopf in die zweite
     Zeile, statt aus dem Bild zu laufen. */
  flex-wrap: wrap;
  scrollbar-width: none;   /* Scrollbalken ausblenden (Firefox) */
}
.map-route-actions::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Hinweis "Setze Start auf der Karte" solange kein Wegpunkt gesetzt ist */
.map-start-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  padding: 8px 16px;
  background: rgba(26, 26, 26, 0.82);
  color: var(--color-primary, #c9a84c);
  border: 1px solid var(--color-primary, #c9a84c);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  animation: mapStartHintPulse 2s ease-in-out infinite;
}
.map-start-hint.hidden { display: none; }
/* Variante: Wegpunkt-Setzen ist AUS → längerer Hinweis (umbrechen) + amber, deutet zur rechten Toolbar */
.map-start-hint--inactive {
  white-space: nowrap;
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(180, 83, 9, 0.92);
  color: #fff7ed;
  border-color: rgba(251, 191, 36, 0.8);
  pointer-events: auto; /* anklickbar: Tipp aktiviert den Wegpunkt-Modus */
  cursor: pointer;
}

/* Satelliten-Schnee-Hinweis im Routen-Panel */
.sat-snow-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,.18), rgba(147,197,253,.12));
  border: 1px solid rgba(147,197,253,.5);
}
.sat-snow-banner.hidden { display: none; }
.sat-snow-banner--clear {
  background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(134,239,172,.10));
  border-color: rgba(134,239,172,.55);
}
.sat-snow-banner__icon { font-size: 18px; flex: 0 0 auto; }
.sat-snow-banner__text { flex: 1 1 150px; font-size: 12.5px; line-height: 1.4; color: var(--text-primary); }
.sat-snow-banner__btn {
  flex: 0 0 auto; background: #2563eb; color: #fff; border: none;
  border-radius: 9px; padding: 8px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.sat-snow-banner__btn:hover { background: #1d4ed8; }

@keyframes mapStartHintPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

/* Compass button — extra spacing from save button */
.map-toolbar__compass {
  margin-top: 6px;
  position: relative;
}

.map-toolbar__compass-rose {
  transition: transform 0.15s linear;
  transform-origin: center;
  display: block;
}

.map-toolbar {
  /* fixed statt absolute: Anker am Viewport (der Map-Container reicht unter den Bildschirm,
     darum wurden die untersten Icons verdeckt). Oben unter den Header, unten über das Menü. */
  position: fixed;
  top: calc(56px + var(--safe-top) + 12px);
  bottom: calc(12px + var(--safe-bottom));
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 360; /* Menü IMMER vorn: über Höhenprofil (45) UND über dem Hotel-Logo (.htLogoFg 350) */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px; /* schützt Badges/Schatten am Rand */
  -ms-overflow-style: none;
  scrollbar-width: none;
  pointer-events: none; /* leerer Streifen blockiert die Karte nicht */
}
.map-toolbar > * { pointer-events: auto; }
.map-toolbar::-webkit-scrollbar { width: 0; height: 0; }

.map-toolbar__btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto; /* nicht stauchen, wenn die Leiste höhenbegrenzt ist → lieber scrollen */
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.map-toolbar__btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.map-toolbar__btn.active {
  background: var(--color-primary);
  color: white;
}

/* Ebenen-Menü = Hauptsteuerung für die Karten-Anzeige → dauerhaft golden hervorgehoben,
   damit klar ist: hier sitzen alle Karten-Einstellungen. */
#layersBtn {
  background: var(--color-primary);
  color: #1a1a1a;
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.55);
}
#layersBtn:hover {
  background: var(--color-primary);
  color: #1a1a1a;
  filter: brightness(1.08);
  transform: scale(1.3);
}
#layersBtn.active {
  background: var(--color-primary);
  color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.5), 0 2px 12px rgba(201, 168, 76, 0.55);
}
/* Ebenen = Hauptmenü: klar größer als die anderen Toolbar-Buttons + dauerhafter goldener Ring
   + kurzer Aufmerksamkeits-Puls beim Laden -> sofort als Hauptmenü erkennbar. */
#layersBtn {
  transform: scale(1.22);
  z-index: 3;
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.45), 0 3px 14px rgba(201, 168, 76, 0.6);
}
#layersBtn.active { transform: scale(1.22); }
@keyframes layersBtnPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.45), 0 3px 14px rgba(201, 168, 76, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(201, 168, 76, 0), 0 3px 14px rgba(201, 168, 76, 0.6); }
}
#layersBtn:not(.active) { animation: layersBtnPulse 1.8s ease-in-out 4; }

/* Schnee-Alarm: ❄️-Icon blinkt, wenn die Route über Altschneefelder führt → antippen für Infos */
@keyframes snowAlertBlink {
  0%, 100% { background: var(--bg-glass); color: var(--text-secondary); box-shadow: var(--shadow-md); }
  50% { background: #3b82f6; color: #fff; box-shadow: 0 0 16px rgba(59,130,246,0.95); transform: scale(1.08); }
}
.map-toolbar__btn.snow-alert {
  animation: snowAlertBlink 1.1s ease-in-out infinite;
}

/* ============================================
   Layer Picker
   ============================================ */
/* POI Filter Panel */
.poi-filter {
  position: absolute;
  top: 12px;
  right: 58px;
  padding: 12px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 48;
  animation: fadeIn var(--transition-fast);
  min-width: 180px;
}
.poi-filter__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.poi-filter__item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.layer-picker {
  position: absolute;
  top: 60px;
  right: 58px;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 10;
  animation: fadeIn var(--transition-fast);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.layer-picker__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 6px;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.layer-picker__option.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.layer-picker__option:hover {
  background: var(--bg-tertiary);
}

.layer-picker__preview {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
}

.layer-picker__preview--topo {
  background: linear-gradient(135deg, #d4edda, #8fbc8f, #6b8e23);
}

.layer-picker__preview--satellite {
  background: linear-gradient(135deg, #2d5016, #1a3a0a, #4a7c2a);
}

.layer-picker__preview--standard {
  background: linear-gradient(135deg, #e8e8e8, #f5f5f5, #ddd);
}

.layer-picker__preview--peakflow {
  background: linear-gradient(135deg, #eef0d2, #b3d47e, #8a9a6a);
}

/* Danger blink animation - color flashes between marker color and white */
@keyframes dangerBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 4px currentColor; }
}
@keyframes failedBlink {
  /* NOTE: no transform here — MapLibre owns transform for positioning! */
  0%, 100% { opacity: 1;   box-shadow: 0 0 10px rgba(231,76,60,0.7), 0 0 0 2px rgba(231,76,60,0.4); }
  50%       { opacity: 0.6; box-shadow: 0 0 20px rgba(231,76,60,1.0), 0 0 0 5px rgba(231,76,60,0.3); }
}
@keyframes navPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(59,130,246,0.4); }
  50% { box-shadow: 0 0 20px rgba(59,130,246,0.8); }
}

/* ============================================
   Route Accordions (SAC, Snow, Packlist)
   ============================================ */
.route-accordion__header {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
.route-accordion__header:hover {
  background: var(--bg-tertiary);
}
.route-accordion__icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}
/* Zugeklappt bleibt die Leiste ruhig: eine Farbe fuer alle Kopfzeilen. Die Signalfarbe
   (Rot bei T5, Orange bei Schnee ...) kommt erst, wenn der Eintrag geoeffnet ist —
   sonst leuchtet die halbe Seitenleiste, bevor man ueberhaupt etwas angesehen hat.
   Die Icons erben die Farbe ueber currentColor und gehen automatisch mit. */
.route-accordion__title {
  color: var(--text-secondary);
  transition: color 0.2s;
  flex: 1;
  min-width: 0;            /* erlaubt Ellipsis im Flex-Container */
  white-space: nowrap;     /* Titel immer nur 1 Zeile */
  overflow: hidden;
  text-overflow: ellipsis; /* zu lang -> intelligent kuerzen mit … */
}
.route-accordion__arrow {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  margin-left: auto;
}
.route-accordion.open .route-accordion__title {
  color: var(--acc-farbe, var(--text-primary));
}
.route-accordion__title svg { vertical-align: -0.15em; flex: none; }
.route-accordion.open .route-accordion__arrow {
  transform: rotate(180deg);
}
.route-accordion__body {
  display: none;
  padding: 6px 12px 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.route-accordion.open .route-accordion__body {
  display: block;
}

/* ============================================
   Elevation Profile
   ============================================ */
.elevation-profile {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  /* iPad/iOS: Home-Indikator-Zone als Innenabstand (Android/Desktop = 0, unveraendert) */
  height: calc(var(--elevation-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(26, 26, 26, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 10;
  padding: 8px 16px;
  animation: slideUp var(--transition-base);
  transition: background 0.3s;
}
.elevation-profile:hover {
  background: rgba(26, 26, 26, 0.85);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.elevation-profile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.elevation-profile__header h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.elevation-profile__close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.elevation-profile__close:hover {
  background: var(--bg-tertiary);
}

#elevationCanvas {
  width: 100%;
  height: 130px;
}

.elevation-profile__tooltip {
  position: absolute;
  padding: 4px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

/* Wegpunkt-Legende unter dem Höhenprofil (Nummern passen zu den Pins im Profil) */
.elevation-legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px 4px;
}
.elevation-legend__item {
  font: 600 11px/1.3 Inter, sans-serif;
  color: var(--text-secondary, #64748b);
  background: var(--bg-tertiary, #f1f5f9);
  border-radius: 7px; padding: 3px 8px; white-space: nowrap;
}
.elevation-legend__item b {
  color: var(--color-primary, #c9a84c); margin-right: 3px; font-weight: 800;
}
@media (max-width: 640px) {
  .elevation-legend { gap: 5px; padding: 7px 8px 3px; max-height: 62px; overflow-y: auto; }
  .elevation-legend__item { font-size: 10.5px; padding: 2px 7px; }
}

/* ============================================
   Walkthrough Controls
   ============================================ */
.walkthrough-controls {
  position: absolute;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  z-index: 20;
  animation: fadeIn var(--transition-base);
}

.walkthrough-controls__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.walkthrough-controls__btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.walkthrough-controls__btn--play {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: white;
}

.walkthrough-controls__btn--play:hover {
  background: var(--color-primary-dark);
  color: white;
  transform: scale(1.05);
}

.walkthrough-controls__progress {
  width: 120px;
  accent-color: var(--color-primary);
}

.walkthrough-controls__speed {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ============================================
   POI Info Card (Walkthrough)
   ============================================ */
.poi-info-card {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  z-index: 20;
  animation: fadeIn var(--transition-fast);
}

.poi-info-card__icon {
  font-size: 20px;
}

.poi-info-card__distance {
  font-size: 12px;
  color: var(--text-tertiary);
}

.poi-info-card__name {
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   Walkthrough v2 - Story Card & Marker
   ============================================ */

/* Animated hiker marker */
.wt-marker { position: relative; width: 24px; height: 24px; }
.wt-marker__dot {
  position: absolute; top: 4px; left: 4px;
  width: 16px; height: 16px; background: #ef4444;
  border: 3px solid white; border-radius: 50%;
  box-shadow: 0 2px 8px rgba(239,68,68,0.5);
  z-index: 2;
}
.wt-marker__pulse {
  position: absolute; top: 0; left: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(239,68,68,0.3);
  animation: wtPulse 1.5s ease-out infinite;
  z-index: 1;
}
@keyframes wtPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Story Card */
.wt-story-card {
  position: absolute;
  bottom: 90px; /* knapp ueber der Play-Steuerung, gibt die Kartenmitte frei */
  left: 50%; transform: translateX(-50%);
  width: min(500px, 90vw);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
  z-index: 25;
  padding: 14px 18px;
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.wt-story-card--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.wt-story-card--hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}
.wt-story-card__progress {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-tertiary);
  margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.wt-story-card__km {
  font-weight: 700; color: var(--primary);
  font-size: 14px;
}
.wt-story-card__sep { opacity: 0.4; }
.wt-story-card__elev {
  margin-left: auto;
  font-weight: 600; color: var(--text-secondary);
}
.wt-story-card__body {
  display: flex; align-items: flex-start; gap: 12px;
}
.wt-story-card__icon {
  font-size: 28px; flex-shrink: 0;
  line-height: 1;
}
.wt-story-card__text {
  font-size: 14px; line-height: 1.5;
  color: var(--text-primary);
}

/* Hide sidebar during walkthrough */
.wt-hidden { display: none !important; }

/* Dark mode story card */
[data-theme="dark"] .wt-story-card {
  background: rgba(30,30,30,0.92);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn--full { width: 100%; }

.btn--primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--accent {
  background: var(--color-accent);
  color: #000;
  border-color: var(--color-accent);
}

.btn--accent:hover {
  background: var(--color-accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn--outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   Modal
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  animation: fadeIn var(--transition-base);
}

.modal__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.emergency-numbers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.emergency-number {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.emergency-number:hover {
  background: rgba(239, 68, 68, 0.12);
  text-decoration: none;
  transform: translateY(-1px);
}

.emergency-number__code {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-danger);
}

.emergency-number__label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.emergency-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ============================================
   Legal Footer
   ============================================ */
.legal-footer {
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 10px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  overflow: hidden;
}

.legal-footer a {
  color: var(--text-tertiary);
  text-decoration: underline;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden { display: none !important; }

/* Scrollbar */
.sidebar__panel::-webkit-scrollbar {
  width: 4px;
}

.sidebar__panel::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar__panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

/* ============================================
   Difficulty Stars
   ============================================ */
.difficulty-stars {
  display: inline-flex;
  gap: 2px;
}

.difficulty-stars__star {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

.difficulty-stars__star--empty {
  color: var(--border-color);
}

/* ============================================
   Weather Forecast Bar
   ============================================ */
.weather-forecast {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
}

.weather-forecast__item {
  flex-shrink: 0;
  text-align: center;
  padding: 6px 10px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color-light);
  font-size: 11px;
}

.weather-forecast__time {
  font-weight: 600;
  margin-bottom: 2px;
}

.weather-forecast__icon {
  font-size: 18px;
  line-height: 1.3;
}

.weather-forecast__temp {
  font-weight: 600;
}

/* ============================================
   Responsive (Mobile)
   ============================================ */
@media (max-width: 768px) {
  /* Toolbar rechts: kleinere Buttons + Anker über dem unteren Menü (44px), damit ALLE
     Icons reinpassen und die untersten nicht vom Bildschirmrand/Menü verdeckt werden. */
  .map-toolbar {
    top: calc(56px + var(--safe-top) + 8px);
    bottom: calc(52px + var(--safe-bottom));
    gap: 4px;
  }
  .map-toolbar__btn {
    width: 34px;
    height: 34px;
  }
  .map-toolbar__btn svg {
    width: 18px;
    height: 18px;
  }

  /* Höhenprofil sitzt DIREKT über der Tab-Leiste (Routen/Entdecken/Gespeichert, 44px hoch).
     +safe-bottom: Bottom-Sheet ist auf iOS um den Home-Indikator gehoben → mitwandern. */
  .elevation-profile {
    /* fixed statt absolute: bottom zählt ab Bildschirmrand (Container ragt sonst unter den
       Viewport → Profil schwebte zu hoch). Jetzt sitzt es bündig über der 44px-Tab-Leiste. */
    position: fixed;
    bottom: calc(44px + var(--safe-bottom));
    left: 0;
    right: 0;
    z-index: 45;
    background: rgba(26, 26, 26, 0.55);
    border-radius: 12px 12px 0 0;
    height: 180px;
    padding-bottom: 6px;
  }
  .elevation-profile #elevationCanvas {
    height: 150px;
  }

  /* Header kompakt + aufgeräumt auf Mobile */
  .header {
    gap: 8px;
    padding: 0 10px;
  }
  .header__title { font-size: 15px; }

  /* Suche füllt den Platz zwischen Logo und Tempo; Placeholder solange "Gipfel" lesbar, sonst nur Lupe */
  .header__search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    font-size: 12px;
    transition: max-width 0.3s ease;
  }
  .header.search-narrow .header__search-input::placeholder { color: transparent; }
  .header__search--expanded { max-width: none; flex: 1; }
  .header__brand {
    max-width: 180px; overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  }
  .header__link-bk {
    max-width: 150px; overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  }
  .header.searching .header__brand,
  .header.searching .header__link-bk {
    max-width: 0; opacity: 0; margin-left: 0; margin-right: 0; pointer-events: none;
  }

  .profile-select {
    padding: 4px 24px 4px 8px;       /* rechts Platz für den Pfeil */
    font-size: 12px;
    min-width: 0;
    max-width: 138px;                /* genug für "🏃 Freizeit" ohne Abschneiden */
    background-position: right 7px center;
    background-size: 10px;
  }

  .sidebar {
    position: fixed;
    bottom: 0; /* bündig am unteren Bildschirmrand — kein Karten-Streifen mehr darunter */
    left: 0;
    right: 0;
    width: 100%;
    /* Inhalt 44px + Home-Indikator-Bereich wird vom Hintergrund gefüllt (iOS). Auf Android ist --safe-bottom = 0. */
    height: calc(44px + var(--safe-bottom)); /* Collapsed: toggle button + tabs visible */
    padding-bottom: var(--safe-bottom); /* Inhalt bleibt über dem iOS-Home-Indikator */
    border-right: none;
    border-top: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    z-index: 400; /* Menü liegt IMMER ganz oben — verdeckt aufgezogen auch "Route fertig" (z200), Badges (z190) etc. */
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
  }

  /* Remove old pseudo-element handle */
  .sidebar::before {
    display: none;
  }

  /* Toggle button at top of mobile sidebar */
  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0 2px;
    cursor: pointer;
  }
  .mobile-toggle__bar {
    width: 40px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 2px;
    transition: background 0.2s;
  }
  .sidebar.expanded .mobile-toggle__bar,
  .sidebar.fully-expanded .mobile-toggle__bar {
    background: var(--color-primary);
  }

  .sidebar.expanded {
    height: calc(50vh + var(--safe-bottom));
  }

  .sidebar.fully-expanded {
    height: calc(85vh + var(--safe-bottom));
  }

  .sidebar__tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    background: inherit;
    padding-top: 0;
    display: flex;
    align-items: center;
    min-height: 32px;
  }
  .sidebar__tab {
    padding: 8px 8px;
    font-size: 13px;
    text-align: center;
  }

  .sidebar__content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100% - 76px); /* toggle + tabs */
    padding-bottom: 14px; /* Sheet ist bereits über die Navi-Leiste gehoben (bottom: var(--safe-bottom)) */
  }

  .app-layout {
    flex-direction: column;
  }

  .map-container {
    height: 100vh;
    width: 100%;
  }

  .legal-footer {
    display: none;
  }

  .layer-picker {
    right: 10px;
    top: 52px;
  }

  /* Smaller buttons on mobile */
  .header__btn {
    width: 32px;
    height: 32px;
  }
  .header__link-bk { display: none; }
  .header__btn-login { padding: 4px 10px; }
  .header__login-sub { display: none; }
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   Custom MapLibre Popup
   ============================================ */
/* Popup always above markers.
   Muss ueber dem Hotel-Logo liegen (.htLogoFg, z-index 350) — sonst verdeckte das
   Logo ausgerechnet die Oeffnungszeiten der Einkehr daneben. Der Wert hier stand
   auf 200 und war damit trotz des Kommentars NIEDRIGER als der Logo-Marker. */
.maplibregl-popup {
  z-index: 500 !important;
}

.maplibregl-popup-content {
  background: var(--bg-secondary) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: var(--radius-md) !important;
  padding: 9px 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  font-family: 'Inter', sans-serif !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.maplibregl-popup-close-button {
  font-size: 18px !important;
  color: var(--text-secondary) !important;
  right: 6px !important;
  top: 4px !important;
}

.maplibregl-popup-tip {
  border-top-color: var(--bg-secondary) !important;
}

/* Markers behind popup */
.maplibregl-marker {
  z-index: 10 !important;
}

/* Wegpunkte IMMER ganz oben — dürfen von Gefahren-/Wasser-/Höhenprofil-Markern
   nie überdeckt werden (sonst nicht mehr antippbar/verschiebbar). */
.maplibregl-marker.route-marker {
  z-index: 30 !important;
}

.popup-content {
  min-width: 158px;
}

.popup-content__name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 1px;
}

.popup-content__elevation {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 3px;
}

.popup-content__type {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================
   Waypoint List
   ============================================ */
.waypoint-list {
  margin-bottom: 12px;
}

.waypoint-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background var(--transition-fast);
}

.waypoint-item:hover {
  background: var(--bg-tertiary);
}

.waypoint-item__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.waypoint-item__coords {
  flex: 1;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: monospace;
}

.waypoint-item__delete {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.waypoint-item__delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* Peak Button (Kudos for community races) */
.peak-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
}
.peak-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.peak-btn.peaked {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  animation: peakPulse 0.4s ease-out;
}
@keyframes peakPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(201,168,76,0.3); }
  50% { box-shadow: 0 0 12px rgba(201,168,76,0.6); }
}

/* ── Einkehr-Radar (Hütten/Lokale mit Öffnungszeiten) ── */
/* Mini-Pin (20px): dunkler Kern, dünner Rand, monochromes Liniensymbol (Farbe via currentColor) */
.hutt-marker {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #6b7078; background: #3a3f47; color: #aeb3ba;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  cursor: pointer; transition: transform .12s ease, opacity .2s ease;
}
.hutt-marker:hover { transform: scale(1.18); z-index: 5; }
.hutt-marker__ico { width: 11px; height: 11px; display: flex; align-items: center; justify-content: center; line-height: 0; }
.hutt-marker__ico svg { width: 11px; height: 11px; stroke: currentColor; fill: none; }
/* geschlossen: gedämpft */
.hutt-marker.is-closed { background: #3a3f47; border-color: #6b7078; color: #aeb3ba; opacity: .6; }
/* SAC-Hütte (Info + Homepage, kein Live-Status) -> blau, kein Puls */
.hutt-marker.is-sac { background: #1c1f25; border-color: #3b82f6; color: #93c5fd; opacity: 1; }
/* OSM-Hütte (Info) -> Schiefer */
.hutt-marker.is-osm { background: #1c1f25; border-color: #94a3b8; color: #cbd5e1; opacity: .95; }
/* offen jetzt: Gold-Rand + Gold-Symbol + Puls */
.hutt-marker.is-open {
  background: #1c1f25; border-color: #c9a84c; color: #e2c874; opacity: 1;
  animation: einkehrPulse 2.4s ease-in-out infinite;
}
/* schließt bald (<45 min): warmer Bernstein */
.hutt-marker.is-open.is-soon {
  background: #1c1f25; border-color: #e07b39; color: #f6b26b;
  animation: einkehrSoon 1.5s ease-in-out infinite;
}
/* öffnet bald: amber */
.hutt-marker.is-closed.is-soon {
  background: #1c1f25; border-color: #e0a13a; color: #f6c26b; opacity: .9;
  animation: einkehrSoon 1.8s ease-in-out infinite;
}
/* offiziell abgeglichen (Kleinwalsertal Tourismus): kleines Verifiziert-Häkchen */
/* (Kleinwalsertal: kein ✓-Haken mehr — gleiche Optik wie Allgäu/Feratel) */
/* liegt an der geplanten Route -> Ankunfts-Status als Ring */
.hutt-marker.arr-open { outline: 2px solid #16a34a; outline-offset: 2px; }
.hutt-marker.arr-closed { outline: 2px dashed #dc2626; outline-offset: 2px; }
@keyframes einkehrPulse {
  0%, 100% { box-shadow: 0 1px 5px rgba(0,0,0,.4), 0 0 0 0 rgba(217,164,65,.55); }
  50% { box-shadow: 0 1px 5px rgba(0,0,0,.4), 0 0 10px 5px rgba(217,164,65,.25); }
}
@keyframes einkehrSoon {
  0%, 100% { box-shadow: 0 1px 5px rgba(0,0,0,.4), 0 0 0 0 rgba(224,123,57,.6); }
  50% { box-shadow: 0 1px 5px rgba(0,0,0,.4), 0 0 10px 5px rgba(224,123,57,.3); }
}

.race-filter {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.race-filter select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card, transparent);
  color: var(--text-primary, inherit);
  font-size: 13px;
  font-family: inherit;
}
.race-del-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, border-color 0.15s;
}
.race-del-btn:hover { opacity: 1; border-color: #e05656; }

/* Community Race Card */
.community-race { transition: transform 0.15s; }
.community-race:hover { transform: translateY(-1px); }

/* Waypoint Insert Button (between waypoints) */
.waypoint-insert {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.waypoint-insert:hover { opacity: 1; }
.waypoint-insert__line {
  flex: 1;
  height: 1px;
  background: var(--color-primary, #c9a84c);
  opacity: 0.4;
}
.waypoint-insert__btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--color-primary, #c9a84c);
  background: transparent;
  color: var(--color-primary, #c9a84c);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
.waypoint-insert__btn:hover {
  background: var(--color-primary, #c9a84c);
  color: white;
}

/* ============================================
   GPS Location Marker
   ============================================ */
.gps-marker {
  width: 18px;
  height: 18px;
  background: #3b82f6;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(0,0,0,0.3);
  animation: gpsPulse 2s ease infinite;
}

@keyframes gpsPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 2px 6px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.1), 0 2px 6px rgba(0,0,0,0.3); }
}

.popup-content__weather {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Danger marker pulse animation */
@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(220, 38, 38, 0.4); opacity: 1; }
  50% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.8); opacity: 0.6; }
}

/* Wasserquelle: blinken beim Anklicken in der Liste (kein transform -> Marker bleibt an Position) */
@keyframes waterPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(59,130,246,0.7); opacity: 1; }
  50% { box-shadow: 0 0 0 3px #fff, 0 0 6px 10px rgba(59,130,246,0.55); opacity: 0.55; }
}

/* ============================================
   AUTH MODAL
   ============================================ */
/* Old login styles removed - using .header__btn-login now */

.user-menu__logout-old {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  width: 100%;
  text-align: left;
}
.user-menu__logout:hover {
  text-decoration: underline;
}

.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal.hidden {
  display: none;
}
.auth-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.auth-modal__content {
  position: relative;
  background: var(--bg-card, white);
  border-radius: 20px;
  padding: 40px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}
.auth-modal__logo {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color, #ece7dc);
}
.auth-modal__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.auth-modal__subtitle {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0 auto 24px;
  max-width: 280px;
}
.auth-modal__error {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}
.auth-modal__error.hidden { display: none; }

.auth-form__field {
  margin-bottom: 16px;
  text-align: left;
}
.auth-form__field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.auth-form__field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg-surface, #f8fafc);
  color: var(--text-primary);
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.auth-form__field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 60, 0.1);
}

.auth-modal__switch {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}
.auth-modal__switch-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.auth-modal__switch-btn:hover {
  text-decoration: underline;
}

/* ============================================
   Settings Modal
   ============================================ */
.settings-modal {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 1000;
  /* iOS: Safe-Area oben/unten einrechnen, damit der Header nicht unter Uhr/Batterie
     rutscht (Android/Desktop = 0, also unveraendert). */
  padding: calc(24px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}
/* Kopfzeile bleibt beim Scrollen stehen — sonst muss der Gast erst wieder ganz
   nach oben, um das X zu finden. Die negativen Raender heben das Panel-Padding
   auf, damit die Leiste beim Kleben die volle Breite deckt. */
.settings-modal__head {
  position: sticky;
  top: calc(-24px - var(--safe-top));
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: calc(-24px - var(--safe-top)) -24px 14px;
  padding: calc(16px + var(--safe-top)) 24px 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.settings-modal.hidden {
  transform: translateX(100%);
  pointer-events: none;
}
.avatar-btn.active, .color-btn.active {
  border-color: var(--primary, #c9a84c) !important;
  box-shadow: 0 0 0 2px var(--primary, #c9a84c);
}

/* ─── Discover Sub-Tabs (Gipfel / Rennen) ───────────────────────── */
.discover-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--bg-secondary);
  border-radius: 10px;
}
.dtab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.2px;
}
.dtab--active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ─── Race Cards ─────────────────────────────────────────────────── */
.race-loading {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}
.race-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.race-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.race-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-primary);
  flex-shrink: 0;
}
.race-logo-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--color-primary, #c9a84c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.race-card__meta {
  flex: 1;
  min-width: 0;
}
.race-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-card__subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.race-card__badge {
  font-size: 10px;
  font-weight: 700;
  background: #e63946;
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.race-card__actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.race-map-btn {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.race-map-btn.active {
  background: var(--color-primary, #c9a84c);
  color: white;
  border-color: transparent;
}
.race-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border-color);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}
.race-stage-row:hover {
  background: var(--bg-primary);
  margin: 0 -4px;
  padding: 6px 4px;
}
.race-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.race-stage-name {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-stage-stats {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ============================================================
   ORGANIZER ACCORDION — Rennen-Tab
   ============================================================ */

/* Outer wrapper per organizer */
.org-group {
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Organizer header row — clickable */
.org-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.org-header:hover,
.org-header.open {
  background: var(--bg-tertiary);
}

/* Logo box — square, rounded */
.org-header__logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  padding: 3px;
}
.org-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.org-header__logo-icon {
  font-size: 22px;
  line-height: 1;
}

/* Text info */
.org-header__info {
  flex: 1;
  min-width: 0;
}
.org-header__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-header__meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Chevron icon */
.org-header__chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}
.org-header__chevron.rotated {
  transform: rotate(180deg);
}

/* Race list — collapsible */
.org-races {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease;
  background: var(--bg-primary);
}
.org-races.collapsed {
  max-height: 0;
}

/* ── Single race card ─────────────────────────────────────── */
.race-item {
  padding: 10px 12px;
  border-top: 1px solid var(--border-color-light);
}
.race-item:first-child {
  border-top: none;
}
.race-item:hover {
  background: var(--bg-secondary);
}

/* Race title row */
.race-item__header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.race-item__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

/* Difficulty badge */
.race-diff {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.race-diff--easy {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.race-diff--medium {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}
.race-diff--hard {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Stats row */
.race-item__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

/* Description */
.race-item__desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions row */
.race-item__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* "Auf Karte" button active state */
.race-show-btn.active {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* Peak button */
.race-peak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.race-peak-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.race-peak-btn.peaked {
  background: rgba(201, 168, 76, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   PASSWORD EYE TOGGLE
   ============================================ */
.pw-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary, #6b6560);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast, 150ms ease);
}
.pw-eye-btn:hover {
  color: var(--text-primary, #f0ece2);
}
.pw-eye-btn.active {
  color: var(--color-primary, #c9a84c);
}

/* ============================================
   TUTORIAL OVERLAY
   ============================================ */
#tutorialOverlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
}
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
/* Wenn ein Spotlight aktiv ist, dimmt nur das Spotlight (mit Loch) — der
   Voll-Backdrop wird transparent, damit das hervorgehobene Element hell bleibt. */
#tutorialOverlay.has-spotlight .tutorial-backdrop {
  background: transparent;
}
.tutorial-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10003;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast, 150ms ease), border-color var(--transition-fast, 150ms ease);
}
.tutorial-close:hover {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.5);
}
.tutorial-spotlight {
  position: absolute;
  z-index: 10002;
  /* dim mit Loch + heller Rahmen/Glow, damit die Auswahl klar heraussticht */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55),
              0 0 0 4px rgba(201, 168, 76, 0.9),
              0 0 22px 6px rgba(201, 168, 76, 0.55);
  border: 3px solid var(--color-primary, #c9a84c);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  transition: all 0.35s ease;
}
.tutorial-card {
  position: absolute;
  z-index: 10003;
  background: var(--bg-secondary, #242424);
  border: 1px solid var(--border-color, #3a3632);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0,0,0,0.6));
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tutorial-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.tutorial-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #f0ece2);
  margin-bottom: 6px;
}
.tutorial-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #a09a8c);
}
.tutorial-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.tutorial-dots {
  display: flex;
  gap: 6px;
}
.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color, #3a3632);
  transition: background var(--transition-fast, 150ms ease);
}
.tutorial-dot.active {
  background: var(--color-primary, #c9a84c);
}
.tutorial-btn {
  padding: 10px 24px;
  background: var(--color-primary, #c9a84c);
  color: #1a1a1a;
  border: none;
  border-radius: var(--radius-md, 10px);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast, 150ms ease);
}
.tutorial-btn:hover {
  background: var(--color-primary-light, #dcc06e);
}

/* Coverage-Hinweis (Region noch nicht abgedeckt) */
.coverage-banner {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 92vw;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.94);
  color: #f4f4f4;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 168, 76, 0.4);
  animation: coverageIn 0.25s ease;
}
.coverage-banner__text { flex: 1; }
.coverage-banner__close {
  flex: none;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #f4f4f4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.coverage-banner__close:hover { background: rgba(255, 255, 255, 0.24); }
@keyframes coverageIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Sehr kleine Screens: "Peakflow"-Text ausblenden, nur Logo — Toolbar bleibt aufgeräumt */
@media (max-width: 360px) {
  .header__title { display: none; }
}

/* Navi-Info-Karussell: Scrollbalken ausblenden (horizontales Blaettern) */
#navInfoScroll::-webkit-scrollbar { display: none; }
#navInfoScroll { scroll-padding: 0; }

/* Navi-Info-Karussell: Menue-Punkte */
.nav-dot { width:7px; height:7px; border-radius:50%; background:rgba(240,236,226,0.30); cursor:pointer; transition:all .2s ease; flex:none; }
.nav-dot--active { background:var(--color-primary,#c9a84c); width:18px; border-radius:4px; }

/* ── Webcam Live-Tour-Vorschau (Galerie aller Route-Webcams) ───────────── */
.webcam-gallery {
  position: fixed; inset: 0; z-index: 4000;
  background: rgba(10, 12, 16, 0.94);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  padding-top: var(--safe-top); padding-bottom: var(--safe-bottom);
}
.wc-gal-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; color: #fff; font-weight: 700; font-size: 15px;
  font-family: Inter, sans-serif; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.wc-gal-close {
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; flex: 0 0 auto;
}
.wc-gal-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.wc-gal-item {
  margin: 0 auto 14px; max-width: 640px; background: #14171c;
  border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.wc-gal-item figcaption {
  padding: 8px 12px; color: #e6e6e6; font-size: 13px; font-weight: 600; font-family: Inter, sans-serif;
}
.wc-gal-km {
  display: inline-block; background: #2563eb; color: #fff; font-weight: 700;
  font-size: 11px; padding: 1px 7px; border-radius: 20px; margin-right: 7px;
}
.wc-gal-item img { width: 100%; display: block; background: #222; min-height: 140px; }
.wc-gal-credit { text-align: center; color: #888; font-size: 11px; padding: 6px 0 14px; font-family: Inter, sans-serif; }
.wc-gal-credit a { color: #888; }

/* ── Wildruhezone-Hinweis (nur wenn Route durchgeht) ─────────────────────── */
.wildlife-banner {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 8px; padding: 10px 12px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.35);
  border-radius: 10px;
  font-size: 13px; line-height: 1.4; color: var(--text-primary, #1a1a1a);
}
.wildlife-banner.hidden { display: none; }
.wildlife-banner__icon { font-size: 16px; line-height: 1.3; flex: 0 0 auto; }
.wildlife-banner__text b { color: #15803d; }

/* ── Ebenen-Menü: Overlay-Toggles aus der Hauptleiste in ein beschriftetes Menü ── */
.map-toolbar__btn.is-overlay-toggle { display: none !important; }

.layers-menu {
  position: fixed;
  top: calc(56px + var(--safe-top) + 14px);
  right: 64px;
  z-index: 47;
  width: 214px;
  max-height: calc(100dvh - 56px - var(--safe-top) - var(--safe-bottom) - 80px);
  overflow-y: auto;
  background: rgba(26, 26, 26, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  /* dezenter Pop-in beim Öffnen – wächst aus der Richtung des Ebenen-Buttons (oben rechts) */
  transform-origin: top right;
  animation: layersMenuPop 0.16s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes layersMenuPop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .layers-menu { animation: none; } }
.layers-menu.hidden { display: none; }
/* Regionen-Intensität: horizontaler Regler unter dem Ebenen-Menü */
.regions-opacity-bar {
  position: fixed;
  right: 64px;
  z-index: 47;
  width: 214px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(26, 26, 26, 0.94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  animation: layersMenuPop 0.16s cubic-bezier(0.2, 0.7, 0.3, 1);
  transform-origin: top right;
}
.regions-opacity-bar.hidden { display: none; }
.regions-opacity-bar .rob-label { font-size: 11px; font-weight: 700; color: #c9a84c; flex: 0 0 auto; }
.regions-opacity-bar input[type="range"] { flex: 1 1 auto; min-width: 0; height: 18px; cursor: pointer; accent-color: #c9a84c; }
.regions-opacity-bar .rob-val { font-size: 11px; color: var(--muted, #9aa0a6); flex: 0 0 auto; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.layers-menu__title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: #9aa0a6; padding: 4px 8px 6px; letter-spacing: 0.03em;
}
.layers-menu__row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: transparent; border: none; border-radius: 9px;
  color: #d6d6d6; font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-align: left;
}
.layers-menu__row svg { flex: 0 0 auto; opacity: 0.7; }
.layers-menu__row:hover { background: rgba(255, 255, 255, 0.07); }
.layers-menu__row.active { color: var(--primary, #c9a84c); background: rgba(201, 168, 76, 0.14); }
.layers-menu__row.active svg { opacity: 1; color: var(--primary, #c9a84c); }
.layers-menu__row::after {
  content: ''; margin-left: auto; width: 9px; height: 9px; border-radius: 50%;
  background: #4a4a4a; flex: 0 0 auto;
}
.layers-menu__row.active::after { background: var(--primary, #c9a84c); }

/* Hotel-Link-Modus: Hinweis-Toast wenn Wegpunkte gesperrt sind (verhindert versehentliches Verlängern der Tour) */
/* Haengt am Wegpunkt-Knopf der Kartenleiste (Position kommt aus dem JS, weil die
   Leiste je nach Fenstergroesse woanders sitzt). Vorher stand der Hinweis unten in
   der Mitte — weit weg von dem Knopf, den er erklaert, und ueber der Karte im Weg. */
.wp-hint {
  position: fixed; z-index: 500;
  display: flex; align-items: center; gap: 10px;
  background: #1c1f25; color: #f2f2f2; border: 1px solid #3a3f47;
  border-radius: 12px; padding: 10px 12px 10px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  font: 500 13px/1.4 Inter, system-ui, sans-serif; max-width: min(320px, 74vw);
}
/* Zeiger auf den Knopf — sitzt rechts, wenn die Blase links daneben liegt. */
.wp-hint::after {
  content: ''; position: absolute; right: -7px; top: 50%; margin-top: -7px;
  border: 7px solid transparent; border-left-color: #3a3f47; border-right: 0;
}
.wp-hint.wp-hint--unten::after {
  right: 18px; top: -7px; margin-top: 0;
  border: 7px solid transparent; border-bottom-color: #3a3f47; border-top: 0;
}
.wp-hint__txt { flex: 1; min-width: 0; }
/* Zweite Zeile: sagt, WO geschaltet wird. Der Hinweis selbst schaltet nichts mehr. */
.wp-hint__sub { display: inline-block; margin-top: 3px; font-size: 11.5px; color: #b9beC6; font-weight: 400; }
.wp-hint__x { flex: 0 0 auto; background: none; border: none; color: #9aa0a6; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.wp-hint--flash { animation: wpHintFlash .4s ease; }
@keyframes wpHintFlash { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
/* Handy: nur ein schlanker Hinweis, nicht der halbe Bildschirm */
@media (max-width: 640px) {
  .wp-hint { gap: 7px; padding: 7px 8px 7px 11px; font-size: 12px; max-width: 78vw; }
  .wp-hint__txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wp-hint__on { padding: 6px 10px; font-size: 12px; }
  .wp-hint__x { font-size: 18px; }
}

/* Einkehr-Marker entlang der gebauten Hotel-Tour (☕, offen grün / geschlossen grau) */
.ht-route-einkehr {
  font-size: 14px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #1c1f25; border: 2px solid #8a9099;
  cursor: pointer; box-sizing: border-box;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.ht-route-einkehr.is-open { border-color: #7bd88f; box-shadow: 0 0 9px rgba(123,216,143,.65); }
.ht-route-einkehr.is-closed { opacity: .82; }
