/* Wohin damit? – Oberfläche (mobil zuerst, hell und dunkel) */
:root {
  --bg: #f4f1ea;
  --flaeche: #fffdf8;
  --flaeche-2: #efebe2;
  --tinte: #1c211e;
  --leise: #5d665f;
  --linie: #e2ddd2;
  --akzent: #1f7a4d;
  --akzent-tinte: #ffffff;
  --akzent-hell: #e1efe6;
  --warn: #9a5b00;
  --warn-hell: #fbefd9;
  --rot: #b3261e;
  --schatten: 0 1px 2px rgba(28, 33, 30, .06), 0 8px 24px rgba(28, 33, 30, .07);
  --rund: 20px;
  --schrift: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111513;
    --flaeche: #1a1f1c;
    --flaeche-2: #232925;
    --tinte: #ecefe9;
    --leise: #a3ada5;
    --linie: #2c332f;
    --akzent: #4cc38a;
    --akzent-tinte: #0b1a12;
    --akzent-hell: #1c3326;
    --warn: #f0b45a;
    --warn-hell: #33281a;
    --rot: #f2867e;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111513; --flaeche: #1a1f1c; --flaeche-2: #232925; --tinte: #ecefe9; --leise: #a3ada5;
  --linie: #2c332f; --akzent: #4cc38a; --akzent-tinte: #0b1a12; --akzent-hell: #1c3326;
  --warn: #f0b45a; --warn-hell: #33281a; --rot: #f2867e; color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: var(--akzent); }
button { font: inherit; color: inherit; cursor: pointer; }

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 96px);
}

/* Kopf */
.kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ort-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 999px;
  padding: 7px 14px 7px 10px; max-width: 100%; text-align: left; min-height: 44px;
}
.ort-chip svg { color: var(--akzent); }
.ort-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ort-text strong { font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ort-text small { color: var(--leise); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status {
  font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: var(--flaeche-2); color: var(--leise);
}
.status.ok { background: var(--akzent-hell); color: var(--akzent); }
.status.laeuft { background: var(--warn-hell); color: var(--warn); }
.status.laeuft::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: puls 1.2s infinite; vertical-align: 1px; }
@keyframes puls { 50% { opacity: .25; } }

/* Start */
.titel { font-size: clamp(34px, 9vw, 44px); line-height: 1.05; letter-spacing: -.02em; margin: 28px 0 6px; font-weight: 750; }
.untertitel { color: var(--leise); margin: 0 0 26px; font-size: 16.5px; max-width: 32ch; }

.kamera {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: min(62vw, 230px); aspect-ratio: 1; margin: 6px auto 30px;
  border-radius: 50%; background: var(--akzent); color: var(--akzent-tinte);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--akzent) 35%, transparent), inset 0 -6px 0 rgba(0, 0, 0, .12);
  cursor: pointer; user-select: none; transition: transform .15s ease;
}
.kamera:active { transform: scale(.96); }
.kamera svg { width: 64px; height: 64px; stroke-width: 1.6; }
.kamera-text { font-weight: 700; font-size: 18px; letter-spacing: .01em; }
.kamera-ring {
  position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--akzent) 35%, transparent);
  animation: ring 2.8s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1.12); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .kamera-ring, .status.laeuft::before { animation: none; } }

