/* Flaggen-Emoji-Webfont: liefert nur die Regional-Indicator-Glyphen (Länder-
   flaggen). Chrome/Edge unter Windows haben keine Flaggen im System-Emoji-Font
   und zeigen sonst nur die Buchstaben (DE/EN). unicode-range beschränkt die
   Schrift strikt auf die Flaggen-Codepoints, sie beeinflusst keinen anderen Text. */
@font-face {
  font-family: 'Twemoji Country Flags';
  src: url('../font/twemoji-country-flags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0020-E007F;
  font-display: swap;
}

:root {
  --c-bg:       #f0ebe0;
  --c-surface:  rgba(255, 252, 245, 0.96);
  --c-border:   rgba(120,100,70,0.12);
  --c-border2:  rgba(120,100,70,0.22);
  --c-text:     #2d2416;
  --c-muted:    rgba(80,60,30,0.52);
  --c-accent:   #2e8b57;
  --c-accent2:  #1a6b9a;
  --c-warn:     #c8860a;
  --c-blur:     blur(20px) saturate(1.4);
  --c-shadow:   0 8px 32px rgba(80,60,20,0.18), 0 2px 8px rgba(80,60,20,0.10);
  --c-shadow-card:0 16px 48px rgba(40,30,10,0.22), 0 2px 8px rgba(40,30,10,0.12);
  --drawer-h:   178px;
  --trans:      cubic-bezier(0.32, 0.72, 0, 1);
  /* extended theme tokens */
  --c-map-bg:       #e8e0cc;
  --c-fade-top:     rgba(240,235,224,0.97);
  --c-pill-active-text: #fff;
  --c-pill-active-shadow: 0 3px 12px rgba(46,139,87,0.28);
  --c-pill-shadow:  0 2px 8px rgba(80,60,20,0.10);
  --c-ctrl-hover:   rgba(255,252,242,0.98);
  --c-ctrl-hover-shadow: 0 4px 16px rgba(80,60,20,0.18);
  --c-notch:        rgba(120,100,70,0.18);
  --c-nav-border:   rgba(46,139,87,0.3);
  --c-nav-bg:       rgba(46,139,87,0.08);
  --c-nav-hover-bg: rgba(46,139,87,0.15);
  --c-nav-hover-shadow: 0 4px 12px rgba(46,139,87,0.22);
  --c-nav-shadow:   0 2px 8px rgba(46,139,87,0.12);
  --c-chip-bg:      rgba(120,100,70,0.06);
  --c-chip-avail-bg:    rgba(46,139,87,0.08);
  --c-chip-avail-border: rgba(46,139,87,0.25);
  --c-backdrop:     rgba(180,160,120,0.38);
  --c-modal-bg:     rgba(255, 252, 244, 0.99);
  --c-modal-shadow: 0 24px 60px rgba(60,40,10,0.22), 0 4px 16px rgba(60,40,10,0.10);
  --c-hover-subtle: rgba(120,100,70,0.06);
  --c-hover-strong: rgba(120,100,70,0.09);
  --c-checked-bg:   rgba(46,139,87,0.06);
  --c-fo-check-border: rgba(120,100,70,0.25);
  --c-apply-text:   #fff;
  --c-apply-shadow: 0 4px 14px rgba(46,139,87,0.28);
  --c-secondary-bg: rgba(120,100,70,0.08);
  --c-secondary-hover: rgba(120,100,70,0.14);
  --c-ri-chip-on-border: rgba(46,139,87,0.3);
  --c-ri-chip-on-bg: rgba(46,139,87,0.07);
  --c-desc-color:   rgba(45,36,22,0.65);
  --c-dfi-size-bg:  rgba(120,100,70,0.08);
  --c-dfi-avail-bg: rgba(46,139,87,0.1);
  --c-dfi-off-bg:   rgba(120,100,70,0.05);
  --c-dfi-off-color: rgba(80,60,30,0.3);
  --c-slider-bg:    rgba(120,100,70,0.06);
  --c-slider-btn-bg: rgba(255,252,244,0.88);
  --c-slider-btn-hover: rgba(255,252,244,0.98);
  --c-slider-btn-shadow: 0 2px 6px rgba(80,60,20,0.12);
  --c-dot-bg:       rgba(120,100,70,0.3);
  --c-collapse-bg:  rgba(120,100,70,0.07);
  --c-collapse-hover: rgba(120,100,70,0.12);
  --c-navigate-bg:  rgba(46,139,87,0.1);
  --c-navigate-border: rgba(46,139,87,0.3);
  --c-navigate-shadow: 0 2px 8px rgba(46,139,87,0.12);
  --c-scrollbar:    rgba(120,100,70,0.15);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  width:100%; height:100dvh;
  overflow:hidden;
  background: var(--c-bg);
  font-family: 'Twemoji Country Flags', 'Syne', sans-serif;
  color: var(--c-text);
}

#map {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  background: var(--c-map-bg);
}

/* hide MapLibre default controls we don't need */
.maplibregl-ctrl-bottom-right { display: none !important; }

.top-fade {
  position: absolute;
  top:0; left:0; right:0;
  height: 130px;
  background: linear-gradient(to bottom, var(--c-fade-top) 0%, transparent 100%);
  pointer-events: none;
  z-index: 5;
  transition: background 0.35s ease;
}

/* ── FILTER PILLS ── */
/* ── NAVI-HUD (Turn-by-turn + Restzeit/-distanz in einer Box) ──────────────
 * Oben angedockt waehrend aktiver Navigation. Liegt UEBER der (gedimmten)
 * Pill-Filter-Bar (z-index 25 > 12). Zwei Zeilen: oben Turn-Anweisung,
 * unten Gesamt-Status (Zeit/Distanz/Modus/Abbrechen). */
