[hidden] { display: none !important; }
:root {
  --gruen: #2f6b3a; --gruen2: #3f8a4c; --sand: #f4f1e8; --text: #1f2a22; --grau: #6b746c;
  --blau: #1a73e8; --karte: #fff; --rand: #e1ddd0; --schatten: 0 4px 18px rgba(0,0,0,.18);
  --oben: env(safe-area-inset-top, 0px); --unten: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --sand: #1d221e; --text: #e8ece6; --grau: #a2aba3; --karte: #262c27; --rand: #39413a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--sand); -webkit-tap-highlight-color: transparent; }
#karte { position: fixed; inset: 0; background: #eef0e6; }
button { font: inherit; cursor: pointer; }
a { color: var(--gruen2); }
.ohne { background: none; border: 0; color: inherit; }

/* Suche */
#kopf { position: fixed; top: calc(10px + var(--oben)); left: 12px; right: 64px; z-index: 1000; max-width: 520px; }
.suchfeld { display: flex; align-items: center; background: var(--karte); border-radius: 26px; box-shadow: var(--schatten); padding: 0 6px 0 14px; height: 50px; }
.suchfeld .lupe { font-size: 18px; opacity: .7; }
#suche { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; padding: 0 10px; color: var(--text); min-width: 0; height: 100%; }
#suche::-webkit-search-cancel-button { display: none; }
#sucheLeeren { width: 38px; height: 38px; font-size: 18px; opacity: .6; }
#vorschlaege { list-style: none; margin: 8px 0 0; padding: 6px 0; background: var(--karte); border-radius: 16px; box-shadow: var(--schatten); max-height: 60vh; overflow: auto; }
#vorschlaege li, .liste li { display: flex; align-items: center; gap: 12px; padding: 8px 14px; cursor: pointer; }
#vorschlaege li:hover, .liste li:hover { background: rgba(47,107,58,.08); }
#vorschlaege li span, .liste li span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#vorschlaege i, .liste i { font-size: 13px; color: var(--grau); }
#vorschlaege .leer { color: var(--grau); cursor: default; }
#vorschlaege li span.sym, .liste li span.sym, .nah span.sym { flex: none; display: inline-flex; }
.sym { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; background: #e3eed8; }

/* Knöpfe */
#knoepfe { position: fixed; right: 10px; top: calc(10px + var(--oben)); z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
#knoepfe button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--karte); color: var(--text); box-shadow: var(--schatten); font-size: 20px; }
body.navigiert #knoepfe { top: calc(120px + var(--oben)); }
body.navigiert #btnListe, body.navigiert #btnEinst { display: none; }
#btnZentrieren { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--unten)); z-index: 1001; border: 0; border-radius: 22px; padding: 10px 18px; background: var(--karte); color: var(--blau); font-weight: 600; box-shadow: var(--schatten); }

/* Marker */
.tm { display: flex; flex-direction: column; align-items: center; }
.tmb { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); overflow: hidden; background: #e3eed8; display: flex; align-items: center; justify-content: center; font-size: 22px; transition: transform .15s; }
.leaflet-marker-pane .tmb img { width: 100% !important; height: 100% !important; object-fit: cover; }
.tml { margin-top: 2px; white-space: nowrap; font-size: 12px; font-weight: 600; color: #233; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 8px; display: none; }
.z-nah .tml { display: block; }
.z-fern .tmb { width: 22px; height: 22px; border-width: 2px; font-size: 12px; }
.z-fern .tm { margin: 9px; }
.z-mittel .tmb { width: 32px; height: 32px; }
.einr span { display: flex; width: 26px; height: 26px; align-items: center; justify-content: center; background: #fff; border-radius: 7px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 15px; }
.z-fern .einr { display: none; }
.hauslabel span { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: 11px; color: #6d5a3d; font-style: italic; text-shadow: 0 0 3px #fff, 0 0 3px #fff; display: none; }
.z-nah .hauslabel span { display: block; }
.ich { position: relative; }
.ichpunkt { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: var(--blau); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.ichpfeil { position: absolute; left: 0; top: 0; width: 44px; height: 44px; display: none; }
.ichpfeil::before { content: ""; position: absolute; left: 14px; top: -2px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 16px solid rgba(26,115,232,.75); }

/* Nähe + Hinweis */
#naehe { position: fixed; left: 12px; right: 12px; bottom: calc(18px + var(--unten)); z-index: 999; background: var(--gruen); color: #fff; border-radius: 30px; padding: 6px 16px 6px 6px; display: flex; align-items: center; gap: 10px; box-shadow: var(--schatten); cursor: pointer; max-width: 480px; margin: 0 auto; }
#naehe img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
#naehe .mehr { margin-left: auto; opacity: .85; }
#hinweis { position: fixed; left: 50%; transform: translateX(-50%); top: calc(72px + var(--oben)); z-index: 2000; background: rgba(30,30,30,.9); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: 90vw; text-align: center; }
body.navigiert #hinweis { top: calc(130px + var(--oben)); }

/* Unteres Blatt */
#blatt { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; background: var(--karte); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,.2); transition: transform .25s ease, max-height .25s; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(16px + var(--unten)); max-width: 640px; margin: 0 auto; }
#blatt.zu { transform: translateY(110%); }
#blatt.halb { max-height: 46vh; }
#blatt.voll { max-height: 86vh; }
.griff { position: sticky; top: 0; height: 22px; margin: 0 -16px 4px; background: var(--karte); z-index: 2; cursor: grab; }
.griff::after { content: ""; position: absolute; left: 50%; top: 8px; width: 42px; height: 5px; margin-left: -21px; border-radius: 3px; background: var(--rand); }
.kurz { display: flex; gap: 12px; align-items: center; }
.kurzbild img, .kurzbild span { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 34px; background: #e3eed8; }
.kurztext { flex: 1; min-width: 0; }
.kurztext h2, .infokopf h2 { margin: 0; font-size: 21px; }
.kurztext i, .infokopf i { color: var(--grau); }
.dist { color: var(--grau); font-size: 14px; margin-top: 3px; }
.x { font-size: 20px; width: 40px; height: 40px; align-self: flex-start; opacity: .6; }
.aktionen { display: flex; gap: 10px; margin: 14px 0 6px; }
.knopf { flex: 1; border: 1px solid var(--rand); background: var(--karte); color: var(--text); border-radius: 26px; padding: 12px 14px; font-size: 16px; font-weight: 600; }
.knopf.gruen { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.knopf.klein { padding: 8px 12px; font-size: 14px; }
.vorschau img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-top: 8px; }
.infobild { margin: 0 -16px 10px; position: relative; }
.infobild img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.bildquelle { font-size: 11px; color: var(--grau); padding: 4px 16px 0; }
.infokopf { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.infotext { line-height: 1.5; font-size: 16px; }
.textquelle, .hinweisklein { font-size: 12.5px; color: var(--grau); }
.angekommen { background: var(--gruen); color: #fff; margin: 0 -16px 0; padding: 10px 16px; font-weight: 600; font-size: 17px; }
.iucn { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 12px; color: #fff; }
.iucn-LC { background: #4b9a4f; } .iucn-NT { background: #8bab2d; } .iucn-VU { background: #d6a400; }
.iucn-EN { background: #e06a14; } .iucn-CR { background: #c62828; } .iucn-EW, .iucn-EX { background: #444; } .iucn-DD { background: #888; }
h3 { margin: 18px 0 8px; font-size: 16px; }
.nahliste { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nah { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rand); background: var(--karte); color: var(--text); border-radius: 30px; padding: 4px 10px 4px 4px; text-align: left; }
.nah .sym { width: 34px; height: 34px; font-size: 18px; }
.nah span { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nah small { color: var(--grau); }
.reiter { display: flex; gap: 6px; margin: 10px 0 4px; }
.reiter button { border: 1px solid var(--rand); background: none; color: var(--text); border-radius: 18px; padding: 6px 14px; }
.reiter button.an { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.liste { list-style: none; padding: 0; margin: 4px -16px 0; }
.liste small { color: var(--grau); white-space: nowrap; }
.schalter { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-size: 16px; }
.schalter input { width: 22px; height: 22px; accent-color: var(--gruen); }

/* Navigation */
#navbanner { position: fixed; top: calc(8px + var(--oben)); left: 8px; right: 8px; z-index: 1100; background: var(--gruen); color: #fff; border-radius: 16px; box-shadow: var(--schatten); display: flex; align-items: center; gap: 12px; padding: 10px 14px; max-width: 560px; margin: 0 auto; }
#navbanner .pfeil { width: 62px; height: 62px; flex: none; }
#navbanner svg { width: 100%; height: 100%; }
.navdist { font-size: 26px; font-weight: 700; line-height: 1.1; }
.navanw { font-size: 19px; font-weight: 600; }
.navsub { font-size: 14px; opacity: .9; }
#navleiste { position: fixed; left: 8px; right: 8px; bottom: calc(10px + var(--unten)); z-index: 1100; background: var(--karte); border-radius: 16px; box-shadow: var(--schatten); display: flex; align-items: center; gap: 8px; padding: 8px 10px; max-width: 560px; margin: 0 auto; }
.navrest { flex: 1; font-size: 15px; }
.navrest b { font-size: 19px; }
#navleiste button { border: 1px solid var(--rand); background: var(--karte); color: var(--text); border-radius: 20px; padding: 8px 12px; font-size: 15px; white-space: nowrap; }
#navleiste .rot { background: #c62828; color: #fff; border-color: #c62828; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
body.navigiert .leaflet-bottom { bottom: 66px; }
