/* ══════════════════════════════════════════════════════════════
   app.css — Prepper

   Gestaltungsregeln, bewusst gesetzt:
   • Dunkel als Standard. Nachts blendet nichts, spart Akku auf
     OLED, und im Ernstfall verrät ein helles Display die Position.
   • Große Ziele (min. 48 px). Bedienung mit Handschuhen, nass,
     unter Stress, einhändig.
   • Kritisches (Notruf, Warnung) hat feste Farben, keine Nuancen.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Flächen */
  --bg:        #12161c;
  --bg-2:      #1a1f27;
  --bg-3:      #232935;
  --bg-hoch:   #2b3240;

  /* Schrift */
  --fg:        #e8edf4;
  --fg-2:      #9aa7b8;
  --fg-3:      #6b7889;

  /* Linien */
  --linie:     #2c3441;
  --linie-2:   #3a4453;

  /* Akzente */
  --akzent:    #4a9eff;
  --akzent-bg: #16324f;

  /* Signale */
  --ok:        #35c07a;
  --ok-bg:     #12331f;
  --warn:      #f5a524;
  --warn-bg:   #3a2a0c;
  --gefahr:    #f04b4b;
  --gefahr-bg: #3d1517;

  /* Maße */
  --kopf-h:    52px;
  --tab-h:     58px;
  --radius:    12px;
  --radius-s:  8px;

  /* Sichere Bereiche (Notch, Home-Indikator) */
  --sa-top:    env(safe-area-inset-top, 0px);
  --sa-bot:    env(safe-area-inset-bottom, 0px);
  --sa-left:   env(safe-area-inset-left, 0px);
  --sa-right:  env(safe-area-inset-right, 0px);

  --schrift: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
             'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* Wer sein System auf Hell stellt, bekommt Hell. */
@media (prefers-color-scheme: light) {
  :root:not([data-thema="dunkel"]) {
    --bg:        #f4f6f9;
    --bg-2:      #ffffff;
    --bg-3:      #eaeef4;
    --bg-hoch:   #dde3ec;
    --fg:        #161b22;
    --fg-2:      #55606f;
    --fg-3:      #7d8797;
    --linie:     #dbe1e9;
    --linie-2:   #c5cedb;
    --akzent:    #0a6fd8;
    --akzent-bg: #e3f0ff;
    --ok-bg:     #e2f7ec;
    --warn-bg:   #fdf3dd;
    --gefahr-bg: #fdeaea;
  }
}

:root[data-thema="hell"] {
  --bg:        #f4f6f9;
  --bg-2:      #ffffff;
  --bg-3:      #eaeef4;
  --bg-hoch:   #dde3ec;
  --fg:        #161b22;
  --fg-2:      #55606f;
  --fg-3:      #7d8797;
  --linie:     #dbe1e9;
  --linie-2:   #c5cedb;
  --akzent:    #0a6fd8;
  --akzent-bg: #e3f0ff;
  --ok-bg:     #e2f7ec;
  --warn-bg:   #fdf3dd;
  --gefahr-bg: #fdeaea;
}

/* ══════════ Grundgerüst ══════════ */

*, *::before, *::after { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen und sie überstimmen:
   sonst gewinnt z.B. .head-btn { display: grid } gegen das
   hidden-Attribut, und ausgeblendete Knöpfe bleiben sichtbar. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

/* Text markieren nur wo es Sinn hat — sonst stört es beim Wischen. */
body { user-select: none; -webkit-user-select: none; }
input, textarea, .waehlbar, .artikel-text { user-select: text; -webkit-user-select: text; }

button { font: inherit; color: inherit; cursor: pointer; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }

a { color: var(--akzent); text-decoration: none; }

/* ══════════ Kopfbereich ══════════
   Alles Obere in einem Block. Was sichtbar ist, stapelt sich von
   selbst; die Bühne holt sich den Abstand aus der gemessenen
   Höhe (--kopf-gesamt, gesetzt in app.js). */

#kopfbereich {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding-top: var(--sa-top);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--linie);
}

/* ══════════ Lage-Banner ══════════ */

.lage-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .02em;
  background: var(--gefahr);
  animation: lage-atmen 2.6s ease-in-out infinite;
}

/* Ruhiges Pulsieren statt Blinken: fällt auf, ohne zu nerven,
   und ist auch bei längerer Lage erträglich. */
@keyframes lage-atmen {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.22); }
}

.lage-banner:active { filter: brightness(1.3); }

