:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --surface-2: #f3ece1;
  --text: #2b2420;
  --muted: #7a6d63;
  --line: #e6dccd;
  --accent: #b4532a;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3d7;
  --green: #5d7a3a;
  --green-soft: #e7eedc;
  --danger: #b3261e;
  --like: #c96a12;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916; --surface: #262220; --surface-2: #2f2a26; --text: #f1e9df; --muted: #a8998b;
    --line: #3d3631; --accent: #e07a4c; --accent-ink: #1c1916; --accent-soft: #3d2a20;
    --green: #9cbc75; --green-soft: #2c3324; --danger: #f2877e; --like: #f0a04b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1916; --surface: #262220; --surface-2: #2f2a26; --text: #f1e9df; --muted: #a8998b;
  --line: #3d3631; --accent: #e07a4c; --accent-ink: #1c1916; --accent-soft: #3d2a20;
  --green: #9cbc75; --green-soft: #2c3324; --danger: #f2877e; --like: #f0a04b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.container { max-width: 1120px; margin: 0 auto; padding: 24px 16px 80px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-right: auto; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface-2);
  font-size: .9rem; border: 0; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  color: #fff; background: hsl(var(--h, 20) 45% 48%); flex: none; }
@media (max-width: 640px) {
  .brand span { display: none; }
  .who .who-name, .btn .lbl-wide { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  text-decoration: none; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .875rem; border-radius: 8px; }
.btn.icon { padding: 8px; min-width: 40px; }
.btn.like.on { color: var(--like); border-color: color-mix(in srgb, var(--like) 40%, var(--line)); background: color-mix(in srgb, var(--like) 8%, var(--surface)); }
.btn.like.on .ic { fill: color-mix(in srgb, currentColor 18%, transparent); }

/* Liste */
.list-head { display: grid; gap: 14px; margin-bottom: 22px; }
.list-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-title h1 { margin: 0; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 13px 14px 13px 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: 1.05rem; box-shadow: var(--shadow); }
.search input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 1px; border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { opacity: .6; margin-left: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(60,40,20,.08), 0 10px 28px rgba(60,40,20,.1); }
.card-img { aspect-ratio: 16 / 10; background: var(--surface-2); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3.2rem;
  background: radial-gradient(circle at 30% 20%, hsl(var(--h) 60% 88%), hsl(var(--h) 45% 74%)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .placeholder { background: radial-gradient(circle at 30% 20%, hsl(var(--h) 30% 32%), hsl(var(--h) 30% 22%)); } }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); }
