/* ADHS Küchenhelden – Stylesheet
   Farben angelehnt an Buchcover und Innenteil (hellgrün, blau, orange, violett, gelb, weiß).
   Für Text werden nur dunkle Farbtöne mit ausreichendem Kontrast (WCAG AA) verwendet. */

@font-face { font-family: "KH Inter"; src: url("../fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "KH Inter"; src: url("../fonts/inter-600.woff") format("woff"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "KH Poppins"; src: url("../fonts/poppins-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "KH Poppins"; src: url("../fonts/poppins-700.woff") format("woff"); font-weight: 600 700; font-display: swap; }

:root {
  --navy: #1F2A5A; --ink: #1F2A5A; --muted: #4A5374;
  --blue: #1C3F94; --blue-soft: #E3EAF8; --sky: #2E86DE;
  --green: #3FA34D; --green-dark: #1D6E2E; --green-soft: #E4F4D5; --page: #F4FAEA;
  --orange: #F28C28; --orange-dark: #9A4500; --orange-soft: #FFE9D3;
  --purple: #7E57C2; --purple-dark: #5A3696; --purple-soft: #EEE6FA;
  --pink: #E8547A; --pink-dark: #A3244B; --pink-soft: #FCE3EA;
  --yellow: #F7C531; --yellow-soft: #FFF4CC;
  --red: #B3261E; --white: #fff; --line: #D5DCC8;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 42, 90, .08), 0 4px 14px rgba(31, 42, 90, .07);
  --tabbar-h: 68px;
  --font: "KH Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "KH Poppins", "KH Inter", system-ui, sans-serif;
}
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; }
html[data-textsize="gross"] { font-size: 118.75%; }
html[data-textsize="sehrgross"] { font-size: 131.25%; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--page); line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.75rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.3rem; margin: 0 0 .75rem; }
h3 { font-size: 1.08rem; margin: 0 0 .4rem; }
p { margin: 0 0 .75rem; }
small { font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { width: 1.35em; height: 1.35em; flex: none; }
.ico.big { width: 64px; height: 64px; color: var(--green-dark); }

/* Fokus gut sichtbar (Tastatur) */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
main:focus, h1[tabindex="-1"]:focus { outline: none; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; z-index: 100; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Kopfzeile & Navigation */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); min-height: 48px; }
.brand img { width: 44px; height: 44px; background: var(--green-soft); border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.brand-sub { font-size: .78rem; color: var(--muted); display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 48px; padding: 0 10px;
  border: 2px solid transparent; background: transparent; color: var(--navy); border-radius: 12px; cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--green-soft); }
.icon-btn.big { min-width: 56px; min-height: 56px; border-color: var(--line); background: var(--white); }
.icon-btn-label { display: none; font-weight: 600; }
.icon-btn > svg { width: 26px; height: 26px; flex: none; }
.icon-btn[aria-current="page"] { background: var(--green-soft); border-color: var(--green); }

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h);
  color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 600; border-top: 4px solid transparent; }
.tabbar a .ico, .tabbar svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--green-dark); border-top-color: var(--green); background: var(--green-soft); }
.tabbar a:hover { color: var(--navy); }

