/* =====================================================================
   Gemeinsames Aussehen v2 – Entwurf 22.10.2026, nach den 28 Regeln (~/audit/designsystem_checkliste_28.md)
   Einbinden: <html lang="de"> · <meta name="color-scheme" content="only light"> · <link rel="stylesheet" href="tokens.css">
              <body data-app="garten|coaching|lager|appmanager|mieterportal">
   Schrift: Systemschrift (keine Webschrift). Symbole: Lucide (ISC-Lizenz), lokal als SVG in symbole/, Farbe = currentColor.
   IMMER HELL (Tobias' Entscheidung): keine Regeln für prefers-color-scheme: dark.
   ALLE Farbwerte stehen nur in dieser Datei (Regel 1).
   ===================================================================== */
:root {
  color-scheme: only light;
  /* Grau (alle Apps) */
  --grund: #f3f6f8; --flaeche: #ffffff; --text: #17232b; --leise: #4b5862; --linie: #d5dee4; --feldrand: #6b7883; --dunkel: #1f2a33;
  /* Bedeutung (alle Apps): Rot nur Fehler/Löschen, Grün Erfolg, Gelb/Orange Warnung */
  --erfolg: #15803d; --erfolg-text: #14532d; --erfolg-hell: #e5f4ea;
  --warnung: #b45309; --warnung-text: #7a4100; --warnung-hell: #fff3d6;
  --fehler: #b42318; --fehler-text: #8a1c12; --fehler-hell: #fdecea;
  --aus-grund: #e4e9ed; --aus-text: #46525b;
  --gelb: #ffd84d; --gelb-text: #2b2100;
  --weiss: #ffffff;
  /* Plan (Garten) */
  --plan-rasen: #e3f3e7; --plan-beet: #f2e2cf; --plan-beet-text: #5a3410; --plan-wasser: #d6ecfb; --plan-wasser-text: #0b4166;
  --plan-raster: #c9dccd; --punkt: #c2410c; --auswahl: #1d5fa8;
  /* Akzent je App (Standard Garten) */
  --akzent: #1f7a3a; --akzent-dunkel: #145a2a; --akzent-hell: #e3f3e7;

  /* Schrift: genau 5 Größen, 2 Stärken */
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "DejaVu Sans", sans-serif;
  --gr-1: 0.875rem; /* 14 px: Unterzeilen, Leiste */
  --gr-2: 1rem;     /* 16 px: Fließtext, Knöpfe */
  --gr-3: 1.125rem; /* 18 px: Abschnitt */
  --gr-4: 1.375rem; /* 22 px: Seitentitel */
  --gr-5: 1.75rem;  /* 28 px: Datum auf „Heute“ */
  --normal: 400; --fett: 700;
  /* Abstände 4/8/12/16/24/32, EIN Eckenradius */
  --a1: 4px; --a2: 8px; --a3: 12px; --a4: 16px; --a5: 24px; --a6: 32px;
  --r: 12px;
  --tipp: 44px; --zeile-h: 56px; --kopf-h: 56px; --leiste-h: 64px; --plus-h: 56px;
  --unten-frei: calc(var(--leiste-h) + var(--plus-h) + var(--a2) + var(--a2) + var(--a4) + env(safe-area-inset-bottom));
}
[data-app="garten"]       { --akzent: #1f7a3a; --akzent-dunkel: #145a2a; --akzent-hell: #e3f3e7; }
[data-app="coaching"]     { --akzent: #c2410c; --akzent-dunkel: #8a2e06; --akzent-hell: #fdebdd; }
[data-app="lager"]        { --akzent: #1d5fa8; --akzent-dunkel: #154a84; --akzent-hell: #e2eefa; }
[data-app="appmanager"]   { --akzent: #3e4a56; --akzent-dunkel: #2a333c; --akzent-hell: #e6eaee; }
[data-app="mieterportal"] { --akzent: #0b6e6b; --akzent-dunkel: #08514f; --akzent-hell: #ddf1f0; }

/* ---------- Grundform ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font: var(--normal) var(--gr-2)/1.5 var(--schrift); overflow-wrap: break-word; }
h1 { font-size: var(--gr-4); line-height: 1.25; font-weight: var(--fett); margin: var(--a2) 0 var(--a1); }
h2 { font-size: var(--gr-3); line-height: 1.3; font-weight: var(--fett); margin: var(--a5) 0 var(--a2); }
p { margin: 0 0 var(--a3); }
b, strong { font-weight: var(--fett); }
small, .leise { font-size: var(--gr-1); color: var(--leise); }
a { color: var(--akzent-dunkel); font-weight: var(--fett); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--auswahl); outline-offset: 2px; }   /* Fokusrahmen nie entfernen */
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Silbentrennung für Karten und Listen, NICHT für Knöpfe */
.karte, .liste, main p, h1, h2 { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 6 3 2; }
button, .knopf, .chip, .leiste a { hyphens: manual; -webkit-hyphens: manual; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Symbole */
.sy { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; vertical-align: middle; }
.sy.k { width: 20px; height: 20px; } .sy.g { width: 28px; height: 28px; }

main { max-width: 560px; margin: 0 auto; padding: var(--a3) var(--a4) calc(var(--leiste-h) + var(--a5) + env(safe-area-inset-bottom)); }
body.mit-plus main { padding-bottom: var(--unten-frei); }   /* Platz für den Plus-Knopf: nichts wird verdeckt */

/* ---------- Kopfleiste: Name, Speicherstatus (feste Stelle), Idee-Knopf ---------- */
.kopf { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--a2); min-height: var(--kopf-h); padding: var(--a1) var(--a2) var(--a1) var(--a4); background: var(--akzent); color: var(--weiss); }
.kopf .marke { display: flex; align-items: center; gap: var(--a2); font-weight: var(--fett); font-size: var(--gr-3); }
.kopf .status { margin-left: auto; display: flex; align-items: center; gap: var(--a1); font-size: var(--gr-1); color: var(--weiss); }
.kopf .idee { flex: none; width: var(--tipp); height: var(--tipp); display: grid; place-items: center; border: 2px solid var(--gelb); border-radius: var(--r); background: var(--gelb); color: var(--gelb-text); padding: 0; }
.kopf .marke + .idee { margin-left: auto; }
/* Offline: dauerhafter Hinweis unter der Kopfleiste */
.offline { position: sticky; top: var(--kopf-h); z-index: 9; display: flex; align-items: center; gap: var(--a2); padding: var(--a2) var(--a4); background: var(--warnung-hell); color: var(--warnung-text); font-size: var(--gr-1); font-weight: var(--fett); border-bottom: 2px solid var(--warnung); }

/* ---------- „Heute“ ---------- */
.heute-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--a2); margin: var(--a2) 0 var(--a3); }
.heute-kopf .datum { font-size: var(--gr-5); font-weight: var(--fett); line-height: 1.15; }
.tipp { display: flex; gap: var(--a3); align-items: flex-start; padding: var(--a3) var(--a4); margin-bottom: var(--a3); background: var(--akzent-hell); color: var(--text); border-radius: var(--r); }
.tipp .sy { color: var(--akzent-dunkel); }

/* ---------- Knöpfe ---------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: var(--a2); min-height: 48px; min-width: var(--tipp); padding: 0 var(--a4);
  border-radius: var(--r); border: 2px solid var(--feldrand); background: var(--flaeche); color: var(--text); font-weight: var(--fett); font-size: var(--gr-2); text-decoration: none; cursor: pointer; }
.knopf:active { transform: translateY(1px); background: var(--aus-grund); }       /* sichtbarer Gedrückt-Zustand */
.knopf.breit { display: flex; width: 100%; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--weiss); }
.knopf.haupt:active { background: var(--akzent-dunkel); }
.knopf.neben { border-color: var(--akzent); color: var(--akzent-dunkel); }
.knopf.gefahr { border-color: var(--fehler); color: var(--fehler-text); }
.knopf.symbol { padding: 0; width: 48px; }
.knopf:disabled, .knopf[aria-disabled="true"] { background: var(--aus-grund); color: var(--aus-text); border: 2px dashed var(--feldrand); cursor: not-allowed; transform: none; }
.knopf-grund { display: block; margin-top: var(--a1); font-size: var(--gr-1); color: var(--leise); }
.reihe-knoepfe { display: flex; gap: var(--a2); flex-wrap: wrap; }
/* Aktionen auf „Heute“: einheitlich, nur die wichtigste farbig */
.aktionen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--a2); }
.aktion { min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--a1); padding: var(--a2) var(--a1);
  border: 2px solid var(--linie); border-radius: var(--r); background: var(--flaeche); color: var(--text); font-weight: var(--fett); font-size: var(--gr-1); text-align: center; }
