/* ================= foodies – Grundstil ================= */
:root {
  color-scheme: light;
  --cream: #fbf8f2;
  --cream-2: #f6f1e7;
  --paper: #fffdf9;
  --mint-50: #f0f7f3;
  --mint-100: #e1f0e8;
  --mint-200: #c9e5d7;
  --mint-300: #a6d4bf;
  --mint-500: #6fb498;
  --mint-700: #3f7f68;
  --mint-900: #2a5446;
  --peach: #f2b896;
  --peach-soft: #fbe6d8;
  --terracotta: #d98a64;
  --honey: #f4d79a;
  --ink: #3b3631;
  --ink-soft: #6d665d;
  --line: rgba(80, 70, 55, .10);
  --shadow-sm: 0 1px 2px rgba(70, 60, 40, .05), 0 2px 8px rgba(70, 60, 40, .05);
  --shadow-md: 0 4px 14px rgba(70, 60, 40, .08), 0 12px 32px rgba(70, 60, 40, .06);
  --shadow-lg: 0 20px 60px rgba(50, 45, 30, .18);
  --radius: 22px;
  --radius-sm: 14px;
  --pill: 999px;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--mint-50) 0%, var(--cream) 38%, var(--cream) 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.muted { color: var(--ink-soft); }

/* weich gezeichnete Hintergrund-Flecken */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.bg-blobs span:nth-child(1) { width: 480px; height: 480px; background: var(--mint-200); top: -160px; left: -120px; }
.bg-blobs span:nth-child(2) { width: 420px; height: 420px; background: var(--peach-soft); top: 120px; right: -160px; }
.bg-blobs span:nth-child(3) { width: 360px; height: 360px; background: #fff3d6; bottom: -120px; left: 30%; opacity: .5; }

/* ================= Header ================= */
.site-header { max-width: 980px; margin: 0 auto; padding: 36px 20px 8px; text-align: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 34px; filter: drop-shadow(0 4px 8px rgba(63,127,104,.25)); }
.brand-name {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(40px, 7vw, 56px); letter-spacing: -.02em; color: var(--mint-900);
}
.brand-tag { margin: 2px 0 0; color: var(--ink-soft); font-size: 15px; }

/* ================= Pillen-Tabs ================= */
.tabs {
  position: sticky; top: 10px; z-index: 20;
  display: flex; gap: 6px; width: fit-content; max-width: calc(100% - 32px);
  margin: 18px auto 26px; padding: 6px;
  background: rgba(255, 253, 249, .62);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--pill);
  box-shadow: 0 6px 24px rgba(63,127,104,.12), inset 0 1px 0 rgba(255,255,255,.9);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 0; border-radius: var(--pill);
  background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 15px;
  cursor: pointer; white-space: nowrap;
  transition: background .25s, color .25s, box-shadow .25s, transform .15s;
}
.tab-emoji { font-size: 18px; line-height: 1; }
.tab:hover { background: rgba(201,229,215,.45); color: var(--mint-900); }
.tab:active { transform: scale(.97); }
.tab.is-active {
  background: linear-gradient(180deg, #fff 0%, var(--mint-100) 100%);
  color: var(--mint-900);
  box-shadow: 0 2px 10px rgba(63,127,104,.18), 0 0 0 1px rgba(111,180,152,.25), inset 0 1px 0 #fff;
}
.tab:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }

/* ================= Panels ================= */
main { max-width: 860px; margin: 0 auto; padding: 0 16px 80px; }
.panel { display: none; animation: fadeUp .35s ease; }
.panel.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 30px; color: var(--mint-900); letter-spacing: -.01em; }
.panel-head p { margin: 2px 0 0; font-size: 14px; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: var(--pill); border: 0;
  font-weight: 800; font-size: 15px; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #7cc0a3 0%, var(--mint-700) 100%);
  box-shadow: 0 6px 16px rgba(63,127,104,.28), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 8px 22px rgba(63,127,104,.34), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-soft { background: var(--mint-100); color: var(--mint-900); padding: 9px 16px; font-size: 14px; }
.btn-soft:hover { background: var(--mint-200); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-warm { background: var(--peach-soft); color: #9a5435; }
.btn-warm:hover { background: #f8d8c4; }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.85); color: var(--ink-soft); cursor: pointer; font-size: 15px;
  box-shadow: var(--shadow-sm); transition: background .2s, transform .15s;
}
.icon-btn:hover { background: #fff; color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.armed { width: auto; padding: 0 14px; border-radius: 999px; background: var(--terracotta); color: #fff; font-weight: 800; font-size: 13px; }

/* ================= Kochen / Backen ================= */
.subtabs {
  display: flex; gap: 4px; width: fit-content; margin: 4px 0 16px; padding: 5px;
  background: rgba(225,240,232,.55); border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--pill); box-shadow: inset 0 1px 3px rgba(63,127,104,.08);
}
.subtab {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 20px; border: 0; border-radius: var(--pill);
  background: transparent; color: var(--ink-soft); font-weight: 800; font-size: 15px; cursor: pointer;
  transition: background .25s, color .25s, box-shadow .25s;
}
.subtab:hover { color: var(--mint-900); }
.subtab.is-active { background: var(--paper); color: var(--mint-900); box-shadow: 0 2px 8px rgba(63,127,104,.16), inset 0 1px 0 #fff; }
.subtab:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }

/* ================= Filter ================= */
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row .chips { flex: 1; min-width: 0; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--pill);
  border: 1px solid var(--mint-300); background: var(--mint-50); color: var(--mint-900);
  font-size: 13px; font-weight: 800; cursor: pointer; transition: all .2s;
}
.filter-btn:hover, .filter-btn[aria-expanded="true"] { background: var(--mint-100); }
.filter-btn.has-active { background: var(--mint-700); border-color: var(--mint-700); color: #fff; }
.filter-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill); display: inline-grid; place-items: center; background: #fff; color: var(--mint-900); font-size: 12px; }
.filter-panel {
  padding: 14px 16px; border-radius: var(--radius); background: rgba(255,253,249,.9);
  border: 1px solid var(--mint-100); box-shadow: var(--shadow-sm); animation: fadeUp .25s ease;
}
.filter-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; color: var(--mint-900); }
.link-btn { border: 0; background: none; color: var(--ink-soft); font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--pill);
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all .2s;
}
.tag:hover { border-color: var(--mint-300); color: var(--ink); }
.tag[aria-pressed="true"] { background: var(--mint-100); border-color: var(--mint-500); color: var(--mint-900); box-shadow: inset 0 0 0 1px var(--mint-500); }

