:root {
  --bg: #fff7fa;
  --card: #ffffff;
  --text: #2b2027;
  --muted: #8a7480;
  --line: #f6dce7;
  --accent: #e2457f;
  --accent-text: #ffffff;
  --accent-soft: #fde8f0;
  --grid-line: #ef9bbb;
  --danger: #c62845;
  --warn-bg: #fff3d6;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(226, 69, 127, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .85rem; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 16px; padding-top: max(.7rem, env(safe-area-inset-top));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); color: var(--accent);
}
.topbar a { color: inherit; text-decoration: none; }
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; }
.navlink { font-weight: 600; white-space: nowrap; }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 1em;
  background: var(--accent); color: var(--accent-text); font-size: .8rem; text-align: center;
}

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}

/* Formulare und Buttons */
input, textarea, select, button { font: inherit; color: inherit; }
input[type=text], input[type=url], input[type=search], input[type=number], input[type=password], textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem .95rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer; text-decoration: none; color: var(--text);
  font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 3px 10px rgba(226, 69, 127, .25); }
.btn.danger { color: var(--danger); }
.btn.small { padding: .35rem .6rem; font-size: .9rem; }
.btn[aria-disabled=true] { opacity: .45; pointer-events: none; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.import-row { display: flex; gap: .5rem; }
.import-row input { flex: 1; min-width: 0; }
details summary { cursor: pointer; color: var(--muted); margin: .75rem 0 .5rem; }
.hint { font-size: .9rem; color: var(--muted); margin: .75rem 0 0; }
.hint.warn { background: var(--warn-bg); color: var(--text); padding: .5rem .75rem; border-radius: 8px; }
label.field { display: block; margin-bottom: .9rem; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 .75rem; }

/* Filter */
.filters { margin-bottom: 12px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .3rem .75rem; cursor: pointer; font-size: .9rem;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chips.sub .chip { font-size: .85rem; }
.tag {
  display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; margin: 0 .25rem .25rem 0;
}

/* Kategorie-Leiste */
.catbar {
  display: flex; gap: .55rem; margin: .8rem -16px 0; padding: .2rem 16px .5rem;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 16px; align-items: center; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.catbar::-webkit-scrollbar { display: none; }
.cat {
  flex: none; scroll-snap-align: start; position: relative;
  display: grid; justify-items: center; align-content: center; gap: .15rem;
  min-width: 5.6rem; height: 4.9rem; padding: .5rem .7rem .45rem; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer;
  transition: background .2s, color .2s, transform .15s, box-shadow .2s;
  animation: cat-in .25s ease both;
}
.cat:active { transform: scale(.96); }
.cat-icon { font-size: 1.55rem; line-height: 1; }
.cat-name { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.cat-count {
  position: absolute; top: .3rem; right: .4rem; font-size: .68rem; font-weight: 700;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.cat.main.on {
  background: linear-gradient(135deg, #f0629a, var(--accent)); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px rgba(226, 69, 127, .3);
}
.cat.main.on .cat-count { color: rgba(255, 255, 255, .85); }
.cat.sub { background: var(--accent-soft); border-color: transparent; box-shadow: none; min-width: 5rem; height: 4.3rem; }
.cat.sub .cat-icon { font-size: 1.3rem; }
.cat.sub.on { background: #fff; border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.cat.empty .cat-icon, .cat.empty .cat-name { opacity: .45; }
.cat-back {
  flex: none; align-self: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; scroll-snap-align: start;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 1rem; cursor: pointer; animation: cat-in .25s ease both;
}
.catbar.focused .cat.sub:nth-child(3) { animation-delay: .03s; }
.catbar.focused .cat.sub:nth-child(4) { animation-delay: .06s; }
.catbar.focused .cat.sub:nth-child(5) { animation-delay: .09s; }
.catbar.focused .cat.sub:nth-child(n+6) { animation-delay: .12s; }
@keyframes cat-in { from { opacity: 0; transform: translateY(4px) scale(.97); } to { opacity: 1; transform: none; } }
@media (min-width: 760px) { .catbar { flex-wrap: wrap; overflow: visible; } }

/* Rezeptkarten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rcard {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.rcard:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(226, 69, 127, .15); }
.thumb {
  position: relative; overflow: hidden; aspect-ratio: 16 / 10; flex: none;
  background: var(--accent-soft); display: grid; place-items: center; font-size: 2.5rem;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rbody { padding: .7rem .8rem .8rem; }
.rbody h3 { margin-bottom: .35rem; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }

/* Rezeptansicht */
.rhead { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 760px) { .rhead.has-img { grid-template-columns: 320px 1fr; } }
.hero { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 320px; object-fit: cover; border-radius: var(--radius); display: block; }
.desc { margin: .25rem 0 .6rem; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .6rem 0; }
.fact { font-weight: 600; }
.portions { display: inline-flex; align-items: center; gap: .35rem; }
.portions input { width: 4.2rem; text-align: center; padding: .4rem; }
.portions button {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-size: 1.15rem; line-height: 1;
}
.source { display: inline-block; margin-top: .2rem; word-break: break-all; }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 16px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: .6rem .95rem; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--accent-text); }

.textview { display: grid; gap: 16px; }
@media (min-width: 760px) { .textview { grid-template-columns: minmax(240px, 1fr) 2fr; align-items: start; } }
.ings { list-style: none; padding: 0; margin: 0; }
.ings li { padding: .35rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; }
.ings li:last-child { border-bottom: 0; }
.ings .qty { min-width: 5.5rem; font-weight: 600; text-align: right; white-space: nowrap; }
.ings .note { color: var(--muted); }
.ings-group { font-weight: 700; margin: .8rem 0 .2rem; }
.steps { margin: 0; padding-left: 1.4rem; }
.steps li { margin-bottom: .7rem; padding-left: .2rem; }
.prep { background: var(--accent-soft); border-radius: 8px; padding: .5rem .75rem; margin-bottom: .8rem; }

/* Diagramm (Recipe Grid) */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.rgrid { border-collapse: collapse; min-width: 100%; font-size: .88rem; }
.rgrid td {
  border: 1.5px solid var(--grid-line); padding: .35rem .55rem; vertical-align: middle;
}
.rgrid td.ing { background: var(--card); min-width: 11rem; }
.rgrid td.ing .q { color: var(--muted); }
.rgrid td.step {
  background: var(--accent-soft); text-align: center; font-weight: 600; min-width: 6.5rem; cursor: help;
  vertical-align: top; padding-top: .5rem;
}
.rgrid td.head { text-align: left; font-style: italic; background: var(--card); }
.grid-help { font-size: .82rem; color: var(--muted); margin: .5rem 0 0; }

.notes textarea { min-height: 6rem; }
.print-only { display: none; }

/* Einkaufsliste */
.shop-recipes { list-style: none; padding: 0; margin: 0; }
.shop-recipes li { display: flex; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shop-recipes li:last-child { border-bottom: 0; }
.shop-recipes .title { flex: 1 1 12rem; font-weight: 600; }
.shop-recipes input { width: 4.2rem; padding: .35rem; text-align: center; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: .7rem; align-items: center; padding: .55rem 0; cursor: pointer; }
.checklist input { width: 1.25rem; height: 1.25rem; accent-color: var(--accent); flex: none; }
.checklist .done { text-decoration: line-through; color: var(--muted); }
.checklist .q { font-weight: 600; min-width: 5rem; }

/* Vorschläge */
.navlink + .navlink { margin-left: 1rem; }
.suggest-strip { margin-bottom: 12px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.strip-head h2 { margin: 0; font-size: 1.05rem; }
.strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; scroll-padding-inline: 16px; }
.strip::-webkit-scrollbar { display: none; }
.scard {
  position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; scroll-snap-align: start;
}
.scard.small { flex: none; width: 9.5rem; }
.scard.small .rbody { padding: .45rem .55rem .55rem; }
.scard.small h3 { font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scard .thumb { aspect-ratio: 1 / 1; }
.scard:not(.small) .thumb { aspect-ratio: 4 / 3; }
.scard .tag { margin-top: .3rem; }
.sadd {
  position: absolute; top: .45rem; right: .45rem; z-index: 2; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  border: 0; display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; text-decoration: none; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--accent); box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
  transition: transform .15s;
}
.sadd:active { transform: scale(.9); }
.sadd.done { background: var(--accent); color: #fff; font-size: 1.05rem; }
.sadd.loading { color: transparent; }
.sadd.loading::after {
  content: ""; position: absolute; inset: .55rem; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.skeleton .thumb, .skeleton h3 { background: linear-gradient(90deg, var(--accent-soft), #fff, var(--accent-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.cards.discover { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 6px; }
.page-head h1 { margin-bottom: 0; }
.page-head p { margin: .1rem 0 0; }
.sheet-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; display: block; margin-bottom: .7rem; }
.sheet-actions { margin: .6rem 0 .8rem; }
.sheet-actions .btn { width: 100%; }
.sheet-sub { font-size: .95rem; margin: .4rem 0 .3rem; }
.sheet-list { margin: 0 0 .6rem; padding-left: 1.2rem; columns: 2; column-gap: 1.2rem; font-size: .9rem; }
.sheet-loading { padding: 2rem; }
@media (max-width: 640px) {
  .strip { margin: 0 -10px; padding: 2px 10px 8px; scroll-padding-inline: 10px; }
  .cards.discover { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cards.discover h3 { font-size: .85rem; line-height: 1.25; }
  .cards.discover .rbody { padding: .45rem .55rem .55rem; }
  .sheet-list { columns: 1; }
}

/* Eigene Fotos */
.hero-add {
  width: 100%; aspect-ratio: 16 / 9; max-height: 220px; border-radius: var(--radius); border: 2px dashed var(--grid-line);
  background: var(--accent-soft); color: var(--accent); font-size: 2rem; cursor: pointer;
  display: grid; place-content: center; gap: .2rem;
}
.hero-add span { font-size: .9rem; font-weight: 700; }
.photo-edit { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; }
.photo-preview {
  width: 7.5rem; height: 5.6rem; border-radius: 12px; overflow: hidden; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 2rem; flex: none;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Foto-Import */
.photo-row { margin-top: .6rem; }
.photo-btn { width: 100%; cursor: pointer; background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.photo-tray { margin-top: .75rem; }
.photo-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .5rem; }
.photo-thumb { position: relative; flex: none; width: 5.5rem; height: 7rem; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button {
  position: absolute; top: .25rem; right: .25rem; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; cursor: pointer;
}
.photo-add {
  flex: none; width: 5.5rem; height: 7rem; border-radius: 12px; border: 2px dashed var(--grid-line);
  background: var(--card); color: var(--accent); font-size: 1.6rem; cursor: pointer; display: grid; place-content: center; gap: .1rem;
}
.photo-add span { font-size: .72rem; font-weight: 700; }

/* Diagramm als Ablauf (Handy) */
.flow { list-style: none; margin: 0; padding: 0; position: relative; }
.flow::before { content: ""; position: absolute; left: 1rem; top: .5rem; bottom: .5rem; width: 2px; background: var(--grid-line); opacity: .5; }
.flow-step { position: relative; display: flex; gap: .75rem; padding-bottom: .8rem; cursor: pointer; }
.flow-dot {
  position: relative; z-index: 1; flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem;
  box-shadow: 0 0 0 4px var(--card);
}
.flow-step.fresh .flow-dot { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }
.flow-card {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: .6rem .75rem;
  transition: border-color .15s, transform .1s;
}
.flow-step:active .flow-card { transform: scale(.99); border-color: var(--accent); }
.flow-title { font-weight: 800; margin-bottom: .35rem; }
.flow-tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--muted); margin-bottom: .2rem; }
.flow-tag.merge { color: var(--accent); }
.flow-ings { display: flex; flex-wrap: wrap; gap: .3rem; }
.flow-ing { font-size: .82rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem; }
.flow-ing b { color: var(--accent); font-weight: 700; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 0; cursor: pointer; text-decoration: underline; }

/* Bottom Sheet */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(43, 32, 39, 0); display: flex; align-items: flex-end; justify-content: center;
  transition: background .2s;
}
.sheet-backdrop.open { background: rgba(43, 32, 39, .45); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 80vh; overflow-y: auto;
  background: var(--card); border-radius: 22px 22px 0 0; padding: .6rem 18px calc(1.2rem + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
@media (min-width: 641px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-grip { width: 2.5rem; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto .8rem; }
.sheet-close {
  position: absolute; top: .7rem; right: .8rem; width: 2rem; height: 2rem; border-radius: 50%;
  border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer;
}
.sheet-step + .sheet-step { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .8rem; }
.sheet-kicker { color: var(--accent); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.sheet h2 { margin: .15rem 2rem .4rem 0; }
.sheet p { margin: 0 0 .6rem; }
.sheet-ings { list-style: none; padding: 0; margin: 0; }
.sheet-ings li { display: flex; gap: .6rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.sheet-ings .qty { min-width: 4.5rem; text-align: right; font-weight: 700; white-space: nowrap; }
.sheet-ings .note { color: var(--muted); }

/* Untere Navigation (nur Handy) */
.bottomnav { display: none; }
@media (max-width: 640px) {
  .topbar nav { display: none; }
  main { padding: 10px 10px calc(4.2rem + env(safe-area-inset-bottom)); }
  .topbar { position: static; padding: .45rem 12px; padding-top: max(.45rem, env(safe-area-inset-top)); }
  .brand { font-size: 1.05rem; }
  .card { padding: 12px; margin-bottom: 10px; border-radius: 14px; }
  h1 { font-size: 1.25rem; }
  .filters { margin-bottom: 8px; }
  .catbar { margin: .5rem -10px 0; padding: .15rem 10px .35rem; scroll-padding-inline: 10px; }
  .cards { gap: 10px; }
  .toolbar { gap: .35rem; margin-bottom: 10px; }
  .toolbar .btn, .seg button { padding: .5rem .6rem; }
  .hero { aspect-ratio: 16 / 9; max-height: 190px; border-radius: 14px; }
  .rhead { gap: 10px; margin-bottom: 10px; }
  .cat { height: 4.1rem; min-width: 4.9rem; padding: .35rem .55rem .3rem; border-radius: 15px; }
  .cat.sub { height: 3.7rem; min-width: 4.5rem; }
  .cat-icon { font-size: 1.3rem; }
  .cat-name { font-size: .8rem; }
  .bottomnav {
    position: fixed; z-index: 40; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(3, 1fr); width: min(360px, calc(100% - 20px)); padding: 3px;
    background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 10px 30px rgba(226, 69, 127, .18);
  }
  .bottomnav[hidden] { display: none; }
  .bn-pill {
    position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 999px;
    background: linear-gradient(135deg, #f0629a, var(--accent)); box-shadow: 0 4px 14px rgba(226, 69, 127, .35);
    transition: transform .3s cubic-bezier(.3, 1.3, .5, 1);
  }
  .bottomnav[data-active="discover"] .bn-pill { transform: translateX(100%); }
  .bottomnav[data-active="shop"] .bn-pill { transform: translateX(200%); }
  .bottomnav a {
    position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .45rem .4rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .85rem;
    transition: color .25s;
  }
  .bottomnav[data-active="home"] a[data-tab="home"], .bottomnav[data-active="shop"] a[data-tab="shop"],
  .bottomnav[data-active="discover"] a[data-tab="discover"] { color: #fff; }
  .bottomnav a { flex-direction: column; gap: 0; font-size: .72rem; padding: .3rem .2rem; line-height: 1.15; }
  .bottomnav .badge { position: absolute; top: 1px; right: 18%; font-size: .65rem; }
  .bottomnav .badge { background: var(--accent); color: #fff; }
  .bottomnav[data-active="shop"] a[data-tab="shop"] .badge { background: #fff; color: var(--accent); }
  .toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .bn-icon { font-size: 1rem; }
}

/* Overlay und Meldungen */
.busy { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.busy-box { background: var(--card); border-radius: var(--radius); padding: 1.5rem; max-width: 22rem; text-align: center; }
.spinner {
  width: 2.5rem; height: 2.5rem; margin: 0 auto .8rem; border-radius: 50%;
  border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 10px; max-width: calc(100% - 32px);
}
.toast.error { background: var(--danger); color: #fff; }
.login-screen { min-height: calc(100dvh - 7rem); display: grid; place-items: center; padding: 1rem 0; }
.login-card {
  width: min(26rem, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 2rem 1.4rem 1.6rem; box-shadow: 0 10px 40px rgba(226, 69, 127, .15); text-align: center;
}
.login-logo { width: 5.5rem; height: 5.5rem; border-radius: 24px; display: block; margin: 0 auto .9rem; box-shadow: 0 8px 22px rgba(226, 69, 127, .3); }
.login-card h1 { font-size: 1.9rem; margin: 0; }
.login-card > .muted { margin: .2rem 0 1.4rem; }
.login-label { display: block; text-align: left; font-weight: 700; margin-bottom: .35rem; }
.pw-wrap { position: relative; }
.pw-wrap input { font-size: 1.2rem; padding: .95rem 3.2rem .95rem 1rem; border-radius: 14px; }
.pw-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 2.7rem; height: 2.7rem;
  border: 0; border-radius: 10px; background: var(--accent-soft); font-size: 1.15rem; cursor: pointer;
}
.login-btn { width: 100%; margin-top: 1.1rem; padding: 1rem; font-size: 1.15rem; border-radius: 14px; }
.login-err { color: var(--danger); font-weight: 600; margin: .7rem 0 0; text-align: left; }

@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  .import-row { flex-direction: column; }
  .toolbar .btn, .toolbar .seg { flex: 1 1 auto; }
  .ings .qty { min-width: 4.5rem; }
  table.rgrid { font-size: .8rem; }
  .rgrid td { padding: .3rem .4rem; }
  .rgrid td.ing { min-width: 8.5rem; }
  .rgrid td.step { min-width: 5rem; }
  .portions button { width: 2.6rem; height: 2.6rem; }
}

/* PDF-Download (eigenes Layout, nur Tabellen und Blöcke) */
.pdf-doc { width: 700px; background: #fff; color: #2b2027; font: 13px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pdf-doc table { border-collapse: collapse; width: 100%; }
.pdf-doc td { vertical-align: top; }
.pdf-bar { height: 6px; border-radius: 3px; background: #e2457f; margin-bottom: 18px; }
.pdf-head { margin-bottom: 18px; }
.pdf-imgcell { width: 220px; padding-right: 18px; }
.pdf-img { width: 220px; height: 160px; border-radius: 14px; background-size: cover; background-position: center; }
.pdf-kicker { color: #e2457f; font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.pdf-title { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-bottom: 8px; }
.pdf-desc { color: #8a7480; margin-bottom: 12px; }
.pdf-fact { display: inline-block; background: #fde8f0; color: #b8285e; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; margin: 0 6px 6px 0; }
.pdf-h2 { font-size: 15px; font-weight: 800; color: #e2457f; margin: 4px 0 8px; padding-bottom: 4px; border-bottom: 2px solid #fde8f0; }
.pdf-cols td.pdf-col-ings { width: 36%; padding-right: 22px; }
.pdf-ings td { padding: 4px 0; border-bottom: 1px solid #f6dce7; }
.pdf-qty { width: 100px; padding-right: 10px !important; font-weight: 700; text-align: right; white-space: nowrap; }
.pdf-note { color: #8a7480; }
.pdf-group { font-weight: 800; padding-top: 10px !important; border-bottom: 0 !important; }
.pdf-step { margin-bottom: 10px; }
.pdf-num { width: 32px; }
.pdf-badge { width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: #e2457f; color: #fff; font-weight: 800; font-size: 11px; text-align: center; }
.pdf-prep { background: #fde8f0; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.pdf-notes { margin-top: 16px; padding: 10px 12px; border: 1px solid #f6dce7; border-radius: 10px; white-space: pre-wrap; }
.pdf-notes .pdf-h2 { border: 0; margin-top: 0; white-space: normal; }
.pdf-source { margin-top: 14px; color: #8a7480; font-size: 11px; word-break: break-all; }
.pdf-doc .rgrid { width: 100%; font-size: 11.5px; }
.pdf-doc .rgrid.fit { table-layout: fixed; width: 100%; }
.pdf-doc .rgrid.fit td { overflow-wrap: break-word; }
.pdf-doc .rgrid td.ing, .pdf-doc .rgrid td.step { min-width: 0; }
.pdf-doc .rgrid td { border: 1.5px solid #ef9bbb; padding: 4px 7px; vertical-align: middle; }
.pdf-doc .rgrid td.ing { background: #fff; }
.pdf-doc .rgrid td.ing .q { color: #8a7480; }
.pdf-doc .rgrid td.step { background: #fde8f0; text-align: center; font-weight: 700; vertical-align: top; padding-top: 6px; }

/* PDF / Drucken */
@media print {
  @page { margin: 12mm; }
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --accent-soft: #e9f5ec; --grid-line: #3c8a5c; }
  body { font-size: 11pt; }
  .no-print, .topbar, .toolbar, .portions button, .notes textarea, .notes small, .toast, .busy { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; }
  .hero { max-height: 6cm; width: auto; }
  .rhead.has-img { grid-template-columns: 6cm 1fr; }
  .portions input { border: 0; width: auto; padding: 0; }
  .grid-wrap { overflow: visible; }
  table.rgrid { font-size: 8.5pt; }
  .rgrid td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .textview { grid-template-columns: 1fr 2fr; }
  a.source::after { content: " – " attr(href); color: #444; font-size: 9pt; }
}
