/* ===== Farbpaletten =====
   Palette per data-palette auf <html> (fehlt = Kräuter), Modus per data-theme (fehlt = Automatisch).
   Gesetzt von public/theme.js. Dunkel jeweils Stufe „Dämmerung“, abgeleitet aus der hellen Palette. */
:root {
  --radius: 14px;
  --shadow: 0 1px 2px rgb(40 45 30 / 6%), 0 4px 16px rgb(40 45 30 / 6%);
  --bg: #faf7f0; /* Seitenhintergrund: warmes Cremeweiß */
  --surface: #ffffff; /* Rezeptkarten */
  --text: #22261f;
  --heading: #344a35; /* Überschriften: dunkles Olivgrün */
  --muted: #747c70; /* Sekundärtext: gedämpftes Grauoliv */
  --line: #e6e4da;
  --accent: #547a53; /* aktive Filter, Knöpfe: Kräutergrün */
  --accent-soft: #dce9d5; /* Kartenkopf ohne Foto, Tags: Salbeigrün */
  --on-accent: #ffffff;
  --star: #d88b5c; /* Favoriten: Terrakotta */
  --on-star: #3a2216; /* dunkle Schrift auf Terrakotta (Kontrast) */
  --rating: #d9a21b; /* Bewertungssterne */
  --danger: #b4412f;
  --done: #aab0a5;
  color-scheme: light;
}
:root[data-palette="tomate"] {
  --bg: #fff9f3; /* Cream – Seitenhintergrund */
  --surface: #ffffff; /* Pure White – Rezeptkarten */
  --text: #2e2824;
  --heading: #49423c; /* Dark Cocoa – Überschriften */
  --muted: #8b7770; /* Warm Taupe – Sekundärtext */
  --line: #eed9ce; /* Peach Border – Rahmen */
  --accent: #c85e47; /* Tomato – Buttons, aktive Filter */
  --accent-soft: #f4dcd0; /* Soft Apricot – Kartenkopf */
  --on-accent: #ffffff;
  --star: #c56e54; /* Terracotta – Favoriten */
  --on-star: #2a140c; /* dunkle Schrift auf Terracotta (Kontrast) */
  --rating: #d39a14;
  --danger: #b4412f;
  --done: #c2b2aa;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #353c34;
    --surface: #424a41;
    --text: #e8ece4;
    --heading: #d3e2cc;
    --muted: #b3bcad;
    --line: #535d51;
    --accent: #a6d4a2;
    --accent-soft: #4b5e47;
    --on-accent: #10200f;
    --star: #e7a27c;
    --on-star: #2a140a;
  --rating: #f0c24f;
    --danger: #e8806c;
    --done: #949d90;
    --shadow: none;
    color-scheme: dark;
  }
  :root[data-palette="tomate"]:not([data-theme="light"]) {
    --bg: #3d3632;
    --surface: #4a423d;
    --text: #f4ede8;
    --heading: #f3e4d9;
    --muted: #c9b8ae;
    --line: #5f5550;
    --accent: #f2967f;
    --accent-soft: #614b41;
    --on-accent: #2a120b;
    --star: #eaa68d;
    --on-star: #2a120b;
  --rating: #f2c75a;
    --danger: #f08a74;
    --done: #9d8f88;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #353c34;
  --surface: #424a41;
  --text: #e8ece4;
  --heading: #d3e2cc;
  --muted: #b3bcad;
  --line: #535d51;
  --accent: #a6d4a2;
  --accent-soft: #4b5e47;
  --on-accent: #10200f;
  --star: #e7a27c;
  --on-star: #2a140a;
  --rating: #f0c24f;
  --danger: #e8806c;
  --done: #949d90;
  --shadow: none;
  color-scheme: dark;
}
:root[data-palette="tomate"][data-theme="dark"] {
  --bg: #3d3632;
  --surface: #4a423d;
  --text: #f4ede8;
  --heading: #f3e4d9;
  --muted: #c9b8ae;
  --line: #5f5550;
  --accent: #f2967f;
  --accent-soft: #614b41;
  --on-accent: #2a120b;
  --star: #eaa68d;
  --on-star: #2a120b;
  --rating: #f2c75a;
  --danger: #f08a74;
  --done: #9d8f88;
  --shadow: none;
  color-scheme: dark;
}

