:root {
  --bg: #fff8f0;
  --bg2: #fff1e3;
  --card: #ffffff;
  --text: #2b2118;
  --muted: #7a6a5c;
  --line: #f0dfcc;
  --accent: #e8590c;
  --accent2: #ff922b;
  --accent-soft: #ffe8d6;
  --green: #2b8a3e;
  --green-soft: #e3f6e6;
  --red: #c92a2a;
  --red-soft: #ffe3e3;
  --blue: #1c7ed6;
  --yellow-soft: #fff3bf;
  --shadow: 0 1px 2px rgba(70, 40, 10, 0.06), 0 6px 20px rgba(70, 40, 10, 0.07);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120f;
    --bg2: #211a15;
    --card: #241d18;
    --text: #f6ece3;
    --muted: #b3a294;
    --line: #3a2f27;
    --accent: #ff8a3d;
    --accent2: #ffa94d;
    --accent-soft: #3d2616;
    --green: #69db7c;
    --green-soft: #1b2e1f;
    --red: #ff8787;
    --red-soft: #3a1d1d;
    --blue: #74c0fc;
    --yellow-soft: #3a3217;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(76px + var(--safe-b));
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.9rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.8em; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ---------- Kopf & Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--text); }
.brand-icon { font-size: 1.5rem; }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 9px; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.bottomnav a span { font-size: 1.3rem; filter: grayscale(0.7); opacity: 0.8; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a.active span { filter: none; opacity: 1; }
@media (min-width: 820px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 40px; }
}

main { max-width: 980px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---------- Bausteine ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-title .num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 0.9rem; }
.section-title h2 { margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); font-weight: 650; cursor: pointer; text-align: center;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:hover { border-color: var(--accent2); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.green { background: var(--green); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.big { padding: 15px 22px; font-size: 1.08rem; border-radius: 16px; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 12px; font-size: 0.875rem; border-radius: 11px; }
.btn.icon { padding: 9px 11px; }
.btn.danger { color: var(--red); }

input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent2) 25%, transparent); }
textarea { resize: vertical; min-height: 84px; }
label.field { display: block; }
label.field > span { display: block; font-weight: 650; font-size: 0.9rem; margin-bottom: 6px; }

/* Chips (Auswahl) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 0.92rem;
  -webkit-tap-highlight-color: transparent; user-select: none; transition: all 0.12s;
}
.chip:hover { border-color: var(--accent2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on.green { background: var(--green); border-color: var(--green); }
.chip.on.red { background: var(--red); border-color: var(--red); }

/* Segment (Ernährung) */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; font-size: 0.82rem;
  -webkit-tap-highlight-color: transparent; transition: all 0.12s;
}
.seg button .e { font-size: 1.7rem; line-height: 1.1; }
.seg button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
@media (max-width: 420px) { .seg button { font-size: 0.72rem; padding: 10px 2px; } .seg button .e { font-size: 1.45rem; } }

/* Stepper (Portionen) */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; background: transparent; width: 40px; height: 38px; font-size: 1.25rem; cursor: pointer; color: var(--accent); font-weight: 800; }
.stepper span { min-width: 76px; text-align: center; font-weight: 700; }

