:root {
  --gruen: #3E7D4F;
  --gruen-dunkel: #2C5E3A;
  --gruen-hell: #E8F2EA;
  --gruen-mittel: #CFE3D4;
  --gelb: #C98A0B;
  --gelb-hell: #FBF1DC;
  --grau: #6B7280;
  --grau-hell: #F1F3F2;
  --rot: #B3412E;
  --text: #1F2A22;
  --bg: #F7FAF7;
  --karte: #FFFFFF;
  --rand: #DCE7DE;
  --radius: 16px;
  --schatten: 0 1px 3px rgba(31, 42, 34, .08), 0 4px 14px rgba(31, 42, 34, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gruen-dunkel); }
img { max-width: 100%; }

/* ---------- Grundlayout ---------- */
#app { max-width: 680px; margin: 0 auto; padding: 0 0 92px; }
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
}
.kopf h1 { font-size: 1.25rem; margin: 0; flex: 1; line-height: 1.2; }
.kopf .zurueck { border: 0; background: var(--karte); width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--schatten); font-size: 1.2rem; cursor: pointer; }
.inhalt { padding: 4px 16px 16px; }

.leiste {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--karte);
  border-top: 1px solid var(--rand);
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste-innen { display: flex; width: 100%; max-width: 680px; }
.leiste button {
  flex: 1; border: 0; background: none; padding: 9px 4px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--grau); font-size: .78rem;
}
.leiste button .ico { font-size: 1.35rem; line-height: 1; }
.leiste button.aktiv { color: var(--gruen); font-weight: 600; }
.leiste button.aktiv .ico { transform: scale(1.08); }

.demo-band {
  background: var(--gelb-hell); color: #6b4a05; font-size: .82rem;
  padding: 6px 16px; text-align: center;
}

