/* ============================================================
   LadeRoute – Styles
   ------------------------------------------------------------
   Laien-/seniorentauglich: hoher Kontrast, grosse Touch-Ziele,
   gut lesbare Schrift. Desktop-first (Sidebar) UND mobil voll
   nutzbar (Bottom-Sheet).
   ============================================================ */

:root {
  --c-bg: #f4f6f8;
  --c-surface: #ffffff;
  --c-text: #1a2330;
  --c-muted: #5b6675;
  --c-line: #e1e7ee;
  --c-primary: #1565c0;        /* kraeftiges Blau (Hauptfarbe) */
  --c-primary-dark: #0d47a1;
  --c-accent: #0a3d62;         /* tiefes Navy fuer Ueberschriften/Marke */
  --c-primary-soft: #eaf2fb;   /* heller Blauton fuer Flaechen */
  --c-warn-bg: #fff4d6;
  --c-warn-border: #e6b800;
  --c-error-bg: #fde8e8;
  --c-error-border: #d64545;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 -4px 18px rgba(0, 0, 0, 0.16);
  --header-h: 60px;
  --panel-w: 384px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-base: 17px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- Kopfzeile --- */
.app-header {
  height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--c-surface);
  box-shadow: var(--shadow);
  z-index: 1500;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.3rem; color: var(--c-accent); text-decoration: none; cursor: pointer; }
.brand:hover { opacity: 0.85; }
.brand-mark { font-size: 1.4rem; }
.header-right { display: flex; align-items: center; gap: 12px; }

