:root {
  --gruen: #1F4D3A;
  --gruen-dunkel: #163828;
  --limette: #C9E265;
  --grund: #F3F6EF;
  --flaeche: #FFFFFF;
  --zart: #E6EDE1;
  --linie: #D5DECF;
  --text: #18231D;
  --leise: #55645A;
  --hell: #DDE8DF;
  --warn-grund: #FFE3C2;
  --warn-text: #7A3300;
  --orange: #D9630B;
  --fehler-grund: #FFD9D2;
  --fehler-text: #8A1C00;
  --kopf: 'Bricolage Grotesque', system-ui, sans-serif;
  --schrift: Inter, system-ui, -apple-system, sans-serif;
  --hand: Caveat, 'Bradley Hand', cursive;
  --unten: env(safe-area-inset-bottom, 0px);
  --oben: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gruen); text-decoration: none; }
:focus-visible { outline: 3px solid var(--limette); outline-offset: 2px; }
img { max-width: 100%; display: block; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.seite { flex: 1; padding: calc(18px + var(--oben)) 20px calc(110px + var(--unten)); display: flex; flex-direction: column; gap: 16px; }
.seite.ohne-nav { padding-bottom: calc(28px + var(--unten)); }

h1, h2, h3 { font-family: var(--kopf); font-weight: 800; margin: 0; line-height: 1.05; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
.hand { font-family: var(--hand); font-weight: 600; font-size: 21px; color: #3E7A4F; line-height: 1.1; }
.leise { color: var(--leise); font-size: 13px; }
.zeile { display: flex; align-items: center; gap: 10px; }
.zwischen { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stapel { display: flex; flex-direction: column; gap: 8px; }

/* Knöpfe */
.knopf { height: 54px; border: none; border-radius: 18px; padding: 0 20px; font-family: var(--kopf); font-weight: 800; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.knopf.haupt { background: var(--gruen); color: #fff; }
.knopf.limette { background: var(--limette); color: var(--gruen); }
.knopf.zart { background: var(--zart); color: var(--gruen); }
.knopf:disabled { opacity: 0.55; cursor: default; }
.rund { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--zart); color: var(--gruen); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rund.dunkel { background: var(--gruen); color: var(--limette); }
.rund.glas { background: rgba(255,255,255,0.16); color: #fff; }
.textlink { background: none; border: none; color: var(--gruen); font-weight: 600; min-height: 44px; padding: 0 4px; }

/* Karten und Felder */
.karte { background: var(--flaeche); border-radius: 20px; padding: 14px 16px; }
.karte.eng { padding: 4px 16px; }
.feld { width: 100%; height: 50px; border-radius: 16px; border: 2px solid var(--linie); background: var(--flaeche); padding: 0 14px; font-size: 16px; }
textarea.feld { height: auto; min-height: 140px; padding: 12px 14px; resize: vertical; }
.feld:focus { border-color: var(--gruen); outline: none; }
label.titel { font-weight: 600; font-size: 15px; }
.suche { display: flex; align-items: center; gap: 10px; background: var(--flaeche); border-radius: 16px; padding: 0 14px; height: 48px; color: var(--leise); }
.suche input { border: none; outline: none; background: transparent; flex: 1; font-size: 16px; color: var(--text); min-width: 0; }

/* Segmente und Chips */
.segmente { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 4px; background: var(--zart); border-radius: 16px; padding: 4px; }
.segmente button { height: 44px; border: none; border-radius: 12px; background: transparent; color: var(--leise); font-weight: 600; }
.segmente button[aria-pressed="true"] { background: var(--flaeche); color: var(--gruen); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--gruen); background: var(--flaeche); color: var(--gruen); font-weight: 600; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.chip[aria-pressed="true"] { background: var(--gruen); color: #fff; }
.chip.stift { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; margin-left: -4px; }
.chips.weich .chip { border-color: transparent; }

/* Personen-Zähler */
.zaehler { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zaehler .wert { font-family: var(--kopf); font-weight: 800; font-size: 24px; min-width: 28px; text-align: center; }
.zaehler .wert { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.zaehler .einheit { font-family: var(--schrift); font-weight: 600; font-size: 12px; color: var(--leise); }
.zaehler button { width: 44px; height: 44px; border-radius: 14px; border: none; font-size: 22px; font-weight: 600; background: var(--zart); color: var(--gruen); }
.zaehler button.plus { background: var(--gruen); color: #fff; }

/* Startseite */
.kopfzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.held { display: block; border-radius: 26px; overflow: hidden; background: var(--gruen); color: #fff; }
.held .bild { height: 196px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.held .bild img { width: 100%; height: 100%; object-fit: cover; }
.held .marke { position: absolute; top: 14px; left: 14px; background: var(--limette); color: var(--gruen); font-weight: 600; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.held .unten { padding: 2px 16px 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.held .unten strong { font-family: var(--kopf); font-size: 22px; display: block; }
.held .hand { color: var(--limette); }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kachel { background: var(--flaeche); border-radius: 22px; overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.kachel .bild { height: 112px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.kachel .bild img { width: 100%; height: 100%; object-fit: cover; }
.kachel .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.kachel .info strong { font-size: 15px; font-weight: 600; }
.leer { text-align: center; padding: 28px 16px; color: var(--leise); }

/* Navigation */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--flaeche); border-top: 1px solid #E1E8DC; padding: 6px 12px calc(10px + var(--unten)); z-index: 10; }
.nav .innen { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; font-size: 12px; color: var(--leise); }
.nav a[aria-current="page"] { color: var(--gruen); font-weight: 600; }

/* Rezept */
.rezeptkopf { margin: calc(-18px - var(--oben)) -20px 0; height: calc(300px + var(--oben)); border-radius: 0 0 32px 32px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rezeptkopf img { width: 100%; height: 100%; object-fit: cover; }
.rezeptkopf .oben-links { position: absolute; top: calc(16px + var(--oben)); left: 16px; }
.rezeptkopf .oben-rechts { position: absolute; top: calc(16px + var(--oben)); right: 16px; display: flex; gap: 8px; }
.rezeptkopf .bildnachweis { position: absolute; bottom: 12px; right: 14px; max-width: 55%; font-size: 11px; line-height: 1.3; color: #fff; background: rgba(0,0,0,0.38); padding: 3px 9px; border-radius: 999px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rezeptkopf .quelle { position: absolute; bottom: 14px; left: 20px; right: 45%; color: var(--limette); text-shadow: 0 1px 2px rgba(0,0,0,0.35); }
.liste .eintrag { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #EEF2EA; }
.liste .eintrag:last-child { border-bottom: none; }
.liste .eintrag .menge { font-weight: 600; text-align: right; white-space: nowrap; }
.unsicher { color: var(--warn-text); }
.schritt { display: flex; gap: 12px; align-items: flex-start; background: var(--flaeche); border-radius: 18px; padding: 12px 14px; }
.schritt .nr { width: 28px; height: 28px; border-radius: 14px; background: var(--zart); color: var(--gruen); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.einstellung { align-self: flex-start; background: var(--gruen); color: #fff; border-radius: 10px; padding: 6px 10px; font-weight: 600; font-size: 13px; }
.mixtopf { display: flex; align-items: center; gap: 8px; background: var(--flaeche); border-radius: 20px; padding: 8px 12px 8px 8px; }
.mixtopf strong { font-family: var(--kopf); font-size: 19px; display: block; }

/* Hinweise */
.hinweis { display: flex; gap: 10px; align-items: flex-start; border-radius: 16px; padding: 12px 14px; font-size: 14px; line-height: 1.4; background: var(--warn-grund); color: var(--warn-text); }
.hinweis.fehler { background: var(--fehler-grund); color: var(--fehler-text); }
.hinweis.ok { background: var(--zart); color: var(--gruen); }
.hinweis svg { flex-shrink: 0; margin-top: 1px; }
.pruefliste .punkt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #EEF2EA; font-size: 14px; }
.pruefliste .punkt:last-child { border-bottom: none; }
.punkt .zeichen { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: 14px; }
.zeichen.ok { background: var(--gruen); color: #fff; }
.zeichen.warn { background: var(--warn-grund); color: var(--warn-text); }
.zeichen.fehler { background: var(--fehler-grund); color: var(--fehler-text); }

/* Fotos und Kommentare */
.fotoreihe { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.fotoreihe .foto { width: 100px; height: 100px; border-radius: 18px; overflow: hidden; flex-shrink: 0; background: var(--zart); position: relative; border: none; padding: 0; }
.fotoreihe .foto img { width: 100%; height: 100%; object-fit: cover; }
.fotoreihe .neu { border: 2px dashed var(--gruen); background: transparent; color: var(--gruen); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 12px; }
.kommentar { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EEF2EA; }
.kommentar .avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--limette); color: var(--gruen); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kommentar .text { font-family: var(--hand); font-size: 22px; line-height: 1.15; }

/* Hinzufügen */
.fotofeld { min-height: 168px; border-radius: 24px; border: 2px dashed var(--gruen); background: var(--flaeche); color: var(--gruen); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; cursor: pointer; }
.fotofeld input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.vorschau { display: flex; gap: 8px; flex-wrap: wrap; }
.vorschau .mini { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; position: relative; }
.vorschau .mini img { width: 100%; height: 100%; object-fit: cover; }
.vorschau .mini button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 13px; border: none; background: rgba(0,0,0,0.6); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.wahl { text-align: left; display: flex; align-items: center; gap: 12px; border-radius: 18px; border: 2px solid var(--flaeche); background: var(--flaeche); padding: 12px 14px; width: 100%; }
.wahl[aria-pressed="true"] { border-color: var(--gruen); }
.wahl .punktwahl { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--gruen); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wahl[aria-pressed="true"] .punktwahl::after { content: ''; width: 12px; height: 12px; border-radius: 6px; background: var(--gruen); }
.wahl strong { display: block; font-weight: 600; }

/* Laden */
.laden { position: fixed; inset: 0; background: var(--gruen); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 50; padding: 32px; text-align: center; }
.laden .hand { color: var(--limette); font-size: 28px; }
@keyframes ruehren { to { transform: rotate(360deg); } }
.laden .loeffel { animation: ruehren 2.2s linear infinite; transform-origin: 50% 50%; }

/* Kochmodus */
.kochen { background: var(--gruen); color: #fff; min-height: 100vh; min-height: 100dvh; }
.kochen .seite { padding-bottom: calc(24px + var(--unten)); }
.punkte { display: flex; gap: 6px; }
.punkte span { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.22); }
.punkte span.an { background: var(--limette); }
.kochen h1 { font-size: 30px; line-height: 1.12; }
.kochen .marke { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--limette); }
.kacheln { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kacheln div { background: #fff; color: var(--gruen); border-radius: 20px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.kacheln small { font-size: 12px; font-weight: 600; color: var(--leise); }
.kacheln strong { font-family: var(--kopf); font-size: 22px; line-height: 1.1; }
.uhr { display: flex; align-items: center; gap: 16px; }
.uhr .ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.uhr .mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 14px; }
.uhr .mitte strong { font-family: var(--kopf); font-size: 34px; line-height: 1; }
.uhr .werte small { display: block; font-size: 12px; color: var(--hell); }
.uhr .werte strong { font-family: var(--kopf); font-size: 22px; display: block; margin-bottom: 6px; }
.waehrend { background: #fff; color: var(--text); border-radius: 20px; padding: 12px 14px; }
.waehrend button { display: flex; align-items: center; gap: 10px; min-height: 44px; width: 100%; border: none; background: transparent; padding: 0; text-align: left; font-size: 15px; }
.waehrend .kasten { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--gruen); display: flex; align-items: center; justify-content: center; color: var(--limette); flex-shrink: 0; }
.waehrend button[aria-pressed="true"] .kasten { background: var(--gruen); }
.waehrend button[aria-pressed="true"] span:last-child { text-decoration: line-through; color: var(--leise); }
.danach { display: flex; gap: 10px; align-items: center; border-top: 1px solid rgba(255,255,255,0.18); padding-top: 10px; opacity: 0.8; font-size: 14px; }
.kochen .steuerung { display: flex; gap: 10px; margin-top: auto; }
.kochen .steuerung .zurueck { width: 64px; height: 58px; border-radius: 18px; border: none; background: rgba(255,255,255,0.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.kochen .steuerung .weiter { flex: 1; height: 58px; border-radius: 18px; border: none; background: var(--limette); color: var(--gruen); font-family: var(--kopf); font-weight: 800; font-size: 18px; }
.kochen .steuerung .weiter:disabled { background: rgba(255,255,255,0.14); color: var(--hell); }
.umriss { height: 52px; border-radius: 16px; border: 2px solid var(--limette); background: transparent; color: var(--limette); font-weight: 600; font-size: 16px; width: 100%; }
@keyframes dampf { 0% { transform: translateY(8px); opacity: 0; } 40% { opacity: .85; } 100% { transform: translateY(-18px); opacity: 0; } }
.dampf path { animation: dampf 2.4s ease-in-out infinite; }
.dampf path:nth-child(2) { animation-delay: .8s; }
.dampf path:nth-child(3) { animation-delay: 1.6s; }
@media (prefers-reduced-motion: reduce) {
  .dampf path, .laden .loeffel { animation: none; opacity: .7; }
}

.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meldung { position: fixed; left: 16px; right: 16px; bottom: calc(96px + var(--unten)); max-width: 528px; margin: 0 auto; background: var(--text); color: #fff; border-radius: 16px; padding: 12px 16px; z-index: 60; font-size: 14px; }
