/* Essensplaner – warm, hell, Grün & Orange, für Handys optimiert */
:root {
  --bg: #fbf6ec; --card: #ffffff; --ink: #24301f; --muted: #6b7363; --line: #ece3d2;
  --green: #3f7d3a; --green-2: #5a9e4b; --green-l: #e8f2df; --orange: #ef7d1f; --orange-l: #fff1e0; --red: #c2402f; --red-l: #fdecea;
  --p: #3a7bd5; --r: #c2587e; --radius: 16px; --shadow: 0 2px 10px rgba(80, 60, 20, .08);
  --nav-h: 64px; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
body.has-sheet { overflow: hidden; }
h1, h2, h3, h4 { line-height: 1.2; margin: .3em 0; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; }
p { margin: .4em 0; } small { color: var(--muted); } a { color: var(--green); }
.center { text-align: center; } .hint { color: var(--muted); font-size: .88rem; } .ok { color: var(--green); } .warn-t { color: #a85a00; } .why { color: #6b5a2e; display: block; }
code { font-size: .8rem; background: #f4efe4; padding: 1px 4px; border-radius: 4px; word-break: break-all; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--green-l); border-bottom: 1px solid #d6e6c8; }
.top h1 { flex: 1; font-size: 1.15rem; margin: 0; color: #2c5a29; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { border: 0; background: none; font-size: 2rem; line-height: 1; color: var(--green); padding: 0 6px; cursor: pointer; }
.sync { border: 0; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 600; cursor: pointer; background: #fff; color: var(--muted); max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync.ok { color: var(--green); } .sync.ok::before { content: "● "; }
.sync.busy { color: #8a6d1d; } .sync.warn { background: var(--orange-l); color: #a85a00; } .sync.err { background: var(--red-l); color: var(--red); }
.testbanner { background: repeating-linear-gradient(45deg, #fff1e0, #fff1e0 10px, #ffe3c2 10px, #ffe3c2 20px); color: #8a4a00; text-align: center; font-weight: 700; font-size: .85rem; padding: 6px; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px; }

/* Navigation unten */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.04); }
.nav button { flex: 1; border: 0; background: none; padding: 8px 2px 10px; font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: var(--nav-h); }
.nav button span { font-size: 1.35rem; } .nav button.active { color: var(--green); font-weight: 700; }
.nav button.active span { background: var(--green-l); border-radius: 12px; padding: 0 12px; }

/* Karten & Knöpfe */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 12px 0; }
.card.slim { padding: 10px 14px; } .card.warn { background: #fff8ec; border: 1px solid #f6d6a8; } .card.note { background: #fffbe9; border: 1px solid #efe2a6; } .card.ok { background: var(--green-l); }
.card.prep { background: var(--orange-l); border: 1px solid #f7d2a6; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border-radius: 14px; border: 1px solid #d9d1bf; background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; } .btn.orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.ghost { background: transparent; } .btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 12px; }
.btn.big { min-height: 56px; font-size: 1.05rem; } .btn.wide { width: 100%; margin: 8px 0; } .btn.on { background: var(--green-l); border-color: var(--green-2); }
.link { border: 0; background: none; color: var(--green); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 2px; }
.filebtn input { display: none; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; flex-wrap: wrap; } .row.two > * { flex: 1; }
.row > .field { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; } .grid2 .btn { font-size: .92rem; padding: 8px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #efe9dc; color: #5f5640; margin: 2px 4px 2px 0; }
.badge.ok { background: var(--green-l); color: var(--green); } .badge.orange { background: var(--orange-l); color: #b05a00; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.sec { margin: 18px 0 6px; color: #2c5a29; }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: .88rem; color: var(--muted); font-weight: 600; }
.field.inline { flex-direction: row; align-items: center; flex-wrap: wrap; } .field.inline input { width: 7em; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid #d9d1bf; border-radius: 12px; padding: 10px 12px; background: #fff; min-height: 46px; width: 100%; }
textarea { min-height: 100px; } select[multiple] { min-height: 110px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid #b9da9f; outline-offset: 1px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 6px 12px 6px 0; font-size: .95rem; } .check input { width: 22px; height: 22px; min-height: 0; }
fieldset { border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; padding: 8px 12px; } legend { font-weight: 700; padding: 0 6px; }
.calc { background: #f7f3e8; border-radius: 10px; padding: 6px 10px; font-size: .88rem; }
.search { display: flex; gap: 8px; } .search input { flex: 1; }

/* Start */
.hello h2 { font-size: 1.5rem; color: #2c5a29; margin-top: 4px; } .hello p { color: var(--muted); margin: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.tile { background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; color: var(--ink); min-height: 104px; }
.tile span { font-size: 1.6rem; } .tile small { font-size: .78rem; }

/* Mahlzeiten */
.weeknav { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: center; margin: 4px 0 8px; } .weeknav .btn { min-width: 48px; font-size: 1.3rem; }
.day { margin: 14px 0; } .day-h { display: flex; align-items: baseline; justify-content: space-between; } .day-h h3 { color: #2c5a29; }
.meal { display: flex; gap: 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; margin: 8px 0; cursor: pointer; width: 100%; text-align: left; border: 0; font: inherit; color: inherit; }
.meal.off { opacity: .75; cursor: default; background: #faf7f0; } .meal.empty { border: 2px dashed #d9cdb5; box-shadow: none; } .meal.done { background: #f3f8ee; }
.meal-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meal-h { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .when { font-size: .75rem; font-weight: 800; color: var(--green); background: var(--green-l); padding: 2px 8px; border-radius: 8px; margin-right: auto; }
.dish { font-size: 1.02rem; } .meta { font-size: .8rem; }
.pps { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; } .pp { display: inline-flex; align-items: center; gap: 4px; }
.meal-art.art-ph { width: 84px; height: 84px; border-radius: 12px; background: #f1ebdd; display: grid; place-items: center; font-size: 2rem; color: #b5a888; flex: none; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: -2px 0 14px; }
.qa { border: 1px solid #e3d9c4; background: #fffdf8; border-radius: 12px; padding: 10px 6px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; min-height: 44px; }
.qa.green { background: var(--green); color: #fff; border-color: var(--green); }

/* Personen */
.ava { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 800; font-style: normal; flex: none; }
.ava-patrick { background: var(--p); } .ava-rachel { background: var(--r); }
.pchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #dcd3c0; border-radius: 999px; padding: 3px 9px 3px 3px; background: #fff; font: inherit; font-size: .85rem; cursor: pointer; min-height: 32px; }
.pchip.small { padding: 2px; min-height: 28px; } .pchip.small em { font-size: .7rem; }
.pchip.off { opacity: .4; filter: grayscale(1); } .pchip.away { background: #fff4e5; border-color: #f0c992; } .pchip em { font-style: normal; }
.grid-att { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 6px; align-items: center; margin: 10px 0; }
.gh { font-weight: 800; color: var(--green); text-align: center; font-size: .85rem; } .gd { font-weight: 700; } .gd small { display: block; font-weight: 400; }
.gc { display: flex; flex-direction: column; gap: 4px; align-items: stretch; } .gc .pchip { justify-content: flex-start; font-size: .78rem; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; } .seg button { border: 1px solid #ddd3be; background: #fff; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .85rem; cursor: pointer; } .seg button.on { background: var(--green); color: #fff; border-color: var(--green); }

/* Bilder */
.art { position: relative; overflow: hidden; border-radius: 12px; background: #f6efe2; flex: none; }
.art svg, .art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art.thumb { width: 84px; height: 84px; } .art.card { width: 100%; aspect-ratio: 6/5; } .art.wide { width: 100%; height: 150px; margin-bottom: 8px; } .art.hero { width: 100%; height: 210px; border-radius: var(--radius); }
.art-tag { position: absolute; right: 4px; bottom: 4px; background: rgba(255,255,255,.88); color: #6b5a2e; font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 6px; }
.art.thumb .art-tag { font-size: .5rem; }

/* Rezepte */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .tags.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .tags.small .tag { font-size: .78rem; padding: 4px 8px; }
.tag { border: 1px solid #ddd3be; background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .88rem; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tag.on, .tag:has(input:checked) { background: var(--green-l); border-color: var(--green-2); color: #2c5a29; font-weight: 700; }
.tag input { width: 16px; height: 16px; min-height: 0; margin: 0; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rcard { background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; }
.rcard .art { border-radius: 0; } .rc-b { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; } .rc-b small { font-size: .74rem; }
.rate { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; } .rate span { font-weight: 700; min-width: 64px; }
.ings { list-style: none; padding: 0; } .ings li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.ing { border: 0; background: none; font: inherit; text-align: left; padding: 8px 0; cursor: pointer; color: inherit; flex: 1; }
.steps-l li { margin: 8px 0; } .ing-row { display: grid; grid-template-columns: 1fr 5em 5.5em; gap: 6px; margin: 6px 0; }
.nutri b { color: #2c5a29; } .nutri i { font-style: normal; font-size: .75rem; padding: 1px 6px; border-radius: 6px; } .nutri i.good { background: var(--green-l); color: var(--green); } .nutri i.low { background: var(--orange-l); color: #a85a00; }

/* Listen */
.list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.alt { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 10px; font: inherit; color: inherit; cursor: pointer; width: 100%; min-height: 52px; }
.alt span { display: flex; flex-direction: column; gap: 2px; } .alt small { font-size: .8rem; }
.plain { padding-left: 18px; } .plain li { margin: 4px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; } .tbl td, .tbl th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; } .tbl tr.sum td { border-top: 2px solid var(--line); }
.tbl.times select { min-height: 38px; padding: 4px; font-size: .85rem; }
.issue { border-top: 1px solid #f1dfc2; padding: 8px 0; } .issue:first-of-type { border-top: 0; }

/* Balken */
.bar { margin: 8px 0; } .bar-l { display: flex; justify-content: space-between; font-size: .85rem; } .bar-t { height: 10px; background: #efe8d8; border-radius: 6px; overflow: hidden; margin-top: 3px; }
.bar-t i { display: block; height: 100%; background: var(--orange); border-radius: 6px; } .bar.good .bar-t i { background: var(--green-2); }

/* Wizard */
.steps { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; }
.step { flex: 1; min-width: 64px; border: 0; background: #efe8d8; border-radius: 12px; padding: 6px 4px; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.step small { font-size: .62rem; font-weight: 600; text-align: center; } .step.on { background: var(--orange); color: #fff; } .step.on small { color: #fff; } .step.done { background: var(--green-l); color: var(--green); }
.sug { border-top: 1px solid var(--line); padding: 6px 0; }

/* Vorrat & Einkauf */
.pitem { display: flex; gap: 10px; align-items: center; background: #fff; border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; margin: 6px 0; text-align: left; font: inherit; color: inherit; width: 100%; cursor: pointer; }
.pitem.first { box-shadow: inset 4px 0 0 var(--orange), var(--shadow); } .pitem .em { font-size: 1.6rem; } .pb { flex: 1; display: flex; flex-direction: column; } .pb small { font-size: .78rem; }
.confirm-item { border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; margin: 8px 0; } .confirm-item.uncertain { border: 2px solid #f0b35e; background: #fffaf2; }
.srow { display: flex; align-items: stretch; gap: 8px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); margin: 6px 0; }
.srow .chk { width: 54px; min-height: 56px; border: 0; border-right: 1px solid var(--line); background: none; font-size: 1.4rem; color: #fff; cursor: pointer; display: grid; place-items: center; }
.srow .chk::before { content: ""; position: absolute; } .srow .chk { position: relative; }
.srow .chk { background-image: radial-gradient(circle, transparent 0); }
.srow:not(.checked) .chk::after { content: ""; width: 26px; height: 26px; border: 2px solid #b9ad93; border-radius: 8px; }
.srow.checked .chk { background: var(--green-2); border-radius: 14px 0 0 14px; }
.srow .sb { flex: 1; border: 0; background: none; text-align: left; font: inherit; color: inherit; padding: 8px 8px 8px 0; display: flex; flex-direction: column; cursor: pointer; } .sb span { font-size: .9rem; } .sb small { font-size: .76rem; }
.srow.checked .sb b { text-decoration: line-through; color: var(--muted); } .srow.obsolete { opacity: .8; background: #fdf6ea; }
.add input[name=name] { flex: 1; min-width: 0; } .add select { width: 6.5em; }
.chain { display: inline-block; background: var(--c, #777); color: #fff; font-weight: 800; font-size: .78rem; padding: 6px 12px; border-radius: 999px; }
.offer { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px; margin: 6px 0; } .offer .ob { flex: 1; display: flex; flex-direction: column; gap: 2px; } .offer.abgelaufen { opacity: .55; }
.verdict { background: var(--green-l); border-radius: 12px; padding: 6px 10px; margin: 8px 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; } .kpi b { font-size: 1.35rem; color: #2c5a29; }

/* Bottom-Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 25, 10, .42); }
.sheet { position: relative; background: var(--bg); width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
.sheet.wide { max-width: 760px; } .sheet > h3:first-of-type { padding-right: 44px; } .sheet-x { position: absolute; top: 10px; right: 10px; border: 0; background: #efe8d8; width: 38px; height: 38px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; max-width: 560px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateY(20px); opacity: 0; pointer-events: none; background: #2d3a28; color: #fff; padding: 10px 14px; border-radius: 14px; display: flex; gap: 12px; align-items: center; z-index: 60; transition: .2s; font-size: .92rem; }
.toast span { flex: 1; } .toast.show { opacity: 1; transform: none; pointer-events: auto; } .toast.err { background: var(--red); }
.toast-btn { border: 0; background: #fff; color: #2d3a28; font-weight: 700; border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.login { max-width: 420px; margin: 30px auto; text-align: center; } .login .logo { font-size: 3rem; } .login form { text-align: left; }
details summary { cursor: pointer; font-weight: 600; color: var(--green); margin: 6px 0; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } .quick { grid-template-columns: repeat(3, 1fr); } .art.thumb { width: 100px; height: 100px; } }
@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } .grid-att { grid-template-columns: 44px 1fr 1fr; } }
