/* =========================================================== Design-Tokens */
:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --surface-3: #e3e7e2;
  --text: #111814;
  --text-2: #4d5a52;
  --muted: #7a867f;
  --line: rgba(17, 24, 20, .08);
  --brand: #17824e;
  --brand-2: #0f6b3f;
  --brand-soft: #dff3e7;
  --on-brand: #ffffff;

  --ok: #15803d;   --ok-soft: #dcfce7;   --ok-line: #86efac;
  --warn: #b45309; --warn-soft: #fef3c7; --warn-line: #fcd34d;
  --bad: #c62828;  --bad-soft: #fee2e2;  --bad-line: #fca5a5;
  --unk: #475569;  --unk-soft: #e7ebf0;  --unk-line: #cbd5e1;
  --star: #f5a524;
  --tint: rgba(17, 24, 20, .06);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 20, .05), 0 2px 10px rgba(16, 24, 20, .04);
  --shadow-2: 0 2px 6px rgba(16, 24, 20, .06), 0 16px 40px rgba(16, 24, 20, .10);
  --blur-bg: rgba(245, 246, 243, .78);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabbar-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d110f;
    --surface: #161c19;
    --surface-2: #1e2622;
    --surface-3: #28322d;
    --text: #edf2ee;
    --text-2: #b6c2bb;
    --muted: #87948c;
    --line: rgba(255, 255, 255, .08);
    --brand: #34c27a;
    --brand-2: #4fd690;
    --brand-soft: #143322;
    --on-brand: #04140b;
    --ok: #4ade80;   --ok-soft: #10301e;  --ok-line: #1f6b3d;
    --warn: #fbbf24; --warn-soft: #36290a; --warn-line: #7a5a12;
    --bad: #f87171;  --bad-soft: #3a1515;  --bad-line: #7f2a2a;
    --unk: #a3b1c2;  --unk-soft: #1f2731;  --unk-line: #3b4757;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset;
    --shadow-2: 0 18px 50px rgba(0, 0, 0, .5);
    --blur-bg: rgba(13, 17, 15, .78);
    --tint: rgba(255, 255, 255, .08);
  }
}