.aktion .sy { color: var(--akzent-dunkel); }
.aktion.haupt { background: var(--akzent); border-color: var(--akzent); color: var(--weiss); } .aktion.haupt .sy { color: var(--weiss); }
.aktion:active { background: var(--aus-grund); }

/* ---------- Chips: zuletzt / Wie gestern ---------- */
.chips { display: flex; gap: var(--a2); flex-wrap: wrap; margin: var(--a2) 0 var(--a3); }
.chip { display: inline-flex; align-items: center; gap: var(--a1); min-height: var(--tipp); padding: 0 var(--a3); border: 2px solid var(--linie); border-radius: var(--r);
  background: var(--flaeche); color: var(--text); font-size: var(--gr-1); font-weight: var(--fett); }
.chip.gestern { border-color: var(--akzent); color: var(--akzent-dunkel); }

/* ---------- Felder ---------- */
.feld { display: block; margin-bottom: var(--a4); }
.feld > .name { display: block; font-weight: var(--fett); margin-bottom: var(--a1); }
.feld input, .feld select { display: block; width: 100%; min-height: 48px; padding: var(--a2) var(--a3); border: 2px solid var(--feldrand); border-radius: var(--r); background: var(--flaeche); color: var(--text); font-size: var(--gr-2); }
.feld input:focus { outline: 3px solid var(--auswahl); outline-offset: 1px; }
.feld .hilfe { display: block; margin-top: var(--a1); font-size: var(--gr-1); color: var(--leise); }
.feld.falsch input { border-color: var(--fehler); background: var(--fehler-hell); }
.feld.falsch .hilfe { display: flex; gap: var(--a1); align-items: flex-start; color: var(--fehler-text); font-weight: var(--fett); }
.einheit { position: relative; display: block; } .einheit input { padding-right: 56px; }
.einheit .e { position: absolute; right: var(--a3); top: 50%; transform: translateY(-50%); color: var(--leise); font-weight: var(--fett); }
details.mehr-angaben > summary { min-height: var(--tipp); display: flex; align-items: center; gap: var(--a2); font-weight: var(--fett); color: var(--akzent-dunkel); cursor: pointer; }

