/* Menu Planer – Gestaltung. Farben nur hier oben ändern. */
:root {
  --bg: #F4F1EA; --surface: #FFFFFF; --surface2: #ECE8DE; --ink: #1D2A22; --muted: #6B776E;
  --line: rgba(29, 42, 34, .10); --accent: #2F4A3A; --accent-ink: #FFFFFF; --sage: #8FA082; --sage-soft: #DDE5D5;
  --warm: #C8643C; --warm-soft: #F6E3D8; --gold: #C79A3B; --danger: #B3402E;
  --shadow: 0 1px 2px rgba(29, 42, 34, .05), 0 10px 30px -12px rgba(29, 42, 34, .22);
  --r: 22px; --r-s: 14px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1411; --surface: #19201B; --surface2: #222B25; --ink: #ECEFE8; --muted: #98A39A;
    --line: rgba(236, 239, 232, .10); --accent: #A9C196; --accent-ink: #10160F; --sage: #7F9273; --sage-soft: #26322A;
    --warm: #E58A62; --warm-soft: #3A251C; --gold: #D9B25A; --danger: #E5705D;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -14px rgba(0, 0, 0, .7);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 34px; line-height: 1.08; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#app { max-width: 1180px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 112px); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.sec a, .sec button { font-size: 14px; color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* Navigation */
#tabs { position: fixed; z-index: 20; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%); display: flex; gap: 2px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
#tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 66px; padding: 8px 0 6px; border-radius: 22px; font-size: 10.5px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
#tabs button.on { background: var(--accent); color: var(--accent-ink); }
#tabs .dot { position: absolute; margin: -2px 0 0 22px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--warm); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

/* Bausteine */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 16px; background: var(--surface2); font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .12s; }
.btn:active, .icon-btn:active, .rc:active { transform: scale(.97); }
.btn.pri { background: var(--accent); color: var(--accent-ink); }
.btn.warm { background: var(--warm); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 550; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 10px; }
.chips::-webkit-scrollbar { display: none; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 9px; background: var(--sage-soft); font-size: 11.5px; font-weight: 600; }
.tag.warm { background: var(--warm-soft); color: var(--warm); }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 12px; }
.search input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Rezeptkarten */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.rc { position: relative; display: block; text-align: left; background: var(--surface); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s; }
.rc .ph, .rc img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ph { display: grid; place-items: center; font: 600 64px/1 var(--serif); color: rgba(255, 255, 255, .85); background: linear-gradient(140deg, var(--sage), var(--accent)); }
.ph.h1 { background: linear-gradient(140deg, #D9A27A, #B35A36); } .ph.h2 { background: linear-gradient(140deg, #C7B07A, #8C6B2C); } .ph.h3 { background: linear-gradient(140deg, #9DB3A7, #3F6657); }
.rc .info { position: absolute; inset: auto 0 0 0; padding: 38px 12px 11px; color: #fff; background: linear-gradient(transparent, rgba(12, 18, 14, .82)); }
.rc .info b { display: block; font: 600 16px/1.2 var(--serif); }
.rc .info span { font-size: 11.5px; opacity: .88; }
.rc .fav { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: var(--warm); }
.rc .fav svg { width: 16px; height: 16px; fill: currentColor; }
.rc .fit { position: absolute; top: 9px; left: 9px; background: var(--gold); color: #fff; padding: 3px 8px; border-radius: 9px; font-size: 10.5px; font-weight: 700; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 18px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .rc { flex: 0 0 150px; scroll-snap-align: start; }

/* Heute */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 20px; color: #fff; background: linear-gradient(135deg, #3B5A47, #22362B 70%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(199, 154, 59, .45), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: rgba(255, 255, 255, .7); }
.hero p { opacity: .9; font-size: 14.5px; margin-top: 6px; max-width: 34em; }
.rings { display: flex; gap: 18px; margin-top: 16px; }
.ring { display: flex; align-items: center; gap: 10px; }
.ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring .bg { stroke: rgba(255, 255, 255, .18); } .ring .fg { stroke: #fff; transition: stroke-dashoffset .6s; } .ring.gold .fg { stroke: #E7C675; }
.ring b { display: block; font: 600 18px/1.1 var(--serif); } .ring span { font-size: 12px; opacity: .8; display: block; } .rings { flex-wrap: wrap; }
.meal { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 10px; }
.meal img, .meal .ph { width: 62px; height: 62px; border-radius: 14px; object-fit: cover; font-size: 26px; flex: none; }
.meal small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.meal b { font: 600 17px/1.2 var(--serif); }
.alert { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 18px; background: var(--warm-soft); color: var(--warm); font-weight: 600; font-size: 14px; margin-top: 10px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick button { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); font-weight: 600; font-size: 14.5px; }
.quick button svg { color: var(--accent); }
.quick button span { font-weight: 400; font-size: 12.5px; color: var(--muted); }

/* Planer */
.weeknav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.weeknav b { flex: 1; text-align: center; font: 600 17px var(--serif); }
.days { display: grid; gap: 12px; }
.day { background: var(--sage-soft); border-radius: var(--r); padding: 12px; }
.day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.day header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.day header b { font: 600 17px var(--serif); } .day header small { color: var(--muted); margin-left: 6px; }
.train { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; }
.day header { flex-wrap: wrap; }
.train.t-kraft, .train.t-zirkel { color: var(--warm); } .train.t-hart, .train.t-lang { color: var(--gold); } .train.t-ruhe { color: var(--muted); }
.slot { margin-top: 6px; }
.slot > small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 0 4px 4px; }
.entry, .add-slot { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 6px 10px 6px 6px; border-radius: 14px; background: var(--surface); text-align: left; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); margin-bottom: 6px; }
.entry img, .entry .ph { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; font-size: 17px; flex: none; }
.entry b { font-weight: 600; font-size: 14.5px; line-height: 1.2; } .entry span { font-size: 11.5px; color: var(--muted); display: block; }
.entry.text { padding-left: 14px; font-family: var(--serif); }
.add-slot { justify-content: center; background: transparent; border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); box-shadow: none; color: var(--muted); font-size: 13.5px; font-weight: 600; min-height: 42px; }
.daysum { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.planbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 16px 0 4px; }
.planbar .btn { padding: 0 8px; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Listen (Einkauf, Vorrat) */
.group-t { font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin: 20px 4px 8px; }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); min-height: 56px; }
.li:last-child { border-bottom: 0; }
.li .t { flex: 1; min-width: 0; text-align: left; } .li .t b { font-weight: 600; display: block; } .li .t span { font-size: 12.5px; color: var(--muted); }
.li.done .t b { text-decoration: line-through; color: var(--muted); }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--sage); display: grid; place-items: center; flex: none; color: transparent; }
.li.done .check, .check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check svg { width: 15px; height: 15px; stroke-width: 2.6; }
.mig { display: grid; place-items: center; height: 34px; padding: 0 10px; border-radius: 10px; background: #FF6600; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .02em; flex: none; }
.step { display: flex; align-items: center; background: var(--surface2); border-radius: 12px; flex: none; }
.step button { width: 34px; height: 34px; font-size: 19px; font-weight: 600; } .step span { min-width: 56px; text-align: center; font-size: 13.5px; font-weight: 600; }
.badge { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 8px; background: var(--warm-soft); color: var(--warm); margin-left: 6px; }
.fab { position: fixed; z-index: 15; right: max(16px, calc(50% - 574px)); bottom: calc(var(--safe-b) + 96px); height: 56px; padding: 0 20px; border-radius: 28px; display: flex; align-items: center; gap: 8px; background: var(--warm); color: #fff; font-weight: 700; box-shadow: 0 10px 28px -8px rgba(200, 100, 60, .7); }

/* Rezept-Detail */
.layer { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; animation: fade .22s; } /* nur einblenden: ein Verschieben würde die festen Leisten mitziehen */
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.d-hero { position: relative; height: min(56vh, 460px); }
.d-hero img, .d-hero .ph { width: 100%; height: 100%; object-fit: cover; font-size: 120px; }
.d-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .28), transparent 30%, transparent 60%, var(--bg)); }
.d-top { position: fixed; z-index: 2; top: calc(var(--safe-t) + 12px); left: 14px; right: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.d-top > * { pointer-events: auto; } .d-top .icon-btn { background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.d-body { position: relative; max-width: 760px; margin: -64px auto 0; padding: 0 18px calc(var(--safe-b) + 120px); }
.meta { display: flex; gap: 18px; margin: 14px 0; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.meta b { color: var(--ink); display: block; font: 600 17px var(--serif); }
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri div { background: var(--surface); border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow); }
.nutri b { display: block; font: 600 19px var(--serif); } .nutri span { font-size: 11px; color: var(--muted); }
.mbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 10px; background: var(--surface2); }
.mbar i { display: block; } .mbar .p { background: var(--warm); } .mbar .c { background: var(--gold); } .mbar .f { background: var(--sage); }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; } .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.ing { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.ing .q { flex: 0 0 84px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ing.x { opacity: .4; text-decoration: line-through; }
.ing .have { color: var(--sage); font-size: 11px; font-weight: 700; margin-left: 6px; }
.ing-g { font: 600 14px var(--serif); color: var(--warm); margin: 16px 0 2px; }
.steps { counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 44px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 600 14px var(--serif); }
.tip { background: var(--sage-soft); border-radius: 16px; padding: 12px 14px; font-size: 14px; }
.d-bar { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--safe-b) + 12px); display: flex; gap: 10px; justify-content: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.d-bar .btn { flex: 1; max-width: 240px; }

/* Bottom-Sheet */
#sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 16, 12, .45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sh { width: 100%; max-width: 620px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 18px calc(var(--safe-b) + 22px); animation: up .3s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 700px) { #sheet { align-items: center; } .sh { border-radius: 28px; } }
.sh::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sh-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 10px; text-align: left; }
.opt svg { color: var(--accent); } .opt b { display: block; } .opt span { font-size: 13px; color: var(--muted); }
.opt.danger, .opt.danger svg { color: var(--danger); }
label.f { display: block; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label.f input, label.f select, label.f textarea, .inp { display: block; width: 100%; margin-top: 5px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 400; outline: 0; }
label.f textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
label.f input:focus, label.f textarea:focus, label.f select:focus { border-color: var(--accent); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--sage-soft); border-top-color: var(--accent); animation: sp 1s linear infinite; margin: 30px auto 16px; }
@keyframes sp { to { transform: rotate(360deg); } }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; } .thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 12px; }