.turn-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  backdrop-filter: var(--c-blur);
  -webkit-backdrop-filter: var(--c-blur);
  border-radius: 16px;
  box-shadow: var(--c-shadow);
  border: 1px solid var(--c-border);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.turn-hud.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
.turn-hud-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.turn-hud-arrow {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--trans);
}
.turn-hud-arrow svg { width: 26px; height: 26px; }
.turn-hud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.turn-hud-distance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.1;
}
.turn-hud-instruction {
  font-size: 13px;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.turn-hud-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--c-border);
}
.turn-hud-totals {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--c-text);
  flex: 1;
  min-width: 0;
}
.turn-hud-clock {
  width: 14px;
  height: 14px;
  color: var(--c-muted);
  flex-shrink: 0;
}
.turn-hud-sep { color: var(--c-muted); }
.turn-hud-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-muted);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.turn-hud-close:hover { background: var(--c-hover-strong); color: var(--c-text); }
.turn-hud-close svg { width: 14px; height: 14px; }
/* Navi-Hinweis-Wiederöffnen-Button (i) — Akzentfarbe, damit er auffällt.
   Nur sichtbar, wenn das Navi-Ziel einen Hinweis hat (JS toggelt .hidden). */
.turn-hud-hint {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--c-accent);
  background: var(--c-surface);
  color: var(--c-accent);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.turn-hud-hint.hidden { display: none; }
.turn-hud-hint:hover { background: var(--c-accent); color: #fff; }
.turn-hud-hint svg { width: 16px; height: 16px; }

/* ── ARRIVED BANNER ────────────────────────────────────────────────────────
 * Kurzer Erfolgs-Hinweis bei Ankunft, zentriert ueber der Karte. Wird vom
 * JS nach ~3s wieder ausgeblendet. */
.arrived-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  background: var(--c-accent);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  transition: opacity 0.3s ease, transform 0.3s var(--trans);
}
.arrived-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% - 12px));
}
.arrived-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrived-banner-icon svg { width: 22px; height: 22px; }
.arrived-banner-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Fortbewegungsart-Umschalter (Fuß | Fahrzeug) — segmentierter Toggle.
 * Wird im Navi-HUD (.turn-hud) und im Drawer wiederverwendet. */
.route-mode-toggle {
  flex-shrink: 0;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--c-hover-subtle);
  border: 1px solid var(--c-border2);
  border-radius: 10px;
}
.route-mode-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--c-muted);
  cursor: pointer;
  transition: background 0.15s var(--trans), color 0.15s var(--trans);
}
.route-mode-btn svg { width: 17px; height: 17px; }
.route-mode-btn:not(.active):hover { color: var(--c-text); }
.route-mode-btn.active {
  background: var(--c-accent);
  color: var(--c-pill-active-text);
}

/* Intro-Toggle: Floating-Button links oben — eigener Container, NICHT in
   .controls (die sitzen rechts unten). Selbe runde Pillen-Optik wie .ctrl.
   Sitzt an der Y-Achse exakt mittig zur Pill-Bar (top + height/2). */
.intro-toggle-btn {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 15;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--c-border2);
  background: var(--c-surface);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
  box-shadow: var(--c-shadow);
  transition: transform 0.1s, background 0.12s;
}
.intro-toggle-btn:hover { background: var(--c-surface-hover, var(--c-surface)); }
.intro-toggle-btn:active { transform: scale(0.94); }
.intro-toggle-btn.hidden { display: none; }
.intro-toggle-btn svg { width: 22px; height: 22px; }

/* ── PILL-FILTER-BAR ── */
/* Wrap: positioniert die scrollbare Pill-Liste rechts neben dem i-Button.
   Linker Offset = i-Button (14 + 40) + 8 px Gap. Rechts 14 px Rand. Höhe 40 px
   damit die Pills (34 px) vertikal mittig zum 40-px-i-Button stehen. */
.filter-bar-wrap {
  position: absolute;
  top: 14px;
  left: 62px;
  right: 14px;
  height: 40px;
  z-index: 12;
  pointer-events: none; /* Wrap blockiert nicht — nur Pills + Chevron klickbar */
}
.filter-bar-wrap.hidden { display: none; }

.filter-bar {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  padding-left: 18px;  /* Platz für Chevron-Fade links */
  padding-right: 22px; /* Platz für Chevron-Fade rechts */
}
.filter-bar::-webkit-scrollbar { display:none; }

/* Chevron-Indicators links + rechts: signalisieren „mehr scrollbar". Werden
   per .at-start / .at-end aus dem JS ausgeblendet sobald die Bar an die
   jeweilige Kante scrollt. Sanfter Fade vom Map-Hintergrund.
   z-index 2 — muss ÜBER den Pills im Bar liegen (HTML-Order alleine reicht
   für das links-Chevron nicht, da es vor dem Bar im DOM steht). */
.filter-bar-chevron {
  position: absolute;
  top: 0;
  height: 100%;
  width: 30px;
  display: flex;
  align-items: center;
  color: var(--c-muted);
  /* Sichtbar: Klicks blockieren (sonst tappt der User auf eine Pille, die
     unter dem Fade kaum noch zu erkennen ist). Versteckt (opacity:0 via
     .at-start / .at-end): pointer-events:none damit das Chevron nicht weiter
     im Weg steht. */
  pointer-events: auto;
  transition: opacity 0.18s ease;
  z-index: 2;
}
.filter-bar-chevron svg { width: 14px; height: 14px; }
.filter-bar-chevron-right {
  right: 0;
  justify-content: flex-end;
  padding-right: 3px;
  background: linear-gradient(to right, transparent 0%, var(--c-fade-top, rgba(245,237,219,0.85)) 60%);
}
.filter-bar-chevron-left {
  left: 0;
  justify-content: flex-start;
  padding-left: 3px;
  background: linear-gradient(to left, transparent 0%, var(--c-fade-top, rgba(245,237,219,0.85)) 60%);
}
.filter-bar-wrap.at-end   .filter-bar-chevron-right { opacity: 0; pointer-events: none; }
.filter-bar-wrap.at-start .filter-bar-chevron-left  { opacity: 0; pointer-events: none; }

