﻿/* =========================================================
   Kochbuch — warmes, ruhiges Design. Mobile-first.
   ========================================================= */

:root {
  --bg: #faf5ec;
  --bg-card: #ffffff;
  --bg-sunken: #f1e9db;
  --ink: #2b241c;
  --ink-soft: #6f6558;
  --line: #e7ddcc;
  --accent: #5a7539;     /* weiße Schrift darauf 5,2:1 (vorher #6d8b46 = 3,9:1) */
  --accent-deep: #4e6b33;
  --accent-soft: #e9efdb;
  --on-accent: #ffffff;  /* Schrift auf grünem Grund */
  --check-line: #9a8b74; /* Rahmen der Abhak-Kästchen, mind. 3:1 zum Hintergrund */
  --green: #3d6b4f;
  --green-soft: #e2ede6;
  --red: #b8452e;
  --shadow: 0 2px 12px rgba(84, 62, 38, 0.10);
  --shadow-big: 0 8px 32px rgba(84, 62, 38, 0.18);
  --radius: 18px;
  --nav-h: 64px;
  --serif: ui-serif, Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Dunkel, weil das Gerät es so will — aber nur, wenn nicht ausdrücklich hell gewählt */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1a16;
    --bg-card: #29241e;
    --bg-sunken: #171310;
    --ink: #f0e9de;
    --ink-soft: #a89c8c;
    --line: #3a332b;
    --accent: #96b46b;
    --accent-deep: #b5cc92;
    --accent-soft: #2e371f;
    /* im Dunkelmodus ist Grün hell -> dunkle Schrift darauf */
    --on-accent: #1e1a16;
    --check-line: #7a6e60;
    --green: #7fb094;
    --green-soft: #26332b;
    --red: #d96a52;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-big: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

/* Dunkel, weil es in den Einstellungen so gewählt wurde — auch auf einem hellen Gerät */
:root[data-theme="dark"] {
  --bg: #1e1a16;
  --bg-card: #29241e;
  --bg-sunken: #171310;
  --ink: #f0e9de;
  --ink-soft: #a89c8c;
  --line: #3a332b;
  --accent: #96b46b;
  --accent-deep: #b5cc92;
  --accent-soft: #2e371f;
  --on-accent: #1e1a16;
  --check-line: #7a6e60;
  --green: #7fb094;
  --green-soft: #26332b;
  --red: #d96a52;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-big: 0 8px 32px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  line-height: 1.5;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.01em; }
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; color: var(--ink); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.82rem; }

.view { max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }

/* ---------- Kopfzeilen ---------- */
.home-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 14px; }
.app-title { font-size: 2rem; color: var(--ink); }
.sub-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 14px; }
.sub-header h1 { font-size: 1.6rem; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); background: var(--bg-card); box-shadow: var(--shadow);
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.94); }

/* ---------- Suche & Tags ---------- */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
#searchInput {
  width: 100%; padding: 12px 16px 12px 42px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--bg-card); outline: none;
}
#searchInput:focus { border-color: var(--accent); }

.tag-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.tag-row::-webkit-scrollbar { display: none; }
.tag-chip {
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  min-height: 40px; display: inline-flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 0.88rem; font-weight: 500;
}
.tag-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Rezeptkarten ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.recipe-card {
  background: var(--bg-card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  text-align: left; display: flex; flex-direction: column; position: relative;
  transition: transform 0.12s ease;
}
.recipe-card:active { transform: scale(0.97); }
.card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg-sunken); }
.card-img-placeholder {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: linear-gradient(135deg, var(--accent-soft), var(--bg-sunken));
}
.card-body { padding: 10px 12px 12px; }
.card-title { font-family: var(--serif); font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.card-meta { display: flex; gap: 8px; margin-top: 5px; color: var(--ink-soft); font-size: 0.8rem; }
.card-fav { position: absolute; top: 8px; right: 8px; font-size: 1.1rem; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }

/* ---------- Werkzeugleiste über der Rezeptliste ---------- */
.browse-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 2px 2px 12px;
}
.sort-select {
  padding: 7px 10px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--ink); font-size: 0.82rem;
  font-family: inherit; font-weight: 600;
}
.tool-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px;
  padding: 7px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  background: var(--bg-card); color: var(--ink-soft); border: 1px solid var(--line);
}
.tool-chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tool-chip:active { transform: scale(0.96); }
.browse-tools .tool-spacer { flex: 1; }