/* Hilferuf sticht über allem anderen hervor und pulsiert
   schneller als eine Lage — er ist die dringendere Meldung. */
.notruf-banner {
  background: var(--gefahr) !important;
  animation-duration: 1.4s;
}

/* ══════════ Notruf ══════════ */

.head-btn-notruf {
  color: var(--gefahr);
  font-size: 17px;
}

.notruf-knopf {
  position: relative;
  width: 168px;
  height: 168px;
  border: 0;
  border-radius: 50%;
  background: var(--gefahr);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 26px rgb(240 75 75 / .38);
  transition: transform .12s;
  touch-action: none;          /* sonst scrollt die Seite beim Halten */
  user-select: none;
  -webkit-user-select: none;
}

.notruf-knopf.laeuft { transform: scale(.95); }
.notruf-knopf.gesendet { background: var(--ok); box-shadow: 0 6px 26px rgb(53 192 122 / .38); }
.notruf-knopf:disabled { opacity: 1; }

.notruf-knopf-text {
  position: relative;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}

/* Der Ring füllt sich in der Haltezeit — damit man sieht, wie
   lange noch, statt blind zu warten. */
.notruf-ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: conic-gradient(#fff calc(var(--anteil, 0) * 1%), transparent 0);
  opacity: .35;
  z-index: 1;
}

@keyframes notruf-fuellen {
  from { --anteil: 0; }
  to   { --anteil: 100; }
}

/* Ohne diese Anmeldung kann die Prozentzahl nicht animiert
   werden — Custom Properties sind sonst nicht interpolierbar. */
@property --anteil {
  syntax: '<number>';
  initial-value: 0;
  inherits: false;
}

/* ══════════ Statusleiste ══════════ */

.statusbar {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .01em;
  background: var(--warn-bg);
  color: var(--warn);
}

.statusbar[data-art="offline"] { background: var(--warn-bg);   color: var(--warn);   }
.statusbar[data-art="sync"]    { background: var(--akzent-bg); color: var(--akzent); }
.statusbar[data-art="fehler"]  { background: var(--gefahr-bg); color: var(--gefahr); }
.statusbar[data-art="ok"]      { background: var(--ok-bg);     color: var(--ok);     }

/* ══════════ Kopfzeile ══════════ */

.apphead {
  height: var(--kopf-h);
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.apphead h1 {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 680;
  padding-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.head-right { display: flex; align-items: center; gap: 2px; }

.head-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: none; border: 0;
  border-radius: var(--radius-s);
  font-size: 20px;
  color: var(--fg-2);
  transition: background .12s, color .12s;
}

.head-btn:active { background: var(--bg-3); color: var(--fg); }
#btn-back { font-size: 30px; font-weight: 300; }

#btn-sync.dreht { animation: dreh 1s linear infinite; color: var(--akzent); }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Zähler offener Änderungen am Sync-Knopf */
.head-btn[data-zaehler]::after {
  content: attr(data-zaehler);
  position: absolute;
  transform: translate(13px, -13px);
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  background: var(--warn); color: #12161c;
  border-radius: 9px;
  font-size: 10.5px; font-weight: 800;
}

/* ══════════ Bühne ══════════ */

.stage {
  flex: 1;
  min-height: 0;
  padding-top: var(--kopf-gesamt, calc(var(--kopf-h) + var(--sa-top)));
  padding-bottom: calc(var(--tab-h) + var(--sa-bot));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Die Karte füllt alles und scrollt nicht mit. */
.stage.randlos { padding-bottom: 0; overflow: hidden; }
.stage.randlos > * { height: 100%; }

.inhalt { padding: 12px 14px calc(20px + var(--sa-bot)); }

/* ══════════ Tab-Leiste ══════════ */

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  height: calc(var(--tab-h) + var(--sa-bot));
  padding-bottom: var(--sa-bot);
  display: flex;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--linie);
}

.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none; border: 0;
  padding: 4px 2px;
  color: var(--fg-3);
  transition: color .12s;
}

.tab-icon { font-size: 21px; line-height: 1; }

.tab-text {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab[aria-selected="true"] { color: var(--akzent); }
.tab:active { background: var(--bg-3); }

/* ══════════ Karten & Listen ══════════ */

.karte {
  background: var(--bg-2);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
}

.karte + .karte { margin-top: 10px; }

.abschnitt { margin-bottom: 22px; }

.abschnitt-titel {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-3);
  margin: 0 2px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-2);
  border: 0;
  border-bottom: 1px solid var(--linie);
  text-align: left;
  color: var(--fg);
  min-height: 54px;
}

