/* Training & Essen – mobile App-Optik.
   Warmes Papier-Weiß bzw. tiefes Graphit, eine Schrift (Archivo, schmal für Überschriften und Zahlen),
   Orange als Aktionsfarbe, die Trainingseinheiten in Hantelscheiben-Farben, Ernährungs-Ampel grün/gelb/rot.
   Unten eine feste Tab-Leiste; Heute/Fortschritt/Mehr schmal (36rem), Essen und Einkauf breiter (68rem). */
:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --raise: #fbfaf7;
  --ink: #17191c;
  --muted: #6a6f75;
  --line: #e3e1db;
  --soft: #eeece6;
  --accent: #f0561e;
  --on-accent: #ffffff;
  --accent-soft: #fde6dc;
  --oa: #d8352b;
  --ua: #e09d00;
  --ob: #2161c9;
  --ub: #1f8a52;
  --plate-text: #ffffff;
  --done: #1f8a52;
  --done-soft: #dff1e6;
  --on-done: #ffffff;
  --warn: #9a6a00;
  --warn-soft: #fbefcf;
  --bad: #c9322a;
  --bad-soft: #f9dedb;
  --shadow: 0 1px 2px rgba(23, 25, 28, .05), 0 4px 16px rgba(23, 25, 28, .05);
  --r: 18px;
  --r-s: 12px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e10; --surface: #17191c; --raise: #1d2024; --ink: #eeeeec; --muted: #9ba1a7; --line: #2a2e33; --soft: #22252a;
    --accent: #ff7038; --on-accent: #120a06; --accent-soft: #3a1f14;
    --oa: #ff5d52; --ua: #ffc531; --ob: #67a2ff; --ub: #46c987; --plate-text: #0d0e10;
    --done: #46c987; --done-soft: #15301f; --on-done: #0d0e10; --warn: #ffc531; --warn-soft: #3a2f10; --bad: #ff6b60; --bad-soft: #3d1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e10; --surface: #17191c; --raise: #1d2024; --ink: #eeeeec; --muted: #9ba1a7; --line: #2a2e33; --soft: #22252a;
  --accent: #ff7038; --on-accent: #120a06; --accent-soft: #3a1f14;
  --oa: #ff5d52; --ua: #ffc531; --ob: #67a2ff; --ub: #46c987; --plate-text: #0d0e10;
  --done: #46c987; --done-soft: #15301f; --on-done: #0d0e10; --warn: #ffc531; --warn-soft: #3a2f10; --bad: #ff6b60; --bad-soft: #3d1c1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