/* =========================================================== Basis */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}
body.no-tabbar { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

main { max-width: 680px; margin: 0 auto; padding: 4px 16px 0; }
.view-enter { animation: view-in .32s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =========================================================== App-Leiste */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--blur-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar.overlay {
  position: fixed; inset: 0 0 auto; background: transparent; border-color: transparent;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.appbar.overlay.scrolled { background: var(--blur-bg); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom-color: var(--line); }
.appbar.overlay:not(.scrolled) .icon-btn { background: rgba(20, 24, 22, .38); color: #fff; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); width: 40px; height: 40px; margin: 2px; }
.appbar-title {
  font-weight: 650; font-size: 1.02rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s;
}
.appbar.title-hidden .appbar-title { opacity: 0; }
.appbar-actions { display: flex; justify-content: flex-end; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--text);
  transition: background .15s, transform .15s, color .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.star-on { color: var(--star) !important; }
.icon-btn.star-on svg path { fill: currentColor; }

/* =========================================================== Große Titel */
.large-title { padding: 4px 4px 14px; }
.large-title h1 { margin: 0; font-size: 2.1rem; line-height: 1.1; font-weight: 800; letter-spacing: -.025em; }
.large-title p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.large-title .warn-count { color: var(--warn); font-weight: 650; }

/* =========================================================== Suche + Filter */
.search { position: relative; margin-bottom: 12px; }
.search input {
  width: 100%; height: 46px; padding: 0 44px; border: 0; border-radius: var(--r-md);
  background: var(--surface-2); font-size: 16px; appearance: none;
  transition: background .15s, box-shadow .15s;
}
.search input:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--brand); }
.search input::-webkit-search-cancel-button { display: none; }
.search .s-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .s-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; color: var(--muted); }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px 16px; padding: 2px 16px 4px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: .9rem; font-weight: 550; box-shadow: var(--shadow-1);
  transition: background .15s, color .15s, transform .15s;
}
.chip:active { transform: scale(.96); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 650; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.chip.cat.active { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* =========================================================== Produktkarten */
.list { display: grid; gap: 12px; }
.card {
  position: relative; background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); border: 1px solid var(--line); overflow: hidden;
  animation: view-in .35s var(--ease) both;
}
.card-link { display: flex; gap: 14px; align-items: center; padding: 12px 52px 12px 12px; text-decoration: none; min-width: 0; transition: background .15s; }
.card-link:active { background: var(--surface-2); }
.thumb { width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden; flex: none; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { min-width: 0; flex: 1; display: grid; gap: 2px; }
.card-body h3 { margin: 0; font-size: 1.02rem; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body .meta { margin: 0; color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body .pill { justify-self: start; margin-top: 6px; }
.fav-btn { position: absolute; top: 4px; right: 4px; color: var(--muted); }
.fav-btn svg path { fill: none; }
.fav-btn.on { color: var(--star); }
.fav-btn.on svg path { fill: currentColor; }
.pop svg { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }

.card.outdated { border-color: var(--warn-line); }
.card-warn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px;
  background: var(--warn-soft); color: var(--warn); font-size: .84rem; line-height: 1.3;
}
.card-warn .txt { flex: 1; }
.card-warn b { display: block; font-weight: 700; }
.card-warn small { display: block; font-size: .8rem; opacity: .9; }

/* Bewertungs-Pillen */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px 0 7px; border-radius: 999px;
  font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.pill .spinner { width: 13px; height: 13px; border-width: 2px; }
.v-glutenfrei { color: var(--ok); background: var(--ok-soft); }
.v-spuren { color: var(--warn); background: var(--warn-soft); }
.v-enthaelt_gluten { color: var(--bad); background: var(--bad-soft); }
.v-unklar, .v-error, .v-pending { color: var(--unk); background: var(--unk-soft); }
.dot.v-glutenfrei { background: var(--ok); }
.dot.v-spuren { background: var(--warn); }
.dot.v-enthaelt_gluten { background: var(--bad); }
.dot.v-unklar { background: var(--unk); }
.dot.v-outdated { background: var(--warn); }

/* Skeleton */
.skeleton { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Leere Zustände */
.empty { text-align: center; padding: 40px 24px 24px; color: var(--muted); animation: view-in .35s var(--ease) both; }
.empty .ill { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 30px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty h2 { margin: 0 0 6px; color: var(--text); font-size: 1.25rem; letter-spacing: -.01em; }
.empty p { margin: 0 auto 22px; max-width: 300px; }
.empty .btn { display: inline-flex; width: auto; padding: 0 22px; }

/* =========================================================== Tab-Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 0 12px env(safe-area-inset-bottom);
  background: var(--blur-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
  transition: color .15s;
}
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .tab-icon svg path { fill: currentColor; fill-opacity: .2; }
.scan-btn {
  width: 58px; height: 58px; margin-top: -24px; border-radius: 20px;
  display: grid; place-items: center; color: var(--on-brand);
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent);
  transition: transform .15s;
}
.tab-scan:active .scan-btn { transform: scale(.92); }

/* =========================================================== Buttons + Formulare */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 52px; padding: 0 18px; border-radius: var(--r-md); border: 0;
  background: var(--brand); color: var(--on-brand); font-weight: 650; font-size: 1rem; text-decoration: none;
  transition: transform .15s, opacity .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; transform: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.sm { height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; width: auto; flex: none; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--text-2); margin: 0 0 6px 2px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 16px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =========================================================== Neues Produkt */
.steps { display: grid; gap: 12px; margin-bottom: 16px; }
.capture {
  position: relative; display: flex; align-items: center; gap: 16px;
  min-height: 116px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px dashed var(--surface-3);
  cursor: pointer; overflow: hidden; transition: border-color .2s, transform .15s, background .2s;
}
.capture:active { transform: scale(.99); }
.capture input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.capture .cap-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.capture .cap-text { flex: 1; min-width: 0; }
.cap-step { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.capture h3 { margin: 2px 0; font-size: 1.08rem; letter-spacing: -.01em; }
.capture p { margin: 0; color: var(--muted); font-size: .86rem; }
.capture .cap-preview { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex: none; display: none; }
.capture.filled { border-style: solid; border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 40%, var(--surface)); }
.capture.filled .cap-icon { display: none; }
.capture.filled .cap-preview { display: block; animation: pop .35s var(--ease); }
.capture .cap-done { display: none; color: var(--brand); font-weight: 650; font-size: .86rem; align-items: center; gap: 4px; }
.capture.filled .cap-done { display: inline-flex; }
.capture.filled .cap-hint { display: none; }

details.more { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--line); margin-bottom: 12px; }
details.more summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 15px 16px; font-weight: 600; cursor: pointer;
}
details.more summary small { color: var(--muted); font-weight: 400; margin-left: auto; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary .chev { transition: transform .2s; color: var(--muted); }
details.more[open] summary .chev { transform: rotate(180deg); }
details.more .more-body { padding: 2px 16px 4px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: .86rem; margin-bottom: 12px; }
.tip svg { color: var(--brand); margin-top: 1px; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--blur-bg);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.bottom-bar-inner { max-width: 648px; margin: 0 auto; display: flex; gap: 10px; }
.bottom-bar .btn { flex: 1; }
.icon-square { width: 52px; height: 52px; flex: none; border-radius: var(--r-md); border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--text); transition: transform .15s; }
.icon-square:active { transform: scale(.95); }

/* =========================================================== Detailseite */
.hero {
  position: relative; margin: 0 -16px; height: min(50vh, 400px);
  background: var(--surface-2); overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(to top, var(--bg), transparent); pointer-events: none; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 120px; background: linear-gradient(to bottom, rgba(0,0,0,.3), transparent); pointer-events: none; z-index: 1; }
body.detail main { padding-top: 0; }

.detail-body { position: relative; margin-top: -72px; z-index: 2; }
.verdict-card {
  border-radius: var(--r-xl); padding: 18px; box-shadow: var(--shadow-2);
  background: var(--surface); border: 1px solid var(--line);
  animation: view-in .4s var(--ease) both;
}
.verdict-head { display: flex; align-items: center; gap: 14px; }
.verdict-icon { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; flex: none; color: #fff; background: var(--unk); }
.verdict-label { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.verdict-sub { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.verdict-card p.expl { margin: 14px 0 0; color: var(--text-2); font-size: .95rem; }
.verdict-card.v-glutenfrei { background: linear-gradient(180deg, var(--ok-soft), var(--surface) 75%); color: var(--text); }
.verdict-card.v-spuren { background: linear-gradient(180deg, var(--warn-soft), var(--surface) 75%); color: var(--text); }
.verdict-card.v-enthaelt_gluten { background: linear-gradient(180deg, var(--bad-soft), var(--surface) 75%); color: var(--text); }
.verdict-card.v-unklar, .verdict-card.v-error, .verdict-card.v-pending { background: linear-gradient(180deg, var(--unk-soft), var(--surface) 75%); color: var(--text); }
.verdict-card.v-glutenfrei .verdict-icon { background: var(--ok); }
.verdict-card.v-spuren .verdict-icon { background: var(--warn); }
.verdict-card.v-enthaelt_gluten .verdict-icon { background: var(--bad); }
.verdict-card.v-glutenfrei .verdict-label { color: var(--ok); }
.verdict-card.v-spuren .verdict-label { color: var(--warn); }
.verdict-card.v-enthaelt_gluten .verdict-label { color: var(--bad); }
@media (prefers-color-scheme: dark) { .verdict-icon { color: #0d110f; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.verdict-card .tag { background: var(--tint); }

/* Analyse läuft */
.verdict-card.analyzing .verdict-icon { background: var(--brand); position: relative; }
.analyzing .verdict-icon::before, .analyzing .verdict-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: 17px; border: 2px solid var(--brand);
  animation: ripple 1.8s var(--ease) infinite;
}
.analyzing .verdict-icon::after { animation-delay: .9s; }
@keyframes ripple { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 16px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--brand); animation: indet 1.4s var(--ease) infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.product-title { padding: 22px 4px 4px; }
.product-title .eyebrow { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); }
.product-title h1 { margin: 2px 0 4px; font-size: 1.8rem; line-height: 1.15; font-weight: 800; letter-spacing: -.025em; }
.product-title .sub { margin: 0; color: var(--muted); }
.product-title h1.placeholder { color: var(--muted); font-weight: 700; }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-lg);
  margin: 14px 0; font-size: .9rem; line-height: 1.4; animation: view-in .35s var(--ease) both;
}
.banner .b-body { flex: 1; }
.banner b { display: block; margin-bottom: 2px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.info { background: var(--unk-soft); color: var(--text-2); }
.banner .btn { margin-top: 10px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; padding: 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact dt { font-size: .72rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.fact dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.section h2 { margin: 0 0 12px; font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.issue { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.issue:first-of-type { border-top: 0; padding-top: 0; }
.issue:last-child { padding-bottom: 0; }
.issue .i-dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.issue b { display: block; }
.issue span { color: var(--text-2); font-size: .9rem; }
.ingredients { white-space: pre-wrap; font-size: .93rem; color: var(--text-2); margin: 0; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); cursor: zoom-in; background: var(--surface-2); display: block; }
.photos figcaption { font-size: .78rem; color: var(--muted); margin-top: 6px; text-align: center; }
.note { white-space: pre-wrap; margin: 0; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; margin: 20px 8px 8px; }

/* =========================================================== Bottom-Sheet */
dialog.sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 92dvh;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); border: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-2); overflow: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-in .36s var(--ease) both; }
dialog.sheet.closing { animation: sheet-out .22s ease-in both; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .3s both; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.grabber { width: 40px; height: 5px; border-radius: 999px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 1.3rem; letter-spacing: -.015em; }
.sheet .sheet-sub { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.menu { display: grid; gap: 2px; margin: 4px 0 12px; }
.menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border: 0; border-radius: var(--r-md);
  background: transparent; text-align: left; font-size: 1rem; font-weight: 600;
}
.menu button:active { background: var(--surface-2); }
.menu button:disabled { opacity: .4; }
.menu .m-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.menu small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.menu .danger { color: var(--bad); }
.menu .danger .m-icon { background: var(--bad-soft); color: var(--bad); }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.choice label { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 12px; line-height: 1.25; border-radius: var(--r-md);
  border: 2px solid transparent; font-weight: 650; font-size: .9rem; cursor: pointer;
}
.choice .c-auto { grid-column: 1 / -1; }
.choice .c-auto span { background: var(--surface-2); color: var(--text-2); }
.choice input:checked + span { border-color: currentColor; }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.sheet-actions { display: grid; gap: 10px; margin-top: 8px; }
.cat-list { display: grid; gap: 2px; margin-bottom: 12px; }
.cat-list button { display: flex; justify-content: space-between; align-items: center; padding: 13px 12px; border: 0; border-radius: var(--r-md); background: transparent; text-align: left; font-size: 1rem; }
.cat-list button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }

/* =========================================================== Login */
.login { max-width: 380px; margin: 10vh auto 0; text-align: center; animation: view-in .4s var(--ease) both; }
.login .logo { width: 88px; height: 88px; border-radius: 24px; box-shadow: var(--shadow-2); margin: 0 auto 20px; display: block; }
.login h1 { margin: 0 0 6px; font-size: 1.9rem; letter-spacing: -.025em; }
.login p { margin: 0 0 26px; color: var(--muted); }
.login .field { text-align: left; }

/* =========================================================== Lightbox + Toast */
dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; }
dialog#lightbox::backdrop { background: rgba(0, 0, 0, .92); }
dialog#lightbox img { max-width: 100vw; max-height: 100dvh; display: block; }
dialog#lightbox .close {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center;
  color: #fff; background: rgba(255, 255, 255, .18);
}

#toast {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); z-index: 50;
  transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 16px; width: max-content; max-width: min(92vw, 420px);
  background: var(--text); color: var(--bg); font-size: .92rem; font-weight: 600; box-shadow: var(--shadow-2);
  animation: toast-in .3s var(--ease) both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  .hero { margin: 0; border-radius: 0 0 var(--r-xl) var(--r-xl); }
}

/* =========================================================== Fotoauswahl mit Qualitätscheck */
.picker {
  padding: 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--brand-soft) 35%, var(--surface));
  border: 1.5px solid var(--brand); animation: view-in .3s var(--ease) both;
}
.picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.picker-head h3 { margin: 2px 0 0; font-size: 1.08rem; letter-spacing: -.01em; }
.picker .cap-done { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 650; font-size: .86rem; white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ph { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.warn { outline: 2.5px solid var(--warn); outline-offset: -2.5px; }
.ph-x {
  position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .5);
}
.ph-badge {
  position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff;
}
.ph-badge .spinner { width: 13px; height: 13px; border-width: 2px; }
.ph-badge.ok { background: var(--ok); }
.ph-badge.warn { background: var(--warn); }
.ph.add {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--surface-3); background: var(--surface); color: var(--brand); font-size: .78rem; font-weight: 650;
  cursor: pointer; text-align: center; padding: 4px;
}
.ph.add input, .file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.picker-hint { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
.q-warn {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--warn-soft); color: var(--warn); font-size: .84rem; line-height: 1.35;
}
.q-text { flex: 1; }
.q-text b { display: block; }
.file-btn { position: relative; overflow: hidden; }
.file-btn.busy { opacity: .6; pointer-events: none; }
.steps .capture h3 { margin: 2px 0; }