/* Kochen/Backen im Editor */
.seg { display: flex; gap: 4px; padding: 4px; width: fit-content; border-radius: var(--pill); background: var(--mint-50); border: 1px solid var(--mint-100); }
.seg-btn { padding: 7px 16px; border: 0; border-radius: var(--pill); background: transparent; color: var(--ink-soft); font-weight: 800; font-size: 14px; cursor: pointer; transition: all .2s; }
.seg-btn[aria-checked="true"] { background: #fff; color: var(--mint-900); box-shadow: 0 2px 6px rgba(63,127,104,.15); }

/* ================= Toolbar ================= */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.search {
  display: flex; align-items: center; gap: 10px; padding: 0 18px;
  background: rgba(255,253,249,.85); border: 1px solid var(--line); border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
}
.search input { flex: 1; border: 0; background: transparent; padding: 12px 0; outline: none; font-size: 15px; }
.search:focus-within { border-color: var(--mint-300); box-shadow: 0 0 0 4px rgba(166,212,191,.3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: var(--pill); border: 1px solid var(--line);
  background: rgba(255,253,249,.7); font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  transition: all .2s;
}
.chip:hover { background: #fff; color: var(--ink); }
.chip.is-active { background: var(--mint-700); border-color: var(--mint-700); color: #fff; }

/* ================= Rezeptliste (schmale Leisten) ================= */
.recipe-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recipe-bar {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 8px 16px 8px 8px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.recipe-bar:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--mint-200); }
.recipe-bar:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }
.thumb {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 16px; overflow: hidden;
  display: grid; place-items: center; font-size: 30px;
}
.thumb { position: relative; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bar-body { flex: 1; min-width: 0; }
.bar-title {
  margin: 0; font-weight: 800; font-size: 16.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 13px; color: var(--ink-soft); }
.bar-meta span { white-space: nowrap; }
.bar-chevron { color: var(--mint-500); font-size: 20px; transition: transform .2s; }
.recipe-bar:hover .bar-chevron { transform: translateX(3px); }

/* Platzhalter-Bilder je Kategorie */
.ph-0 { background: linear-gradient(135deg, var(--mint-100), var(--mint-200)); }
.ph-1 { background: linear-gradient(135deg, var(--peach-soft), #f8d2bb); }
.ph-2 { background: linear-gradient(135deg, #fdf1d2, var(--honey)); }
.ph-3 { background: linear-gradient(135deg, #e9f3ea, #fbe9dc); }

/* Leerzustand & Bald */
.empty, .soon { text-align: center; padding: 56px 20px; background: rgba(255,253,249,.6); border: 1.5px dashed var(--mint-200); border-radius: var(--radius); }
.empty-emoji, .soon-emoji { font-size: 48px; margin-bottom: 6px; }
.soon h2 { margin: 0 0 4px; font-family: var(--font-display); color: var(--mint-900); }

/* ================= Modals ================= */
.modal {
  width: min(820px, calc(100% - 24px)); max-height: calc(100% - 32px);
  padding: 0; border: 0; border-radius: 28px;
  background: var(--cream); color: var(--ink);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal[open] { animation: popIn .28s cubic-bezier(.2,.9,.3,1.1); }
.modal::backdrop { background: rgba(42, 60, 50, .28); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-inner { max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.modal-top h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--mint-900); }
body.modal-open { overflow: hidden; }

/* ---------- Detail ---------- */
.hero { position: relative; height: 260px; display: grid; place-items: center; font-size: 96px; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(transparent, var(--cream)); }
.hero-actions { position: absolute; top: 14px; right: 14px; left: 14px; display: flex; justify-content: flex-end; gap: 8px; z-index: 2; }
.detail-body { padding: 0 28px 30px; margin-top: -26px; position: relative; z-index: 1; }
.detail-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 5vw, 36px); line-height: 1.15; color: var(--mint-900); letter-spacing: -.01em; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }
.meta-chip.tag-chip { background: var(--mint-50); border-color: var(--mint-200); color: var(--mint-900); }
.meta-chip { padding: 5px 12px; border-radius: var(--pill); background: rgba(255,255,255,.8); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-soft); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.card h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--mint-900); }

.servings { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; margin-bottom: 14px; border-radius: var(--pill); background: var(--mint-50); border: 1px solid var(--mint-100); }
.servings-label { font-size: 13px; font-weight: 700; color: var(--mint-900); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: var(--mint-700); font-size: 18px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s, background .2s; }
.stepper button:hover { background: var(--mint-100); }
.stepper button:active { transform: scale(.9); }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper output { min-width: 64px; text-align: center; font-weight: 800; font-size: 15px; }

.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; transition: opacity .2s; }
.ing-list li:last-child { border-bottom: 0; }
.ing-amt { flex: 0 0 auto; min-width: 74px; font-weight: 800; color: var(--mint-700); font-variant-numeric: tabular-nums; }
.ing-list li.done { opacity: .4; text-decoration: line-through; }

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li { position: relative; padding: 2px 0 16px 46px; cursor: pointer; counter-increment: step; transition: opacity .2s; }
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--peach-soft); color: #a45c3b; font-weight: 800; font-size: 14px;
}
.step-list li.done { opacity: .45; }
.step-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--mint-900); margin: 2px 0 3px; }
.step-text { display: block; }
.step-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rows .step-fields .s-title { font-weight: 800; color: var(--mint-900); }
.rows .step-fields .s-title::placeholder { font-weight: 500; }
.step-list li.done::before { content: "✓"; background: var(--mint-200); color: var(--mint-900); }
.hint { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; }

.tips-card { margin-top: 18px; background: linear-gradient(135deg, #fff8e8, var(--peach-soft)); border-color: rgba(217,138,100,.18); }
.tips-card h3 { color: #94543a; }
.tips-card ul { margin: 0; padding-left: 0; list-style: none; }
.tips-card li { position: relative; padding: 4px 0 4px 28px; }
.tips-card li::before { content: "💡"; position: absolute; left: 0; top: 4px; font-size: 15px; }

/* ---------- Editor ---------- */
.editor { padding-bottom: 0; }
.editor .section { margin: 14px 24px; border: 1px solid var(--line); min-width: 0; }
/* Legende als eigener Block oberhalb des Inhalts (kein float – der verschob auf dem Handy die Zutaten) */
/* float holt die Legende in die Karte; ALLE folgenden Elemente räumen den float (vorher nur das erste –
   das war auf dem Handy ausgeblendet, daher rutschten die Zutaten daneben) */
.editor legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 0; margin-bottom: 12px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--mint-900); float: left; width: 100%; }
.editor .section > :not(legend) { clear: both; }
.editor legend small { font-family: var(--font-body); font-size: 12.5px; font-weight: 500; }
.step-badge { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-100); color: var(--mint-700); font-family: var(--font-body); font-weight: 800; font-size: 14px; }

.title-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.image-drop {
  position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; text-align: center;
  background: var(--mint-50); border: 2px dashed var(--mint-300); color: var(--mint-700); font-weight: 700; font-size: 14px;
  transition: background .2s, border-color .2s;
}
.image-drop:hover, .image-drop.drag { background: var(--mint-100); border-color: var(--mint-500); }
.image-drop img { max-width: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-drop .big { display: block; font-size: 34px; margin-bottom: 4px; }
.image-drop small { font-weight: 500; color: var(--ink-soft); }
.image-col { min-width: 0; }
.image-remove { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; box-shadow: var(--shadow-sm); }

.fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-soft); padding-left: 4px; }
.field-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="url"], select, textarea, .rows input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 46px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--mint-300); box-shadow: 0 0 0 4px rgba(166,212,191,.3); }
input.invalid { border-color: var(--terracotta); box-shadow: 0 0 0 4px rgba(217,138,100,.18); }

