:root {
  --grund: #f4eee3;
  --karte: #fffcf6;
  --tinte: #2a251f;
  --leise: #7b6f61;
  --linie: #e4dac8;
  --akzent: #c2562f;
  --akzent-weich: #f6dccf;
  --kraut: #4f7a45;
  --kraut-weich: #dde9d4;
  --butter: #f3d98b;
  --schatten: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --unten: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1d1a17;
    --karte: #282420;
    --tinte: #f1e9dc;
    --leise: #a89b8b;
    --linie: #3b352e;
    --akzent: #e07a52;
    --akzent-weich: #4a2c20;
    --kraut: #8fbf7f;
    --kraut-weich: #2c3a27;
    --butter: #6b5a2a;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--grund); color: var(--tinte); font: 16px/1.45 var(--sans); }
body { min-height: 100vh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
a { color: var(--akzent); }

.seite { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(96px + var(--unten)); }
.kopf { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.kopf h1 { font-size: 30px; flex: 1; min-width: 0; }
.kopf .klein { font-size: 13px; color: var(--leise); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; padding: 8px 12px calc(8px + var(--unten)); background: color-mix(in srgb, var(--grund) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--linie); }
.nav button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; font-size: 12px; color: var(--leise); position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button.an { color: var(--akzent); }
.nav .zahl { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--akzent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--akzent); color: #fff; font-weight: 600; }
a.knopf { text-decoration: none; }
.seite > .hinweis { margin-bottom: 14px; }
.knopf.zart { background: var(--karte); color: var(--tinte); border: 1px solid var(--linie); }
.knopf.gruen { background: var(--kraut); }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .5; }
.knopf svg { width: 18px; height: 18px; }
.rund { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--karte); border: 1px solid var(--linie); flex: none; }
.rund svg { width: 20px; height: 20px; }
.rund.voll { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.fab { position: fixed; right: max(16px, calc(50% - 364px)); bottom: calc(84px + var(--unten)); z-index: 19; width: 58px; height: 58px; border-radius: 50%; background: var(--akzent); color: #fff; box-shadow: 0 8px 24px rgba(194, 86, 47, .35); display: flex; align-items: center; justify-content: center; }
.fab svg { width: 28px; height: 28px; }

.suche { display: flex; align-items: center; gap: 8px; background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 0 12px; min-height: 46px; }
.suche svg { width: 18px; height: 18px; color: var(--leise); flex: none; }
.suche input { flex: 1; border: 0; background: none; outline: none; min-width: 0; height: 44px; font-size: 16px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linie); background: var(--karte); font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.chip.an { background: var(--tinte); color: var(--grund); border-color: var(--tinte); }
.chip.tm.an { background: var(--kraut); border-color: var(--kraut); color: #fff; }

.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 620px) { .raster { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.karte { background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.karte .bild { aspect-ratio: 4 / 3; background: var(--akzent-weich); position: relative; }
.karte .bild img { width: 100%; height: 100%; object-fit: cover; }
.karte .platzhalter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 42px; color: var(--akzent); }
.karte .herz { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--akzent); display: flex; align-items: center; justify-content: center; }
.karte .herz svg { width: 15px; height: 15px; }
.karte .text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.karte .titel { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.karte .meta { font-size: 12px; color: var(--leise); display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--akzent-weich); color: var(--akzent); }
.tag svg { width: 14px; height: 14px; flex: none; }
.tag { white-space: nowrap; }
.tag.tm { background: var(--kraut-weich); color: var(--kraut); }
.tag.grau { background: var(--linie); color: var(--leise); }

.leer { text-align: center; color: var(--leise); padding: 48px 12px; }
.leer h2 { color: var(--tinte); font-size: 22px; margin-bottom: 6px; }
.leer .knopf { margin-top: 14px; }

.held { margin: calc(-14px - env(safe-area-inset-top, 0px)) -16px 0; aspect-ratio: 16 / 11; max-height: 52vh; background: var(--akzent-weich); position: relative; overflow: hidden; }
.held img { width: 100%; height: 100%; object-fit: cover; }
.held .platzhalter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 80px; color: var(--akzent); }
.held .oben { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 12px; display: flex; gap: 8px; }
.held .oben .rund { background: rgba(255, 252, 246, .92); border: 0; color: #2a251f; }
.held .oben .luft { flex: 1; }
.ohne-bild { margin-top: 0; aspect-ratio: auto; height: calc(env(safe-area-inset-top, 0px) + 64px); max-height: none; background: none; }
.rezept-kopf { padding: 16px 0 6px; }
.rezept-kopf h1 { font-size: 28px; line-height: 1.15; }
.rezept-kopf .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.aktionen { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.aktionen .knopf { flex: 1; min-width: 140px; }
.abschnitt { margin-top: 22px; }
.abschnitt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.abschnitt-kopf h2 { font-size: 21px; }
.portionen { display: inline-flex; align-items: center; gap: 4px; background: var(--karte); border: 1px solid var(--linie); border-radius: 999px; padding: 3px; }
.portionen button { width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; }
.portionen span { min-width: 74px; text-align: center; font-size: 14px; font-weight: 600; }

.zutaten { list-style: none; margin: 0; padding: 0; background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); }
.zutaten li { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--linie); align-items: baseline; }
.zutaten li:last-child { border-bottom: 0; }
.zutaten .menge { flex: none; width: 84px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.zutaten .was small { display: block; color: var(--leise); font-size: 13px; }
.schritte { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.schritte li { counter-increment: s; position: relative; padding: 2px 0 16px 44px; }
.schritte li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--akzent-weich); color: var(--akzent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.schritte li.zwischen { padding-left: 0; counter-increment: none; font-family: var(--serif); font-weight: 600; font-size: 17px; }
.schritte li.zwischen::before { display: none; }
.notiz { background: color-mix(in srgb, var(--butter) 45%, var(--karte)); border-radius: var(--r); padding: 12px 14px; white-space: pre-wrap; }
.hinweis { background: var(--kraut-weich); color: var(--tinte); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hinweis p { margin: 0; font-size: 14px; }
.leise { color: var(--leise); font-size: 14px; }

.woche-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.woche-kopf .mitte { flex: 1; text-align: center; }
.woche-kopf .mitte b { display: block; font-family: var(--serif); font-size: 20px; }
.woche-kopf .mitte span { font-size: 13px; color: var(--leise); }
.tag-zeile { background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); padding: 12px 12px 12px 14px; margin-bottom: 10px; }
.tag-zeile.heute { outline: 2px solid var(--akzent); }
.tag-zeile.vorbei { opacity: .62; }
.tag-oben { display: flex; align-items: center; gap: 10px; }
.tag-oben .name { flex: 1; }
.tag-oben .name b { font-family: var(--serif); font-size: 18px; }
.tag-oben .name span { color: var(--leise); font-size: 14px; margin-left: 6px; }
.tag-oben .rund { width: 36px; height: 36px; }
.eintrag { display: flex; align-items: center; gap: 10px; margin-top: 10px; width: 100%; text-align: left; }
.eintrag .mini { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--akzent-weich); flex: none; }
.eintrag .mini img { width: 100%; height: 100%; object-fit: cover; }
.eintrag .mini .platzhalter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 22px; color: var(--akzent); }
.eintrag .infos { flex: 1; min-width: 0; }
.eintrag .infos b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eintrag .infos span { font-size: 13px; color: var(--leise); }
.eintrag .status { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; flex: none; }
.status.offen { background: var(--akzent); color: #fff; }
.status.liste { background: var(--kraut-weich); color: var(--kraut); }
.status.fertig { background: var(--linie); color: var(--leise); }

.liste-add { display: flex; gap: 8px; margin-bottom: 14px; }
.liste-add .suche { flex: 1; }
.gang { margin-top: 18px; }
.gang h3 { font-family: var(--sans); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--leise); margin: 0 4px 6px; }
.zettel { background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }
.posten { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 58px; border-bottom: 1px solid var(--linie); width: 100%; text-align: left; user-select: none; -webkit-user-select: none; }
.posten:last-child { border-bottom: 0; }
.haken { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--linie); flex: none; display: flex; align-items: center; justify-content: center; color: transparent; transition: background .15s, border-color .15s; }
.haken svg { width: 16px; height: 16px; }
.posten.erledigt .haken { background: var(--kraut); border-color: var(--kraut); color: #fff; }
.posten .inhalt { flex: 1; min-width: 0; padding: 9px 0; }
.posten .zeile1 { font-size: 17px; }
.posten .zeile1 b { font-variant-numeric: tabular-nums; }
.posten .zeile2 { font-size: 12px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posten.erledigt .zeile1 { text-decoration: line-through; color: var(--leise); }
.posten .weg { width: 36px; height: 36px; border-radius: 50%; color: var(--akzent); display: flex; align-items: center; justify-content: center; flex: none; }
.posten .weg svg { width: 18px; height: 18px; }
.posten select { max-width: 120px; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); font-size: 13px; padding: 4px; }
.erledigt-kopf { display: flex; align-items: center; justify-content: space-between; margin: 24px 4px 6px; }
.erledigt-kopf h3 { margin: 0; }
.erledigt-kopf button { color: var(--akzent); font-size: 14px; font-weight: 600; padding: 6px 0; }
.umschalter { display: inline-flex; background: var(--karte); border: 1px solid var(--linie); border-radius: 999px; padding: 3px; }
.umschalter button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--leise); }
.umschalter button.an { background: var(--tinte); color: var(--grund); }
.offline { background: var(--butter); color: #3a2f12; border-radius: 12px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

.blatt-hinter { position: fixed; inset: 0; z-index: 50; background: rgba(20, 14, 8, .42); display: flex; align-items: flex-end; justify-content: center; animation: ein .18s ease-out; }
.blatt { background: var(--grund); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: hoch .24s cubic-bezier(.2, .8, .2, 1); }
.blatt-kopf { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.blatt-kopf h2 { flex: 1; font-size: 21px; min-width: 0; }
.blatt-kopf .rund { width: 36px; height: 36px; }
.blatt-inhalt { overflow-y: auto; padding: 6px 16px 16px; -webkit-overflow-scrolling: touch; }
.blatt-fuss { padding: 10px 16px calc(12px + var(--unten)); border-top: 1px solid var(--linie); display: flex; gap: 8px; }
.blatt-fuss .knopf { flex: 1; }
@keyframes ein { from { opacity: 0; } }
@keyframes hoch { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 700px) { .blatt-hinter { align-items: center; } .blatt { border-radius: 22px; } }

.feld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.feld > span { font-size: 13px; font-weight: 600; color: var(--leise); }
.feld input, .feld select, .feld textarea, .eingabe { width: 100%; border: 1px solid var(--linie); background: var(--karte); border-radius: 12px; padding: 11px 12px; font-size: 16px; outline: none; }
.feld textarea { min-height: 110px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus, .eingabe:focus { border-color: var(--akzent); }
.reihe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.zutat-reihe { display: grid; grid-template-columns: 64px 64px minmax(0, 1fr) 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.zutat-reihe input { width: 100%; border: 1px solid var(--linie); background: var(--karte); border-radius: 10px; padding: 9px 8px; font-size: 15px; outline: none; min-width: 0; }
.zutat-reihe .notizfeld { grid-column: 3 / 4; font-size: 13px; padding: 6px 8px; margin-top: -2px; }
.zutat-reihe .weg { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--leise); }
.zutat-reihe .weg svg { width: 18px; height: 18px; }
.bild-wahl { display: flex; gap: 12px; align-items: center; }
.bild-wahl .vorschau { width: 96px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--akzent-weich); flex: none; }
.bild-wahl .vorschau img { width: 100%; height: 100%; object-fit: cover; }
.bild-wahl .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.datei { display: none; }
.gefahr { color: var(--akzent); font-weight: 600; padding: 12px 0; width: 100%; text-align: center; }

.waehlen { list-style: none; margin: 0; padding: 0; background: var(--karte); border-radius: var(--r); overflow: hidden; }
.waehlen li { border-bottom: 1px solid var(--linie); }
.waehlen li:last-child { border-bottom: 0; }
.waehlen button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; min-height: 56px; text-align: left; }
.waehlen .kasten { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--linie); flex: none; display: flex; align-items: center; justify-content: center; color: transparent; }
.waehlen .kasten svg { width: 16px; height: 16px; }
.waehlen button.an .kasten { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.waehlen button.gekauft { opacity: .55; }
.waehlen .menge { font-weight: 700; font-variant-numeric: tabular-nums; }
.waehlen small { display: block; color: var(--leise); font-size: 12px; }
.schnell { display: flex; gap: 8px; margin-bottom: 10px; }
.schnell button { font-size: 14px; font-weight: 600; color: var(--akzent); padding: 6px 0; }
.tage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.tage button { border: 1px solid var(--linie); background: var(--karte); border-radius: 12px; padding: 8px 0; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--leise); }
.tage button b { font-size: 17px; color: var(--tinte); }
.tage button.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.tage button.an b { color: #fff; }
.tage button .punkt { width: 5px; height: 5px; border-radius: 50%; background: var(--akzent); margin-top: 2px; }
.tage button.an .punkt { background: #fff; }
.picker { list-style: none; margin: 10px 0 0; padding: 0; }
.picker li button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 0; text-align: left; border-bottom: 1px solid var(--linie); }
.picker .mini { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--akzent-weich); flex: none; }
.picker .mini img { width: 100%; height: 100%; object-fit: cover; }
.picker .mini .platzhalter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); color: var(--akzent); font-size: 20px; }
.picker b { display: block; font-weight: 600; }
.picker span { font-size: 12px; color: var(--leise); }
.menue { display: flex; flex-direction: column; gap: 8px; }
.menue .knopf { justify-content: flex-start; }

.anmeldung { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 380px; margin: 0 auto; padding: 24px 20px; }
.anmeldung .logo { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 18px; }
.anmeldung h1 { font-size: 34px; margin-bottom: 4px; }
.anmeldung p { color: var(--leise); margin: 0 0 22px; }
.wer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.wer button { min-height: 64px; border-radius: 16px; border: 2px solid var(--linie); background: var(--karte); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.wer button.an { border-color: var(--akzent); background: var(--akzent-weich); color: var(--akzent); }
.fehler { color: var(--akzent); font-size: 14px; min-height: 20px; margin: 6px 0; }

.toast { position: fixed; left: 50%; bottom: calc(92px + var(--unten)); transform: translateX(-50%); z-index: 80; background: var(--tinte); color: var(--grund); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--schatten); animation: ein .2s; }
.lade { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: dreh .7s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.mitte-lade { display: flex; justify-content: center; padding: 60px 0; color: var(--leise); }
.feld .portionen { align-self: flex-start; }