/* Schriften (lokal ausgeliefert, siehe public/fonts/LICENSE.md) */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/fraunces-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
}
:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
}
h1, h2, .head-font { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; color: var(--heading); }

* { box-sizing: border-box; }
/* „hidden“ muss immer gewinnen – sonst überstimmen display-Regeln (z. B. .btn, .fab-menu) das Attribut */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-body);
}
a { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; text-decoration: none; color: var(--text);
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.icon { width: 44px; padding: 0; font-size: 20px; }
.btn.ghost { border-color: transparent; background: transparent; }

.fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); font-size: 32px; line-height: 1;
  box-shadow: 0 6px 20px rgb(0 0 0 / 20%); cursor: pointer;
  display: grid; place-items: center; text-decoration: none;
}

.fab { transition: transform .15s; }
.fab.open { transform: rotate(45deg); }
.fab-menu {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(92px + env(safe-area-inset-bottom));
  display: grid; gap: 8px; justify-items: end; z-index: 5;
}
.fab-menu .btn { box-shadow: 0 4px 16px rgb(0 0 0 / 15%); }

.busy {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgb(0 0 0 / 35%); padding: 16px;
}
.busy-card {
  background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 24px 28px;
  display: grid; gap: 6px; justify-items: center; text-align: center; max-width: 320px;
}
.busy-card span { color: var(--muted); font-size: 14px; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%; margin-bottom: 8px;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Hilfe ---- */
.help { display: grid; gap: 10px; max-width: 720px; }
.help details, .example {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.help summary, .example summary {
  cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.help summary::-webkit-details-marker, .example summary::-webkit-details-marker { display: none; }
.help summary::after, .example summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 400; }
.help details[open] summary::after, .example[open] summary::after { content: "−"; }
.help-body { padding: 0 16px 14px; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 10px; }
.help-body li { margin-bottom: 4px; }
.help pre, .example pre {
  background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px;
  font-size: 14px; white-space: pre-wrap;
}
.example { font-size: 14px; }
.example summary { padding: 8px 14px; font-weight: 500; color: var(--accent); }
.example pre, .example p { margin-left: 14px; margin-right: 14px; }
.example p { color: var(--muted); margin-bottom: 12px; }
.cook-hint { color: var(--muted); font-size: 15px; margin: -8px 0 16px; }

/* ---- List ---- */
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.top h1 { margin: 0; font-size: clamp(23px, 6.6vw, 30px); flex: 1; min-width: 0; line-height: 1.05; white-space: nowrap; }
.top h1 .tagline { display: block; font-family: var(--font-body); font-size: 13px; font-weight: 400; letter-spacing: .02em; color: var(--muted); margin-top: 3px; }
.count { color: var(--muted); font-size: 14px; }

.search {
  width: 100%; height: 48px; padding: 0 16px 0 44px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 16px center;
  outline: none;
}
.search:focus { border-color: var(--accent); }

.listbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.sort {
  display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px; padding: 0 4px 0 12px; background: var(--surface);
}
.sort select {
  border: 0; background: transparent; font-size: 14px; padding: 7px 8px 7px 2px; outline: none;
  color: var(--text); cursor: pointer;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 14px; color: var(--text);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.card { position: relative; }
/* zuletzt geöffnetes Rezept nach „Zurück“: Rahmen, der langsam verblasst */
.card.last { animation: last-seen 3s ease-out forwards; }
@keyframes last-seen {
  0%, 40% { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
  100% { box-shadow: 0 0 0 3px transparent, var(--shadow); }
}
.card .star {
  position: absolute; z-index: 1; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  background: var(--surface); color: var(--star); box-shadow: 0 1px 4px rgb(0 0 0 / 15%);
}
.chip.fav.on { background: var(--star); border-color: var(--star); color: var(--on-star); }
.fav-btn { font-size: 22px; color: var(--muted); }
.fav-btn.on { color: var(--star); border-color: var(--star); }
.card .thumb { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; background: var(--accent-soft); }
.card .ph {
  aspect-ratio: 3 / 2; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.card .ph svg { opacity: .85; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
/* feste Zeilen: Titel (2 Zeilen), Zeit (1), Tags (1) – damit alle Karten gleich aufgebaut sind */
.card h3 {
  margin: 0; font-size: 15px; line-height: 1.3; font-weight: 600; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .c-time { color: var(--muted); font-size: 13px; line-height: 1.4; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .c-tags { display: flex; flex-wrap: wrap; gap: 4px; height: 21px; overflow: hidden; }
.card .c-tags span {
  font-size: 11.5px; line-height: 19px; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  background: var(--accent-soft); color: var(--heading);
}
.card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---- Recipe ---- */
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bar .spacer { flex: 1; }
.bar strong { font-family: var(--font-head); font-weight: 600; font-size: 21px; color: var(--heading); }
.hero { border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; max-height: 360px; }
.hero img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; }
.recipe h1 { font-size: 32px; line-height: 1.12; margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--heading); text-decoration: none; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; color: var(--muted); font-size: 15px; }
.facts a { word-break: break-all; }

.scaler {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
  color: var(--text);
}
.scaler button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--accent); }
.scaler button:hover { background: var(--accent-soft); }
.scaler span { min-width: 92px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.cols { display: grid; gap: 28px; }
@media (min-width: 760px) { .cols { grid-template-columns: minmax(260px, 1fr) 2fr; } }
.cols h2 { font-size: 21px; margin: 0 0 8px; }
.cols h4 { margin: 16px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.ing { list-style: none; margin: 0; padding: 0; }
.ing li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ing .amt { min-width: 76px; font-weight: 600; font-variant-numeric: tabular-nums; }

.steps { margin: 0; padding-left: 24px; }
.steps li { margin-bottom: 12px; padding-left: 4px; }
.notes { margin-top: 28px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); white-space: pre-wrap; color: var(--muted); }
.notes strong { color: var(--text); display: block; margin-bottom: 4px; }

/* ---- Cook mode ---- */
.cook { font-size: 20px; }
.cook h1 { font-size: 28px; margin: 0; flex: 1; line-height: 1.15; }
.cook .cols { gap: 36px; }
.cook .ing li { cursor: pointer; padding: 12px 4px; align-items: center; user-select: none; }
.cook .ing li::before {
  content: ""; flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line);
}
.cook .ing li.done { color: var(--done); text-decoration: line-through; }
.cook .ing li.done::before { background: var(--accent); border-color: var(--accent); }
.cook .steps { list-style: none; padding: 0; counter-reset: s; }
.cook .steps li {
  counter-increment: s; position: relative; cursor: pointer; user-select: none;
  padding: 14px 16px 14px 56px; margin-bottom: 10px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid transparent;
}
.cook .steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}
.cook .steps li.current { border-color: var(--accent); }
.cook .steps li.done { color: var(--done); }
.cook .steps li.done::before { content: "✓"; background: var(--line); color: var(--muted); }
.wake { font-size: 13px; color: var(--muted); }

/* ---- Editor ---- */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.form .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.form input[type=text], .form input[type=number], .form input[type=url], .form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-weight: 400; outline: none;
}
.form input:focus, .form textarea:focus { border-color: var(--accent); }
.form textarea { resize: vertical; line-height: 1.6; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr 1.4fr; }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > :last-child { grid-column: span 2; } }
.photo-edit { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.photo-edit img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.actions .spacer { flex: 1; }

#toast {
  z-index: 60; /* über Kacheln, Knöpfen und Leisten */
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; font-size: 15px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media print {
  .bar, .fab, .scaler button { display: none !important; }
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #ccc; }
}

.theme-btn { font-size: 18px; color: var(--muted); }
.top { position: relative; }
.look-menu {
  position: absolute; right: 0; top: 52px; z-index: 10; width: min(300px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(0 0 0 / 18%); padding: 12px 14px 14px;
}
.look-label { font-size: 13px; color: var(--muted); margin: 4px 0 6px; }
.look-label + .seg + .look-label { margin-top: 12px; }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 14px; cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--heading); font-weight: 600; }
.seg .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* Gäste / Anmeldung / Privat */
.login-btn { font-size: 14px; color: var(--muted); padding: 0 12px; }
/* schmale Handys: nur das Schloss, damit der Name in eine Zeile passt */
@media (max-width: 440px) { .login-btn .lbl { display: none; } .login-btn { padding: 0 6px; } .top { gap: 4px; } .top .theme-btn { width: 36px; } .top .btn.lang-btn { min-width: 36px; padding: 0 5px; } .btn.lang-btn .caret { margin-left: 1px; } }
.look-logout { margin-top: 12px; width: 100%; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.private-note { display: inline-block; font-size: 13px; color: var(--muted); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; margin-bottom: 10px; }
.card .lock { font-size: 12px; }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.form .check input { width: 20px; height: 20px; accent-color: var(--accent); }

.keep-orig { margin-top: 6px; font-weight: 500 !important; }

/* Vorheriges / Nächstes Rezept */
.recipe-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-top: 28px; }
.recipe-nav .rn {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0;
}
.recipe-nav .rn.next { text-align: right; }
.recipe-nav .rn.empty { background: transparent; border-color: transparent; }
.recipe-nav .rn small { color: var(--accent); font-weight: 600; font-size: 13px; }
.recipe-nav .rn span { font-weight: 600; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recipe-nav .rn:hover { border-color: var(--accent); }
.rn-pos { align-self: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
@media print { .recipe-nav { display: none; } }

/* Bewertung (Sterne) – getrennt vom Favoriten-Herz */
.stars { display: inline-flex; gap: 1px; line-height: 1; }
.stars .st { color: var(--line); font-size: 20px; }
.stars .st.full { color: var(--rating); }
.stars .st.half { background: linear-gradient(90deg, var(--rating) 50%, var(--line) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars.rate .st { background: none; border: 0; padding: 2px; cursor: pointer; font-size: 26px; }
.stars.rate .st:hover, .stars.rate .st:focus-visible { transform: scale(1.12); }
.rating-row { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.rating-text { color: var(--muted); font-size: 14px; }
.card .c-time { display: flex; justify-content: space-between; gap: 6px; }
.card .c-time .t { overflow: hidden; text-overflow: ellipsis; }
.card .c-rating { color: var(--muted); font-weight: 600; flex: none; }
.card .c-rating b { color: var(--rating); }
.fav-btn { font-size: 22px; }

/* ---- Kochbuch ---- */
/* Umschalter Kochbuch | Sammlung (nur angemeldet) */
.switch { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.switch a { padding: 7px 16px; border-radius: 999px; text-decoration: none; color: var(--text); font-size: 14px; }
.switch a.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Cover des Kochbuchs */
.cover { position: relative; text-align: center; padding: 34px 20px 28px; margin: 0 0 6px; border-radius: var(--radius);
  background: var(--accent-soft); }
.cover-title { margin: 0; font-size: clamp(28px, 7vw, 40px); line-height: 1.1; }
.cover-sub { margin: 8px 0 0; color: var(--heading); font-style: italic; font-size: 17px; }
.cover-count { margin: 12px 0 0; color: var(--muted); font-size: 13px; letter-spacing: .03em; }
.cover-edit { position: absolute; top: 10px; right: 14px; font-size: 13px; color: var(--muted); }

.book-sec { margin-top: 30px; scroll-margin-top: 16px; }
.book-sec h2 { margin: 0; font-size: 24px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.book-sec .sec-hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.book-sec.try h2 { color: var(--muted); }
.book-sec.try .card { opacity: .92; }
.book-empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.book-empty p { margin: 6px 0; }
.chips a.chip { text-decoration: none; }

/* Platz in den Top 10 und Status-Markierung in der Sammlung */
.card .rank { position: absolute; z-index: 1; top: 8px; left: 8px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 17px;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 4px rgb(0 0 0 / 18%); }
.card .badge { position: absolute; z-index: 1; top: 8px; left: 8px; height: 26px; padding: 0 9px; border-radius: 999px;
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  background: var(--surface); color: var(--heading); box-shadow: 0 1px 4px rgb(0 0 0 / 15%); }
.card .badge.try { color: var(--muted); font-weight: 400; }

/* Kochbuch-Bereich im Rezept */
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.book-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; }
.book-panel.in { padding: 8px 10px; border-radius: 12px; background: var(--accent-soft); }
.book-panel .bp-label { font-weight: 600; color: var(--heading); font-size: 14px; margin-right: 2px; }
.book-panel select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; max-width: 100%; }
.bp-add-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%;
  padding: 10px; border-radius: 12px; background: var(--accent-soft); }
.bp-add-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--heading); }
.book-info { margin: 4px 0 12px; color: var(--heading); font-size: 14px; }
.book-info.try { color: var(--muted); }

/* Kochbuch bearbeiten: Kapitelliste */
.book-form .lbl { font-weight: 600; font-size: 14px; }
.chap-list { list-style: none; margin: -8px 0 0; padding: 0; display: grid; gap: 6px; }
.chap-list li { display: flex; align-items: center; gap: 4px; }
.chap-list input { flex: 1; min-width: 0; }
.chap-list .chap-n { color: var(--muted); font-size: 12px; min-width: 72px; text-align: right; padding-right: 4px; }
.chap-list .btn.icon { width: 36px; min-height: 36px; font-size: 16px; }
.chap-list .btn[disabled] { opacity: .3; cursor: default; }
@media (max-width: 440px) { .chap-list .chap-n { display: none; } }

/* Editor: Tags auswählen */
.tag-field { display: grid; gap: 8px; }
.tag-field .lbl { font-weight: 600; font-size: 14px; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-new { display: flex; gap: 8px; }
.tag-new input { flex: 1; min-width: 0; }

/* Rezept auf der Probierliste: Zustand deutlich zeigen */
.book-panel .bp-state { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; width: 100%; }
.book-panel .bp-note { color: var(--muted); font-size: 13px; }

/* Blättern oben im Rezept: ← 3 / 15 → */
.pager { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.pager .pg { width: 40px; height: 36px; display: grid; place-items: center; border-radius: 999px; text-decoration: none; color: var(--accent); font-size: 19px; font-weight: 600; }
.pager a.pg:hover, .pager a.pg:active { background: var(--accent-soft); }
.pager .pg.off { color: var(--line); }
.pager .pg-pos { min-width: 44px; text-align: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
/* Handys: Blättern als Leiste unten in Daumennähe (oben wäre zu weit weg) */
@media (max-width: 560px) {
  .recipe-bar .pager {
    position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom));
    gap: 6px; padding: 4px; box-shadow: 0 4px 18px rgb(0 0 0 / 18%);
  }
  .recipe-bar .pager .pg { width: 64px; height: 48px; font-size: 24px; }
  .recipe-bar .pager .pg-pos { min-width: 56px; font-size: 14px; }
  /* Meldungen über der Leiste anzeigen */
  body:has(.recipe-bar .pager) #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media print { .pager { display: none; } }

/* Übersetzung (Stufe 2) */
.tr-note { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.edit-lang { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--heading); font-size: 14px; }

/* Sprachknopf oben rechts: zeigt die andere Sprache (EN / DE) */
.btn.lang-btn { min-height: 34px; min-width: 44px; padding: 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); border-color: var(--line); }
.btn.lang-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Rückmeldungen (Testphase): schwebender Knopf unten links + Formular von unten */
.fb-fab {
  position: fixed; z-index: 20; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px;
  border-radius: 999px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--accent);
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: 0 4px 16px rgb(0 0 0 / 16%);
}
/* Rezept am Handy: unten in der Mitte sitzen die Blätter-Pfeile – dort nur das Symbol */
@media (max-width: 560px) { .fb-fab.on-recipe { width: 48px; padding: 0; justify-content: center; font-size: 20px; } .fb-fab.on-recipe .lbl { display: none; } }
.fb-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgb(0 0 0 / 38%); }
.fb-panel {
  display: grid; gap: 10px; width: min(560px, 100%); max-height: 90vh; overflow: auto;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--bg);
  box-shadow: 0 -8px 30px rgb(0 0 0 / 20%);
}
@media (min-width: 600px) { .fb-sheet { align-items: center; } .fb-panel { border-radius: 18px; } }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fb-head strong { font-family: var(--font-head); font-size: 20px; color: var(--heading); }
.fb-about { margin: -6px 0 0; font-weight: 600; color: var(--heading); }
.fb-panel .fb-hint { margin: 0; color: var(--muted); font-size: 14px; }
.fb-panel textarea, .fb-panel input[type=text] { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px; color: var(--text); outline: none; }
.fb-panel textarea:focus, .fb-panel input[type=text]:focus { border-color: var(--accent); }
.fb-panel .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; } /* Fangfeld für Bots */
body.sheet-open { overflow: hidden; }
@media print { .fb-fab, .fb-sheet { display: none !important; } }
.switch .fb-link b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 18px; text-align: center; }
.fb-item { padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.fb-item.new { border-left: 4px solid var(--accent); }
.fb-meta { color: var(--muted); font-size: 13px; }
.fb-new { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.fb-text { margin: 6px 0 8px; white-space: pre-wrap; }
/* Sprachmenü: schmal, zwei Einträge untereinander */
.lang-menu { width: 180px; padding: 8px; }
.seg-col { flex-direction: column; }
.btn.lang-btn .caret { font-size: 10px; margin-left: 3px; opacity: .7; }
.btn.lang-btn { color: var(--heading); }
/* Meldungen über dem Feedback-Knopf anzeigen */
body:has(.fb-fab) #toast { bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; }

/* Rezeptseite (angemeldet): Rückmeldungen zu diesem Rezept */
.fb-count { display: inline-block; margin: -2px 0 10px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--heading); font-size: 13px; font-weight: 600; text-decoration: none; }
.fb-recipe { margin-top: 26px; scroll-margin-top: 16px; }
.fb-recipe h2 { font-size: 22px; margin: 0 0 10px; }
.fb-all { font-size: 14px; }
@media print { .fb-count, .fb-recipe { display: none !important; } }
/* Kochbuch: Kapitel als Knöpfe (alle sichtbar, umbrechend), darunter Favoriten + Filter */
.chap-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 0; }
.chap-chips + .book-tools { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.book-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 0; }
.chip.tool { display: inline-flex; align-items: center; gap: 5px; }
.chip.tool .tool-n { font-weight: 600; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filters:not(:empty) { padding-top: 8px; }
.chip.small { font-size: 13px; padding: 4px 10px; }

/* Blätter von unten (Inhalt, Filter) – wie das Feedback-Formular */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgb(0 0 0 / 38%); }
.sheet-panel {
  display: grid; gap: 10px; width: min(560px, 100%); max-height: 85vh; overflow: auto;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--bg);
  box-shadow: 0 -8px 30px rgb(0 0 0 / 20%);
}
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-panel { border-radius: 18px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head strong { font-family: var(--font-head); font-size: 21px; color: var(--heading); }
.sheet-hint { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; }
.tag-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
/* Inhaltsverzeichnis wie im Buch: Kapitel links, Anzahl rechts, gepunktete Linie */
.toc { display: grid; }
.toc a { display: flex; align-items: baseline; gap: 8px; padding: 13px 4px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); font-size: 17px; }
.toc a span:first-child { font-family: var(--font-head); color: var(--heading); }
.toc a::after { content: none; }
.toc .toc-n { margin-left: auto; color: var(--muted); font-size: 14px; }
.toc .toc-try span:first-child { color: var(--muted); }