.view { max-width: 1120px; margin: 0 auto; padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.banner { background: var(--yellow-soft); border-bottom: 2px solid var(--yellow); padding: 10px 16px; }
.banner p { max-width: 1120px; margin: 0 auto 4px; }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px;
  border: 2px solid var(--navy); background: var(--white); color: var(--navy); font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.btn:hover { background: var(--blue-soft); }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.btn-primary:hover { background: #175A25; border-color: #175A25; }
.btn-secondary { background: var(--white); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #8E1E18; }
.btn-danger-text { color: var(--red); border-color: var(--red); }
.btn-danger-text:hover { background: #FCE8E6; }
.btn-link { background: none; border: none; color: var(--blue); text-decoration: underline; padding: 6px 4px; min-height: 44px; cursor: pointer; font-weight: 600; }
.btn-big { min-height: 56px; font-size: 1.08rem; padding: 12px 24px; }
.btn-small { min-height: 44px; padding: 6px 12px; font-size: .9rem; border-width: 2px; border-color: var(--line); }
.btn-add { width: 100%; border-style: dashed; border-color: var(--green-dark); color: var(--green-dark); background: transparent; border-radius: var(--radius-sm); }
.btn-add:hover { background: var(--green-soft); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

/* ---------------------------------------------------------------- Formularfelder, Chips */
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--white); border: 2px solid #8A93AD; border-radius: 14px; padding: 0 12px; }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-box input { flex: 1; border: none; outline: none; background: transparent; min-height: 52px; font-size: 1.05rem; min-width: 0; }
.search-box .ico { color: var(--muted); }
input[type="text"], textarea { border: 2px solid #8A93AD; border-radius: 12px; padding: 10px 12px; min-height: 52px; background: var(--white); width: 100%; }
input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.inline-field { display: flex; gap: 8px; }
.inline-field input { flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 13px; font-size: .94rem; border-radius: 999px; border: 2px solid var(--line);
  background: var(--white); color: var(--navy); font-weight: 600; cursor: pointer; }
.chip .ico { width: 1.1em; height: 1.1em; }
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓"; font-weight: 700; }
.filter-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.filter-status p { margin: 0; font-weight: 600; }

.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.seg-wrap { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.seg-col { grid-template-columns: 1fr; }
.seg-days { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.seg-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 6px 8px; border: 2px solid var(--line);
  background: var(--white); border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--navy); text-align: center; }
.seg-btn small { font-weight: 400; color: var(--muted); }
.seg-btn:hover { border-color: var(--navy); }
.seg-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: inset 0 -4px 0 var(--yellow); }
.seg-btn[aria-pressed="true"] small { color: #E6E9F5; }
fieldset { border: none; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* ---------------------------------------------------------------- Startseite */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; margin-bottom: 16px;
  background: linear-gradient(135deg, #EAF7D8 0%, #D9F0C1 100%); border-radius: 22px; overflow: hidden; border: 2px solid #CBE7AE; }
.hero::before { content: ""; position: absolute; width: 180px; height: 180px; right: -40px; top: -60px; background: var(--yellow-soft); border-radius: 50%; }
.hero-text { position: relative; }
.hero-title { font-size: 2rem; margin: 0 0 4px; letter-spacing: -.01em; }
.hero-title::after { content: ""; display: block; width: 120px; height: 8px; margin-top: 6px; border-radius: 6px;
  background: linear-gradient(90deg, var(--orange) 0 25%, var(--sky) 25% 50%, var(--green) 50% 75%, var(--purple) 75%); }
.hero-sub { font-weight: 700; font-size: 1.08rem; color: var(--green-dark); margin: 8px 0 6px; }
.hero-welcome { font-size: 1.05rem; margin: 0; }
.hero-leo { position: relative; width: 84px; height: auto; flex: none; }
.main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.big-tile { display: flex; flex-direction: column; gap: 4px; min-height: 128px; padding: 16px; border-radius: 18px; text-decoration: none; color: var(--navy);
  background: var(--white); border: 2px solid var(--line); border-top-width: 8px; box-shadow: var(--shadow); }
.big-tile > span { font-family: var(--font-head); font-weight: 700; font-size: clamp(.86rem, 3.9vw, 1.05rem); line-height: 1.2; text-transform: uppercase; letter-spacing: .01em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.big-tile small { color: var(--muted); font-size: .86rem; }
.big-tile .ico { width: 38px; height: 38px; padding: 6px; border-radius: 12px; margin-bottom: 4px; }
.big-tile:hover { transform: translateY(-1px); border-color: var(--navy); }
.t-orange { border-top-color: var(--orange); } .t-orange .ico { background: var(--orange-soft); color: var(--orange-dark); }
.t-green { border-top-color: var(--green); } .t-green .ico { background: var(--green-soft); color: var(--green-dark); }
.t-blue { border-top-color: var(--sky); } .t-blue .ico { background: var(--blue-soft); color: var(--blue); }
.t-purple { border-top-color: var(--purple); } .t-purple .ico { background: var(--purple-soft); color: var(--purple-dark); }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h2 small { display: block; font-family: var(--font); font-weight: 400; font-size: .9rem; color: var(--muted); margin-top: 2px; }
.today-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.today-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); text-decoration: none; color: var(--navy); }
.today-item:hover { border-color: var(--navy); }
.today-item img { width: 84px; height: 63px; object-fit: cover; border-radius: 8px; }
.today-item span { display: flex; flex-direction: column; }
.today-item small { color: var(--muted); }
.today-empty { background: var(--green-soft); border-radius: 12px; padding: 14px; }
.book { display: flex; gap: 16px; align-items: flex-start; }
.book img { width: 96px; border-radius: 6px; box-shadow: var(--shadow); flex: none; }
@media (max-width: 400px) { .book img { width: 72px; } .book { gap: 12px; } }

/* ---------------------------------------------------------------- Rezeptkarten */
.page-title { margin-top: 4px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 156px), 1fr)); }
.card { position: relative; background: var(--white); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; border-bottom: 5px solid var(--cc, var(--green)); }
.card-link { display: flex; flex-direction: column; height: 100%; color: var(--navy); text-decoration: none; }
.card-link:hover .card-title { text-decoration: underline; }
.card-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--green-soft); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.card-cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ccd, var(--green-dark)); }
.card-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.card-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .82rem; margin-top: auto; }
.card-meta .ico { width: 1.1em; height: 1.1em; }
.fav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.card-fav { position: absolute; top: 8px; right: 8px; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--white);
  background: rgba(255, 255, 255, .95); color: var(--pink-dark); box-shadow: var(--shadow); }