/* ---------- Kompakte Listenansicht ---------- */
.recipe-grid.as-list { grid-template-columns: 1fr; gap: 8px; }
.recipe-grid.as-list .recipe-card { flex-direction: row; align-items: stretch; }
.recipe-grid.as-list .card-img,
.recipe-grid.as-list .card-img-placeholder {
  width: 84px; height: 84px; flex-shrink: 0; aspect-ratio: auto; font-size: 1.6rem;
}
.recipe-grid.as-list .card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.recipe-grid.as-list .card-title { font-size: 0.98rem; }
.recipe-grid.as-list .card-menu { bottom: 50%; transform: translateY(50%); right: 8px; }
.recipe-grid.as-list .card-menu:active { transform: translateY(50%) scale(0.92); }
.recipe-grid.as-list .card-fav { top: 6px; right: 46px; }
.recipe-grid.as-list .recipe-card-wrap .card-meta { padding-right: 42px; }
.recipe-grid.as-list .recipe-card-wrap .card-body { min-height: 0; }

/* ⋯-Knopf auf der Rezeptkachel: Bearbeiten/Löschen ohne das Rezept zu öffnen */
.recipe-card-wrap { position: relative; display: flex; }
.recipe-card-wrap .recipe-card { flex: 1; min-width: 0; }
/* Platz für den ⋯-Knopf lassen, sonst verdeckt er Zeit und Portionen */
.recipe-card-wrap .card-meta { padding-right: 34px; flex-wrap: wrap; }
.recipe-card-wrap .card-body { min-height: 46px; }
.card-menu {
  position: absolute; bottom: 6px; right: 6px;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; line-height: 1; color: var(--ink-soft);
  background: var(--bg-card); box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.card-menu:active { transform: scale(0.92); }

/* ---------- Leerer Zustand ---------- */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-emoji { font-size: 3.4rem; margin-bottom: 12px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--ink-soft); margin-bottom: 20px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; min-height: 44px; border-radius: 14px; font-size: 0.95rem; font-weight: 600;
  transition: transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg-card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { color: var(--ink-soft); }
.btn-danger { color: var(--red); }
.btn-block { width: 100%; margin-bottom: 10px; }
.btn-sm { padding: 10px 16px; border-radius: 12px; }

/* ---------- Detail-Ansicht ---------- */
.detail-hero { position: relative; margin: -16px -16px 0; }
.detail-hero img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.detail-hero .card-img-placeholder { aspect-ratio: 16/10; border-radius: 0; }
.detail-back {
  position: absolute; top: 14px; left: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #2b241c;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.detail-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; }
.detail-actions .icon-btn { background: rgba(255,255,255,0.92); color: #2b241c; }
.detail-body { padding-top: 18px; }
.detail-title { font-size: 1.7rem; line-height: 1.2; margin-bottom: 12px; color: var(--accent-deep); }

/* Info-Leiste: Symbol + Wert + kleines Label, mit Trennstrichen (wie im gedruckten Kochbuch) */
.info-bar {
  display: flex; align-items: stretch;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 4px; margin-bottom: 6px; overflow-x: auto; scrollbar-width: none;
}
.info-bar::-webkit-scrollbar { display: none; }
.info-item {
  /* nicht schmaler als der Inhalt – sonst überlappen lange Gruppennamen; die Leiste scrollt dann */
  flex: 1 0 auto; min-width: 76px; padding: 0 8px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center;
}
.info-item a { text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.info-ico { font-size: 1.15rem; }
.info-item b { font-size: 0.95rem; white-space: nowrap; }
.info-item small { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
/* Portionen weichen vom Original ab (Stepper verstellt) */
.info-item.info-scaled b { color: var(--accent-deep); }
.info-sep { width: 1px; background: var(--line); margin: 3px 0; flex-shrink: 0; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 24px 0 12px; }
.section-head h2 { font-size: 1.25rem; }

/* Grünes Abschnitts-Banner wie in der Vorlage */
.section-banner {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  font-family: var(--serif); font-weight: 700; font-size: 1rem;
  letter-spacing: 0.07em; text-transform: uppercase;
  padding: 7px 22px; border-radius: 4px 18px 18px 4px;
  box-shadow: var(--shadow);
}

/* Tipp-Box und Schlusszeile */
.tips-box {
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 20px; font-size: 0.92rem; white-space: pre-wrap;
}

/* Nährwerte pro Portion */
.nutri-box {
  background: var(--bg-sunken); border-radius: var(--radius);
  padding: 12px 14px 14px; margin-top: 18px;
}
.nutri-title {
  font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-soft); text-align: center; margin-bottom: 10px;
}
.nutri-est {
  display: inline-block; background: var(--accent); color: var(--on-accent);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px;
  font-size: 0.72rem; letter-spacing: 0.04em;
}
.nutri-grid { display: flex; justify-content: space-around; gap: 4px; }
.nutri-item {
  /* Breite nach Inhalt: „Kohlenhydrate“ braucht mehr Platz als „Fett“ */
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  gap: 1px; text-align: center; min-width: 0;
}
.nutri-ico { font-size: 1.05rem; }
.nutri-item b { font-size: 0.95rem; white-space: nowrap; }
.nutri-item small {
  font-size: 0.75rem; letter-spacing: 0.01em;
  color: var(--ink-soft); font-weight: 600; line-height: 1.2;
}
.nutri-hint { font-size: 0.78rem; color: var(--ink-soft); text-align: center; margin-top: 9px; }
.nutri-empty { text-align: center; }
/* Vier schmale Zahlenfelder im Editor */
.nutri-row { gap: 8px; }
.nutri-row .editor-field { margin-bottom: 8px; }
.nutri-row input { text-align: center; padding-left: 4px; padding-right: 4px; }
.nutri-row .hint { text-align: center; }
.tips-title { font-weight: 700; color: var(--accent-deep); margin-bottom: 6px; letter-spacing: 0.03em; }
.detail-tagline {
  text-align: center; font-family: var(--serif); font-style: italic;
  color: var(--accent-deep); margin: 26px 0 12px; font-size: 1.02rem;
}

.portion-stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.portion-stepper button { position: relative; width: 36px; height: 36px; border-radius: 50%; font-size: 1.15rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.portion-stepper button:active { background: var(--accent-soft); }
.portion-mid { display: inline-flex; align-items: center; font-size: 0.88rem; font-weight: 600; padding: 0 2px; }
.portion-input {
  width: 44px; text-align: center; border: none; outline: none;
  background: var(--bg-sunken); border-radius: 8px; padding: 5px 2px;
  font-size: 0.92rem; font-weight: 700; color: var(--ink);
}
.portion-input:focus { background: var(--accent-soft); }
.portion-stepper .portion-reset { font-size: 0.95rem; color: var(--ink-soft); width: 28px; height: 28px; }

/* Umschalter Metrisch / Original (US) */
.unit-toggle {
  display: flex; gap: 0; margin: 0 0 12px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; width: fit-content;
}
.unit-toggle button {
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
}
.unit-toggle button.active { background: var(--accent); color: var(--on-accent); }

/* Gruppen als Ordner-Kacheln */
.tag-chip.tag-manage { border-style: dashed; color: var(--accent-deep); font-weight: 700; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; margin-bottom: 18px; align-items: start; }
.folder-tile {
  background: var(--bg-card); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column; text-align: left;
  transition: transform 0.12s ease;
}
.folder-tile:active { transform: scale(0.96); }
.folder-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; padding: 9px 11px 0; word-break: break-word; }
.folder-count { font-size: 0.75rem; color: var(--ink-soft); padding: 2px 11px 10px; }
.folder-new { border: 2px dashed var(--line); background: transparent; box-shadow: none; color: var(--accent-deep); }
.folder-new .folder-name { color: var(--accent-deep); padding-bottom: 10px; }

/* Foto-Mosaik als Ordner-Vorschau */
.tile-preview {
  width: 100%; aspect-ratio: 3/2; display: grid; gap: 2px; overflow: hidden;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; background: var(--bg-sunken);
}
/* min-height:0 nötig, sonst drückt die Originalhöhe des Fotos die Kachel auf */
.tile-preview img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }
.tile-preview.tile-one { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.tile-preview.tile-two { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.tile-empty {
  display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-sunken));
}
.tile-plus { background: transparent; font-size: 1.6rem; font-weight: 700; }
.folder-actions { margin: -6px 0 14px; }
.crumb-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.crumb-title { font-size: 1.2rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-title { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 2px 10px; }
.picker-list { max-height: 46vh; overflow-y: auto; }

/* Zutaten-Abschnitte (Teig, Füllung, Topping …) */
.ing-section {
  padding: 10px 16px 4px; font-weight: 700; color: var(--accent-deep);
  font-family: var(--serif); font-size: 0.98rem; letter-spacing: 0.02em;
}
.ing-section ~ .ing-section { border-top: 1px dashed var(--line); margin-top: 6px; }
.cook-ing-sec { list-style: none; margin-left: 0 !important; margin-top: 12px !important; font-weight: 700; color: var(--accent-deep); font-family: var(--serif); }

/* Werkzeug-Zeile (Einheiten + Übersetzen) */
.tools-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.tools-row .unit-toggle { margin: 0; }

/* Küchen-Timer */
.timer-start { margin-top: 18px; align-self: flex-start; }
.timer-chip {
  position: fixed; right: 14px; bottom: calc(var(--nav-h) + 16px); z-index: 85;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.95rem;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow-big);
  font-variant-numeric: tabular-nums;
}

/* Wochenplaner */
.week-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 6px 0 16px; }
.week-head h1 { font-size: 1.7rem; }
.week-head p { margin-top: 2px; }
.plan-day {
  display: flex; gap: 12px; background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px;
}
.plan-today { border: 1.5px solid var(--accent); }
.plan-date {
  width: 44px; flex-shrink: 0; text-align: center; border-radius: 12px;
  background: var(--bg-sunken); padding: 6px 0 5px; align-self: flex-start;
}
.plan-today .plan-date { background: var(--accent); color: var(--on-accent); }
.plan-date b { display: block; font-size: 1.2rem; line-height: 1.1; font-family: var(--serif); }
.plan-date small { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; }
.plan-body { flex: 1; min-width: 0; }
.plan-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-day-name { font-weight: 700; font-size: 0.95rem; }
.plan-add {
  position: relative; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-deep); font-size: 1.05rem; font-weight: 700;
}
.plan-add:active { transform: scale(0.9); }
.plan-empty {
  display: block; width: 100%; text-align: left; color: var(--ink-soft);
  font-size: 0.84rem; padding: 8px 0 2px; min-height: 40px;
}
.plan-item { display: flex; align-items: center; gap: 10px; padding: 8px 0 2px; cursor: pointer; }
.plan-thumb { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.plan-thumb-ph { display: flex; align-items: center; justify-content: center; background: var(--bg-sunken); font-size: 1.15rem; }
.plan-text { flex: 1; min-width: 0; }
.plan-text b { display: block; font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-text small { color: var(--ink-soft); font-size: 0.78rem; }
.plan-remove { color: var(--ink-soft); padding: 6px 4px; font-size: 0.95rem; flex-shrink: 0; }

/* Timer in der Kochmodus-Kopfzeile */
.cook-timer {
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 0.9rem;
  padding: 0 14px; min-height: 44px; border-radius: 999px; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Einstellungen */
.set-block { background: var(--bg-card); border-radius: 14px; padding: 13px 14px; margin-bottom: 12px; }
.set-label { display: block; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 8px; }
.set-select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); color: var(--ink); font-size: 0.95rem; margin-bottom: 10px;
}
.set-check { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; margin-bottom: 6px; cursor: pointer; }
.set-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.set-block .btn-block { margin-bottom: 8px; }
.set-block .btn-block:last-child { margin-bottom: 0; }
.lang-row { justify-content: flex-start; }
.lang-active { border-color: var(--accent); color: var(--accent-deep); font-weight: 700; }

.ing-list { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; padding: 4px 0; }
.ing-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px dashed var(--line); cursor: pointer;
}
.ing-item:last-child { border-bottom: none; }
.ing-emoji { font-size: 1.15rem; width: 26px; text-align: center; flex-shrink: 0; }
.ing-text { flex: 1; }
.ing-check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--check-line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: transparent;
}
.ing-item.done .ing-check { background: var(--green); border-color: var(--green); color: #fff; }
.ing-item.done .ing-text { text-decoration: line-through; color: var(--ink-soft); }

.step-list { counter-reset: step; }
.step-item {
  display: flex; gap: 14px; background: var(--bg-card);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 10px;
}
.step-num {
  counter-increment: step;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.step-num::before { content: counter(step); }

.detail-cta-row { display: flex; gap: 10px; margin: 20px 0 8px; }
.detail-cta-row .btn { flex: 1; }

.video-link {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 16px; margin-top: 8px; text-decoration: none; color: var(--ink); font-weight: 600;
}


/* ---------- Editor ---------- */
.editor-field { margin-bottom: 16px; }
.editor-field label { display: block; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.editor-field input, .editor-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-card); outline: none; resize: vertical;
}
.editor-field input:focus, .editor-field textarea:focus { border-color: var(--accent); }
/* Platzhalter klar als Hinweis erkennbar, nicht wie echter Inhalt */
.editor-field input::placeholder, .editor-field textarea::placeholder { color: var(--ink-soft); opacity: 0.6; font-style: italic; }
.editor-field .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.editor-row { display: flex; gap: 12px; }
.editor-row .editor-field { flex: 1; }

.img-pick {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  border: 2px dashed var(--line); background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--ink-soft); overflow: hidden; position: relative;
}
.img-pick img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.img-remove {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(0,0,0,0.55); color: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 0.8rem; font-weight: 600;
}