/* ---------- Karten und Listen ---------- */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: var(--a4); margin-bottom: var(--a2); }
.aufgabe { display: flex; gap: var(--a3); align-items: center; }
.aufgabe .mitte { flex: 1; min-width: 0; } .aufgabe .mitte b { display: block; } .aufgabe .mitte small { display: block; }
.liste { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; }
.liste > li + li { border-top: 1px solid var(--linie); }
.zeile { display: flex; align-items: center; gap: var(--a3); min-height: var(--zeile-h); padding: var(--a2) var(--a4); color: var(--text); text-decoration: none; font-weight: var(--normal); background: var(--flaeche); width: 100%; border: 0; text-align: left; }
.zeile:active { background: var(--aus-grund); }
.zeile .rund { flex: none; width: 40px; height: 40px; border-radius: var(--r); background: var(--akzent-hell); color: var(--akzent-dunkel); display: grid; place-items: center; }
.zeile .mitte { flex: 1; min-width: 0; } .zeile .mitte b { display: block; } .zeile .mitte small { display: block; }
.zeile .rechts { flex: none; text-align: right; font-weight: var(--fett); } .zeile > .sy:last-child { color: var(--leise); }
.haken { flex: none; width: var(--tipp); height: var(--tipp); display: grid; place-items: center; border: 2px solid var(--akzent); border-radius: var(--r); background: var(--flaeche); color: var(--akzent-dunkel); padding: 0; }
.marke-k { display: inline-flex; align-items: center; gap: var(--a1); padding: 0 var(--a2); border-radius: var(--r); font-size: var(--gr-1); font-weight: var(--fett); background: var(--aus-grund); color: var(--text); }
.marke-k.warn { background: var(--warnung-hell); color: var(--warnung-text); } .marke-k.gut { background: var(--erfolg-hell); color: var(--erfolg-text); }
.marke-k.wartet { background: var(--warnung-hell); color: var(--warnung-text); }
.abschnitt { display: flex; align-items: center; justify-content: space-between; gap: var(--a2); }
.abschnitt a { display: inline-flex; align-items: center; justify-content: flex-end; min-height: var(--tipp); min-width: var(--tipp); padding-left: var(--a2); font-size: var(--gr-1); }
.fortschritt { height: 8px; border-radius: var(--r); background: var(--aus-grund); overflow: hidden; margin-top: var(--a1); }
.fortschritt > i { display: block; height: 100%; background: var(--akzent); }
/* Lade-Platzhalter statt „Keine Einträge“ */
.platzhalter { height: var(--zeile-h); border-radius: var(--r); background: linear-gradient(90deg, var(--aus-grund) 0 40%, var(--grund) 50%, var(--aus-grund) 60% 100%); background-size: 300% 100%; margin-bottom: var(--a2); animation: laden 1.4s infinite linear; }
@keyframes laden { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* Kachelraster – NUR im App-Manager */
.app-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--a2); }
.app-raster a { position: relative; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--a1); border-radius: var(--r); background: var(--flaeche); border: 1px solid var(--linie); color: var(--text); text-decoration: none; font-size: var(--gr-1); }
.abzeichen { position: absolute; top: var(--a1); right: var(--a1); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--fehler); color: var(--weiss); font-size: var(--gr-1); font-weight: var(--fett); line-height: 22px; text-align: center; }