/* Pill: Default = weißer Hintergrund + farbiger Rand + farbiger Text (Cat-Color
   via CSS-Custom-Property). Active = Hintergrund in Cat-Color + weißer Text. */
.pill {
  --pill-color: var(--c-accent);
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border-radius: 100px;
  border: 1.2px solid var(--pill-color);
  background: var(--c-surface);
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
  color: var(--pill-color);
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .16s, color .16s, border-color .16s, transform .1s, box-shadow .16s;
  user-select: none;
  white-space: nowrap;
  box-shadow: var(--c-pill-shadow);
}
.pill:hover {
  background: color-mix(in srgb, var(--pill-color) 8%, var(--c-surface));
}
.pill:active { transform: scale(0.95); }
.pill.active {
  background: var(--pill-color);
  border-color: var(--pill-color);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--pill-color) 35%, transparent);
}

/* ── MAP CONTROLS ── */
.controls {
  position: absolute;
  /* iOS-Safari: Buttons ÜBER der URL-Bar verankern (sonst sitzen sie
     hinter der transparenten Browser-Chrome). */
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  right: 18px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: bottom 0.4s var(--trans);
}
.controls.up { bottom: calc(var(--drawer-h) + 18px + env(safe-area-inset-bottom, 0px)); }

/* Reset-Search-Button: nimmt absolut über dem .controls-Stack Platz, OHNE
   den Flex-Flow zu beeinflussen — sonst würde der Search-Button beim Ein-/
   Ausblenden des Resets vertikal springen. `bottom: calc(100% + 9px)`
   positioniert die Unterkante von Reset exakt 9 px über der Oberkante des
   .controls-Containers (= dem Search-Button), `right: 0` rechts-bündig zum
   Stack. Bewegt sich automatisch mit der `.controls.up`-Animation mit. */
.controls #btnResetSearch {
  position: absolute;
  bottom: calc(100% + 9px);
  right: 0;
}

.ctrl {
  width: 46px; height: 46px;
  border-radius: 13px;
  border: 1px solid var(--c-border2);
  background: var(--c-surface);
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
  box-shadow: var(--c-shadow);
  color: var(--c-text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.ctrl:hover  { background: var(--c-ctrl-hover); box-shadow: var(--c-ctrl-hover-shadow); }
.ctrl:active { transform: scale(0.91); }
.ctrl svg    { width: 18px; height: 18px; stroke-width: 1.8; }
/* active = Ortung läuft, aber User hat gepannt (manual) → nur Outline */
.ctrl.active { background: var(--c-surface); border-color: var(--c-accent); color: var(--c-accent); }
.ctrl.active:hover { background: rgba(46,139,87,0.08); }
/* following = Ortung läuft + Karte folgt → gefüllt */
.ctrl.active.following { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.ctrl.active.following:hover { background: var(--c-accent); box-shadow: 0 2px 12px rgba(46,139,87,0.35); }
/* Such-Button während aktiver Navigation gesperrt (ausgegraut, nicht klickbar). */
.ctrl:disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ── SPRACHUMSCHALTER-POPOVER ── */
/* Per JS (setupLanguageSwitcher) Fixed-positioniert neben #btnLang. Selbe
   Pillen-/Glas-Optik wie .ctrl. */
.lang-popover {
  position: fixed;
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 13px;
  border: 1px solid var(--c-border2);
  background: var(--c-surface);
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
  box-shadow: var(--c-shadow);
}
.lang-popover.hidden { display: none; }
.lang-popover .lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  color: var(--c-text);
  white-space: nowrap;
  text-align: left;
}
.lang-popover .lang-item:hover { background: var(--c-ctrl-hover); }
.lang-popover .lang-item.active { color: var(--c-accent); font-weight: 600; }
.lang-popover .lang-item .lang-flag { font-size: 18px; line-height: 1; }

/* Pill-Filter-Bar während aktiver Navigation gesperrt. */
.filter-bar-wrap.nav-locked { opacity: 0.4; }
.filter-bar-wrap.nav-locked .pill,
.filter-bar-wrap.nav-locked .filter-bar-chevron-left,
.filter-bar-wrap.nav-locked .filter-bar-chevron-right { pointer-events: none; }

/* ── LOCATION PERMISSION MODAL ── */
.locate-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.locate-modal.hidden { display: none; }
.locate-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.locate-modal-panel {
  position: relative; max-width: 340px; margin: 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--c-shadow-card);
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
}
.locate-modal-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--c-text); }
.locate-modal-text { font-size: 13px; line-height: 1.5; color: var(--c-text); margin: 0 0 16px; }
.locate-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.locate-modal-btn { height: 34px; padding: 0 14px; border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--c-border2); background: transparent; color: var(--c-text); }
.locate-modal-btn:active { transform: scale(0.96); }
.locate-modal-ok { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

/* Navi-Hinweis-Text: kann lang/mehrzeilig sein → Zeilenumbrüche erhalten und
   bei Überlänge im Panel scrollen statt das Modal zu sprengen. Linksbündig. */
.navhint-text { white-space: pre-wrap; text-align: left; max-height: 45vh; overflow-y: auto; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 1001; max-width: 90vw;
  background: rgba(30,25,15,0.92); color: #fff;
  padding: 10px 16px; border-radius: 100px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.hidden { display: none; }

/* ── DRAWER ── */
.drawer {
  position: absolute;
  left: 0; right: 0;
  /* iOS-Safari: bottom auf safe-area verankern, sonst sitzt der Drawer
     unter der URL-Bar und sein Stub schimmert durch die transparente
     Browser-Chrome durch (sichtbarer "Balken" am Bildrand). */
  bottom: env(safe-area-inset-bottom, 0);
  height: var(--drawer-h);
  z-index: 20;
  padding: 0 14px 22px;
  /* Schiebt den Drawer um seine eigene Höhe + safe-area + 80px Sicherheits-
     Puffer raus. Der Puffer fängt iOS-Quirks ab wo env() nicht greift oder
     wo Apples URL-Bar-Backdrop-Filter den Stub-Bereich sonst durchschimmern
     lässt. Bei translateY(120%) war noch ein Rest sichtbar. */
  transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px) + 80px));
  transition: transform 0.4s var(--trans), height 0.4s var(--trans);
  pointer-events: none;
  touch-action: none;
}
.drawer.open      { transform: translateY(0); pointer-events: all; }
.drawer.expanded  { height: 88dvh; padding-bottom: 14px; }