/* =========================================================== Barcode-Scanner */
body.scan-mode main { max-width: 560px; }
.scanner { display: grid; gap: 14px; }
.scan-stage {
  position: relative; aspect-ratio: 3 / 4; max-height: 62dvh; width: 100%; border-radius: var(--r-xl);
  overflow: hidden; background: #000; box-shadow: var(--shadow-2);
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; left: 10%; right: 10%; top: 25%; bottom: 25%; border-radius: 20px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); border: 2.5px solid rgba(255, 255, 255, .9);
}
.scan-line {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 2.5px; border-radius: 2px;
  background: #ff4d4d; box-shadow: 0 0 12px #ff4d4d; animation: scanline 2s ease-in-out infinite;
}
@keyframes scanline { 0%, 100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
.scan-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; text-align: center; color: #fff;
  font-weight: 600; font-size: .92rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.scan-stage .torch { position: absolute; top: 12px; right: 12px; }
.scan-stage .torch.on { background: #fff; color: #111; }
.scan-fallback { text-align: center; padding: 24px 12px 8px; }
.scan-fallback .ill { width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.scan-fallback h2 { margin: 0 0 6px; font-size: 1.25rem; }
.scan-fallback p { margin: 0 auto; max-width: 340px; color: var(--muted); }
.scan-actions { display: grid; gap: 10px; }
.scan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lookup { display: flex; align-items: center; gap: 14px; padding: 10px 4px 14px; }
.lookup .spinner { width: 26px; height: 26px; color: var(--brand); }
.lookup b { display: block; font-size: 1.05rem; }
.lookup small { color: var(--muted); }
.form-error { color: var(--bad); font-size: .88rem; margin: -6px 0 12px 2px; }

.scan-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow-1);
}
.scan-link > svg:first-child { color: var(--brand); }
.scan-link span { flex: 1; }
.scan-link b { display: block; font-size: .95rem; }
.scan-link small { color: var(--muted); font-size: .82rem; }
.scan-link > svg:last-child { transform: rotate(180deg); color: var(--muted); }

/* =========================================================== Open Food Facts */
.off-card {
  display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 10px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); animation: view-in .3s var(--ease) both;
}
.off-img { width: 76px; height: 76px; border-radius: var(--r-md); object-fit: contain; background: #fff; flex: none; }
.off-icon { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.off-body { min-width: 0; display: grid; gap: 2px; }
.off-body .eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.off-body b { font-size: 1.02rem; }
.off-body small { color: var(--muted); }
.off-body .pill { justify-self: start; margin-top: 6px; white-space: normal; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; }
.off-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 2px 16px; color: var(--muted); font-size: .82rem; }
.off-note svg { margin-top: 2px; }
.section .pill { white-space: normal; height: auto; min-height: 26px; padding-top: 3px; padding-bottom: 3px; }
.mini-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 0; font-size: .9rem; }
.mini-facts dt { color: var(--muted); }
.mini-facts dd { margin: 0; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--brand); font-weight: 600; font-size: .9rem; text-decoration: none; }
.muted-text { margin: 0; color: var(--muted); font-size: .9rem; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }

/* =========================================================== Offline-Warteschlange */
.queue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.queue-head { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .9rem; margin: 0 2px 8px; }
.queue-head span { margin-left: auto; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.q-item:first-of-type { border-top: 0; }
.q-item img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }
.q-body { flex: 1; min-width: 0; }
.q-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-body small { color: var(--muted); }
#offline-bar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  width: max-content; max-width: min(92vw, 440px); padding: 9px 14px; border-radius: 999px;
  background: var(--unk); color: #fff; font-size: .82rem; font-weight: 600; box-shadow: var(--shadow-2); text-align: center;
}
body.no-tabbar #offline-bar { bottom: calc(92px + env(safe-area-inset-bottom)); }

/* =========================================================== Tab-Leiste: Badge */
.tab-icon { position: relative; display: grid; place-items: center; }
.tab-badge {
  position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.tab { font-size: .68rem; }
.scan-btn { width: 54px; height: 54px; border-radius: 18px; }

/* =========================================================== Läden-Auswahl */
.store-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.store-chips:empty { display: none; }
.store-chips .chip { box-shadow: none; }
.store-chips .chip.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); font-weight: 650; }
.store-add { display: flex; gap: 8px; }
.store-add input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); font-size: 16px;
}
.store-add input:focus { outline: none; background: var(--surface); border-color: var(--brand); }
.icon-square.sm { width: 44px; height: 44px; }
.icon-square.on { background: var(--brand-soft); color: var(--brand); }

