:root {
  --aubergine: #5b2a4e;
  --aubergine-2: #7a3d69;
  --tomate: #d4472b;
  --olive: #5f7324;
  --olive-hell: #e7ecd3;
  --safran: #f0a52e;
  --safran-hell: #fdf0d8;
  --bg: #fbf6ee;
  --karte: #ffffff;
  --karte-2: #f5eee3;
  --text: #2b1f27;
  --text-2: #6f6068;
  --linie: #eadfd2;
  --schatten: 0 1px 2px rgba(60, 30, 50, .06), 0 6px 20px rgba(60, 30, 50, .08);
  --auf: #ffffff;
  --radius: 22px;
  --radius-s: 14px;
  --kopf: 'Fraunces', Georgia, serif;
  --fliess: 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #1c1519; --karte: #2a2027; --karte-2: #33282f; --text: #f5ebef; --text-2: #bba9b3;
    --linie: #43363e; --aubergine: #c89bd0; --aubergine-2: #dcb8e2; --olive: #b5c96b; --olive-hell: #37391f; --tomate: #ff8a6d;
    --safran: #f7bd5c; --safran-hell: #40321b; --schatten: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --auf: #231a20; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #1c1519; --karte: #2a2027; --karte-2: #33282f; --text: #f5ebef; --text-2: #bba9b3;
  --linie: #43363e; --aubergine: #c89bd0; --aubergine-2: #dcb8e2; --olive: #b5c96b; --olive-hell: #37391f; --tomate: #ff8a6d;
  --safran: #f7bd5c; --safran-hell: #40321b; --schatten: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --auf: #231a20; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--fliess); min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--kopf); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-variation-settings: "SOFT" 100, "WONK" 1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--aubergine); }
.leise { color: var(--text-2); font-size: .9rem; }
.versteckt { display: none !important; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.kopf .unter { color: var(--text-2); font-size: .95rem; }

/* Navigation */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--linie);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
nav.tabs button { flex: 1; max-width: 140px; background: none; border: 0; padding: 6px 4px; border-radius: 14px; display: flex;
  flex-direction: column; align-items: center; gap: 2px; font-size: .78rem; color: var(--text-2); font-weight: 700; }
nav.tabs button svg { width: 24px; height: 24px; }
nav.tabs button[aria-current="page"] { color: var(--aubergine); background: color-mix(in srgb, var(--aubergine) 10%, transparent); }

/* Karten */
.karte { background: var(--karte); border-radius: var(--radius); box-shadow: var(--schatten); padding: 18px; margin-bottom: 14px; }
.karte.flach { box-shadow: none; background: var(--karte-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--karte-2); color: var(--text-2); }
.chip.olive { background: var(--olive-hell); color: var(--olive); }
.chip.safran { background: var(--safran-hell); color: color-mix(in srgb, var(--safran) 70%, var(--text)); }
.chip.tomate { background: color-mix(in srgb, var(--tomate) 14%, transparent); color: var(--tomate); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.knopf { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 800; background: var(--aubergine); color: var(--auf);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--aubergine) 30%, transparent); transition: transform .12s; min-height: 46px; }
.knopf:active { transform: scale(.97); }
.knopf.breit { width: 100%; }
.knopf.zweit { background: var(--karte-2); color: var(--text); box-shadow: none; }
.knopf:disabled { opacity: .5; }
.textknopf { background: none; border: 0; color: var(--aubergine); font-weight: 800; padding: 8px 4px; }