/* Kochmodus */
#cook { z-index: 50; background: #0E130F; color: #F0F3EC; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 14px) 22px calc(var(--safe-b) + 18px); }
#cook .c-top { display: flex; justify-content: space-between; align-items: center; color: #9FAC9F; font-size: 14px; }
#cook .c-step { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 820px; margin: 0 auto; width: 100%; }
#cook .c-step small { color: #E7C675; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; font-size: 13px; }
#cook .c-step p { font: 500 clamp(24px, 4.6vw, 40px)/1.32 var(--serif); margin-top: 14px; }
#cook .c-nav { display: flex; gap: 12px; } #cook .c-nav .btn { flex: 1; min-height: 60px; font-size: 17px; background: #1E2720; color: #F0F3EC; } #cook .c-nav .btn.pri { background: #A9C196; color: #10160F; }
#cook .prog { height: 4px; background: #1E2720; border-radius: 2px; margin: 12px 0; } #cook .prog i { display: block; height: 100%; background: #A9C196; border-radius: 2px; transition: width .3s; }
#cook .c-ing { max-height: 30vh; overflow-y: auto; font-size: 15px; color: #C9D2C6; border-top: 1px solid #1E2720; padding-top: 10px; margin-bottom: 12px; columns: 2; column-gap: 20px; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--safe-b) + 110px); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 16px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; max-width: 88vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* iPad und grösser */
@media (min-width: 760px) {
  #app { padding-left: 28px; padding-right: 28px; }
  h1 { font-size: 42px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
  .hscroll .rc { flex-basis: 190px; }
  .days { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .home2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: start; }
  .two { columns: 2; column-gap: 26px; } .two > * { break-inside: avoid; }
  .d-body { margin-top: -90px; }
}
@media (min-width: 1100px) { .days { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
