/* NEU 28.10.2026: Navigationsansicht (s. navigation.html) */
:root {
  --primary: #0E6E8C;
  --text: #1f2933;
  --hell: rgba(253, 251, 247, 0.96); /* 18.11.2026: Flächen heller */
  /* Kartenknöpfe halbtransparent (Userwunsch 28.10.2026) */
  --knopf: rgba(255, 255, 255, 0.85);
  --schatten: 0 1px 4px rgba(0, 0, 0, 0.28);
  /* unter der Statusleiste bzw. über der Gestenleiste des Handys bleiben */
  /* NACHTRAG 01.11.2026 (Userwunsch): Knöpfe oben etwas höher (vorher mind. 24 px Abstand) */
  --oben: calc(env(safe-area-inset-top, 0px) + 4px); /* NACHTRAG 01.11.2026 abends: noch etwas höher */
  --unten: max(env(safe-area-inset-bottom), 14px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); }
#karte { position: absolute; inset: 0; }

.spalte { position: absolute; top: var(--oben); z-index: 3; display: flex; flex-direction: column; gap: 4px; } /* 01.11.2026: Abstände 4 statt 10 px (Userwunsch: spürbar enger) */
.links-oben { left: 10px; }
.rechts-oben { right: 10px; align-items: flex-end; }
/* Knöpfe wie auf der Website (Leaflet-Leisten): weiß, grauer Rand */
.gruppe {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--knopf); border: 2px solid rgba(0, 0, 0, 0.22); border-radius: 5px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.gruppe .knopf { border: 0; border-radius: 0; background: none; backdrop-filter: none; box-shadow: none; }
.gruppe .knopf + .knopf { border-top: 1px solid #ccc; }
.knopf {
  width: 34px; height: 34px; padding: 0; border: 2px solid rgba(0, 0, 0, 0.22); border-radius: 5px;
  background: var(--knopf); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  color: #333; display: flex; align-items: center; justify-content: center; position: relative;
}
.gruppe .knopf { width: 30px; height: 32px; }
.knopf svg { width: 20px; height: 20px; }
/* NACHTRAG 06.11.2026: Standort-Symbol (MapLibre-Form) etwas größer, wie in der Vorschau */
#zentrieren svg { width: 23px; height: 23px; }
.knopf.aktiv { color: var(--primary); }
.knopf.aus { color: #9aa1a8; }
.knopf[hidden] { display: none; }
#kompassNadel { transition: transform 0.2s linear; width: 30px; height: 30px; }
.kompass-text {
  /* Userwunsch 01.11.2026: „N“ oben rechts statt unten rechts */
  position: absolute; right: 2px; top: 1px; font-size: 9px; font-weight: 700; color: var(--primary);
}
#zentrieren.folgt { color: #1f6fd6; }

.ebenen-kasten {
  background: #fff; border: 2px solid rgba(0, 0, 0, 0.22); border-radius: 5px;
  padding: 6px 12px 6px 8px; font-size: 14px; color: #333; min-width: 150px;
}
.ebenen-kasten[hidden] { display: none; }
.ebenen-kasten label { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.ebenen-kasten input { width: 16px; height: 16px; margin: 0; }
/* NEU 08.11.2026 (Userwunsch): Top-Hotspots / Alle eingerückt unter Sehenswürdigkeiten */
.ebenen-kasten .sehens-wahl { display: flex; gap: 12px; padding: 0 0 2px 23px; font-size: 13.5px; }
.ebenen-kasten .sehens-wahl[hidden] { display: none; }
.ebenen-kasten .sehens-wahl label { gap: 5px; padding: 2px 0; }
.ebenen-kasten .sehens-wahl input { width: 14px; height: 14px; }
.ebenen-kasten .trenner { border-top: 1px solid #ddd; margin: 5px -12px 5px -8px; }
/* Aufnahme: kleiner Knopf rechts unter den Ebenen, Info links daneben */
.aufnahme-bereich { position: relative; display: flex; align-items: center; }
.aufnahme-knopf { }
.aufnahme-punkt {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #111;
  display: flex; align-items: center; justify-content: center;
}
.aufnahme-punkt::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #d4213d; }
/* aus: schwarzer, nicht ausgefüllter Kreis mit kleinem roten Punkt – soll
   nicht nach „läuft schon“ aussehen (Userwunsch 29.10.2026) */
.aufnahme-knopf:not(.laeuft):not(.pause) .aufnahme-punkt::after { width: 7px; height: 7px; }
/* läuft: roter Ring, rotes Quadrat (= Stopp-Symbol), pulsierend */
.aufnahme-knopf.laeuft .aufnahme-punkt { border-color: #d4213d; animation: pulsieren 1.4s ease-in-out infinite; }
.aufnahme-knopf.laeuft .aufnahme-punkt::after { border-radius: 2px; width: 9px; height: 9px; }
/* Pause: roter Ring mit zwei Balken */
.aufnahme-knopf.pause .aufnahme-punkt { border-color: #d4213d; }
.aufnahme-knopf.pause .aufnahme-punkt::after { background: none; border-radius: 0; width: 4px; height: 9px; border-left: 3px solid #d4213d; border-right: 3px solid #d4213d; }
@keyframes pulsieren { 50% { opacity: 0.35; } }
.aufnahme-info {
  position: absolute; right: 46px; white-space: nowrap;
  display: none; background: var(--hell); border-radius: 8px; padding: 5px 8px; font-size: 13px;
  box-shadow: var(--schatten); font-variant-numeric: tabular-nums;
}
.aufnahme-info.sichtbar { display: block; }

/* unten */
.unten { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 0 10px var(--unten); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.unten > * { pointer-events: auto; }
.feld { background: var(--hell); border-radius: 12px; box-shadow: var(--schatten); padding: 10px 12px; }
.feld[hidden] { display: none; }
/* NACHTRAG 05.11.2026: vier Spalten (Gesamt, Zurückgelegt, Rest, Zeit) */
.strecke-raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; gap: 4px; }
/* ohne feste Ziffernbreite – Ziffern stehen enger, wie sonst in der App
   (Userwunsch 29.10.2026) */
.strecke-raster .wert { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; } /* 17 statt 19 px: vier Spalten (05.11.2026) */
.strecke-raster .name { display: block; font-size: 12px; font-weight: 700; color: #3b4450; }
.hinweis { font-size: 12px; color: #b4371f; text-align: center; margin-top: 4px; }
.hinweis:empty { display: none; }
.profil-kopf { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
button.klein { border: 1px solid var(--primary); background: none; color: var(--primary); border-radius: 6px; font-size: 12px; padding: 3px 8px; }
.profil { width: 100%; height: 132px; display: block; touch-action: none; } /* 132 statt 110 px (08.11.2026) */
.leiste { display: flex; background: var(--hell); border-radius: 14px; box-shadow: var(--schatten); }
.leiste button {
  flex: 1; border: 0; background: none; padding: 4px 2px 3px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); /* 13 px, halbfett (Userwunsch 08.11.2026) */
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.leiste button svg { width: 20px; height: 20px; }
/* NACHTRAG 17.11.2026 (Userwunsch): Symbole so groß wie im App-Menü (27 px) */
.leiste button svg { width: 27px; height: 27px; }
/* NACHTRAG 17.11.2026 (Userwunsch): Navigationsleiste niedriger */
.leiste { padding: 2px; gap: 2px; }
.leiste button { padding: 2px 2px 1px; gap: 0; }
.leiste { padding: 3px; gap: 3px; }
.leiste button { border-radius: 10px; }
/* ausgewählt: kräftig hinterlegt – erneutes Antippen schaltet wieder aus */
.leiste button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 700; }
/* NACHTRAG 16.11.2026 (Userwunsch, Vorschlag B): Leiste in Sandbeige wie die Menüleiste der App */
.leiste { background: rgba(237, 227, 204, 0.97); }
/* NACHTRAG 16.11.2026 spät (Userwunsch, Vorschlag 8): dunkles Waldgrün, gewählte Taste weiß */
/* NACHTRAG 16.11.2026 23 Uhr (Userwunsch): Stein-Ton der App etwas dunkler
   wie die Menüleiste; gewählte Taste petrol */
.leiste { background: rgba(221, 213, 194, 0.97); } /* 18.11.2026: ca. 20 % heller */
.leiste button { color: #1f2933; }
.leiste button[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* Schichten (Menü, Foto groß) */
.schicht { position: fixed; inset: 0; z-index: 10; background: rgba(14, 20, 32, 0.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px var(--unten); }
.schicht[hidden] { display: none; }
.schicht.dunkel { background: rgba(0, 0, 0, 0.92); flex-direction: column; align-items: center; justify-content: center; }
.menue { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.menue-titel { font-weight: 700; font-size: 17px; }
.menue-text { font-size: 14px; color: #59626F; margin-bottom: 4px; }
.menue button { border: 0; border-radius: 10px; padding: 12px; font: inherit; font-size: 16px; background: var(--primary); color: #fff; }
.menue button.leise { background: #efe7d4; color: var(--text); }
#fotoGrossBild { max-width: 100%; max-height: 80vh; object-fit: contain; }
.foto-text { color: #fff; font-size: 15px; margin-top: 10px; text-align: center; }

/* Fotomarker-Popup */
.maplibregl-popup-content { padding: 6px; border-radius: 10px; }
/* NACHTRAG 01.11.2026 (Fehler gemeldet: Hochkant-Fotos erschienen quer – die
   Vorschau hatte ein festes Querformat und schnitt sie zu): Format des Fotos behalten */
.foto-popup img { display: block; width: auto; height: auto; max-width: 180px; max-height: 200px; border-radius: 6px; }
.foto-popup div { font-size: 13px; font-weight: 600; margin-top: 4px; max-width: 180px; } /* halbfett (Userwunsch 08.11.2026) */

/* eigene Position */
/* Userwunsch 31.10.2026: großer Richtungspfeil wie bei OsmAnd; ohne bekannte
   Richtung ein Punkt */
.position { width: 48px; height: 48px; position: relative; }
.position .punkt { position: absolute; inset: 13px; border-radius: 50%; background: #1f6fd6; border: 3px solid #fff; box-shadow: 0 0 4px rgba(0,0,0,.4); }
.position .genauigkeit { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%;
  background: rgba(31, 111, 214, 0.18); border: 1px solid rgba(31, 111, 214, 0.35); pointer-events: none; }
.position .richtung { position: absolute; inset: 0; width: 48px; height: 48px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
.position .richtung + .punkt { display: none; }
.position.ohne-richtung .richtung { display: none; }
.position.ohne-richtung .richtung + .punkt { display: block; }

#meldung {
  position: fixed; left: 50%; top: 45%; transform: translateX(-50%); z-index: 20;
  background: #0E1420; color: #fff; padding: 9px 13px; border-radius: 8px; font-size: 14px;
  max-width: 85%; text-align: center; display: none;
}

/* Quellenangabe und Maßstab über der unteren Leiste */
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(var(--unten) + 54px); }

/* beim Wischen über Profil/Felder keinen Text markieren */
.feld, .profil, .leiste { -webkit-user-select: none; user-select: none; }

/* Maßstab ausblenden, solange Strecke/Höhenprofil offen sind (29.10.2026) */
body.feld-offen .maplibregl-ctrl-scale { display: none; }

/* kein Rechteck beim Antippen (Android-Markierung, 30.10.2026) */
* { -webkit-tap-highlight-color: transparent; }

/* NEU 31.10.2026: Abbiegepfeile (Vorbild OsmAnd) – Kasten links oben,
   die Knöpfe links rücken darunter */
.abbiege-kasten { position: absolute; top: var(--oben); left: 10px; z-index: 4; background: rgba(255, 255, 255, 0.93);
  border: 2px solid rgba(0, 0, 0, 0.22); border-radius: 8px; padding: 2px 10px 2px 6px; box-shadow: var(--schatten); min-width: 112px; } /* 01.11.2026: schmaler */
.abbiege-kasten[hidden] { display: none; }
.abbiege-zeile { display: flex; align-items: center; gap: 7px; height: 36px; } /* NACHTRAG 08.11.2026 (Userwunsch): Kasten kleiner */
.abbiege-zeile + .abbiege-zeile { border-top: 1px solid #ddd; }
.abbiege-symbol { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; }
.abbiege-symbol svg { width: 30px; height: 30px; }
.abbiege-zeile b { font-size: 19px; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; white-space: nowrap; }
.abbiege-zeile b small { font-size: 13px; font-weight: 600; color: #555; margin-left: 3px; }
.abbiege-zeile b.abseits { color: #d4213d; font-size: 19px; display: flex; flex-direction: column; line-height: 1.05; }
.abbiege-zeile b.abseits small { color: #d4213d; font-size: 12px; margin-left: 0; }
#rueckPfeil { transition: transform 0.3s; }
/* NEU 01.11.2026 (Etappe 6): Auswahl Abseits-Warnung im Ebenen-Kasten */
.ebenen-kasten .abseits-wahl { flex-direction: column; align-items: flex-start; gap: 4px; }
.ebenen-kasten select { font: inherit; font-size: 14px; padding: 4px 6px; border: 1px solid #bbb; border-radius: 6px; background: #fff; width: 100%; }
/* NEU 21.11.2026 (Userwunsch): Abseits-Warnung, Ton und Ansage klappen im
   Kasten nach unten auf statt eines Auswahlfensters (s. navigation.js
   „Aufklapp-Auswahl im Ebenen-Kasten“); die <select> bleiben unsichtbar */
.ebenen-kasten .abseits-wahl select { display: none; }
.ebenen-kasten .abseits-wahl { gap: 3px; }
.wahl-anzeige { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #bbb; border-radius: 6px; background: #fff; color: #333; text-align: left;
  -webkit-tap-highlight-color: transparent; }
.wahl-anzeige::after { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); flex: none; }
.wahl-anzeige.offen { border-color: var(--primary); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wahl-anzeige.offen::after { transform: translateY(2px) rotate(-135deg); }
.wahl-zeilen { width: 100%; box-sizing: border-box; margin-top: -3px; border: 1px solid var(--primary); border-top: 0; border-radius: 0 0 6px 6px; background: #FDFBF7; overflow: hidden; }
.wahl-zeilen[hidden] { display: none; }
.wahl-zeilen button { display: flex; justify-content: space-between; width: 100%; padding: 7px 8px; border: 0; border-top: 1px solid #ece4d2;
  background: none; font: inherit; font-size: 14px; color: #333; text-align: left; -webkit-tap-highlight-color: transparent; }
.wahl-zeilen button:first-child { border-top: 0; }
.wahl-zeilen button[aria-checked='true'] { color: var(--primary); font-weight: 700; }
.wahl-zeilen button[aria-checked='true']::after { content: '✓'; }
.wahl-anzeige:focus, .wahl-zeilen button:focus { outline: none; }
.ebenen-kasten { max-height: calc(100vh - 150px); overflow-y: auto; } /* 21.11.2026: aufgeklappt nie über den Bildschirm hinaus */

body.mit-abbiegen .links-oben { top: calc(var(--oben) + 81px); } /* Kasten 77 px + 4 px Abstand (08.11.2026) */

/* NEU 01.11.2026 (Userwunsch): Karte vom eigenen Standort weggeschoben –
   „Meine Position“ deutlich größer, hellrot hinterlegt, mit Beschriftung */
/* Userwunsch 01.11.2026: Beschriftung bündig mit den anderen Knöpfen, der
   große Knopf mittig darüber (Beschriftung 74 px, Knopf 54 px → 10 px Einzug) */
#zentrieren.weg { margin-left: 10px; width: 54px; height: 54px; background: #fde4e6; border-color: #d4213d; color: #b0182f; overflow: visible; }
#zentrieren.weg svg { width: 30px; height: 30px; }
/* die anderen Knöpfe der Spalte behalten ihre Breite */
.links-oben { align-items: flex-start; }
#zentrieren.weg::after {
  content: "Zentrieren"; position: absolute; top: calc(100% + 3px); left: -12px; width: 74px; box-sizing: border-box; text-align: center;
  background: #d4213d; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 9px; white-space: nowrap;
}

/* Userwunsch 01.11.2026: beim Folgen braucht es den Knopf „Meine Position“
   nicht – er erscheint nur (groß, hellrot), wenn die Karte weggeschoben ist */
#zentrieren.folgt { display: none; }

/* NEU 01.11.2026: Fenster „Ziel erreicht“ */
.ziel-schicht { align-items: center; }
.ziel-menue { align-items: center; text-align: center; }
.ziel-menue .pokal { width: 84px; height: 84px; }
.ziel-menue button { align-self: stretch; }

/* NEU 01.11.2026: Knopf „3D“ (aktiv = Karte gekippt) */
.knopf.drei-d { font: 800 14px/1 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: -0.3px; }
.knopf.drei-d.aktiv { background: #d8eef5; color: var(--primary); border-color: var(--primary); }

/* NEU 01.11.2026 (Userwunsch): aktuelle Höhe unten links, knapp */
.hoehe-anzeige { position: absolute; left: 10px; bottom: calc(var(--unten) + 56px); z-index: 3; display: flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.85); border: 2px solid rgba(0, 0, 0, 0.22); border-radius: 5px; padding: 2px 7px 2px 5px; }
.hoehe-anzeige[hidden], body.feld-offen .hoehe-anzeige { display: none; }
.hoehe-anzeige svg { width: 18px; height: 18px; }
.hoehe-anzeige b { font-size: 15px; font-weight: 700; color: #222; font-variant-numeric: tabular-nums; }
/* NEU 01.11.2026 (Userwunsch): Auswahl der Richtung beim Start */
.richtung-wahl { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 2px solid #E8E3D7; border-radius: 10px; }
.richtung-wahl:has(input:checked) { border-color: var(--primary); background: #eef5f7; }
.richtung-wahl input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.richtung-wahl b { display: block; font-size: 16px; }
.richtung-wahl small { display: block; font-size: 13.5px; color: #59626F; margin-top: 2px; }
/* NEU 19.11.2026 (Userwunsch): „Ton an“ dezent rechtsbündig unter den Richtungsfeldern, ohne Kasten */
.ton-wahl { align-self: flex-end; display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 0 4px; margin-top: -2px; }
.ton-wahl input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }

/* NEU 05.11.2026 (Userwunsch): Vorschau des Tracks bei der Richtungswahl */
/* NACHTRAG 20.11.2026 (Userwunsch): Fenster darf höher werden, Karte füllt den
   Platz und wird nie oben vom Bildschirmrand abgeschnitten (schrumpft eher) */
#richtungMenue .menue { max-height: 100%; box-sizing: border-box; }
.richtung-karte { height: min(48vh, 400px); min-height: 150px; flex: 1 1 auto; border-radius: 10px; overflow: hidden; background: #e8e2d3; }
.richtung-karte[hidden] { display: none; }
/* NACHTRAG 06.11.2026: Zoomknöpfe der Vorschau nicht wie die Menüknöpfe färben;
   Quellenangabe unten am Rand der kleinen Karte */
.richtung-karte .maplibregl-ctrl-group button { width: 36px; height: 36px; padding: 0; border-radius: 0; background-color: #fff; color: #111; }
.richtung-karte .maplibregl-ctrl-group { border-radius: 8px; overflow: hidden; }
.richtung-karte .maplibregl-ctrl-bottom-right, .richtung-karte .maplibregl-ctrl-bottom-left { bottom: 0; }

/* NEU 10.11.2026 (Userwunsch): Auswahl „Zurück zum Track“ */
.rueck-wahl { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.rueck-wahl[hidden] { display: none; }
.rueck-wahl > div { background: #fff; border-radius: 14px; padding: 16px; width: 100%; max-width: 340px; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.rueck-wahl b { display: block; font-size: 16px; margin-bottom: 4px; }
.rueck-wahl p { margin: 0 0 12px; font-size: 14px; color: #59626F; }
.rueck-wahl button { display: block; width: 100%; margin-top: 8px; border: 0; border-radius: 10px; padding: 11px; font: inherit; font-size: 15px; font-weight: 700; background: #efe7d4; color: #0E1420; }
.rueck-wahl button.haupt { background: var(--primary); color: #fff; }
.rueck-wahl button[hidden] { display: none; }
body:has(.abbiege-zeile b.abseits) .abbiege-kasten { cursor: pointer; }