.suche {
  display: flex; align-items: center; gap: 10px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px;
  padding: 0 14px; min-height: 54px; box-shadow: var(--schatten);
}
.suche svg { color: var(--leise); }
.suche input {
  flex: 1; border: 0; background: transparent; color: var(--tinte); font: inherit; font-size: 16.5px;
  min-height: 52px; outline: none; min-width: 0;
}
.suche:focus-within { border-color: var(--akzent); }
.treffer {
  list-style: none; margin: 8px 0 0; padding: 6px; background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 16px; box-shadow: var(--schatten);
}
.treffer li button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; background: transparent; padding: 10px; border-radius: 12px; min-height: 48px;
}
.treffer li button:hover, .treffer li button:focus-visible { background: var(--flaeche-2); outline: none; }
.treffer .punkt { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.treffer .t-name { font-weight: 600; }
.treffer .t-ziel { color: var(--leise); font-size: 14px; margin-left: auto; text-align: right; }
.treffer .leer { padding: 12px; color: var(--leise); }

.schnell { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.schnell button {
  border: 1px solid var(--linie); background: transparent; border-radius: 999px;
  padding: 8px 14px; font-size: 14.5px; min-height: 40px; color: var(--tinte);
}
.schnell button:hover { background: var(--flaeche); }

/* Karten */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund);
  padding: 18px; box-shadow: var(--schatten); margin: 14px 0;
}
.hinweis-karte { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.hinweis-karte svg { color: var(--akzent); margin-top: 2px; }
.hinweis-karte p { margin: 0; }
.abschnitt { font-size: 20px; margin: 26px 0 10px; letter-spacing: -.01em; }
.leer { color: var(--leise); }
.kleingedruckt { color: var(--leise); font-size: 13px; margin-top: 28px; }

/* Ergebnis */
.zurueck {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent;
  color: var(--leise); padding: 8px 6px 8px 0; margin: 14px 0 4px; min-height: 44px;
}
.ergebnis {
  border-radius: 26px; overflow: hidden; background: var(--flaeche);
  border: 1px solid var(--linie); box-shadow: var(--schatten); margin-bottom: 14px;
}
.ergebnis-kopf {
  --farbe: #3f4448;
  display: flex; align-items: center; gap: 18px; padding: 22px 20px;
  background: color-mix(in srgb, var(--farbe) 14%, var(--flaeche));
  border-bottom: 1px solid color-mix(in srgb, var(--farbe) 25%, var(--linie));
}
.tonne { width: 72px; height: 84px; flex: none; }
.tonne svg { width: 100%; height: 100%; stroke: none; }
.ergebnis-kopf .was { color: var(--leise); font-size: 14.5px; margin: 0 0 2px; }
.ergebnis-kopf .wohin { font-size: 27px; line-height: 1.12; font-weight: 750; margin: 0; letter-spacing: -.015em; }
.ergebnis-koerper { padding: 16px 20px 20px; }
.ergebnis-koerper p { margin: 0 0 10px; }
.region-hinweis {
  background: var(--akzent-hell); border-radius: 14px; padding: 12px 14px; font-size: 15px; margin: 6px 0 12px;
}
.region-hinweis a { font-size: 13.5px; }
.allgemein-hinweis { font-size: 13.5px; color: var(--leise); }
.teile { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--linie); }
.teile li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: 15px; }
.teile .punkt { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.teile .ziel { margin-left: auto; color: var(--leise); text-align: right; }
.sicherheit { font-size: 13px; color: var(--warn); }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 18px; min-height: 48px;
  background: var(--akzent); color: var(--akzent-tinte); font-weight: 650; text-decoration: none; font-size: 15.5px;
}
.knopf.zweit { background: var(--flaeche-2); color: var(--tinte); }
.knopf.klein { min-height: 40px; padding: 8px 14px; font-size: 14.5px; }
.knopf.voll { width: 100%; }
.textknopf { border: 0; background: transparent; color: var(--leise); text-decoration: underline; padding: 8px 0; font-size: 14px; }