/* Rezept aus Link: Eingabefeld im Blatt */
.link-input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px; color: var(--text); outline: none; }
.link-input:focus { border-color: var(--accent); }

/* Name oben links führt zur Seite „Die Idee“ */
.top h1 .brand { color: inherit; text-decoration: none; }
/* Willkommenskasten (nur beim ersten Besuch) */
.welcome { position: relative; margin: 0 0 14px; padding: 14px 44px 14px 16px; border-radius: var(--radius); border: 1.5px solid var(--accent); background: var(--surface); }
.welcome strong { font-family: var(--font-head); font-size: 19px; color: var(--heading); }
.welcome p { margin: 6px 0 10px; color: var(--text); font-size: 15px; }
.welcome-x { position: absolute; top: 4px; right: 4px; }
.about-link { text-align: center; margin: 30px 0 0; font-size: 14px; }
/* Seite „Die Idee“: ruhig, gut lesbar, wie ein Vorwort */
.about { max-width: 640px; margin: 0 auto; line-height: 1.65; font-size: 17px; }
.about h1 { font-size: 36px; margin: 4px 0 0; }
.about .about-lead { font-family: var(--font-head); font-style: italic; font-size: 22px; color: var(--heading); margin: 2px 0 18px; }
.about h2 { font-size: 22px; margin: 28px 0 6px; }
.about p { margin: 0 0 12px; }
.about .about-sign { margin-top: 28px; font-style: italic; }
.about .about-links { margin-top: 30px; font-size: 15px; color: var(--muted); }

