:root {
  --gelb: #f5c400;
  --kontur: #1f2933;
  --gruen: #16a34a;
  --rot: #dc2626;
  --blau-piste: #1d4ed8;
  --rot-piste: #dc2626;
  --schwarz-piste: #111827;
  --route: #d946ef;
  --stopp: #ea580c;
  --flaeche: #ffffff;
  --text: #1f2933;
  --text-leise: #64748b;
  --linie: #e2e8f0;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  --sicher-oben: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #0f172a;
  overscroll-behavior: none;
}
#karte { position: fixed; inset: 0; background: #dfe7ee; }

/* Grundkarte „Winter“: OpenTopoMap entfärbt, aufgehellt und leicht eisblau – farbige Pisten heben sich ab */
.winter-karte { filter: grayscale(1) brightness(1.18) contrast(.9) sepia(.15) hue-rotate(170deg); }

/* ---------------------------------------------------------------- Kartenelemente */

.lift-marke, .piste-marke, .huette-marke { background: none; border: 0; }

/* Icon sitzt mittig auf der Liftlinie, Ampel-Kreis links, Name rechts daneben */
.lift-marke .inhalt { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; white-space: nowrap; }
.lift-marke img { width: 30px; height: 30px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); cursor: pointer; }
.lift-marke .kreis { position: absolute; right: calc(100% + 2px); top: 4px; }
.lift-marke .label {
  position: absolute; left: calc(100% + 3px); top: 6px; pointer-events: none;
  font-size: 11px; font-weight: 700; color: var(--kontur);
  background: rgba(255,255,255,.88); border-radius: 4px; padding: 1px 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
#karte.z-lt13 .lift-marke .kreis { right: auto; left: 7px; top: 7px; }

/* Ampel-Kreis mit Nummer */
.kreis {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px;
  font-size: 11px; font-weight: 800; color: #fff; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(31,41,51,.45), 0 1px 3px rgba(0,0,0,.35);
  cursor: pointer; pointer-events: auto;
}
.kreis.open { background: var(--gruen); }
.kreis.closed { background: var(--rot); }
.piste-marke .kreis { position: absolute; transform: translate(-50%, -50%); min-width: 20px; height: 20px; font-size: 10px; border-width: 1.5px; }

.huette-punkt {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: #8a4b1f; color: #fff; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(31,41,51,.45), 0 1px 3px rgba(0,0,0,.35);
}
.huette-punkt.schutz { background: #5b6b2e; }
.huette-punkt svg { width: 13px; height: 13px; }
.huette-marke .huette-punkt { position: absolute; transform: translate(-50%, -50%); cursor: pointer; }

/* Zoomabhängige Sichtbarkeit: Klassen setzt map.js am Kartencontainer */
#karte.z-lt13 .lift-marke img, #karte.z-lt14 .lift-marke .label,
#karte.z-lt15 .piste-marke, #karte.z-lt16 .piste-marke.neben, #karte.z-lt15 .huette-marke, #karte.z-lt12 .lift-marke { display: none; }
#karte.z-lt13 .lift-marke .kreis { min-width: 16px; height: 16px; font-size: 0; padding: 0; }

/* ---------------------------------------------------------------- Pop-up */

.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 14px 16px 12px; min-width: 210px; font-size: 14px; }
/* Pop-up passt neben die linke Knopfleiste (56 px) mit 10 px Rand rechts, auch auf dem iPhone SE */
.leaflet-popup-content { max-width: calc(100vw - 98px); }
.popup-offen .leaflet-control-scale { visibility: hidden; }  /* Maßstab ist breiter als die Knöpfe und läge über dem Pop-up */
.info h3 { margin: 0 0 2px; font-size: 18px; line-height: 1.2; }
.info .unterzeile { color: var(--text-leise); font-size: 13px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.info dl > div { display: contents; }
.info dt { color: var(--text-leise); }
.info dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.info .differenz dd, .info .differenz dt { font-weight: 800; color: var(--text); }
.info .wichtig dt, .info .wichtig dd { font-weight: 700; color: var(--text); }
.info .sektion { background: #f1f5f9; border-radius: 10px; padding: 7px 9px; margin: 0 0 8px; font-size: 13px; }
.info .sektion-hinweis { color: #b45309; margin-top: 3px; }
.info .sektion-knoepfe { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.info .sektion-knoepfe button { flex: 1; font-size: 12px; min-height: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info [hidden] { display: none !important; }
.info .nav-zeile { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.info .nav-zeile + .nav-zeile { margin-top: 6px; }
.info .nav-titel { flex: 0 0 36px; font-size: 12px; font-weight: 700; color: var(--text-leise); }
.info .nav-zeile button { flex: 1; padding: 6px 4px; white-space: nowrap; }
.info .nav-zeile .umschalter { flex: 0 0 40px; font-size: 18px; }
.stufe { display: inline-block; padding: 1px 7px; border-radius: 10px; color: #fff; font-size: 12px; font-weight: 700; }
.stufe.Blau { background: var(--blau-piste); }
.stufe.Rot { background: var(--rot-piste); }
.stufe.Schwarz { background: var(--schwarz-piste); }
/* Pistennummer legendärer Pisten: goldenes Abzeichen neben dem Namen */
.pisten-nr { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: 12px; font-weight: 800;
  color: #6e4300; background: linear-gradient(100deg, #fde68a, #f5c84b 45%, #fff4c2 60%, #e0a412); border: 1px solid #b45309; }
.pisten-nr.leer { font-weight: 600; color: #92400e; background: #fffbeb; }
/* Kasten „Legendary 8“ im Pisten-Pop-up */
.info.punkt-info dl { margin-bottom: 8px; }
.info .naehe { display: flex; flex-direction: column; gap: 5px; }
.info .naehe-zeile {
  display: grid; row-gap: 2px; grid-template-columns: 1fr auto; grid-template-areas: "titel hin" "name hin" "zusatz hin";
  text-align: left; padding: 6px 9px; border-radius: 10px; font-size: 13px; line-height: 1.3; width: 100%;
}
.info .naehe-titel { grid-area: titel; font-size: 11px; font-weight: 700; color: var(--text-leise); text-transform: uppercase; letter-spacing: .03em; }
.info .naehe-name { grid-area: name; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.info .naehe-name .kreis { min-width: 18px; height: 18px; font-size: 10px; }
.info .naehe-zusatz { grid-area: zusatz; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.info .naehe-zeile .hin { grid-area: hin; align-self: center; font-size: 20px; color: var(--text-leise); padding-left: 6px; }

/* Angetippte freie Stelle der Karte */
.tipp-marke span {
  position: absolute; transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%;
  background: var(--kontur); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.info .legende { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 7px 9px; margin: 0 0 8px; font-size: 13px; }
.info .legende-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.info .legende-kopf i { color: #92400e; }
.info .legende-daten { margin-top: 4px; font-weight: 700; }
.info .legende-weg { margin-top: 2px; color: var(--text-leise); font-size: 12px; }
.status-text.open { color: var(--gruen); font-weight: 700; }
.status-text.closed { color: var(--rot); font-weight: 700; }

/* Legendäre Pisten: edle Goldschrift mit Verlauf und leichtem Glanz */
.legendaer {
  background: linear-gradient(100deg, #6e4300 0%, #c98f00 20%, #f7d774 36%, #b07800 52%, #6e4300 70%, #d9a514 88%, #6e4300 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 3px rgba(245, 196, 0, .7));
  animation: goldglanz 6s linear infinite;
}
@keyframes goldglanz { to { background-position: 200% center; } }
@media (prefers-reduced-motion: reduce) { .legendaer { animation: none; } }

/* ---------------------------------------------------------------- Bedienelemente */

button {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 10px;
  padding: 8px 10px; cursor: pointer; min-height: 38px;
}
button:active { background: #e2e8f0; }
button.haupt { background: var(--kontur); color: #fff; border-color: var(--kontur); }
button.klein { min-height: 32px; padding: 4px 8px; display: inline-flex; align-items: center; justify-content: center; }
button.klein svg { width: 18px; height: 18px; }
button.mit-text { gap: 5px; font-size: 13px; white-space: nowrap; }

/* Ortsnamen und Pässe */
.ort-marke { background: none; border: 0; }
.ort-marke .ort-text {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap; text-align: center; line-height: 1.1;
  color: #0f172a; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff, 0 0 1px #fff;
}
.ort-marke b { display: block; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.ort-marke .ort-alt { display: block; font-size: 10px; font-style: italic; font-weight: 600; color: #334155; }
.ort-marke.weiler b { font-size: 11px; font-weight: 700; }
.ort-marke.pass b { font-size: 11px; font-weight: 700; font-style: italic; color: #374151; }
.ort-marke.gipfel b { font-size: 11px; font-weight: 700; color: #3f2a14; }
.ort-marke.gipfel .gipfel-dreieck { font-style: normal; color: #7c4a1e; }
#karte.z-lt13 .ort-marke.pass, #karte.z-lt14 .ort-marke.weiler, #karte.z-lt13 .ort-alt { display: none; }
#karte.z-lt14 .ort-marke.gipfel, #karte.z-lt15 .ort-marke.gipfel .ort-alt { display: none; }

.hinweis {
  position: fixed; top: calc(10px + var(--sicher-oben)); left: 50%; transform: translateX(-50%);
  z-index: 1000; max-width: calc(100% - 32px);
  background: var(--kontur); color: #fff; padding: 8px 14px; border-radius: 20px;
  font-size: 14px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* „Du bist offline“: oben, kurz aufblinkend, dann dezent */
.offline-banner {
  position: fixed; top: calc(8px + var(--sicher-oben)); left: 50%; transform: translateX(-50%);
  z-index: 1100; background: #b91c1c; color: #fff; font-weight: 700; font-size: 15px;
  padding: 8px 18px; border-radius: 20px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.offline-banner.blinkt { animation: aufblinken 0.5s ease-in-out 3; }
@keyframes aufblinken { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .offline-banner.blinkt { animation: none; } }

.extras { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linie); }
.extras button { width: 100%; }
.status-zeile { margin: 6px 0; font-size: 12px; color: var(--text-leise); }

.panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: var(--flaeche); border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 16px rgba(0,0,0,.18);
  padding-bottom: var(--sicher-unten);
  max-height: 48vh; display: flex; flex-direction: column;
}
.panel-griff {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; border: 0; background: none; border-radius: 16px 16px 0 0; padding: 8px 16px 10px;
}
.griff-strich { width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; }
.panel-inhalt { display: none; overflow-y: auto; overflow-x: hidden; padding: 0 16px 14px; }
.panel.offen .panel-inhalt { display: block; }

.punkte { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 8px; }
.punkt { display: flex; align-items: center; gap: 8px; }
.punkt-marke {
  flex: 0 0 24px; height: 24px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.punkt-marke.start { background: var(--gruen); }
.punkt-marke.ziel { background: var(--route); }
.punkt-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punkt button { flex: 0 0 auto; }
.punkt-name.leer { color: var(--text-leise); font-weight: 400; }
.stopps { display: contents; }
.punkt-marke.stopp { background: var(--stopp); }
button.papierkorb { color: #b91c1c; }
button.papierkorb svg { width: 18px; height: 18px; }

.filter { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter legend { float: left; margin-right: 2px; }
.filter label { border: 1px solid #cbd5e1; border-radius: 16px; padding: 2px 10px 2px 6px; background: #f8fafc; }
.filter label:has(input:checked) { background: #fee2e2; border-color: #fca5a5; }
.filter legend { font-size: 12px; color: var(--text-leise); padding: 0 4px; }
.filter label { display: flex; align-items: center; gap: 5px; font-size: 13px; min-height: 30px; }

.filter.touren .tour::before { content: ""; width: 14px; height: 6px; border-radius: 3px; order: 2; }
.filter.touren .tour.orange::before { background: #ff7700; }
.filter.touren .tour.gruen::before { background: #00a000; }
.filter.touren .tour.orange:has(input:checked) { background: #ffedd5; border-color: #fdba74; }
.filter.touren .tour.gruen:has(input:checked) { background: #dcfce7; border-color: #86efac; }

.runde-wahl { margin-top: -4px; }
.runde-wahl .runde-titel { font-size: 12px; color: var(--text-leise); margin-right: 2px; }
.runde-wahl label:has(input:checked) { background: #e0e7ff; border-color: #a5b4fc; }
.runde-wahl .tour.orange:has(input:checked) { background: #ffedd5; border-color: #fdba74; }
.runde-wahl .tour.gruen:has(input:checked) { background: #dcfce7; border-color: #86efac; }
.runde-wahl #ganze-runde { font-size: 13px; }
.ergebnis .zusammenfassung .tour-label { flex-basis: 100%; font-size: 13px; color: #9a3412; white-space: normal; }
.zusammenfassung .tour-label.gruen { color: #166534; }

/* GPS-Knopf (Leaflet-Steuerelement) */
.gps-knopf { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; cursor: pointer; color: var(--kontur); border: 0; padding: 0; min-height: 0; }
.gps-knopf svg { width: 20px; height: 20px; }
.gps-knopf.an { color: #2563eb; }
.gps-knopf.folgt { background: #2563eb; color: #fff; }

/* Ebenen-Schalter oben links (unter dem GPS-Knopf), klappt nach rechts auf */
.leaflet-control.ebenen-steuerung { position: relative; z-index: 810; }  /* Liste über dem Maßstab */
.ebenen-knopf { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; cursor: pointer; color: var(--kontur); border: 0; padding: 0; min-height: 0; }
.ebenen-knopf svg { width: 20px; height: 20px; }
.ebenen-knopf.an { background: var(--kontur); color: #fff; }
.ebenen-liste {
  position: absolute; left: calc(100% + 8px); top: 0; background: #fff; border-radius: 12px; padding: 8px 12px 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: nowrap; font-size: 14px; min-width: 180px;
}
.ebenen-liste[hidden] { display: none; }
.ebenen-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.ebenen-kopf b { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-leise); }
.ebenen-zu { width: 32px; height: 32px; min-height: 0; margin-right: -6px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--kontur); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ebenen-zu:hover { background: #eef1f4; }
.ebenen-zu svg { width: 18px; height: 18px; }
.ebenen-liste label { display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; }
.ebenen-liste input { width: 20px; height: 20px; margin: 0; accent-color: var(--kontur); }
.ebene-symbol { width: 22px; text-align: center; font-size: 15px; line-height: 1; }
.ebene-symbol .huette-punkt { width: 20px; height: 20px; vertical-align: middle; }
.ebene-symbol .huette-punkt svg { width: 12px; height: 12px; }
.ebene-linie { display: inline-block; width: 20px; height: 5px; border-radius: 3px; vertical-align: middle; }
.ebene-linie.pisten { background: linear-gradient(90deg, var(--blau-piste) 33%, var(--rot-piste) 33% 66%, var(--schwarz-piste) 66%); }
.ebene-linie.lifte { background: var(--gelb); box-shadow: 0 0 0 1.5px var(--kontur); }
.ebene-gipfel { color: #7c4a1d; }

.gps-punkt { background: none; border: 0; }
.gps-punkt span {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: #2563eb; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
.gps-punkt span::after {  /* pulsierender Ring, damit der Punkt auf jeder Karte sofort auffällt */
  content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid rgba(37,99,235,.6);
  animation: gpspuls 2s ease-out infinite;
}
@keyframes gpspuls { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .gps-punkt span::after { animation: none; opacity: .5; } }

/* Navigationsleiste oben */
.navi {
  position: fixed; top: calc(8px + var(--sicher-oben)); left: 56px; right: 56px; z-index: 1000;
  background: var(--kontur); color: #fff; border-radius: 14px; padding: 8px 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35); font-size: 14px;
}
.navi > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.navi .navi-jetzt { font-weight: 800; font-size: 16px; }
.navi .navi-danach { color: #cbd5e1; margin-top: 2px; }
.navi .navi-titel { flex: 0 0 52px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; font-weight: 700; }
.navi span:not(.navi-titel):not(.navi-rest) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navi .navi-rest { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.navi img { width: 20px; height: 20px; vertical-align: -4px; }
.navi .stufe { width: 12px; height: 12px; padding: 0; border-radius: 6px; vertical-align: -1px; }

.ergebnis .zusammenfassung { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; margin-bottom: 8px; }
.ergebnis .zusammenfassung span { white-space: nowrap; }
.ergebnis ol { list-style: none; margin: 0; padding: 0; }
.ergebnis li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--linie); font-size: 14px; }
.ergebnis li .symbol { flex: 0 0 22px; text-align: center; }
.ergebnis li .text { flex: 1; min-width: 0; }
.ergebnis li .zeit { color: var(--text-leise); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ergebnis li[data-schritt] { cursor: pointer; border-radius: 8px; }
.ergebnis li[data-schritt]:active, .ergebnis li[data-schritt]:hover { background: #f1f5f9; }
.ergebnis li[data-schritt]:focus-visible { outline: 2px solid var(--route); outline-offset: -2px; }
.ergebnis li .hin { color: #94a3b8; font-size: 18px; line-height: 1; padding-left: 2px; }
.ergebnis li.aktiv { background: #fdf4ff; box-shadow: inset 3px 0 0 var(--route); }
/* Smartphone: angetippter Routenschritt → Panel bleibt offen, aber niedriger, darüber das Info-Pop-up */
@media (max-width: 759px) { body.schritt-ansicht .panel { max-height: 30vh; } }

/* Richtungspfeile auf Pisten und Liften */
.pfeil-marke { background: none; border: 0; }
.pfeil { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; overflow: visible; }
.pfeil path { stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; paint-order: stroke; }
.pfeil.lift { left: -8px; top: -8px; width: 16px; height: 16px; }
.pfeil.lift path { stroke: var(--gelb); stroke-width: 2; }

/* Hervorgehobener Routenabschnitt (nach Antippen in der Schrittliste) */
.markierung { animation: markieren 0.8s ease-in-out 3; }
@keyframes markieren { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .markierung { animation: none; } }
.ergebnis .fehler { color: var(--rot); font-weight: 600; }

.start-ziel-marke span {
  position: absolute; transform: translate(-50%, -100%);
  width: 26px; height: 26px; border-radius: 13px 13px 13px 0; rotate: -45deg;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.start-ziel-marke.start span { background: var(--gruen); }
.start-ziel-marke.ziel span { background: var(--route); }

/* Zwischenstopps: nummerierte Marke auf der Karte, Pop-up mit Papierkorb oben rechts */
.stopp-marke span {
  position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
  background: var(--stopp); color: #fff; font-weight: 800; font-size: 13px;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
.info.stopp-info { padding-right: 34px; }
.info.stopp-info h3 { font-size: 16px; }
.info .papierkorb {
  position: absolute; top: 6px; right: 26px; width: 32px; height: 32px; min-height: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none;
}
.info .papierkorb:hover, .info .papierkorb:active { background: #fee2e2; }
.info .papierkorb svg { width: 19px; height: 19px; }
.ergebnis .stopp-zeile { font-weight: 700; color: var(--stopp); cursor: default; }
.ergebnis .stopp-zeile .punkt-marke { flex-basis: 20px; width: 20px; height: 20px; font-size: 11px; color: #fff; }
.zusammenfassung .tour-label.stopp { color: var(--stopp); }

.leaflet-control-layers { border-radius: 10px !important; }
.kartenwahl-offen .suche-knopf, .kartenwahl-offen .sprach-knopf, .kartenwahl-offen .gebiete-knopf { display: none; }

/* ---------------------------------------------------------------- Reiter „Skigebiete Status“ */

.gebiete-knopf {
  position: fixed; z-index: 950; right: 10px; top: calc(72px + var(--sicher-oben));
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 6px 11px 6px 9px;
  font-size: 13px; font-weight: 700; background: #fff; border: 0; border-radius: 18px;
  box-shadow: 0 1px 5px rgba(0,0,0,.35);
}
.popup-offen .gebiete-knopf { display: none; }
.punkt-mini { width: 9px; height: 9px; border-radius: 50%; }
.punkt-mini + .punkt-mini { margin-left: -2px; margin-right: 2px; }
.punkt-mini.open, .ampel.open { background: var(--gruen); }
.punkt-mini.closed, .ampel.closed { background: var(--rot); }

.gebiete {
  position: fixed; z-index: 1050; top: 0; right: 0; bottom: 0; width: min(380px, 90vw);
  background: var(--flaeche); box-shadow: -6px 0 18px rgba(0,0,0,.25);
  padding: calc(10px + var(--sicher-oben)) 14px calc(12px + var(--sicher-unten));
  overflow-y: auto; overscroll-behavior: contain;
  animation: einschieben .2s ease-out;
}
.gebiete[hidden] { display: none; }
@keyframes einschieben { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .gebiete { animation: none; } }
.gebiete-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gebiete-kopf h2 { margin: 0; font-size: 19px; }
.gebiete-pause { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px; padding: 8px 10px; margin: 6px 0 10px; font-size: 13px; }
.gebiete-pause p { margin: 0 0 6px; }
.gebiete-pause label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.gebiete-liste details { border-top: 1px solid var(--linie); }
.gebiete-liste details:last-child { border-bottom: 1px solid var(--linie); }
.gebiete-liste summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px;
  padding: 11px 2px; cursor: pointer; list-style: none;
}
.gebiete-liste summary::-webkit-details-marker { display: none; }
.gebiete-liste summary::before { content: "›"; font-size: 20px; line-height: 1; color: #94a3b8; transition: transform .15s; }
.gebiete-liste details[open] summary::before { transform: rotate(90deg); }
.gebiete-liste .tg-name { flex: 1; font-weight: 800; font-size: 15px; }
.gebiete-liste .tg-zahlen { font-size: 12px; color: var(--text-leise); display: flex; gap: 6px; align-items: center; }
.gebiete-liste .zaehler { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.gebiete-liste .zaehler .ampel { flex: 0 0 8px; width: 8px; height: 8px; }
.gebiete-liste h3 { margin: 4px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-leise); }
.gebiete-liste ul { list-style: none; margin: 0 0 8px; padding: 0; }
.gebiete-liste .eintrag {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  min-height: 34px; padding: 4px 4px; border: 0; border-radius: 8px; background: none; font-weight: 500;
}
.gebiete-liste .eintrag:active, .gebiete-liste .eintrag:hover { background: #f1f5f9; }
.gebiete-liste .ampel { flex: 0 0 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(31,41,51,.2); }
.gebiete-liste .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gebiete-liste .eintrag small { color: var(--text-leise); font-size: 11px; white-space: nowrap; }
.gebiete-liste .eintrag small.teilweise { color: var(--rot); font-weight: 700; }
.gebiete-liste .eintrag .stufe { flex: 0 0 12px; width: 12px; height: 12px; padding: 0; border-radius: 3px; }
.gebiete .quelle { margin-top: 12px; }

/* ---------------------------------------------------------------- Suche */

.suche-knopf {
  position: fixed; z-index: 950; top: calc(10px + var(--sicher-oben)); left: 56px; right: 66px;
  display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 6px 14px;
  font-size: 14px; font-weight: 600; color: var(--text-leise); text-align: left;
  background: #fff; border: 0; border-radius: 20px; box-shadow: 0 1px 5px rgba(0,0,0,.35);
}
.suche-knopf svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--kontur); }
.suche-knopf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navi:not([hidden]) ~ .suche-knopf { display: none; }
/* Während der Navigation: Mikrofon rechts unter „Skigebiete Status“ – neues Ziel ansagen, ohne anzuhalten */
.navi:not([hidden]) ~ .sprach-knopf {
  top: calc(118px + var(--sicher-oben)); right: 10px; width: 42px; height: 42px;
  background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35);
}
.navi:not([hidden]) ~ .sprach-knopf.an { background: var(--rot); }
.popup-offen .navi:not([hidden]) ~ .sprach-knopf { display: none; }
.suche-knopf { padding-right: 46px; }  /* Platz für das Mikrofon rechts im Suchfeld */

/* Mikrofon rechts im Suchfeld (eigener Knopf über dem Suchfeld-Knopf) */
.sprach-knopf {
  position: fixed; z-index: 951; top: calc(12px + var(--sicher-oben)); right: 70px;
  width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #eef2f7; color: var(--kontur); cursor: pointer;
}
.sprach-knopf svg { width: 20px; height: 20px; }
.sprach-knopf.an { background: var(--rot); color: #fff; }
.sprache {
  position: fixed; z-index: 1090; top: calc(58px + var(--sicher-oben)); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
  background: var(--flaeche); border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.3); font-weight: 600;
}
.sprache[hidden] { display: none; }
.sprache-text { flex: 1; min-width: 0; }
.sprache-welle { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--rot); }
.sprache.hoert .sprache-welle { animation: sprache-puls 1s ease-in-out infinite; }
@keyframes sprache-puls { 50% { transform: scale(1.5); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .sprache.hoert .sprache-welle { animation: none; } }
.s-symbol.befehl { background: var(--kontur); color: #fff; font-size: 11px; }
.s-befehl .s-name { white-space: normal; }

.suche { position: fixed; inset: 0; z-index: 1080; background: rgba(15,23,42,.35); }
.suche[hidden] { display: none; }
.suche-fenster {
  position: absolute; top: 0; left: 0; right: 0; max-height: 100%; display: flex; flex-direction: column;
  background: var(--flaeche); box-shadow: 0 6px 18px rgba(0,0,0,.3);
  padding: calc(10px + var(--sicher-oben)) 12px 8px; border-radius: 0 0 16px 16px;
}
.suche-kopf { display: flex; gap: 8px; align-items: center; }
.suche-kopf input {
  flex: 1; min-width: 0; min-height: 42px; padding: 8px 12px; font-size: 16px;  /* 16 px: iPhone zoomt sonst hinein */
  border: 2px solid var(--kontur); border-radius: 12px; background: #fff; color: var(--text);
}
.suche-kopf .klein { min-height: 42px; min-width: 42px; }
.suche .status-zeile { margin: 6px 2px 4px; }
.suche-liste { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; max-height: 70vh; }
.s-eintrag {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  min-height: 46px; padding: 5px 6px; border: 0; border-radius: 10px; background: none; font-weight: 500;
}
.suche-liste li[aria-selected="true"] .s-eintrag, .s-eintrag:hover, .s-eintrag:active { background: #f1f5f9; }
.s-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.s-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-text small { color: var(--text-leise); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-symbol {
  flex: 0 0 22px; width: 22px; height: 22px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
}
.s-symbol.lift { background: var(--gelb); box-shadow: inset 0 0 0 2px var(--kontur); }
.s-symbol.legende { color: #b8860b; font-size: 17px; }
.s-symbol.gipfel { color: #7c4a1e; font-size: 16px; }
.s-symbol.ort, .s-symbol.weiler, .s-symbol.pass { color: var(--kontur); font-weight: 800; }
.s-gesperrt { color: var(--rot); font-weight: 700; font-size: 12px; }

/* Laptop/Tablet quer: Panel als Karte links unten, Navigationsleiste mittig */
@media (min-width: 760px) {
  .panel { left: 12px; right: auto; bottom: 12px; width: 390px; border-radius: 16px; max-height: calc(100vh - 120px); }
  .panel-griff { border-radius: 16px; }
  .navi { left: 50%; right: auto; transform: translateX(-50%); width: 440px; }
  .suche-knopf { left: 50%; right: auto; transform: translateX(-50%); width: 360px; }
  .sprach-knopf { right: auto; left: calc(50% + 180px - 42px); }
  .navi:not([hidden]) ~ .sprach-knopf { left: auto; right: 10px; }
  .sprache { left: 50%; right: auto; transform: translateX(-50%); width: 420px; }
  .suche-fenster { left: 50%; right: auto; transform: translateX(-50%); width: 480px; top: 10px; border-radius: 16px; max-height: calc(100% - 20px); }
  .leaflet-container { cursor: grab; }
  .leaflet-interactive { cursor: pointer; }
}
.leaflet-top { top: var(--sicher-oben); }