/* Höfe */
.hof { display: grid; gap: 4px; }
.hof h3 { margin: 0; font-size: 17px; }
.hof .adr { color: var(--leise); font-size: 14.5px; }
.hof .zustand { font-size: 14.5px; font-weight: 600; }
.hof .zustand.offen { color: var(--akzent); }
.hof .zustand.zu { color: var(--leise); }
.hof .zeiten { font-size: 13.5px; color: var(--leise); white-space: pre-line; }
.hof .marken { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.marke { font-size: 12.5px; background: var(--flaeche-2); border-radius: 999px; padding: 3px 9px; color: var(--leise); }
.hof .zeile { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.entfernung { font-size: 13.5px; color: var(--leise); }

/* Region */
.region-zeile { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: 15px; }
.region-zeile:last-child { border-bottom: 0; }
.region-zeile span:first-child { color: var(--leise); }
.region-zeile span:last-child { text-align: right; font-weight: 600; }
.quelle { font-size: 13px; color: var(--leise); word-break: break-word; }

/* Laden */
.laden {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px);
}
.laden-box { background: var(--flaeche); border-radius: 22px; padding: 26px 30px; text-align: center; box-shadow: var(--schatten); max-width: 280px; }
.laden-box p { margin: 14px 0 0; font-weight: 600; }
.kreisel { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--akzent-hell); border-top-color: var(--akzent); animation: dreh .9s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

.fehler { background: color-mix(in srgb, var(--rot) 12%, var(--flaeche)); border-color: color-mix(in srgb, var(--rot) 30%, var(--linie)); }

/* Leiste */
.leiste {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 12px);
  display: flex; gap: 4px; padding: 6px; z-index: 20;
  background: color-mix(in srgb, var(--flaeche) 88%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--linie); border-radius: 22px; box-shadow: var(--schatten);
  width: min(calc(100% - 32px), 380px);
}
.leiste button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: transparent; border-radius: 16px; padding: 7px 4px; font-size: 12.5px; color: var(--leise); min-height: 52px;
}
.leiste button.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 650; }

/* Termine */
.abholung { padding: 14px 18px; }
.abholung-titel { margin: 0 0 6px; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); }
.abholung-zeile { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15.5px; }
.abholung-zeile .a-wann { min-width: 92px; color: var(--leise); }
.abholung-zeile .a-was { font-weight: 600; }
.abholung-zeile.bald .a-wann { color: var(--akzent); font-weight: 700; }
.abholung-leer { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 0; }
.abholung-leer svg { color: var(--akzent); margin-top: 2px; }
.abholung-leer span { display: grid; gap: 2px; }
.abholung-leer small { color: var(--leise); font-size: 14px; }
.punkt { display: inline-block; width: 12px; height: 12px; border-radius: 4px; flex: none; }
.naechste { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; background: var(--flaeche-2); border-radius: 12px; font-size: 15px; }
.monat { font-size: 15px; margin: 22px 0 6px; color: var(--leise); font-weight: 650; }
.termine-liste { padding: 6px 18px; margin-top: 0; }
.termin { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linie); font-size: 15px; }
.termin:last-child { border-bottom: 0; }
.termin .t-tag { min-width: 92px; color: var(--leise); }
.termin .t-was { font-weight: 600; }
.termin small { font-weight: 400; color: var(--leise); }
.schalter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; margin: 6px 0 4px; }
.schalter input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--akzent); }
.schalter select { font: inherit; color: var(--tinte); background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: 10px; padding: 6px 8px; min-height: 40px; }
.schnell .wahl { display: inline-flex; align-items: center; gap: 8px; opacity: .55; }
.schnell .wahl.an { opacity: 1; border-color: var(--akzent); background: var(--akzent-hell); }
.klein-feld { box-shadow: none; margin: 10px 0 4px; }
.klein-feld input { padding-left: 2px; }
.karte > p:first-child { margin-top: 0; }

.zusatz { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.zusatz .knopf svg { width: 20px; height: 20px; }
.produkt-kopf { padding: 18px 20px; border-bottom: 1px solid var(--linie); }
.produkt-kopf .was { margin: 0; color: var(--leise); font-size: 14px; }
.produkt-kopf .wohin { margin: 2px 0 0; font-size: 22px; font-weight: 750; }
.teile .ziel strong { color: var(--tinte); }
.produkt-kopf + .ergebnis-koerper .teile:first-child, .region-hinweis + .teile { margin-top: 0; }
.produkt-kopf + .ergebnis-koerper .teile:first-child { border-top: 0; }

.update-hinweis { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; padding: 12px 14px;
  background: var(--akzent-hell); border: 1px solid color-mix(in srgb, var(--akzent) 30%, var(--linie)); border-radius: 16px; font-size: 15px; }
.update-hinweis span { flex: 1 1 180px; }
