/* Unser Kochbuch – Stil. Mobile first, Farbschema über <html data-theme="dark|light"> (Standard: dark). */

/* ---------- Farben ---------- */
/* Gestaltung angelehnt an die Schwester-Apps Kontor (dunkel) und Dienstzettel (hell):
   neutraler Grund, Glas-Karten, neutrale Hauptknöpfe, Akzentfarbe nur für Hervorhebungen.
   Akzent und eigener Hintergrund kommen aus den Einstellungen (/theme.css). */
:root,
[data-theme="dark"] {
  --bg: #070708;
  --surface: rgba(22, 23, 26, .80);
  --surface-solid: #151619;
  --surface-2: rgba(255, 255, 255, .05);
  --border: rgba(255, 255, 255, .10);
  --text: #e9edf3;
  --muted: #9a9ca3;
  --primary: #e8eaee;         /* Hauptknöpfe: neutral hell */
  --primary-hover: #ffffff;
  --primary-ink: #0c0d10;
  --accent: #f0a35b;          /* Orange wie Kontor */
  --accent-hover: #f5b97f;
  --accent-ink: #1e130b;
  --accent-soft: rgba(240, 163, 91, .14);
  --info: #c9ccd3;            /* Zeiten, Hinweise: neutral */
  --info-soft: rgba(255, 255, 255, .07);
  --star: #f0c05a;
  --ok-bg: rgba(95, 211, 154, .13); --ok-text: #5fd39a;
  --error-bg: rgba(255, 138, 128, .13); --error-text: #ff8a80;
  --danger: #ff8a80;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 40px rgba(0, 0, 0, .45);
  --shadow-hover: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 14px 44px rgba(0, 0, 0, .55);
  --card-blur: 12px;
  --wave: url("/static/bg-waves.svg") center bottom / max(100%, 1100px) auto no-repeat;
  --halo: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 255, 255, .035), transparent 70%);
  --bg-dim: transparent;
  --header-bg: rgba(8, 9, 11, .78);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f8f7f3;
  --border: #e1ddd3;
  --text: #17201c;
  --muted: #5d6a64;
  --primary: #1b1f1d;         /* Hauptknöpfe: neutral dunkel */
  --primary-hover: #000000;
  --primary-ink: #ffffff;
  --accent: #c2410c;          /* Orange wie Dienstzettel */
  --accent-hover: #9a3412;
  --accent-ink: #ffffff;
  --accent-soft: rgba(194, 65, 12, .10);
  --info: #5d6a64;
  --info-soft: #ebe9e3;
  --star: #d97706;
  --ok-bg: #e1f3e8; --ok-text: #157347;
  --error-bg: #fdecea; --error-text: #b42318;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(23, 32, 28, .06), 0 6px 24px rgba(23, 32, 28, .06);
  --shadow-hover: 0 2px 4px rgba(23, 32, 28, .08), 0 14px 30px rgba(23, 32, 28, .10);
  --card-blur: 0px;
  --wave: linear-gradient(transparent, transparent);
  --halo: linear-gradient(transparent, transparent);
  --bg-dim: transparent;
  --header-bg: color-mix(in srgb, #f4f2ec 88%, transparent);
  color-scheme: light;
}

