/* Schleichwege Berlin: Karte im Zentrum, Liste links (breit) oder als eigene Ansicht (schmal),
   Details als Seitenleiste (breit) oder Blatt von unten (schmal). Systemschriften, keine fremden Server. */
:root {
  --bg: #f3f4ee;
  --surface: #ffffff;
  --surface-2: #eceee5;
  --fg: #1d2419;
  --muted: #5f6b58;
  --line: #d9ddd0;
  --soil: #b8661f;          /* Akzent: ausgetretener Boden */
  --soil-ink: #ffffff;
  --offen: #d9a21b;
  --gruen: #2f7d3b;
  --rot: #b3342b;
  --mark: #ff3dbb;
  --schatten: 0 6px 24px rgba(20, 28, 16, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-zahl: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --kopf-h: 56px;
  --filter-h: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141811; --surface: #1d2219; --surface-2: #252b20; --fg: #e8ecdf; --muted: #9aa58f; --line: #333b2c;
  --soil: #e08a3c; --soil-ink: #1a1208; --offen: #e0b43c; --gruen: #5cbf69; --rot: #e9675d; --mark: #ff5fcb;
  --schatten: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #141811; --surface: #1d2219; --surface-2: #252b20; --fg: #e8ecdf; --muted: #9aa58f; --line: #333b2c;
  --soil: #e08a3c; --soil-ink: #1a1208; --offen: #e0b43c; --gruen: #5cbf69; --rot: #e9675d; --mark: #ff5fcb;
  --schatten: 0 6px 24px rgba(0, 0, 0, .5);
  color-scheme: dark }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); overflow: hidden; }
button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--soil); outline-offset: 2px; }

