:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1d2721;
  --ink-2: #3a453e;
  --muted: #6f786f;
  --line: #e6e0d3;
  --brand: #1f6f4a;
  --brand-ink: #155238;
  --brand-soft: #e3f1e8;
  --side: #143a2a;
  --side-2: #1b4a36;
  --accent: #ee7d2b;
  --accent-soft: #fdebd9;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --cool: #2f7fb5;
  --cool-soft: #e2f0f9;
  --danger: #c2412d;
  --art-bg: #efe7d6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 39, 33, 0.04), 0 6px 20px rgba(29, 39, 33, 0.06);
  --shadow-lg: 0 2px 4px rgba(29, 39, 33, 0.06), 0 16px 40px rgba(29, 39, 33, 0.12);
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; }
h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 17px; font-weight: 650; }
h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.small { font-size: 13px; font-weight: 400; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Layout ---------- */

.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, var(--side) 0%, #102f22 100%);
  color: #eaf3ee;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(238, 125, 43, 0.35); }
.brand-mark svg { width: 30px; height: 30px; }
.brand strong { display: block; font-family: var(--font-display); font-size: 19px; letter-spacing: -0.01em; }
.brand span { font-size: 12px; opacity: 0.65; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; color: #cfe0d6;
  padding: 11px 12px; border-radius: 12px; cursor: pointer; text-align: left;
  font-weight: 550; transition: background 0.15s, color 0.15s;
}
.nav-item:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-item:disabled { opacity: 0.38; cursor: not-allowed; }
.nav-no {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.1);
}
.nav-item.active .nav-no { background: var(--accent); color: #fff; }
.nav-short { display: none; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.sidebar-summary { background: rgba(255, 255, 255, 0.06); border-radius: 14px; padding: 14px; }
.sidebar-summary .eyebrow { color: #9fc4ae; margin-bottom: 6px; }
.side-target { font-size: 14px; opacity: 0.9; }
.side-target strong { font-family: var(--font-display); font-size: 20px; margin-right: 2px; }

.main { overflow-y: auto; padding: 36px 44px 64px; scroll-behavior: smooth; }
.view { display: none; max-width: 1240px; margin: 0 auto; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.view-head .lead { margin-top: 8px; max-width: 680px; color: var(--ink-2); font-size: 16px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 40px 0 16px; }
.section-no { width: 30px; height: 30px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }
.section-lead { margin: -8px 0 16px; max-width: 720px; }

.actions { display: flex; justify-content: flex-end; margin-top: 24px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px;
  font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(31, 111, 74, 0.3); }
.btn.primary:hover:not(:disabled) { background: var(--brand-ink); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #cfc7b6; background: var(--surface-2); }
.btn.export { justify-content: center; background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(238, 125, 43, 0.3); }
.btn.export:hover:not(:disabled) { background: #dd6d1c; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--brand-soft); border-color: #bcdcc8; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Profil ---------- */

.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.form { padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.grow { flex: 1; }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row > .field:not(.grow) { flex: 1 1 140px; }
.field-label { font-weight: 650; font-size: 14px; }
.field-hint { font-size: 12.5px; color: var(--muted); }

.input-unit { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.input-unit:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-unit input { border: 0; background: transparent; padding: 11px 12px; font: inherit; font-weight: 600; width: 100%; min-width: 0; outline: none; }
.input-unit span { padding-right: 12px; color: var(--muted); font-size: 13px; }

input[type='range'] { width: 100%; accent-color: var(--brand); }

.options { display: grid; gap: 10px; }
.options.cols-2 { grid-template-columns: repeat(2, 1fr); }
.options.cols-3 { grid-template-columns: repeat(3, 1fr); }
.option {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  background: var(--surface-2); transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: #cfc7b6; }
.option.checked { border-color: var(--brand); background: var(--brand-soft); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-label { font-weight: 650; }
.option-hint { font-size: 12.5px; color: var(--muted); }

.targets { padding: 26px; position: sticky; top: 0; }
.big-targets { display: flex; gap: 24px; margin: 8px 0 20px; }
.big-targets > div { display: flex; flex-direction: column; }
.big { font-family: var(--font-display); font-size: 44px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.big.accent { color: var(--brand); }
.unit { color: var(--muted); font-size: 13px; margin-top: 4px; }
.target-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-list > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.target-list dt { font-size: 12px; color: var(--muted); }
.target-list dd { margin: 0; font-weight: 700; }
.explain { display: flex; gap: 10px; margin-top: 18px; font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: 12px; padding: 12px; }
.explain .icon { color: var(--accent); margin-top: 2px; }

/* ---------- Tags & Chips ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { font-size: 11.5px; font-weight: 650; color: #b4561a; background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.chip .icon { width: 14px; height: 14px; }
.chip-cool { background: var(--cool-soft); border-color: #c5e0f2; color: var(--cool); }
.chip-lg { font-size: 14px; padding: 8px 14px; background: var(--surface); }
.chip-lg .icon { width: 17px; height: 17px; color: var(--brand); }

/* ---------- Baukasten ---------- */

.base-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.base-card, .variant-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.base-card:hover, .variant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.base-card.active { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow-lg); }
.base-art svg, .variant-art svg { display: block; width: 100%; height: auto; }
.base-body, .variant-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.base-variants { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }

.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.variant-card { opacity: 0.72; }
.variant-card.selected { opacity: 1; border-color: var(--brand); }
.variant-art { position: relative; }
.check {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.9); color: transparent;
  border: 2px solid #d8d0c0; transition: all 0.15s;
}
.variant-card.selected .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.variant-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.variant-macros { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.variant-macros strong { color: var(--ink); }

.distribute { padding: 8px 20px; }
.dist-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dist-art { width: 74px; border-radius: 10px; overflow: hidden; flex: none; }
.dist-art svg { display: block; width: 100%; height: auto; }
.dist-name { flex: 1; display: flex; flex-direction: column; }
.dist-name .muted { font-size: 13px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; min-width: 24px; text-align: center; }
.dist-foot { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 12px; gap: 16px; }
.dist-foot > span { display: flex; align-items: center; gap: 8px; }
.dist-foot.ok > span { color: var(--brand); }
.dist-foot.bad > span { color: var(--danger); }

/* ---------- Wochenplan ---------- */

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat-plain { display: flex; align-items: center; gap: 14px; }
.stat-plain .icon { width: 30px; height: 30px; color: var(--brand); padding: 6px; background: var(--brand-soft); border-radius: 10px; box-sizing: content-box; }
.stat-plain strong { display: block; font-family: var(--font-display); font-size: 18px; }
.stat-plain .muted { font-size: 13px; }

.meter-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.meter-label strong { color: var(--ink); font-size: 15px; }
.meter-track { position: relative; height: 10px; border-radius: 999px; background: #efebe2; overflow: visible; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.3s; }
.meter-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; opacity: 0.5; }
.meter-low .meter-fill { background: var(--warn); }
.meter-high .meter-fill { background: var(--accent); }

.flow { display: grid; grid-template-columns: 220px 60px 1fr; align-items: center; padding: 20px; margin-bottom: 18px; }
.flow-base { border-radius: 14px; padding: 18px; background: color-mix(in srgb, var(--accent) 12%, white); border: 2px solid color-mix(in srgb, var(--accent) 40%, white); display: flex; flex-direction: column; gap: 2px; }
.flow-base .eyebrow { color: var(--accent); }
.flow-base strong { font-family: var(--font-display); font-size: 18px; }
.flow-arrows { align-self: stretch; display: flex; flex-direction: column; justify-content: space-around; padding: 10px 0; }
.flow-arrows span { height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 10px); position: relative; }
.flow-arrows span::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: #c9c0ad; }
.flow-variants { display: flex; flex-direction: column; gap: 10px; }
.flow-variant { display: flex; align-items: center; gap: 14px; }
.flow-art { width: 70px; border-radius: 10px; overflow: hidden; flex: none; }
.flow-art svg { display: block; width: 100%; height: auto; }
.flow-variant > div:last-child { display: flex; flex-direction: column; }
.flow-variant .muted { font-size: 13px; }

.warn { display: flex; gap: 12px; padding: 16px 18px; background: var(--warn-soft); border-color: #f1dca8; margin-bottom: 18px; }
.warn .icon { color: var(--warn); margin-top: 2px; }
.warn ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }

.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.day-card { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.day-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; }
.badge .icon { width: 13px; height: 13px; }
.badge-fridge { background: var(--brand-soft); color: var(--brand); }
.badge-freezer { background: var(--cool-soft); color: var(--cool); }
.badge-late { background: var(--warn-soft); color: var(--warn); }
.day-art { border-radius: 12px; overflow: hidden; }
.day-art svg { display: block; width: 100%; height: auto; }
.day-card h3 { font-size: 15px; }
.day-macros { display: flex; gap: 12px; font-size: 13px; color: var(--muted); }
.day-macros strong { color: var(--ink); }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.recipe-card { display: grid; grid-template-columns: 200px 1fr; overflow: hidden; }
.recipe-art { background: var(--art-bg); }
.recipe-art svg { display: block; width: 100%; height: auto; }
.recipe-body { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.macro-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.mc { font-size: 12.5px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.mc-kcal { background: var(--accent-soft); border-color: #f6d2b1; }
.mc-p { background: var(--brand-soft); border-color: #bcdcc8; }
.recipe-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.recipe-cols h4:not(:first-child) { margin-top: 12px; }
.ing-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.ing-list li { padding: 3px 0; border-bottom: 1px dotted var(--line); }
.per-portion-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.reheat { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.reheat .icon { color: var(--brand); margin-top: 2px; }

/* ---------- Kochanleitung ---------- */

.guide-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.equipment { padding: 16px 20px; margin-bottom: 8px; }
.equipment ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.equipment li { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.equipment .icon { color: var(--brand); width: 16px; height: 16px; }

.guide-section { margin-top: 36px; }
.guide-section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.step-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.15s;
}
.step-card:hover { box-shadow: var(--shadow-lg); }
.step-card.done { opacity: 0.5; }
.step-art-wrap { position: relative; }
.step-art-wrap svg { display: block; width: 100%; height: auto; }
.step-no {
  position: absolute; left: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 750; font-size: 18px;
  display: grid; place-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.step-flag { position: absolute; right: 12px; top: 14px; background: #fff; color: var(--accent); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em; }
.step-done { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(31, 111, 74, 0.55); color: #fff; opacity: 0; transition: opacity 0.2s; }
.step-done .icon { width: 56px; height: 56px; stroke-width: 2.4; }
.step-card.done .step-done { opacity: 1; }
.step-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.step-text { font-size: 14.5px; color: var(--ink-2); }
.step-text strong { color: var(--ink); }
.step-text ul { margin: 8px 0; padding-left: 18px; }
.prep-list { list-style: none; padding: 0 !important; margin: 0 !important; }
.prep-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.prep-how { color: var(--muted); font-size: 13px; text-align: right; }
.step-time { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.step-time .icon { width: 15px; height: 15px; }

.reheat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.reheat-card { display: flex; gap: 14px; padding: 14px; align-items: center; }
.reheat-art { width: 110px; border-radius: 10px; overflow: hidden; flex: none; }
.reheat-art svg { display: block; width: 100%; height: auto; }
.reheat-card p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

/* ---------- Einkaufsliste ---------- */

.progress { padding: 16px 20px; margin-bottom: 18px; }
.progress-label { font-size: 14px; margin-bottom: 8px; }
.shop-columns { columns: 3 300px; column-gap: 16px; }
.shop-group { break-inside: avoid; padding: 18px 18px 10px; margin-bottom: 16px; }
.shop-group h3 { margin-bottom: 8px; }
.shop-group.pantry { background: var(--surface-2); }
.shop-item { display: grid; grid-template-columns: 24px auto 1fr; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.shop-item:last-child { border-bottom: 0; }
.shop-item input { position: absolute; opacity: 0; pointer-events: none; }
.shop-item .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #cfc7b6; display: grid; place-items: center; color: transparent; align-self: center; transition: all 0.15s; }
.shop-item .box .icon { width: 14px; height: 14px; stroke-width: 3; }
.shop-item.checked .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.shop-item.checked .shop-main, .shop-item.checked .shop-name { text-decoration: line-through; color: var(--muted); }
.shop-main { font-weight: 700; white-space: nowrap; }
.shop-name small { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Sonstiges ---------- */

.empty { padding: 48px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-weight: 550; transition: all 0.25s; z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media screen and (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr; }
  .targets { position: static; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .options.cols-3 { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr; }
}

/* ---------- Neue Elemente (v2) ---------- */

.big.veg { color: #3f8a2f; }
.base-art { position: relative; }
.base-badge { position: absolute; top: 10px; left: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.dist-group { margin-top: 12px; padding: 4px 0 4px 10px; border-left: 4px solid var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.veg-text { display: inline-flex; align-items: center; gap: 3px; color: #3f8a2f; }
.veg-text .icon { width: 14px; height: 14px; }
.veg-text strong { color: #3f8a2f !important; }
.mc-veg { display: inline-flex; align-items: center; gap: 4px; background: #e8f4e1; border-color: #c6e2b5; }
.mc-veg .icon { width: 13px; height: 13px; color: #3f8a2f; }
.meter-veg .meter-fill { background: #5aa24a; }
.meter-veg.meter-low .meter-fill { background: var(--warn); }
.recipe-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.recipe-top .tags { margin-bottom: 4px; }
.recipe-top .icon-btn { flex: none; }

.shop-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.shop-step {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; color: var(--muted);
}
.shop-step span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; }
.shop-step em { font-style: normal; font-size: 12px; background: var(--accent-soft); color: #b4561a; padding: 1px 8px; border-radius: 999px; }
.shop-step.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.shop-step.active span { background: var(--brand); color: #fff; }
.shop-step-arrow { color: var(--muted); display: grid; }
.shop-intro { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 18px; background: var(--brand-soft); border-color: #bcdcc8; }
.shop-intro > .icon { width: 28px; height: 28px; color: var(--brand); }
.shop-intro > div:nth-child(2) { flex: 1; }
.shop-intro .muted { font-size: 13.5px; }
.have-item.checked .shop-main, .have-item.checked .shop-name { text-decoration: none; }
.have-item.checked .box { background: #5aa24a; border-color: #5aa24a; }
.have-label { color: #3f8a2f !important; font-weight: 650; }
.shop-next { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; position: sticky; bottom: 0; box-shadow: var(--shadow-lg); }

.box-fill { font-size: 12px; color: var(--muted); margin-top: 2px; }
.box-fill span { display: block; margin-bottom: 4px; }
.box-fill .meter-track { height: 6px; }
.box-fill .meter-fill { background: #8a9aa6; }
.box-fill.over .meter-fill { background: var(--danger); }
.box-fill.over span { color: var(--danger); font-weight: 650; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 650; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.filter-chip:hover { border-color: #cfc7b6; }
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.print-area { display: none; }

/* ---------- Handy & Tablet ---------- */

.topbar { display: none; }

@media screen and (max-width: 1000px) and (min-width: 761px) {
  .app { grid-template-columns: 210px 1fr; }
  .main { padding: 28px 24px 56px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 760px) {
  /* Seite scrollt als Ganzes, Navigation sitzt unten wie in einer App */
  .app { display: block; height: auto; min-height: 100vh; }
  .main { overflow: visible; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }

  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--side); color: #fff;
  }
  .topbar .brand { padding: 0; gap: 10px; }
  .topbar .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .topbar .brand-mark svg { width: 24px; height: 24px; }
  .topbar .brand strong { font-size: 18px; }
  .topbar .btn.export { padding: 8px 12px; font-size: 13.5px; box-shadow: none; }

  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    flex-direction: row; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
  }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 2px; }
  .nav-item { flex: 1; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 7px 2px; font-size: 11px; text-align: center; }
  .nav-label { display: none; }
  .nav-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-item .nav-no { display: none; }
  .nav-item .icon { width: 22px; height: 22px; }

  h1 { font-size: 27px; }
  h2 { font-size: 19px; }
  .view-head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 20px; }
  .view-head .lead { font-size: 15px; }
  .view-head > .btn, .head-actions .btn { flex: 1 1 auto; justify-content: center; }
  .head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .head-actions .btn { flex: 1 1 calc(50% - 8px); padding: 9px 10px; font-size: 13.5px; white-space: normal; }
  .actions .btn { width: 100%; justify-content: center; }
  .section-title { margin: 28px 0 12px; flex-wrap: wrap; }

  /* Profil */
  .profile-grid { grid-template-columns: 1fr; gap: 16px; }
  .form { padding: 18px; gap: 20px; }
  .field-row { flex-direction: column; gap: 20px; }
  .options.cols-3 { grid-template-columns: 1fr; }
  .targets { position: static; padding: 18px; }
  .big { font-size: 34px; }
  .big-targets { gap: 18px; flex-wrap: wrap; }

  /* Baukasten: zwei kompakte Karten nebeneinander */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-chip { flex: none; }
  .base-grid, .variant-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .base-body, .variant-body { padding: 10px 12px 12px; }
  .base-body h3, .variant-body h3 { font-size: 14.5px; }
  .base-body .muted, .variant-body .muted { font-size: 12.5px; }
  .base-card .tags, .variant-card .tags, .base-variants { display: none; }
  .variant-meta .chip { font-size: 11.5px; padding: 3px 8px; }
  .variant-macros { flex-wrap: wrap; gap: 2px 10px; font-size: 12px; }
  .check { width: 26px; height: 26px; top: 8px; right: 8px; }
  .base-badge { font-size: 11px; padding: 3px 8px; }
  .distribute { padding: 4px 14px; }
  .dist-art { width: 56px; }
  .dist-foot { flex-direction: column; align-items: stretch; }
  .dist-foot .btn { justify-content: center; }

  /* Wochenplan */
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px; }
  .meter-label { flex-direction: column; gap: 2px; }
  .flow { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .flow-arrows { display: none; }
  .day-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .day-card { padding: 10px; }
  .day-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .day-card h3 { font-size: 14px; }
  .day-macros { flex-wrap: wrap; gap: 2px 8px; font-size: 12px; }
  .recipe-grid { grid-template-columns: 1fr; }
  .recipe-card { grid-template-columns: 1fr; }
  .recipe-art { max-height: 190px; overflow: hidden; }
  .recipe-cols { grid-template-columns: 1fr; gap: 6px; }

  /* Kochanleitung */
  .steps-grid, .reheat-grid { grid-template-columns: 1fr; gap: 14px; }
  .guide-section { margin-top: 28px; }
  .guide-meta .chip-lg { font-size: 13px; padding: 6px 12px; }
  .reheat-card { align-items: flex-start; }
  .reheat-art { width: 84px; }

  /* Einkaufsliste: große Tippflächen für den Supermarkt */
  .shop-columns { columns: 1; }
  .shop-steps { flex-direction: column; align-items: stretch; gap: 8px; }
  .shop-step-arrow { display: none; }
  .shop-intro { flex-direction: column; align-items: flex-start; }
  .shop-intro-actions, .shop-intro-actions .btn { width: 100%; justify-content: center; }
  .shop-item { grid-template-columns: 30px auto 1fr; padding: 13px 0; }
  .shop-item .box { width: 26px; height: 26px; }
  .shop-next { bottom: calc(70px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
  .shop-next .btn { justify-content: center; }

  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); }
  .empty { padding: 28px 18px; }
}

/* ---------- Druck / PDF ---------- */

@media print {
  @page { size: A4; margin: 12mm; }
  /* Kein Seitenhintergrund – die Seitenränder kommen aus der Fensterfarbe, siehe main.cjs */
  html, body { height: auto; background: #fff !important; font-size: 12px; }
  body.print-area-mode .app, .toast, .topbar { display: none !important; }
  body.print-area-mode .print-area { display: block; }
  .no-print { display: none !important; }
  .print-page + .print-page { break-before: page; }
  .card, .step-card { box-shadow: none; }
  .step-card, .day-card, .recipe-card, .shop-group, .reheat-card, .flow, .print-group { break-inside: avoid; }
  .steps-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .step-card.done { opacity: 1; }
  .step-done { display: none; }
  .day-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .recipe-card { grid-template-columns: 130px 1fr; }
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .base-grid, .variant-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .shop-columns { columns: 2; }
  .shop-next { position: static; }
  h1 { font-size: 26px; }
  .view-head { margin-bottom: 16px; }
  .guide-section { margin-top: 20px; break-inside: auto; }
  .guide-section-head { break-after: avoid; }
  .print-list { columns: 2; column-gap: 28px; }
  .print-group { margin-bottom: 14px; }
  .print-group h3 { font-size: 14px; border-bottom: 2px solid var(--ink); padding-bottom: 4px; margin-bottom: 4px; }
  .print-row { display: grid; grid-template-columns: 16px auto 1fr; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
  .print-row small { color: var(--muted); }
  .print-box { width: 12px; height: 12px; border: 1.5px solid var(--ink); border-radius: 3px; align-self: center; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