.drawer-card {
  height: 100%;
  background: var(--c-surface);
  -webkit-backdrop-filter: var(--c-blur);
  backdrop-filter: var(--c-blur);
  border: 1px solid var(--c-border2);
  border-radius: 20px;
  box-shadow: var(--c-shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* static mini header always visible */
.drawer-header {
  flex-shrink: 0;
  padding: 14px 18px 12px;
  cursor: grab;
  user-select: none;
}
.drawer-header:active { cursor: grabbing; }

.drawer-notch {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: var(--c-notch);
  margin: 0 auto 12px;
}

.drawer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

/* Top-Slot oben rechts im Drawer-Header: zwei Fuß/Fahrzeug-Icon-Buttons, wenn
   keine Navigation läuft; ein roter "X"-Abbrechen-Button während der Navigation
   (Slot-Wechsel via .routing am Container, gesetzt in setRouteButtonState). */
.drawer-nav-top {
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.btn-nav-top-mode {
  flex-shrink: 0;
  width: 44px; height: 44px;
  padding: 0;
  border: 1.5px solid var(--c-nav-border);
  border-radius: 12px;
  background: var(--c-nav-bg);
  color: var(--c-accent);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--c-nav-shadow);
}
.btn-nav-top-mode svg { width: 18px; height: 18px; }
.btn-nav-top-mode:hover { background: var(--c-nav-hover-bg); box-shadow: var(--c-nav-hover-shadow); }
.btn-nav-top-mode.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-pill-active-text);
}
.btn-nav-top-mode.active svg { stroke: var(--c-pill-active-text); }

/* Abbrechen-Button: nur während aktiver Navigation sichtbar. Dezent: rote
   Outline + roter Text auf transparentem Grund (kein gefülltes Rot). */
.btn-navigate-top {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid rgba(192,57,43,0.55);
  border-radius: 12px;
  background: transparent;
  color: #c0392b;
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.btn-navigate-top:hover {
  background: rgba(192,57,43,0.08);
  border-color: #c0392b;
}

/* Slot-Umschaltung: routing → Modus-Buttons aus, Abbrechen an. */
.drawer-nav-top.routing .btn-nav-top-mode { display: none; }
.drawer-nav-top.routing .btn-navigate-top { display: flex; }

.drawer-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 4px;
}

.drawer-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--c-text);
  line-height: 1.1;
}

.drawer-chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.chip {
  height: 27px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-chip-bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-muted);
  display: flex; align-items: center; gap: 5px;
}
.chip.on-avail { background: var(--c-chip-avail-bg); border-color: var(--c-chip-avail-border); color: var(--c-accent); }
.chip.sqm-chip { background: var(--c-chip-bg); border-color: var(--c-border2); color: var(--c-text); }
.chip.cat-chip { background: var(--c-chip-bg); }
.chip svg      { width: 12px; height: 12px; flex-shrink: 0; }

/* ── SEARCH MODAL ── */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--c-backdrop);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  position: absolute;
  left: 14px; right: 14px;
  top: 56px;
  bottom: 14px;
  z-index: 41;
  background: var(--c-modal-bg);
  border: 1px solid var(--c-border2);
  border-radius: 22px;
  box-shadow: var(--c-modal-shadow);
  overflow: hidden;
  transform: translateY(-16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s var(--trans), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
}
.modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* ── SEARCH TABS ── */
.search-tabs {
  flex-shrink: 0;
  display: flex;
  border-bottom: 1px solid var(--c-border);
  padding: 0 12px;
  gap: 4px;
}
.search-tab {
  flex: 1;
  height: 44px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--c-muted);
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.search-tab.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}
.search-tab:hover:not(.active) { color: var(--c-text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--c-text);
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-reset {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--c-border2);
  background: transparent;
  color: var(--c-muted);
  font-family: 'Syne', sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-reset:hover { background: var(--c-hover-subtle); color: var(--c-text); }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--c-hover-subtle);
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: system-ui;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--c-hover-strong); color: var(--c-text); }

.modal-body {
  overflow-y: auto;
  padding: 6px 0 8px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--c-scrollbar) transparent;
}

.filter-group {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}
.filter-group:last-child { border-bottom: none; }
/* Solange Textsuche aktiv ist: Filter-Gruppen werden komplett ausgeblendet,
 * stattdessen rendert .panel-results die Trefferliste inline. Filter-State
 * bleibt erhalten — leeren des Suchfelds blendet die Filter sofort wieder ein. */
.tab-panel.is-search-active .filter-group {
  display: none;
}
.tab-panel:not(.is-search-active) .panel-results {
  display: none;
}