/* Kopf */
.kopf { height: var(--kopf-h); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  padding-top: env(safe-area-inset-top); background: var(--surface); border-bottom: 1px solid var(--line); }
.marke { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.marke > div { min-width: 0; }
.logo { width: 30px; height: 30px; flex: none; }
.logo-weg { fill: none; stroke: var(--muted); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.logo-pfad { fill: none; stroke: var(--soil); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 4 3; }
h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unterzeile { margin: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ansicht { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.ansicht button { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font-size: 14px; }
.ansicht button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.knopf-rund { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  font-weight: 700; flex: none; }

/* Filter */
.filter { height: var(--filter-h); display: flex; align-items: center; gap: 8px; padding: 0 16px; overflow-x: auto;
  background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px;
  font-size: 13.5px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--soil); border-color: var(--soil); color: var(--soil-ink); font-weight: 600; }
.filter select { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 5px 10px; font-size: 13.5px; max-width: 220px; }

/* Hauptbereich */
.haupt { position: relative; height: calc(100% - var(--kopf-h) - var(--filter-h) - env(safe-area-inset-top)); }
#karte { position: absolute; inset: 0; z-index: 0; background: var(--surface-2); }
.leaflet-container { font: inherit; }
.leaflet-control-layers, .leaflet-bar a { background: var(--surface); color: var(--fg); }
.leaflet-control-attribution { font-size: 10.5px; }

.melden-knopf { position: absolute; z-index: 500; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 999px; padding: 11px 20px;
  background: var(--soil); color: var(--soil-ink); font-weight: 650; box-shadow: var(--schatten); }
.melde-hinweis { position: absolute; z-index: 600; top: 12px; left: 50%; transform: translateX(-50%); width: max-content;
  max-width: calc(100% - 32px); background: var(--fg); color: var(--bg); padding: 9px 14px; border-radius: 12px;
  box-shadow: var(--schatten); font-size: 14px; }
.melde-hinweis button { margin-left: 8px; border: 0; background: none; color: inherit; text-decoration: underline; }
.haupt.meldet #karte { cursor: crosshair; }
.haupt.meldet .melden-knopf { display: none; }

/* Liste */
.liste { position: absolute; inset: 0; z-index: 700; background: var(--bg); display: none; flex-direction: column; }
.haupt[data-ansicht="liste"] .liste { display: flex; }
.haupt[data-ansicht="liste"] .melden-knopf { display: none; }
.liste-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.liste-kopf select { margin-left: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 6px; }
.export { display: flex; gap: 6px; }
.knopf { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: 13.5px; }
.knopf.voll { background: var(--soil); border-color: var(--soil); color: var(--soil-ink); font-weight: 650; }
#listeInhalt { list-style: none; margin: 0; padding: 8px 16px 90px; overflow-y: auto; flex: 1; }
.eintrag { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; width: 100%;
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px;
  margin-bottom: 8px; }
.eintrag img, .eintrag .ohne-bild { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.eintrag .ohne-bild { display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; }
.eintrag b { display: block; font-size: 14.5px; }
.eintrag small { display: block; color: var(--muted); font-size: 12.5px; }
.eintrag .wunsch { display: inline-block; margin-top: 3px; font-size: 12.5px; font-weight: 650; color: var(--gruen);
  background: color-mix(in srgb, var(--gruen) 12%, transparent); border-radius: 999px; padding: 1px 8px; }
.eintrag .wunsch + .meine { margin-left: 4px; }
.eintrag .meine { display: inline-block; margin-top: 3px; font-size: 12.5px; font-weight: 650; border-radius: 999px;
  padding: 1px 8px; color: #fff; background: #5f6b58; }
.eintrag .meine.ausbauen { background: #2f7d3b; }
.eintrag .meine.lieber_nicht { background: #b3342b; }
.leer { color: var(--muted); padding: 24px 0; text-align: center; }
.liste-fuss { display: flex; justify-content: center; gap: 18px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); font-size: 12.5px; }
.liste-fuss a { color: var(--muted); }

/* Detail */
.detail { position: absolute; z-index: 800; left: 0; right: 0; bottom: 0; max-height: 78%; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--schatten);
  padding-bottom: env(safe-area-inset-bottom); }
.detail[hidden] { display: none; }
.detail-griff { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
/* klebt beim Scrollen oben rechts im Blatt; der negative Rand lässt das Luftbild darunter beginnen */
.schliessen { position: sticky; z-index: 3; top: 10px; display: block; margin: 10px 10px -44px auto;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff;
  font-size: 24px; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.luftbild { position: relative; margin: 8px 16px 0; aspect-ratio: 4 / 3; border-radius: 12px;
  overflow: hidden; background: var(--surface-2); }
.luftbild[hidden] { display: none; }
.luftbild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.luftbild svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.luftbild figcaption { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; align-items: end; }
.jahreszeit { display: flex; background: rgba(0,0,0,.55); border-radius: 999px; padding: 2px; }
.jahreszeit button { border: 0; background: none; color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; }
.jahreszeit button[aria-pressed="true"] { background: #fff; color: #1d2419; font-weight: 600; }
.massstab { color: #fff; font-size: 11.5px; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; align-items: end; }
.massstab i { display: block; height: 5px; border: 2px solid #fff; border-top: 0; box-shadow: 0 1px 2px #000; }
.detail-text { padding: 12px 16px 18px; }
.detail-ort { margin: 0; color: var(--muted); font-size: 13px; }
.detail h2 { margin: 2px 0 10px; font-size: 19px; letter-spacing: -.01em; }
.werte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 10px; }
.werte div { background: var(--surface-2); border-radius: 10px; padding: 7px 10px; }
.werte dt { font-size: 11.5px; color: var(--muted); }
.werte dd { margin: 0; font-family: var(--font-zahl); font-size: 15px; }
.status { margin: 0 0 12px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--offen); }
.status.bestaetigt::before { background: var(--soil); }
.frage { margin: 0 0 8px; font-weight: 650; }
.stimmen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stimmen button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13.5px; }
.stimmen button b { font-family: var(--font-zahl); font-size: 17px; }
.stimmen button i { font-style: normal; font-size: 11.5px; font-weight: 650; min-height: 1.3em; }
/* eigene Stimme: voll gefüllt, damit man sie auf einen Blick sieht */
.stimmen button[aria-pressed="true"] { border-width: 2px; font-weight: 650; color: #fff; }
.stimmen button[data-wahl="ausbauen"][aria-pressed="true"] { border-color: var(--gruen); background: #2f7d3b; }
.stimmen button[data-wahl="lieber_nicht"][aria-pressed="true"] { border-color: var(--rot); background: #b3342b; }
.stimmen button[data-wahl="kein_weg"][aria-pressed="true"] { border-color: var(--muted); background: #5f6b58; }
.detail-links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13.5px; }
.detail-links a, .link { color: var(--soil); border: 0; background: none; padding: 0; text-decoration: underline; }

.modus-hinweis { position: fixed; z-index: 900; left: 50%; transform: translateX(-50%); top: calc(var(--kopf-h) + var(--filter-h) + 8px);
  margin: 0; width: max-content; max-width: calc(100% - 32px); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; font-size: 12.5px; color: var(--muted); box-shadow: var(--schatten); }

/* Kartenmarker */
.leaflet-tooltip.weg-tip { font: 12.5px/1.3 var(--font); }
.meldung-popup .leaflet-popup-content-wrapper, .meldung-popup .leaflet-popup-tip { background: var(--surface); color: var(--fg); }
.meldung-popup .leaflet-popup-content { margin: 12px 30px 12px 14px; font: 13.5px/1.4 var(--font); }
.meldung-info p { margin: 4px 0 0; }
.meldung-entfernen { font-size: 12px; color: var(--muted); }
.meldung-info a { color: var(--soil); }

/* Dialoge */
dialog { border: 0; border-radius: 16px; padding: 20px; max-width: min(460px, calc(100% - 32px));
  background: var(--surface); color: var(--fg); box-shadow: var(--schatten); }
dialog::backdrop { background: rgba(10, 14, 8, .45); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
dialog p { margin: 0 0 10px; }
dialog .klein { font-size: 12.5px; color: var(--muted); }
dialog a { color: var(--soil); }
dialog .dialog-fuss { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.hinweis-oeffentlich { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--bg); resize: vertical; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 419px) { .zusatz, .breit { display: none; } }

/* Breite Bildschirme: Liste links fest, Details rechts */
@media (min-width: 900px) {
  .ansicht { display: none; }
  .liste { display: flex; right: auto; width: 380px; border-right: 1px solid var(--line); z-index: 600; }
  #karte { left: 380px; }
  .melden-knopf { left: calc(50% + 190px); }
  .melde-hinweis { left: calc(50% + 190px); }
  .detail { left: auto; right: 16px; top: 16px; bottom: 16px; width: 380px; max-height: none; border-radius: 16px; }
  .detail-griff { display: none; }
  .luftbild { aspect-ratio: 1; }
  .modus-hinweis { left: calc(50% + 190px); }
}
