:root {
  --rot: #b5121b; --rot-hell: #fbe9ea; --auf-rot: #fff;
  --grund: #f5f3f0; --flaeche: #fff; --text: #1c1a19; --leise: #5a5450; --rand: #d6d0ca;
  --gruen: #17663a; --gruen-hell: #e2f2e8; --gelb: #7a4b00; --gelb-hell: #fdf0d5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --rot: #d6333c; --rot-hell: #3a191b;
    --grund: #171514; --flaeche: #231f1e; --text: #f4f0ec; --leise: #b8afa8; --rand: #453e3a;
    --gruen: #7fd6a2; --gruen-hell: #16301f; --gelb: #f2c266; --gelb-hell: #362a12;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--grund); color: var(--text); font: 1.125rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
header { display: flex; align-items: center; gap: 12px; background: var(--rot); color: var(--auf-rot); padding: 8px 16px; min-height: 60px; }
header .titel { flex: 1; margin: 0; font-weight: 700; font-size: 1.15rem; }
#zurueck, .notruf { color: inherit; background: none; border: 2px solid currentColor; border-radius: 8px; padding: 8px 12px; min-height: 44px; font: inherit; font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; cursor: pointer; }
main { max-width: 640px; margin: 0 auto; padding: 20px 16px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 4px 0 20px; text-wrap: balance; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
p { margin: 0 0 10px; }
a { color: inherit; }
.leise { color: var(--leise); font-size: 1rem; }
button, .haupt, .knopf { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

.auswahl { display: grid; gap: 12px; margin-bottom: 16px; }
.auswahl button, .haupt { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 72px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--rot); color: var(--auf-rot); font-size: 1.3rem; font-weight: 700; text-align: center; text-decoration: none; }
.auswahl .zweit { background: var(--flaeche); color: var(--text); border: 2px solid var(--rand); min-height: 60px; font-size: 1.1rem; }
.haupt[aria-busy="true"] { opacity: .75; }
#ortform { margin: 24px 0 16px; }
#ortform label { display: block; font-weight: 600; margin-bottom: 8px; }
.zeile { display: flex; gap: 8px; }
input { flex: 1; min-width: 0; font: inherit; padding: 12px; min-height: 56px; border: 2px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--text); }
.zeile button, .knopf { min-height: 56px; padding: 10px 18px; border: 2px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--text); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
#meldung { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--gelb-hell); color: var(--gelb); font-weight: 600; }

.kasten { background: var(--gelb-hell); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.kasten ul { margin: 8px 0 0; padding-left: 20px; }
.kasten li { margin-bottom: 6px; }

#karte-haus { background: var(--flaeche); border: 2px solid var(--rand); border-radius: 12px; padding: 16px; }
#karte-haus .ueber { color: var(--leise); font-size: 1rem; margin: 0 0 2px; }
#karte-haus h1 { margin: 0 0 6px; font-size: 1.5rem; }
.weit { font-size: 2.4rem; font-weight: 800; line-height: 1.1; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.weit small { font-size: 1rem; font-weight: 400; color: var(--leise); }
.marken { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.marken li { padding: 5px 12px; border-radius: 8px; font-size: 1rem; font-weight: 600; background: var(--grund); }
.marken .offen { background: var(--gruen-hell); color: var(--gruen); }
.marken .acht { background: var(--gelb-hell); color: var(--gelb); }
#karte-haus ul.info { margin: 0 0 14px; padding-left: 20px; }
.knoepfe { display: grid; gap: 8px; }
.knoepfe .knopf { width: 100%; }
.zuerst { background: var(--gelb-hell); border-radius: 10px; padding: 12px 14px; margin: 0 0 12px; }

#modi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 10px; }
#modi button { min-height: 68px; padding: 6px 2px; border: 2px solid var(--rand); border-radius: 10px; background: var(--flaeche); color: var(--text); font-size: 1rem; line-height: 1.25; font-weight: 600; }
#modi button span { display: block; font-weight: 400; font-size: .9rem; font-variant-numeric: tabular-nums; }
#modi button[aria-pressed="true"] { background: var(--text); color: var(--flaeche); border-color: var(--text); }
#landkarte { height: 320px; border-radius: 12px; border: 2px solid var(--rand); margin-bottom: 10px; z-index: 0; background: var(--rand); }
#weg ol { margin: 8px 0; padding: 0; list-style: none; }
#weg li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rand); }
#weg li span:last-child { color: var(--leise); white-space: nowrap; font-variant-numeric: tabular-nums; }
#weg details { background: var(--flaeche); border: 2px solid var(--rand); border-radius: 12px; padding: 4px 16px; margin-top: 10px; }
#weg summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; cursor: pointer; }
#weg summary::after { content: "▾"; }
#weg details[open] summary::after { content: "▴"; }
#weg .zeit { white-space: nowrap; font-variant-numeric: tabular-nums; }
#weg .dist { margin: 12px 0 0; }

.liste { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.liste button { width: 100%; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; min-height: 64px; border: 2px solid var(--rand); border-radius: 12px; background: var(--flaeche); color: var(--text); }
.liste b { display: block; }
.liste small { color: var(--leise); font-size: .95rem; }
.liste .km { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.heim { background: var(--flaeche); border: 2px solid var(--rand); border-radius: 12px; padding: 12px 14px; }
.heim .knopf { min-height: 48px; margin-top: 8px; }

footer { max-width: 640px; margin: 0 auto; padding: 4px 16px 32px; font-size: 1rem; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 11px; }
.ich { width: 22px; height: 22px; border-radius: 50%; background: #1663c7; border: 4px solid #fff; box-shadow: 0 0 0 2px #1663c7; }
.haus { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #b5121b; border: 3px solid #fff; box-shadow: 0 1px 4px #0008; }
@media (max-width: 460px) { header .schmal { color: transparent; font-size: 0; } }
@media (max-width: 360px) { #modi { grid-template-columns: 1fr 1fr; } header .titel { font-size: 1rem; } }