/* ---------- Bottom Sheet ---------- */
.sheet-backdrop, .modal-backdrop {
  position: fixed; inset: 0; background: rgba(30, 22, 14, 0.45);
  z-index: 50; display: flex; backdrop-filter: blur(2px);
}
.sheet-backdrop { align-items: flex-end; }
.sheet {
  background: var(--bg); width: 100%; max-width: 640px; margin: 0 auto;
  border-radius: 24px 24px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-big); animation: sheetUp 0.22s ease;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.sheet h2 { font-size: 1.3rem; margin-bottom: 14px; }
.sheet-option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--bg-card); border-radius: 16px; padding: 13px 16px;
  margin-bottom: 10px; box-shadow: var(--shadow); text-align: left;
}
.sheet-option:active { transform: scale(0.98); }
.sheet-ico { font-size: 1.5rem; }
.sheet-option strong { display: block; font-size: 0.98rem; }
.sheet-option small { color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- Modal ---------- */
.modal-backdrop { align-items: center; justify-content: center; padding: 20px; }
.modal {
  background: var(--bg); border-radius: 22px; padding: 22px;
  width: 100%; max-width: 460px; box-shadow: var(--shadow-big);
  max-height: 86vh; overflow-y: auto; animation: sheetUp 0.2s ease;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 10px; }
.modal p { margin-bottom: 14px; }
.modal textarea, .modal input[type="url"], .modal input[type="text"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-card); outline: none; margin-bottom: 14px; resize: vertical;
}
.modal-btns { display: flex; gap: 10px; }
.modal-btns .btn { flex: 1; }