.zeile:last-child { border-bottom: 0; }
.zeile:active { background: var(--bg-3); }

.zeile-icon {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--bg-3);
  font-size: 19px;
}

.zeile-text { flex: 1; min-width: 0; }

.zeile-titel {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zeile-unter {
  font-size: 12.5px;
  color: var(--fg-2);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zeile-rechts {
  flex: none;
  font-size: 12.5px;
  color: var(--fg-3);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zeile-pfeil { color: var(--fg-3); font-size: 20px; font-weight: 300; }

/* ══════════ Marken ══════════ */

.marke {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
  background: var(--bg-3);
  color: var(--fg-2);
  white-space: nowrap;
}

.marke.ok     { background: var(--ok-bg);     color: var(--ok);     }
.marke.warn   { background: var(--warn-bg);   color: var(--warn);   }
.marke.gefahr { background: var(--gefahr-bg); color: var(--gefahr); }
.marke.info   { background: var(--akzent-bg); color: var(--akzent); }

/* ══════════ Knöpfe ══════════ */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--linie-2);
  border-radius: var(--radius-s);
  background: var(--bg-3);
  color: var(--fg);
  font-size: 15px;
  font-weight: 650;
  transition: filter .12s, background .12s;
}

.knopf:active { filter: brightness(1.25); }
.knopf:disabled { opacity: .45; pointer-events: none; }

.knopf.voll   { width: 100%; }
.knopf.haupt  { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.gut    { background: var(--ok);     border-color: var(--ok);     color: #0b2417; }
.knopf.boese  { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.knopf.leise  { background: none; border-color: transparent; color: var(--fg-2); }
.knopf.klein  { min-height: 38px; padding: 0 12px; font-size: 13.5px; }

.knopf-reihe { display: flex; gap: 10px; }
.knopf-reihe > .knopf { flex: 1; }

/* Schwebender Aktionsknopf */
.fab {
  position: absolute;
  right: 14px;
  bottom: calc(var(--tab-h) + var(--sa-bot) + 14px);
  z-index: 20;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--akzent);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 4px 16px rgb(0 0 0 / .4);
}

.fab:active { filter: brightness(1.15); transform: scale(.95); }

/* ══════════ Formulare ══════════ */

.feld { margin-bottom: 15px; }

.feld-titel {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--fg-2);
  margin-bottom: 6px;
}

.eingabe {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--linie-2);
  border-radius: var(--radius-s);
  color: var(--fg);
  font: inherit;
  font-size: 16px;   /* unter 16px zoomt iOS beim Fokus rein */
}

.eingabe:focus {
  outline: none;
  border-color: var(--akzent);
  background: var(--bg-2);
}

.eingabe::placeholder { color: var(--fg-3); }

textarea.eingabe { min-height: 92px; resize: vertical; line-height: 1.5; }

select.eingabe {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-2) 50%),
                    linear-gradient(135deg, var(--fg-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.feld-hinweis { font-size: 12px; color: var(--fg-3); margin-top: 5px; }

.feld-reihe { display: flex; gap: 10px; }
.feld-reihe > .feld { flex: 1; }

/* Schalter */
.schalter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  min-height: 54px;
}

.schalter-text { flex: 1; min-width: 0; }

.schalter input { display: none; }

.schalter-knebel {
  flex: none;
  width: 50px; height: 30px;
  border-radius: 15px;
  background: var(--bg-hoch);
  position: relative;
  transition: background .18s;
}

.schalter-knebel::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
}

.schalter input:checked + .schalter-knebel { background: var(--ok); }
.schalter input:checked + .schalter-knebel::after { transform: translateX(20px); }

/* Ankreuzfeld für Checklisten — bewusst groß */
.haken {
  flex: none;
  width: 30px; height: 30px;
  border: 2.5px solid var(--linie-2);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 17px;
  color: transparent;
  transition: background .12s, border-color .12s, color .12s;
}

.haken.an {
  background: var(--ok);
  border-color: var(--ok);
  color: #0b2417;
}

/* ══════════ Suche ══════════ */

.suchleiste { position: relative; margin-bottom: 12px; }

.suchleiste .eingabe { padding-left: 40px; }

.suchleiste::before {
  content: '🔍';
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: .55;
  pointer-events: none;
}

