:root {
  --bg: #fff8f3; --karte: #ffffff; --text: #2d2522; --leise: #7d6f69; --linie: #f0e4dc;
  --akzent: #e8735a; --akzent-hell: #fde7df; --gruen: #3f9b6e; --rot: #c94a3a;
  --radius: 16px; --tab-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1d1918; --karte: #2a2422; --text: #f4ece8; --leise: #b3a59e; --linie: #3a322f; --akzent-hell: #4a2c25; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; }
#app { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
h1 { font-size: 1.7rem; margin: 8px 0 14px; }
h2 { font-size: 1.15rem; margin: 26px 0 10px; }
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--leise); text-transform: capitalize; }
small { color: var(--leise); font-size: .82rem; }
p { margin: 6px 0; }
.laden { padding: 40vh 0; text-align: center; color: var(--leise); }
.demo { background: var(--akzent-hell); border-radius: 10px; padding: 6px 10px; font-size: .82rem; margin-bottom: 8px; }
.hinweis { color: var(--leise); font-size: .9rem; }
.mitte { display: block; text-align: center; }
.rot { color: var(--rot); }

.karte { background: var(--karte); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.karte .kopf { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin-bottom: 6px; gap: 8px; }
.karte img { width: 100%; border-radius: 12px; margin: 6px 0; }

.duell .score { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 4px 0 8px; }
.duell .score > div { text-align: center; opacity: .65; }
.duell .score > div.fuehrt { opacity: 1; }
.duell .score b { display: block; font-size: 2.3rem; line-height: 1; }
.duell .score .fuehrt b { color: var(--akzent); }
.duell .vs { font-size: 1.6rem; opacity: .4 !important; }

.btn { display: block; width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; margin: 8px 0 0; font: inherit; font-weight: 600;
  background: var(--akzent); color: #fff; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.hell { background: var(--akzent-hell); color: var(--text); }
.btn.warn { background: transparent; color: var(--rot); border: 1.5px solid var(--rot); }
.link { background: none; border: 0; color: var(--akzent); font: inherit; padding: 8px; }
.reihe { display: flex; gap: 8px; align-items: flex-end; }
.reihe > * { flex: 1; }
.reihe .btn { width: auto; }
form.reihe .btn { flex: 0 0 auto; padding: 12px 18px; }
.stapel { display: flex; flex-direction: column; gap: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--leise); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); margin-top: 6px; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--karte); border: 1.5px solid var(--linie); border-radius: 12px; padding: 11px 12px; width: 100%; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--akzent); }
.wochen { align-items: center; text-align: center; margin-bottom: 8px; }
.wochen .btn { flex: 0 0 48px; margin: 0; }

.liste { background: var(--karte); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.karte .liste { background: transparent; }
.zeile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.karte .zeile { padding: 10px 0; }
.zeile .txt { flex: 1; display: flex; flex-direction: column; }
.zeile.aufgabe .txt { flex-direction: column; }
.zeile .tag { width: 2.2em; font-weight: 600; }
.zeile.plan select { padding: 8px 10px; }
.zeile.rezept { cursor: pointer; }
.liste.klein .zeile { padding: 7px 0; font-size: .9rem; }
.box { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--akzent); flex: 0 0 22px; }
.box.an { background: var(--akzent); }
.erledigt .txt { text-decoration: line-through; color: var(--leise); }
.leer { color: var(--leise); padding: 12px 14px; margin: 0; }
.pill { border: 0; border-radius: 999px; background: var(--akzent); color: #fff; font: inherit; font-weight: 700; padding: 7px 13px; min-width: 56px; cursor: pointer; }
.pill.aus { background: var(--linie); color: var(--leise); }
.x { border: 0; background: none; color: var(--leise); font-size: 1rem; padding: 4px 8px; cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1.5px solid var(--linie); background: var(--karte); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .88rem; }
.chip.an { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.rezept-detail { padding: 4px 14px 14px; border-bottom: 1px solid var(--linie); font-size: .93rem; }
.rezept-detail ul { margin: 4px 0 8px; padding-left: 18px; }

#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--karte); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
#tabs button { flex: 1; border: 0; background: none; font: inherit; font-size: .68rem; color: var(--leise); padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; height: var(--tab-h); }
#tabs button span { font-size: 1.35rem; filter: grayscale(1); opacity: .6; }
#tabs button.aktiv { color: var(--akzent); font-weight: 600; }
#tabs button.aktiv span { filter: none; opacity: 1; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 30; max-width: 90vw; text-align: center; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.dialog { background: var(--bg); width: 100%; max-width: 640px; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.dialog h2 { margin-top: 0; }
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login .logo { font-size: 3.5rem; }
.zeile a, .hinweis a { color: var(--akzent); font-weight: 600; }
.aufklapp { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 8px; } .aufklapp + .liste { margin-top: 0; }
#tabs[hidden], #toast[hidden] { display: none; }