/* Textsuche pro Tab — sitzt als erste Sektion im Tab-Panel, optisch abgesetzt
 * vom restlichen Filter-Stack (kein Border-Bottom, eigener Hintergrund). */
.panel-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 18px 4px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-input-bg, #fff);
  transition: border-color .18s, box-shadow .18s;
}
.panel-search:focus-within {
  border-color: var(--c-accent, #2e8b57);
  box-shadow: 0 0 0 3px var(--c-chip-avail-bg, rgba(46,139,87,0.12));
}
.panel-search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--c-muted, #888);
}
.panel-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--c-text, #333);
  font-size: 14px;
  font-family: inherit;
  padding: 0;
}
.panel-search-input::placeholder { color: var(--c-muted, #888); }
.panel-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--c-border, #e5e5e5);
  color: var(--c-text, #333);
  cursor: pointer;
  padding: 0;
}
.panel-search-clear svg { width: 12px; height: 12px; }
.panel-search-clear:hover { background: var(--c-muted, #888); color: #fff; }
.panel-search-clear.hidden { display: none; }

/* Inline-Trefferliste — sichtbar nur wenn Suche im Tab aktiv (siehe
 * .tab-panel.is-search-active oben). Nutzt dieselben .result-item-Styles
 * wie der separate viewList. */
.panel-results {
  padding: 6px 18px 12px;
}
.panel-results-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--c-muted);
  font-size: 13px;
  font-style: italic;
}

.filter-group-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text, #333);
  margin-bottom: 12px;
  min-height: 19px;
  line-height: 19px;
}
.fo-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-muted);
  padding: 8px 0 4px;
}
.fo-group-title:first-child { padding-top: 0; }
.filter-active-badge {
  display: inline-block;
  height: 17px;
  padding: 0 7px;
  border-radius: 100px;
  background: var(--c-chip-avail-bg);
  border: 1px solid var(--c-chip-avail-border);
  color: var(--c-accent);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 17px;
  vertical-align: middle;
  margin-left: 6px;
  transition: opacity .2s;
}
.filter-active-badge:empty { display: none; }

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 11px;
  cursor: pointer;
  transition: background .14s;
  user-select: none;
}
.filter-option:hover { background: var(--c-hover-subtle); }
.filter-option.checked { background: var(--c-checked-bg); }

.fo-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--c-fo-check-border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.fo-check svg { width: 11px; height: 11px; opacity: 0; transition: opacity .15s; }
.filter-option.checked .fo-check {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.filter-option.checked .fo-check svg { opacity: 1; }

.fo-check.radio {
  border-radius: 50%;
}
.filter-option.checked .fo-check.radio {
  background: none;
  border-color: var(--c-accent);
  position: relative;
}
.filter-option.checked .fo-check.radio svg { opacity: 0; }
.filter-option.checked .fo-check.radio::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.fo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fo-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text);
}
.fo-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--c-muted);
}
.fo-icon-wrap {
  width: 10px; height: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.fo-icon-wrap svg { width: 14px; height: 14px; }

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}
.btn-apply {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--c-accent);
  color: var(--c-apply-text);
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--c-apply-shadow);
}
.btn-apply:hover  { opacity: 0.88; }
.btn-apply:active { transform: scale(0.98); }
.btn-close-search {
  width: 100%; height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s;
}
.btn-close-search:hover { color: var(--c-text); }

/* ── MODAL VIEWS ── */
.modal-view { display: flex; flex-direction: column; height: 100%; }
.modal-view.hidden { display: none; }

.btn-back {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1.5px solid var(--c-accent);
  color: var(--c-accent);
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.btn-back:hover { background: var(--c-accent); color: #fff; }
.btn-back:hover svg { stroke: #fff; }

.modal-footer-2 {
  display: flex; flex-direction: column; gap: 8px;
}
.result-count-label {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  padding-bottom: 2px;
}
.footer-btn-row {
  display: flex;
  gap: 8px;
}
.footer-btn-row .btn-apply {
  flex: 1;
}
.btn-secondary {
  background: var(--c-secondary-bg) !important;
  color: var(--c-text) !important;
  border: 1px solid var(--c-border2);
  box-shadow: none !important;
}
.btn-secondary:hover { background: var(--c-secondary-hover) !important; }

/* result list */
.result-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-border);
  transition: background .14s;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--c-hover-subtle); }
.result-item:active { background: var(--c-hover-strong); }

.ri-color {
  width: 4px; align-self: stretch;
  border-radius: 2px;
  flex-shrink: 0;
}
.ri-main { flex: 1; min-width: 0; }
.ri-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  color: var(--c-text);
}
.ri-cat {
  font-size: 11px; color: var(--c-muted);
  margin-top: 2px;
}
.ri-chips { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.ri-chip {
  height: 20px; padding: 0 8px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--c-border);
  color: var(--c-muted);
  background: var(--c-chip-bg);
}
.ri-chip.on  { border-color: var(--c-ri-chip-on-border); color: var(--c-accent); background: var(--c-ri-chip-on-bg); }
.ri-chip.off { opacity: 0.45; }
.ri-arrow { color: var(--c-muted); flex-shrink: 0; }
.ri-arrow svg { width: 16px; height: 16px; }

/* detail view */
.detail-hero {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--c-border);
}
.detail-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 4px; }
.detail-name { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 500; color: var(--c-text); }
/* Kategorie-Pille im Drawer/Detail: die Kategoriefarbe traegt jetzt NUR der
 * (dickere) Rahmen — innen ist die Pille einheitlich neutral, damit der Text
 * unabhaengig von der Kategoriefarbe immer gut lesbar bleibt. Inline-Style
 * setzt nur noch border-color. */