/* Waagrechte Filterreihe */
.filterreihe {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.filterreihe::-webkit-scrollbar { display: none; }

.filter {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--linie-2);
  border-radius: 20px;
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.filter[aria-pressed="true"] {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #fff;
}

/* ══════════ Überlagerung & Blatt ══════════ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(0 0 0 / .55);
  backdrop-filter: blur(2px);
  animation: einblenden .18s ease;
}

@keyframes einblenden { from { opacity: 0; } }

.blatt {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 110;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 30px rgb(0 0 0 / .5);
  animation: hochfahren .26s cubic-bezier(.2, .9, .25, 1);
  padding-bottom: var(--sa-bot);
}

@keyframes hochfahren { from { transform: translateY(100%); } }

.blatt-griff {
  flex: none;
  width: 38px; height: 4px;
  margin: 9px auto 2px;
  border-radius: 2px;
  background: var(--linie-2);
}

.blatt-kopf {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--linie);
}

.blatt-kopf h2 { flex: 1; font-size: 17px; }

.blatt-koerper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.blatt-fuss {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--linie);
  background: var(--bg-2);
}

.blatt-fuss > .knopf { flex: 1; }

/* ══════════ Meldungen ══════════ */

.toast-host {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tab-h) + var(--sa-bot) + 14px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  max-width: 460px;
  padding: 12px 18px;
  border-radius: 22px;
  background: var(--bg-hoch);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 18px rgb(0 0 0 / .45);
  animation: toast-auf .22s ease;
}