.card-fav .ico { width: 26px; height: 26px; }
.fav-btn[aria-pressed="true"] { color: var(--pink-dark); }
.c1 { --cc: var(--orange); --ccd: var(--orange-dark); --ccs: var(--orange-soft); }
.c2 { --cc: var(--green); --ccd: var(--green-dark); --ccs: var(--green-soft); }
.c3 { --cc: var(--sky); --ccd: var(--blue); --ccs: var(--blue-soft); }
.c4 { --cc: var(--purple); --ccd: var(--purple-dark); --ccs: var(--purple-soft); }
.c5 { --cc: var(--pink); --ccd: var(--pink-dark); --ccs: var(--pink-soft); }
.chip.c1, .chip.c2, .chip.c3, .chip.c4, .chip.c5 { border-color: var(--cc); }
.chip.c1[aria-pressed="true"], .chip.c2[aria-pressed="true"], .chip.c3[aria-pressed="true"], .chip.c4[aria-pressed="true"], .chip.c5[aria-pressed="true"] { background: var(--ccd); border-color: var(--ccd); }
.empty, .empty-state { list-style: none; grid-column: 1 / -1; text-align: center; padding: 28px 16px; background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius); }
.empty-state .row { justify-content: center; }
.empty-small { list-style: none; padding: 16px; color: var(--muted); }
.empty-hint { margin-top: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- Rezeptseite */
.crumbs { margin-bottom: 4px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.recipe-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; margin: 0; }
.cat-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--ccs, var(--green-soft)); color: var(--ccd, var(--green-dark)); font-weight: 700; font-size: .85rem; border: 1px solid var(--cc, var(--green)); }
.recipe .page-title { font-size: 1.85rem; margin: 6px 0 8px; }
.recipe-desc { font-size: 1.08rem; }
.recipe-photo { margin: 0 0 14px; }
.recipe-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; background: var(--green-soft); }
.facts { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.facts li { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.facts .ico { color: var(--ccd, var(--green-dark)); width: 28px; height: 28px; }
.facts span { display: flex; flex-direction: column; line-height: 1.25; }
.facts small { color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
.fav-wide { color: var(--navy); }
.fav-wide .ico { color: var(--pink-dark); }
.recipe-grid { display: grid; gap: 16px; }
.ingredients, .steps { margin-bottom: 0; }
.ing-list { list-style: none; padding: 0; margin: 12px 0; }
.ing-list li { padding: 9px 0 9px 26px; border-bottom: 1px solid #ECEFE4; position: relative; }
.ing-list li::before { content: ""; position: absolute; left: 6px; top: 1.05em; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--green)); }
.ing-list li.ing-group { padding-left: 0; font-weight: 700; color: var(--navy); border-bottom: none; padding-top: 14px; }
.ing-list li.ing-group::before { display: none; }
.scaled-note { background: var(--yellow-soft); border-left: 5px solid var(--yellow); padding: 10px 12px; border-radius: 8px; font-size: .92rem; }
.allergens { background: var(--blue-soft); border-radius: 12px; padding: 12px 14px; }
.allergens h3 { margin: 0 0 4px; }
.allergens p { margin: 0; }
.step-list { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; }
.step-list li { counter-increment: s; position: relative; padding: 0 0 14px 48px; min-height: 40px; }
.step-list li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--ccd, var(--green-dark)); color: #fff; font-weight: 700; font-family: var(--font-head); }
.notes { display: grid; gap: 12px; margin: 16px 0; }
.note { border-radius: 14px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-left-width: 6px; }
.note p { margin: 0; }
.note-g { border-left-color: var(--green); background: #F3FAEC; }
.note-p { border-left-color: var(--pink); background: #FDF1F4; }
.note-b { border-left-color: var(--sky); background: #EFF5FD; }
.note-kid { display: flex; gap: 12px; align-items: flex-start; border-left-color: var(--orange); background: var(--orange-soft); }
.note-kid img { flex: none; }

/* Stepper (Portionen) */
.stepper { display: inline-grid; grid-template-columns: 48px minmax(7em, auto) 48px; align-items: center; gap: 6px 8px; }
.stepper-label { grid-column: 1 / -1; font-weight: 700; }
.stepper.small { grid-template-columns: 44px minmax(6em, auto) 44px; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--navy); background: var(--white); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.step-btn:hover { background: var(--blue-soft); }
.step-btn:disabled { opacity: .35; cursor: not-allowed; }
.step-val { min-width: 7.5em; text-align: center; font-weight: 700; font-size: 1.05rem; }
.stepper.small .step-btn { width: 44px; height: 44px; }
.stepper.small .step-val { min-width: 6.5em; font-size: .95rem; }

/* ---------------------------------------------------------------- Kochmodus */
body.cooking .tabbar, body.cooking .topbar { display: none; }
body.cooking .view { padding-bottom: 32px; }
.cook { max-width: 860px; margin: 0 auto; }
.cook-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cook-recipe { font-size: 1.2rem; color: var(--muted); margin: 8px 0; }
.cook-progress { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; margin: 12px 0 6px; }
.cook-bar { height: 10px; background: #DCE5CF; border-radius: 6px; overflow: hidden; margin-bottom: 18px; }
.cook-bar span { display: block; height: 100%; background: var(--green-dark); }
.cook-text { font-size: 1.6rem; line-height: 1.5; background: var(--white); border-radius: 18px; padding: 22px; border: 2px solid var(--line); min-height: 8em; }
.cook-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.cook-ing { background: var(--white); border: 2px solid var(--green); border-radius: 16px; padding: 14px 18px; margin-bottom: 14px; }
.cook-ing ul { margin: 0; padding-left: 1.2em; font-size: 1.15rem; }
.cook-ing li { margin: 4px 0; }
.cook-ing .ing-group { list-style: none; margin-left: -1.2em; font-weight: 700; }
.cook-done { text-align: center; padding-top: 24px; }

/* ---------------------------------------------------------------- Wochenplan */
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 10px; }
.weeknav-label { margin: 0; text-align: center; display: flex; flex-direction: column; font-weight: 600; }
.weeknav-label b { font-family: var(--font-head); font-size: 1.1rem; }
.plan-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.plan-tools .seg { grid-template-columns: 1fr 1fr; flex: 1; max-width: 420px; }
.daytabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 8px 0 20px; }
.daytab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; padding: 4px 2px;
  border: 2px solid var(--line); background: var(--white); border-radius: 12px; cursor: pointer; color: var(--navy); }
.daytab b { font-size: 1rem; }
.daytab small { color: var(--muted); }
.daytab .dot { position: absolute; bottom: -11px; left: 50%; transform: translateX(-50%); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: .72rem; font-weight: 700; line-height: 17px; background: var(--green-dark); color: #fff; border: 1.5px solid #fff; }
.daytab .dot:empty { display: none; }
.daytab.today { border-color: var(--orange); }
.daytab[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: inset 0 -5px 0 var(--yellow); }
.daytab[aria-pressed="true"] small { color: #E6E9F5; }
.day-title { display: flex; align-items: center; gap: 8px; }
.pill { font-family: var(--font); font-size: .8rem; background: var(--orange-soft); color: var(--orange-dark); border: 1px solid var(--orange); padding: 2px 10px; border-radius: 999px; }
.meals { display: grid; gap: 12px; }
.meal { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.meal h3 { font-size: 1.1rem; }
.entries { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.entry { border: 2px solid var(--line); border-radius: 12px; padding: 10px; }
.entry-main { display: flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; font-weight: 600; min-height: 48px; }
.entry-main:hover .entry-title { text-decoration: underline; }
.entry-main img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; flex: none; }
.entry-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.entry-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-actions, .list-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.weekgrid { display: grid; gap: 12px; }
.weekday { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.weekday.today { border: 2px solid var(--orange); }
.weekday h2 { font-size: 1.05rem; margin-bottom: 6px; }
.weekday h2 .btn-link { font-family: var(--font-head); font-size: 1.05rem; padding: 0; min-height: 40px; color: var(--navy); }
.weekday dl { margin: 0; display: grid; gap: 4px; }
.weekday dl div { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; padding: 4px 0; border-top: 1px solid #EEF1E8; }
.weekday dt { font-weight: 700; color: var(--muted); }
.weekday dd { margin: 0; }

/* ---------------------------------------------------------------- Dialoge */
.dlg { border: none; padding: 0; border-radius: 20px; width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dlg-wide { width: min(760px, calc(100% - 24px)); }
.dlg::backdrop { background: rgba(31, 42, 90, .55); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 1.2rem; }
.dlg-body { padding: 16px 20px; overflow-y: auto; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.picker-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.picker-count { color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.pick-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--white); cursor: pointer; color: var(--navy); }
.pick-row:hover { border-color: var(--navy); }
.pick-row img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }
.pick-row span { display: flex; flex-direction: column; }
.pick-row small { color: var(--muted); }
.addplan-recipe { display: flex; align-items: center; gap: 12px; }
.addplan-recipe img { width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }
.addplan-serv { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share-text { width: 100%; font-family: ui-monospace, monospace; font-size: .9rem; }

/* ---------------------------------------------------------------- Einkaufsliste */
.add-manual { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sources { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin-bottom: 12px; }
.sources summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.src-list { list-style: none; padding: 0; margin: 0 0 10px; }
.src-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #EEF1E8; }
.src-list small { color: var(--muted); }
.list-status { font-weight: 700; }
.shop-group { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.shop-group h2 { font-size: 1.1rem; padding-bottom: 6px; border-bottom: 3px solid var(--green-soft); }
.shop-items { list-style: none; padding: 0; margin: 0; }
.shop-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px; border-bottom: 1px solid #EEF1E8; }
.shop-item:last-child { border-bottom: none; }
.check { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; padding: 4px 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: none; width: 30px; height: 30px; border: 2.5px solid var(--navy); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--white); color: transparent; }
.check .box .ico { width: 22px; height: 22px; }
.check input:checked + .box { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.check input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 3px; }
.check .txt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.check .name { font-weight: 600; }
.check .amt { color: var(--muted); }
.check .opt, .check .done-tag { font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.check .done-tag { border-color: var(--green-dark); color: var(--green-dark); font-weight: 700; }
.shop-item.done .name, .shop-item.done .amt { text-decoration: line-through; color: #6B7390; }
.contrib { grid-column: 1 / -1; margin: 0 0 10px; padding: 8px 12px 8px 30px; background: #F6F8F1; border-radius: 10px; font-size: .9rem; }
.contrib li { margin: 2px 0; }

/* ---------------------------------------------------------------- Einstellungen */
.warn { display: flex; gap: 10px; align-items: flex-start; background: var(--yellow-soft); border-left: 5px solid var(--yellow); padding: 10px 12px; border-radius: 8px; }
.warn-strong { background: #FCE8E6; border-left-color: var(--red); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.howto { padding-left: 1.2em; }
.howto li { margin: 4px 0; }

/* ---------------------------------------------------------------- Hinweis-Toast */
.toast { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); visibility: hidden; opacity: 0; transition: opacity .2s; }
.toast.show { visibility: visible; opacity: 1; }
.toast p { margin: 0; }
.toast-action { color: var(--yellow); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
body.cooking .toast { bottom: 16px; }

.print-area { display: none; }

/* ---------------------------------------------------------------- Größere Bildschirme */
@media (min-width: 600px) {
  .brand-sub { display: block; }
  .icon-btn-label { display: inline; }
  .actions { grid-template-columns: 1fr 1fr; }
  .main-actions { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 28px; }
  .hero-title { font-size: 2.5rem; }
  .hero-leo { width: 110px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
  .weekgrid { grid-template-columns: 1fr 1fr; }
  .book img { width: 120px; }
}
@media (min-width: 960px) {
  :root { --tabbar-h: 0px; }
  .tabbar { position: sticky; top: 64px; bottom: auto; z-index: 25; display: flex; justify-content: center; gap: 4px; border-top: none; border-bottom: 1px solid var(--line); padding: 4px 16px; }
  .tabbar a { flex-direction: row; gap: 8px; min-height: 52px; padding: 0 18px; font-size: .95rem; border-top: none; border-bottom: 4px solid transparent; border-radius: 10px 10px 0 0; }
  .tabbar a[aria-current="page"] { border-bottom-color: var(--green); }
  .view { padding-top: 24px; padding-bottom: 48px; }
  .recipe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .recipe .recipe-head { grid-column: 1 / -1; }
  .recipe .recipe-photo { grid-column: 1; grid-row: 2 / span 3; }
  .recipe .facts, .recipe .actions { grid-column: 2; }
  .recipe .recipe-grid, .recipe .notes, .recipe > p { grid-column: 1 / -1; }
  .recipe-grid { grid-template-columns: 2fr 3fr; align-items: start; }
  .notes { grid-template-columns: repeat(3, 1fr); }
  .meals { grid-template-columns: 1fr 1fr; }
  .weekgrid { grid-template-columns: repeat(3, 1fr); }
  .toast { bottom: 24px; }
  .cook-text { font-size: 1.9rem; }
}
/* Die Tabbar steht im Quelltext hinter <main>; auf großen Bildschirmen wird sie per Flex-Reihenfolge nach oben geholt */
@media (min-width: 960px) {
  body { display: flex; flex-direction: column; min-height: 100vh; }
  .skip-link { order: 0; } .topbar { order: 1; } .tabbar { order: 2; } .banner { order: 3; } main { order: 4; flex: 1; }
  .toast, .print-area, #dialogs { order: 5; }
}

/* Weniger Bewegung, wenn im System eingestellt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .big-tile:hover { transform: none; }
}

/* ---------------------------------------------------------------- Drucken */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; display: block; font-size: 11pt; }
  .topbar, .tabbar, .banner, .toast, #dialogs, .skip-link, .actions, .crumbs, .card-fav, .stepper button, .plan-actions, .list-actions,
  .add-manual, .weeknav button, .plan-tools, .btn, .icon-btn, .fav-btn, .scaled-note .btn-link { display: none !important; }
  .view { padding: 0; max-width: none; }
  .panel, .note, .meal, .shop-group, .card { box-shadow: none; }
  .recipe-photo img { max-height: 70mm; width: auto; }
  body.printing-extra main { display: none; }
  body.printing-extra .print-area { display: block; }
  .print-head h1 { margin: 0 0 2mm; font-size: 20pt; }
  .print-head p { margin: 0 0 6mm; color: #333; }
  .print-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9.5pt; }
  .print-table th, .print-table td { border: 1px solid #999; padding: 2mm; vertical-align: top; text-align: left; }
  .print-table thead th { background: #EEF5E4; }
  .print-table td div { margin-bottom: 2mm; }
  .print-cols { columns: 2; column-gap: 10mm; }
  .print-cols section { break-inside: avoid; margin-bottom: 5mm; }
  .print-cols h2 { font-size: 12pt; border-bottom: 1px solid #999; margin: 0 0 2mm; }
  .print-check { list-style: none; padding: 0; margin: 0; }
  .print-check li { display: flex; gap: 3mm; padding: 1mm 0; break-inside: avoid; }
  .print-check li.done span:last-child { text-decoration: line-through; }
  .pbox { width: 4mm; height: 4mm; border: 1px solid #333; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 8pt; margin-top: .5mm; }
}