.detail-cat-badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 12px;
  border-radius: 8px; margin-top: 8px;
  font-size: 11px; font-weight: 600;
  border: 3px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
}
.detail-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

.detail-section { padding: 14px 18px; border-bottom: 1px solid var(--c-border); }
.detail-section:last-child { border-bottom: none; }
.detail-section-title { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 10px; }
.detail-desc { font-size: 13.5px; line-height: 1.65; color: var(--c-desc-color); }

.detail-feature {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--c-border);
}
.detail-feature:last-child { border-bottom: none; }
.dfi {
  width: 32px; height: 32px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dfi svg { width: 15px; height: 15px; }
.dfi.size  { background: var(--c-dfi-size-bg); color: var(--c-text); }
.dfi.avail { background: var(--c-dfi-avail-bg); color: var(--c-accent); }
.dfi.off   { background: var(--c-dfi-off-bg); color: var(--c-dfi-off-color); }
.dft strong { display: block; font-size: 13px; font-weight: 600; color: var(--c-text); }
.dft span   { font-size: 12px; color: var(--c-muted); }

.detail-slider-wrap {
  position: relative; border-radius: 12px; overflow: hidden;
  height: 170px; background: var(--c-slider-bg);
  border: 1px solid var(--c-border);
}

/* expanded content - hidden in mini state */
.drawer-body {
  flex: 1;
  overflow-y: hidden;
  overflow-x: hidden;
  padding: 0 18px 18px;
  pointer-events: none;
  transition: opacity 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--c-scrollbar) transparent;
  position: relative;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}
.drawer.expanded .drawer-body {
  overflow-y: auto;
  pointer-events: all;
  mask-image: none;
  -webkit-mask-image: none;
}

.drawer-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 18px 0 8px;
}

.drawer-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--c-desc-color);
  padding: 0 18px 14px;
  margin: 0;
}
.drawer-desc:empty { display: none; }

/* feature detail rows */
.feature-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
  padding: 8px 0 2px;
}
.feature-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}
.feature-row:last-child { border-bottom: none; }
.feature-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { width: 16px; height: 16px; }
.feature-icon.size  { background: var(--c-dfi-size-bg); color: var(--c-text); }
.feature-icon.avail { background: var(--c-dfi-avail-bg); color: var(--c-accent); }
.feature-text strong { display: block; font-size: 13px; font-weight: 600; color: var(--c-text); }
.feature-text span   { font-size: 12px; color: var(--c-muted); }

/* image slider */
.slider-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 180px;
  background: var(--c-slider-bg);
  border: 1px solid var(--c-border);
}
.slides {
  display: flex;
  height: 100%;
  transition: transform 0.38s var(--trans);
}
.slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--c-muted);
}
.slide-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.slide-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  color: var(--c-muted);
  font-size: 12px;
}
.slide-placeholder svg { width: 32px; height: 32px; opacity: 0.3; }

.slider-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-slider-btn-bg);
  border: 1px solid var(--c-border2);
  color: var(--c-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 2;
  box-shadow: var(--c-slider-btn-shadow);
}
.slider-btn:hover { background: var(--c-slider-btn-hover); }
.slider-btn svg { width: 14px; height: 14px; }
.slider-btn.prev { left: 8px; }
.slider-btn.next { right: 8px; }

.slider-dots {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 5px;
}
.dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-dot-bg);
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.dot.active { background: var(--c-accent); transform: scale(1.3); }

/* ── Initial Loading Spinner ── */
/* Sichtbar bis loadData + addMapLayers + KI-Bild fertig sind. Hintergrund matcht
   den Papier-Stil, damit der Übergang zur fertigen Karte unauffällig ist. */
.map-loading-spinner {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #f3e8d0;
  pointer-events: all;
  transition: opacity 0.3s ease;
}
.map-loading-spinner.hide {
  opacity: 0;
  pointer-events: none;
}
.spinner-logo {
  width: 320px;
  height: auto;
  margin-bottom: 8px;
}
.spinner-circle {
  width: 72px;
  height: 72px;
  border: 6px solid rgba(192, 57, 43, 0.18);
  border-top-color: #c0392b;
  border-radius: 50%;
  animation: mapSpin 0.9s linear infinite;
}
.spinner-label {
  font-size: 14px;
  font-weight: 500;
  color: #c0392b;
  letter-spacing: 0.02em;
}
@keyframes mapSpin {
  to { transform: rotate(360deg); }
}

/* ── Thumbnail grid ── */
.thumb-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
/* dPhotosSection sitzt außerhalb der gepaddeten drawer-body (damit es im
   Mini-State sichtbar bleibt), braucht daher eigenes horizontales Padding —
   sonst klebt das "Fotos"-Label am linken Card-Rand. Bottom-Border + Padding
   spiegeln den Section-Trenner aus der Detail-View (.detail-section). */
#dPhotosSection {
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 14px;
}
.thumb {
  width: 72px; height: 72px; border-radius: 8px;
  overflow: hidden; cursor: pointer;
  border: 1px solid var(--c-border);
  transition: border-color .12s, box-shadow .12s;
}
.thumb:hover { border-color: var(--c-accent); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.lightbox.hidden { display: none; }
.lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(6px);
}
.lightbox-img {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 85vh;
  object-fit: contain; border-radius: 8px;
  user-select: none;
}
/* 360°-Bilder werden statt als <img> ueber Photo Sphere Viewer gerendert.
   Stage muss eine feste Groesse haben damit PSV den Canvas korrekt
   initialisieren kann. Gleiches Limit wie .lightbox-img fuer konsistente
   Optik. */
.lightbox-pano-stage {
  position: relative; z-index: 1;
  width: 90vw; height: 85vh;
  max-width: 1600px;
  background: #1c1e22;
  border-radius: 8px;
  overflow: hidden;
}