.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.import-status { text-align: center; padding: 16px 0; color: var(--ink-soft); }

/* ---------- Kochmodus ---------- */
.cook-mode {
  position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.cook-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cook-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cook-progress { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; white-space: nowrap; }
.cook-close { font-size: 0.9rem; font-weight: 700; color: var(--accent-deep); padding: 0 16px; min-height: 44px; background: var(--accent-soft); border-radius: 999px; }
.cook-bar { height: 5px; border-radius: 3px; background: var(--bg-sunken); margin-bottom: 22px; overflow: hidden; }
.cook-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.25s ease; }
/* Mittig, aber lange Zutatenlisten dürfen oben nicht abgeschnitten werden (auto-Ränder statt justify-content: center) */
.cook-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.cook-content > :first-child { margin-top: auto; }
.cook-content > :last-child { margin-bottom: auto; }
/* Schriftgröße im Kochmodus: --cook-scale kommt aus den Einstellungen (1 bis 1,8) */
.cook-step-text { font-size: calc(1.5rem * var(--cook-scale, 1)); line-height: 1.45; font-family: var(--serif); }
.cook-ing-title { font-size: calc(1.35rem * var(--cook-scale, 1)); margin-bottom: 14px; font-family: var(--serif); font-weight: 700; }
.cook-ing-list li { margin: 0 0 9px 20px; font-size: calc(1.1rem * var(--cook-scale, 1)); }
.cook-font { display: flex; gap: 6px; align-items: center; }
.cook-font button {
  width: 44px; height: 44px; border-radius: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-deep); border: 1px solid var(--line);
}
.cook-font button:disabled { opacity: 0.4; }
.cook-font .cook-font-a { font-size: 0.8rem; }
.cook-font .cook-font-b { font-size: 1.05rem; }
.cook-nav { display: flex; gap: 12px; margin-top: 18px; }
.cook-nav .btn { flex: 1; padding: 16px; font-size: 1.05rem; }