:root {
  --radius: 16px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, serif;
  --wrap: 1180px;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* sonst überschreiben Klassen wie .btn das hidden-Attribut */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
/* Hintergrund wie bei Kontor: eigene, fest stehende Ebene (funktioniert auch auf iPhone/iPad,
   wo background-attachment: fixed ignoriert wird). Oben → unten: Abdunklung, Lichtkegel, Bild, Grundfarbe. */
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
  /* 100lvh = volle Höhe auch bei eingefahrener Adressleiste (iPhone/iPad) – sonst bleibt unten ein Streifen ohne Bild */
  background: linear-gradient(var(--bg-dim), var(--bg-dim)), var(--halo), var(--wave), var(--bg);
}
body {
  margin: 0; color: var(--text); font: 17px/1.6 var(--font);
  background: transparent;
  min-height: 100vh;
  position: relative;
  transition: background-color .25s, color .25s;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.print-only { display: none; }

/* ---------- Kopf ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 14px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 600 1.2rem var(--font-serif); white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand img { height: var(--logo-h, 40px); margin-block: -6px; width: auto; max-width: min(60vw, 420px); object-fit: contain; border-radius: 10px; }
.brand.has-logo img { border-radius: 0; }
.header-search { flex: 1 1 220px; max-width: 420px; order: 3; width: 100%; }
.header-search input { border-radius: 999px; padding: 9px 16px; background: var(--surface); }
.nav { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--text); font-weight: 500; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .btn, .nav .btn:hover { color: var(--primary-ink); }
.nav-user { color: var(--muted); font-size: .95rem; }
@media (min-width: 860px) { .header-search { order: 0; width: auto; } }

.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); transition: transform .2s, background .2s;
}
.theme-toggle:hover { background: var(--surface-2); transform: rotate(-12deg); }
[data-theme="dark"] .icon-moon, [data-theme="light"] .icon-sun { display: none; }

.main { padding-top: 28px; padding-bottom: 56px; min-height: 65vh; }
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px;
  backdrop-filter: blur(var(--card-blur)); -webkit-backdrop-filter: blur(var(--card-blur)); }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.quote { margin: .5em 0 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); white-space: pre-line; }
.list { list-style: none; padding: 0; margin: 0; }
.row-between { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }
.prose p { max-width: 70ch; white-space: pre-line; }
.section { margin: 36px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-title { font-size: 1.45rem; }
.empty { text-align: center; padding: 40px 20px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--text); font-size: .9rem; border: 1px solid var(--border); text-decoration: none;
}
.chip-link:hover { border-color: var(--accent); color: var(--accent); }
.chip-link.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip-count { color: var(--muted); font-size: .8rem; }
.chip-link.is-active .chip-count { color: inherit; opacity: .75; }
.chip-time { background: var(--info-soft); color: var(--info); border-color: transparent; margin-top: 4px; font-size: .82rem; padding: 3px 10px; }
.chip-on-img { position: absolute; left: 10px; top: 10px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(6px); border: 0; font-size: .78rem; padding: 4px 10px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; }
.form > .btn, .form > button { justify-self: start; }
.narrow .form > .btn { justify-self: stretch; }
input, textarea, select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Schaltflächen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px;
  padding: 10px 22px; cursor: pointer; background: var(--primary); color: var(--primary-ink);
  font: 600 1rem var(--font); text-decoration: none; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn:active { transform: translateY(1px); }
/* Dunkles Design: Hauptknopf wie bei Kontor – heller Verlauf mit sanftem Leuchten */
[data-theme="dark"] .btn:not(.btn-ghost):not(.btn-danger):not(.is-fav) { background: linear-gradient(180deg, #f6f7f9, #cfd2d8); box-shadow: 0 0 22px rgba(255, 255, 255, .14); }
[data-theme="dark"] .btn:not(.btn-ghost):not(.btn-danger):not(.is-fav):hover { box-shadow: 0 0 30px rgba(255, 255, 255, .25); }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
[data-theme="dark"] .btn-ghost { background: rgba(255, 255, 255, .05); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
button.link:hover { color: var(--accent); }
.round-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.round-btn:hover { border-color: var(--accent); color: var(--accent); }
.seg { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 4px 11px; cursor: pointer; font: inherit; font-size: .88rem; }
.seg.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- Meldungen ---------- */
.flash { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }

/* ---------- Startseite ---------- */
.hero { padding: 26px 0 10px; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; margin-bottom: .6em; }
.hero h1 { max-width: 16ch; font-size: clamp(2.1rem, 6vw, 3.6rem); }
.hero-search { display: flex; gap: 8px; max-width: 620px; margin-top: 18px; }
.hero-search input { border-radius: 999px; padding: 13px 20px; font-size: 1.05rem; background: var(--surface); box-shadow: var(--shadow); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }

/* ---------- Rezeptkarten ---------- */
.recipe-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .recipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1040px) { .recipe-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.recipe-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
.recipe-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.recipe-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.recipe-card:hover .recipe-card-img img { transform: scale(1.04); }
.recipe-card-placeholder { display: grid; place-items: center; height: 100%; font-size: 2.6rem; opacity: .5; }
.recipe-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.recipe-card-body h3 { font-size: 1.02rem; margin: 0; line-height: 1.3; }
.recipe-card .ru { color: var(--muted); font-size: .85rem; margin: 0; }
.recipe-card-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin: auto 0 0; padding-top: 6px; }
.stars-mini { color: var(--star); font-weight: 600; }

/* Liste */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.list-head h1 { margin-bottom: .1em; }
.list-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.list-tools input { width: 220px; }
.list-tools select { width: auto; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; }

/* ---------- Rezeptseite ---------- */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.recipe-head { display: grid; gap: 24px; align-items: start; margin-bottom: 28px; }
@media (min-width: 900px) { .recipe-head { grid-template-columns: 1fr 520px; gap: 36px; } }
.ru-title { font-size: 1.15rem; color: var(--muted); margin-top: -.2em; }
.recipe-hero { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4 / 3; background: var(--surface-2); }
.recipe-hero img { width: 100%; height: 100%; object-fit: cover; }
.facts { list-style: none; padding: 0; margin: 16px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .92rem; display: inline-flex; gap: 8px; align-items: center; }
.fact-label { color: var(--muted); }
.stars { color: var(--star); letter-spacing: 1px; }
.byline { font-size: .9rem; }
.recipe-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.recipe-body { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .recipe-body { grid-template-columns: 380px 1fr; gap: 36px; } .ingredients { position: sticky; top: 84px; } }
.ingredients-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ingredients-head h2 { margin: 0; }
.scaler { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.scaler label { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.scaler input { width: 62px; text-align: center; padding: 6px; }
.group-title { font-family: var(--font); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 18px 0 6px; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { border-bottom: 1px dashed var(--border); }
.ing-list li:last-child { border-bottom: 0; }
.ing { display: grid; grid-template-columns: 20px auto auto 1fr; gap: 0 8px; align-items: baseline; padding: 8px 0; cursor: pointer; }
.ing-check { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); align-self: center; }
.ing-amount { font-weight: 700; text-align: right; min-width: 2.2ch; font-variant-numeric: tabular-nums; }
.is-scaled .ing-amount[data-scalable="1"] { color: var(--accent); }
.ing-unit { color: var(--muted); }
.ing-note { color: var(--muted); font-size: .9em; }
.ing-note::before { content: "· "; }
.is-done .ing { opacity: .45; text-decoration: line-through; }

.step-list { list-style: none; padding: 0; margin: 0 0 24px; counter-reset: none; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: 0; }
.step-no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.step-text p { margin: 0 0 .4em; max-width: 68ch; }
.story { background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.notes { margin: 24px 0; }
.notes p, .story p { max-width: 68ch; }

.gallery { margin: 36px 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-grid img { border-radius: var(--radius-sm); aspect-ratio: 1; object-fit: cover; width: 100%; transition: opacity .2s; }
.gallery-grid a:hover img { opacity: .85; }

.comments { margin: 36px 0; max-width: 760px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 10px; }
.comment-reply { margin-left: 28px; }
.comment-head { margin-bottom: 4px; }
.comment p { margin: 0 0 .4em; }

/* ---------- Benutzermenü ---------- */
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary[aria-current="page"] .user-name { color: var(--accent); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-weight: 700; font-size: .95rem; }
.user-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .user-name { display: none; } }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; z-index: 30; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover);
  display: grid; gap: 2px;
}
.menu-panel a, .menu-panel button.link { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; text-align: left; width: 100%; }
.menu-panel a:hover, .menu-panel button.link:hover { background: var(--surface-2); color: var(--accent); }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.menu-role { padding: 4px 10px 2px; margin: 0; }

/* ---------- Mitmachen auf der Rezeptseite ---------- */
.btn.is-fav { background: #e11d48; color: #fff; }
.btn.is-fav:hover { background: #be123c; color: #fff; }
.community-grid { display: grid; gap: 18px; margin-top: 36px; }
@media (min-width: 760px) { .community-grid { grid-template-columns: 1fr 1fr; } }
.community-grid .card { margin: 0; }
.rate-form { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.star-input { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; line-height: 1; color: var(--border); cursor: pointer; padding: 0 2px; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--star); }
.star-input label:hover { transform: scale(1.15); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.note-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.note-list li { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: .95rem; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment-remove { margin-left: auto; }
.reply summary { cursor: pointer; color: var(--accent); margin-top: 4px; width: fit-content; }
.reply .form { margin-top: 8px; }
.comment-form { margin-top: 18px; }
button.link.danger, .danger { color: var(--danger); }

/* ---------- Editor ---------- */
.editor { max-width: 900px; margin: 0 auto; }
.editor-form .card h2 { font-size: 1.2rem; }
.editor-form .card { display: grid; gap: 14px; }
.grid-2, .grid-3, .grid-5 { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
}
textarea.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .95rem; line-height: 1.55; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.status-choice { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.status-choice legend { font-weight: 700; margin-bottom: 6px; }
label.radio { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; cursor: pointer; }
label.radio input { width: auto; accent-color: var(--accent); }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo-tile { margin: 0; background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; }
.photo-tile.is-cover { border-color: var(--accent); }
.photo-tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.photo-tile figcaption { padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.photo-actions { display: flex; gap: 10px; width: 100%; }
.chip-warn { background: var(--error-bg); color: var(--error-text); border-color: transparent; font-size: .75rem; padding: 2px 8px; }
.upload-form { display: grid; gap: 10px; }
.upload-form > .btn { justify-self: start; }
.upload-form input[type="file"] { padding: 8px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* ---------- Mein Bereich ---------- */
.my-recipe { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 12px; }
.my-recipe-img { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; text-decoration: none; }
.my-recipe-img img { width: 100%; height: 100%; object-fit: cover; }
.my-recipe-text a { color: var(--text); text-decoration: none; }
.my-recipe-text a:hover { color: var(--accent); }
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.status-published { background: var(--ok-bg); color: var(--ok-text); }
.status-review { background: var(--info-soft); color: var(--info); }
.status-draft, .status-hidden { background: var(--surface-2); color: var(--muted); }

/* ---------- Kochmodus ---------- */
.cook { --cook-scale: 1; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.cook-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.cook-exit { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 1.1rem; border: 1px solid var(--border); flex: none; }
.cook-exit:hover { color: var(--accent); }
.cook-title { display: grid; min-width: 0; flex: 1; }
.cook-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-serif); font-size: 1.1rem; }
.cook-tools { display: flex; align-items: center; gap: 6px; }
.cook-tools .round-btn { font-size: .85rem; width: 38px; height: 38px; }
.wake-status { font-size: .8rem; color: var(--info); background: var(--info-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
@media (max-width: 560px) { .cook-tools [data-font] { display: none; } }
.cook-progress { height: 4px; background: var(--surface-2); }
.cook-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.cook-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 20px 160px; }
.cook-steps { list-style: none; margin: 0; padding: 0; }
.cook-step { padding: 18px 0 28px; border-bottom: 1px solid var(--border); outline: none; }
.cook-step-no { color: var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; margin-bottom: .6em; }
.cook-text p { font-size: calc(1.55rem * var(--cook-scale)); line-height: 1.5; margin: 0 0 .5em; max-width: 34ch; }
@media (min-width: 700px) { .cook-text p { font-size: calc(1.9rem * var(--cook-scale)); max-width: 38ch; } }
.cook-timer-btn { margin-top: 18px; font-size: 1.1rem; padding: 12px 22px; background: var(--info); color: var(--bg); }
.cook-timer-btn:hover { background: color-mix(in srgb, var(--info) 85%, #fff); color: var(--bg); }
.cook-done h2 { font-size: 2.2rem; }

/* Mit JavaScript: nur der aktuelle Schritt */
.cook.js .cook-step { display: none; border: 0; animation: cook-in .25s ease; }
.cook.js .cook-step.is-current { display: block; }
.cook:not(.js) .cook-nav, .cook:not(.js) .cook-progress, .cook:not(.js) [data-toggle-ingredients] { display: none; }
.cook:not(.js) .cook-ingredients { position: static; transform: none; box-shadow: none; max-width: 860px; margin: 0 auto; border: 0; }
@keyframes cook-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cook.js .cook-step { animation: none; } }

.cook-ingredients {
  position: fixed; z-index: 15; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--border); padding: 80px 20px 120px;
  transform: translateX(105%); visibility: hidden; transition: transform .25s, visibility 0s .25s; box-shadow: var(--shadow-hover);
}
.cook.show-ingredients .cook-ingredients { transform: none; visibility: visible; transition: transform .25s; }
html:has(body.cook), body.cook { overflow-x: hidden; }
.cook-ingredients .ing { font-size: calc(1.05rem * var(--cook-scale)); padding: 10px 0; }

.cook-nav {
  position: fixed; z-index: 12; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
}
.cook-nav .btn { min-width: 130px; padding: 14px 22px; font-size: 1.05rem; }
.cook-nav .btn:disabled { opacity: .35; cursor: default; }
.cook-counter { color: var(--muted); font-variant-numeric: tabular-nums; }

.cook-timers { position: fixed; z-index: 13; left: 50%; transform: translateX(-50%); bottom: 86px; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.cook-timer {
  display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--info); border-radius: var(--radius-sm); box-shadow: var(--shadow-hover);
}
.cook-timer-label { color: var(--muted); font-size: .9rem; }
.cook-timer-time { font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--info); }
.cook-timer.is-paused .cook-timer-time { opacity: .5; }
.cook-timer.is-done { border-color: var(--accent); animation: timer-pulse 1s ease-in-out infinite; }
.cook-timer.is-done .cook-timer-time { color: var(--accent); }
@keyframes timer-pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }

/* ---------- Offline / PWA ---------- */
.offline-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.offline-list a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.offline-list a:hover { border-color: var(--accent); color: var(--accent); }
.install-hint { display: none; }
.install-hint.is-visible { display: flex; }

/* ---------- Einstellungen ---------- */
.logo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { width: 120px; height: 120px; display: grid; place-items: center; border-radius: var(--radius); background: var(--surface-2);
  background-image: linear-gradient(45deg, var(--border) 25%, transparent 25%, transparent 75%, var(--border) 75%), linear-gradient(45deg, var(--border) 25%, transparent 25%, transparent 75%, var(--border) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; }
.logo-preview img { width: 96px; height: 96px; object-fit: contain; }
.color-field { display: flex; align-items: center; gap: 10px; }
.bg-preview { width: 220px; height: 124px; border-radius: var(--radius-sm); overflow: hidden; background: #070708; border: 1px solid var(--border); }
.bg-preview img { width: 100%; height: 100%; object-fit: cover; }
.color-field input[type="color"] { width: 56px; height: 40px; padding: 2px; cursor: pointer; }

/* ---------- Foto-Editor ---------- */
.photo-rotate { display: inline-flex; gap: 4px; }
.photo-rotate .round-btn { width: 30px; height: 30px; font-size: 1rem; }
.photo-editor { display: grid; gap: 16px; }
.pe-stage { position: relative; justify-self: center; max-width: 100%; touch-action: none; user-select: none; cursor: crosshair; line-height: 0; }
.pe-canvas { max-width: 100%; max-height: 62vh; width: auto; height: auto; border-radius: var(--radius-sm); background: var(--surface-2); }
.pe-crop { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; outline: 1px dashed rgba(0, 0, 0, .6); }
.pe-handle { position: absolute; width: 18px; height: 18px; background: #fff; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .5); }
.pe-handle.nw { left: -10px; top: -10px; cursor: nwse-resize; } .pe-handle.ne { right: -10px; top: -10px; cursor: nesw-resize; }
.pe-handle.sw { left: -10px; bottom: -10px; cursor: nesw-resize; } .pe-handle.se { right: -10px; bottom: -10px; cursor: nwse-resize; }
.pe-tools { display: grid; gap: 12px; }
.pe-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pe-label { font-weight: 600; font-size: .9rem; min-width: 80px; }
.pe-slider { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; }
.pe-slider input { padding: 0; accent-color: var(--accent); }
.range-field input { padding: 0; accent-color: var(--accent); }
.range-field output { float: right; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Benachrichtigungen ---------- */
.notify-table { width: 100%; border-collapse: collapse; }
.notify-table th, .notify-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.notify-table thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.notify-table td { width: 70px; text-align: center; }
.notify-table tbody th { font-weight: 500; }
.notify-table input { width: 20px; height: 20px; accent-color: var(--accent); }
.chip-check { cursor: pointer; }
.chip-check input { width: auto; accent-color: var(--accent); margin: 0; }
.chip-check:has(input:checked) { border-color: var(--accent); color: var(--accent); }

/* ---------- Labor ---------- */
.labor-warn { border-color: color-mix(in srgb, var(--star) 50%, var(--border)); background: linear-gradient(135deg, rgba(251, 191, 36, .08), transparent 60%), var(--surface); }
.labor-preview { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 12px; }
.labor-preview-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.labor-img { width: 220px; max-width: 100%; border-radius: var(--radius-sm); }
.labor-preview h4 { margin: 14px 0 6px; font-family: var(--font); font-size: .95rem; }
.labor-log { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; font-size: .9rem; }
.labor-log-row { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; }
.labor-url { word-break: break-all; }

/* ---------- Druck ---------- */
@media print {
  :root, [data-theme] { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #444; --border: #ccc; --accent: #000; --accent-soft: transparent; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .no-print, .crumbs, .flash { display: none !important; }
  .print-only { display: block; }
  .main { padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .recipe-head { grid-template-columns: 1fr 6cm; gap: 1cm; }
  .recipe-hero { box-shadow: none; aspect-ratio: auto; }
  .recipe-body { grid-template-columns: 6.5cm 1fr; gap: 1cm; }
  .ingredients { position: static; }
  .facts li { border: 0; padding: 0 12px 0 0; }
  .step { break-inside: avoid; padding: 6px 0; }
  .step-no { background: none; border: 1px solid #000; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Wochenplan ---------- */
.plan-range { font-size: .55em; font-weight: 400; margin-left: .3em; }
.plan-nav { display: flex; gap: 6px; }
.plan-toolbar { margin-bottom: 8px; }
.plan-days { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 14px; }
@media (min-width: 760px) { .plan-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .plan-days { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan-day { margin-bottom: 0; padding: 16px 18px; }
.plan-day.is-today { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.plan-day.is-past { opacity: .6; }
.plan-day-head { font-size: 1.05rem; margin: 0 0 10px; }
.plan-slot + .plan-slot { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.plan-slot-label { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.plan-entry, .plan-pick-btn { display: flex; gap: 12px; align-items: center; min-width: 0; }
.plan-thumb { flex: 0 0 64px; width: 64px; height: 48px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; font-size: 1.4rem; }
.plan-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plan-entry-text { min-width: 0; display: flex; flex-direction: column; }
.plan-entry-text p { margin: 0; }
.plan-title { font-weight: 600; color: var(--text); line-height: 1.3; overflow-wrap: anywhere; }
.plan-tools { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.plan-empty { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-empty .plan-tools { margin-top: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 1rem; cursor: pointer; padding: 0; text-decoration: none; line-height: 1; }
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.icon-btn.is-on { border-color: var(--accent); background: var(--accent-soft); }
.plan-servings { margin-left: auto; }
.plan-servings input { width: 64px; padding: 6px 8px; text-align: center; }
.plan-clear { margin: 14px 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
#plan-einstellungen fieldset { border: 0; padding: 0; margin: 0 0 14px; }
#plan-einstellungen legend { font-weight: 700; margin-bottom: 6px; }
.plan-picks { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .plan-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan-pick { margin: 0; }
.plan-pick-btn { width: 100%; text-align: left; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.plan-pick-btn:hover { border-color: var(--accent); }
.plan-add { margin-top: 10px; }
.plan-add > summary { list-style: none; display: inline-flex; }
.plan-add > summary::-webkit-details-marker { display: none; }
.plan-add-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.plan-add-form label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; }
.plan-add-form select, .plan-add-form input { width: auto; }
.plan-add-form input[type=number] { width: 80px; }
.shop-list { list-style: none; padding: 8px 18px; }
.shop-list li { border-bottom: 1px solid var(--border); }
.shop-list li:last-child { border-bottom: 0; }
.shop-list label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 0; cursor: pointer; font-weight: 400; }
.shop-list input { width: auto; accent-color: var(--accent); transform: translateY(2px); }
.shop-amt { font-weight: 700; min-width: 5.5em; font-variant-numeric: tabular-nums; }
.shop-for { flex-basis: 100%; padding-left: 26px; margin-top: -4px; }
.shop-list input:checked ~ span { text-decoration: line-through; opacity: .5; }
@media print { .shop-list { box-shadow: none; border: 0; padding: 0; } .shop-for { display: none; } }
.plan-day.is-past.is-empty { padding: 10px 18px; }
.plan-day.is-past.is-empty .plan-day-head { margin: 0; font-size: .95rem; }
.plan-day.is-past.is-empty .plan-slot { display: none; }
.plan-day { scroll-margin-top: 140px; }

/* ---------- Statistik ---------- */
.stat-kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
@media (min-width: 720px) { .stat-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.stat-kpi { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; }
.stat-kpi-n { font-size: 1.8rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-grid .card { margin: 0; }
.stat-grid h2 { font-size: 1.1rem; }
.stat-bars { list-style: none; padding: 0; margin: 0 0 8px; }
.stat-bars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 5px 0; font-size: .92rem; }
.stat-bar-label { min-width: 0; overflow-wrap: anywhere; }
.stat-bar-n { font-variant-numeric: tabular-nums; color: var(--muted); }
.stat-bars progress { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden;
  -webkit-appearance: none; appearance: none; }
.stat-bars progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
.stat-bars progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.stat-bars progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.stat-chart { width: 100%; height: 160px; display: block; }
.stat-chart rect { fill: var(--accent); opacity: .85; }
.stat-chart rect:hover { opacity: 1; }
.stat-chart-month rect.src-matomo { fill: var(--muted); opacity: .6; }
.stat-chart-hours { height: 110px; }
.stat-chart-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stat-table th, .stat-table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.stat-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.stat-path { max-width: 280px; overflow-wrap: anywhere; }
.stat-privacy summary { cursor: pointer; }
.stat-quote { border-left: 3px solid var(--accent); margin: 8px 0 0; padding: 4px 0 4px 14px; color: var(--muted); }

/* Endloses Scrollen in Rezeptlisten */
.more-status { text-align: center; color: var(--muted); font-size: .9rem; min-height: 1.6em; margin: 18px 0 6px; }
.more-status + .btn { display: flex; margin: 0 auto 18px; }
.more-sentinel { height: 1px; }

/* ---------- Eigene Einkaufsliste ---------- */
.shop-page { max-width: 760px; margin: 0 auto; }
.shop-hero { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: end; padding: 20px 22px; }
.shop-hero h1 { margin: 0; }
.shop-hero .eyebrow { margin-bottom: .2em; }
.shop-hero-text p { margin: 2px 0 0; }
.shop-hero-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.shop-progress { grid-column: 1 / -1; order: 3; }
.shop-progress progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--surface-2); -webkit-appearance: none; appearance: none; display: block; }
.shop-progress progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
.shop-progress progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 99px; transition: width .3s; }
.shop-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.shop-recipes { grid-column: 1 / -1; order: 4; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.shop-chip { font-size: .8rem; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }

.shop-add { display: flex; gap: 8px; align-items: center; margin: 0 0 18px;
  padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); }
.shop-add:focus-within { border-color: var(--accent); }
.shop-add textarea { flex: 1; resize: none; border: 0; background: transparent; padding: 8px 0; min-height: 0; line-height: 1.4; overflow: hidden; box-shadow: none; outline: none; font-size: 1rem; }
.shop-add-btn { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); }
.shop-add-btn:hover { background: var(--accent-hover); }

.shop-group { padding: 6px 8px 4px; margin-bottom: 14px; }
.shop-group-head { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 8px 10px 2px; font-family: var(--font); }
.shop-group-icon { font-size: 1.1rem; filter: saturate(.9); }
.shop-group-n { margin-left: auto; font-weight: 600; background: var(--surface-2); border-radius: 99px; padding: 0 8px; font-size: .75rem; }

.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; border-top: 1px solid var(--border); transition: opacity .25s, transform .25s; }
.shop-group .shop-item:first-child { border-top: 0; }
.shop-item.is-leaving { opacity: 0; transform: translateX(20px); }
.shop-check-form { flex: 1; min-width: 0; margin: 0; }
.shop-check { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 8px 12px 10px; background: none; border: 0; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); -webkit-tap-highlight-color: transparent; }
.shop-check:hover { background: var(--surface-2); }
.shop-box { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent);
  display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s, transform .15s; }
.shop-check:hover .shop-box { border-color: var(--accent); }
.shop-check:active .shop-box { transform: scale(.9); }
.shop-item.is-done .shop-box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.shop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-name { font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; }
.shop-note { color: var(--muted); font-size: .85rem; }
.shop-item .shop-for { padding-left: 0; flex-basis: auto; color: var(--muted); font-size: .76rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-qty { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; padding-left: 8px; }
.shop-qty small { font-weight: 500; color: var(--muted); font-size: .85em; }
.shop-item.is-done .shop-name, .shop-item.is-done .shop-qty { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: .45; }
.shop-item.is-done .shop-for { opacity: .45; }
.shop-del-form { margin: 0; }
.shop-del { width: 34px; height: 34px; margin-right: 4px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center;
  cursor: pointer; opacity: .55; }
.shop-del:hover { opacity: 1; background: var(--surface-2); color: var(--danger); }

.shop-done { margin-top: 6px; }
.shop-done > summary { cursor: pointer; color: var(--muted); font-weight: 600; margin: 4px 4px 10px; list-style: none; }
.shop-done > summary::before { content: "▸ "; }
.shop-done[open] > summary::before { content: "▾ "; }
.shop-done .shop-items { padding: 4px 8px; }
.shop-clear { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 18px 0; }
.shop-empty-icon { font-size: 3rem; margin: 0; }
.shop-empty-actions { justify-content: center; }
@media (max-width: 560px) {
  .shop-hero { grid-template-columns: 1fr; }
  .shop-hero-actions { justify-content: flex-start; }

}
@media print {
  .shop-hero, .shop-group, .shop-items { box-shadow: none; border: 0; background: none; }
  .shop-del-form, .shop-for, .shop-recipes, .shop-progress { display: none !important; }
  .shop-box { border-color: #000; }
  .shop-group { break-inside: avoid; }
}

.icon-previews { position: relative; }
.icon-previews .favicon-preview { position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 6px;
  background: var(--surface-solid); padding: 2px; box-shadow: var(--shadow); }
.shop-group.is-complete .shop-group-head { opacity: .5; }