/* 360°-Marker (Phase 2). Werden vom PSV-Markers-Plugin als HTML-Marker
   im Viewer-Overlay gerendert. Identisch zur Admin-CSS — wenn Anpassungen,
   beide CSS-Files muessen mit (siehe Memory project_panorama_360.md). */
.pano-marker {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transform-origin: center center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pano-marker:hover { transform: scale(1.08); }
.pano-marker-label {
  padding: 4px 10px;
  border-radius: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #1c1e22;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pano-marker-badge {
  position: relative;
  width: 31px; height: 31px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
  background: #ffffff;
  overflow: hidden;
}
/* Link-Indikator bei reinen Icon-Markern: kleines ↗ als Eck-Chip (innen unten
   rechts, weil .pano-marker-badge overflow:hidden hat → aussen würde geclippt). */
.pano-marker-linkarrow {
  position: absolute;
  right: 0; bottom: 0;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #1c1e22;
  background: rgba(255, 255, 255, 0.95);
  border-top-left-radius: 7px;
  padding: 1px 1px 0 2px;
  pointer-events: none;
}
/* Link-Glyph in Text-Markern (Label-Pille). */
.pano-marker-linkglyph {
  font-weight: 700;
}
.pano-marker-badge svg,
.pano-marker-badge img {
  width: 100%; height: 100%;
  pointer-events: none;
  display: block;
}
.pano-marker-badge--no-ring {
  background: transparent !important;
  box-shadow: none;
  overflow: visible;
}
.pano-marker-badge-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px;
  background: rgba(0,0,0,.5); border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.lightbox-close:hover { background: rgba(0,0,0,.7); }
.lightbox-close svg { width: 20px; height: 20px; }
/* Zurück-Button: nur nach einem Marker-Sprung in ein anderes 360°-Bild
   sichtbar (Verlaufs-Stack in frontend.js). Links oben, Gegenstück zum
   Close-Button rechts. */
.lightbox-back {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  height: 40px; padding: 0 14px 0 8px;
  background: rgba(0,0,0,.5); border: none; border-radius: 20px;
  color: #fff; cursor: pointer; font-size: .9rem; font-weight: 500;
  display: flex; align-items: center; gap: 4px;
  transition: background .12s;
}
.lightbox-back:hover { background: rgba(0,0,0,.7); }
.lightbox-back svg { width: 20px; height: 20px; }
.lightbox-nav {
  position: absolute; top: 50%; z-index: 2;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,.5); border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.lightbox-nav:hover { background: rgba(0,0,0,.7); }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-caption {
  position: absolute; bottom: 44px; left: 50%; z-index: 2;
  transform: translateX(-50%);
  font-size: .9rem; color: rgba(255,255,255,.9);
  text-align: center; max-width: 80vw;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* ── Intro-Screen Overlay ─────────────────────────────────────────────────── */
/* Dialog-Style: dunkler halbtransparenter Backdrop (Karte schimmert durch),
   darin ein zentriertes abgerundetes Card-Element (97 vw × 97 vh). Schließt
   per X-Button, Klick auf Backdrop oder localStorage-Flag (einmal-pro-Session
   Auto-Open, danach manuell via i-Button rechts oben). */
.intro-screen-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 18, 14, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.25s ease;
}
.intro-screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.intro-screen-dialog {
  position: relative;
  width: 93vw; height: 93vh;
  background: var(--c-surface, #fff);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.intro-screen-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 40px; height: 40px;
  border: 1px solid var(--c-border2, rgba(0,0,0,0.1));
  border-radius: 50%;
  background: var(--c-surface, #fff);
  color: var(--c-text, #1a1a17);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.intro-screen-close:active {
  transform: scale(0.95);
}
.intro-screen-close svg {
  width: 18px; height: 18px;
}
.intro-screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 56px 24px 32px;
  -webkit-overflow-scrolling: touch;
}
.intro-screen-content {
  max-width: 600px;
  margin: 0 auto;
}
/* Sticky-Footer im Dialog (außerhalb des Scroll-Containers) — Button immer
   sichtbar egal wie weit der User im Content gescrollt hat. */
.intro-screen-footer {
  flex-shrink: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--c-border2, rgba(0,0,0,0.08));
  background: var(--c-surface, #fff);
}
.intro-screen-continue {
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 22px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s, background 0.12s;
}
.intro-screen-continue:hover { background: #15803d; }
.intro-screen-continue:active { transform: scale(0.98); }
/* Block-Styles — Mobile-first, sollten 1:1 dem Editor-Preview entsprechen. */
.intro-block-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  margin: 0 0 20px;
}
/* --intro-font wird von frontend.js (setupIntroScreen) auf #introScreenContent
   gesetzt, basierend auf dem im Admin gewählten Schriftart-Preset. Fallback
   = Syne, damit es ohne Setting wie vorher aussieht. */
.intro-block-headline {
  font-family: var(--intro-font, 'Syne', sans-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a17;
  margin: 0 0 14px;
}
.intro-block-text {
  font-family: var(--intro-font, inherit);
  font-size: 16px;
  line-height: 1.55;
  color: #2c2416;
  margin: 0 0 18px;
}
/* Basis-Styling für alle Button-Varianten. Farben (background/color/border)
   kommen aus .intro-block-button--{variant}. Werte gespiegelt aus admin
   app.css (.intro-preview-button--*) — wenn dort ändern, hier mitziehen. */
.intro-block-button {
  /* Tab-Switcher-Look: inline-block damit mehrere aufeinanderfolgende Button-
     Blöcke nebeneinander fließen (wie die Tab-Pills im "Parktipps"-Screenshot
     — fast rechteckig, deutliche Rundung an den Ecken). Schatten +
     Hover-Lift für den Touch-App-Look. */
  display: inline-block;
  vertical-align: top;
  text-align: center;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  font-family: var(--intro-font, inherit);
  margin: 5px 6px 6px 0;
  border: 2px solid transparent;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  cursor: pointer;
}
.intro-block-button:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
  transform: translateY(-1px);
}
.intro-block-button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}
/* Primary = gefüllt (Standard-CTA-Look), die übrigen Varianten = Outline auf
   cremigem Hintergrund. Trennung Primary ↔ Outline sonst unsichtbar. */
.intro-block-button--secondary,
.intro-block-button--outline,
.intro-block-button--dark {
  background: #f4f2ea;
}
.intro-block-button--primary {
  background: #15803d;
  color: #fff;
  border-color: #15803d;
}
.intro-block-button--secondary {
  color: #1d4ed8;
  border-color: #1d4ed8;
}
.intro-block-button--outline {
  color: #15803d;
  border-color: #15803d;
}
.intro-block-button--dark {
  color: #1f2937;
  border-color: #1f2937;
}
.intro-block-list {
  margin: 0 0 18px;
  padding-left: 22px;
  font-family: var(--intro-font, inherit);
  font-size: 16px;
  line-height: 1.55;
  color: #2c2416;
}
.intro-block-list li {
  margin-bottom: 4px;
}
/* Editor.js Marker (gelber Highlight) — innerhalb von Headline/Text/List */
.intro-block-headline mark,
.intro-block-text mark,
.intro-block-list mark {
  background: #fef9c3;
  padding: 0 2px;
  border-radius: 2px;
  color: inherit;
}
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; z-index: 2;
  transform: translateX(-50%);
  font-size: .75rem; color: rgba(255,255,255,.5);
  font-family: 'DM Mono', monospace;
}

/* ── PDF list ── */
.pdf-list { display: flex; flex-direction: column; gap: 2px; padding: 0 18px; }
.pdf-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--c-text);
  transition: background .12s;
}
.pdf-list-item:hover { background: var(--c-surface-hover, rgba(0,0,0,.04)); }
.pdf-list-item svg { flex-shrink: 0; }
.pdf-list-info { flex: 1; min-width: 0; }
.pdf-list-name { font-size: .88rem; font-weight: 600; word-break: break-word; }
.pdf-list-meta { font-size: .72rem; color: var(--c-muted); margin-top: 2px; }
.pdf-lang-badge {
  display: inline-block; font-size: .65rem;
  padding: 1px 5px; border-radius: 4px;
  background: var(--c-surface, rgba(0,0,0,.05)); color: var(--c-muted);
}
.pdf-lang-badge + .pdf-lang-badge { margin-left: 3px; }
.detail-section .pdf-list { padding: 0; }