.status-pill {
  font-size: 0.82rem; font-weight: 600; padding: 6px 12px;
  border-radius: 999px; background: #eef2f6; color: var(--c-muted);
}
.status-pill.live { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.status-pill.demo { background: var(--c-warn-bg); color: #7a5c00; }

.mode-toggle {
  font: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 9px 16px; min-height: 44px;
  border: 2px solid var(--c-accent); border-radius: 999px;
  background: var(--c-surface); color: var(--c-accent);
  cursor: pointer; white-space: nowrap;
}
.mode-toggle[aria-pressed="true"] { background: var(--c-accent); color: #fff; }

/* --- Hauptbereich: Sidebar + Karte --- */
.app-main { flex: 1 1 auto; display: flex; min-height: 0; }

.panel {
  flex: 0 0 var(--panel-w);
  width: var(--panel-w);
  height: 100%;
  overflow-y: auto;
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
  z-index: 1100;
}

.map-wrap { flex: 1 1 auto; position: relative; min-width: 0; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; background: #dde3e8; }

/* Griff zum Ein-/Ausklappen: auf dem Desktop ohne Funktion -> ausgeblendet. */
.panel-handle { display: none; }

/* --- Panel-Inhalt --- */
.panel-section { padding: 16px; border-bottom: 8px solid var(--c-bg); }
.panel-title { margin: 0 0 12px; font-size: 1.1rem; color: var(--c-accent); }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--c-muted); margin-bottom: 5px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.text-input, select {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 2px solid var(--c-line); border-radius: var(--radius);
  background: #fff; color: var(--c-text);
}
.text-input:focus, select:focus { outline: none; border-color: var(--c-primary); }

input[type="range"] { width: 100%; accent-color: var(--c-primary); height: 28px; }
.range-value { display: flex; align-items: center; gap: 10px; }
.range-value output { font-weight: 700; min-width: 52px; text-align: right; }

.btn {
  font: inherit; font-weight: 700; font-size: 1.02rem;
  width: 100%; min-height: 52px; padding: 14px 18px;
  border: none; border-radius: var(--radius); cursor: pointer;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-primary:disabled { background: #9bb4d6; cursor: progress; }
.btn-secondary {
  background: #fff; color: var(--c-accent);
  border: 2px solid var(--c-accent); min-height: 44px; font-size: 0.95rem;
}

.hint { margin: 8px 0 0; font-size: 0.9rem; color: var(--c-muted); }
.hint.error { color: var(--c-error-border); }

/* --- Filter / Checkbox-Gruppen --- */
.check-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; min-height: 40px;
  border: 2px solid var(--c-line); border-radius: 999px;
  cursor: pointer; user-select: none; font-size: 0.92rem; background: #fff;
}
.chip input { accent-color: var(--c-primary); width: 18px; height: 18px; }
.chip.active { border-color: var(--c-primary); background: var(--c-primary-soft); }
.operator-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.op-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; }
.op-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.15); }

/* --- Pro-Sektionen ein/ausblenden --- */
.pro-sections[hidden] { display: none; }

/* --- Ladestopp-Liste --- */
.plan-summary { background: var(--c-primary-soft); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; font-size: 0.95rem; }
.plan-summary strong { color: var(--c-primary-dark); }
.summary-note { margin-top: 6px; font-size: 0.85rem; color: #7a5c00; }
.stop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.stop-card { border: 1px solid var(--c-line); border-radius: var(--radius); padding: 12px; }
.stop-card h3 { margin: 0 0 6px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.stop-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 0.85rem; flex: 0 0 auto; }
.stop-meta { font-size: 0.9rem; color: var(--c-muted); display: flex; flex-direction: column; gap: 2px; }
.stop-meta strong { color: var(--c-text); }
.stop-dist { color: var(--c-accent); font-weight: 600; margin-bottom: 2px; }
.stop-reason { font-size: 0.88rem; margin-top: 8px; padding: 6px 10px; background: #eef2f6; border-radius: 8px; color: var(--c-accent); }
.stop-addr { color: var(--c-muted); font-size: 0.88rem; }
.field-hint { font-weight: 400; color: var(--c-muted); font-size: 0.82rem; }

/* Navi-Übergabe (Koordinaten/Adresse kopieren) */
.stop-navi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.navi-label { font-size: 0.82rem; font-weight: 600; color: var(--c-muted); }
.copy-btn { border: 1px solid var(--c-line); background: var(--c-primary-soft); color: var(--c-primary-dark);
  border-radius: 8px; padding: 4px 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.copy-btn:hover { background: #dde9f8; }

/* Zwischenstopp-Liste (dynamisch) */
.via-list { display: flex; flex-direction: column; }
/* Mit gesetzten Zwischenstopps: auffälliger gelber Kasten (unübersehbar). */
.via-list.has-vias { gap: 8px; padding: 10px; margin-bottom: 8px;
  border: 1px solid #f0c36d; background: #fff8e8; border-radius: var(--radius); }
.via-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.via-header-label { font-size: 0.82rem; font-weight: 700; color: #8a5a00; }
.via-clear { flex: 0 0 auto; font-size: 0.8rem; font-weight: 600; padding: 5px 10px; cursor: pointer;
  color: #d64545; background: #fff; border: 1px solid #e7b4b4; border-radius: 8px; }
.via-clear:hover { background: #fdeaea; border-color: #d64545; }
.via-list.has-vias .via-field .field-label { font-weight: 700; color: #8a5a00; }
.via-row { display: flex; gap: 6px; align-items: center; }
.via-row .ac-wrap { flex: 1; }
.via-remove { flex: 0 0 auto; width: 40px; height: 44px; border: 1px solid var(--c-line); background: #fff;
  border-radius: 8px; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--c-muted); }
.via-remove:hover { border-color: #d64545; color: #d64545; }
.via-move { flex: 0 0 auto; width: 34px; height: 44px; border: 1px solid var(--c-line); background: #fff;
  border-radius: 8px; font-size: 1.05rem; line-height: 1; cursor: pointer; color: var(--c-muted); }
.via-move:hover { border-color: var(--c-primary); color: var(--c-primary-dark); }
.via-move:disabled { opacity: 0.3; cursor: default; }

/* Live-Standort-Button auf der Karte */
.lr-locate-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--c-line);
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: #1a73e8; display: flex; align-items: center; justify-content: center;
  margin: 0 10px 16px 0; padding: 0; }
.lr-locate-btn:hover { background: #f2f7ff; }
.lr-locate-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }

/* Notknopf „Jetzt laden" + Ergebnisliste */
.now-section { padding-bottom: 10px; }
.btn-now { width: 100%; font-size: 1.25rem; font-weight: 700; padding: 16px; border: none;
  border-radius: var(--radius); cursor: pointer; color: #fff; background: #e8731c;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.btn-now:hover { background: #d6660f; }
.btn-now:active { transform: scale(0.99); }
.btn-now:disabled { opacity: 0.7; cursor: default; }
.now-result { margin-top: 12px; }
.now-soc { margin-bottom: 8px; }
.now-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--c-line); }
.now-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.now-op { font-weight: 700; }
.now-meta { font-size: 0.85rem; color: var(--c-muted); }
.now-reach.ok { color: #1c7a3c; font-weight: 600; }
.now-reach.no { color: #d64545; font-weight: 600; }
.now-go { flex: 0 0 auto; padding: 8px 12px; }
.btn-copilot { width: 100%; margin-top: 10px; font-weight: 600; }
.btn-copilot.active { background: #1c7a3c; color: #fff; border-color: #1c7a3c; }

/* Co-Pilot-Modus: größeres, kontrastreiches Layout fürs Tablet im Auto */
body.copilot .panel { font-size: 1.06rem; }
body.copilot .btn, body.copilot .text-input, body.copilot select, body.copilot .field-label { font-size: 1.06rem; }
body.copilot .btn-now { font-size: 1.5rem; padding: 22px; }
body.copilot .now-row { padding: 14px 0; }
body.copilot .now-op { font-size: 1.12rem; }
body.copilot .lr-locate-btn { width: 56px; height: 56px; font-size: 1.8rem; }

/* Live-Begleitung: Reroute-Dialog (groß, beifahrertauglich) */
.codrv-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.codrv-card { background: #fff; border-radius: var(--radius); padding: 20px; width: 100%;
  max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.codrv-card h3 { margin: 0 0 4px; font-size: 1.3rem; }
.codrv-card .field-label { display: block; margin: 14px 0 4px; font-weight: 600; }
.codrv-card .text-input { width: 100%; }
.codrv-row2 { display: flex; gap: 8px; }
.codrv-row2 .btn { flex: 1; }
.codrv-row2 .btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.codrv-actions { display: flex; gap: 8px; margin-top: 18px; }
.codrv-actions .btn { flex: 1; font-size: 1.1rem; padding: 14px; }

/* Kleine Schnell-Buttons rechts oben im Header */
.header-right { display: flex; gap: 8px; align-items: center; }
.hdr-btn { font-size: 0.82rem; font-weight: 600; padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--c-line); background: #fff; cursor: pointer; color: var(--c-text); white-space: nowrap; }
.hdr-btn:hover { background: #f2f7ff; }
.hdr-btn.active { background: #1c7a3c; color: #fff; border-color: #1c7a3c; }
.hdr-now { background: #e8731c; color: #fff; border-color: #e8731c; }
.hdr-now:hover { background: #d6660f; }

/* Ganz unten zentriert: „Mehr Optionen" + OCM-Status */
.panel-foot { display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--c-line); }
.panel-foot #status-pill { display: block; }
.add-via { width: 100%; margin-bottom: 14px; padding: 9px 12px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; color: var(--c-primary-dark); background: var(--c-primary-soft);
  border: 1px dashed var(--c-primary); border-radius: var(--radius); }
.add-via:hover { background: #dde9f8; }

/* Routen-Werkzeuge + Alternativen */
.route-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.route-tools .btn { width: auto; flex: 1 1 140px; min-height: 40px; font-size: 0.88rem; }
.route-tools .btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.route-alternatives { margin-top: 10px; }
.alt-route-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--c-line); font-size: 0.9rem; }
.alt-route-row .btn { width: auto; min-height: 36px; padding: 6px 12px; font-size: 0.85rem; flex: 0 0 auto; }

/* Zuhause-Schnellzugriff unter dem Startfeld */
.home-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.home-btn { background: var(--c-primary-soft); border: 1px solid var(--c-line); color: var(--c-primary-dark);
  border-radius: 8px; padding: 4px 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.home-btn:hover { background: #dde9f8; }
.home-btn.link { background: none; border: none; color: var(--c-muted); text-decoration: underline; padding: 4px 2px; font-weight: 500; }
.home-btn.link:hover { color: var(--c-primary-dark); background: none; }

/* Favoriten-Stern */
.fav-btn { background: none; border: none; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 4px; color: #c9a200; }
.fav-btn.on { color: #f5b301; }
.popup-fav { margin-top: 8px; width: 100%; border: 1px solid var(--c-line); background: var(--c-primary-soft);
  color: var(--c-primary-dark); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.popup-fav.on { background: #fff5d6; border-color: #f5b301; color: #8a6d00; }
.popup-correct { margin-top: 6px; width: 100%; border: 1px solid var(--c-line); background: #fff;
  color: var(--c-muted); border-radius: 8px; padding: 5px 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.popup-correct:hover { border-color: var(--c-primary); color: var(--c-primary-dark); background: var(--c-primary-soft); }
.popup-hide { margin-top: 6px; width: 100%; border: 1px solid var(--c-line); background: #fff;
  color: #b23; border-radius: 8px; padding: 5px 10px; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.popup-hide:hover { border-color: #d64545; background: #fde8e8; }

/* Nummerierter Lade-Stopp mit Betreiber-Schriftzug */
.lr-stop { background: transparent; border: none; }
.lr-stop-circle { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.lr-stop-name { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #fff; border: 1.5px solid; border-radius: 6px; padding: 0 5px; font-size: 11px; font-weight: 700;
  line-height: 1.5; box-shadow: 0 1px 3px rgba(0,0,0,.3); pointer-events: none; }

/* Adress-Autocomplete */
.ac-wrap { position: relative; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 1200; margin: 2px 0 0; padding: 0;
  list-style: none; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 260px; overflow-y: auto; }
.ac-item { padding: 9px 12px; font-size: 0.9rem; cursor: pointer; border-bottom: 1px solid var(--c-line); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.stop-actions { display: flex; gap: 8px; margin-top: 10px; }
.stop-actions .btn { width: auto; flex: 1; min-height: 42px; font-size: 0.9rem; }
.alt-wrap { margin-top: 10px; }
.alt-wrap summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--c-accent); }
.alt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 0.88rem; border-bottom: 1px solid var(--c-line); }
.alt-row .btn { width: auto; min-height: 38px; padding: 6px 12px; font-size: 0.85rem; flex: 0 0 auto; }
.export-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.export-bar .btn { width: auto; flex: 1 1 120px; }
.qr-box { flex-basis: 100%; text-align: center; margin-top: 8px; }
.qr-box img { image-rendering: pixelated; max-width: 220px; }

/* --- Tempo-Vergleich --- */
.speed-compare { margin-top: 10px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cmp-table th, .cmp-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--c-line); }
.cmp-table th { color: var(--c-muted); font-weight: 600; }

/* --- Fahrzeug-Editor / Ladekurve --- */
.vehicle-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vehicle-actions .btn { width: auto; flex: 1 1 100px; }
.curve-editor { margin-bottom: 14px; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 8px 12px; }
.curve-editor summary { cursor: pointer; font-weight: 600; color: var(--c-accent); }
.curve-table { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.curve-row { display: flex; align-items: flex-end; gap: 8px; }
.curve-cell { display: flex; flex-direction: column; flex: 1; }
.curve-cell small { font-size: 0.72rem; color: var(--c-muted); }
.curve-input { width: 100%; font: inherit; padding: 8px; border: 2px solid var(--c-line); border-radius: 8px; }
.curve-del { flex: 0 0 auto; width: 40px; height: 40px; border: 2px solid var(--c-line); background: #fff; border-radius: 8px; cursor: pointer; color: var(--c-muted); }
.curve-del:hover { border-color: var(--c-error-border); color: var(--c-error-border); }

/* --- Betreiber-Praeferenz --- */
.pref-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pref-rank { font-weight: 700; color: var(--c-accent); width: 22px; flex: 0 0 auto; }
.pref-row select { flex: 1; min-width: 0; }
.pref-btn { flex: 0 0 auto; width: 38px; height: 44px; border: 2px solid var(--c-line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.pref-btn:disabled { opacity: 0.35; cursor: default; }

/* --- Betreiber-Präferenz je Land --- */
.country-block { border: 1px solid var(--c-line); border-radius: var(--radius); padding: 10px; margin-bottom: 12px; background: #fafcff; }
.country-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.country-name { font-weight: 700; color: var(--c-primary-dark); }
.country-remove { flex: 0 0 auto; font-size: 0.8rem; font-weight: 600; padding: 5px 10px; cursor: pointer;
  color: #d64545; background: #fff; border: 1px solid #e7b4b4; border-radius: 8px; }
.country-remove:hover { background: #fdeaea; border-color: #d64545; }
.country-add { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.country-add select { flex: 1; min-width: 0; }
.country-add .btn { flex: 0 0 auto; }

/* --- Tarif-Editor --- */
.tariff-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tariff-name { flex: 1; font-size: 0.95rem; }
.tariff-input { width: 92px; flex: 0 0 auto; font: inherit; padding: 8px; border: 2px solid var(--c-line); border-radius: 8px; text-align: right; }
.tariff-unit { color: var(--c-muted); font-size: 0.85rem; width: 52px; flex: 0 0 auto; }

/* --- Hinweis-Banner (ueber der Karte) --- */
.banner {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  z-index: 1200; max-width: min(92%, 560px);
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--c-warn-bg); border: 1px solid var(--c-warn-border);
  box-shadow: var(--shadow); font-size: 0.92rem; text-align: center;
}
.banner.error { background: var(--c-error-bg); border-color: var(--c-error-border); }

/* --- Marker-Popups --- */
.popup-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; }
.popup-op {
  display: inline-block; font-size: 0.82rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: #eef2f6;
  color: var(--c-accent); margin-bottom: 6px;
}
.popup-row { margin: 3px 0; font-size: 0.92rem; }
.popup-row .label { color: var(--c-muted); }
.popup-power { font-weight: 700; color: var(--c-primary-dark); }
.popup-comments { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--c-line); font-size: 0.85rem; color: var(--c-muted); }

/* ============================================================
   Mobil: Panel als Bottom-Sheet
   ============================================================ */
@media (max-width: 768px) {
  :root { --fs-base: 18px; }

  /* Kompakte Kopfzeile: kein Umbruch, nichts abgeschnitten */
  .app-header { padding: 0 10px; gap: 6px; }
  .brand { font-size: 1.1rem; gap: 5px; }
  .header-right { gap: 6px; }
  .status-pill {
    font-size: 0.7rem; padding: 5px 9px; max-width: 116px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mode-toggle { padding: 8px 11px; font-size: 0.8rem; }

  .app-main { display: block; position: relative; }
  .map-wrap { position: absolute; inset: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    width: auto; flex: none; height: auto; max-height: 64vh;
    border-right: none; border-top: 1px solid var(--c-line);
    border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
    transition: transform 0.25s ease;
  }
  /* Echter Griff (tippbar) ersetzt den rein optischen ::before-Balken. */
  .panel::before { display: none; }
  .panel-handle {
    display: block; position: sticky; top: 0; z-index: 2;
    width: 100%; height: 28px; border: none; padding: 0; margin: 0;
    background: var(--c-surface); border-radius: 16px 16px 0 0;
    cursor: pointer; touch-action: manipulation;
  }
  .panel-handle::before {
    content: ""; position: absolute; left: 50%; top: 9px;
    transform: translateX(-50%);
    width: 42px; height: 5px; background: #cdd5de; border-radius: 999px;
  }
  /* Eingeklappt: Panel fährt nach unten, nur der Griff bleibt sichtbar. */
  .panel.collapsed { transform: translateY(calc(100% - 28px)); }
  .mode-toggle { padding: 9px 12px; font-size: 0.88rem; }
  .leaflet-popup-content { font-size: 1rem; }
}