/* ---------- Bausteine ---------- */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 16px; margin-bottom: 14px; }
.karte h2 { margin: 0 0 8px; font-size: 1.1rem; }
.karte h3 { margin: 14px 0 6px; font-size: 1rem; }
.leise { color: var(--grau); font-size: .9rem; }
.klein { font-size: .85rem; }
.mitte { text-align: center; }
.zeile { display: flex; align-items: center; gap: 8px; }
.zeile.umbruch { flex-wrap: wrap; }
.zeile.abstand { justify-content: space-between; }
.wachsen { flex: 1; min-width: 0; }
.stapel > * + * { margin-top: 10px; }
.versteckt { display: none !important; }
hr { border: 0; border-top: 1px solid var(--rand); margin: 14px 0; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  background: var(--gruen); color: #fff; font-weight: 600; text-decoration: none;
  min-height: 46px;
}
.knopf:active { transform: scale(.98); }
.knopf.zweit { background: var(--gruen-hell); color: var(--gruen-dunkel); }
.knopf.rand { background: var(--karte); color: var(--gruen-dunkel); border: 1.5px solid var(--gruen-mittel); }
.knopf.gefahr { background: #fbe9e6; color: var(--rot); }
.knopf.voll { width: 100%; }
.knopf.klein { min-height: 36px; padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.knopf[disabled] { opacity: .45; cursor: default; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }
.knopfreihe .knopf { flex: 1 1 auto; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--rand); background: var(--karte); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.chip.an { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.chip.gf { border-color: var(--gruen); color: var(--gruen-dunkel); background: var(--gruen-hell); font-weight: 600; }
.chip.gf.an { background: var(--gruen-dunkel); color: #fff; }
.chip.warn { border-color: #f0d9a8; background: var(--gelb-hell); color: #6b4a05; }
.chipreihe { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chipreihe::-webkit-scrollbar { display: none; }
.chipwolke { display: flex; flex-wrap: wrap; gap: 8px; }

label.feld { display: block; margin-bottom: 12px; }
label.feld > span { display: block; font-size: .85rem; color: var(--grau); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--rand); border-radius: 12px; padding: 11px 12px; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gruen); }
.check { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--gruen); }

/* ---------- Glutenfrei-Siegel ---------- */
.siegel {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 2px 9px 2px 5px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  line-height: 1.5;
}
.siegel svg { width: 18px; height: 18px; flex: 0 0 auto; }
.siegel.gf { background: var(--gruen); color: #fff; }
.siegel.anp { background: var(--gelb); color: #fff; }
.siegel.unklar { background: var(--grau-hell); color: var(--grau); }
.siegel.gluten { background: transparent; color: var(--grau); font-weight: 500; padding-left: 2px; }
.siegel.vorschlag { outline: 2px dashed rgba(0,0,0,.25); outline-offset: 1px; }

.gfbox { border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--gruen-hell); }
.gfbox.anp { background: var(--gelb-hell); }
.gfbox.unklar { background: var(--grau-hell); }
.gfbox ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Morgen ---------- */
.morgen-held { text-align: center; padding: 18px 8px 8px; }
.morgen-held .datum { color: var(--grau); font-size: .95rem; }
.grossknopf {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: linear-gradient(160deg, #4C9460, var(--gruen-dunkel));
  color: #fff; border-radius: 24px; padding: 28px 20px; margin: 16px 0 10px;
  font-size: 1.45rem; font-weight: 800; line-height: 1.25;
  box-shadow: 0 8px 24px rgba(44, 94, 58, .35);
}
.grossknopf small { display: block; font-size: .9rem; font-weight: 500; opacity: .9; margin-top: 6px; }
.grossknopf:active { transform: scale(.985); }

.frage { text-align: center; padding-top: 10px; }
.frage .fortschritt { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.frage .fortschritt i { width: 28px; height: 6px; border-radius: 3px; background: var(--gruen-mittel); }
.frage .fortschritt i.an { background: var(--gruen); }
.frage h2 { font-size: 1.45rem; margin: 6px 0 18px; }
.antworten { display: grid; gap: 10px; }
.antworten.zwei { grid-template-columns: 1fr 1fr; }
.antwort {
  border: 2px solid var(--rand); background: var(--karte); border-radius: 16px; padding: 16px 14px;
  cursor: pointer; font-size: 1.08rem; font-weight: 600; text-align: left;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--schatten);
}
.antwort .ico { font-size: 1.6rem; }
.antwort small { display: block; font-weight: 400; color: var(--grau); font-size: .85rem; }
.antwort.gewaehlt { border-color: var(--gruen); background: var(--gruen-hell); }
.antwort.gf { border-color: var(--gruen-mittel); }
.antworten.lust { grid-template-columns: 1fr 1fr; }
.antworten.lust .antwort { font-size: .98rem; padding: 12px; }

.vorschlag .bild { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 14px; background: var(--gruen-hell); display: block; }
.vorschlag .bild-leer { width: 100%; aspect-ratio: 16/9; border-radius: 14px; background: var(--gruen-hell); display: flex; align-items: center; justify-content: center; font-size: 3.2rem; }
.vorschlag h2 { font-size: 1.35rem; margin: 12px 0 6px; }
.warum { background: var(--grau-hell); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .95rem; }

.laden { text-align: center; padding: 50px 10px; }
.kreisel { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--gruen-mittel); border-top-color: var(--gruen); animation: dreh 0.9s linear infinite; margin: 0 auto 16px; }
@keyframes dreh { to { transform: rotate(360deg); } }

.sterne { color: #E0A400; letter-spacing: 1px; white-space: nowrap; }
.sterne-wahl { display: flex; gap: 4px; }
.sterne-wahl button { border: 0; background: none; font-size: 1.9rem; color: #d6d6d6; cursor: pointer; padding: 0 2px; line-height: 1; }
.sterne-wahl button.an { color: #E0A400; }
.daumen { display: flex; gap: 8px; }
.daumen button { border: 2px solid var(--rand); background: #fff; border-radius: 12px; font-size: 1.4rem; padding: 6px 14px; cursor: pointer; }
.daumen button.an { border-color: var(--gruen); background: var(--gruen-hell); }

/* ---------- Rezepte ---------- */
.suche { position: relative; margin-bottom: 10px; }
.liste { display: grid; gap: 10px; }
.rkarte {
  display: flex; gap: 12px; align-items: center; cursor: pointer;
  background: var(--karte); border-radius: 14px; box-shadow: var(--schatten); padding: 10px;
}
.rkarte .thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--gruen-hell); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.rkarte .titel { font-weight: 700; line-height: 1.25; margin-bottom: 4px; }
.rkarte .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--grau); }
.fab {
  position: fixed; right: max(18px, calc(50vw - 322px)); bottom: 86px; z-index: 25;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gruen); color: #fff; font-size: 2rem; box-shadow: 0 6px 18px rgba(44, 94, 58, .4);
}

.rezept-bild { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; display: block; background: var(--gruen-hell); }
.bildreihe { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.bildreihe img { width: 74px; height: 74px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.portionen { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.portionen button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--gruen-hell); color: var(--gruen-dunkel); font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.zutaten { list-style: none; padding: 0; margin: 0; }
.zutaten li { padding: 7px 0; border-bottom: 1px solid var(--grau-hell); display: flex; gap: 10px; }
.zutaten li .m { min-width: 78px; font-weight: 600; text-align: right; }
.zutaten li.gruppe { border: 0; font-weight: 700; padding-top: 12px; color: var(--gruen-dunkel); }
.zutaten li .kritisch { color: var(--gelb); font-size: .8rem; display: block; }
.schritte { padding-left: 22px; margin: 0; }
.schritte li { margin-bottom: 10px; }

.fotoeditor { display: flex; gap: 8px; flex-wrap: wrap; }
.fotoeditor .f { position: relative; }
.fotoeditor img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.fotoeditor .f button { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--rot); color: #fff; cursor: pointer; }
.fotoeditor label.neu { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--gruen-mittel); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: var(--gruen); cursor: pointer; }

/* ---------- Einkauf ---------- */
.eintrag { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--grau-hell); }
.eintrag input[type=checkbox] { width: 24px; height: 24px; margin-top: 1px; accent-color: var(--gruen); flex: 0 0 auto; }
.eintrag.erledigt .t { text-decoration: line-through; color: var(--grau); }
.eintrag .hinweis { display: block; font-size: .8rem; color: var(--gruen-dunkel); font-weight: 600; }
.eintrag .hinweis.warn { color: var(--gelb); }
.eintrag .quelle { display: block; font-size: .75rem; color: var(--grau); }
.eintrag .weg { border: 0; background: none; color: var(--grau); font-size: 1.1rem; cursor: pointer; padding: 0 4px; }

/* ---------- Mehr / Plan ---------- */
.menue { list-style: none; margin: 0; padding: 0; }
.menue li { border-bottom: 1px solid var(--grau-hell); }
.menue li:last-child { border-bottom: 0; }
.menue button { width: 100%; text-align: left; border: 0; background: none; padding: 14px 4px; display: flex; gap: 12px; align-items: center; cursor: pointer; font-size: 1rem; }
.menue button .ico { font-size: 1.3rem; width: 28px; text-align: center; }
.menue button small { display: block; color: var(--grau); font-size: .8rem; }
.menue button[disabled] { opacity: .5; cursor: default; }

.tag { margin-bottom: 10px; }
.tag .tkopf { font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.tag.heute .tkopf { color: var(--gruen); }
.slot { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.slot .art { width: 54px; font-size: .8rem; color: var(--grau); }
.slot .platz { flex: 1; border: 1.5px dashed var(--rand); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: none; text-align: left; min-height: 40px; color: var(--grau); }
.slot .platz.voll { border-style: solid; border-color: var(--gruen-mittel); background: var(--gruen-hell); color: var(--text); font-weight: 600; }
.slot .platz.gekocht { opacity: .65; }

/* ---------- Dialog & Hinweis ---------- */
.dialog-hg { position: fixed; inset: 0; background: rgba(20, 30, 22, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.dialog {
  background: var(--karte); width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  animation: hoch .18s ease-out;
}
@media (min-width: 700px) { .dialog-hg { align-items: center; } .dialog { border-radius: 22px; } }
@keyframes hoch { from { transform: translateY(30px); opacity: .4; } }
.dialog h2 { margin: 0 0 12px; font-size: 1.2rem; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  background: #1F2A22; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: .92rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 90vw; text-align: center;
}
.fortschrittsliste { font-size: .88rem; max-height: 320px; overflow-y: auto; }
.fortschrittsliste div { padding: 4px 0; border-bottom: 1px solid var(--grau-hell); }
.balken { height: 8px; background: var(--grau-hell); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.balken i { display: block; height: 100%; background: var(--gruen); transition: width .3s; }

.login { max-width: 400px; margin: 60px auto; padding: 0 18px; }
.login .logo { width: 96px; height: 96px; border-radius: 24px; display: block; margin: 0 auto 14px; }
