/* =====================================================================
   Vorrat – Design
   Ruhige, warme Flächen, ein grüner Akzent, Status-Farben nur mit Text.
   ===================================================================== */

:root {
  color-scheme: light dark;
  --bg: #f4f3ee;
  --flaeche: #ffffff;
  --flaeche-2: #efeee8;
  --text: #1b1d1a;
  --leise: #6a6f67;
  --linie: #e4e2d9;
  --akzent: #2f7d4f;
  --akzent-text: #ffffff;
  --akzent-zart: #e3efe7;
  --rot: #c23b2a;
  --gelb: #a86e00;
  --gruen: #2a8a55;
  --grau: #8a8e86;
  --schatten: 0 1px 2px rgb(30 30 20 / .04), 0 4px 14px rgb(30 30 20 / .05);
  --radius: 16px;
  --tabbar-hoehe: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121411;
    --flaeche: #1c1f1b;
    --flaeche-2: #262a25;
    --text: #ecede8;
    --leise: #9da198;
    --linie: #2f332d;
    --akzent: #5bb582;
    --akzent-text: #0b1910;
    --akzent-zart: #1f3327;
    --rot: #ec6a56;
    --gelb: #e3b23c;
    --gruen: #5bbf86;
    --grau: #7d8279;
    --schatten: 0 1px 2px rgb(0 0 0 / .3);
  }
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 600px; margin: 0 auto; min-height: 100dvh; padding: 0 16px calc(var(--tabbar-hoehe) + 96px + env(safe-area-inset-bottom)); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; margin-bottom: 10px; }
.leise { color: var(--leise); }
.klein { font-size: .85rem; }
.mitte { text-align: center; }
.abstand-oben { margin-top: 18px; }
[hidden] { display: none !important; }

/* ---------- Formulare & Buttons ---------- */
label { display: block; font-size: .85rem; color: var(--leise); margin-bottom: 12px; }
.feldname { font-size: .85rem; color: var(--leise); margin: 0 0 6px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px;
  font: inherit; font-size: 16px;            /* 16px verhindert Auto-Zoom auf iPhones */
  color: var(--text); background: var(--flaeche-2);
  border: 1px solid transparent; border-radius: 12px; padding: 12px 13px;
  transition: border-color .15s, background .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--akzent); background: var(--flaeche); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 12px 16px; color: var(--text); background: var(--flaeche-2); transition: transform .08s, background .15s, opacity .15s; }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