/* Wochenstreifen */
.streifen { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.streifen .tag { background: var(--karte); border-radius: 14px; padding: 8px 2px 10px; text-align: center; box-shadow: var(--schatten);
  animation: aufbau .45s cubic-bezier(.2,.8,.2,1) both; }
.streifen .tag b { display: block; font-size: .75rem; color: var(--text-2); }
.streifen .punkt { width: 12px; height: 12px; border-radius: 50%; margin: 6px auto 0; background: var(--linie); }
.streifen .punkt.ja { background: var(--olive); }
.streifen .punkt.frei { background: transparent; border: 2px dashed var(--text-2); }
.streifen .punkt.offen { background: var(--safran); }
@keyframes aufbau { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* Vorschlagskarten */
.slot { position: relative; }
.slot .wann { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.slot h3 { margin-top: 4px; cursor: pointer; }
.slot .aktionen { display: flex; align-items: stretch; gap: 8px; margin-top: 14px; }
.slot .behalten { display: flex; gap: 8px; flex: 1.3; }
.slot .streichen { display: flex; gap: 6px; flex: 1; justify-content: flex-end; padding-left: 10px; border-left: 2px dotted var(--linie); }
.aktion { border: 0; border-radius: 16px; padding: 10px 8px; font-weight: 800; font-size: .88rem; display: flex; flex-direction: column;
  align-items: center; gap: 2px; min-height: 58px; flex: 1; line-height: 1.1; }
.aktion svg { width: 20px; height: 20px; }
.aktion.ja { background: var(--olive); color: var(--auf); }
.aktion.ersetzen { background: var(--safran-hell); color: color-mix(in srgb, var(--safran) 60%, var(--text)); }
.aktion.nicht { background: transparent; color: var(--text-2); border: 1.5px solid var(--linie); font-size: .78rem; min-width: 0; }
.aktion.nie { background: transparent; color: var(--tomate); border: 1.5px solid color-mix(in srgb, var(--tomate) 35%, transparent); font-size: .78rem; }
.slot.weg { animation: wegwischen .38s cubic-bezier(.5,0,.8,.3) forwards; }
@keyframes wegwischen { to { transform: translateX(110%) rotate(6deg); opacity: 0; } }
.slot.laedt h3 { color: var(--text-2); }
.laden-balken { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--karte-2), var(--safran-hell), var(--karte-2));
  background-size: 200% 100%; animation: schimmer 1.2s linear infinite; margin-top: 10px; }
@keyframes schimmer { to { background-position: -200% 0; } }
.frei-slot { border: 2px dashed var(--linie); background: transparent; box-shadow: none; padding: 14px 18px; }
.frei-slot .titel { color: var(--text-2); font-family: var(--kopf); font-size: 1.05rem; }
.frei-slot s { color: var(--text-2); }

/* Geplante Zeilen */
.plan-zeile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--karte); border-radius: var(--radius-s);
  margin-bottom: 8px; box-shadow: var(--schatten); animation: aufbau .35s both; cursor: pointer; }
.plan-zeile .tagk { width: 42px; font-weight: 800; color: var(--olive); font-size: .85rem; line-height: 1.1; }
.plan-zeile .tagk small { display: block; color: var(--text-2); font-weight: 700; font-size: .7rem; }
.plan-zeile .n { flex: 1; font-weight: 700; }
.plan-zeile .haekchen { width: 26px; height: 26px; border-radius: 50%; background: var(--olive); color: var(--auf); display: grid; place-items: center;
  animation: pop .4s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(0); } }