/* =========================================================== Einkaufsliste */
.shop-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 12px; margin-bottom: 12px; box-shadow: var(--shadow-1); animation: view-in .3s var(--ease) both; }
.shop-group h2 { display: flex; align-items: center; gap: 6px; margin: 8px 2px 4px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shop-group h2 span { margin-left: auto; font-variant-numeric: tabular-nums; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.shop-group h2 + .shop-item { border-top: 0; }
.check {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--surface-3); background: transparent;
  display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s, transform .15s;
}
.check:active { transform: scale(.9); }
.shop-item.done .check, .fav-row input:checked + .check { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.shop-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.shop-main img, .fav-row img, .shared-row img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
.shop-text { min-width: 0; display: grid; gap: 1px; justify-items: start; }
.shop-text b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.shop-text small { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pill.sm { height: 22px; font-size: .72rem; padding: 0 8px 0 6px; margin-top: 3px; }
.shop-item.done .shop-text b { text-decoration: line-through; color: var(--muted); }
.shop-item.done img { opacity: .5; }
.done-group { background: transparent; box-shadow: none; }
.all-done { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: var(--ok); font-weight: 650; }
.shop-actions { display: grid; gap: 10px; margin-top: 4px; }
.fav-pick { display: grid; gap: 2px; margin-bottom: 12px; }
.fav-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-radius: var(--r-md); cursor: pointer; }
.fav-row input { position: absolute; opacity: 0; pointer-events: none; }
.fav-row input:focus-visible + .check { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.fav-row.disabled { opacity: .55; cursor: default; }
.fav-row.disabled .check { background: var(--surface-3); border-color: var(--surface-3); color: var(--muted); }

/* =========================================================== Teilen & Export */
.export-card h2, .section h2 svg { display: inline-flex; vertical-align: -3px; }
.section h2 { display: flex; align-items: center; gap: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 4px; border-radius: 10px; font-weight: 600; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.switch-row { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; cursor: pointer; }
.switch-row > span:first-child { flex: 1; }
.switch-row b { display: block; font-weight: 600; }
.switch-row small { color: var(--muted); font-size: .84rem; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch-row input:checked + .switch { background: var(--brand); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.export-count { margin: 0 0 12px; color: var(--muted); font-size: .88rem; }
.export-buttons { display: grid; gap: 10px; }
.shared-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.shared-row:first-child { border-top: 0; padding-top: 0; }
.shared-row .shop-text { flex: 1; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--r-md); background: var(--surface-2); margin-bottom: 12px; }
.link-box span { flex: 1; min-width: 0; font-size: .86rem; overflow-wrap: anywhere; color: var(--text-2); }
.hint-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: .84rem; }
.hint-warn svg { margin-top: 2px; }
.sheet-actions a.btn { text-decoration: none; }

/* =========================================================== Bild-Editor (zuschneiden, ausrichten) */
dialog.editor {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: #0b0d0c; color: #fff;
  display: none; flex-direction: column;
}
dialog.editor[open] { display: flex; animation: fade .2s both; }
dialog.editor::backdrop { background: #0b0d0c; }
.ed-top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
}
.ed-top b { font-size: 1rem; font-weight: 650; text-align: center; }
.ed-txt { background: none; border: 0; color: #fff; font-size: 1rem; padding: 10px 12px; justify-self: start; }
.ed-txt.strong { justify-self: end; color: #4fd690; font-weight: 700; }
.ed-txt:disabled { opacity: .5; }
.ed-stage { flex: 1; min-height: 0; position: relative; margin: 0 8px; }
.ed-stage img { display: block; max-width: 100%; }
.ed-hint { margin: 10px 16px 4px; text-align: center; font-size: .84rem; color: rgba(255, 255, 255, .7); }
.ed-tools { padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.ed-rotate { display: grid; grid-template-columns: auto 1fr auto 52px; align-items: center; gap: 10px; }
.ed-rotate label { display: grid; gap: 4px; }
.ed-rotate label span { font-size: .75rem; color: rgba(255, 255, 255, .65); text-align: center; }
.ed-rotate input[type="range"] { width: 100%; accent-color: #4fd690; height: 32px; }
.ed-rotate output { font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }
.ed-step { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .12); }
.ed-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-buttons button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 14px;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: .78rem; font-weight: 600;
}
.ed-buttons button:active, .ed-step:active { background: rgba(255, 255, 255, .2); }
/* Zuschneide-Rahmen gut sichtbar und mit großen Anfassern für Finger */
.editor .cropper-view-box { outline: 2px solid #fff; outline-color: rgba(255, 255, 255, .95); }
.editor .cropper-line { background-color: #fff; opacity: .15; }
.editor .cropper-point { background-color: #fff; opacity: 1; width: 14px; height: 14px; border-radius: 50%; }
.editor .cropper-point.point-se { width: 14px; height: 14px; }
.editor .cropper-point.point-n, .editor .cropper-point.point-s, .editor .cropper-point.point-e, .editor .cropper-point.point-w { opacity: .9; }
.editor .cropper-dashed { border-color: rgba(255, 255, 255, .55); }
.editor .cropper-modal { background-color: #000; opacity: .55; }

/* Vorschaubilder: antippen zum Bearbeiten */
.ph-edit { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.ph-edit img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-edit:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.ph-pen {
  position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; pointer-events: none;
}
.cap-src { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--brand); font-size: .78rem; font-weight: 600; }
.cap-src svg { display: inline-block; }
.q-warn .btn.sm { flex: none; }
.q-warn { flex-wrap: wrap; }
.q-text { flex: 1 1 60%; }

/* =========================================================== Mehr (Sammelstelle) */
.hub { display: grid; gap: 10px; margin-bottom: 16px; }
.hub-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  text-decoration: none; color: var(--text); animation: view-in .3s var(--ease) both;
}
.hub-item:active { background: var(--surface-2); }
.hub-item > svg:last-child { color: var(--muted); }
.hub-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.hub-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hub-text b { font-weight: 650; }
.hub-text small { color: var(--muted); font-size: .84rem; line-height: 1.35; }
.hub-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .78rem; font-weight: 700; display: grid; place-items: center; }

/* =========================================================== Rückrufe */
.group-title { margin: 20px 4px 10px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.group-title small { font-weight: 600; text-transform: none; letter-spacing: 0; }
.recall-card { background: var(--surface); border: 1.5px solid var(--bad-line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; animation: view-in .3s var(--ease) both; }
.recall-card.plain { border-color: var(--line); }
.recall-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.recall-head img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.recall-head div { display: grid; gap: 3px; justify-items: start; }
.recall-head small { color: var(--muted); font-size: .8rem; }
.recall-title { margin: 0 0 6px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.recall-title svg { align-self: center; color: var(--bad); }
.recall-details { margin: 6px 0 0; font-size: .9rem; color: var(--text-2); }
.recall-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.recall-actions .btn.sm { text-decoration: none; }
.ok-box { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.pad { padding: 4px 4px 12px; }
.link-banner { text-decoration: none; align-items: center; }
.link-banner > svg:last-child { flex: none; }
.card.recalled { border-color: var(--bad-line); }
.card .pill + .pill { margin-left: 6px; }
.banner .rc-line { display: block; margin-top: 4px; }
.banner .recall-actions { margin-top: 8px; }
.banner.bad .btn.secondary { background: color-mix(in srgb, var(--surface) 80%, transparent); }

/* =========================================================== Speisekarten-Check */
.menu-summary { display: flex; gap: 10px; align-items: flex-start; }
.menu-summary svg { color: var(--brand); margin-top: 3px; }
.menu-summary p { margin: 0; }
.dish { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 10px; display: grid; gap: 4px; justify-items: start; animation: view-in .3s var(--ease) both; }
.dish b { font-size: 1.02rem; margin-top: 4px; }
.dish .orig { color: var(--muted); font-style: italic; }
.dish p { margin: 2px 0 0; color: var(--text-2); font-size: .92rem; }
.dish .mod { display: flex; gap: 6px; align-items: flex-start; color: var(--brand); font-weight: 600; }
.dish .mod svg { margin-top: 2px; }
.dish .ask { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; color: var(--text-2); }
.staff-q { padding: 10px 0; border-top: 1px solid var(--line); }
.staff-q:first-of-type { border-top: 0; padding-top: 0; }
.q-local { margin: 0; font-size: 1.1rem; font-weight: 650; }
.q-de { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.link-row { text-decoration: none; color: inherit; }
.link-row > svg { color: var(--muted); flex: none; }

/* =========================================================== Zöliakie-Karte */
.travel-card {
  background: #fff; color: #111814; border-radius: var(--r-xl); padding: 22px 20px; margin-bottom: 14px;
  border-top: 8px solid #17824e; box-shadow: var(--shadow-2); animation: view-in .3s var(--ease) both;
}
.travel-card.plain { box-shadow: none; border-top: 0; padding: 0; background: transparent; color: var(--text); margin: 0; animation: none; }
.travel-card .tc-eyebrow { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #17824e; }
.travel-card h2 { margin: 0 0 10px; font-size: 1.75rem; line-height: 1.15; letter-spacing: -.02em; }
.travel-card.plain h2 { font-size: 1.2rem; }
.travel-card .tc-intro { font-size: 1.08rem; font-weight: 500; }
.travel-card h3 { margin: 16px 0 4px; font-size: 1.02rem; padding-left: 10px; border-left: 4px solid currentColor; }
.travel-card p { margin: 0; line-height: 1.5; }
.tc-bad { color: #c62828; }
.tc-warn { color: #b45309; }
.tc-ok { color: #15803d; }
.travel-card.plain .tc-bad { color: var(--bad); }
.travel-card.plain .tc-warn { color: var(--warn); }
.travel-card.plain .tc-ok { color: var(--ok); }
.travel-card .tc-thanks { margin-top: 16px; font-weight: 800; color: #17824e; font-size: 1.1rem; }
.travel-card.big { font-size: 1.15rem; box-shadow: none; margin: 0; min-height: 100%; border-radius: 0; }
.travel-card.big h2 { font-size: 2.2rem; }
dialog.tc-full { position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: calc(16px + env(safe-area-inset-top)) 0 env(safe-area-inset-bottom); border: 0; background: #fff; overflow: auto; }
dialog.tc-full::backdrop { background: #fff; }
.tc-close { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #eef0ec; color: #111814; display: grid; place-items: center; z-index: 2; }
.tc-preview { width: 100%; max-height: 50dvh; object-fit: contain; border-radius: var(--r-md); border: 1px solid var(--line); margin-bottom: 12px; background: #fff; }
.btn-row { display: grid; gap: 10px; margin-top: 4px; }

/* =========================================================== Rezeptur-Verlauf */
.hist-item { border-top: 1px solid var(--line); padding: 10px 0; }
.hist-item:first-of-type { border-top: 0; padding-top: 0; }
.hist-item.now { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hist-item summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.hist-item summary::-webkit-details-marker { display: none; }
.hist-item summary svg:last-child { margin-left: auto; color: var(--muted); transition: transform .2s; }
.hist-item[open] summary svg:last-child { transform: rotate(180deg); }
.hist-date { font-weight: 600; font-size: .92rem; }
.hist-changes { margin: 8px 0 6px; font-size: .88rem; color: var(--text-2); }
.chg { display: block; font-weight: 600; }
.chg.add { color: var(--bad); }
.chg.del { color: var(--ok); }
.banner .chg { margin-top: 2px; }

/* =========================================================== Scan-Modus-Umschalter + Regal-Modus */
.scan-mode-bar { display: grid; gap: 8px; margin-bottom: 14px; }
.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; cursor: pointer;
}
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg-btn:disabled { opacity: .45; cursor: not-allowed; }
.seg-hint { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: .85rem; }

.shelf .scan-stage { aspect-ratio: auto; height: 45dvh; min-height: 340px; max-height: 480px; }
.shelf .scan-frame { top: 20%; bottom: 31%; transition: border-color .15s; }
.shelf .scan-hint { top: 10px; bottom: auto; left: 56px; right: 56px; font-size: .85rem; }
.shelf .scan-line { top: 44%; }
.scan-stage .sound { position: absolute; top: 12px; left: 12px; }
.scan-stage .sound.on { background: #fff; color: #111; }
.scan-frame.flash-ok { border-color: var(--ok-line); animation: frame-flash .3s ease-out; --flash: var(--ok); }
.scan-frame.flash-warn { border-color: var(--warn-line); animation: frame-flash .3s ease-out; --flash: var(--warn); }
.scan-frame.flash-bad { border-color: var(--bad-line); animation: frame-flash .3s ease-out; --flash: var(--bad); }
.scan-frame.flash-unk { border-color: var(--unk-line); animation: frame-flash .3s ease-out; --flash: var(--unk); }
@keyframes frame-flash {
  0% { box-shadow: 0 0 0 999px rgba(0, 0, 0, .45), inset 0 0 0 6px var(--flash); }
  100% { box-shadow: 0 0 0 999px rgba(0, 0, 0, .45), inset 0 0 0 0 var(--flash); }
}
@media (prefers-reduced-motion: reduce) {
  .scan-frame[class*="flash-"] { animation: none; border-color: rgba(255, 255, 255, .9); }
}
.shelf-paused {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; border: 0;
  background: rgba(0, 0, 0, .72); color: #fff; font: inherit; cursor: pointer; z-index: 3;
}
.shelf-card-slot { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; }
.shelf-card {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); border: 2px solid var(--line);
  border-left-width: 6px; animation: view-in .2s var(--ease) both;
}
.shelf-card.t-ok { border-left-color: var(--ok); }
.shelf-card.t-warn { border-left-color: var(--warn); }
.shelf-card.t-bad { border-left-color: var(--bad); }
.shelf-card.t-unk { border-left-color: var(--unk); }
.shelf-card.recall { border-color: var(--bad); }
.shelf-card-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-height: 44px; }
.shelf-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.shelf-thumb.ph { display: grid; place-items: center; color: var(--muted); }
.shelf-card-text { flex: 1; min-width: 0; display: grid; }
.shelf-card-text b, .shelf-card-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-card-text small { color: var(--text-2); font-size: .78rem; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.shelf-verdict { display: grid; justify-items: center; gap: 1px; flex: none; width: 74px; text-align: center; font-weight: 700; font-size: .78rem; line-height: 1.15; }
.shelf-card.t-ok .shelf-verdict { color: var(--ok); }
.shelf-card.t-warn .shelf-verdict { color: var(--warn); }
.shelf-card.t-bad .shelf-verdict { color: var(--bad); }
.shelf-card.t-unk .shelf-verdict { color: var(--unk); }
.shelf-marks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.shelf-mark { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; white-space: nowrap; border-radius: 6px; font-size: .7rem; font-weight: 700; }
.shelf-mark.t-bad { color: var(--bad); background: var(--bad-soft); }
.shelf-mark.t-warn { color: var(--warn); background: var(--warn-soft); }
.shelf-mark.t-unk { color: var(--unk); background: var(--unk-soft); }
.shelf-cart {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
}
.shelf-cart.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.shelf-card .btn.sm { min-height: 44px; }
.shelf-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; color: var(--warn); font-size: .85rem; font-weight: 600; }
.shelf-round-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 8px; }
.shelf-round-head h2 { margin: 0; font-size: 1.05rem; }
.shelf-round-head .btn.sm { min-height: 44px; }
.shelf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shelf-empty { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: var(--r-lg); background: var(--surface); color: var(--muted); border: 1px dashed var(--line); }
.shelf-row { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.shelf-row.recall { border-color: var(--bad); }
.shelf-row > a, .shelf-row-static { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; color: inherit; text-decoration: none; }
.shelf-row > a > svg:last-child { color: var(--muted); flex: none; }
.shelf-row-text { flex: 1; min-width: 0; display: grid; }
.shelf-row-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-row-text small { color: var(--text-2); font-size: .8rem; }
.shelf-row-text .shelf-mark { justify-self: start; margin-top: 3px; }
.shelf-row time { color: var(--muted); font-size: .8rem; flex: none; font-variant-numeric: tabular-nums; }
.shelf-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.shelf-dot.t-ok { background: var(--ok); }
.shelf-dot.t-warn { background: var(--warn); }
.shelf-dot.t-bad { background: var(--bad); }
.shelf-dot.t-unk { background: var(--unk); }
.shelf-row-actions { display: flex; gap: 8px; padding: 0 12px 10px 52px; }
.shelf-row-actions .btn.sm { min-height: 44px; }