button.primaer { background: var(--akzent); color: var(--akzent-text); font-weight: 600; width: 100%; padding: 14px 16px; }
button.sekundaer { background: var(--flaeche-2); font-weight: 600; }
button.breit { width: 100%; }
button.text-warn { background: none; color: var(--rot); font-weight: 600; }
button.text-link { background: none; color: var(--akzent); font-weight: 600; padding: 8px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline { display: flex; gap: 8px; align-items: stretch; }
.inline input { margin: 0; }
.karte { background: var(--flaeche); border-radius: var(--radius); padding: 16px; box-shadow: var(--schatten); }

/* ---------- Segmente (Umschalter) ---------- */
.segment-leiste { display: flex; background: var(--flaeche-2); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.segment-leiste button { flex: 1; background: none; padding: 9px; border-radius: 9px; color: var(--leise); font-weight: 500; }
.segment-leiste button.aktiv { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.segment-leiste small { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.segmente { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--flaeche-2); color: var(--text); font-size: .92rem; cursor: pointer; transition: background .15s; }
.seg input:checked + span { background: var(--akzent); color: var(--akzent-text); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 2px; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { white-space: nowrap; border-radius: 999px; padding: 7px 13px; font-size: .9rem; background: var(--flaeche); box-shadow: inset 0 0 0 1px var(--linie); }
.chips button.aktiv { background: var(--text); color: var(--bg); box-shadow: none; }
.chips.klein button { padding: 6px 11px; font-size: .82rem; }
.chips.umbruch { flex-wrap: wrap; overflow: visible; }
.chips small { opacity: .6; margin-left: 5px; }

/* ---------- Login & Start ---------- */
.login { padding-top: 12vh; text-align: center; }
.login-logo { width: 76px; height: 76px; filter: drop-shadow(0 6px 16px rgb(47 125 79 / .25)); }
.login h1 { font-size: 2.1rem; margin-top: 12px; }
.login > p { margin: 6px 0 28px; }
.login .karte { text-align: left; }
.start { padding-top: 10vh; }
.start > p { margin: 8px 0 22px; }
.start form input, .sheet-inhalt form#hh-neu input, .sheet-inhalt form#hh-beitreten input { margin-bottom: 10px; }
.oder { text-align: center; color: var(--leise); margin: 12px 0; font-size: .85rem; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 0 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.kopf-titel { flex: 1; min-width: 0; }
.kopf-gruss { display: block; font-size: .8rem; color: var(--leise); }
.haushalt-wahl {
  margin: 0; padding: 0 26px 0 0; font-weight: 700; font-size: 1.3rem; border: 0; width: auto; max-width: 100%;
  letter-spacing: -.01em; appearance: none; -webkit-appearance: none; border-radius: 6px;
  background: no-repeat right 2px center / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6f67' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}
.haushalt-wahl:focus { background-color: transparent; }
@media (prefers-color-scheme: dark) {
  .haushalt-wahl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239da198' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
}
.icon-btn { background: none; padding: 8px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.klein { padding: 6px; color: var(--leise); }
.icon-btn.klein svg { width: 16px; height: 16px; }

/* ---------- Suche ---------- */
.suche { position: relative; display: block; margin: 2px 0 12px; }
.suche svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--leise); pointer-events: none; }
.suche input { margin: 0; padding-left: 40px; background: var(--flaeche); box-shadow: var(--schatten); }

/* ---------- Liste ---------- */
.gruppe { margin-bottom: 18px; }
.gruppe-titel { font-size: .8rem; font-weight: 600; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px 4px; }
.gruppe-titel small { font-weight: 500; opacity: .7; margin-left: 4px; }
/* minmax(0, 1fr): Spalte nie breiter als der Bildschirm – lange Texte werden mit … gekürzt */
.liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.eintrag {
  display: flex; align-items: center; gap: 12px;
  background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 10px 10px 10px 12px; cursor: pointer;
  transition: transform .08s;
}
.eintrag:active { transform: scale(.99); }
.eintrag.kompakt { cursor: default; padding: 8px 6px 8px 10px; }
.eintrag-text { flex: 1; min-width: 0; }
.eintrag-text strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag-text span { display: block; font-size: .82rem; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag-rechts { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.eintrag-rechts .menge { font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }

.avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; object-fit: contain;
  background: hsl(var(--farbton, 140) 45% 92%); color: hsl(var(--farbton, 140) 45% 30%);
  font-weight: 700; font-size: 1.1rem;
}
img.avatar { background: #fff; padding: 3px; }
.avatar.klein { width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }
.avatar.emoji { font-size: 1.45rem; font-weight: 400; background: hsl(var(--farbton, 140) 40% 94%); }
.avatar.emoji.klein { font-size: 1.1rem; }
.produkt-kopf .avatar.emoji { font-size: 2.1rem; }
.avatar.manuell { background: var(--flaeche-2); color: var(--leise); }
@media (prefers-color-scheme: dark) {
  .avatar { background: hsl(var(--farbton, 140) 25% 22%); color: hsl(var(--farbton, 140) 50% 78%); }
  .avatar.emoji { background: hsl(var(--farbton, 140) 14% 20%); }
}

.minus {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; flex-shrink: 0;
  font-size: 1.2rem; line-height: 1; background: var(--flaeche-2); color: var(--text);
}

/* Haltbarkeits-Badge: Farbe + Text, nie nur Farbe */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: color-mix(in srgb, var(--gruen) 14%, transparent); color: var(--gruen); }
.badge-bald { background: color-mix(in srgb, var(--gelb) 16%, transparent); color: var(--gelb); }
.badge-abgelaufen { background: color-mix(in srgb, var(--rot) 14%, transparent); color: var(--rot); }
.badge-unbekannt { background: var(--flaeche-2); color: var(--leise); font-weight: 500; }

.leer { text-align: center; color: var(--leise); padding: 48px 20px; }
.leer-symbol { font-size: 2.4rem; margin-bottom: 8px; }
.klein-leer { padding: 20px; }
.lade { width: 30px; height: 30px; margin: 40px auto; border: 3px solid var(--linie); border-top-color: var(--akzent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* ---------- Plus-Button & Leiste unten ---------- */
.fab {
  position: fixed; z-index: 6;
  right: max(18px, calc(50% - 282px)); bottom: calc(var(--tabbar-hoehe) + 18px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 18px; padding: 0;
  display: grid; place-items: center;
  background: var(--akzent); color: var(--akzent-text);
  box-shadow: 0 8px 22px rgb(47 125 79 / .35);
}
.fab svg { width: 26px; height: 26px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: flex; justify-content: center; gap: 4px;
  height: calc(var(--tabbar-hoehe) + env(safe-area-inset-bottom));
  padding: 6px 12px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--flaeche) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--linie);
}
.tabbar button {
  flex: 1; max-width: 160px; background: none; padding: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--leise); font-size: .72rem; font-weight: 500;
}
.tabbar button svg { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 999px; transition: background .15s; }
.tabbar button.aktiv { color: var(--akzent); font-weight: 600; }
.tabbar button.aktiv svg { background: var(--akzent-zart); }

/* ---------- Bottom-Sheet ---------- */
dialog#sheet {
  margin: auto auto 0; width: 100%; max-width: 600px; max-height: 92dvh;
  border: 0; border-radius: 24px 24px 0 0; padding: 0;
  background: var(--flaeche); color: var(--text);
}
dialog#sheet[open] { animation: hoch .22s cubic-bezier(.2, .9, .3, 1); }
dialog#sheet::backdrop { background: rgb(10 12 10 / .45); }
@keyframes hoch { from { transform: translateY(60px); opacity: 0; } }
.sheet-inhalt { padding: 6px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overflow-x: hidden; max-height: 92dvh; }
.griff { width: 40px; height: 5px; border-radius: 3px; background: var(--linie); margin: 6px auto 16px; }
.sheet-inhalt > h2 { margin-bottom: 6px; }
.sheet-inhalt > p { margin: 0 0 14px; }
.sheet-inhalt > p.abstand-oben { margin-top: 18px; }
.sheet-inhalt:focus { outline: none; }
.sheet-inhalt details { margin-top: 16px; border-top: 1px solid var(--linie); padding-top: 14px; }
.sheet-inhalt summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.sheet-inhalt input, .sheet-inhalt select, .sheet-inhalt textarea { background: var(--flaeche-2); }

.produkt-kopf { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.produkt-kopf .avatar { width: 64px; height: 64px; border-radius: 16px; font-size: 1.5rem; }
.produkt-kopf h2 { font-size: 1.2rem; }
.produkt-kopf .klein { display: block; margin-top: 2px; }
.nutri { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; color: #fff; }
.nutri-a { background: #038141; } .nutri-b { background: #5e9f1f; } .nutri-c { background: #b88a00; }
.nutri-d { background: #d26f00; } .nutri-e { background: #d33a10; }

.info-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.info-reihe div { background: var(--flaeche-2); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.info-reihe span { display: block; font-size: .74rem; color: var(--leise); }
.info-reihe b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-reihe small { display: block; font-size: .74rem; color: var(--leise); }
.info-reihe div:first-child b { white-space: normal; }   /* "0,5 Packungen" lieber umbrechen als abschneiden */

.entnahme { margin-top: 18px; }
.menge-eingabe { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.menge-eingabe input { margin: 0; text-align: center; font-weight: 600; font-size: 1.1rem; flex: 1; min-width: 0; }
.menge-eingabe select { margin: 0; width: auto; flex-shrink: 0; }
.menge-eingabe .einheit { color: var(--leise); min-width: 52px; }
.rund { width: 44px; height: 44px; border-radius: 50%; padding: 0; font-size: 1.3rem; flex-shrink: 0; }
.vorschau { min-height: 1.4em; margin: 0 0 12px; font-weight: 600; color: var(--akzent); }
.aktionen { display: grid; gap: 8px; }
.aktionen .sekundaer { width: 100%; }

.code-box { display: flex; align-items: center; gap: 10px; background: var(--flaeche-2); border-radius: 14px; padding: 12px 14px; margin: 12px 0 6px; }
.code-box > div { flex: 1; }
.code-box strong { font-size: 1.35rem; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.menue-liste { margin-top: 18px; border-top: 1px solid var(--linie); }
.zeile { display: block; width: 100%; text-align: left; background: none; padding: 14px 2px; border-bottom: 1px solid var(--linie); border-radius: 0; }

/* ---------- Scanner ---------- */
.scanner { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: var(--radius); overflow: hidden; margin: 12px 0 8px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-rahmen {
  position: absolute; inset: 30% 12%; border: 3px solid #fff; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / .35);   /* dunkelt alles außerhalb des Rahmens ab */
}

/* ---------- Nährwert-Tabelle ---------- */
table.naehr { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
table.naehr th { text-align: right; font-weight: 600; color: var(--leise); font-size: .78rem; padding: 4px 0; }
table.naehr td { padding: 6px 0; border-top: 1px solid var(--linie); text-align: right; }
table.naehr td:first-child { text-align: left; }

/* ---------- Heute ---------- */
.tag-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.tag-nav strong { font-size: 1rem; }
.hero { margin-bottom: 10px; }
.hero-label { font-size: .85rem; color: var(--leise); font-weight: 500; }
.hero-zahl { font-size: 3.2rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; margin: 2px 0 14px; }
.hero-zahl small { font-size: 1rem; font-weight: 600; color: var(--leise); letter-spacing: 0; }
.hero .sekundaer { margin-top: 4px; }

/* Meter: Spur ist eine hellere Stufe derselben Farbe; über dem Ziel wird es rot (+ Text "Über dem Ziel") */
.meter { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--akzent) 16%, transparent); overflow: hidden; }
.meter.gross { height: 12px; }
.meter > div { height: 100%; border-radius: 999px; background: var(--akzent); transition: width .4s ease; }
.meter.ueber { background: color-mix(in srgb, var(--rot) 16%, transparent); }
.meter.ueber > div { background: var(--rot); }
.meter-legende { display: flex; justify-content: space-between; font-size: .8rem; color: var(--leise); margin-top: 7px; }

.makros { margin-bottom: 10px; }
.makro-zeile { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.makro-zeile span:first-child { font-weight: 600; }
.makro-wert { font-variant-numeric: tabular-nums; color: var(--leise); }
.makro-reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.makro-reihe div { background: var(--flaeche-2); border-radius: 12px; padding: 9px 12px; }
.makro-reihe span { display: block; font-size: .78rem; color: var(--leise); }
.makro-reihe b { font-size: 1.05rem; }

.vorschlag {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  margin-bottom: 18px; color: var(--text);
  background: linear-gradient(135deg, var(--akzent-zart), var(--flaeche));
}
.vorschlag > svg { width: 20px; height: 20px; color: var(--leise); flex-shrink: 0; }
.vorschlag span:nth-child(2) { flex: 1; }
.vorschlag-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--akzent); color: var(--akzent-text); display: grid; place-items: center; flex-shrink: 0; }
.vorschlag-icon svg { width: 22px; height: 22px; }

.abschnitt-kopf { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 6px; }
.abschnitt-kopf .gruppe-titel { margin: 0 0 0 4px; }
.hinweis { font-size: .82rem; color: var(--leise); background: var(--flaeche-2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }

/* ---------- Rezept ---------- */
.seiten-kopf { margin: 4px 0 16px; }
.seiten-kopf p { margin: 6px 0 0; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; margin: 6px 0 16px; }
label.check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--akzent); }
textarea.prompt { font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.45; margin: 4px 0 14px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--tabbar-hoehe) + 18px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 11px 12px 11px 16px; border-radius: 14px; font-size: .92rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .25);
  animation: hoch .2s ease-out;
}
#toast button { background: none; color: var(--akzent-zart); font-weight: 700; padding: 4px 6px; }
#toast.fehler { background: var(--rot); color: #fff; }
dialog #toast { bottom: calc(24px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Einkaufsliste ---------- */
.tabbar button { position: relative; }
.tab-zahl {
  position: absolute; top: 2px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--rot); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--flaeche);
}
.einkauf-eingabe { display: flex; gap: 8px; margin-bottom: 14px; }
.einkauf-eingabe input { margin: 0; background: var(--flaeche); box-shadow: var(--schatten); }
.hinzu-btn { width: 48px; flex-shrink: 0; padding: 0; display: grid; place-items: center; background: var(--akzent); color: var(--akzent-text); }
.hinzu-btn svg { width: 22px; height: 22px; }
.einkauf-eintrag { cursor: default; padding: 8px 6px 8px 8px; }
.haken {
  width: 30px; height: 30px; padding: 0; margin: 0 2px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; background: none; color: transparent;
  box-shadow: inset 0 0 0 2px var(--linie);
}
.haken svg { width: 16px; height: 16px; }
.haken.an { background: var(--akzent); color: var(--akzent-text); box-shadow: none; }
.einkauf-eintrag.erledigt { opacity: .6; box-shadow: none; background: var(--flaeche-2); }
.einkauf-eintrag.erledigt strong { text-decoration: line-through; font-weight: 500; }
.detail-zeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 4px; }
.text-link svg { width: 17px; height: 17px; vertical-align: -3px; margin-right: 2px; }
.sheet-inhalt .hinweis { margin-top: 14px; }

/* ---------- Einladung & Zugänge ---------- */
.einladung-banner { background: var(--akzent-zart); color: var(--text); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; text-align: left; font-size: .92rem; }
.einladung-banner.fehler { background: color-mix(in srgb, var(--rot) 14%, transparent); }
.karte.innen { box-shadow: none; background: var(--flaeche-2); }
.karte.innen input { background: var(--flaeche); }
.link-box input { margin-top: 4px; font-size: .85rem; background: var(--flaeche); }
.link-box + .breit { margin-top: 8px; }
.eintrag.gesperrt { opacity: .55; }
.eintrag-text strong .badge { display: inline-block; margin-left: 4px; vertical-align: 1px; font-size: .68rem; overflow: visible; }
#einladung-ergebnis + .feldname, #einladung-ergebnis ~ .feldname { margin-top: 20px; }

/* ---------- Installieren ---------- */
.install-hinweis { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; margin-bottom: 12px; }
.install-hinweis img { width: 40px; height: 40px; border-radius: 10px; }
.install-hinweis > span { flex: 1; min-width: 0; line-height: 1.3; }
.install-hinweis .sekundaer { padding: 8px 12px; font-size: .88rem; background: var(--akzent); color: var(--akzent-text); }
.anleitung { padding-left: 22px; margin: 6px 0 14px; line-height: 1.9; }
.anleitung .symbol { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--flaeche-2); }

/* ---------- Hinweis-Karte (z. B. "Erinnerungen einschalten?") ---------- */
.hinweis-karte { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--akzent-zart), var(--flaeche)); }
.hinweis-symbol { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--flaeche); flex-shrink: 0; }
.hinweis-karte > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.3; }
.hinweis-karte b { display: block; }
.hinweis-karte .sekundaer { padding: 8px 12px; font-size: .88rem; background: var(--akzent); color: var(--akzent-text); }

