/* PlanetCareScan Oberfläche v2
   Prinzip: Kamera zuerst, eine Antwort, Fakten mit Quelle, nichts gesperrt.
   Farben tragen Bedeutung nur zusammen mit Symbol und Wort. */

:root {
  --linen: #f4f1e8;
  --paper: #fffdf8;
  --ink: #17231c;
  --ink-2: #4b5a51;
  --ink-3: #737d76;
  --rule: #e2ddd0;
  --moss: #2d6a4f;
  --moss-ink: #ffffff;
  --moss-soft: #e1ede5;

  --yes: #1f7a45;   --yes-bg: #e2f0e6;
  --no: #b5462f;    --no-bg: #f7e3dd;
  --mid: #95600c;   --mid-bg: #f5e9cf;
  --unk: #5f6862;   --unk-bg: #ebe9e2;

  --stage: #0f1712;
  --on-stage: #f2f5f0;

  --serif: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --linen: #121813;
    --paper: #1a221c;
    --ink: #eaefe9;
    --ink-2: #b7c2ba;
    --ink-3: #8c978f;
    --rule: #2b352e;
    --moss: #6fbf93;
    --moss-ink: #0f1712;
    --moss-soft: #1f3328;
    --yes: #7fd0a0;  --yes-bg: #1c3427;
    --no: #f0957f;   --no-bg: #3a221c;
    --mid: #e6b45c;  --mid-bg: #352a14;
    --unk: #aab3ad;  --unk-bg: #262d28;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--linen);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--moss); }
svg { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 3px solid var(--moss); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Ansichten ---------- */
.view { position: fixed; inset: 0 0 calc(var(--tab-h) + var(--safe-b)) 0; display: none; }
.view.is-active { display: block; }
.view-page { overflow-y: auto; padding: calc(var(--safe-t) + 8px) 20px 32px; -webkit-overflow-scrolling: touch; }
.page-head h1 { font: 700 30px/1.15 var(--serif); margin: 18px 0 20px; letter-spacing: -.01em; }

/* ---------- Kamera ---------- */
.view-scan { background: var(--stage); color: var(--on-stage); }
.scan-top {
  position: absolute; z-index: 3; left: 0; right: 0; top: 0;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: .005em; font-size: 16px; }
.wordmark svg { width: 22px; height: 22px; color: #9fd6b5; }

.stage { position: absolute; inset: 0; overflow: hidden; }
#video { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.finder {
  position: absolute; left: 50%; top: 42%;
  width: min(72vw, 300px); aspect-ratio: 1.7;
  transform: translate(-50%, -50%);
  transition: transform .18s var(--ease);
}
.finder span { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; border-radius: 4px; }
.finder span:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.finder span:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.finder span:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.finder span:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.finder.hit { transform: translate(-50%, -50%) scale(.94); }
.finder.hit span { border-color: #9fd6b5; }

.stage-msg { position: absolute; left: 0; right: 0; top: calc(42% + min(21vw, 88px) + 22px); text-align: center; padding: 0 24px; }
.stage-hint {
  display: inline-block; margin: 0; padding: 8px 14px; border-radius: 999px;
  background: rgba(15, 23, 18, .62); color: var(--on-stage); font-size: 15px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.cam-gate {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 14px; padding: 0 28px 90px; background: var(--stage);
}
.cam-gate h1 { font: 700 34px/1.1 var(--serif); margin: 0; }
.cam-gate p { margin: 0 0 10px; color: #c9d3cc; max-width: 30ch; }

.scan-actions {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 16px;
  display: flex; justify-content: center; gap: 10px; padding: 0 16px;
}
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(15, 23, 18, .66); color: var(--on-stage); font-weight: 600; font-size: 15px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill-btn:active { transform: scale(.97); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: inherit;
}
.icon-btn.on-dark { background: rgba(255,255,255,.12); }
.icon-btn[aria-pressed="true"] { background: #f5d77a; color: #2a2205; }

/* Vergleichsleiste */
.compare-tray {
  position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 80px;
  background: var(--paper); color: var(--ink); border-radius: var(--r-md);
  padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.compare-slots { display: grid; grid-template-columns: repeat(var(--slots, 2), 1fr); gap: 8px; margin-bottom: 10px; }
.slot {
  min-height: 56px; border-radius: var(--r-sm); border: 1.5px dashed var(--rule);
  padding: 8px 10px; font-size: 13px; color: var(--ink-3); display: flex; align-items: center;
}
.slot.filled { border-style: solid; border-color: var(--moss); color: var(--ink); font-weight: 600; background: var(--moss-soft); }
.compare-actions { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Navigation ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--rule);
}
body[data-view="scan"] .tabbar { background: var(--stage); border-top-color: rgba(255,255,255,.08); color: #b9c4bd; }
.tabbar button {
  border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-3);
}
body[data-view="scan"] .tabbar button { color: #9aa79f; }
.tabbar button[aria-current="page"] { color: var(--moss); }
body[data-view="scan"] .tabbar button[aria-current="page"] { color: #9fd6b5; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent;
  font-weight: 650; font-size: 16px; text-decoration: none; transition: transform .1s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--moss); color: var(--moss-ink); }
.btn-quiet { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.btn-ghost-light { background: transparent; color: var(--on-stage); border-color: rgba(255,255,255,.28); }
.btn-lg { min-height: 54px; font-size: 17px; padding: 0 26px; }
.btn-sm { min-height: 42px; font-size: 15px; padding: 0 14px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--moss); font-weight: 600; text-align: left; }

/* ---------- Blätter ---------- */
.scrim { position: fixed; inset: 0; z-index: 29; background: rgba(10, 16, 12, .42); opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  max-height: 88vh; max-height: 88dvh;
  background: var(--paper); color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.22);
  transform: translateY(102%); transition: transform .28s var(--ease);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-tall { height: 88vh; height: 88dvh; }
/* Ergebnisblatt liegt über der Navigation nicht darauf, damit Verlauf und Profil erreichbar bleiben */
#sheet-result { bottom: calc(var(--tab-h) + var(--safe-b)); padding-bottom: 0; max-height: calc(88dvh - var(--tab-h)); box-shadow: 0 -10px 40px rgba(0,0,0,.28); }
/* Platz für den Schließen-Knopf, damit er nie über dem Inhalt liegt */
.sheet:has(.sheet-close) .sheet-grip { margin-bottom: 30px; }
[tabindex="-1"]:focus { outline: none; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--rule); margin: 10px auto 4px; flex: none; touch-action: none; }
.sheet-close { position: absolute; right: 8px; top: 6px; color: var(--ink-3); z-index: 1; }
.sheet-body { overflow-y: auto; padding: 8px 20px 24px; -webkit-overflow-scrolling: touch; }
.sheet-title { font: 700 26px/1.2 var(--serif); margin: 10px 0 6px; }
.sheet-lead { color: var(--ink-2); margin: 0 0 18px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; position: sticky; bottom: 0; background: var(--paper); padding-top: 12px; }

/* ---------- Ergebnis ---------- */
.r-head { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; padding-right: 36px; margin-top: 6px; }
.r-img { width: 64px; height: 64px; border-radius: 12px; background: var(--linen); object-fit: contain; border: 1px solid var(--rule); }
.r-img.ph { display: grid; place-items: center; color: var(--ink-3); }
.r-name { font: 700 21px/1.2 var(--serif); margin: 0; overflow-wrap: anywhere; }
.r-brand { color: var(--ink-2); font-size: 14px; margin-top: 2px; }

.answer {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 6px;
  padding: 14px 16px; border-radius: var(--r-md); font: 600 19px/1.3 var(--serif);
}
.answer svg { width: 28px; height: 28px; }
.answer.good { background: var(--yes-bg); color: var(--yes); }
.answer.partial { background: var(--mid-bg); color: var(--mid); }
.answer.low { background: var(--no-bg); color: var(--no); }
.answer.insufficient { background: var(--unk-bg); color: var(--unk); }
.answer-note { font-size: 13px; color: var(--ink-3); margin: 0 2px 10px; }

.facts { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.fact {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 2px; border-bottom: 1px solid var(--rule);
}
.fact-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.fact-ico svg { width: 16px; height: 16px; }
.fact.yes .fact-ico { background: var(--yes-bg); color: var(--yes); }
.fact.no .fact-ico { background: var(--no-bg); color: var(--no); }
.fact.mid .fact-ico { background: var(--mid-bg); color: var(--mid); }
.fact.unknown .fact-ico { background: var(--unk-bg); color: var(--unk); }
.fact-label { font-weight: 650; }
.fact-text { color: var(--ink-2); font-size: 14.5px; }
.fact-state { font-size: 12.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; margin-top: 2px; }
.fact.yes .fact-state { background: var(--yes-bg); color: var(--yes); }
.fact.no .fact-state { background: var(--no-bg); color: var(--no); }
.fact.mid .fact-state { background: var(--mid-bg); color: var(--mid); }
.fact.unknown .fact-state { background: var(--unk-bg); color: var(--unk); }
.fact-weight { font-size: 12px; color: var(--ink-3); }
.fact-ask { grid-column: 2 / 4; justify-self: start; margin-top: 4px; }
.fact-ask[aria-pressed="true"] { color: var(--ink-3); }

.r-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 8px; }
.r-actions .btn { padding: 0 12px; }
.r-actions .btn[aria-pressed="true"] { background: var(--moss-soft); color: var(--moss); border-color: var(--moss); }

.details { margin-top: 14px; border-top: 1px solid var(--rule); }
.details summary { list-style: none; padding: 14px 2px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.details summary::-webkit-details-marker { display: none; }
.details summary svg { transition: transform .2s; }
.details[open] summary svg { transform: rotate(180deg); }
.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.sources { font-size: 13px; color: var(--ink-3); margin: 12px 2px 0; }
.sources a { color: inherit; }

.r-skeleton .sk { background: linear-gradient(90deg, var(--rule), var(--linen), var(--rule)); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Nicht gefunden */
.nf-title { font: 700 24px/1.2 var(--serif); margin: 8px 40px 6px 0; }
.nf-gtin { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 14px; margin-bottom: 14px; }
.nf-options { display: grid; gap: 10px; margin-top: 16px; }

/* ---------- Werteauswahl ---------- */
.values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.value-chip {
  min-height: 72px; border-radius: var(--r-md); border: 1.5px solid var(--rule); background: var(--paper);
  text-align: left; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.value-chip strong { font-size: 16px; }
.value-chip small { color: var(--ink-3); font-size: 13px; }
.value-chip[data-w="1"] { border-color: var(--moss); background: var(--moss-soft); }
.value-chip[data-w="2"] { border-color: var(--moss); background: var(--moss); color: var(--moss-ink); }
.value-chip[data-w="2"] small { color: inherit; opacity: .85; }

/* ---------- Vergleich ---------- */
.cmp-grid { display: grid; gap: 0; border-top: 1px solid var(--rule); margin-top: 14px; }
.cmp-row { display: grid; grid-template-columns: 1.1fr repeat(var(--n), 1fr); align-items: center; border-bottom: 1px solid var(--rule); min-height: 46px; }
.cmp-row > * { padding: 8px 6px; }
.cmp-row.head > * { align-self: end; }
.cmp-prod { font-weight: 650; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.cmp-prod.best { color: var(--moss); }
.cmp-badge { display: inline-block; font-size: 12px; font-weight: 650; background: var(--moss); color: var(--moss-ink); border-radius: 999px; padding: 2px 8px; margin-bottom: 4px; }
.cmp-cell { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.cmp-cell .fact-ico { width: 24px; height: 24px; }
.cmp-cell.yes .fact-ico { background: var(--yes-bg); color: var(--yes); }
.cmp-cell.no .fact-ico { background: var(--no-bg); color: var(--no); }
.cmp-cell.mid .fact-ico { background: var(--mid-bg); color: var(--mid); }
.cmp-cell.unknown .fact-ico { background: var(--unk-bg); color: var(--unk); }
.cmp-label { color: var(--ink-2); font-size: 14px; }
.cmp-summary { font: 600 18px/1.35 var(--serif); margin: 16px 0 4px; }

/* ---------- Verlauf ---------- */
.history-list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.h-item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 2px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; width: 100%;
}
.h-item img, .h-item .r-img { width: 48px; height: 48px; border-radius: 10px; }
.h-name { font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.h-meta { font-size: 13px; color: var(--ink-3); }
.h-verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.h-dot { width: 10px; height: 10px; border-radius: 50%; }
.h-dot.good { background: var(--yes); } .h-dot.partial { background: var(--mid); }
.h-dot.low { background: var(--no); } .h-dot.insufficient { background: var(--unk); }
.h-day { font-size: 13px; font-weight: 650; color: var(--ink-3); margin: 18px 2px 4px; }
.h-day:first-child { margin-top: 4px; }

.empty { text-align: left; padding: 32px 2px; }
.empty h2 { font: 700 22px/1.2 var(--serif); margin: 0 0 6px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; max-width: 34ch; }

/* ---------- Profil ---------- */
.group { margin-bottom: 26px; }
.group-title { font-size: 14px; font-weight: 650; color: var(--ink-3); margin: 0 2px 6px; }
.row-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  min-height: 60px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--rule);
  background: none; text-align: left; color: var(--ink); text-decoration: none;
}
.row-btn span { display: flex; flex-direction: column; }
.row-btn small { color: var(--ink-3); font-size: 13.5px; }
.chev { color: var(--ink-3); width: 18px; height: 18px; }
.select { border: 1.5px solid var(--rule); border-radius: 10px; padding: 8px 10px; background: var(--paper); min-height: 44px; }
.support-card { background: var(--moss-soft); border-radius: var(--r-md); padding: 16px; margin-bottom: 8px; }
.support-card p { margin: 0 0 14px; font-size: 15px; color: var(--ink-2); }
.support-card strong { color: var(--ink); }
.fine { font-size: 12.5px; color: var(--ink-3); margin: 8px 2px 0; }

/* ---------- Formular ---------- */
.manual-form { display: flex; gap: 10px; }
.input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--rule); background: var(--linen); font-size: 20px;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.input:focus { border-color: var(--moss); outline: none; }
.field-error { color: var(--no); font-size: 14px; min-height: 20px; margin: 8px 2px 0; }

/* ---------- Hinweis ---------- */
.toast {
  position: fixed; z-index: 40; left: 50%; top: calc(var(--safe-t) + 64px);
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-size: 15px;
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; width: 560px; transform: translate(-50%, 102%); }
  .sheet.open { transform: translate(-50%, 0); }
  .view-page { max-width: 640px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Navigation: Scannen hervorgehoben ---------- */
.tab-scan-ico { display: grid; place-items: center; width: 44px; height: 30px; border-radius: 999px; }
.tabbar .tab-scan[aria-current="page"] .tab-scan-ico { background: var(--moss-soft); }
body[data-view="scan"] .tabbar .tab-scan .tab-scan-ico { background: rgba(159, 214, 181, .16); }
.tab-ico-wrap { position: relative; display: inline-grid; }
.tab-badge {
  position: absolute; top: -5px; right: -11px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--moss); color: var(--moss-ink); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

/* ---------- Listen-Chip im Kamerabild ---------- */
.scan-top-right { display: flex; align-items: center; gap: 8px; }
.list-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: rgba(15,23,18,.62);
  color: var(--on-stage); font-weight: 600; font-size: 14px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.list-chip svg { width: 18px; height: 18px; color: #9fd6b5; }

/* ---------- Einkaufsliste ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.list-progress { margin: 0; color: var(--ink-3); font-size: 14px; font-weight: 600; white-space: nowrap; }
.add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.add-row .input { font-size: 17px; letter-spacing: 0; min-height: 52px; }
.add-btn { min-width: 52px; padding: 0; }
.add-btn svg { width: 22px; height: 22px; }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest-label { font-size: 13px; color: var(--ink-3); font-weight: 600; margin: 0 0 6px 2px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1.5px solid var(--rule); background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.chip svg { width: 14px; height: 14px; }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.li {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px;
  min-height: 60px; border-bottom: 1px solid var(--rule);
  transition: opacity .25s, background .25s;
}
.li.just-done { background: var(--yes-bg); }
.check {
  width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; padding: 0;
}
.check span {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--ink-3);
  display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s, transform .15s;
}
.check span svg { width: 16px; height: 16px; }
.li.done .check span { background: var(--moss); border-color: var(--moss); color: var(--moss-ink); }
.li.done .check span { animation: pop .28s var(--ease); }
@keyframes pop { 50% { transform: scale(1.18); } }
.li-main { min-width: 0; padding: 8px 0; }
.li-text { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.li.done .li-text { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-3); font-weight: 500; }
.li-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; font-size: 13px; color: var(--ink-3); align-items: center; }
.li-del { width: 44px; height: 44px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; }
.li-del svg { width: 18px; height: 18px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.tag .h-dot { width: 8px; height: 8px; }
.list-section { font-size: 13px; font-weight: 650; color: var(--ink-3); margin: 22px 2px 6px; display: flex; justify-content: space-between; align-items: center; }
.list-finish { margin-top: 20px; }
.list-empty { padding: 18px 2px 8px; }
.list-empty h2 { font: 700 21px/1.25 var(--serif); margin: 0 0 6px; }
.list-empty p { color: var(--ink-2); margin: 0 0 6px; max-width: 36ch; }
.list-tip { display: flex; gap: 10px; align-items: flex-start; background: var(--moss-soft); border-radius: var(--r-md); padding: 12px 14px; margin-top: 14px; font-size: 14.5px; color: var(--ink-2); }
.list-tip svg { color: var(--moss); margin-top: 1px; }

/* ---------- Einkauf erledigt ---------- */
.trip-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--moss-soft); color: var(--moss); display: grid; place-items: center; margin: 10px 0 6px; }
.trip-mark svg { width: 34px; height: 34px; }
.trip-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 4px; }
.trip-stat { background: var(--linen); border-radius: var(--r-md); padding: 12px; }
.trip-stat b { display: block; font: 700 26px/1.1 var(--serif); }
.trip-stat span { font-size: 13px; color: var(--ink-3); }

/* ---------- Beitrag ---------- */
.impact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.impact-tile { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 12px 14px; }
.impact-tile b { display: block; font: 700 26px/1.1 var(--serif); color: var(--moss); }
.impact-tile span { font-size: 13.5px; color: var(--ink-2); }

/* ---------- Hinweis mit Aktion ---------- */
.toast { display: flex; align-items: center; gap: 14px; }
.toast.has-action { pointer-events: auto; }
.toast-action { border: 0; background: none; color: #9fd6b5; font-weight: 700; padding: 6px 2px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .toast-action { color: #1e5a3e; } }

/* Ergebnis: Aktionen in zwei Zeilen */
.r-actions-sub { display: flex; justify-content: center; margin-bottom: 4px; }

/* ---------- Einkauf teilen ---------- */
.share-format { display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--linen); border-radius: 999px; padding: 4px; margin: 4px 0 14px; }
.share-format button { border: 0; background: none; min-height: 38px; padding: 0 18px; border-radius: 999px; font-weight: 650; color: var(--ink-2); }
.share-format button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.share-preview { display: grid; place-items: center; background: var(--linen); border-radius: var(--r-md); padding: 12px; }
.share-preview canvas { width: auto; height: auto; max-width: 100%; max-height: 42vh; border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.14); }
.share-label { display: block; font-weight: 650; margin: 16px 2px 6px; }
.share-label span { font-weight: 400; color: var(--ink-3); font-size: 14px; }
.share-comment { width: 100%; min-height: 64px; padding: 12px 14px; font-size: 16px; letter-spacing: 0; resize: none; font-family: inherit; }
.share-count { font-size: 12.5px; color: var(--ink-3); text-align: right; margin: 4px 2px 0; }
.share-foot { flex-direction: column; align-items: stretch; }
.share-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-links .btn { padding: 0 8px; font-size: 15px; }
.trip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }

/* =====================================================
   DESKTOP-LAYOUT (ab 768px)
   App zentriert mit max-width, linkes Kleben verhindert
   ===================================================== */
@media (min-width: 768px) {
  /* Körper */
  body {
    background: #0a1a0f;
    display: flex;
    justify-content: center;
    overflow: hidden;
  }

  /* Äußerer Wrapper: alle Views + Tabbar */
  body::before {
    content: '';
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 430px;
    top: 0;
    bottom: 0;
    background: var(--linen);
    z-index: 0;
    box-shadow: 0 0 80px rgba(0,0,0,.6);
  }

  /* Views zentrieren */
  .view {
    left: 50%;
    transform: translateX(-50%);
    width: 430px;
    right: auto;
  }

  /* Scan-Header */
  .scan-top {
    left: 50%;
    transform: translateX(-50%);
    width: 430px;
    right: auto;
  }

  /* Tabbar */
  .tabbar {
    left: 50%;
    transform: translateX(-50%);
    width: 430px;
    right: auto;
  }

  /* Sheets */
  .sheet {
    left: 50% !important;
    right: auto !important;
    width: 430px !important;
    transform: translate(-50%, 102%) !important;
  }
  .sheet.open {
    transform: translate(-50%, 0) !important;
  }

  /* Scrim */
  #scrim {
    background: rgba(0,0,0,.6);
  }

  /* Toast */
  .toast {
    left: 50%;
  }
}

/* =====================================================
   EINKAUFSBILANZ (finishTrip)
   ===================================================== */
.trip-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 20px 8px;
}
.trip-ring-wrap { flex: none; }
.trip-header-text { flex: 1; min-width: 0; }
.trip-header-text .sheet-title { font-size: 20px; margin: 0 0 4px; }
.trip-header-text .sheet-lead  { font-size: 13px; margin: 0; color: var(--ink-2); line-height: 1.4; }

.trip-stats {
  display: flex;
  gap: 0;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--rule);
}
.trip-stat {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
}
.trip-stat b { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.trip-stat span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }

.trip-items-list {
  padding: 8px 20px 4px;
}
.trip-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.trip-item-row:last-child { border-bottom: none; }
.trip-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.trip-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trip-item-verdict {
  font-size: 11.5px;
  color: var(--ink-3);
  flex: none;
}

.trip-compare {
  font-size: 12px;
  color: var(--ink-3);
  padding: 10px 20px 0;
  margin: 0;
}

/* =====================================================
   PRO UPGRADE / STATUS
   ===================================================== */
.pro-price-row {
  display: flex;
  gap: 10px;
  margin: 14px 0 12px;
}
.pro-price-card {
  flex: 1;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pro-price-card.active {
  border-color: #e8b86d;
  background: rgba(232,184,109,.08);
}
.pro-price-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.pro-price-amount { font-size: 20px; font-weight: 800; color: var(--ink); }
.pro-price-sub { font-size: 11px; color: var(--ink-3); }

/* Aktiver Pro-Status */
.pro-active-card {
  padding: 4px 0 8px;
}
.pro-active-badge {
  display: inline-block;
  background: rgba(74,222,128,.15);
  color: #4ade80;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.pro-active-info {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
.pro-active-sub {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
}

/* =====================================================
   BETA-BANNER (fixed, nie die App verdecken)
   ===================================================== */
#beta-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 430px);
  height: auto;
  z-index: 200;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px;
  background: var(--moss, #2d6a4f);
  color: #fff;
  font-size: 13px;
  font-family: Manrope, sans-serif;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}
body.has-beta .scan-top { padding-top: calc(env(safe-area-inset-top, 0px) + 12px + 28px); }
body.has-beta .view-page { padding-top: calc(env(safe-area-inset-top, 0px) + 8px + 28px); }
