/* Sepet – warm, ruhig, gut lesbar im Supermarktlicht */
:root {
  --bg: #F6F1E7; --karte: #FFFDF8; --karte2: #FBF7EF; --text: #1F2A23; --muted: #6E756B; --linie: #E7DFD1;
  --gruen: #2F6B4F; --gruen-t: #E2EDE5; --gruen-d: #23543D; --rot: #C2553D; --rot-t: #F7E3DD; --gold: #C98A1B; --gold-t: #F6EBD3;
  --schatten: 0 1px 2px rgba(60, 50, 30, .06), 0 6px 20px rgba(60, 50, 30, .07);
  --r: 16px; --kopf-h: 120px; --leiste-h: 80px; --unten: env(safe-area-inset-bottom, 0px);
  --rund: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121614; --karte: #1B211E; --karte2: #171C19; --text: #ECEFE9; --muted: #98A199; --linie: #2B332F;
    --gruen: #5DB088; --gruen-t: #1E3329; --gruen-d: #7CC9A2; --rot: #E07A62; --rot-t: #3A221C; --gold: #E0A93E; --gold-t: #362B16;
    --schatten: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { font-family: var(--rund); margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.klein { font-size: 13px; }

/* ---------- Kopf ---------- */
#kopf { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 8px; border-bottom: 1px solid transparent; transition: border-color .2s; }
#kopf.gescrollt { border-bottom-color: var(--linie); }
.kopf-zeile { display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.marke { display: flex; align-items: center; gap: 8px; font-family: var(--rund); font-weight: 800; font-size: 22px; }
.marke img { width: 30px; height: 30px; border-radius: 9px; }
.kopf-zeile .spacer { flex: 1; }
.ikon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--karte); box-shadow: var(--schatten); }
.ikon:active { transform: scale(.94); }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--c, var(--gruen)); flex: none; }
.avatar.gross { width: 34px; height: 34px; font-size: 15px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--karte); box-shadow: var(--schatten); font-weight: 600; font-size: 15px; white-space: nowrap; scroll-snap-align: start; border: 2px solid transparent; }
.tab .zahl { font-size: 12px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--karte2); color: var(--muted); text-align: center; }
.tab.aktiv { border-color: var(--lc, var(--gruen)); background: color-mix(in srgb, var(--lc, var(--gruen)) 12%, var(--karte)); }
.tab.aktiv .zahl { background: var(--lc, var(--gruen)); color: #fff; }
.tab.neu-liste { color: var(--muted); font-weight: 500; }
.tab .punkt { width: 7px; height: 7px; border-radius: 50%; background: var(--rot); }

/* ---------- Banner ---------- */
#banner { padding: 0 16px; }
.banner { margin: 8px 0 0; padding: 12px 14px; border-radius: var(--r); display: flex; gap: 10px; align-items: center; font-size: 14px; line-height: 1.35; }
.banner.live { background: var(--gruen-t); color: var(--gruen-d); }
.banner.live .puls { width: 10px; height: 10px; border-radius: 50%; background: var(--gruen); flex: none; animation: puls 1.6s infinite; }
.banner.offline { background: var(--gold-t); color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
.banner.info { background: var(--karte); box-shadow: var(--schatten); }
.banner .x { margin-left: auto; opacity: .6; padding: 4px 6px; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gruen) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Inhalt ---------- */
#inhalt { padding: 6px 16px calc(var(--leiste-h) + var(--unten) + 40px); max-width: 720px; margin: 0 auto; }
.listen-titel { display: flex; align-items: center; gap: 10px; margin: 14px 2px 6px; }
.listen-titel h1 { font-size: 26px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listen-titel .sub { font-size: 13px; color: var(--muted); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; background: var(--karte); box-shadow: var(--schatten); font-weight: 600; }
.knopf.primaer { background: var(--gruen); color: #fff; box-shadow: none; }
.knopf.gefahr { color: var(--rot); }
.knopf.flach { box-shadow: none; background: var(--karte2); }
.knopf.breit { width: 100%; padding: 14px; font-size: 17px; border-radius: 14px; }
.knopf:active, .rund:active { transform: scale(.97); }
.knopf:disabled { opacity: .5; }

.abschnitt { margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.abschnitt .linie { flex: 1; height: 1px; background: var(--linie); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--karte); box-shadow: var(--schatten); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip small { color: var(--muted); font-weight: 500; }
.chip.faellig { background: var(--gold-t); box-shadow: none; }
.chip.paket { background: var(--gruen-t); color: var(--gruen-d); box-shadow: none; }
.chip:active { transform: scale(.96); }

.gruppe { margin-top: 14px; }
.gruppe-kopf { position: sticky; top: var(--kopf-h); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg); }
.gruppe-kopf .e { font-size: 16px; }
.karte { background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }

.item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; background: var(--karte); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.item + .item { border-top: 1px solid var(--linie); }
.item .check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s, transform .15s; }
.item .check::after { content: ''; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0); margin-top: -3px; transition: transform .18s cubic-bezier(.3, 1.6, .6, 1); }
.item.erledigt .check { background: var(--gruen); border-color: var(--gruen); }
.item.erledigt .check::after { transform: rotate(45deg) scale(1); }
.item .body { flex: 1; min-width: 0; }
.item .z1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.item .name { font-weight: 600; font-size: 17px; word-break: break-word; }
.item .menge { font-size: 14px; font-weight: 700; color: var(--gruen-d); background: var(--gruen-t); padding: 1px 7px; border-radius: 7px; }
.item .z2 { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.item .z2 .avatar { width: 18px; height: 18px; font-size: 10px; }
.tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; }
.tag.dringend { background: var(--rot); color: #fff; }
.tag.neu { background: var(--gold-t); color: var(--gold); }
.item.urgent { box-shadow: inset 4px 0 0 var(--rot); }
.item .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--karte2); }
.item.erledigt .name { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.item.erledigt .menge { opacity: .6; }
.item.erledigt { background: var(--karte2); }
.item .preis { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.item.weg { transition: transform .2s, opacity .2s; opacity: 0; }
.item .wisch { position: absolute; inset: 0; background: var(--rot); color: #fff; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; font-weight: 700; z-index: -1; }
.item.blitz { animation: blitz 1.2s ease; }
@keyframes blitz { 0%, 30% { background: var(--gold-t); } 100% { background: var(--karte); } }

.leer { text-align: center; padding: 48px 20px 24px; color: var(--muted); }
.leer .gross { font-size: 54px; margin-bottom: 8px; }
.leer h2 { color: var(--text); font-size: 20px; margin-bottom: 6px; }

.fuss-info { display: flex; justify-content: space-between; gap: 12px; margin: 16px 4px 0; font-size: 13px; color: var(--muted); }

/* ---------- Einkaufsmodus ---------- */
body.laden .item { min-height: 66px; padding: 14px 16px; }
body.laden .item .name { font-size: 19px; }
body.laden .item .check { width: 32px; height: 32px; }
.fortschritt { height: 8px; border-radius: 99px; background: var(--linie); overflow: hidden; margin: 10px 16px 2px; }
.fortschritt div { height: 100%; background: var(--gruen); border-radius: 99px; transition: width .35s cubic-bezier(.3, 1.2, .5, 1); }
.laden-kopf { display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.laden-kopf .mitte { flex: 1; text-align: center; min-width: 0; }
.laden-kopf .mitte button { font-family: var(--rund); font-weight: 800; font-size: 19px; }
.laden-kopf .mitte .klein { display: block; color: var(--muted); }

/* ---------- Eingabeleiste ---------- */
#leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 8px 12px calc(10px + var(--unten)); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--linie); }
#leiste > * { max-width: 720px; margin-left: auto; margin-right: auto; }
#vorschlag { padding: 0 2px 8px; }
#vorschlag:empty { display: none; }
#eingabe { display: flex; gap: 8px; align-items: center; }
#feld { flex: 1; min-width: 0; height: 50px; border-radius: 15px; border: 1.5px solid var(--linie); background: var(--karte); padding: 0 16px; font-size: 17px; outline: none; transition: border-color .15s; }
#feld:focus { border-color: var(--gruen); }
.rund { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; background: var(--karte); border: 1.5px solid var(--linie); flex: none; }
.rund.primaer { background: var(--gruen); color: #fff; border-color: var(--gruen); font-size: 28px; font-weight: 300; }
.rund.hoert { background: var(--rot); border-color: var(--rot); animation: puls 1.2s infinite; }
#laden-fuss { padding-top: 8px; }

/* ---------- Sheets ---------- */
.sheet-hg { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 16, .38); opacity: 0; transition: opacity .2s; }
.sheet-hg.auf { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--unten)); transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); max-width: 720px; margin: 0 auto; overscroll-behavior: contain; }
.sheet.auf { transform: none; }
.sheet .griff { width: 40px; height: 5px; border-radius: 9px; background: var(--linie); margin: 2px auto 12px; }
.sheet h2 { font-size: 21px; margin-bottom: 14px; }
.sheet .menue { display: flex; flex-direction: column; background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }
.sheet .menue button, .sheet .menue a { display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-align: left; font-size: 16px; font-weight: 500; color: inherit; text-decoration: none; }
.sheet .menue > * + * { border-top: 1px solid var(--linie); }
.sheet .menue .e { width: 26px; text-align: center; font-size: 19px; }
.sheet .menue .rechts { margin-left: auto; color: var(--muted); font-size: 14px; }
.feldgruppe { margin-bottom: 14px; }
.feldgruppe > label, .feldgruppe > .label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 2px 6px; }
.eingabe, select.eingabe, textarea.eingabe { width: 100%; height: 48px; border-radius: 13px; border: 1.5px solid var(--linie); background: var(--karte); padding: 0 14px; font-size: 17px; outline: none; }
textarea.eingabe { height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.eingabe:focus { border-color: var(--gruen); }
.reihe { display: flex; gap: 10px; align-items: center; }
.reihe > * { flex: 1; min-width: 0; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--linie); border-radius: 13px; background: var(--karte); height: 48px; overflow: hidden; }
.stepper button { width: 46px; height: 100%; font-size: 22px; color: var(--gruen); }
.stepper input { flex: 1; min-width: 0; width: 100%; border: 0; text-align: center; font-size: 17px; font-weight: 600; background: none; outline: none; }
.schalter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; background: var(--karte); border-radius: 13px; border: 1.5px solid var(--linie); font-weight: 500; }
.schalter input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--linie); position: relative; transition: background .2s; flex: none; margin: 0; }
.schalter input::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; }
.schalter input:checked { background: var(--gruen); }
.schalter input.rot:checked { background: var(--rot); }
.schalter input:checked::after { transform: translateX(20px); }
.farben { display: flex; gap: 10px; flex-wrap: wrap; }
.farben button { width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid transparent; outline: 2px solid transparent; }
.farben button.an { outline-color: var(--c); border-color: var(--bg); }
.farben button:disabled { opacity: .25; }
.foto-gross { width: 100%; max-height: 50dvh; object-fit: contain; border-radius: 14px; background: var(--karte2); }
.foto-feld { display: flex; gap: 10px; align-items: center; }
.foto-feld img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.hinweis { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.aktionen { display: flex; gap: 10px; margin-top: 18px; }
.aktionen > * { flex: 1; }
.emoji-wahl { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-wahl button { width: 42px; height: 42px; border-radius: 12px; font-size: 21px; background: var(--karte); border: 2px solid transparent; }
.emoji-wahl button.an { border-color: var(--gruen); background: var(--gruen-t); }
.sortier { display: flex; flex-direction: column; background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }
.sortier > div { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; }
.sortier > div + div { border-top: 1px solid var(--linie); }
.sortier .nr { width: 22px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sortier .t { flex: 1; }
.sortier button { width: 38px; height: 38px; border-radius: 10px; background: var(--karte2); font-size: 16px; }
.sortier button:disabled { opacity: .3; }

/* ---------- Seiten (Einstellungen, Statistik) ---------- */
.seite h1 { font-size: 26px; font-weight: 800; margin: 14px 2px 4px; }
.block { margin-top: 22px; }
.block > h3 { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 4px 8px; }
.liste-menue { display: flex; flex-direction: column; background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); overflow: hidden; }
.liste-menue > * { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; font-size: 16px; min-height: 52px; }
.liste-menue > * + * { border-top: 1px solid var(--linie); }
.liste-menue a { color: inherit; text-decoration: none; }
.liste-menue .rechts { margin-left: auto; color: var(--muted); font-size: 14px; text-align: right; }
.liste-menue .e { width: 24px; text-align: center; font-size: 19px; }

.kacheln { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kachel { background: var(--karte); border-radius: var(--r); box-shadow: var(--schatten); padding: 14px; }
.kachel .wert { font-family: var(--rund); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kachel .was { font-size: 13px; color: var(--muted); }
.balken { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 14px 12px 0; background: var(--karte); border-radius: var(--r) var(--r) 0 0; box-shadow: var(--schatten); }
.balken > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.balken .b { width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--gruen) 35%, transparent); min-height: 3px; transition: height .5s; }
.balken .aktuell .b { background: var(--gruen); }
.balken-achse { display: flex; gap: 6px; padding: 6px 12px 10px; background: var(--karte); border-radius: 0 0 var(--r) var(--r); box-shadow: var(--schatten); font-size: 11px; color: var(--muted); }
.balken-achse > div { flex: 1; text-align: center; }
.rang { display: flex; align-items: center; gap: 10px; }
.rang .leiste { flex: 1; height: 8px; border-radius: 99px; background: var(--linie); overflow: hidden; }
.rang .leiste div { height: 100%; background: var(--c, var(--gruen)); border-radius: 99px; }

/* ---------- Anmeldung ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 40px) 22px 40px; }
.auth .logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: var(--schatten); display: block; margin: 0 auto 16px; }
.auth h1 { text-align: center; font-size: 30px; font-weight: 800; }
.auth p.unter { text-align: center; color: var(--muted); margin: 6px 0 26px; }
.fehler { color: var(--rot); font-size: 14px; margin: 8px 2px; min-height: 1em; }

/* ---------- Toast & Laden ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--leiste-h) + var(--unten) + 18px); transform: translate(-50%, 20px); z-index: 60; background: var(--text); color: var(--bg); padding: 12px 14px 12px 16px; border-radius: 14px; font-size: 15px; display: flex; gap: 14px; align-items: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
#toast.auf { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: color-mix(in srgb, var(--gruen) 60%, var(--bg)); font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) { #toast button { color: var(--gruen-d); filter: brightness(.6); } }
.laden-punkt { width: 36px; height: 36px; margin: 80px auto; border-radius: 50%; border: 3px solid var(--linie); border-top-color: var(--gruen); animation: dreh 0.8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.konfetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.konfetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.2s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (prefers-color-scheme: dark) { .knopf.primaer, .rund.primaer, .tab.aktiv .zahl { color: #0E1A13; } }