/* ---------- Schalter (an/aus) ---------- */
.schalter-zeile { display: flex; align-items: center; gap: 12px; margin: 4px 0 0; color: var(--text); font-size: 1rem; cursor: pointer; }
.schalter-zeile > span { flex: 1; line-height: 1.35; }
input.schalter {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative; cursor: pointer;
  width: 52px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 22%, transparent); transition: background .2s;
}
input.schalter::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s;
}
input.schalter:checked { background: var(--akzent); }
input.schalter:checked::after { transform: translateX(20px); }
input.schalter:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
input.schalter:disabled { opacity: .5; }

/* ---------- Wochenstatistik ---------- */
.woche { margin-bottom: 18px; }
.woche-kopf { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.karten-titel { font-size: 1rem; font-weight: 600; }
.woche-diagramm { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 150px; padding-top: 18px; }
.woche-tag {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  background: none; padding: 0; border-radius: 10px; color: var(--leise);
}
.woche-tag:active:not(:disabled) { transform: none; }
.woche-wert { font-size: .72rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Wert sitzt direkt über seinem Balken */
.woche-spur { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.woche-balken { width: min(22px, 70%); border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--akzent) 42%, var(--flaeche)); transition: height .4s ease, background .15s; }
.woche-balken.leer { height: 2px !important; background: var(--linie); }
.woche-tag.aktiv .woche-balken:not(.leer) { background: var(--akzent); }
.woche-tag:hover .woche-balken:not(.leer) { background: color-mix(in srgb, var(--akzent) 70%, var(--flaeche)); }
.woche-name { font-size: .72rem; height: 16px; }
.woche-tag.aktiv .woche-name { color: var(--text); font-weight: 700; }
/* Ziellinie: Die Balkenfläche beginnt 20px über dem Boden (Tagesnamen) und endet 20px unter
   der Oberkante (Wert) – die Position rechnet app.js mit calc() genau so aus */
.woche-ziel {
  position: absolute; left: 0; right: 0; height: 0; pointer-events: none; z-index: 1;
  border-top: 1.5px dashed color-mix(in srgb, var(--text) 35%, transparent);
}
.woche-legende { display: inline-flex; align-items: center; gap: 6px; }
.woche-legende i { display: inline-block; width: 16px; border-top: 1.5px dashed color-mix(in srgb, var(--text) 35%, transparent); }
.woche-zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.woche-zahlen div { background: var(--flaeche-2); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.woche-zahlen span { display: block; font-size: .74rem; color: var(--leise); }
.woche-zahlen b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.woche-zahlen small { display: block; font-size: .72rem; color: var(--leise); }
.woche-fussnote { margin: 10px 0 0; }

/* ---------- Lagerorte ---------- */
.neuer-ort { margin: -4px 0 12px; }
.neuer-ort input { margin: 0; }
.mhd-zeigen { display: block; padding: 4px 0; margin: -2px 0 12px; }
.ort-liste .eintrag { gap: 8px; padding: 6px 6px 6px 8px; }
.ort-form { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.ort-form input { margin: 0; background: transparent; padding: 8px 8px; font-weight: 600; }
.ort-form input:focus { background: var(--flaeche-2); }
.ort-anzahl { flex-shrink: 0; }

/* ---------- Claude: Connector oder Prompt ---------- */
a.knopf { display: block; text-align: center; text-decoration: none; border-radius: 12px; }
a.primaer { background: var(--akzent); color: var(--akzent-text); font-weight: 600; padding: 14px 16px; }
a.karte.vorschlag { text-decoration: none; }
.connector-hinweis { margin: 0 0 14px; line-height: 1.45; }
.connector-hinweis input { margin: 0; font-size: .85rem; background: var(--flaeche); padding: 9px 10px; }
.connector-hinweis .sekundaer { padding: 8px 12px; font-size: .88rem; background: var(--flaeche); }
.abstand-klein { margin-top: 8px; }
.schnell-fragen a {
  white-space: nowrap; border-radius: 999px; padding: 7px 13px; font-size: .88rem; text-decoration: none;
  color: var(--text); background: var(--flaeche); box-shadow: inset 0 0 0 1px var(--linie);
}
.schnell-fragen a:active { transform: scale(.97); }
.ort-speichern { background: var(--akzent); color: var(--akzent-text); padding: 6px; flex-shrink: 0; }
.ort-speichern svg { width: 18px; height: 18px; }

/* ---------- Immer da haben (im Produkt-Detail) ---------- */
.mindest-zeile { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 14px;
  background: var(--flaeche-2); }
.mindest-zeile > span:first-child { flex: 1; min-width: 0; line-height: 1.3; }
.mindest-zeile input { width: 70px; margin: 0; text-align: center; background: var(--flaeche); padding: 9px 6px; }
.mindest-zeile .einheit { color: var(--leise); font-size: .85rem; }

/* ---------- Scanner: Serie ---------- */
.scanner-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.schalter-zeile.serie { margin: 12px 0 4px; font-size: .95rem; }

/* ---------- Einkaufsliste: Bereiche & Wagen ---------- */
.bereich-titel { font-size: .78rem; font-weight: 600; color: var(--leise); margin: 14px 0 6px 4px; }
.bereich-titel:first-child { margin-top: 0; }
#wagen-einlagern { display: flex; align-items: center; justify-content: center; gap: 8px; }
#wagen-einlagern svg { width: 20px; height: 20px; }
.wagen-posten { border: 0; margin: 0 0 10px; padding: 12px; min-width: 0; transition: opacity .15s; }
.wagen-posten.aus { opacity: .5; }
.wagen-posten.aus .wagen-felder { display: none; }
.wagen-kopf { margin: 0 0 8px; }
.wagen-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.wagen-felder label { margin-bottom: 8px; }
.wagen-felder input, .wagen-felder select { background: var(--flaeche); padding: 10px; }
.wagen-felder input[type=date] { margin-top: 6px; }

/* ---------- Rezepte ---------- */
#rezept-bereich { margin-top: 2px; }
.zutaten { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.zutaten li { display: flex; gap: 10px; align-items: baseline; padding: 7px 2px; border-bottom: 1px solid var(--linie); }
.zutaten li:last-child { border-bottom: 0; }
.zutat-status { width: 20px; flex-shrink: 0; text-align: center; font-weight: 700; }
.zutaten li.da .zutat-status { color: var(--gruen); }
.zutaten li.fehlt .zutat-status { color: var(--gelb); }
.zubereitung { white-space: pre-wrap; line-height: 1.55; background: var(--flaeche-2); border-radius: 12px; padding: 12px 14px; }
#rezept-eintragen { display: flex; align-items: center; justify-content: center; gap: 6px; }
#rezept-eintragen svg { width: 18px; height: 18px; }

/* ---------- Statistik ---------- */
.stat-zahlen { margin: 4px 0 6px; }
/* Symbole in Text-Knöpfen immer klein (sonst füllen SVGs ohne Größe den ganzen Knopf) */
.aktionen button > svg, button.sekundaer > svg, button.primaer > svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