.card-img .badge { position: absolute; top: 10px; left: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.kicker { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.card h3 { font-size: 1.2rem; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 10px; display: flex; gap: 14px; align-items: center; font-size: .85rem; color: var(--muted); }
.card-meta > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.card-meta > span.by { display: block; min-width: 0; }
.card-meta .liked { color: var(--like); }
.card-meta .liked .ic { fill: color-mix(in srgb, currentColor 18%, transparent); }
.card-meta .by { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); max-width: 520px; margin: 0 auto; }
.empty-state img { margin: 0 auto 16px; }
.empty-state h1, .empty-state h2 { color: var(--text); }

/* Rezeptansicht */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.recipe { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.hero { aspect-ratio: 21 / 9; background: var(--surface-2); max-height: 440px; width: 100%; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .placeholder { font-size: 5rem; }
.recipe-head { padding: 24px clamp(16px, 4vw, 40px) 8px; }
.recipe-head .lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 14px; max-width: 70ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .95rem; margin-bottom: 12px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts strong { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .82rem; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.actions .spacer { flex: 1; }
.likers { font-size: .875rem; color: var(--muted); margin-top: -4px; padding-bottom: 8px; }

.recipe-body { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: clamp(20px, 4vw, 48px);
  padding: 20px clamp(16px, 4vw, 40px) 28px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .recipe-body { grid-template-columns: 1fr; } }
.ingredients { background: var(--surface-2); border-radius: var(--radius); padding: 18px; align-self: start; }
.servings { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; }
.servings .num { min-width: 7.5em; text-align: center; font-weight: 600; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list label { display: flex; gap: 10px; padding: 8px 0; cursor: pointer; align-items: baseline; }
.ing-list input { accent-color: var(--green); transform: translateY(2px); }
.ing-list .amt { font-weight: 700; min-width: 4.5em; white-space: nowrap; }
.ing-list input:checked ~ span { text-decoration: line-through; opacity: .5; }
.ing-group { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; padding: 14px 0 2px; border: 0 !important; }
.ing-group:first-child { padding-top: 0; }
.step-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step-list li { counter-increment: step; display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 10px 8px; margin: 0 -8px;
  border-radius: 10px; cursor: pointer; white-space: pre-line; }
.step-list li:hover { background: var(--surface-2); }
.step-list li::before { content: counter(step); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: var(--serif); }
.step-list li.done { opacity: .45; }
.step-list li.done::before { content: "✓"; background: var(--green-soft); color: var(--green); }
.tip { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--green-soft); border-left: 4px solid var(--green); white-space: pre-line; }
.tip strong { display: block; color: var(--green); margin-bottom: 2px; }

.panel { padding: 22px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); }
.panel h2 { display: flex; align-items: center; gap: 8px; }
.panel h2 .count { font-family: var(--sans); font-size: .9rem; color: var(--muted); font-weight: 500; }
.note { background: #fff7d6; color: #4a3d12; border-radius: 4px 12px 12px 12px; padding: 12px 14px; margin-bottom: 10px; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.08); white-space: pre-line; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .note { background: #3a3420; color: #f1e6bd; } }
:root[data-theme="dark"] .note { background: #3a3420; color: #f1e6bd; }
.note .meta, .comment .meta { font-size: .8rem; opacity: .7; margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: inherit; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .avatar { width: 36px; height: 36px; }
.comment .who-line { font-weight: 600; }
.comment .text { white-space: pre-line; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.inline-form textarea { flex: 1; min-height: 46px; resize: vertical; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
@media (max-width: 520px) { .inline-form { flex-direction: column; align-items: stretch; } }

/* Formular */
.editor { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-head h1 { margin: 0; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); box-shadow: var(--shadow); display: grid; gap: 16px; }
.card-box > h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.field textarea { resize: vertical; line-height: 1.5; }
.field.title input { font-family: var(--serif); font-size: 1.5rem; padding: 12px 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.photo { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; }
@media (max-width: 520px) { .photo { grid-template-columns: 1fr; } }
.photo-box { aspect-ratio: 4 / 3; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); display: grid; place-items: center;
  overflow: hidden; cursor: pointer; color: var(--muted); text-align: center; font-size: .9rem; }
.photo-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.preview { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .9rem; min-height: 44px; }
.preview .pv-row { display: flex; gap: 8px; padding: 3px 0; }
.preview .pv-amt { font-weight: 700; min-width: 5.5em; color: var(--accent); }
.preview .pv-group { font-weight: 700; padding-top: 6px; font-family: var(--serif); }
.preview ol { margin: 0; padding-left: 1.3em; }
.preview ol li { padding: 2px 0; }
.helper { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); flex-wrap: wrap; }
.helper p { margin: 0; flex: 1; min-width: 220px; }
details.more > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::before { content: "▸"; transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more[open] > summary { margin-bottom: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 12px 0;
  background: linear-gradient(transparent, var(--bg) 35%); }

/* Freigabe */
.vis-options { display: grid; gap: 8px; }
.vis-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.vis-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.vis-opt input { accent-color: var(--accent); margin-top: 4px; }
.vis-opt strong { display: flex; align-items: center; gap: 6px; }
.vis-opt small { color: var(--muted); }
.people-pick { display: grid; gap: 4px; padding: 6px 0 0 30px; }
.people-pick[hidden] { display: none; }
.people-pick label { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; }
.people-pick input { accent-color: var(--accent); width: 18px; height: 18px; }

/* Personen */
.people { display: grid; gap: 10px; }
.person { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; }
.person .avatar { width: 40px; height: 40px; }
.person .name { font-weight: 600; }
.person .sub { font-size: .85rem; color: var(--muted); }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.person select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
@media (max-width: 700px) {
  .person { grid-template-columns: 40px 1fr; }
  .person-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.role-card { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.role-card strong { display: block; margin-bottom: 2px; }
.add-person { display: grid; grid-template-columns: 1fr 180px auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .add-person { grid-template-columns: 1fr; } }

/* Dialog & Toast */
.dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dialog::backdrop { background: rgba(30, 20, 10, .45); backdrop-filter: blur(2px); }
.dialog-inner { padding: 22px; display: grid; gap: 14px; }
.dialog-inner h2 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.share-links { display: grid; gap: 8px; }
.share-link { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100vw - 32px); font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* Druck */
@media print {
  .topbar, .back, .actions, .likers, .inline-form, .comments, .no-print, .servings button { display: none !important; }
  body { background: #fff; color: #000; }
  .container { padding: 0; }
  .recipe { box-shadow: none; border: 0; }
  .hero { max-height: 240px; }
  .ing-list input { display: none; }
  .step-list li { break-inside: avoid; }
}
.share-link > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; }
.share-link > span:last-child { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* Kommentar-Antworten */
.thread { border-bottom: 1px solid var(--line); }
.thread .comment { border-bottom: 0; }
/* Jede Antwortebene rückt ein; die Linie zeigt, zu welchem Kommentar sie gehört */
.replies { margin-left: 17px; border-left: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line)); padding-left: 16px; }
.replies .replies { margin-left: 14px; }
.replies.flat { margin-left: 0; border-left: 0; padding-left: 0; }
.comment.reply { grid-template-columns: 30px 1fr; gap: 10px; padding: 8px 0; }
.comment.reply .avatar { width: 30px; height: 30px; font-size: .72rem; }
.comment .meta .linkbtn { display: inline-flex; align-items: center; gap: 4px; }
.reply-slot { margin-left: 48px; }
.replies .reply-slot { margin-left: 40px; }
.reply-slot:empty { display: none; }
.reply-form { margin: 0 0 14px; flex-wrap: wrap; }
.reply-form textarea { min-width: 200px; }
.reply-actions { display: flex; gap: 8px; }
.comment.flash { animation: flash 2s ease-out; border-radius: 10px; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (max-width: 520px) {
  .replies { margin-left: 8px; padding-left: 12px; }
  .replies .replies { margin-left: 6px; }
  .reply-slot, .replies .reply-slot { margin-left: 0; }
}

/* Toast mit Aktion */
.toast { display: flex; align-items: center; gap: 14px; }
.toast[hidden] { display: none; }
.toast-action { color: inherit; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 18%, transparent); text-decoration: none; white-space: nowrap; }

/* Live-Anzeige in der Navigation */
.live-link { position: relative; }
.live-link.is-live { color: #e0323c; }
.live-link.is-live::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: #e0323c; animation: pulse 1.6s infinite; }
.live-link.is-me { background: #e0323c; color: #fff; border-color: #e0323c; }
.live-link.is-me::after { background: #fff; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 50, 60, .55); } 70% { box-shadow: 0 0 0 9px rgba(224, 50, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 50, 60, 0); } }

/* Chat */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(0,0,0,.22); cursor: pointer; display: grid; place-items: center; }
.chat-fab[hidden] { display: none; }
.chat-fab .ic { width: 26px; height: 26px; }
.chat-fab:hover { filter: brightness(1.07); }
.chat-fab.has-unread { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 92% { transform: rotate(-9deg); } 96% { transform: rotate(9deg); } }
.fab-badge { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e0323c;
  color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.fab-badge[hidden] { display: none; }
body[data-route="editor"] .chat-fab { display: none; }

.chat-panel { position: fixed; right: 20px; bottom: 20px; z-index: 41; width: 380px; height: min(600px, calc(100vh - 100px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
@media (max-width: 640px) {
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  body.chat-open { overflow: hidden; }
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.chat-title { flex: 1; min-width: 0; }
.chat-title strong { font-family: var(--serif); font-size: 1.1rem; }
.chat-online { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.chat-online .dot { width: 8px; height: 8px; border-radius: 50%; background: #3fa34d; flex: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 12px 6px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty .ic { width: 40px; height: 40px; opacity: .5; }
.chat-day { align-self: center; font-size: .75rem; color: var(--muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; margin: 10px 0 6px; }
.msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; max-width: 88%; position: relative; }
.msg.grouped { margin-top: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 30px; flex: none; }
.msg-av .avatar { width: 30px; height: 30px; font-size: .72rem; }
.msg-body { min-width: 0; }
.msg-name { font-size: .75rem; font-weight: 700; color: var(--muted); margin: 0 0 2px 10px; }
.bubble { background: var(--surface-2); padding: 7px 11px 6px; border-radius: 16px 16px 16px 5px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.msg.mine .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 5px 16px; }
.msg.mine .bubble a { color: inherit; }
.msg-time { font-size: .68rem; opacity: .65; margin-left: 8px; float: right; margin-top: 5px; }
.msg-del { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; align-self: center; }
.msg-del .ic { width: 14px; height: 14px; }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
@media (hover: none) { .msg-del { opacity: .45; } }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; padding: 10px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); max-height: 120px; line-height: 1.35; }
.chat-form textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); border-color: var(--accent); }
.chat-form .btn { border-radius: 50%; width: 42px; height: 42px; min-width: 42px; padding: 0; }

/* Live-Küche */
.empty-state > .ic { width: 52px; height: 52px; opacity: .5; margin-bottom: 8px; }
.stream-thumb { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, hsl(var(--h) 45% 40%), hsl(var(--h) 40% 18%)); }
.stream-thumb .avatar { width: 72px; height: 72px; font-size: 1.6rem; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.live-badge { position: absolute; top: 12px; left: 12px; z-index: 2; background: #e0323c; color: #fff; font-weight: 800; font-size: .75rem;
  letter-spacing: .08em; padding: 4px 9px 4px 22px; border-radius: 6px; }
.live-badge::before { content: ""; position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.live-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .live-layout { grid-template-columns: 1fr; } }
.live-stage { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.live-stage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.live-stage video.mirror { transform: scaleX(-1); }
.live-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; color: #fff;
  background: rgba(0,0,0,.55); padding: 20px; }
.live-overlay[hidden] { display: none; }
.live-overlay .btn { color: var(--text); }
.unmute { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3; }
.unmute[hidden] { display: none; }
.live-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.live-controls .btn.off { color: #e0323c; border-color: color-mix(in srgb, #e0323c 45%, var(--line)); }
.live-controls [hidden] { display: none; }
.btn.big { min-height: 52px; font-size: 1.05rem; }
#goLive, #stopLive { width: 100%; }
#stopLive { color: #fff; background: #c62a33; border-color: #c62a33; }
.live-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: #e0323c; font-size: 1.2rem; }
.viewers { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.viewer { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; }
.viewer .avatar { width: 26px; height: 26px; font-size: .68rem; }
.watch { max-width: 1200px; margin: 0 auto; }
.watch-info { display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; flex-wrap: wrap; }
.watch-info > .avatar { width: 46px; height: 46px; }
.watch-title { flex: 1; min-width: 200px; }
.watch-title h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 0; }

/* Chat im Livestream */
.live-side { display: grid; gap: 18px; }
.stream-chat { gap: 10px; }
.stream-chat h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.sc-msgs { height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; overscroll-behavior: contain; }
.watch .sc-msgs { height: min(46vh, 420px); }
.sc-msg { font-size: .93rem; line-height: 1.4; overflow-wrap: anywhere; }
.sc-msg strong { color: var(--accent); margin-right: 4px; }
.sc-msg.mine strong { color: var(--green); }
.sc-form { display: flex; gap: 8px; }
.sc-form input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); }
.sc-form .btn { border-radius: 50%; width: 42px; height: 42px; min-width: 42px; padding: 0; }

/* Rezeptkarten im Chat */
.chat-recipe { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; background: var(--surface); color: var(--text);
  text-decoration: none; border: 1px solid var(--line); text-align: left; width: 100%; cursor: pointer; font: inherit; }
.chat-recipe img, .chat-recipe .placeholder { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; flex: none; font-size: 1.6rem; }
.chat-recipe span { display: flex; flex-direction: column; font-weight: 600; line-height: 1.25; min-width: 0; }
.chat-recipe small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.chat-recipe.locked { color: var(--muted); }
.chat-recipe.locked > .ic { width: 28px; height: 28px; margin: 0 8px; }
.bubble.has-recipe { display: grid; gap: 6px; min-width: 210px; }
.msg.mine .bubble a.chat-recipe, .msg.mine .chat-recipe { color: var(--text); }
.chat-recipe.preview { cursor: default; }
.chat-attach { width: 42px; height: 42px; min-width: 42px; padding: 0; border-radius: 50%; color: var(--muted); }
.recipe-pick { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }

/* Startseite & Anmeldung */
.install-hint { display: flex; align-items: center; gap: 10px 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft);
  margin-bottom: 18px; flex-wrap: wrap; position: relative; padding-right: 44px; }
.install-hint > .ic { width: 26px; height: 26px; color: var(--accent); flex: none; }
.install-hint p { margin: 0; flex: 1 1 200px; font-size: .92rem; }
.install-hint #installHintClose { position: absolute; top: 6px; right: 6px; }
.invite-form { display: grid; gap: 10px; text-align: left; max-width: 420px; margin: 20px auto 8px; }
.helper-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Rezept: Einkauf, Nachgekocht, Fotos */
.shop-btn { width: 100%; margin-top: 14px; }
.cooked-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cooked-item { position: relative; border: 0; padding: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; background: var(--surface-2); }
.cooked-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.cooked-item:hover img { transform: scale(1.04); }
.cooked-item span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: .8rem; font-weight: 600; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); text-align: left; }
.cooked-tag { font-weight: 500; font-size: .8rem; color: var(--green); }
.comment-photo { border: 0; padding: 0; margin: 6px 0 2px; border-radius: 10px; overflow: hidden; cursor: zoom-in; display: block; max-width: 240px; }
.comment-photo img { width: 100%; max-height: 200px; object-fit: cover; }
.cooked-pick { aspect-ratio: 4 / 3; width: 100%; font: inherit; }
.lightbox { margin: 0; display: grid; gap: 10px; }
.lightbox img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #000; }
.lightbox figcaption { font-size: .95rem; }

/* Auswahl-Dialog (Zutaten → Einkaufsliste) */
.pick-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.pick-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row input { accent-color: var(--accent); width: 18px; height: 18px; transform: translateY(3px); }
.pick-row .amt { font-weight: 700; min-width: 4.5em; white-space: nowrap; }
.pick-group { font-family: var(--serif); font-weight: 600; padding: 10px 0 2px; }
.pick-tools { font-size: .85rem; color: var(--muted); }

/* Einkaufsliste */
.shop { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.head-actions { display: flex; gap: 8px; }
.shop-box { gap: 12px; }
.shop-sub { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shop-sub .avatar { width: 22px; height: 22px; font-size: .6rem; display: inline-grid; vertical-align: middle; }
.shop-add { display: flex; gap: 8px; }
.shop-add input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 1.05rem; }
.shop-add .btn { width: 48px; height: 48px; border-radius: 12px; }
.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-item label { flex: 1; display: flex; gap: 14px; align-items: center; padding: 12px 2px; cursor: pointer; min-height: 52px; }
.shop-item input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.shop-text { font-size: 1.05rem; line-height: 1.3; }
.shop-text .amt { font-weight: 700; }
.shop-text small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.shop-item.done .shop-text { text-decoration: line-through; opacity: .5; }
.shop-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 10px; border-radius: 8px; opacity: .5; }
.shop-del:hover { opacity: 1; background: var(--surface-2); }
.shop-empty { text-align: center; color: var(--muted); padding: 20px 0; }
.shop-empty .ic { width: 40px; height: 40px; opacity: .5; }
.shop-done { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; justify-items: start; }
.shop-foot { text-align: center; font-size: .88rem; }
.linkbtn.danger { color: var(--danger); }
.chips a.chip { text-decoration: none; color: inherit; }
.chips a.chip[aria-pressed="true"] { color: var(--bg); }
.export-preview { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin: 0; max-height: 34vh; overflow: auto;
  font: inherit; white-space: pre-wrap; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.export-help summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.export-help p { font-size: .9rem; margin: 8px 0 0; }

/* App-Dialog */
.dlg-section { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.dlg-section h3 { margin: 0; font-size: 1.05rem; }
.dlg-section p { margin: 0; }
.howto { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.switch-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; cursor: pointer; padding: 4px 0; }
.switch-row > span:first-child { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: .8rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.small-row { padding-left: 4px; }
#pushPrefs { display: grid; gap: 6px; }
#pushPrefs[hidden] { display: none; }

/* Kochmodus */
body.cooking { overflow: hidden; }
body.cooking .chat-fab { display: none; }
.cook { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ck-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: relative; }
.ck-title { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; }
.ck-progress span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.ck-timers { display: flex; gap: 8px; padding: 10px 14px 0; flex-wrap: wrap; }
.ck-timer { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: .92rem; }
.ck-t-label { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-t-left { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; }
.ck-timer.paused .ck-t-left { opacity: .5; }
.ck-timer.done { background: #e0323c; color: #fff; animation: ckflash 1s infinite; }
.ck-timer.done .ck-t-label { color: #fff; }
@keyframes ckflash { 50% { background: #a71d26; } }
.ck-main { flex: 1; min-height: 0; display: flex; }
.ck-side { display: none; width: 300px; flex: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 18px; background: var(--surface-2); }
.cook.show-ings .ck-side { display: block; }
.ck-side h3 { margin: 0 0 8px; }
.ck-body { flex: 1; overflow-y: auto; padding: clamp(20px, 5vw, 56px); display: flex; }
.ck-step { margin: auto; max-width: 860px; width: 100%; }
.ck-kicker { color: var(--accent); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; margin-bottom: 14px; }
.ck-text { font-size: clamp(1.45rem, 3.6vw, 2.5rem); line-height: 1.4; margin: 0 0 24px; font-family: var(--serif); font-weight: 500; white-space: pre-line; }
.ck-timers-start { display: flex; gap: 10px; flex-wrap: wrap; }
.ck-timers-start .btn { min-height: 52px; font-size: 1.05rem; }
.ck-ings { list-style: none; margin: 0; padding: 0; }
.ck-ings li { border-bottom: 1px dashed var(--line); }
.ck-ings li.mentioned { background: var(--accent-soft); border-radius: 8px; }
.ck-ings label { display: flex; gap: 10px; align-items: baseline; padding: 8px 6px; cursor: pointer; }
.ck-ings input { width: 20px; height: 20px; accent-color: var(--green); transform: translateY(3px); flex: none; }
.ck-ings input:checked ~ span { text-decoration: line-through; opacity: .45; }
.ck-ings .amt { font-weight: 700; min-width: 4.5em; }
.ck-ings.big { font-size: 1.2rem; columns: 2 280px; column-gap: 40px; }
.ck-ings.big li { break-inside: avoid; }
.ck-group { font-family: var(--serif); font-weight: 600; padding: 12px 6px 2px; border: 0 !important; }
.ck-note { color: var(--muted); }
.ck-done { text-align: center; }
.ck-emoji { font-size: 4rem; }
.ck-done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ck-foot { display: flex; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.ck-foot .btn { flex: 1; min-height: 58px; font-size: 1.15rem; }
@media (max-width: 899px) {
  .cook.show-ings .ck-side { position: absolute; inset: 58px 0 84px 0; width: auto; z-index: 2; border-right: 0; box-shadow: var(--shadow); }
}

/* Profilbilder */
.avatar.has-img { background: var(--surface-2); overflow: hidden; padding: 0; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who-head { display: flex; align-items: center; gap: 12px; }
.who-head .avatar { width: 52px; height: 52px; font-size: 1.1rem; }
.who-head h2 { margin: 0; }
.avatar-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.avatar-big { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex: none; background: var(--surface-2); }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-big .avatar { width: 100%; height: 100%; font-size: 2.4rem; }
.avatar-edit-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-btn { position: relative; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; width: 40px; height: 40px; }
.avatar-btn .avatar { width: 40px; height: 40px; }
.avatar-cam { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.avatar-cam .ic { width: 12px; height: 12px; }
.avatar-btn:hover .avatar-cam { color: var(--accent); border-color: var(--accent); }

/* Rezept im Livestream */
.live-main { display: grid; gap: 18px; min-width: 0; }
.watch .live-main, .watch > div:first-child { min-width: 0; }
#liveRecipeBox:empty { display: none; }
.live-recipe { gap: 12px; }
.live-recipe h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.live-recipe h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.02rem; }
.lr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lr-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.lr-pick select { flex: 1; min-width: 200px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.lr-cols { display: grid; grid-template-columns: minmax(200px, 1fr) 1.6fr; gap: 22px; }
@media (max-width: 700px) { .lr-cols { grid-template-columns: 1fr; } }
.lr-ings { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.lr-ings li { border-bottom: 1px dashed var(--line); }
.lr-ings label { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; cursor: pointer; }
.lr-ings input { accent-color: var(--green); transform: translateY(2px); }
.lr-ings input:checked ~ span { text-decoration: line-through; opacity: .45; }
.lr-ings .amt { font-weight: 700; min-width: 4.2em; white-space: nowrap; }
.lr-group { font-weight: 700; padding: 8px 0 2px; border: 0 !important; }
.lr-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: 1.02rem; line-height: 1.45; }
.lr-steps li { cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.lr-steps li:hover { background: var(--surface-2); }
.lr-steps li.done { opacity: .4; text-decoration: line-through; }

/* Rezept des Tages */
.daily { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; margin-bottom: 14px; transition: transform .15s; }
.daily:hover { transform: translateY(-2px); }
.daily-img { min-height: 220px; background: var(--surface-2); }
.daily-img img { width: 100%; height: 100%; object-fit: cover; }
.daily-img .placeholder { font-size: 4.5rem; }
.daily-body { padding: clamp(16px, 3vw, 28px); display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.daily-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.daily h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.daily p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { .daily { grid-template-columns: 1fr; } .daily-img { min-height: 0; aspect-ratio: 16 / 9; } }

.today-teaser { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--green-soft);
  color: var(--text); text-decoration: none; margin-bottom: 22px; }
.today-teaser > .ic:first-child { width: 26px; height: 26px; color: var(--green); }
.today-teaser span { flex: 1; }
.today-teaser:hover { filter: brightness(.98); }

/* Was koche ich heute? */
.today { max-width: 920px; margin: 0 auto; display: grid; gap: 16px; }
.fridge-items { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fridge-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--green-soft);
  color: var(--green); font-weight: 600; }
.fridge-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; display: grid; }
.fridge-chip .ic { width: 14px; height: 14px; }
.fridge-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.fridge-quick .chip { font-size: .85rem; padding: 4px 10px; }
.today-actions { display: flex; justify-content: center; margin-bottom: 4px; }
.match-section { margin-bottom: 22px; }
.match-section h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.match-section > p { margin: 0 0 10px; }
.match-list { display: grid; gap: 10px; }
.match-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.match-img { display: block; background: var(--surface-2); min-height: 110px; }
.match-img img { width: 100%; height: 100%; object-fit: cover; }
.match-body { padding: 12px 14px 12px 0; display: grid; gap: 6px; align-content: start; justify-items: start; }
.match-title { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; color: var(--text); text-decoration: none; }
.match-ings { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .82rem; }
.ing-have { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.ing-have .ic { width: 12px; height: 12px; }
.ing-missing { padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--line); color: var(--muted); }
@media (max-width: 520px) { .match-card { grid-template-columns: 90px 1fr; } }

/* Doppelter Titel */
.dup-actions { flex-wrap: wrap; }
.dup-actions .btn { white-space: normal; text-align: center; }
.person-actions .badge { padding: 5px 10px; }

/* Kategorien auf der Startseite: alle sichtbar (umbrechen statt seitlich scrollen) */
#cats { flex-wrap: wrap; overflow: visible; }

/* „Mehr"-Menü */
.more-wrap { position: relative; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; display: grid; }
.more-menu[hidden] { display: none; }
.more-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.more-menu a:hover { background: var(--surface-2); }

/* Bewertungen */
.stars-mini { color: #d99a00; }
.stars-mini .ic { fill: currentColor; }
.rating-box { display: grid; gap: 8px; padding: 12px 0 14px; border-top: 1px solid var(--line); }
.rating-summary { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rating-big { font-weight: 800; font-size: 1.25rem; color: #d99a00; display: inline-flex; align-items: center; gap: 4px; }
.rating-big .ic { fill: currentColor; }
.rating-mine { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 2px; }
.star { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--line); border-radius: 6px; }
.star .ic { width: 26px; height: 26px; }
.star.on { color: #e0a800; }
.star.on .ic { fill: currentColor; }
.stars:hover .star { color: #e0a800; }
.stars:hover .star .ic { fill: currentColor; }
.stars .star:hover ~ .star { color: var(--line); }
.stars .star:hover ~ .star .ic { fill: none; }
.btn.again.on { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.rating-list summary { cursor: pointer; color: var(--muted); }
.rating-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .92rem; }
.rating-row .avatar { width: 26px; height: 26px; font-size: .65rem; }
.stars-static { color: #e0a800; letter-spacing: 1px; }
.again-tag { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; color: var(--green); }
.again-tag .ic { width: 12px; height: 12px; }

/* Supermarkt-Abteilungen in der Einkaufsliste */
.aisle-title { font-family: var(--sans); font-size: .76rem; letter-spacing: .07em; text-transform: uppercase; color: var(--accent);
  margin: 10px 0 0; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.aisle:first-of-type .aisle-title { margin-top: 0; }

/* Wochenplan */
.planner { display: grid; gap: 14px; }
.week-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.week-label { display: grid; text-align: center; min-width: 170px; }
.week-label span { color: var(--muted); font-size: .9rem; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; align-content: start; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.day.past { opacity: .7; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-head span { color: var(--muted); font-size: .85rem; }
.day.today .day-head span { color: var(--accent); font-weight: 700; }
.day-entries { display: grid; gap: 6px; }
.day-empty { padding: 6px 0; }
.plan-entry { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 6px; }
.plan-entry.note { padding: 8px 6px 8px 10px; }
.plan-entry > .ic { color: var(--muted); flex: none; }
.plan-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; display: block; }
.plan-thumb img, .plan-thumb .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 1.4rem; }
.plan-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.plan-text a { color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.25; }
.plan-text .linkbtn { justify-self: start; color: var(--muted); font-size: .78rem; }
.plan-entry.note .linkbtn { color: var(--muted); font-size: .78rem; }
.plan-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; flex: none; }
.plan-del:hover { background: var(--surface); color: var(--danger); }
.day-add { display: flex; gap: 6px; flex-wrap: wrap; }

/* Restezettel */
.fridge-chip .fc-name { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.fridge-chip .fc-name small { font-weight: 500; opacity: .85; margin-left: 2px; }
.fridge-chip .fc-name .ic { width: 13px; height: 13px; }
.fridge-chip.soon { background: color-mix(in srgb, #e0a800 22%, var(--surface)); color: #8a5a00; }
.fridge-chip.urgent { background: color-mix(in srgb, #e0323c 18%, var(--surface)); color: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fridge-chip.soon { color: #f4c25b; } :root:not([data-theme="light"]) .fridge-chip.urgent { color: #ff8a8a; } }
.rescue-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, #e0323c 10%, var(--surface)); border: 1px solid color-mix(in srgb, #e0323c 30%, var(--line)); }
.rescue-note > .ic { color: #e0323c; width: 22px; height: 22px; flex: none; margin-top: 2px; }
.ing-have.urgent, .ing-have.soon { background: color-mix(in srgb, #e0323c 15%, var(--surface)); color: #b3261e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ing-have.urgent, :root:not([data-theme="light"]) .ing-have.soon { color: #ff8a8a; } }

/* Bestenliste */
.best { display: grid; gap: 16px; }
.best h1 { display: flex; align-items: center; gap: 10px; }
.best-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.best-box { gap: 10px; }
.best-box h2 { font-size: 1.15rem; }
.best-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.best-list a, .best-list.people li { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; color: inherit; text-decoration: none; }
.best-list a:hover { background: var(--surface-2); }
.best-rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); flex: none; font-size: 1.05rem; }
.best-img { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex: none; }
.best-img img, .best-img .placeholder { width: 100%; height: 100%; object-fit: cover; font-size: 1.3rem; }
.best-text { display: grid; min-width: 0; }
.best-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best-text small { color: var(--muted); }
.best-list.people .avatar { width: 36px; height: 36px; }

/* Rezeptbuch – Auswahl */
.book-page-ui { display: grid; gap: 16px; }
.book-controls { display: grid; gap: 14px; }
.book-options { display: flex; gap: 18px; flex-wrap: wrap; }
.book-options label, .book-item, .book-cat-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.book-options input, .book-select input { accent-color: var(--accent); width: 18px; height: 18px; }
.book-sel-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.book-sel-head .chips { flex-wrap: wrap; }
.book-select { columns: 2 300px; column-gap: 28px; }
.book-cat { break-inside: avoid; margin-bottom: 14px; }
.book-cat-head { padding: 4px 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.book-item { padding: 3px 0 3px 4px; font-size: .94rem; }
.book-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px;
  border-radius: var(--radius); background: var(--accent-soft); }
.book-toolbar p { margin: 0; }

/* Rezeptbuch – Seiten (Bildschirm-Vorschau wie Papier) */
.book { display: grid; gap: 22px; margin-top: 16px; }
.book-page { background: #fff; color: #222; border-radius: 6px; box-shadow: 0 4px 24px rgba(0,0,0,.2); padding: 48px 52px;
  max-width: 820px; width: 100%; margin: 0 auto; font-family: var(--serif); }
.book-cover { min-height: 900px; display: grid; place-items: center; text-align: center; background: linear-gradient(160deg, #fbf3e6, #f3e2c8); }
.bc-inner img { margin: 0 auto 24px; }
.book-cover h1 { font-size: 3rem; margin: 0 0 10px; color: #6b2f14; }
.bc-sub { font-size: 1.2rem; color: #7a5a40; margin: 0; }
.bc-count { margin-top: 40px; color: #9a7a60; font-family: var(--sans); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; }
.book-toc h2 { font-size: 2rem; margin: 0 0 12px; color: #6b2f14; }
.book-toc h3 { font-size: 1.1rem; margin: 18px 0 4px; color: #b4532a; }
.book-toc ol { list-style: none; margin: 0; padding: 0; }
.book-toc li { display: flex; gap: 6px; padding: 2px 0; font-size: 1rem; }
.toc-dots { flex: 1; border-bottom: 1px dotted #bbb; transform: translateY(-5px); }
.book-divider { min-height: 400px; display: grid; place-items: center; align-content: center; text-align: center; background: #fbf3e6; }
.book-divider div { font-size: 5rem; }
.book-divider h2 { font-size: 2.6rem; color: #6b2f14; margin: 0; }
.br-head { display: flex; justify-content: space-between; font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #b4532a; font-weight: 700; }
.br-title { font-size: 2rem; margin: 6px 0 8px; color: #2b1d14; }
.br-desc { font-style: italic; color: #555; margin: 0 0 8px; }
.br-facts { font-family: var(--sans); font-size: .85rem; color: #777; margin-bottom: 14px; }
.br-img { width: 100%; max-height: 330px; object-fit: cover; border-radius: 6px; margin-bottom: 18px; }
.br-cols { display: grid; grid-template-columns: 1fr 1.7fr; gap: 28px; }
.br-cols h3 { font-size: 1.15rem; margin: 0 0 8px; color: #6b2f14; border-bottom: 2px solid #f0dcc8; padding-bottom: 4px; }
.br-ings ul { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .9rem; }
.br-ings li { padding: 3px 0; border-bottom: 1px dotted #e5d6c6; }
.br-ings li span { font-weight: 700; }
.br-group { font-family: var(--serif); font-weight: 700; border: 0 !important; padding-top: 8px !important; }
.br-steps ol { margin: 0; padding-left: 1.3em; font-family: var(--sans); font-size: .93rem; line-height: 1.5; }
.br-steps li { margin-bottom: 6px; }
.br-tip, .br-notes { margin-top: 14px; padding: 10px 12px; background: #f6f1e7; border-left: 3px solid #b4532a; font-family: var(--sans); font-size: .88rem; }
.br-notes p { margin: 4px 0 0; }
@media (max-width: 700px) { .book-page { padding: 24px 20px; } .br-cols { grid-template-columns: 1fr; } .book-cover { min-height: 520px; } }

@media print {
  @page { size: A4; margin: 14mm; }
  body[data-route="buch"] .book-controls, body[data-route="buch"] .book-toolbar, body[data-route="buch"] .topbar,
  body[data-route="buch"] .chat-fab { display: none !important; }
  body[data-route="buch"] .container { padding: 0; max-width: none; }
  .book { display: block; margin: 0; }
  .book-page { box-shadow: none; border-radius: 0; padding: 0; max-width: none; break-after: page; }
  .book-cover { min-height: 255mm; }
  .book-divider { min-height: 255mm; }
  .br-cols { grid-template-columns: 1fr 1.7fr; gap: 20px; }
  .br-ings li, .br-steps li { break-inside: avoid; }
  /* kompakter, damit die meisten Rezepte auf eine A4-Seite passen */
  .br-title { font-size: 1.6rem; margin: 4px 0 4px; }
  .br-desc { margin-bottom: 4px; }
  .br-facts { margin-bottom: 10px; }
  .br-img { max-height: 58mm; margin-bottom: 12px; }
  .br-ings ul { font-size: .82rem; }
  .br-ings li { padding: 2px 0; }
  .br-steps ol { font-size: .84rem; line-height: 1.42; }
  .br-steps li { margin-bottom: 4px; }
  .br-tip, .br-notes { font-size: .8rem; margin-top: 10px; padding: 8px 10px; }
}

@media print { .chat-fab, .chat-panel, .toast, .install-hint, .shop-btn, .cooked, .comment-photo, .daily, .today-teaser { display: none !important; } }
