:root {
  --gruen: #2f5d50;
  --gruen-hell: #e3eee9;
  --text: #1d2521;
  --grau: #66706b;
  --flaeche: #ffffff;
  --rand: #d5ddd9;
  --rot: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gruen: #7cc2a8;
    --gruen-hell: #23332d;
    --text: #e8eeeb;
    --grau: #a3aea9;
    --flaeche: #161c19;
    --rand: #33403a;
    --rot: #f2a19b;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--flaeche); }
#map { position: fixed; inset: 0; }

/* Handy: Einstellungsfeld als ziehbares "Blatt" von unten mit drei Raststufen.
   Die Höhe ist fest (88 % des Bildschirms); eingeklappt wird per Verschieben nach unten
   (--y, gesetzt von app.js). */
#panel {
  position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0;
  height: 88vh; height: 88dvh; background: var(--flaeche); color: var(--text);
  border-radius: 16px 16px 0 0; box-shadow: 0 -2px 12px #0003;
  display: flex; flex-direction: column;
  transform: translateY(var(--y, 0px)); transition: transform .25s ease-out;
}
#panel.zieht { transition: none; }
#griff { border: 0; background: none; padding: 12px 0 10px; width: 100%; cursor: grab; touch-action: none; }
#griff span { display: block; width: 48px; height: 6px; border-radius: 3px; background: var(--grau); opacity: .6; margin: auto; }
#inhalt { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
          padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 800px) {
  #panel { left: 12px; right: auto; top: 12px; bottom: 12px; width: 380px; height: auto; border-radius: 16px;
           transform: none !important; }
  #griff { display: none; }
  #inhalt { padding-top: 12px; }
}

h1 { font-size: 20px; margin: 0 0 8px; color: var(--gruen); touch-action: none; }
h1 small { font-size: 13px; color: var(--grau); font-weight: normal; }
.hinweis { background: var(--gruen-hell); padding: 8px 10px; border-radius: 8px; margin: 0 0 10px; }
.link { border: 0; background: none; color: var(--gruen); font: inherit; text-decoration: underline; padding: 0; cursor: pointer; }
.zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.zeile label { display: flex; align-items: center; gap: 4px; }
input[type=number] { width: 4.5em; padding: 6px; font: inherit; border: 1px solid var(--rand); border-radius: 6px; background: var(--flaeche); color: var(--text); }

.umschalter { display: inline-flex; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; }
.umschalter button { border: 0; background: none; color: var(--text); padding: 7px 12px; font: inherit; cursor: pointer; }
.umschalter button + button { border-left: 1px solid var(--rand); }
.umschalter button.aktiv { background: var(--gruen); color: var(--flaeche); }
.umschalter.klein button { padding: 5px 9px; font-size: 13px; }

details { margin: 10px 0; }
summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.filter { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--rand); }
.filter .name { flex: 1; }
.filter .stufen button { padding: 4px 7px; font-size: 12px; }

.haupt { width: 100%; padding: 11px; margin: 8px 0; border: 0; border-radius: 10px; background: var(--gruen); color: var(--flaeche); font: 600 16px system-ui, sans-serif; cursor: pointer; }
.haupt:disabled { opacity: .45; cursor: default; }
#status { color: var(--grau); min-height: 1.2em; }
#status.fehler { color: var(--rot); }

.vorschlag { border: 2px solid var(--rand); border-radius: 10px; padding: 8px 10px; margin: 8px 0; cursor: pointer; }
.vorschlag.gewaehlt { border-color: var(--farbe); }
.vorschlag .kopf { display: flex; justify-content: space-between; font-weight: 600; }
.vorschlag .kopf::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--farbe); margin-right: 6px; align-self: center; }
.vorschlag .kopf span:first-child { flex: 1; }
.vorschlag ul { margin: 4px 0 6px; padding-left: 18px; color: var(--grau); font-size: 14px; }
.vorschlag .gut { color: var(--gruen); }
.vorschlag .aktionen button { font-size: 13px; }
.knopf { border: 1px solid var(--rand); background: var(--flaeche); color: var(--text); border-radius: 6px; padding: 4px 8px; cursor: pointer; font: inherit; }

footer { font-size: 12px; color: var(--grau); margin-top: 14px; }
footer a { color: var(--grau); }

.regler { margin: 6px 0; }
.regler label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.regler input[type=range] { width: 100%; accent-color: var(--gruen); margin: 6px 0 0; }
.klein { font-size: 13px; }
.grau { color: var(--grau); margin: 2px 0 8px; }

.startpunkt { background: var(--gruen); border: 4px solid #fff; border-radius: 50%; box-shadow: 0 1px 5px #0007; }

/* Textseiten (Datenschutz) */
.textseite { position: static; max-width: 720px; margin: 0 auto; padding: 16px; }
.textseite h1 { font-size: 24px; }
.textseite h2 { font-size: 18px; margin-top: 22px; color: var(--gruen); }
.textseite a { color: var(--gruen); }

/* "hidden" darf von keiner anderen Regel überstimmt werden */
[hidden] { display: none !important; }

/* Höhenprofil */
.profil { display: block; width: 100%; height: 90px; margin: 6px 0 0; touch-action: none; cursor: crosshair; }
.profil .flaeche { fill: var(--gruen-hell); }
.profil .linie { fill: none; stroke: var(--gruen); stroke-width: 2; }
.profil .zeiger { stroke: #e67e22; stroke-width: 2; }
.profil-achse { display: flex; justify-content: space-between; font-size: 12px; color: var(--grau); margin-bottom: 6px; }
.profil-info { color: var(--text); font-weight: 600; }