/* ---------- Untere Leiste: 3–5 Ziele, „Heute“ links, „Profil“ rechts, kein „Mehr“ ---------- */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 2px; min-height: var(--leiste-h);
  padding: var(--a1) var(--a1) calc(var(--a1) + env(safe-area-inset-bottom)); background: var(--flaeche); border-top: 1px solid var(--linie); }
.leiste a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px;
  border-radius: var(--r); color: var(--leise); font-size: var(--gr-1); font-weight: var(--normal); text-decoration: none; }
.leiste a.an { background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: var(--fett); }
.leiste a .abzeichen { right: 18%; }

/* ---------- Plus-Knopf: einer, nur „Hinzufügen“, 16 px vom Rand, über der Leiste ---------- */
.plus { position: fixed; right: var(--a4); bottom: calc(var(--leiste-h) + var(--a4) + env(safe-area-inset-bottom)); z-index: 11; min-height: var(--plus-h); padding: 0 var(--a4) 0 var(--a3);
  display: inline-flex; align-items: center; gap: var(--a2); border: 0; border-radius: var(--r); background: var(--akzent); color: var(--weiss); font-weight: var(--fett); font-size: var(--gr-2); }
/* Plus-Streifen (seit 23.10.): der Knopf sitzt in einem festen, deckenden Streifen über der Leiste. Inhalt läuft UNTER den Streifen
   (wie unter die Leiste) und nie unter den Knopf – so verdeckt er an keiner Scrollposition eine Karte, Zeile oder einen Knopf. */
.plus-streifen { position: fixed; left: 0; right: 0; bottom: calc(var(--leiste-h) + env(safe-area-inset-bottom)); z-index: 11; display: flex; justify-content: flex-end;
  padding: var(--a2) var(--a4); background: var(--grund); }
.plus-streifen .plus { position: static; }