.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ing-head, .ing-row { display: grid; grid-template-columns: 136px 104px minmax(0, 1fr) 38px; gap: 8px; align-items: center; }
.ing-row { grid-template-areas: "amt unit name del" "sugg sugg sugg sugg"; }
.ing-row .i-step { grid-area: amt; }
.ing-row .i-unit { grid-area: unit; }
.ing-row .i-name-wrap { grid-area: name; }
.ing-row .row-del { grid-area: del; }
.ing-row .ing-suggest { grid-area: sugg; }
.i-step { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); }
.i-step:focus-within { border-color: var(--mint-300); box-shadow: 0 0 0 4px rgba(166,212,191,.3); }
.i-step button { width: 30px; height: 34px; flex: 0 0 30px; border: 0; border-radius: 10px; background: var(--mint-50); color: var(--mint-700); font-size: 17px; font-weight: 800; cursor: pointer; }
.i-step button:active { transform: scale(.92); }
.rows .i-step input { flex: 1; min-width: 0; padding: 6px 2px; border: 0; background: transparent; text-align: center; font-weight: 800; box-shadow: none; }
.rows .i-step input:focus { box-shadow: none; }
.i-unit { padding-right: 6px; }
.i-name-wrap { position: relative; min-width: 0; }
.i-emoji { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 18px; pointer-events: none; }
.rows .i-name-wrap input { padding-left: 38px; }
.ing-suggest { list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--mint-100); border-radius: 16px; box-shadow: var(--shadow-md); }
.ing-head { font-size: 12px; font-weight: 700; color: var(--ink-soft); padding: 0 6px 4px; }
.text-row { display: grid; grid-template-columns: 30px 1fr 38px; gap: 8px; align-items: start; }
.text-row .num { width: 30px; height: 30px; margin-top: 8px; border-radius: 50%; display: grid; place-items: center; background: var(--peach-soft); color: #a45c3b; font-weight: 800; font-size: 13px; }
.text-row .num.tip { background: #fff3d6; }
.row-del { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 14px; transition: background .2s, color .2s; }
.text-row .row-del { margin-top: 4px; }
.row-del:hover { background: var(--peach-soft); color: #a45c3b; }

.modal-actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; margin-top: 10px;
  background: rgba(251,248,242,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

/* ================= Inspiration ================= */
.insp-chefkoch { margin-top: 14px; text-decoration: none; }
.insp-random { margin-top: 10px; background: var(--peach-soft); border-color: rgba(217,138,100,.25); color: #94543a; }
.insp-random:hover { background: #f8d8c4; color: #7c4029; }
.search-go {
  flex: 0 0 auto; margin-right: -12px; padding: 7px 16px; border: 0; border-radius: var(--pill);
  background: var(--mint-700); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer; transition: filter .2s;
}
.search-go:hover { filter: brightness(1.08); }
.insp-status {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; margin-bottom: 14px;
  border-radius: var(--radius); background: rgba(255,253,249,.7); border: 1.5px dashed var(--mint-200);
  color: var(--ink-soft); text-align: center; font-weight: 600;
}
.insp-status .big { display: block; font-size: 40px; margin-bottom: 4px; }
.spinner { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; border: 3px solid var(--mint-200); border-top-color: var(--mint-700); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.idea-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.idea-card {
  display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.idea-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--mint-200); }
.idea-card:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }
/* Bild absolut im Rahmen verankern – sonst lässt Safari den 4:3-Rahmen auf Originalbildgröße wachsen */
.idea-img { position: relative; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; min-height: 0; flex: 0 0 auto; display: grid; place-items: center; font-size: 54px; overflow: hidden; }
@supports not (aspect-ratio: 1) { .idea-img { height: 0; padding-top: 75%; } }
.idea-img img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.idea-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.idea-title { margin: 0; font-weight: 800; font-size: 15.5px; line-height: 1.3; color: var(--ink); }
.idea-sub { font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.idea-tags { font-size: 14px; letter-spacing: 2px; }
.insp-more { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--ink-soft); }
.insp-more a { color: var(--mint-700); font-weight: 800; text-decoration: none; padding: 4px 10px; border-radius: var(--pill); background: var(--mint-50); border: 1px solid var(--mint-100); margin: 0 3px; display: inline-block; }
.insp-more a:hover { background: var(--mint-100); }
.idea-summary { margin: -8px 0 18px; color: var(--ink-soft); font-size: 15.5px; max-width: 62ch; }
.idea-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.idea-actions a.btn { text-decoration: none; }
.simple-ing { list-style: none; margin: 0; padding: 0; }
.simple-ing li { display: flex; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.simple-ing li:last-child { border-bottom: 0; }
.origin-note { margin-top: 14px; font-size: 13px; color: var(--ink-soft); }

/* ================= Anmeldung & Sync ================= */
.site-header { position: relative; }
.logout-btn {
  position: absolute; top: 18px; right: max(16px, env(safe-area-inset-right, 0px));
  padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line);
  background: rgba(255,253,249,.7); color: var(--ink-soft); font-size: 13px; font-weight: 700; cursor: pointer;
}
.logout-btn:hover { background: #fff; color: var(--ink); }
body.locked .tabs, body.locked main { display: none; }
.login { display: grid; place-items: center; padding: 20px 16px 80px; }
.login-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; text-align: center;
  padding: 28px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-md);
}
.login-card h2 { margin: 0; font-family: var(--font-display); font-weight: 600; color: var(--mint-900); font-size: 26px; }
.login-card p { margin: 0; }
.login-card .field { text-align: left; }
.login-emoji { font-size: 40px; }
.login-error { color: #a4472a; background: var(--peach-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; font-weight: 600; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff8e8, var(--peach-soft)); border: 1px solid rgba(217,138,100,.2); font-weight: 600; font-size: 14.5px;
}
.banner-actions { display: flex; gap: 8px; }
.draft-banner { margin: 6px 24px 0; }
@media (max-width: 680px) { .draft-banner { margin: 6px 14px 0; } }

/* ================= Einkaufsliste ================= */
.shop-add {
  display: flex; gap: 8px; align-items: center; padding: 6px; margin-bottom: 6px;
  background: rgba(255,253,249,.9); border: 1px solid var(--line); border-radius: var(--pill); box-shadow: var(--shadow-sm);
}
.shop-add:focus-within { border-color: var(--mint-300); box-shadow: 0 0 0 4px rgba(166,212,191,.3); }
.shop-add input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; outline: none; box-shadow: none; }
.shop-add input:focus { box-shadow: none; }
.shop-add select { width: auto; flex: 0 0 auto; max-width: 42%; padding: 8px 10px; border-radius: var(--pill); background: var(--mint-50); border-color: var(--mint-100); font-size: 14px; font-weight: 700; color: var(--mint-900); }
.shop-add-btn { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; font-size: 22px; }
.shop-hint { margin: 0 0 18px 14px; font-size: 12.5px; }

.shop-cat { margin-bottom: 18px; }
.shop-cat-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 4px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--mint-900); }
.shop-cat-emoji { font-size: 20px; }
.shop-cat-count { margin-left: auto; margin-right: 4px; min-width: 26px; height: 24px; padding: 0 8px; border-radius: var(--pill); display: grid; place-items: center; background: var(--mint-100); color: var(--mint-700); font-family: var(--font-body); font-size: 12.5px; font-weight: 800; }
.shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shop-item {
  display: flex; align-items: center; gap: 2px; padding-right: 4px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm);
  transition: background .25s, border-color .25s, opacity .25s;
}
.shop-check {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px;
  border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 18px;
}
.shop-check:focus-visible { outline: 2px solid var(--mint-500); outline-offset: -2px; }
.shop-emoji { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--cream-2); transition: background .25s; }
.shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-name { font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.shop-name b { color: var(--mint-700); font-weight: 800; }
.shop-src { font-size: 12px; color: var(--ink-soft); }
.shop-tick {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--mint-200); color: transparent; font-size: 14px; font-weight: 900; transition: all .25s;
}
.shop-item.is-checked { background: var(--mint-100); border-color: var(--mint-300); }
.shop-item.is-checked .shop-emoji { background: rgba(255,255,255,.7); }
.shop-item.is-checked .shop-name { color: var(--mint-900); text-decoration: line-through; text-decoration-color: rgba(42,84,70,.45); }
.shop-item.is-checked .shop-tick { background: var(--mint-700); border-color: var(--mint-700); color: #fff; transform: scale(1.05); }
.shop-move { position: relative; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); font-size: 14px; cursor: pointer; }
.shop-move:hover { background: var(--cream-2); color: var(--ink); }
.shop-move select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.shop-del { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 13px; }
.shop-del:hover { background: var(--peach-soft); color: #a45c3b; }
.shop-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.shop-actions .btn:disabled { opacity: .45; cursor: default; }
#shop-clear-all.armed { background: var(--terracotta); color: #fff; }

/* Suche, Vorschläge & Mengen-Panel */
.shop-adder { position: relative; z-index: 5; }
.shop-add-icon { padding-left: 10px; font-size: 16px; }
.shop-suggest {
  list-style: none; margin: 0; padding: 6px; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--paper); border: 1px solid var(--mint-100); border-radius: 20px; box-shadow: var(--shadow-md); max-height: 60vh; overflow-y: auto;
}
.sugg { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; cursor: pointer; }
.sugg:hover, .sugg.is-active { background: var(--mint-50); }
.sugg-emoji { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; background: var(--cream-2); font-size: 18px; }
.sugg-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.sugg-cat { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.sugg-star { font-size: 12px; }
.sugg-free .sugg-name, .sugg-new .sugg-name { font-weight: 600; color: var(--mint-700); }
.sugg-new { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 12px; }

.qty-panel {
  margin-top: 10px; padding: 16px; border-radius: var(--radius); background: var(--paper);
  border: 1px solid var(--mint-200); box-shadow: var(--shadow-md); animation: fadeUp .2s ease;
  display: flex; flex-direction: column; gap: 14px;
}
.qty-head { display: flex; align-items: center; gap: 12px; }
.qty-emoji { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 16px; display: grid; place-items: center; font-size: 32px; background: var(--mint-50); }
.qty-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.qty-title strong { font-size: 18px; overflow-wrap: anywhere; }
.qty-title select { width: auto; padding: 4px 10px; border-radius: var(--pill); font-size: 13px; font-weight: 700; background: var(--mint-50); border-color: var(--mint-100); color: var(--mint-900); }
.qty-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qty-stepper { padding: 5px; border-radius: var(--pill); background: var(--mint-50); border: 1px solid var(--mint-100); }
.qty-stepper button { width: 42px; height: 42px; font-size: 22px; }
.qty-stepper input { width: 84px; text-align: center; font-weight: 800; font-size: 18px; border: 0; background: transparent; padding: 6px; box-shadow: none; }
.qty-row > select { width: auto; flex: 1; min-width: 110px; padding: 12px 14px; border-radius: var(--pill); font-weight: 700; }
.qty-actions { display: flex; gap: 10px; justify-content: flex-end; }
.qty-actions .btn-primary { flex: 1; max-width: 240px; }

/* Eigene Zutaten */
.modal-sm { width: min(560px, calc(100% - 24px)); }
.custom-body { padding: 6px 24px 24px; }
.custom-form { display: flex; flex-direction: column; gap: 12px; }
.custom-form h3 { margin: 0; }
.custom-top { display: flex; gap: 12px; align-items: flex-end; }
.custom-emoji-preview input {
  width: 64px; height: 64px; padding: 0; text-align: center; font-size: 34px; border-radius: 18px;
  background: var(--mint-50); border: 2px dashed var(--mint-300);
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; max-height: 176px; overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--cream-2); }
.emoji-pick { height: 40px; border: 0; border-radius: 12px; background: transparent; font-size: 22px; cursor: pointer; }
.emoji-pick:hover { background: #fff; }
.emoji-pick.is-on { background: #fff; box-shadow: inset 0 0 0 2px var(--mint-500); }
.custom-row { grid-template-columns: 1.3fr 1fr 1fr; }
.custom-actions { display: flex; justify-content: flex-end; gap: 10px; }
.custom-list-title { margin: 22px 0 10px 4px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--mint-900); }
.custom-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.custom-item { display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.custom-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.custom-info small { color: var(--ink-soft); font-size: 12.5px; }
.custom-item .shop-move { border: 0; background: transparent; }
.custom-empty { padding: 14px; text-align: center; font-size: 14px; }
.shop-hint .link-btn { font-size: 12.5px; color: var(--mint-700); }

/* ================= Kalender ================= */
.week { display: flex; flex-direction: column; gap: 16px; }

/* Kalender-Raster */
.cal { padding: 14px 12px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cal-weekdays, .cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekdays span { text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.cal-weekdays .is-weekend { color: var(--terracotta); }
.cal-kw { margin: 12px 2px 6px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; }
.cal-kw:first-of-type { margin-top: 8px; }
.cal-cell {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; min-height: 92px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.cal-cell:hover { border-color: var(--mint-300); }
.cal-cell:focus-visible { outline: 2px solid var(--mint-500); outline-offset: 2px; }
.cal-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--pill); display: grid; place-items: center; font-weight: 800; font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-meals { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-meal { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 5px; border-radius: 8px; background: var(--mint-50); font-size: 12px; font-weight: 700; color: var(--mint-900); }
.cal-meal-emoji { flex: 0 0 auto; font-size: 13px; }
.cal-meal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: 11px; font-weight: 800; color: var(--ink-soft); padding-left: 4px; }
.cal-cell.is-past { background: #f1efea; border-color: transparent; }
.cal-cell.is-past .cal-num { color: #a29d94; }
.cal-cell.is-past .cal-meal { background: #e6e3dc; color: #8f897f; filter: grayscale(.7); }
.cal-cell.is-today { border-color: var(--mint-500); box-shadow: 0 0 0 2px rgba(111,180,152,.25); }
.cal-cell.is-today .cal-num { background: var(--mint-700); color: #fff; }
.cal-cell.is-selected { background: var(--mint-50); border-color: var(--mint-500); box-shadow: inset 0 0 0 1px var(--mint-500); }
.today-card { background: linear-gradient(135deg, #fff, var(--mint-50)); }
.today-card .day-head strong { font-size: 24px; }
.day-panel.is-past { background: #f6f4ef; }
.day-none { margin: 0; font-size: 14px; }
.cal-hint { margin: -6px 0 0; text-align: center; font-size: 13px; }
.pick-h { margin: 4px 2px 8px; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--mint-900); }
.pick-add { display: flex; flex-direction: column; gap: 10px; }
.pick-add .pick-h { margin-bottom: 0; }
#plan-pick-planned:empty { display: none; }
.day { padding: 14px 14px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.day.is-today { border-color: var(--mint-300); box-shadow: 0 0 0 3px rgba(166,212,191,.25), var(--shadow-sm); }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.day-head strong { font-family: var(--font-display); font-weight: 600; font-size: 20px; color: var(--mint-900); }
.day.is-today .day-head strong::after { content: " ☀️"; font-size: 16px; }
.day-head span { font-size: 13px; color: var(--ink-soft); }
.day-meals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.day-meals:empty { display: none; }
.meal, .pick-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 12px 6px 6px; text-align: left; cursor: pointer;
  background: var(--mint-50); border: 1px solid var(--mint-100); border-radius: 16px; transition: background .2s, transform .15s;
}
.meal:hover, .pick-item:hover { background: var(--mint-100); }
.meal:active, .pick-item:active { transform: scale(.99); }
.plan-thumb { position: relative; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; font-size: 24px; }
.plan-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.plan-thumb.big { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; }
.meal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.meal-title { font-weight: 800; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere; }
.meal-sub { font-size: 12.5px; color: var(--ink-soft); }
.day-add {
  width: 100%; margin-top: 8px; padding: 9px; border-radius: 14px; border: 1.5px dashed var(--mint-300);
  background: transparent; color: var(--mint-700); font-weight: 800; font-size: 14px; cursor: pointer; transition: background .2s;
}
.day-add:hover { background: var(--mint-50); }
.pick-body { padding: 4px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.pick-sub { margin: 0; }
.pick-list, .day-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pick-item { background: var(--paper); border-color: var(--line); }
.pick-plus { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-100); color: var(--mint-700); font-weight: 800; }
.pick-empty { padding: 18px; text-align: center; }
.day-pick-btn {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "main sub" "meals meals"; gap: 2px 10px; align-items: baseline;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; transition: background .2s;
}
.day-pick-btn:hover { background: var(--mint-50); border-color: var(--mint-200); }
.dp-main { grid-area: main; font-weight: 800; font-size: 16px; }
.dp-sub { grid-area: sub; font-size: 13px; color: var(--ink-soft); }
.dp-meals { grid-area: meals; font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.day-pick-btn.has-it { background: var(--mint-50); }
.day-pick-btn.has-it .dp-meals { color: var(--mint-700); font-weight: 700; }
.meal-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.meal-head h2 { font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.meal-date { margin: 0; font-size: 13px; font-weight: 700; color: var(--mint-700); }
.to-recipe { align-self: flex-start; }
.meal-manage { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meal-manage .field { flex: 1; min-width: 160px; }
.meal-remove.armed { background: var(--terracotta); color: #fff; }
.plan-btn { margin: -8px 0 18px; }

/* ================= Reste ================= */
.rest-box { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rest-box .shop-add { margin: 0; box-shadow: none; background: var(--cream); }
.rest-sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rest-sub-head h3, .rest-quick summary { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--mint-900); }
.rest-quick summary { cursor: pointer; list-style: none; margin-bottom: 8px; }
.rest-quick summary::-webkit-details-marker { display: none; }
.rest-quick summary::before { content: "▸ "; color: var(--mint-500); }
.rest-quick[open] summary::before { content: "▾ "; }
.rest-quick summary .muted { font-family: var(--font-body); font-size: 13px; font-weight: 500; }
.rest-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.rest-have .rest-chips { max-height: none; }
.rchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: var(--pill);
  border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; transition: all .15s;
}
.rchip span { font-size: 16px; }
.rchip:hover { border-color: var(--mint-300); background: var(--mint-50); }
.rchip.is-on { background: var(--mint-100); border-color: var(--mint-500); color: var(--mint-900); }
.rchip.is-on i { font-style: normal; font-size: 11px; color: var(--mint-700); margin-left: 2px; }
.rest-none { margin: 4px 2px; font-size: 13.5px; }
.rest-staples { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.rest-staples input { width: 18px; height: 18px; accent-color: var(--mint-700); }

.rest-group { margin-bottom: 20px; }
.rest-group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 4px; font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--mint-900); }
.rest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rest-card {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 14px 8px 8px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.rest-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.g-all .rest-card { border-color: var(--mint-300); background: linear-gradient(135deg, #fff, var(--mint-50)); }
.rest-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rest-info .bar-title { white-space: normal; }
.rest-progress { height: 6px; border-radius: 6px; background: var(--cream-2); overflow: hidden; }
.rest-progress span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--mint-300), var(--mint-700)); }
.g-some .rest-progress span { background: linear-gradient(90deg, var(--honey), var(--peach)); }
.rest-stat { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.rest-missing { font-size: 13px; color: #b5452a; }
.rest-missing b { font-weight: 800; }
.rest-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rest-ings li { align-items: center; }
.rest-mark { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; }
.rest-ings .is-have .rest-mark { background: var(--mint-100); color: var(--mint-700); }
.rest-ings .is-missing .rest-mark { background: #fbe0d6; color: #b5452a; }
.rest-ings .is-missing .ing-name, .rest-ings .is-missing .ing-amt { color: #b5452a; }
.rest-ings .is-missing small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; background: #fbe0d6; }
.rest-ings .ing-amt { min-width: 64px; }
.rest-buy { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* Links */
.link-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 38px; gap: 8px; align-items: start; }
.link-num { width: 30px; height: 30px; margin-top: 8px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-100); font-size: 14px; }
.link-fields { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rows .link-fields .l-title { font-size: 14px; padding: 8px 12px; }
.link-row .row-del { margin-top: 4px; }
.links-card { margin-top: 18px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--mint-50); border: 1px solid var(--mint-100); transition: background .2s, transform .15s;
}
.link-item:hover { background: var(--mint-100); }
.link-item:active { transform: scale(.99); }
.link-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; display: grid; place-items: center; background: #fff; font-size: 17px; }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.link-text strong { font-size: 15px; overflow-wrap: anywhere; }
.link-text small { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-go { font-size: 18px; color: var(--mint-700); font-weight: 800; }

/* Warenkorb-Knopf in der Rezeptansicht */
.ing-list li { align-items: center; }
.ing-name { flex: 1; min-width: 0; }
.ing-cart {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 15px; cursor: pointer; filter: grayscale(1); opacity: .55; transition: all .2s;
}
.ing-cart:hover { opacity: .9; filter: none; }
.ing-cart.is-on { filter: none; opacity: 1; background: var(--mint-100); border-color: var(--mint-500); box-shadow: inset 0 0 0 1px var(--mint-500); }
.ing-list li.done .ing-cart { text-decoration: none; }
.add-all-btn { width: 100%; margin-top: 12px; }

.site-footer { text-align: center; padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); font-size: 11.5px; color: var(--ink-soft); opacity: .7; }

/* ================= Toast ================= */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: var(--pill); background: var(--mint-900); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-md); pointer-events: none; transition: all .3s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= Mobil ================= */
@media (max-width: 680px) {
  .site-header { padding-top: 24px; }
  .tabs { margin: 14px 16px 20px; max-width: none; width: auto; }
  .tab { padding: 9px 14px; font-size: 14px; }
  .panel-head h2 { font-size: 26px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-body { padding: 0 18px 24px; }
  .hero { height: 210px; }
  .editor .section { margin: 12px 14px; padding: 16px; }
  .modal-top { padding: 18px 16px 4px; }
  .modal-actions { padding: 14px 16px; }
  .title-grid { grid-template-columns: 1fr; }
  .image-drop { aspect-ratio: 16 / 9; }
  .idea-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-row { flex-wrap: nowrap; }
  .filter-row .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
  .filter-row .chips::-webkit-scrollbar { display: none; }
  .filter-row .chip, .filter-btn { flex: 0 0 auto; white-space: nowrap; }
  .idea-title { font-size: 14.5px; }
  .idea-sub { display: none; }
  .search-go { padding: 7px 12px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:first-child { grid-column: 1 / -1; }
  .ing-head { display: none; }
  .editor legend small { flex-basis: 100%; padding-left: 38px; }
  /* Zutat als kleine Karte: oben Menge + Einheit, darunter der Name in voller Breite */
  .ing-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 34px;
    grid-template-areas: "name name name" "amt unit del" "sugg sugg sugg";
    gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--mint-50); border: 1px solid var(--mint-100);
  }
  .i-step button { width: 36px; flex-basis: 36px; height: 38px; }
  .rows { gap: 10px; }
  .text-row { grid-template-columns: 26px minmax(0, 1fr) 34px; gap: 6px; }
  .text-row .num { width: 26px; height: 26px; font-size: 12px; }
  .row-del { width: 34px; height: 34px; }
  /* iOS zoomt bei Schrift < 16px automatisch hinein */
  input, select, textarea, .search input { font-size: 16px; }
  .editor .section { margin: 10px 10px; padding: 14px; }
  /* Vollbild-Dialog, der die Safari-Leisten berücksichtigt */
  .modal { width: 100%; max-width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .modal-inner { height: 100%; max-height: 100%; }
  .modal-top { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .modal-actions { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .modal-actions .btn { flex: 1; }
  .logout-btn { top: 10px; padding: 3px 9px; font-size: 11px; font-weight: 700; }
  .qty-actions .btn { flex: 1; }
  .qty-actions .btn-primary { max-width: none; }
  .custom-body { padding: 4px 14px 24px; }
  .pick-body { padding: 4px 14px 24px; }
  .rest-box { padding: 12px; }
  .rest-chips { max-height: 210px; }
  .rest-actions .btn { flex: 1; }
  /* Kalender auf dem Handy: kompakte Zellen, Mahlzeiten nur als Emoji */
  .cal { padding: 12px 8px 10px; }
  .cal-weekdays, .cal-row { gap: 4px; }
  .cal-weekdays span { font-size: 11px; }
  .cal-cell { min-height: 62px; padding: 4px 3px; border-radius: 12px; align-items: center; gap: 3px; }
  .cal-num { align-self: center; min-width: 24px; height: 24px; padding: 0 4px; font-size: 12.5px; }
  .cal-meals { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 1px; }
  .cal-meal { padding: 0; background: transparent; }
  .cal-meal-emoji { font-size: 15px; }
  .cal-meal-title { display: none; }
  .cal-more { padding: 0; font-size: 10px; align-self: center; }
  .cal-cell.is-past .cal-meal { background: transparent; }
  .custom-row { grid-template-columns: 1fr 1fr; }
  .custom-row .field:first-child { grid-column: 1 / -1; }
  .hero-actions { top: calc(14px + env(safe-area-inset-top, 0px)); }
}