/* ---------- Startseite ---------- */
.hero { text-align: center; padding: 18px 0 22px; }
.hero h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.hero .hero-emoji { font-size: 2.4rem; letter-spacing: 4px; margin-bottom: 6px; }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 20px 10px; border-radius: 18px; border: 2px dashed color-mix(in srgb, var(--accent2) 55%, var(--line));
  background: var(--bg2); cursor: pointer; font-weight: 700; text-align: center; transition: all 0.15s;
}
.upload-btn:hover, .upload-btn.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-btn .e { font-size: 2rem; }
.upload-btn small { font-weight: 500; color: var(--muted); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; font-size: 0.85rem; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ing-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ing {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 11px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; animation: pop 0.25s ease;
}
.ing.soon { background: var(--yellow-soft); border-color: color-mix(in srgb, #fab005 50%, var(--line)); }
.ing .amt { color: var(--muted); font-weight: 500; font-size: 0.82rem; }
.ing button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.ing button:hover { background: var(--line); color: var(--text); }
.ai-comment { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 0.93rem; }
.add-ing { display: flex; gap: 8px; margin-top: 12px; }
.add-ing input { flex: 1; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }

details.more { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "＋ "; }
details.more[open] summary::before { content: "－ "; }
.filter-group { margin-top: 14px; }
.filter-group > .lbl { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; display: block; }

.cta-bar { position: sticky; bottom: calc(70px + var(--safe-b)); z-index: 10; display: flex; gap: 10px; margin: 18px 0; }
.cta-bar .btn.primary { flex: 1; }
@media (min-width: 820px) { .cta-bar { bottom: 16px; } }

/* Vorschläge */
.sugg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.sugg {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; animation: rise 0.35s ease both;
  text-align: left; padding: 0; color: inherit;
}
.sugg:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(70, 40, 10, 0.14); }
.sugg-top { position: relative; width: 100%; height: 112px; display: grid; place-items: center; font-size: 3.6rem; }
.sugg-top .match { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, 0.88); color: #2b2118; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 800; }
.sugg-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sugg-body h3 { margin: 0; font-size: 1.1rem; }
.sugg-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.sugg .missing { font-size: 0.85rem; color: var(--red); }
.sugg .missing.ok { color: var(--green); }
.sugg .hl { font-size: 0.82rem; font-weight: 700; color: var(--accent); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); }
.badge.vegan { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.vegetarisch { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.fisch { background: color-mix(in srgb, var(--blue) 14%, var(--card)); color: var(--blue); border-color: transparent; }
.badge.fleisch { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* Lade-Animation */
.cooking-loader { text-align: center; padding: 34px 10px; }
.pan { font-size: 3.4rem; display: inline-block; animation: flip 1.4s ease-in-out infinite; }
.cooking-loader .msg { margin-top: 10px; font-weight: 700; min-height: 1.5em; }
@keyframes flip { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg) translateY(-6px); } }
.skeleton { background: linear-gradient(90deg, var(--bg2) 0%, var(--line) 50%, var(--bg2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); height: 260px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Rezeptseite ---------- */
.r-hero { border-radius: 24px; padding: 26px 22px; margin-bottom: 16px; color: #2b2118; position: relative; overflow: hidden; }
.r-hero .big-emoji { font-size: 4.5rem; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); }
.r-hero h1 { margin-bottom: 8px; }
.r-hero p { opacity: 0.85; max-width: 680px; }
.r-hero .badge { background: rgba(255, 255, 255, 0.7); color: #2b2118; border-color: transparent; }
.r-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.r-stats div { background: rgba(255, 255, 255, 0.62); border-radius: 14px; padding: 9px 6px; text-align: center; }
.r-stats b { display: block; font-size: 1.1rem; }
.r-stats small { font-size: 0.75rem; opacity: 0.75; }
.r-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.r-actions .btn.primary { flex: 1 1 220px; }
.view-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 16px; width: 100%; max-width: 440px; }
.view-toggle button { border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--muted); }
.view-toggle button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

.r-layout { display: grid; gap: 16px; }
@media (min-width: 860px) { .r-layout { grid-template-columns: 340px 1fr; align-items: start; } .r-side { position: sticky; top: 76px; } }

.ing-table { list-style: none; padding: 0; margin: 0; }
.ing-table li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.ing-table li:last-child { border-bottom: 0; }
.ing-table .chk { flex: 0 0 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 0.8rem; color: #fff; margin-top: 1px; }
.ing-table li.done .chk { background: var(--green); border-color: var(--green); }
.ing-table li.done .nm { text-decoration: line-through; opacity: 0.55; }
.ing-table .qty { flex: 0 0 auto; min-width: 74px; font-weight: 800; color: var(--accent); }
.ing-table .nm { flex: 1; }
.ing-table .nm small { display: block; color: var(--muted); }
.tag-missing { font-size: 0.72rem; font-weight: 800; color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }
.ing-group { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 800; margin: 14px 0 2px; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .n { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; }
.steps li.done .n { background: var(--green); color: #fff; }
.steps li.done .st { opacity: 0.55; }
.steps .st { flex: 1; }
.steps h3 { margin: 4px 0 4px; }
.tip { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--yellow-soft); font-size: 0.9rem; }

.info-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.drink { display: flex; gap: 12px; padding: 8px 0; }
.drink .e { font-size: 1.6rem; }
.nut-kcal { font-size: 2rem; font-weight: 800; }
.macro { margin-top: 10px; }
.macro .bar { height: 9px; border-radius: 9px; background: var(--bg2); overflow: hidden; margin-top: 4px; }
.macro .bar i { display: block; height: 100%; border-radius: 9px; }
ul.nice { margin: 0; padding-left: 1.2em; }
ul.nice li { margin: 4px 0; }

/* Essen fertig */
.ready-card { background: linear-gradient(135deg, color-mix(in srgb, var(--green) 16%, var(--card)), var(--card)); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.btn.ready { background: linear-gradient(135deg, #40c057, #2b8a3e); color: #fff; border-color: transparent; font-size: 1.15rem; padding: 16px 20px; box-shadow: 0 8px 20px rgba(43, 138, 62, 0.35); }

/* Bewertung */
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: transparent; font-size: 1.6rem; cursor: pointer; padding: 0 2px; filter: grayscale(1); opacity: 0.35; transition: transform 0.1s; }
.stars button.on { filter: none; opacity: 1; }
.stars button:hover { transform: scale(1.15); }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; margin-bottom: 10px; }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; font-size: 0.95rem; }
.bubble.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.model { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 5px; }
.quick-q { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.quick-q button { font-size: 0.82rem; padding: 5px 10px; }

/* ---------- Kochmodus ---------- */
.cook {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(14px + var(--safe-b));
}
.cook-head { display: flex; align-items: center; gap: 10px; }
.cook-head .t { flex: 1; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 8px; border-radius: 8px; background: var(--bg2); overflow: hidden; margin: 12px 0 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.3s; }
.cook-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; max-width: 760px; width: 100%; margin: 0 auto; padding: 18px 2px; }
.cook-step-n { color: var(--accent); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.cook-body h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin: 6px 0 14px; }
.cook-text { font-size: clamp(1.2rem, 3.6vw, 1.55rem); line-height: 1.55; }
.cook-ings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cook-ings span { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 600; }
.cook-ings b { color: var(--accent); }
.cook-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.cook-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.cook-done { text-align: center; }
.cook-done .big { font-size: 5rem; animation: flip 1.6s ease-in-out infinite; }
.anim-in { animation: slidein 0.28s ease both; }
.anim-back { animation: slideback 0.28s ease both; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideback { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Timer */
#timers { position: fixed; z-index: 60; right: 12px; bottom: calc(84px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
@media (min-width: 820px) { #timers { bottom: 20px; } }
.timer-pill {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--text); color: var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-weight: 700;
}
.timer-pill .time { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.timer-pill .lbl { font-size: 0.82rem; opacity: 0.8; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-pill button { border: 0; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; background: rgba(127, 127, 127, 0.3); color: inherit; }
.timer-pill.ring { background: var(--red); color: #fff; animation: ring 0.6s ease-in-out infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg) scale(1.04); } 75% { transform: rotate(3deg) scale(1.04); } }

/* Listen (Favoriten/Verlauf) */
.list-tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.list-tools input { flex: 1 1 200px; }
.rlist { display: grid; gap: 10px; }
.ritem { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; transition: border-color 0.15s; }
.ritem:hover { border-color: var(--accent2); }
.ritem .e { font-size: 2.2rem; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; }
.ritem .info { flex: 1; min-width: 0; }
.ritem .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty .e { font-size: 3.2rem; margin-bottom: 10px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(20, 12, 5, 0.5); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.modal { background: var(--card); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); animation: up 0.22s ease; }
@media (min-width: 620px) { .modal-bg { align-items: center; } .modal { border-radius: 24px; } }
.modal h2 { display: flex; align-items: center; justify-content: space-between; }
.modal .x { border: 0; background: var(--bg2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; }
.check-list label { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.check-list input { width: 20px; height: 20px; accent-color: var(--accent); }
.check-list .spec { color: var(--muted); font-size: 0.88rem; margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%) translateY(20px); z-index: 100; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all 0.25s; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); color: #fff; }

.notice { padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); margin-bottom: 14px; font-size: 0.93rem; }
.notice.err { background: var(--red-soft); color: var(--red); }
code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; font-size: 0.88em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 0.93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* Drucken */
@media print {
  .topbar, .bottomnav, #timers, .r-actions, .view-toggle, .no-print, .cta-bar { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  .r-layout { grid-template-columns: 1fr 1.6fr; }
  .r-hero { padding: 0; background: none !important; }
  .r-hero .big-emoji { font-size: 2.5rem; }
}
@media (max-width: 560px) {
  .r-actions { display: grid; grid-template-columns: repeat(5, 1fr); }
  .r-actions .btn.primary { grid-column: 1 / -1; }
  .r-actions .btn.icon { padding: 12px 0; }
}
/* im Kochmodus Timer oben, damit sie die Buttons unten nicht verdecken */
body.cooking #timers { bottom: auto; top: calc(70px + env(safe-area-inset-top, 0px)); }