/* ---------- Einkaufsliste ---------- */
.shopping-add { display: flex; gap: 10px; margin-bottom: 16px; }
.shopping-add input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-card); outline: none;
}
.shop-group-title { font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; margin: 18px 2px 8px; }
.shop-src { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.shop-done-list { opacity: 0.6; }
.edit-tag-row { padding: 8px 2px 2px; }
.shop-empty { text-align: center; color: var(--ink-soft); padding: 40px 20px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 18px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 11px 20px;
  border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow-big); z-index: 90; max-width: 88vw; text-align: center;
  animation: toastUp 0.25s ease;
}
@keyframes toastUp { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Untere Navigation ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-around;
}
.nav-btn {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-soft); font-size: 0.75rem; font-weight: 600;
  padding: 6px 2px; position: relative;
}
.nav-btn.active { color: var(--accent); }
.nav-add {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(90, 117, 57, 0.45);
  margin-top: -22px; flex: 0 0 54px; margin-left: 4px; margin-right: 4px;
}
.nav-add:active { transform: scale(0.94); }
.badge {
  position: absolute; top: 2px; right: calc(50% - 26px);
  background: var(--accent); color: var(--on-accent);
  font-size: 0.66rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}


/* ---------- Einkaufsliste: Abteilungen ---------- */
.shop-tools { margin-bottom: 2px; }
.shop-group-n {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  background: var(--bg-sunken); color: var(--ink-soft); border-radius: 999px;
  font-size: 0.7rem; line-height: 17px; text-align: center;
}