/* ---------- Meldungen ---------- */
.meldung { display: flex; gap: var(--a3); align-items: flex-start; padding: var(--a3) var(--a4); border-radius: var(--r); border-left: 6px solid; margin-bottom: var(--a3); }
.meldung b { display: block; } .meldung p { margin: 2px 0 0; }
.meldung.erfolg { background: var(--erfolg-hell); border-color: var(--erfolg); color: var(--erfolg-text); }
.meldung.warnung { background: var(--warnung-hell); border-color: var(--warnung); color: var(--warnung-text); }
.meldung.fehler { background: var(--fehler-hell); border-color: var(--fehler); color: var(--fehler-text); }
.meldung a { color: inherit; }
/* Rückgängig statt Nachfrage */
.rueck { display: flex; align-items: center; justify-content: space-between; gap: var(--a3); padding: var(--a2) var(--a2) var(--a2) var(--a4); background: var(--dunkel); color: var(--weiss); border-radius: var(--r); }
.rueck button { flex: none; min-height: var(--tipp); display: inline-flex; align-items: center; gap: var(--a1); padding: 0 var(--a3); border: 0; border-radius: var(--r); background: var(--gelb); color: var(--gelb-text); font-weight: var(--fett); }
/* Leerer Zustand: ein Satz + Knopf */
.leer { text-align: center; padding: var(--a5) var(--a4); background: var(--flaeche); border: 2px dashed var(--linie); border-radius: var(--r); }
.leer > .sy { color: var(--akzent-dunkel); width: 40px; height: 40px; }

/* ---------- Profil (Einstellungen, Seltenes) ---------- */
.protokoll { margin-top: var(--a5); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 0 var(--a4); }
.protokoll summary { min-height: var(--zeile-h); display: flex; align-items: center; gap: var(--a2); font-weight: var(--fett); cursor: pointer; list-style: none; }
.protokoll summary::-webkit-details-marker { display: none; }
.protokoll summary .sy:last-child { margin-left: auto; color: var(--leise); }
.protokoll ul { list-style: none; padding: 0; margin: 0 0 var(--a2); } .protokoll li { display: flex; gap: var(--a3); padding: var(--a2) 0; border-top: 1px solid var(--linie); }
.protokoll .wann { flex: none; min-width: 72px; font-weight: var(--fett); color: var(--akzent-dunkel); }

/* ---------- Plan (Garten) ---------- */
.umschalter { display: inline-flex; border: 2px solid var(--akzent); border-radius: var(--r); overflow: hidden; margin: var(--a2) 0 var(--a3); }
.umschalter a { min-height: var(--tipp); min-width: 88px; display: inline-flex; align-items: center; justify-content: center; gap: var(--a1); padding: 0 var(--a3); text-decoration: none; color: var(--akzent-dunkel); }
.umschalter a.an { background: var(--akzent); color: var(--weiss); }
.plan { position: relative; container-type: inline-size; background: var(--plan-rasen); border: 1px solid var(--linie); border-radius: var(--r); overflow: hidden; }
.plan.raster { background-image: linear-gradient(var(--plan-raster) 1px, transparent 1px), linear-gradient(90deg, var(--plan-raster) 1px, transparent 1px); background-size: 6.25cqw 6.25cqw; }
.pf { position: absolute; display: flex; flex-direction: column; justify-content: flex-start; padding: 1.5cqw; border-radius: var(--r); background: var(--plan-beet); color: var(--plan-beet-text); border: 1px solid var(--plan-beet-text);
  font-size: var(--gr-1); font-weight: var(--fett); line-height: 1.2; text-decoration: none; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 6 3 2; }
.pf.wasser { background: var(--plan-wasser); color: var(--plan-wasser-text); border-color: var(--plan-wasser-text); }
.pf.gewaehlt { outline: 3px solid var(--auswahl); outline-offset: 3px; }
.ppunkt { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--punkt); color: var(--weiss); border: 2px solid var(--weiss);
  display: grid; place-items: center; font-size: var(--gr-1); font-weight: var(--fett); }
.nummer { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--punkt); color: var(--weiss); display: grid; place-items: center; font-size: var(--gr-1); font-weight: var(--fett); }
/* Bearbeiten-Modus */
.bearbeiten-streifen { display: flex; align-items: center; gap: var(--a2); padding: var(--a2) var(--a4); margin: calc(-1 * var(--a3)) calc(-1 * var(--a4)) var(--a3); background: var(--gelb); color: var(--gelb-text); font-weight: var(--fett); }
.steuer { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: var(--a1); }
.steuer .knopf { min-height: 48px; }
.zahlen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a2); }
.zahlen .feld { margin-bottom: var(--a2); }
.fuss-aktionen { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: var(--a2); padding: var(--a2) var(--a4) calc(var(--a2) + env(safe-area-inset-bottom)); background: var(--flaeche); border-top: 1px solid var(--linie); }
.fuss-aktionen .knopf { flex: 1; }