.toast.ok     { background: var(--ok);     color: #0b2417; }
.toast.warn   { background: var(--warn);   color: #2c1d02; }
.toast.gefahr { background: var(--gefahr); color: #fff; }

.toast.geht { animation: toast-zu .22s ease forwards; }

@keyframes toast-auf { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes toast-zu  { to   { opacity: 0; transform: translateY(6px)  scale(.97); } }

/* ══════════ Leerzustand ══════════ */

.leer {
  padding: 52px 30px;
  text-align: center;
  color: var(--fg-3);
}

.leer-icon { font-size: 46px; margin-bottom: 12px; opacity: .5; }

.leer-titel {
  font-size: 16px;
  font-weight: 650;
  color: var(--fg-2);
  margin-bottom: 6px;
}

.leer-text { font-size: 13.5px; line-height: 1.55; max-width: 300px; margin: 0 auto; }

/* ══════════ Karte (MapLibre) ══════════ */

.kartenflaeche { position: relative; width: 100%; height: 100%; }
#main-map { position: absolute; inset: 0; }

.karten-knoepfe {
  position: absolute;
  right: 12px;
  bottom: calc(var(--tab-h) + var(--sa-bot) + 12px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.karten-knopf {
  width: 47px; height: 47px;
  display: grid; place-items: center;
  border: 1px solid var(--linie-2);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-2) 93%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fg);
  font-size: 20px;
  box-shadow: 0 2px 10px rgb(0 0 0 / .3);
}

.karten-knopf:active { background: var(--bg-hoch); }
.karten-knopf.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }

/* Hinweisstreifen über der Karte */
.karten-hinweis {
  position: absolute;
  top: 10px; left: 12px; right: 12px;
  z-index: 15;
  padding: 9px 13px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-2) 93%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 10px rgb(0 0 0 / .3);
}

.karten-hinweis.warn { background: var(--warn-bg); color: var(--warn); }

/* MapLibre an das Farbschema angleichen */
.maplibregl-popup-content {
  background: var(--bg-2) !important;
  color: var(--fg) !important;
  border-radius: var(--radius) !important;
  padding: 14px 16px !important;
  box-shadow: 0 4px 20px rgb(0 0 0 / .45) !important;
}

.maplibregl-popup-tip {
  border-top-color: var(--bg-2) !important;
  border-bottom-color: var(--bg-2) !important;
}

.maplibregl-popup-close-button {
  width: 36px !important; height: 36px !important;
  font-size: 24px !important;
  color: var(--fg-2) !important;
  right: 2px !important; top: 2px !important;
  border-radius: 8px !important;
}

.maplibregl-ctrl-group {
  background: var(--bg-2) !important;
  border: 1px solid var(--linie-2) !important;
}

.maplibregl-ctrl-group button + button { border-top-color: var(--linie) !important; }
.maplibregl-ctrl-icon { filter: invert(.85); }
:root[data-thema="hell"] .maplibregl-ctrl-icon { filter: none; }

/* GPS-Punkt */
.gps-punkt {
  width: 20px; height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--akzent);
  box-shadow: 0 0 0 0 rgb(74 158 255 / .55);
  animation: gps-puls 2.2s infinite;
}

@keyframes gps-puls {
  0%   { box-shadow: 0 0 0 0   rgb(74 158 255 / .55); }
  70%  { box-shadow: 0 0 0 16px rgb(74 158 255 / 0); }
  100% { box-shadow: 0 0 0 0   rgb(74 158 255 / 0); }
}

/* Marker-Nadel */
.nadel {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 7px rgb(0 0 0 / .45);
}

.nadel > span { transform: rotate(45deg); font-size: 16px; line-height: 1; }

/* ══════════ Zielpunkt ══════════
   Muss sich deutlich von normalen Markern abheben — er beantwortet
   die Frage „wo genau ist das jetzt", und die darf nicht im
   Kartenbild untergehen. */

.ziel-punkt {
  position: relative;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.ziel-kern {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ziel-farbe, #f04b4b);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgb(0 0 0 / .5);
  font-size: 14px;
  z-index: 2;
}

.ziel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--ziel-farbe, #f04b4b);
  animation: ziel-welle 1.8s ease-out infinite;
  z-index: 1;
}

@keyframes ziel-welle {
  0%   { transform: scale(1);   opacity: .85; }
  100% { transform: scale(3.4); opacity: 0; }
}

.ziel-schild {
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 9px;
  background: var(--ziel-farbe, #f04b4b);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 2px 8px rgb(0 0 0 / .4);
}

/* ══════════ Fortschritt ══════════ */

.balken {
  height: 7px;
  border-radius: 4px;
  background: var(--bg-hoch);
  overflow: hidden;
}

.balken-fuellung {
  height: 100%;
  border-radius: 4px;
  background: var(--akzent);
  transition: width .3s ease;
}

.balken-fuellung.ok     { background: var(--ok); }
.balken-fuellung.warn   { background: var(--warn); }
.balken-fuellung.gefahr { background: var(--gefahr); }

/* ══════════ Boot ══════════ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity .3s;
}

.boot.weg { opacity: 0; pointer-events: none; }

.boot-mark {
  font-size: 46px;
  color: var(--akzent);
  animation: boot-puls 1.5s ease-in-out infinite;
}

@keyframes boot-puls {
  0%, 100% { opacity: .35; transform: scale(.94); }
  50%      { opacity: 1;   transform: scale(1); }
}

.boot-text { font-size: 13.5px; color: var(--fg-3); }

.boot-error {
  max-width: 340px;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--gefahr-bg);
  color: var(--gefahr);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  font-family: var(--mono);
}

/* ══════════ Kleinkram ══════════ */

.trenner { height: 1px; background: var(--linie); margin: 16px 0; }

.mono { font-family: var(--mono); font-size: 13px; }

.gedaempft { color: var(--fg-2); }
.leise     { color: var(--fg-3); font-size: 12.5px; }

.zentriert { text-align: center; }

.stapel    { display: flex; flex-direction: column; gap: 10px; }
.reihe     { display: flex; align-items: center; gap: 10px; }
.wachse    { flex: 1; min-width: 0; }

.gitter-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Kennzahl-Kachel */
.kennzahl {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--linie);
  text-align: center;
}

.kennzahl-wert { font-size: 25px; font-weight: 750; line-height: 1.15; }
.kennzahl-text { font-size: 11.5px; color: var(--fg-3); margin-top: 3px; font-weight: 600; }

/* Wischen zum Löschen */
.wisch { position: relative; overflow: hidden; }

.wisch-inhalt {
  position: relative;
  z-index: 1;
  background: var(--bg-2);
  transition: transform .2s;
}

.wisch-aktion {
  position: absolute;
  inset: 0 0 0 auto;
  width: 88px;
  display: grid; place-items: center;
  background: var(--gefahr);
  color: #fff;
  font-size: 20px;
}

/* Wer weniger Bewegung will, kriegt weniger Bewegung. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Auf breiten Schirmen mittig halten statt breitziehen. */
@media (min-width: 720px) {
  .inhalt { max-width: 660px; margin: 0 auto; }
  .blatt {
    left: 50%; right: auto;
    transform: translateX(-50%);
    width: min(560px, 100%);
    border-radius: 18px 18px 0 0;
  }
  @keyframes hochfahren { from { transform: translate(-50%, 100%); } }
}