/* ── Weblink list (pois_urls / accommodations_urls) ── */
.url-list { display: flex; flex-direction: column; gap: 2px; padding: 0 18px; }
.url-list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: var(--c-text);
  transition: background .12s;
}
.url-list-item:hover { background: var(--c-surface-hover, rgba(0,0,0,.04)); }
.url-list-item svg { flex-shrink: 0; margin-top: 1px; }
.url-list-info { flex: 1; min-width: 0; }
.url-list-name { font-size: .88rem; font-weight: 600; word-break: break-word; }
.url-list-meta { font-size: .72rem; color: var(--c-muted); margin-top: 2px; }
.detail-section .url-list { padding: 0; }

/* collapse button shown in expanded state */
.drawer-actions {
  display: none;
  margin: 14px 18px 0;
  gap: 8px;
}
.drawer.expanded .drawer-actions { display: flex; }

.btn-collapse {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--c-border2);
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
  background: var(--c-collapse-bg);
  color: var(--c-muted);
}
.btn-collapse svg { width: 14px; height: 14px; }
.btn-collapse:hover { background: var(--c-collapse-hover); color: var(--c-text); }

/* Fortbewegungsart-Wahl im Drawer: Label + 2 Start-Buttons (Fuß/Fahrzeug).
   Jeder Button startet sofort in dem Modus; der aktuelle Default ist gefüllt
   hervorgehoben (synchron mit dem Toggle in der Route-Leiste). */
.drawer-nav-modes {
  display: none;
  flex-direction: column;
  gap: 7px;
  margin: 14px 18px 0;
}
.drawer.expanded .drawer-nav-modes { display: flex; }
.drawer-nav-label {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
}
.drawer-nav-btns {
  display: flex;
  gap: 8px;
}
.drawer-nav-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  white-space: nowrap;
  border-radius: 12px;
  border: 1px solid var(--c-navigate-border);
  background: var(--c-navigate-bg);
  color: var(--c-accent);
  font-family: 'Syne', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.drawer-nav-btn svg { width: 15px; height: 15px; }
.drawer-nav-btn:hover { background: var(--c-nav-hover-bg); }
.drawer-nav-btn.active {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-pill-active-text);
}
.drawer-nav-btn.active svg { stroke: var(--c-pill-active-text); }

/* ── BRAND-LOGO (unten zentriert) ───────────────────────────────────────
   Dezenter Brand-Anker: Banner ab Desktop-Breite, quadratisches Icon
   für schmale Viewports. Klick führt auf camply.guide. */
.camply-brand {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  /* Über der Karte (0), aber UNTER Drawer (20), Pill-Bar (25), Modal (40+),
     Intro (200) etc. — bei offenem Drawer/Modal verdeckt vom UI. */
  z-index: 5;
  display: block;
  pointer-events: auto;
  /* Pill-Hintergrund für Lesbarkeit auf Aquarell-/Foto-Karten — eng am
     Logo, der Backdrop-Blur trägt mehr zur Lesbarkeit bei als die Deckung. */
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.camply-brand-banner { display: block; height: 38px; width: auto; }

