:root {
  --petrol: #1F5F5B; --petrol-dark: #154440; --petrol-tint: #E4EFED; --petrol-soft: #EDF5F4; --petrol-light: #8CC7C0;
  --bg: #F7F8F7; --card: #FFFFFF; --line: #DDE3E1; --line-soft: #EAEEED; --field: #EAEEED; --chip-line: #CBD3D1;
  --ink: #1E1C1A; --ink-2: #3C4442; --muted: #5B6361; --muted-2: #7B8482;
  --warn-bg: #F6E1D7; --warn: #8E3522; --danger: #B3372A;
  --head: 'Bricolage Grotesque', Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Figtree', system-ui, sans-serif; font-size: 16px; }
body { min-height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--petrol); text-decoration: none; }
h1, h2, h3 { font-family: var(--head); margin: 0; }
img { display: block; }
.noscroll::-webkit-scrollbar { display: none; } .noscroll { scrollbar-width: none; }

#app { max-width: 560px; margin: 0 auto; padding: calc(24px + var(--safe-t)) 20px calc(104px + var(--safe-b)); }
#app.full { padding: 0; max-width: none; }

/* Tab-Leiste */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(247,248,247,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 0 8px var(--safe-b); }
#tabs[hidden] { display: none; }
#tabs a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; min-height: 60px; color: var(--muted); font-size: 11px; font-weight: 500; }
#tabs a.on { color: var(--petrol); font-weight: 700; }

.stack { display: flex; flex-direction: column; }
.hello { font-size: 14px; font-weight: 600; color: var(--muted); }
.title { font-size: 34px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.sub { font-size: 14px; font-weight: 500; color: var(--muted); }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }

.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.chip { flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.chip.on { background: var(--ink); color: #FAFAF9; border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.photo { position: relative; aspect-ratio: 1 / 1.05; border-radius: 18px; overflow: hidden; background: #F0DFC4; display: flex; align-items: center; justify-content: center; color: rgba(30,28,26,0.3); }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .name { font-size: 15px; font-weight: 700; line-height: 1.25; }
.card .meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty .big { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--ink); }
.bubble { width: 80px; height: 80px; border-radius: 999px; background: var(--petrol-tint); color: var(--petrol); display: flex; align-items: center; justify-content: center; }

/* Rezept */
.hero { position: relative; height: 340px; background: #F0DFC4; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .top { position: absolute; left: 0; right: 0; top: 0; padding: calc(12px + var(--safe-t)) 16px 0; display: flex; justify-content: space-between; }
.round { width: 44px; height: 44px; border-radius: 999px; border: 0; background: rgba(255,255,255,0.92); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.sheet { position: relative; margin-top: -28px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 24px 20px calc(120px + var(--safe-b)); max-width: 560px; margin-left: auto; margin-right: auto; display: flex; flex-direction: column; gap: 22px; }
.r-title { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.015em; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 10px; border-radius: 999px; background: var(--petrol-tint); color: var(--petrol-dark); font-size: 12px; font-weight: 700; }
.pill.grey { background: var(--field); color: var(--ink-2); }
.facts { display: flex; gap: 10px; }
.fact { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.fact b { font-size: 15px; } .fact span { font-size: 12px; color: var(--muted); font-weight: 600; }
.desc { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 999px; border: 0; background: var(--field); display: flex; align-items: center; justify-content: center; }
.stepper span { min-width: 92px; text-align: center; font-size: 14px; font-weight: 700; }
.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.list.soft { background: #EEF1F0; }
.ing { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 52px; border-bottom: 1px solid var(--line-soft); }
.ing:last-child { border-bottom: 0; }
.ing .amt { min-width: 72px; font-size: 15px; font-weight: 700; }
.ing .nm { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 15px; font-weight: 500; }
.ing .nt { font-size: 12px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); }
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; }
.step .n { width: 30px; height: 30px; flex-shrink: 0; border-radius: 999px; background: var(--ink); color: #FAFAF9; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step p { margin: 3px 0 0; font-size: 16px; line-height: 1.5; }
.tipbox { display: flex; flex-direction: column; gap: 12px; background: var(--petrol-tint); border-radius: 20px; padding: 18px; }
.tipbox .h { display: flex; align-items: center; gap: 8px; color: var(--petrol); }
.tipbox .h h2 { font-size: 20px; color: var(--ink); }
.tipbox p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(247,248,247,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + var(--safe-b)); }
.bar .in { max-width: 520px; margin: 0 auto; display: flex; gap: 10px; }
.btn { white-space: nowrap; height: 56px; border-radius: 16px; border: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; }
.btn.main { flex: 1; background: var(--petrol); color: #FFF; }
.btn.ghost { background: var(--card); border: 1px solid var(--chip-line); color: var(--ink); }
.btn.dark { background: var(--ink); color: #FAFAF9; }
.btn[disabled] { opacity: 0.5; }

/* Kochmodus */
.cook { min-height: 100dvh; background: #131B1A; color: #F5F1EA; display: flex; flex-direction: column; gap: 22px; padding: calc(16px + var(--safe-t)) 24px calc(24px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.cook .round { background: #223130; color: #F5F1EA; box-shadow: none; }
.cook .bars { display: flex; gap: 6px; }
.cook .bars i { flex: 1; height: 5px; border-radius: 999px; background: #2C3C3A; }
.cook .bars i.on { background: var(--petrol-light); }
.cook .lbl { font-size: 14px; font-weight: 700; letter-spacing: 0.06em; color: var(--petrol-light); }
.cook .txt { margin: 0; font-size: 24px; line-height: 1.45; color: #E4ECEA; }
.cook .why { display: flex; gap: 12px; background: #1D2A28; border-radius: 18px; padding: 16px; color: #CFDAD7; font-size: 15px; line-height: 1.5; }
.cook .timer { align-self: flex-start; height: 52px; padding: 0 20px; border-radius: 16px; border: 0; background: #F5F1EA; color: #131B1A; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cook .timer.run { background: var(--petrol-light); }
.cook .nav { margin-top: auto; display: flex; gap: 12px; }
.cook .nav .prev { width: 64px; height: 64px; border-radius: 20px; border: 1px solid #2C3C3A; background: transparent; color: #F5F1EA; display: flex; align-items: center; justify-content: center; }
.cook .nav .next { flex: 1; height: 64px; border-radius: 20px; border: 0; background: var(--petrol); color: #FFF; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cook .ings { display: flex; flex-wrap: wrap; gap: 8px; }
.cook .ings span { padding: 6px 10px; border-radius: 10px; background: #1D2A28; color: #CFDAD7; font-size: 14px; }

/* Login */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 400px; margin: 0 auto; padding: 24px; }
.logo { width: 88px; height: 88px; border-radius: 22px; background: var(--petrol); color: #fff; display: flex; align-items: center; justify-content: center; }
.field { height: 54px; border-radius: 14px; border: 1px solid var(--chip-line); background: var(--card); padding: 0 16px; font-size: 16px; outline: none; width: 100%; }
.field:focus { border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-tint); }
.err { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 20px; }

/* Überlagerungen */
#overlay:empty { display: none; }
.dim { position: fixed; inset: 0; z-index: 40; background: rgba(30,28,26,0.45); display: flex; align-items: flex-end; justify-content: center; animation: fade 160ms ease-out; }
.dim.center { align-items: center; padding: 20px; }
.panel { width: 100%; max-width: 560px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 12px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; max-height: 88dvh; overflow-y: auto; animation: up 200ms ease-out; }
.dim.center .panel { border-radius: 24px; padding: 22px 20px 20px; max-width: 420px; }
.grab { align-self: center; width: 40px; height: 5px; border-radius: 999px; background: var(--chip-line); }
#toast { position: fixed; left: 20px; right: 20px; bottom: calc(96px + var(--safe-b)); z-index: 50; max-width: 520px; margin: 0 auto; display: none; align-items: center; gap: 10px; background: var(--ink); color: #F7F8F7; border-radius: 16px; padding: 14px 16px; font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(30,28,26,0.28); }
#toast.show { display: flex; animation: up 220ms ease-out; }
#toast button { margin-left: auto; height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: #2F3634; color: var(--petrol-light); font-weight: 700; }
@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.soon { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, #ECEFEE 25%, #F4F6F5 50%, #ECEFEE 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Etappe 2 bis 4 ---------- */
.round.flat { background: var(--field); box-shadow: none; }
.round.dark { width: 48px; height: 48px; border-radius: 16px; background: var(--ink); color: #FAFAF9; box-shadow: none; }
.link { white-space: nowrap; border: 0; background: none; color: var(--petrol); font-size: 14px; font-weight: 700; padding: 6px 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { font-weight: 500; letter-spacing: 0; text-transform: none; }
.btn.plain { background: transparent; color: var(--ink-2); font-size: 15px; height: 48px; }
.btn.pillbtn { align-self: center; height: 44px; border-radius: 999px; font-size: 14px; }
.field.area { height: auto; padding: 14px; line-height: 1.5; resize: none; }
.pill.ghost { border: 1px dashed var(--chip-line); background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 700; }

/* Zutaten auswählen */
.ing.pick { cursor: pointer; user-select: none; }
.ing.pick.on { background: var(--petrol-soft); }
.box { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; border: 2px solid var(--chip-line); display: flex; align-items: center; justify-content: center; color: #fff; background: #fff; }
.on > .box, .box.on { background: var(--petrol); border-color: var(--petrol); }
.list.soft .ing.pick.on { background: #E3EDEB; }

/* Tag wählen */
.dayrow { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: left; color: var(--ink); }
.dayrow.busy { background: #F0F2F1; color: var(--muted); }
.dayrow .dn { width: 44px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.dayrow .dn b { font-size: 15px; color: var(--ink); }
.dayrow .dl { flex: 1; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Woche */
.overview { display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.ovr { display: flex; gap: 10px; align-items: flex-start; }
.ovl { width: 44px; flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 6px; }
.sum { padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #ECEFEE; color: var(--ink-2); }
.sum.warn { background: var(--warn-bg); color: var(--warn); }
.wday { display: flex; gap: 12px; align-items: flex-start; }
.wd { width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding-top: 14px; font-size: 12px; color: var(--muted); }
.wd b { font-size: 13px; color: var(--ink); }
.wd.today b, .wd.today span { color: var(--petrol); }
.wd.today b { background: var(--petrol-tint); border-radius: 8px; padding: 1px 6px; }
.wcol { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.wrow { display: flex; align-items: center; gap: 4px; border-radius: 16px; min-height: 72px; }
.card-row { background: var(--card); border: 1px solid var(--line); padding: 8px 4px 8px 8px; }
.rest-row, .text-row { background: var(--petrol-tint); padding: 0 4px 0 14px; gap: 12px; }
.wlink { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.thumb { position: relative; width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wtxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-align: left; }
.wtxt b { font-size: 15px; line-height: 1.25; }
.wtxt span { font-size: 12px; font-weight: 600; color: var(--muted); }
.wtxt span.tagged { color: var(--petrol); }
.wico { color: var(--petrol); display: flex; }
.tbtn { flex: 1; min-width: 0; min-height: 72px; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; }
.wrow .x { width: 36px; height: 44px; flex-shrink: 0; border: 0; background: none; color: var(--muted-2); display: flex; align-items: center; justify-content: center; }
.two { height: 34px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #fff; color: var(--ink-2); border: 1px solid var(--chip-line); }
.two.on { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.wempty { display: flex; gap: 8px; }
.wempty button { flex: 1; height: 56px; border-radius: 16px; border: 1.5px dashed var(--chip-line); background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.missing { display: flex; flex-direction: column; gap: 8px; background: var(--petrol-tint); border-radius: 16px; padding: 12px 14px; font-size: 13px; color: var(--petrol-dark); }
.missing .wrap span { padding: 6px 10px; border-radius: 999px; background: #fff; font-weight: 700; }
.suggest { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px 8px 8px; }
.badge { flex-shrink: 0; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: var(--petrol-tint); color: var(--petrol-dark); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* Einkaufsliste */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--field); border-radius: 16px; }
.seg button { flex: 1; height: 40px; border-radius: 12px; border: 0; background: transparent; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(30,28,26,0.15); }
.srow-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.srow-wrap:last-child { border-bottom: 0; }
.sdel { position: absolute; top: 0; right: 0; bottom: 0; width: 96px; border: 0; background: var(--danger); color: #fff; font-size: 13px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.srow { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 6px 8px 16px; min-height: 58px; background: #fff; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; transition: transform 200ms ease-out; }
.srow .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.srow .lbl { font-size: 15px; font-weight: 600; }
.srow .nt { font-size: 12px; color: var(--muted); }
.srow .nt.warn { color: #A8412B; font-weight: 600; }
.srow.done .lbl { color: rgba(30,28,26,0.45); text-decoration: line-through; }
.srow.done .nt { opacity: 0.5; }
.srow .mv { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; background: none; color: var(--muted-2); display: flex; align-items: center; justify-content: center; }
.mvrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; min-height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; font-size: 15px; font-weight: 600; }
.mvrow .num { width: 22px; color: var(--muted-2); font-size: 13px; }

/* Sammlungen */
.coll { display: flex; flex-direction: column; gap: 8px; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); }
.coll .name { font-size: 16px; font-weight: 700; } .coll .meta { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: -6px; }
.mosaic { height: 120px; border-radius: 18px; overflow: hidden; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.mosaic div { position: relative; overflow: hidden; }
.mosaic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.favcard { display: flex; align-items: center; gap: 14px; background: var(--ink); color: #FAFAF9; border-radius: 20px; padding: 16px; border: 0; }
.favcard b { font-size: 17px; } .favcard span span { font-size: 13px; color: #C9D1CF; }
.favic { width: 48px; height: 48px; border-radius: 14px; background: var(--petrol); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Einkaufswoche */
.btn.soft { background: var(--petrol-tint); color: var(--petrol); }
.ovstat { font-size: 14px; color: var(--ink-2); padding-bottom: 2px; }
.ovstat b { color: var(--ink); }
.ovstat .free { color: var(--petrol); font-weight: 700; }
.shoplink { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 2px 0 0; font-size: 13px; }
.wd .shopday { margin-top: 6px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--petrol-tint); color: var(--petrol); font-style: normal; }

/* Löschen */
.btn.danger { background: var(--danger); color: #FFF; }
.link.danger { color: var(--danger); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