/* ---------- Mehrere Rezepte auswählen ---------- */
.card-check {
  position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); border: 2px solid var(--accent);
  color: var(--accent-deep); font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.recipe-card-wrap.selected .card-check { background: var(--accent); color: var(--on-accent); }
.recipe-card-wrap.selected .recipe-card { outline: 2.5px solid var(--accent); outline-offset: -1px; }
.recipe-grid.selecting .recipe-card { cursor: pointer; }
.select-bar {
  position: fixed; left: 0; right: 0; z-index: 60;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(84, 62, 38, 0.12);
}
.select-bar-inner { max-width: 640px; margin: 0 auto; padding: 9px 12px 10px; }
.select-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.select-count { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.select-actions { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.select-actions::-webkit-scrollbar { display: none; }
.select-actions .tool-chip { flex-shrink: 0; }
.tool-chip:disabled { opacity: 0.4; }
.tool-chip.tool-danger { color: var(--red); }
body.has-select-bar #view-home { padding-bottom: 92px; }

/* ---------- Rezepte in Ordner ziehen ---------- */
.drag-ghost {
  position: fixed; z-index: 120; pointer-events: none;
  transform: translate(-50%, -140%);
  background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700;
  max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: var(--shadow-big);
}
body.kb-dragging { user-select: none; -webkit-user-select: none; }
.folder-tile.drop-over {
  outline: 3px solid var(--accent); outline-offset: 2px; transform: scale(1.04);
}

/* ---------- Editor: Abschnitte zum Auf- und Zuklappen ---------- */
.ed-sec {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; margin-bottom: 10px; overflow: hidden;
}
.ed-sec > summary {
  display: flex; align-items: baseline; gap: 8px; cursor: pointer;
  padding: 13px 14px; font-weight: 700; font-size: 0.95rem; list-style: none;
}
.ed-sec > summary::-webkit-details-marker { display: none; }
.ed-sec > summary::after {
  content: '▾'; margin-left: auto; color: var(--ink-soft); font-size: 0.8rem; transition: transform 0.15s ease;
}
.ed-sec[open] > summary::after { transform: rotate(180deg); }
.ed-sec[open] > summary { border-bottom: 1px solid var(--line); }
.ed-sec-h {
  font-weight: 400; font-size: 0.78rem; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%;
}
.ed-sec-body { padding: 14px 14px 2px; }
.ed-sec-body .editor-field:last-child { margin-bottom: 12px; }

/* ---------- Timer ---------- */
.cook-timer-new { background: var(--bg-sunken); color: var(--ink-soft); }
.timer-quick { flex-wrap: wrap; overflow: visible; }
.timer-quick .tag-chip { flex-shrink: 0; }

/* ---------- Fuß der Rezept-Ansicht ---------- */
.detail-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 10px; }

/* ---------- Drucken (und „als PDF sichern") ----------
   Auf dem Blatt soll nur das Rezept stehen: keine Navigation, keine Knöpfe,
   keine Häkchen-Kästchen. Schritte und Zutaten nicht über zwei Seiten reißen. */
@media print {
  :root { --bg: #fff; --bg-card: #fff; --bg-sunken: #fff; --ink: #000; --ink-soft: #444; --line: #bbb; }
  body { background: #fff; }
  .bottom-nav, .select-bar, .timer-chip, .toast, .modal-backdrop, .sheet-backdrop,
  .cook-mode, .home-header, .search-wrap, .browse-tools, .card-menu,
  .detail-back, .detail-actions, .detail-cta-row, .tools-row, .portion-stepper,
  .detail-bottom, .ing-check, .nutri-empty, .video-link { display: none !important; }
  .view { max-width: none; padding: 0; }
  .detail-hero { margin: 0; }
  .detail-hero img { max-height: 7cm; width: auto; max-width: 100%; }
  .detail-title { color: #000; }
  .ing-list, .nutri-box, .tips-box, .info-bar {
    box-shadow: none; border: 1px solid #ccc; background: #fff;
  }
  .ing-item, .step-item, .nutri-box, .tips-box { break-inside: avoid; page-break-inside: avoid; }
  .section-banner { background: none; color: #000; border-bottom: 2px solid #000; border-radius: 0; padding-left: 0; }
  .detail-tagline { color: #555; }
  a[href]::after { content: ''; }
}

/* Öffentliche Fassung: Hinweis bei eingefügtem Link, Rechtliches */
.hint-list { margin: 10px 0 16px 18px; color: var(--ink-soft); font-size: 0.92rem; }
.hint-list li { margin-bottom: 6px; }
.hint-list b { color: var(--ink); }
.legal-links { text-align: center; margin-top: 4px; }
.legal-links a { color: var(--accent-deep); display: inline-block; padding: 12px 6px; }

/* Impressum / Datenschutz (eigene Seiten) */
.legal-page { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.legal-page h1 { font-size: 1.7rem; margin: 8px 0 4px; }
.legal-page h2 { font-size: 1.15rem; margin: 26px 0 6px; }
.legal-page p, .legal-page li { margin-bottom: 8px; }
.legal-page ul { margin-left: 20px; }
.legal-page a { color: var(--accent-deep); }
.legal-page .back { display: inline-block; margin-bottom: 8px; text-decoration: none; }
.legal-page .fill { background: #ffe58f; color: #2b241c; padding: 0 4px; border-radius: 4px; }
body.legal { padding-bottom: 0; }

/* Schritt-Fotos */
.step-photo { margin-top: 10px; border-radius: 12px; max-height: 260px; object-fit: cover; width: 100%; cursor: pointer; }
.step-photo-add { position: relative; margin-top: 6px; font-size: 0.8rem; color: var(--ink-soft); padding: 6px 12px; border: 1px dashed var(--line); border-radius: 999px; }
.cook-step-photo { margin-top: 18px; border-radius: 16px; max-height: 40vh; width: 100%; object-fit: cover; }
@media print { .step-photo-add { display: none; } }
.step-body { flex: 1; min-width: 0; }
.step-photo-add { display: block; }

/* Zuschneiden vor der Texterkennung */
.crop-wrap { position: relative; margin: 10px auto 14px; width: fit-content; max-width: 100%; touch-action: none; user-select: none; }
.crop-wrap img { max-height: 58vh; max-width: 100%; display: block; border-radius: 8px; }
.crop-box { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); cursor: move; touch-action: none; }
.crop-wrap { overflow: hidden; border-radius: 8px; }
.crop-box span { position: absolute; width: 26px; height: 26px; background: var(--accent); border: 3px solid #fff; border-radius: 50%; }
.crop-box span[data-ecke="nw"] { left: -4px; top: -4px; cursor: nwse-resize; }
.crop-box span[data-ecke="ne"] { right: -4px; top: -4px; cursor: nesw-resize; }
.crop-box span[data-ecke="sw"] { left: -4px; bottom: -4px; cursor: nesw-resize; }
.crop-box span[data-ecke="se"] { right: -4px; bottom: -4px; cursor: nwse-resize; }

/* ---------- Tippflächen mind. 44 px ----------
   Kleine runde Knöpfe bleiben optisch klein, die unsichtbare Fläche drumherum
   reagiert aber auch (Daumen in der Küche, nasse Finger). */
.portion-stepper button::after, .plan-add::after, .card-menu::after, .step-photo-add::after {
  content: ''; position: absolute; inset: -4px;
}
.step-photo-add::after { inset: -7px -4px; }
/* Einstellungen: Auswahl-Knöpfe umbrechen statt seitlich zu verschwinden */
.set-block .tag-row { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }
.shopping-add .btn { min-width: 48px; }

/* ---------- Symbole (kbIcon in app.js) ---------- */
.ico { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.info-ico { color: var(--accent-deep); line-height: 0; margin-bottom: 3px; }
.card-fav { line-height: 0; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; }
.star-on { color: #c9921a; }
.star-on path { fill: #e8b230; }
.ing-emoji .ico, .tile-empty .ico, .crumb-title .ico { color: var(--accent-deep); }
.tile-empty .star-on { color: #c9921a; }
.tips-title, .ed-sec-t { display: inline-flex; align-items: center; gap: 6px; }
.tips-title { display: flex; }
.shop-empty .ico { color: var(--ink-soft); }
.sheet-ico {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Rezept ohne Foto (kbPlaceholder) ----------
   Anfangsbuchstabe auf einer von vier warmen Farben statt leerem Teller. */
:root {
  --ph0-bg: linear-gradient(140deg, #e9efdb, #dde7c9); --ph0-fg: #4e6b33;
  --ph1-bg: linear-gradient(140deg, #f6e6da, #efd6c4); --ph1-fg: #93472a;
  --ph2-bg: linear-gradient(140deg, #f5ecd3, #ecdfb9); --ph2-fg: #76601e;
  --ph3-bg: linear-gradient(140deg, #e9e7df, #dcd9cd); --ph3-fg: #55503f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ph0-bg: linear-gradient(140deg, #2e371f, #26301a); --ph0-fg: #b5cc92;
    --ph1-bg: linear-gradient(140deg, #3b2a21, #33241c); --ph1-fg: #e3a888;
    --ph2-bg: linear-gradient(140deg, #37301c, #2f2917); --ph2-fg: #dcc47f;
    --ph3-bg: linear-gradient(140deg, #302d27, #29261f); --ph3-fg: #bfb8a6;
  }
}
:root[data-theme="dark"] {
  --ph0-bg: linear-gradient(140deg, #2e371f, #26301a); --ph0-fg: #b5cc92;
  --ph1-bg: linear-gradient(140deg, #3b2a21, #33241c); --ph1-fg: #e3a888;
  --ph2-bg: linear-gradient(140deg, #37301c, #2f2917); --ph2-fg: #dcc47f;
  --ph3-bg: linear-gradient(140deg, #302d27, #29261f); --ph3-fg: #bfb8a6;
}
.ph { font-family: var(--serif); font-weight: 700; line-height: 1; }
.ph-0 { background: var(--ph0-bg); color: var(--ph0-fg); }
.ph-1 { background: var(--ph1-bg); color: var(--ph1-fg); }
.ph-2 { background: var(--ph2-bg); color: var(--ph2-fg); }
.ph-3 { background: var(--ph3-bg); color: var(--ph3-fg); }
.card-img-placeholder.ph { font-size: 2.6rem; }
.recipe-grid.as-list .card-img-placeholder.ph { font-size: 1.9rem; }
.plan-thumb-ph.ph { font-size: 1.25rem; }
.ing-ph { width: 28px; height: 28px; border-radius: 8px; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center; }
/* Rezept-Ansicht ohne Foto: keine leere Fläche, Knöpfe in einer Zeile über dem Titel */
.detail-hero.no-img { margin: -4px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.detail-hero.no-img .detail-back, .detail-hero.no-img .detail-actions { position: static; }
.detail-hero.no-img .detail-back, .detail-hero.no-img .detail-actions .icon-btn { background: var(--bg-card); color: var(--ink); }
.detail-hero.no-img + .detail-body { padding-top: 14px; }

/* ---------- Einstellungen: Umschalter Hell/Dunkel ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg-sunken); border-radius: 14px; padding: 4px; }
.seg button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; border-radius: 11px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
}
.seg button.on { background: var(--bg-card); color: var(--accent-deep); box-shadow: var(--shadow); }

/* Hinweise (Toast) nicht über dem Timer-Chip bzw. den Kochmodus-Knöpfen */
body:has(#timerChip:not([hidden])) .toast { bottom: calc(var(--nav-h) + 74px); }
#cookMode:not([hidden]) ~ .toast { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.timer-chip { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Zuletzt gekocht ---------- */
.cooked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 8px 2px 0; color: var(--ink-soft); font-size: 0.88rem; }
.cooked-text { display: inline-flex; align-items: center; gap: 6px; }
.cooked-text b { color: var(--ink); font-weight: 600; }

/* ---------- Backup-Erinnerung ---------- */
.backup-nag { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); color: var(--ink);
  border-radius: var(--radius); padding: 14px 14px 10px; margin-bottom: 14px; }
.backup-nag > .ico { color: var(--accent-deep); margin-top: 1px; }
.backup-nag-body { flex: 1; min-width: 0; }
.backup-nag-body p { font-size: 0.92rem; margin-bottom: 8px; }
.backup-nag-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-state { display: flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 600; color: var(--green); margin-bottom: 8px; }
.backup-state.warn { color: var(--red); }

/* ---------- Kochmodus: abhaken, „Dafür“, Zutaten-Knopf ---------- */
.cook-ing-list .cook-ing-item { list-style: none; margin-left: 0; display: flex; align-items: center; gap: 12px;
  min-height: 44px; cursor: pointer; }
.cook-ing-item .ing-check { width: 24px; height: 24px; }
.cook-ing-item.done .ing-check { background: var(--green); border-color: var(--green); color: #fff; }
.cook-ing-item.done > span:last-child { text-decoration: line-through; color: var(--ink-soft); }
.cook-ing-pop { max-height: 58vh; overflow-y: auto; padding: 0; }
.cook-ing-pop .cook-ing-sec { margin-top: 8px !important; }
.cook-need { margin-top: 22px; background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; }
.cook-need-t { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 4px; }
.cook-need ul { list-style: none; }
.cook-need li { font-size: calc(1.05rem * var(--cook-scale, 1)); padding: 3px 0; }
.cook-ing-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.cook-tools { flex-wrap: wrap; }

/* ---------- Einkaufsliste: zwei Knöpfe oben ---------- */
.sub-header-btns { display: flex; gap: 8px; }

/* Auswahlfenster müssen auch ÜBER dem Kochmodus liegen (Timer, Zutaten) */
body:has(#cookMode:not([hidden])) #pickerModal { z-index: 86; }