[data-w="OA"], [data-w="GA"] { --pc: var(--oa); --pt: var(--plate-text); }
[data-w="OB"], [data-w="GB"] { --pc: var(--ob); --pt: var(--plate-text); }
[data-w="UA"] { --pc: var(--ua); --pt: #1b1400; }
[data-w="UB"] { --pc: var(--ub); --pt: var(--plate-text); }

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); font-stretch: 100%;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 24px);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-stretch: 78%; font-weight: 750; letter-spacing: -.005em; line-height: 1.15; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0; }
a { color: inherit; }
.wrap { width: 100%; max-width: 36rem; margin: 0 auto; padding: 0 16px; }
body[data-view="essen"] .wrap, body[data-view="einkauf"] .wrap { max-width: 68rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; line-height: 1.45; }
.eyebrow { display: block; font-size: .72rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sec-note { margin: 2px 4px 0; }
main { display: grid; gap: 12px; padding-top: 4px; }
.more { display: grid; gap: 12px; padding-top: 4px; }

/* ---------- Kopfzeile ---------- */
.appbar {
  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-top: env(safe-area-inset-top, 0px);
}
.appbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-weight: 800; font-stretch: 80%; font-size: 1.1rem;
}
body[data-profile="her"] .avatar { background: var(--accent); color: var(--on-accent); }
.brand .eyebrow { line-height: 1.1; }
.view-title { font-size: 1.45rem; }
.sync-head {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.sync-head[data-state="ok"] .dot, .dot.on { background: var(--done); box-shadow: 0 0 0 3px var(--done-soft); }
.sync-head[data-state="offline"] .dot { background: var(--warn); }
.sync-head[data-state="pin"] .dot, .sync-head[data-state="setup"] .dot, .sync-head[data-state="locked"] .dot { background: var(--bad); }

/* ---------- Tagesnavigation ---------- */
.daynav { padding-bottom: 12px; }
.daynav-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.date-block h2 { font-size: 1.15rem; font-stretch: 90%; font-weight: 650; }
.daynav-btns { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: inline-grid; place-items: center; padding: 0;
}
.icon-btn svg, .tab svg, .btn svg, .go, .search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; white-space: nowrap;
}
button.pill { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  display: grid; justify-items: center; gap: 1px; padding: 8px 0 7px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); position: relative;
}
.day .dname { font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day .dnum { font-size: 1.15rem; font-weight: 750; font-stretch: 80%; line-height: 1.2; }
.day .dtag { min-width: 26px; height: 18px; padding: 0 5px; border-radius: 6px; font-size: .66rem; font-weight: 750; line-height: 18px; text-align: center; color: var(--muted); }
.day.train .dtag { background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); }
.day.logged .dtag { background: var(--pc); color: var(--pt); }
.day.skipped .dtag { color: var(--muted); }
.day.is-today .dnum { color: var(--accent); }
.day.sel { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day.sel .dname { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.day.sel.is-today .dnum { color: var(--bg); }
.day.sel.train:not(.logged) .dtag { background: var(--pc); color: var(--pt); }

/* ---------- Tab-Leiste ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding: 6px max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: none; padding: 0;
  font-size: .68rem; font-weight: 600; color: var(--muted); border-radius: 12px;
}
.tab svg { width: 24px; height: 24px; padding: 2px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] svg { background: var(--accent-soft); color: var(--accent); border-radius: 9px; width: 44px; padding: 2px 11px; }
@media (min-width: 900px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; width: 480px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); height: var(--tabbar); padding-bottom: 6px; }
}

/* ---------- Karten, Knöpfe, Schalter ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.linkbtn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 650; font-size: .86rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: .92rem;
  text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn.bring { background: #ee524f; border-color: #ee524f; color: #fff; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-row, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; font-size: .68rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.veg { background: var(--done-soft); color: var(--done); }
.tag.frz { background: color-mix(in srgb, var(--ob) 14%, transparent); color: var(--ob); }
.tag.fresh { background: var(--warn-soft); color: var(--warn); }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 14px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: 0; background: none; border-radius: 10px; padding: 8px 12px; font-size: .86rem; font-weight: 650; color: var(--muted); white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.field { display: grid; gap: 6px; font-size: .86rem; font-weight: 600; margin-top: 12px; }
.field input, .search input, select {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); font-size: 1rem;
}
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.saved { min-height: 1.2em; margin-top: 8px; font-size: .86rem; color: var(--done); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 14px); z-index: 40;
  max-width: min(92vw, 30rem); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: .9rem; font-weight: 550; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}

/* ---------- Heute: Trainingskarte ---------- */
.hero { position: relative; overflow: hidden; display: grid; gap: 14px; }
.hero[data-w]::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pc); }
.hero-top { display: flex; gap: 14px; align-items: flex-start; }
.plate {
  width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--pc, var(--ink)); color: var(--pt, var(--bg)); font-weight: 800; font-stretch: 75%; font-size: 1.3rem;
  box-shadow: inset 0 0 0 5px color-mix(in srgb, #000 12%, transparent), inset 0 0 0 9px color-mix(in srgb, #fff 18%, transparent);
}
.hero-txt { min-width: 0; display: grid; gap: 3px; }
.hero h2 { font-size: 1.55rem; }
.focus { color: var(--muted); font-size: .9rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-meta span { font-size: .8rem; font-weight: 650; padding: 5px 10px; border-radius: 999px; background: var(--soft); }
.progress { display: flex; align-items: center; gap: 12px; }
.progress b { font-size: .9rem; font-stretch: 85%; font-weight: 750; white-space: nowrap; min-width: 3.4em; text-align: right; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--done); transition: width .3s ease; }
.skip-btn { justify-self: start; color: var(--muted); }
.hero.is-skipped .plate { opacity: .35; }
.hero.is-skipped h2 { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.hero.rest { gap: 10px; }
.hero.rest h2 { font-size: 1.7rem; }
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tips li { padding-left: 22px; position: relative; font-size: .94rem; }
.tips li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--done); }
.next {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 4px; padding: 12px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--raise);
}
.next .plate { width: 44px; height: 44px; font-size: 1rem; }
.next small { display: block; color: var(--muted); font-size: .78rem; }
.next strong { font-stretch: 85%; font-size: 1.05rem; }
.next .go { margin-left: auto; color: var(--muted); }