/* ☰ Menü: Seiten oben, dann Darstellung, dann An-/Abmelden */
.top .menu-btn { font-size: 20px; color: var(--heading); }
.main-menu { width: min(290px, calc(100vw - 32px)); }
.menu-nav { display: grid; margin: -4px -6px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.menu-nav a { display: flex; align-items: center; gap: 6px; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 16px; }
.menu-nav a:hover { background: var(--accent-soft); }
.menu-nav a.on { background: var(--accent-soft); color: var(--heading); font-weight: 600; }
.menu-nav .menu-n { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; line-height: 20px; text-align: center; }
a.look-login { display: block; text-align: center; text-decoration: none; line-height: 38px; color: var(--accent); font-weight: 600; border-color: var(--accent); }
/* Unterseiten (Hilfe, Idee, Rückmeldungen): Seitentitel unter der Kopfzeile */
.page-head { margin: 4px 0 16px; }
.page-head .back-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.page-head .page-title { margin: 4px 0 0; font-size: 30px; }

/* Trennlinie unter Name und Knöpfen */
.top { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
/* ☰ ohne Symbole: schlichte Textliste */
.main-menu { width: min(240px, calc(100vw - 32px)); }
.main-menu .menu-nav { margin-bottom: 0; }
.main-menu .look-logout { margin-top: 10px; }
@media (max-width: 440px) { .top .menu-btn { width: 36px; } }
/* schmale Handys: vier Knöpfe neben dem Namen – etwas enger stellen */
@media (max-width: 440px) {
  .top { gap: 2px; }
  .top .theme-btn, .top .menu-btn { width: 34px; }
  .top .btn.lang-btn { min-width: 34px; padding: 0 4px; margin-left: 4px; }
}