/* Maskottchen */
.aubergine { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 16px; }
.aubergine svg { width: 52px; height: 64px; flex: none; animation: wippen 3.5s ease-in-out infinite; transform-origin: 50% 90%; }
.aubergine .sagt { background: var(--karte-2); border-radius: 4px 18px 18px 18px; padding: 10px 14px; font-size: .95rem; flex: 1; }
.aubergine .sagt b { color: var(--aubergine); font-family: var(--kopf); }
@keyframes wippen { 50% { transform: rotate(-4deg); } }
/* Animierte Aubergine */
.figur { flex: none; overflow: visible; }
.figur.denkt { width: 64px; height: 61px; }
.figur.kocht { width: 110px; height: 78px; }
.figur.klein.denkt { width: 30px; height: 29px; vertical-align: -9px; margin-right: 6px; }
.figur.klein.kocht { width: 44px; height: 31px; }
.figur .figur-wippen { transform-box: view-box; transform-origin: 50px 118px; }
.figur.denkt .figur-wippen { animation: sinnieren 3.5s ease-in-out infinite; }
.figur.kocht .figur-wippen { animation: hueppen 1.6s ease-in-out infinite; }
.figur .pupillen { animation: umherschauen 4s ease-in-out infinite; }
.figur .blase { transform-box: fill-box; transform-origin: center; animation: blase 1.5s ease-in-out infinite; }
.figur .dampf { animation: dampf 2.4s ease-out infinite; opacity: 0; }
.figur .ruehren { transform-box: view-box; transform-origin: 82px 60px; animation: ruehren 1.6s ease-in-out infinite; }
@keyframes sinnieren { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg) translateY(-2px); } }
@keyframes hueppen { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-3px) rotate(3deg); } }
@keyframes umherschauen { 0%, 40%, 100% { transform: translate(0, 0); } 55%, 80% { transform: translate(1.6px, -1px); } }
@keyframes blase { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: .9; transform: scale(1); } }
@keyframes dampf { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes ruehren { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(5deg); } }
.denkt-zeile { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.denkt-zeile h3 { margin: 0; color: var(--text-2); }
.koch-laeuft { display: flex; align-items: center; gap: 16px; margin-top: 20px; background: var(--safran-hell); border-radius: 22px; padding: 12px 18px; }
.koch-laeuft .zeit { font-family: var(--fliess); font-weight: 800; font-size: 2rem; font-variant-numeric: tabular-nums; }
.koch-laeuft.fertig { background: color-mix(in srgb, var(--tomate) 18%, transparent); }
.koch-laeuft > svg:not(.figur) { width: 56px; height: 68px; flex: none; }
.timer > svg { width: 44px; height: 31px; flex: none; margin: -6px -4px -6px -8px; }
.timer > svg:not(.figur) { width: 26px; height: 32px; }
body.kochen .timerleiste { bottom: calc(104px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Formular */
label.feld { display: block; margin-bottom: 16px; }
label.feld > span { display: block; font-weight: 800; margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; background: var(--karte-2); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--aubergine); }
input[type="range"] { width: 100%; accent-color: var(--aubergine); }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.schalter:last-child { border-bottom: 0; }
.schalter input { width: 46px; height: 28px; appearance: none; background: var(--linie); border-radius: 999px; position: relative; flex: none; transition: background .2s; cursor: pointer; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.schalter input:checked { background: var(--olive); }
.schalter input:checked::after { transform: translateX(18px); }
.segment { display: flex; background: var(--karte-2); border-radius: 999px; padding: 4px; gap: 4px; }
.segment button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 6px; font-weight: 800; font-size: .88rem; color: var(--text-2); }
.segment button[aria-pressed="true"] { background: var(--karte); color: var(--aubergine); box-shadow: var(--schatten); }
.tags-eingabe { display: flex; flex-wrap: wrap; gap: 6px; background: var(--karte-2); border-radius: 12px; padding: 8px; }
.tags-eingabe input { flex: 1; min-width: 120px; border: 0; background: none; padding: 4px; }
.tags-eingabe .chip button { border: 0; background: none; padding: 0 0 0 2px; color: inherit; font-weight: 800; }

/* Sheet (Rezept) */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; animation: hoch .3s cubic-bezier(.2,.8,.2,1); }
@keyframes hoch { from { transform: translateY(30px); opacity: 0; } }
.sheet .innen { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.sheet .zurueck { position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.zutaten { list-style: none; padding: 0; margin: 0; }
.zutaten li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.zutaten .m { width: 84px; flex: none; text-align: right; font-weight: 800; color: var(--aubergine); font-variant-numeric: tabular-nums; }
.schritte { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.schritte li { counter-increment: s; position: relative; padding: 12px 0 12px 42px; border-bottom: 1px solid var(--linie); }
.schritte li::before { content: counter(s); position: absolute; left: 0; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--karte-2);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.schritte li.kind { background: var(--olive-hell); border-radius: 16px; border: 0; margin: 6px 0; padding-right: 12px; }
.schritte li.kind::before { background: var(--olive); color: var(--auf); }
.kind-marke { display: inline-block; font-weight: 800; color: var(--olive); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.timer-knopf { margin-top: 6px; border: 0; border-radius: 999px; padding: 4px 12px; background: var(--safran-hell); font-weight: 800; font-size: .85rem; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--karte-2); border-radius: 999px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--karte); font-weight: 800; font-size: 1.2rem; }
.stepper span { min-width: 80px; text-align: center; font-weight: 800; }

/* Kochmodus */
.kochmodus { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
.kochmodus .oben { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kochmodus .schritt { flex: 1; display: flex; flex-direction: column; justify-content: center; font-size: clamp(1.5rem, 5.8vw, 2.3rem); line-height: 1.35;
  font-family: var(--kopf); font-weight: 500; animation: aufbau .3s both; max-width: 720px; margin: 0 auto; width: 100%; }
.kochmodus .unten { display: flex; gap: 12px; max-width: 720px; margin: 0 auto; width: 100%; }
.kochmodus .unten .knopf { flex: 1; min-height: 64px; font-size: 1.1rem; }
.fortschritt { display: flex; gap: 4px; margin: 12px auto; max-width: 720px; width: 100%; }
.fortschritt i { flex: 1; height: 5px; border-radius: 3px; background: var(--linie); }
.fortschritt i.an { background: var(--aubergine); }

/* Timerleiste */
.timerleiste { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 70; display: flex; flex-direction: column; gap: 6px; width: min(92vw, 420px); }
.timer { display: flex; align-items: center; gap: 10px; background: var(--karte); color: var(--text); border: 2px solid var(--aubergine); border-radius: 999px; padding: 8px 8px 8px 16px; box-shadow: var(--schatten); }
.timer .z { font-weight: 800; font-variant-numeric: tabular-nums; }
.timer .n { flex: 1; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer button { border: 0; background: var(--karte-2); color: inherit; border-radius: 999px; padding: 6px 12px; font-weight: 800; }
.timer.fertig { border-color: var(--tomate); background: color-mix(in srgb, var(--tomate) 16%, var(--karte)); animation: puls 1s infinite; }
@keyframes puls { 50% { transform: scale(1.03); } }

/* Einkauf */
.einkauf-gruppe h3 { margin: 18px 0 8px; }
.eintrag { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--linie); cursor: pointer; user-select: none; }
.eintrag .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--linie); flex: none; display: grid; place-items: center; transition: all .15s; }
.eintrag.da .box { background: var(--olive); border-color: var(--olive); color: var(--auf); }
.eintrag.da .box svg { animation: pop .3s cubic-bezier(.3,1.6,.5,1); }
.eintrag.da .name { text-decoration: line-through; color: var(--text-2); }
.eintrag .name { flex: 1; font-weight: 700; }
.eintrag .menge { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Toast */
.toast { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 90; background: var(--text); color: var(--bg);
  border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: .92rem; box-shadow: var(--schatten); animation: aufbau .25s both; max-width: 92vw; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: var(--safran); font-weight: 800; }

.leerstand { text-align: center; padding: 32px 16px; }
.leerstand svg { width: 96px; height: 116px; }
.hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--safran-hell); font-size: .92rem; margin-bottom: 8px; }
.hinweis.olive { background: var(--olive-hell); }
.frage { background: var(--safran-hell); border-radius: 16px; padding: 12px 14px; margin-top: 12px; font-size: .92rem; }
.frage .reihe { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.zeile { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.liste-einfach { list-style: none; padding: 0; margin: 0; }
.liste-einfach li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.inspiration a { font-size: .9rem; }
.suche { margin-bottom: 12px; }
details summary { cursor: pointer; font-weight: 800; padding: 6px 0; }

.pfeil { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--karte); box-shadow: var(--schatten); color: var(--aubergine); font-size: 1.4rem; font-weight: 800; line-height: 1; }