.phase summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phase summary .eyebrow { white-space: nowrap; margin-left: auto; }
.phase summary::after { content: "+"; font-weight: 700; color: var(--muted); }
.phase[open] summary::after { content: "–"; }
.phase-name { font-weight: 750; font-stretch: 85%; font-size: 1.02rem; }
.phase p { margin-top: 10px; font-size: .92rem; }
.howto summary { font-weight: 700; font-stretch: 85%; display: flex; justify-content: space-between; }
.howto summary::after { content: "+"; color: var(--muted); }
.howto[open] summary::after { content: "–"; }
.howto p { margin-top: 10px; font-size: .92rem; }

/* ---------- Heute: Essen und Gewicht ---------- */
.meal-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 0;
  border: 0; border-top: 1px solid var(--line); background: none;
}
.meal-row:first-of-type { border-top: 0; }
.mlabel { width: 82px; flex: none; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mname { flex: 1; min-width: 0; font-weight: 650; }
.mname small { display: block; font-weight: 450; color: var(--muted); font-size: .8rem; margin-top: 1px; }
.meal-row.empty .mname { color: var(--accent); }
.meal-row .go { color: var(--muted); }
.meals-day .dayvals { margin: 10px 0 8px; }
.dayvals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.dv { display: grid; justify-items: center; gap: 1px; }
.dv small { font-size: .64rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.v { display: inline-block; min-width: 100%; text-align: center; padding: 3px 4px; border-radius: 8px; font-weight: 750; font-stretch: 85%; font-size: .9rem; font-variant-numeric: tabular-nums; }
.v.g { background: var(--done-soft); color: var(--done); }
.v.y { background: var(--warn-soft); color: var(--warn); }
.v.r { background: var(--bad-soft); color: var(--bad); }
.v.off { background: var(--soft); color: var(--muted); }
.legend .v { min-width: 0; padding: 1px 6px; font-size: .74rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .78rem; color: var(--muted); align-items: center; margin: 4px 4px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.weigh { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 650; }
.weigh span:first-child { flex: 1; }
.weigh input {
  width: 7.5rem; min-height: 50px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--raise);
  font-size: 1.4rem; font-weight: 750; font-stretch: 85%; text-align: right;
}
.weigh .unit { color: var(--muted); font-weight: 650; }

/* ---------- Heute: Übungen ---------- */
.exercises { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ex { display: grid; gap: 12px; transition: border-color .2s; }
.ex.ex-done { border-color: color-mix(in srgb, var(--done) 55%, var(--line)); }
.ex-title { display: flex; align-items: center; gap: 10px; }
.ex-title h3 { flex: 1; min-width: 0; }
.ex-num {
  width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--soft); font-weight: 800; font-stretch: 80%;
}
.ex.ex-done .ex-num { background: var(--done); color: var(--on-done); }
.dose { display: flex; flex-wrap: wrap; gap: 6px; }
.dose span { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.dose .main { background: var(--ink); color: var(--bg); font-weight: 750; }
.ex-img { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ex-img figure { margin: 0; position: relative; border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; border: 1px solid var(--line); }
.ex-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ex-img figcaption { position: absolute; left: 6px; bottom: 6px; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: rgba(23, 25, 28, .72); color: #fff; }
.ex-img.noimg { display: none; }
.cue { font-size: .9rem; color: var(--muted); }
.hint, .target { font-size: .88rem; padding: 10px 12px; border-radius: 12px; }
.hint { background: var(--warn-soft); }
.target { background: var(--accent-soft); }
.last { font-size: .8rem; color: var(--muted); }
.setlog { display: grid; gap: 6px; }
.setrow { display: grid; grid-template-columns: 40px 1fr 1fr 50px; gap: 8px; align-items: center; }
.setrow.head span { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.setrow .sn { text-align: center; font-weight: 750; font-stretch: 80%; color: var(--muted); }
.setrow input {
  width: 100%; min-height: 48px; padding: 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise);
  font-size: 1.2rem; font-weight: 700; font-stretch: 85%; text-align: center; font-variant-numeric: tabular-nums;
}
.setrow input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); font-weight: 500; }
.check {
  width: 50px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  display: grid; place-items: center; padding: 0; color: var(--muted);
}
.check svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.check.on { background: var(--done); border-color: var(--done); color: var(--on-done); }
.setrow.is-done input { background: var(--done-soft); border-color: transparent; color: var(--done); }

/* ---------- Essen ---------- */
.subtabs { max-width: 24rem; }
.range-nav { display: flex; align-items: center; gap: 8px; }
.range-label { flex: 1; min-width: 0; display: grid; }
.range-label b { font-size: 1.15rem; font-stretch: 80%; font-weight: 750; }
.range-label span { font-size: .82rem; color: var(--muted); }
.plan-actions .btn.primary { flex: 1 1 auto; max-width: 22rem; }
.sync-note { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); margin: 0 4px; }
.sync-note.warn { align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--ink); margin: 0; }
.sync-note.warn .dot { margin-top: 6px; background: var(--warn); }
.note-links { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
.targets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.targets li { display: flex; gap: 8px; align-items: baseline; font-size: .82rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.targets li span { color: var(--muted); }
.week { display: grid; gap: 10px; margin-top: 10px; }
.dayrow { display: grid; grid-template-columns: 52px 1fr; gap: 10px 12px; padding: 12px; }
.dayrow.now { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.dr-day { display: grid; align-content: start; justify-items: center; gap: 0; padding-top: 2px; }
.dr-day b { font-size: 1.05rem; font-stretch: 80%; font-weight: 800; text-transform: uppercase; }
.dr-day span { font-size: .78rem; color: var(--muted); }
.badge { margin-top: 4px; font-size: .6rem !important; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: var(--on-accent) !important; }
.dr-slots { display: grid; gap: 6px; min-width: 0; }
.slot {
  display: grid; gap: 2px; text-align: left; width: 100%; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--raise); min-width: 0;
}
.slot .slabel { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.slot .nm { font-weight: 650; font-size: .94rem; line-height: 1.3; }
.slot.empty { border-style: dashed; background: transparent; }
.slot.empty .nm { color: var(--accent); }
.slot.is-rest { background: var(--soft); }
.slot.is-rest .nm { color: var(--muted); }
.span { justify-self: start; font-size: .7rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; margin-top: 2px; }
.span.two { background: var(--accent-soft); color: var(--accent); }
.span.one { background: var(--soft); color: var(--muted); }
.span.rest { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.dr-vals { grid-column: 1 / -1; display: grid; gap: 6px; }
.pvals { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; }
.pname { font-size: .74rem; font-weight: 700; color: var(--muted); text-align: center; }
.avg { display: grid; gap: 8px; margin-top: 10px; }
@media (min-width: 760px) {
  .dayrow { grid-template-columns: 56px minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
  .dr-slots { grid-template-columns: 1fr 1fr; }
  .dr-vals { grid-column: auto; }
  .pvals { grid-template-columns: 42px 1fr; gap: 8px; }
}
.cook-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .cook-list { grid-template-columns: 1fr 1fr; } }
.cook { display: grid; gap: 8px; align-content: start; }
.cook-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.weigh-l { list-style: none; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); display: grid; gap: 4px; }
.weigh-l li { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.weigh-l b { font-stretch: 85%; font-variant-numeric: tabular-nums; }
.prep summary { font-size: .86rem; font-weight: 650; color: var(--accent); }
.prep p { margin-top: 6px; font-size: .9rem; }

/* ---------- Einkauf ---------- */
#shop { display: grid; gap: 12px; }
.trips { max-width: 34rem; }
.shop-controls { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--done); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.shop-bar { display: grid; gap: 12px; position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 5; }
.shop-bar .btn.bring { flex: 1 1 auto; }
.print-head { display: none; }
.shop-groups { display: grid; gap: 10px; align-items: start; }
@media (min-width: 760px) { .shop-groups { grid-template-columns: 1fr 1fr; } }
.sgroup { padding: 14px 14px 6px; }
.sgroup h3 { font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-stretch: 100%; margin-bottom: 4px; }
.sgroup ul { list-style: none; margin: 0; padding: 0; }
.sgroup li + li { border-top: 1px solid var(--line); }
.sitem { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.sitem input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sitem .box { width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; }
.sitem .box svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sitem input:checked + .box { background: var(--done); border-color: var(--done); color: var(--on-done); }
.sitem input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.sitem .nm { flex: 1; min-width: 0; font-weight: 600; }
.sitem .nm small { display: block; font-weight: 450; font-size: .76rem; color: var(--muted); }
.sitem .amt { font-weight: 750; font-stretch: 85%; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sitem.done .nm, .sitem.done .amt { color: var(--muted); text-decoration: line-through; }
.shop-empty { text-align: center; color: var(--muted); }

/* ---------- Rezepte ---------- */
.search { display: flex; align-items: center; gap: 8px; margin-top: 10px; position: relative; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; background: var(--surface); }
.recipes { display: grid; gap: 10px; margin-top: 10px; align-items: start; }
@media (min-width: 760px) { .recipes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .recipes { grid-template-columns: 1fr 1fr 1fr; } }
.rcard { display: grid; gap: 10px; }
.rcard summary, .rcard .rh { display: grid; gap: 6px; }
.rcard h3 { font-size: 1.05rem; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags:empty { display: none; }
.macros { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); }
.macros span { display: grid; justify-items: center; font-weight: 750; font-stretch: 85%; font-size: .92rem; font-variant-numeric: tabular-nums; }
.macros small { font-size: .62rem; font-weight: 650; color: var(--muted); text-transform: uppercase; }
.ing-list { margin: 0; padding-left: 18px; display: grid; gap: 2px; font-size: .9rem; }
.rcard > p { font-size: .9rem; color: var(--muted); }
details.rcard[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.base-card { background: var(--raise); }
.no-hit { text-align: center; margin-top: 10px; }

/* ---------- Auswahldialog ---------- */
dialog {
  width: min(100vw, 40rem); max-width: 100vw; max-height: 92vh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 24px 24px 0 0; background: var(--bg); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
@media (min-width: 700px) { dialog { margin: auto; border-radius: 24px; max-height: 86vh; } }
dialog::backdrop { background: rgba(10, 11, 12, .5); backdrop-filter: blur(2px); }
.dlg { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 16px 10px; }
.dlg-head h2 { font-size: 1.25rem; }
.dlg-head p { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.pick-dur { display: grid; gap: 6px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
.dlg-list { overflow-y: auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.sugg-head { display: flex; justify-content: space-between; align-items: center; }
.sugg { display: grid; gap: 8px; }
.opt {
  display: block; width: 100%; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
}
.opt[aria-current="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .body { display: grid; gap: 5px; }
.opt .t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opt .t b { font-weight: 700; margin-right: 2px; }
.opt .ing { font-size: .8rem; color: var(--muted); }
.opt .row { display: flex; gap: 8px; font-size: .78rem; color: var(--muted); }
.opt .lbl { font-weight: 700; }
.opt .pvals { grid-template-columns: 44px 1fr; gap: 8px; }
.opt.clear { text-align: center; color: var(--muted); font-weight: 650; border-style: dashed; background: transparent; }
.all-dishes { border-top: 1px solid var(--line); padding-top: 10px; }
.all-dishes summary { font-weight: 650; font-size: .9rem; color: var(--accent); padding: 4px 0; }
.all-list { display: grid; gap: 8px; margin-top: 8px; }

/* ---------- Fortschritt ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.tile .k { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile .v { min-width: 0; text-align: left; padding: 0; font-size: 2rem; font-weight: 800; font-stretch: 75%; line-height: 1.1; }
.tile .s { font-size: .78rem; color: var(--muted); }
.chart-card { display: grid; gap: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chart-head select { width: auto; max-width: 60%; min-height: 38px; font-size: .88rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 500 11px var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .09; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .raw { fill: var(--muted); opacity: .45; }
.chart .dot-end { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.chart .end-label { fill: var(--ink); font: 750 14px var(--font); font-stretch: 80%; }
.chart .goal-line { stroke: var(--done); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .goal-label { fill: var(--done); font: 650 11px var(--font); }
.chart .bar-plan { fill: var(--soft); }
.chart .bar-done { fill: var(--done); }
.chart .bar-cur { fill: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fact { padding: 10px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line); display: grid; gap: 2px; }
.fact .k { font-size: .68rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fact .v { min-width: 0; text-align: left; padding: 0; font-size: 1.1rem; font-weight: 800; font-stretch: 80%; }
.up { color: var(--done); }
.verdict { font-size: .9rem; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.goal { display: grid; gap: 10px; }
.goal-row { display: flex; justify-content: space-between; font-size: .9rem; }
.empty-state { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 28px 18px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td .sub { display: block; font-size: .76rem; color: var(--muted); }
tr.cur td { background: var(--accent-soft); font-weight: 650; }

/* ---------- Mehr ---------- */
.more > .card > h2, .more details summary { margin-bottom: 4px; }
.more details summary { font-weight: 750; font-stretch: 85%; font-size: 1.1rem; display: flex; justify-content: space-between; }
.more details summary::after { content: "+"; color: var(--muted); }
.more details[open] summary::after { content: "–"; }
.details-body { display: grid; gap: 10px; margin-top: 10px; font-size: .92rem; }
.details-body ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.sync-state { margin: 6px 0 4px; font-weight: 650; }
.sync-state[data-state="ok"] { color: var(--done); }
.sync-state[data-state="pin"], .sync-state[data-state="setup"], .sync-state[data-state="locked"] { color: var(--bad); }
.sync-form { display: grid; gap: 10px; }
.sync-form .field { margin-top: 0; }
.targets-card { display: grid; gap: 12px; }
.tgt { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); }
.tgt-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tgt-h b { font-size: 1.05rem; }
.tgt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tgt-grid span { display: grid; }
.tgt-grid b { font-size: 1.25rem; font-weight: 800; font-stretch: 78%; }
.tgt-grid small { font-size: .7rem; color: var(--muted); }
.credits { font-size: .78rem; color: var(--muted); text-align: center; padding: 8px 0; }

/* ---------- Druck: nur die Einkaufsliste ---------- */
@media print {
  @page { margin: 14mm; }
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] { color-scheme: light; --ink: #000; --muted: #333; --line: #999; --surface: #fff; --bg: #fff; --soft: #fff; --raise: #fff; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; padding: 0; }
  body[data-view="einkauf"] > *:not(main), body[data-view="einkauf"] main > *:not(#shop),
  #shop > *:not(.print-head):not(.shop-groups), .toast, dialog, .tabbar, .appbar { display: none !important; }
  .wrap, body[data-view="einkauf"] .wrap { max-width: none; padding: 0; }
  .print-head { display: block; margin: 0 0 8px; font-size: 10pt; }
  .shop-groups { display: block; columns: 2; }
  .card { border: 1px solid #000; border-radius: 6px; box-shadow: none; break-inside: avoid; margin-bottom: 8px; }
  .sitem, .sitem * { color: #000 !important; }
  .sitem { padding: 4px 2px; }
  .sitem .box { width: 12px; height: 12px; border: 1px solid #000; border-radius: 2px; }
}
