/* Laurus — Design-Finale Richtung H (entschieden 31.07.2026, ersetzt C):
   reines Schwarz, edle Karten (Haarkante + Licht oben + Tiefe), FARBE =
   BEDEUTUNG wie Apple Health: Blau Lernen, Orange Gewohnheiten, Pink
   Bewegung, Grün Essen, Lila Termine. Jade nur noch Marke (Logo, XP).
   Token-NAMEN unverändert — die Werte tragen die neue Welt. */

:root {
  --bg: #000000;
  --card: #151517;
  --card2: #222226;
  --card3: #2c2c30;
  --label: #ffffff;
  --label2: rgba(235,235,245,.64);
  --label3: rgba(235,235,245,.38);
  --sep: rgba(255,255,255,.09);
  /* Bereichsfarben (Bedeutung, app-weit fix) */
  --blau: #0a84ff;   /* Lernen + generelle Aktionen (iOS-Systemblau) */
  --blau2: #409cff;
  --gruen: #4ade80;  /* Essen */
  --orange: #ff9f0a; /* Gewohnheiten + Serie */
  --rot: #ff375f;    /* Bewegung */
  --lila: #bf5af2;   /* Termine/Plan */
  --teal: #64d2ff;
  /* Marke: Jade nur für Logo + XP-Währung */
  --jade: #34d99b;
  --jade-deep: #12a06e;
  --jade-hell: #7cf0c6;
  --jade-glow: rgba(52,217,155,.35);
  --jade-verlauf: linear-gradient(180deg, var(--jade), var(--jade-deep));
  --tint: var(--blau);
  --tint-dunkel: #ffffff;      /* Text AUF Tint-Flächen */
  /* Edles Karten-Material: Verlauf + Haarkante + Licht oben + Tiefenschatten */
  --mat: linear-gradient(180deg, #19191c, #141416);
  --kante: inset 0 0 0 0.5px rgba(255,255,255,.09), inset 0 1px 0 rgba(255,255,255,.07), 0 8px 22px rgba(0,0,0,.45);
  --glas: rgba(21,21,23,.9);
  --glas-stark: rgba(21,21,23,.94);
  --glas-hell: rgba(44,44,48,.6);
  --glas-kante: inset 0 0 0 0.5px rgba(255,255,255,.09), inset 0 1px 0 rgba(255,255,255,.07);
  --glas-blur: blur(22px) saturate(160%);
  /* Alt-Aliase (von app.js-Klassen genutzt) */
  --accent: var(--blau); --accent2: var(--blau2); --ok: var(--gruen);
  --warn: var(--orange); --xp: var(--jade); --dim: var(--label2);
  --ios-kurve: cubic-bezier(0.32, 0.72, 0, 1);
}

/* touch-action: manipulation schaltet den Doppeltipp-Zoom ab (Gianis Wunsch:
   fix formatiert wie eine native App) — Scrollen bleibt unberührt, die
   nav-Regel (touch-action: none) gewinnt als spezifischerer Selektor. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--label);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.2px;
  max-width: 640px; margin: 0 auto; padding: 6px 16px 122px;
  -webkit-font-smoothing: antialiased;
  position: relative; min-height: 100vh;
  overflow-x: hidden; /* Apple-Apps scrollen nie horizontal */
  /* Gianis Gerätefund 02.08.: Überziehen nach oben löste iOS' Pull-to-Refresh
     aus — die App lud komplett neu und hing („über der oberen Grenze, lädt
     lange"). Kein Überscroll-Verhalten nach außen weiterreichen. */
  overscroll-behavior-y: none;
}
html { overscroll-behavior-y: none; }
/* Jade-Glow oben — als FIXES Viewport-Element statt Body-Hintergrund:
   scrollt nicht mit, wird genau einmal gerastert. Der Body-Verlauf über die
   volle Seitenhöhe war Gianis Lag-Quelle bei schnellen Wischern (28.07.). */
body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 48vh;
  background: radial-gradient(120% 100% at 50% -15%, rgba(52,217,155,.13), transparent 62%);
  pointer-events: none; z-index: -1;
}

/* ---------- Header: Laurus-Knopf (öffnet Fächer) + Chips ---------- */
/* KEIN backdrop-filter auf sticky (Perf-Lehre 28.07.) — solider Verlauf. */
header { position: sticky; top: 0; z-index: 20; background: linear-gradient(#000 78%, rgba(0,0,0,.6) 92%, transparent); padding: calc(10px + env(safe-area-inset-top)) 0 10px; }
.kopfzeile { display: flex; align-items: center; gap: 8px; }
.laurus-btn {
  display: flex; align-items: center; gap: 7px; border: none; color: var(--label);
  background: var(--mat); border-radius: 20px; padding: 7px 12px 7px 9px;
  box-shadow: var(--kante); transition: transform .12s var(--ios-kurve);
}
.laurus-btn:active { transform: scale(.96); }
.laurus-btn b { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.laurus-btn .logo-zeichen { display: block; width: 23px; height: 23px; }
.laurus-btn .lb-chev { width: 12px; height: 12px; stroke: var(--label3); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ios-kurve); }
body.fan-offen .laurus-btn .lb-chev { transform: rotate(180deg); }
.kopf-spacer { flex: 1; }
#datum { letter-spacing: -0.2px; }
.datumzeile { font-size: 13.5px; font-weight: 600; color: var(--label2); text-align: center; margin-top: 12px; }
.datumzeile b { color: var(--xp); font-weight: 750; }

.streak-flamme {
  font-size: 13px; font-weight: 700; color: var(--orange);
  background: #1c1509; border: none; border-radius: 999px; padding: 6px 12px; white-space: nowrap;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 .5px rgba(255,159,10,.25), inset 0 1px 0 rgba(255,255,255,.05);
}
.streak-flamme.kalt { color: var(--label3); background: var(--card); box-shadow: var(--glas-kante); }
.level-badge {
  background: var(--card); border: none; border-radius: 999px; padding: 5px 12px; text-align: right; white-space: nowrap;
  display: flex; align-items: baseline; gap: 6px; box-shadow: var(--glas-kante);
}
.level-badge .lvl { font-size: 13px; font-weight: 750; color: var(--label); font-variant-numeric: tabular-nums; }
.level-badge .titel { font-size: 11.5px; color: var(--label2); font-weight: 600; }
.xp-bar { height: 4px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.xp-bar > div { height: 100%; background: var(--jade-verlauf); border-radius: 99px; transition: width .5s var(--ios-kurve); }
.xp-zeile { display: flex; justify-content: space-between; font-size: 12px; color: var(--label3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.xp-zeile b { color: var(--label2); font-weight: 600; }

/* ---------- Dreifach-Ring (Richtung H): Blau Lernen · Orange Gewohnheiten · Pink Bewegung ---------- */
.held2 { text-align: center; padding: 6px 0 2px; }
.ringwrap3 { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.ringwrap3 > svg { transform: rotate(-90deg); display: block; }
.r3-spur { fill: none; stroke-width: 13; }
.r3-spur.lernen { stroke: rgba(10,132,255,.16); }
.r3-spur.gw { stroke: rgba(255,159,10,.16); }
.r3-spur.koerper { stroke: rgba(255,55,95,.16); }
.r3-voll { fill: none; stroke-width: 13; stroke-linecap: round; transition: stroke-dashoffset .7s var(--ios-kurve); }
.r3-voll.lernen { stroke: var(--blau); }
.r3-voll.gw { stroke: var(--orange); }
.r3-voll.koerper { stroke: var(--rot); }
.ring-mitte { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-proz { font-size: 37px; font-weight: 800; letter-spacing: -0.04em; line-height: .92; font-variant-numeric: tabular-nums; }
.ring-proz small { font-size: 15px; font-weight: 700; color: var(--label2); margin-left: 2px; }
.ring-cap { font-size: 11px; font-weight: 600; color: var(--label3); margin-top: 4px; letter-spacing: .01em; }
.held2 .xp-bar { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .r3-voll { transition: none; } }

/* ---------- Wave 5: Motion aus der Demo (nur transform/opacity) ---------- */
/* Atmendes Licht hinter dem Ring — leise Lebendigkeit */
.held2 { position: relative; }
.atem {
  position: absolute; left: 50%; top: 100px; width: 240px; height: 240px;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(52,217,155,.09), transparent 65%);
  animation: atmen 5s ease-in-out infinite;
}
@keyframes atmen {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .7; }
  50% { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
}

/* Halten-zum-Abhaken: Ring füllt sich unterm Daumen */
.jd-halt { position: relative; width: 52px; height: 52px; flex: none; border: 0; background: none; cursor: pointer; padding: 0; }
.jd-halt .jh-ring { position: absolute; inset: 0; transform: rotate(-90deg); display: block; }
.jd-halt .jh-spur { fill: none; stroke: rgba(10,132,255,.18); stroke-width: 3.5; }
.jd-halt .jh-voll { fill: none; stroke: #0a6fdd; stroke-width: 3.5; stroke-linecap: round; }
.jd-halt .kern {
  position: absolute; inset: 5px; border-radius: 50%;
  background: linear-gradient(180deg, #409cff, #0a6fdd); display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 16px rgba(10,111,221,.35);
  transition: transform .18s var(--ios-kurve);
}
.jd-halt.druck .kern { transform: scale(.88); }
.jd-halt .kern svg { width: 19px; height: 19px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Partikel-Burst + XP-Kugel (fixe Elemente, selbstentfernend) */
.part {
  position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; z-index: 60;
  animation: part-flieg .8s var(--ios-kurve) forwards;
}
@keyframes part-flieg { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.orb {
  position: fixed; width: 14px; height: 14px; border-radius: 50%; pointer-events: none; z-index: 60;
  background: radial-gradient(circle at 35% 30%, #7cf0c6, #12a06e);
  box-shadow: 0 0 12px rgba(52,217,155,.8);
  transition: all .75s cubic-bezier(.4, 0, .7, .4);
}
.level-badge { transition: transform .3s var(--ios-kurve); }
.level-badge.puls { transform: scale(1.15); }

/* Feder-Pop beim Abhaken eines Gewohnheits-Kreises */
.gwk.done .k { animation: gwk-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes gwk-pop { 0% { transform: scale(.75); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Karten schweben beim App-Start gestaffelt ein (Klasse fällt nach 1,4 s) */
body.start-anim #jetzt-dran, body.start-anim .gwbox, body.start-anim .grid2, body.start-anim #bosse {
  animation: karte-rein .6s var(--ios-kurve) backwards;
}
body.start-anim .gwbox { animation-delay: .1s; }
body.start-anim .grid2 { animation-delay: .18s; }
body.start-anim #bosse { animation-delay: .26s; }
@keyframes karte-rein { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  .atem, .part, .gwk.done .k { animation: none; }
  body.start-anim #jetzt-dran, body.start-anim .gwbox, body.start-anim .grid2, body.start-anim #bosse { animation: none; }
  .orb { display: none; }
}

/* ---------- Jetzt dran (Things-3-Muster) ---------- */
.jetzt {
  display: flex; align-items: center; gap: 14px; margin: 15px 0 0; border-radius: 20px; padding: 15px 16px;
  background: var(--mat); box-shadow: var(--kante); cursor: pointer;
}
.jd-ring { position: relative; width: 46px; height: 46px; flex: none; }
.jd-ring svg { transform: rotate(-90deg); display: block; }
.jd-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--blau2); font-variant-numeric: tabular-nums; }
.jetzt .tx { flex: 1; min-width: 0; }
.jetzt .tx small { font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--blau2); }
.jetzt.fertig .tx small { color: var(--gruen); }
.jetzt .tx b { display: block; font-size: 15.5px; letter-spacing: -0.02em; margin-top: 2px; overflow-wrap: break-word; }
.jetzt .tx span { font-size: 12px; color: var(--label3); font-weight: 600; }
.jd-check {
  width: 46px; height: 46px; border-radius: 50%; flex: none; border: none;
  background: linear-gradient(180deg, #409cff, #0a6fdd); display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 5px 16px rgba(10,111,221,.35);
  transition: transform .12s var(--ios-kurve);
}
.jd-check:active { transform: scale(.92); }
.jd-check svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.jetzt.fertig .jd-check { background: linear-gradient(180deg, #4ade80, #1f8a48); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* ---------- Gewohnheiten-Kreise (Streaks-Muster) ---------- */
.gwbox { margin-top: 12px; }
.gwbox .gw-titel { color: var(--orange); }
.gwreihe { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 4px 0 14px; }
.gwk { display: grid; justify-items: center; gap: 6px; border: none; background: none; color: var(--label); cursor: pointer; }
.gwk .k {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #101012; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14);
  transition: transform .12s var(--ios-kurve);
}
.gwk:active .k { transform: scale(.92); }
.gwk.done .k { background: linear-gradient(180deg, #ffb340, #f08f00); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 5px 14px rgba(240,143,0,.28); }
.gwk .k svg { width: 22px; height: 22px; stroke: var(--label3); stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.gwk .k b { font-size: 19px; font-weight: 750; color: var(--label3); }
.gwk.done .k svg { stroke: #221500; }
.gwk.done .k b { color: #221500; }
.gwk i { font-style: normal; font-size: 10px; font-weight: 600; color: var(--label3); text-align: center; line-height: 1.15; max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
.gwk.done i { color: var(--label2); }

/* ---------- Widget-Grid: Essen + Steht an ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.widget2 { border-radius: 20px; padding: 14px 15px; background: var(--mat); box-shadow: var(--kante); }
.widget2 .wh { font-size: 11.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; display: flex; gap: 7px; align-items: center; }
.widget2 .wh .dot { width: 7px; height: 7px; border-radius: 50%; }
.w-essen .wh { color: var(--gruen); } .w-essen .dot { background: var(--gruen); }
.w-plan .wh { color: var(--lila); } .w-plan .dot { background: var(--lila); }
.we-inhalt { display: flex; align-items: center; gap: 12px; margin-top: 11px; }
.we-ring { position: relative; width: 58px; height: 58px; flex: none; }
.we-ring svg { transform: rotate(-90deg); display: block; }
.we-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--gruen); font-variant-numeric: tabular-nums; }
.we-zahlen b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.we-zahlen span { font-size: 10.5px; color: var(--label3); font-weight: 600; }
.we-plus {
  margin-top: 11px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 14px; padding: 8px; border: none; width: 100%;
  background: #0e1f15; box-shadow: inset 0 0 0 .5px rgba(74,222,128,.3);
  color: var(--gruen); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.wp-item { display: flex; gap: 9px; align-items: baseline; padding: 8px 0 0; }
.wp-item b { font-size: 12px; font-weight: 800; color: var(--lila); font-variant-numeric: tabular-nums; flex: none; }
.wp-item span { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.wp-leer { font-size: 12.5px; color: var(--label3); font-weight: 600; padding-top: 10px; }
.wp-mehr { margin-top: 10px; font-size: 11px; color: var(--label3); font-weight: 600; background: none; border: none; padding: 0; cursor: pointer; }

/* ---------- Phasen-Band (Bereich 3): Info statt Denkmal ---------- */
.band {
  display: flex; align-items: center; gap: 9px; margin-top: 12px; border-radius: 16px; padding: 10px 14px;
  background: #0d1626; box-shadow: inset 0 0 0 .5px rgba(64,156,255,.25);
}
.band svg { width: 16px; height: 16px; stroke: var(--blau2); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.band .bt { flex: 1; font-size: 12.5px; color: var(--label2); font-weight: 600; line-height: 1.35; }
.band .bt b { color: var(--label); }
.band .bbar { width: 54px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; flex: none; }
.band .bbar > div { height: 100%; background: var(--blau); border-radius: 99px; }

/* Klausurphasen-Abschluss (Feature #7, 07.08.): faktenbasierte Rückschau,
   ruhig, kein neues "nächstes Ziel" (das ist Gianis Entscheidung). */
#phasen-archiv { position: relative; margin-top: 12px; border-radius: 18px; padding: 15px 16px; background: var(--mat); box-shadow: var(--kante); }
.pa-zu { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 50%; border: none; background: var(--card2); color: var(--label3); font-size: 12px; cursor: pointer; }
.pa-kopf { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; padding-right: 30px; }
.pa-kopf svg { width: 18px; height: 18px; stroke: var(--gruen); stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pa-zeile { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.pa-zeile b { font-size: 21px; font-weight: 800; color: var(--gruen); letter-spacing: -0.03em; }
.pa-zeile span { font-size: 12.5px; color: var(--label2); font-weight: 600; }
.pa-klausuren { font-size: 12px; color: var(--label3); font-weight: 600; margin-top: 6px; }

/* ---------- Laurus-Fächer (Bereich 2) ---------- */
#fan-back { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.62); opacity: 0; pointer-events: none; transition: opacity .22s var(--ios-kurve); }
#fan { position: fixed; top: calc(58px + env(safe-area-inset-top)); left: 16px; z-index: 41; display: grid; gap: 9px; opacity: 0; pointer-events: none; }
body.fan-offen #fan-back, body.fan-offen #fan { opacity: 1; pointer-events: auto; }
.fk {
  display: flex; align-items: center; gap: 11px; border: none; color: var(--label); text-align: left;
  border-radius: 18px; padding: 12px 16px 12px 12px; background: var(--mat); box-shadow: var(--kante); min-width: 214px;
}
body.fan-offen .fk { animation: fk-ein .3s cubic-bezier(.22, 1.2, .36, 1) backwards; }
body.fan-offen .fk:nth-child(1) { animation-delay: .02s; } body.fan-offen .fk:nth-child(2) { animation-delay: .06s; }
body.fan-offen .fk:nth-child(3) { animation-delay: .1s; } body.fan-offen .fk:nth-child(4) { animation-delay: .14s; }
@keyframes fk-ein { from { transform: translateY(-14px) scale(.92); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body.fan-offen .fk { animation: none; } #fan-back { transition: none; } }
.fk .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.fk .ic svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.fk-essen .ic { background: linear-gradient(180deg, #34c06b, #1f8a48); }
.fk-akt .ic { background: linear-gradient(180deg, #ff5c7c, #d92a52); }
.fk-gewicht .ic { background: linear-gradient(180deg, #c576ff, #9333ea); }
.fk-fokus .ic { background: linear-gradient(180deg, #409cff, #0a6fdd); }
.fk-demo .ic { background: linear-gradient(180deg, #7cf0c6, #12a06e); }
.fk-einst .ic { background: linear-gradient(180deg, #9ba3ae, #5c636e); }

/* ---------- Einstellungen (neu, 07.08.) ---------- */
.ez-form { padding-top: 4px; }
.ez-zeile { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 0.5px solid var(--sep); }
.ez-zeile:first-child { border-top: none; }
.ez-zeile label { flex: 1; font-size: 15px; }
.ez-zeile input { width: 84px; text-align: right; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.ez-zeile span { font-size: 13px; color: var(--label3); min-width: 44px; }
.ez-fehler { min-height: 16px; font-size: 13px; color: var(--rot); margin-top: 4px; }
.ez-toggle-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 0.5px solid var(--sep); font-size: 15px; cursor: pointer; }
.ez-toggle-zeile:first-child { border-top: none; }
.ez-toggle-zeile input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--tint); }
.fk .ft b { font-size: 14.5px; font-weight: 700; display: block; }
.fk .ft span { display: block; font-size: 11px; color: var(--label3); font-weight: 600; margin-top: 1px; }
#fan-bereiche {
  margin-top: 6px; border-radius: 18px; background: var(--mat); box-shadow: var(--kante);
  padding: 4px 6px; display: grid;
}
#fan-bereiche:empty { display: none; }
.fan-bereich {
  border: none; background: none; color: var(--label2); text-align: left; cursor: pointer;
  font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: 12px;
}
.fan-bereich:active { background: var(--card2); color: var(--label); }
body.fan-offen #fan-bereiche { animation: fk-ein .3s cubic-bezier(.22, 1.2, .36, 1) .18s backwards; }
@media (prefers-reduced-motion: reduce) { body.fan-offen #fan-bereiche { animation: none; } }

/* ---------- Grouped Sections: satte Karten mit Innenkante (Richtung C) ---------- */
section {
  background: var(--card); border: none; border-radius: 20px; padding: 4px 17px; margin-bottom: 16px;
  box-shadow: var(--glas-kante);
}
h2 {
  font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em;
  color: var(--label3); padding: 13px 0 6px; display: flex; justify-content: flex-start; align-items: baseline; gap: 8px;
}
h2 > :last-child { margin-left: auto; }
h2 .meta { text-transform: none; letter-spacing: -0.1px; font-size: 13px; }

/* Einklappbare Sektionen (iOS-Settings-Gefühl): Chevron im Header, Zustand bleibt gemerkt */
section[data-akk] h2 { cursor: pointer; user-select: none; }
.akk-chev {
  color: var(--label3); font-size: 16px; font-weight: 400; line-height: 1;
  transform: rotate(90deg); transition: transform .25s var(--ios-kurve);
  align-self: center;
}
section.zu .akk-chev { transform: rotate(0deg); }
/* !important, weil einzelne Kinder (Sparkline, Ziel-Balken) per Inline-Style ein-/ausgeblendet werden */
section.zu > *:not(h2) { display: none !important; }
section.zu h2 { padding-bottom: 12px; }
.meta { font-size: 13px; color: var(--label2); }
.xp-tag { font-size: 12px; color: var(--label3); white-space: nowrap; font-weight: 500; text-transform: none; letter-spacing: 0; }
.leer-hinweis { color: var(--label3); padding: 10px 0 14px; font-size: 15px; }

/* ---------- Listen-Zeilen (Reminders-Stil) ---------- */
ul { list-style: none; }
li.item {
  display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 8px 0;
  border-top: 0.5px solid var(--sep); cursor: pointer; user-select: none;
  transition: background .15s;
}
li.item:first-child { border-top: none; }
li.item:active { background: rgba(255,255,255,.04); }
.box {
  width: 25px; height: 25px; min-width: 25px; border-radius: 50%;
  border: 2px solid rgba(220,232,226,.28); display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: transparent; transition: all .18s var(--ios-kurve);
}
li.done .box {
  background: linear-gradient(180deg, #409cff, #0a6fdd); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25); animation: check-pop .28s var(--ios-kurve);
}
@keyframes check-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.15); } 100% { transform: scale(1); } }
li.done .lbl { color: var(--label3); text-decoration: line-through; text-decoration-color: rgba(220,232,226,.25); }
.lbl { flex: 1; font-size: 16px; font-weight: 550; letter-spacing: -0.015em; min-width: 0; overflow-wrap: break-word; }
.streak {
  font-size: 12px; font-weight: 750; color: var(--orange); white-space: nowrap; font-variant-numeric: tabular-nums;
  background: rgba(255,159,10,.12); padding: 4px 10px; border-radius: 999px;
}
.del { background: none; border: none; color: var(--label3); font-size: 16px; cursor: pointer; padding: 6px 4px; }
.del:active { color: var(--rot); }

#fokus-text { font-size: 17px; font-weight: 600; padding: 4px 0 14px; letter-spacing: -0.3px; }
#fokus-text.leer { color: var(--label3); font-weight: 400; }
#journal { font-size: 14px; color: var(--label2); padding-bottom: 14px; }
#journal .jt { color: var(--label); font-weight: 600; margin-bottom: 6px; letter-spacing: -0.2px; }
#journal p { margin-bottom: 4px; }

/* ---------- Formulare ---------- */
input, select {
  background: var(--card2); border: none; border-radius: 10px;
  color: var(--label); padding: 11px 13px; font-size: 16px; outline: none; width: 100%;
  letter-spacing: -0.2px;
}
input::placeholder { color: var(--label3); }
input:focus { box-shadow: 0 0 0 1.5px var(--tint) inset; }
.knopf {
  background: linear-gradient(180deg, #409cff, #0a6fdd); border: none; border-radius: 999px; color: #fff;
  padding: 11px 18px; font-size: 15.5px; font-weight: 700; cursor: pointer;
  transition: opacity .12s, transform .12s; letter-spacing: -0.2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.knopf:active { opacity: .75; transform: scale(.97); }
.knopf.sekundaer { background: var(--card2); color: var(--blau2); box-shadow: var(--glas-kante); }
.zeile { display: flex; gap: 9px; margin: 8px 0 12px; }
.zeile > input { flex: 1; }

/* ---------- Tab-Bar: schwebende Liquid-Glass-Kapsel (iOS 26/27) ---------- */
nav {
  /* Tiefer wie Apples schwebende Tab-Bar: knapp über den Home-Indicator statt
     komplett über der Safe-Area (iPhone 16 Pro: 20px statt 40px vom Rand). */
  position: fixed; bottom: max(8px, calc(env(safe-area-inset-bottom) - 14px)); left: 50%; transform: translateX(-50%);
  width: min(calc(100% - 28px), 520px); z-index: 30;
  background: var(--glas-stark);
  backdrop-filter: var(--glas-blur); -webkit-backdrop-filter: var(--glas-blur);
  border: none; border-radius: 999px;
  box-shadow: var(--glas-kante), 0 12px 34px rgba(0,0,0,.5);
  display: flex; justify-content: space-around;
  padding: 7px 10px;
  /* Wischen auf der Leiste darf NICHT die Seite dahinter scrollen (iOS reicht
     die Geste sonst durch) — Tipps funktionieren weiter normal. */
  touch-action: none;
}
/* Unsichtbare Fangzone um die Pille: schluckt Tipps und Wischer knapp daneben
   und darunter (Home-Indicator-Bereich), statt sie den Inhalt dahinter treffen
   zu lassen. z-index -1 hält sie hinter den Buttons. */
nav::after {
  content: ""; position: absolute; z-index: -1;
  left: -14px; right: -14px; top: -4px;
  bottom: calc(-10px - env(safe-area-inset-bottom));
}
nav button {
  flex: 1; max-width: 160px; background: none; border: none; color: var(--label2);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0; padding: 4px 2px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color .15s;
}
nav button .ikon { width: 26px; height: 26px; display: grid; place-items: center; }
nav button .ikon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav button .ikon svg .voll { fill: currentColor; stroke: none; }
nav button { border-radius: 999px; padding: 6px 4px 4px; }
nav button.aktiv {
  color: #fff; background: linear-gradient(180deg, #2c2c30, #232327);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16), inset 0 1px 0 rgba(255,255,255,.1);
}
nav button:active { opacity: .6; }
.tab { display: none; }
.tab.aktiv { display: block; animation: einblenden .3s var(--ios-kurve); }
@keyframes einblenden { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Essen ---------- */
.ziel-balken { margin: 4px 0 14px; }
.ziel-balken .zb-kopf { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.zb-kopf b { font-variant-numeric: tabular-nums; font-weight: 600; }
.balken { height: 6px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.balken > div { height: 100%; border-radius: 99px; transition: width .45s var(--ios-kurve); background: var(--tint); }
.balken > div.gruen { background: var(--gruen); }
.balken > div.rot { background: var(--rot); }
.bonus-chips { display: flex; gap: 8px; margin: 2px 0 14px; flex-wrap: wrap; }
.bonus-chip {
  font-size: 12.5px; font-weight: 500; border-radius: 999px; padding: 5px 11px;
  background: var(--card2); color: var(--label2); border: none;
}
.bonus-chip.an { background: rgba(48,209,88,.16); color: var(--gruen); }
.fav-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.fav-chip {
  background: var(--card2); border: none; border-radius: 999px; padding: 8px 14px;
  font-size: 14px; cursor: pointer; color: var(--label); transition: opacity .12s;
}
.fav-chip:active { opacity: .6; }
.fav-chip small { color: var(--label2); font-size: 12px; }
.essen-eintrag { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border-top: 0.5px solid var(--sep); }
.essen-eintrag:first-child { border-top: none; }
.essen-eintrag .en { flex: 1; font-size: 15.5px; }
.essen-eintrag .ew { font-size: 13.5px; color: var(--label2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scan-vorschau { background: var(--card2); border: none; border-radius: 12px; padding: 13px 14px; margin: 4px 0 12px; }
.scan-vorschau b { display: block; margin-bottom: 4px; font-size: 16px; letter-spacing: -0.2px; }
#scan-status { font-size: 13.5px; color: var(--label2); margin: 2px 0 8px; min-height: 18px; }

.kat-titel {
  font-size: 13px; font-weight: 500; color: var(--label2); text-transform: uppercase;
  letter-spacing: .06em; margin: 14px 0 4px;
}
.zeit-label {
  font-size: 11.5px; font-weight: 600; color: var(--label3); text-transform: uppercase;
  letter-spacing: .08em; padding: 10px 0 2px;
}

/* ---------- Segmented Control (iOS) ---------- */
.segmente {
  display: flex; background: var(--card2); border-radius: 10px; padding: 2.5px;
  margin: 4px 0 12px; gap: 2px;
}
.segmente button {
  flex: 1; border: none; background: none; color: var(--label2);
  font-size: 14px; font-weight: 600; padding: 7px 4px; border-radius: 8px; cursor: pointer;
  transition: all .18s var(--ios-kurve); letter-spacing: -0.2px;
}
.segmente button.aktiv { background: var(--card3); color: var(--label); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.modus-panel { display: none; }
.modus-panel.aktiv { display: block; animation: einblenden .22s var(--ios-kurve); }

/* ---------- Offline-Pille (Punkt 19): still statt Alarm — die App funktioniert ja ---------- */
#netz-pille {
  position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--glas-stark); -webkit-backdrop-filter: var(--glas-blur); backdrop-filter: var(--glas-blur);
  color: var(--label2);
  font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  border: 0.5px solid var(--sep); box-shadow: 0 2px 10px rgba(0,0,0,.4);
  z-index: 100; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
#netz-pille.zeig { opacity: 1; transform: translateX(-50%) translateY(0); }
#netz-pille .pille-spin {
  display: inline-block; vertical-align: -2px; width: 11px; height: 11px;
  border: 1.7px solid var(--card3); border-top-color: var(--label2);
  border-radius: 50%; animation: dreh .8s linear infinite; margin-right: 7px;
}

/* Offline-Kennzeichen: Internet-Funktionen dimmen + kurzer Hinweis statt halber Fehler.
   body.getrennt wird von app.js gesetzt, sobald der Stand aus dem Offline-Cache kommt. */
.offline-hinweis { display: none; font-size: 13px; color: var(--label2); padding: 8px 2px; }
body.getrennt .offline-hinweis { display: block; }
body.getrennt .nur-online { opacity: .35; pointer-events: none; }

/* ---------- Bewegung reduzieren, wenn das System es wünscht (Apple-Standard) ---------- */
@media (prefers-reduced-motion: reduce) {
  .anker-kern .ring, .anker-kern .glut, #anker-blase { animation: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Aktivitäten ---------- */
.akt-karte { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 6px 0; border-top: 0.5px solid var(--sep); }
.akt-karte:first-of-type { border-top: none; }
.akt-karte .al { flex: 1; font-size: 15.5px; }
.akt-plus {
  background: var(--card2); color: var(--tint); border: none;
  border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .12s, transform .12s;
}
.akt-plus:active { opacity: .6; transform: scale(.95); }
.akt-heute { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; border-top: 0.5px solid var(--sep); font-size: 15px; }
.akt-heute:first-child { border-top: none; }
.akt-heute .zeit { color: var(--label2); font-size: 13px; font-variant-numeric: tabular-nums; }
.akt-heute .al { flex: 1; }

/* ---------- Boss-/Phasen-Karten: der satte Moment (Richtung C) ---------- */
.boss-karte {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #0c5a3f, #0a3b2c 70%);
  border: none; border-radius: 20px; padding: 15px 17px; margin-bottom: 10px;
  box-shadow: 0 10px 28px rgba(6,60,42,.45);
}
.boss-karte::after {
  content: ""; position: absolute; top: -40%; right: -18%; width: 65%; height: 160%;
  background: radial-gradient(circle, rgba(52,217,155,.35), transparent 62%); pointer-events: none;
}
.boss-kopf { display: flex; align-items: center; gap: 12px; position: relative; }
.boss-emoji { font-size: 30px; }
.boss-name { flex: 1; min-width: 0; }
.boss-name b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -0.4px; }
.boss-name span { font-size: 13px; color: rgba(220,255,240,.75); }
.boss-hp-text { font-size: 13px; color: rgba(220,255,240,.85); font-weight: 700; font-variant-numeric: tabular-nums; }
.boss-hp { height: 6px; background: rgba(0,0,0,.3); border-radius: 99px; overflow: hidden; margin-top: 11px; position: relative; }
.boss-hp > div { height: 100%; background: var(--jade-verlauf); border-radius: 99px; transition: width .5s var(--ios-kurve); box-shadow: 0 0 8px var(--jade-glow); }
.boss-karte.ko { background: linear-gradient(150deg, #10251c, #0d1c15 70%); box-shadow: var(--glas-kante); }
.boss-karte.ko::after { display: none; }
.boss-karte.ko .boss-hp > div { background: var(--jade-verlauf); }
.boss-karte.ko .boss-hp-text { color: var(--jade); }

/* ---------- Fortschritt: Chart, Kategorien, Abzeichen, Shop ---------- */
/* .chart/.saeule/.balken-v/.cx/.cl: NICHT verwaist — der Wochen-Rückblick-
   Overlay (rueckblickOeffnen, Bautag 12) baut sein eigenes Mini-Chart mit
   genau diesen Klassen wieder. Verlauf v2 unten nutzt bewusst eigene
   v2-*-Klassennamen, um diese hier nicht zu kollidieren. */
.chart { display: flex; gap: 7px; align-items: flex-end; height: 112px; padding: 6px 0 2px; }
.chart .saeule { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart .balken-v { width: 100%; max-width: 40px; background: var(--card3); border-radius: 5px; min-height: 2px; transition: height .4s var(--ios-kurve); }
.chart .saeule.heute .balken-v { background: var(--tint); }
.chart .cl { font-size: 11px; color: var(--label2); }
.chart .cx { font-size: 11px; color: var(--label2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Verlauf v2 (Bereich 8): segmentierte Tagesbalken — Farbe zeigt WOHER die XP kamen */
h2 .v2-total { color: var(--label); font-size: 19px; font-weight: 800; letter-spacing: -0.03em; text-transform: none; font-variant-numeric: tabular-nums; }
.v2-diff { font-weight: 650; }
.v2-diff.hoch { color: var(--gruen); }
.v2-diff.runter { color: var(--orange); }
.v2-wochen { display: flex; gap: 8px; align-items: flex-end; height: 118px; padding: 12px 2px 2px; }
.v2-tag { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.v2-tagxp { font-size: 10.5px; font-weight: 700; color: var(--label3); font-variant-numeric: tabular-nums; }
.v2-tag.heute .v2-tagxp { color: var(--label); }
.v2-stapel { width: 100%; max-width: 30px; display: flex; flex-direction: column-reverse; border-radius: 7px; overflow: hidden; background: var(--card2); transition: height .7s var(--ios-kurve); }
.v2-stapel i { display: block; width: 100%; }
.v2-seg-lernen { background: var(--blau); } .v2-seg-gw { background: var(--orange); }
.v2-seg-beweg { background: var(--rot); } .v2-seg-essen { background: var(--gruen); }
.v2-tagl { font-size: 11px; color: var(--label2); }
.v2-tag.heute .v2-tagl { color: var(--label); font-weight: 700; }
.v2-legende { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--sep); }
.v2-leg { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--label2); font-weight: 600; }
.v2-leg i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.v2-einsicht { font-size: 12.5px; color: var(--label2); line-height: 1.5; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--sep); }
.v2-einsicht b { color: var(--label); }
@media (prefers-reduced-motion: reduce) { .v2-stapel { transition: none; } }

/* Verlauf v2: Serien-Zeile unter der Heatmap */
.v2-streak-band { display: flex; align-items: center; gap: 12px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--sep); }
.v2-streak-zahl { font-size: 25px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.v2-streak-tx { font-size: 12px; color: var(--label2); font-weight: 600; line-height: 1.4; }
.v2-streak-tx b { color: var(--label); }

/* Abzeichen v2 (Bereich 9): Trophäen-Medaillen — Gold nur hier als echter
   Award-Moment, nicht App-Chrome. Fortschritt bleibt Jade (App-eigene
   Fortschritts-Farbe), jetzt als Balken statt Ring. */
.abzeichen-gitter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 4px 0 14px; }
.badge { background: var(--card2); border-radius: 16px; padding: 12px 6px 10px; text-align: center; position: relative; overflow: hidden; box-shadow: var(--glas-kante); }
.badge.frei { background: linear-gradient(160deg, #3a2f0e, #1c1708 70%); }
.badge.frei::before { content: ""; position: absolute; top: -40%; right: -20%; width: 70%; height: 150%; background: radial-gradient(circle, rgba(255,207,92,.32), transparent 62%); }
.medaille { position: relative; width: 40px; height: 40px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; }
.badge.frei .medaille { background: radial-gradient(circle at 35% 28%, #ffcf5c, #e0a020); box-shadow: 0 4px 12px rgba(224,160,32,.4), inset 0 1px 0 rgba(255,255,255,.4); }
.badge.zu .medaille { background: #101012; box-shadow: inset 0 0 0 2px rgba(255,255,255,.1); }
.medaille svg { width: 18px; height: 18px; stroke: #2b1a00; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.badge.zu .medaille svg { stroke: var(--label3); }
.badge .an { position: relative; font-size: 11.5px; font-weight: 750; margin-top: 8px; letter-spacing: -0.01em; }
.badge.frei .an { color: #ffe9b8; }
.badge .ah { position: relative; font-size: 9.5px; color: var(--label3); margin-top: 2px; line-height: 1.25; font-weight: 600; }
.badge .fortschritt { position: relative; height: 3px; background: rgba(255,255,255,.08); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.badge .fortschritt > i { display: block; height: 100%; background: var(--jade); border-radius: 99px; }
.badge.neu { box-shadow: 0 0 0 1.5px #ffcf5c; }

/* ---------- Lernblock-Editor (Punkt 4): Inline statt Modal, Apple-Reminders-Geist ---------- */
#lernbloecke .item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.block-editor { padding: 8px 0 10px; border-top: 0.5px solid var(--sep); }
.block-editor:first-child { border-top: none; }
.block-editor .fokus-input { width: 100%; margin-bottom: 10px; }
.block-editor .zeile { gap: 8px; }
.block-editor .knopf { flex: 1; }
.block-editor .block-weg { color: var(--rot); }

/* ---------- Erinnerungs-Karte (Punkt 15): Pre-Permission, ruhig erklärt ---------- */
#push-karte .push-text { font-size: 14.5px; color: var(--label2); line-height: 1.45; padding: 2px 0 12px; }
#push-karte .zeile { padding-bottom: 14px; }

/* ---------- Jahresblick (Punkt 16): GitHub-Raster in Apple-Fitness-Ruhe ---------- */
/* Wochen als Spalten (Mo–So), Jade-Stufen, horizontal scrollbar im eigenen
   Container — die Seite selbst scrollt nie seitlich. */
.hm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 0 6px; }
.hm-monate {
  display: grid; grid-auto-flow: column; grid-auto-columns: 16px;
  margin-left: 26px; height: 14px; font-size: 9.5px; color: var(--label3);
}
.hm-monate span { grid-row: 1; white-space: nowrap; }
.hm-koerper { display: flex; gap: 6px; width: max-content; }
.hm-wochentage {
  display: grid; grid-template-rows: repeat(7, 13px); row-gap: 3px;
  font-size: 9.5px; color: var(--label3); width: 20px; text-align: right;
}
.hm-wochentage span:nth-child(1) { grid-row: 1; }
.hm-wochentage span:nth-child(2) { grid-row: 3; }
.hm-wochentage span:nth-child(3) { grid-row: 5; }
.hm-raster {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px;
}
/* Verlauf v2: Heatmap-Intensität in Orange (Serien-Farbe der App), bewusst
   nicht Jade — Konsistenz statt Marke, siehe DESIGN-FINALE Bereich 8. */
.hm-zelle { width: 13px; height: 13px; border-radius: 3.5px; background: var(--card2); }
.hm-zelle.h1 { background: rgba(255,159,10,.28); }
.hm-zelle.h2 { background: rgba(255,159,10,.52); }
.hm-zelle.h3 { background: rgba(255,159,10,.76); }
.hm-zelle.h4 { background: var(--orange); }
.hm-zelle.gewaehlt { box-shadow: 0 0 0 1.6px var(--label); }
.hm-fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0 12px; font-size: 12px; color: var(--label2); }
.hm-info { min-height: 16px; }
.hm-legende { color: var(--label3); font-size: 11px; white-space: nowrap; }
.hm-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 1.5px; vertical-align: -1px; background: var(--card2); }
.hm-legende i.h1 { background: rgba(255,159,10,.28); }
.hm-legende i.h2 { background: rgba(255,159,10,.52); }
.hm-legende i.h3 { background: rgba(255,159,10,.76); }
.hm-legende i.h4 { background: var(--orange); }
.fav-chip.aktiv { background: var(--tint); color: #06231a; font-weight: 600; }
/* Heatmap-Chips: eine ruhige Zeile, seitlich scrollbar statt mehrzeiliger Wolke */
#hm-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
#hm-chips .fav-chip { white-space: nowrap; flex-shrink: 0; }

/* Shop v2 (Bereich 9): Guthaben-Band als Wertigkeits-Moment + Belohnungen
   als Wallet-Karten statt schmaler Zeilen. */
.guthaben-band {
  display: flex; align-items: center; gap: 11px; margin: 2px 0 12px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #123f2c, #0a2419 70%); border-radius: 16px; padding: 13px 15px;
}
.guthaben-band::after { content: ""; position: absolute; top: -50%; right: -15%; width: 60%; height: 180%; background: radial-gradient(circle, rgba(52,217,155,.28), transparent 62%); }
.guthaben-band svg { position: relative; width: 26px; height: 26px; stroke: var(--jade); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.guthaben-band b { position: relative; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; display: block; font-variant-numeric: tabular-nums; }
.guthaben-band span { position: relative; font-size: 11px; color: rgba(220,255,240,.65); font-weight: 650; }

.belohnung { display: flex; align-items: center; gap: 12px; background: var(--card2); border-radius: 16px; padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--glas-kante); }
.belohnung .bi { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,207,92,.14); display: grid; place-items: center; flex: none; }
.belohnung .bi svg { width: 18px; height: 18px; stroke: #ffcf5c; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.belohnung .bt { flex: 1; font-size: 14.5px; font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.einloesen {
  background: linear-gradient(180deg, #ffcf5c, #e0a020); border: none; border-radius: 999px;
  padding: 7px 13px; font-size: 12.5px; font-weight: 800; color: #2b1a00; cursor: pointer;
  white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  transition: opacity .12s;
}
.einloesen:active { opacity: .75; }
.einloesen:disabled { background: var(--card3); color: var(--label3); box-shadow: none; opacity: 1; }
.shop-gekauft-zeile { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--label2); border-top: 0.5px solid var(--sep); font-variant-numeric: tabular-nums; }
.shop-gekauft-zeile:first-child { border-top: none; }

/* ---------- Anker-Figur ---------- */
.anker-kern { display: block; width: 100%; height: 100%; }
.anker-kern .ring { transform-box: fill-box; transform-origin: center; }
/* Ruhig statt verspielt: sehr langsame Rotation, kaum wahrnehmbares Atmen, kein Schweben */
.anker-kern .ring.aussen { animation: kreisen 28s linear infinite; }
.anker-kern .ring.innen { animation: kreisen 40s linear infinite reverse; }
@keyframes kreisen { to { transform: rotate(360deg); } }
.anker-kern .glut { animation: atmen 5.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes atmen { 0%,100% { opacity: .94; transform: scale(1); } 50% { opacity: 1; transform: scale(1.015); } }

#anker-blase {
  /* Gianis Wunsch 02.08.: einen Ticken tiefer, näher an der Nav-Pille */
  position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer; border: none;
  background: none; padding: 0;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
  transition: filter .4s;
}
#anker-blase:active { opacity: .8; }
#anker-blase.denkt { filter: drop-shadow(0 5px 20px rgba(80,190,150,.7)); }
#anker-blase.denkt .ring.aussen { animation-duration: 1.2s; }
#anker-blase.denkt .ring.innen { animation-duration: 1.7s; }
#anker-blase.stolz { filter: drop-shadow(0 5px 16px rgba(48,209,88,.5)); }
#anker-blase.stolz .anker-kern { filter: hue-rotate(-26deg); }
#anker-blase.besorgt { filter: drop-shadow(0 5px 16px rgba(255,159,10,.5)); }
#anker-blase.besorgt .anker-kern { filter: hue-rotate(-121deg) saturate(1.15); }

/* Statt Sprechblase (verdeckte den Inhalt): dezentes Ausrufezeichen an der Kugel.
   Der Hinweis selbst erscheint beim Öffnen des Chats. */
#anker-hinweis {
  position: absolute; top: -1px; right: -1px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--tint); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
  display: none; place-items: center; border: 2px solid var(--bg);
}
#anker-hinweis.zeig { display: grid; animation: hinweis-auf .3s var(--ios-kurve); }
@keyframes hinweis-auf { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }

/* ---------- Verzeichnis: linke Randlasche + Panel mit den Blöcken des aktiven Tabs ---------- */
#verz-knopf {
  position: fixed; left: 0; top: 38%; z-index: 40;
  width: 21px; height: 54px; border: none; border-radius: 0 12px 12px 0;
  background: var(--glas-stark); backdrop-filter: var(--glas-blur); -webkit-backdrop-filter: var(--glas-blur);
  color: var(--label3); font-size: 15px; font-weight: 400;
  display: grid; place-items: center; cursor: pointer; padding: 0 2px 0 0;
  box-shadow: var(--glas-kante), 0 4px 14px rgba(0,0,0,.4);
}
#verz-hintergrund { position: fixed; inset: 0; z-index: 48; background: rgba(0,0,0,.4); display: none; }
#verz-hintergrund.offen { display: block; }
#verz-panel {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 49; width: min(72vw, 300px);
  background: rgba(24,24,28,.92); backdrop-filter: var(--glas-blur); -webkit-backdrop-filter: var(--glas-blur);
  border-radius: 0 24px 24px 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 12px 0 44px rgba(0,0,0,.5);
  transform: translateX(-105%); transition: transform .35s var(--ios-kurve);
  padding: calc(26px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
#verz-panel.offen { transform: none; }
.verz-titel {
  font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  color: var(--label2); padding: 0 12px 10px;
}
.verz-eintrag {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--label); font-size: 17px; letter-spacing: -0.2px;
  padding: 13px 12px; border-radius: 12px; cursor: pointer; transition: background .15s;
}
.verz-eintrag:active { background: rgba(255,255,255,.06); }
/* Sprungziel darf nicht unterm Sticky-Header landen */
section { scroll-margin-top: 118px; }

/* ---------- Chat-Sheet (iOS Sheet + iMessage) ---------- */
#chat-hintergrund { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; display: none; }
#chat-hintergrund.offen { display: block; }
#chat-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 640px; margin: 0 auto;
  background: rgba(24,24,28,.86);
  backdrop-filter: var(--glas-blur); -webkit-backdrop-filter: var(--glas-blur);
  border: none;
  border-radius: 24px 24px 0 0; transform: translateY(105%);
  transition: transform .42s var(--ios-kurve);
  display: flex; flex-direction: column; height: min(80vh, 660px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 -10px 44px rgba(0,0,0,.55);
}
#chat-sheet.offen { transform: none; }
/* Tastatur offen: ohne Backdrop-Blur (WebKit trifft sonst beim Cursor-Setzen daneben),
   dafür fast deckende Fläche — optisch kaum Unterschied, Eingabe funktioniert. */
#chat-sheet.tastatur { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(26,26,30); }
/* iOS-Tastatur schiebt das Sheet nach oben und legt darunter die Seite frei —
   die Schürze führt den Sheet-Hintergrund nach unten weiter und deckt den Streifen ab. */
#chat-sheet::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 70vh;
  background: rgb(24,24,28);
}
.griff { width: 36px; height: 5px; border-radius: 3px; background: var(--card3); margin: 7px auto 0; }
.griff, .chat-kopf { touch-action: none; } /* sonst übernimmt Safari die Geste und bricht das Runterziehen ab */
.chat-kopf { display: flex; align-items: center; gap: 11px; padding: 8px 16px 11px; border-bottom: 0.5px solid var(--sep); }
.chat-kopf .mini-anker { width: 36px; height: 36px; }
.chat-kopf .ct { flex: 1; }
.chat-kopf .ct b { display: block; font-size: 16px; letter-spacing: -0.3px; }
.chat-kopf .ct span { font-size: 12.5px; color: var(--label2); }
.chat-zu {
  background: var(--card2); border: none; color: var(--label2); font-size: 13px; font-weight: 700;
  cursor: pointer; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
}
#chat-verlauf { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 9px 14px; border-radius: 19px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; letter-spacing: -0.2px; }
.msg.user { align-self: flex-end; background: var(--tint); color: #fff; border-bottom-right-radius: 6px; }
/* Chat v2 (Bereich 7): Bubble trägt die Persona-Farbe (--pf, von chatOeffnenMit
   gesetzt) statt einheitlichem Grau — Aurel orange, Nova grün, Anker sein Jade. */
.msg.anker { align-self: flex-start; position: relative; background: color-mix(in srgb, var(--pf, var(--card2)) 16%, var(--card2)); border: none; border-bottom-left-radius: 6px; }
/* iMessage-Rhythmus: Nachrichten derselben Serie rücken zusammen (negativer
   Margin gegen den Grund-gap von 8px), ein Farbpunkt markiert das Ende der
   Serie statt eines Avatarbilds. */
.msg.anker + .msg.anker, .msg.user + .msg.user { margin-top: -5px; }
.msg.anker:not(:has(+ .msg.anker))::after {
  content: ""; position: absolute; left: -4px; bottom: 3px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--pf, var(--tint));
}
.msg.denkt { color: var(--label2); font-style: normal; }
.msg.denkt .punkte::after { content: ""; animation: punkte 1.4s steps(4) infinite; }

/* Essens-Zuruf: Novas Bestätigungs-Karte (Vorbild Apple-Health-Dateneingabe) */
.schaetz-karte {
  align-self: flex-start; width: min(100%, 360px);
  background: var(--card2); border-radius: 16px; border-bottom-left-radius: 6px;
  padding: 11px 13px 13px;
}
.sk-kopf { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; }
.sk-titel { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--label2); text-transform: uppercase; letter-spacing: .5px; }
.sk-chip { font-size: 11.5px; color: var(--orange); background: rgba(255,159,10,.14); border-radius: 99px; padding: 3px 9px; }
.sk-zeile { padding: 8px 0 10px; border-top: 0.5px solid var(--sep); }
.sk-oben { display: flex; align-items: center; gap: 6px; }
.schaetz-karte input { background: transparent; border-radius: 8px; padding: 5px 7px; font-size: 15.5px; }
.schaetz-karte .sk-name { font-weight: 600; letter-spacing: -0.2px; padding-left: 0; }
.sk-unten { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.sk-menge { flex: 1; font-size: 13px; color: var(--label2); padding-left: 0; }
.schaetz-karte .sk-zahl { width: 64px; text-align: right; font-variant-numeric: tabular-nums; background: var(--card3); }
.sk-einheit { font-size: 13px; color: var(--label2); }
.schaetz-karte .del { background: none; border: none; color: var(--label3); font-size: 15px; padding: 4px 6px; cursor: pointer; }
.sk-summe { display: flex; justify-content: flex-end; font-size: 13px; color: var(--label2); padding: 8px 0 0; border-top: 0.5px solid var(--sep); font-variant-numeric: tabular-nums; }
.sk-fehler { color: var(--rot); font-size: 13.5px; padding-top: 6px; }
.sk-fehler:empty { display: none; }
.sk-aktionen { display: flex; gap: 8px; margin-top: 10px; }
.sk-aktionen .knopf { flex: 1; padding: 10px; font-size: 15.5px; }
.sk-fertig { font-size: 14.5px; color: var(--gruen); padding: 2px 1px; }
.sk-fertig.leise { color: var(--label2); }
/* Punkt 18: Aktions-Zeilen in der Vorschlags-Karte */
.sk-zeile.sk-aktion { display: flex; align-items: center; gap: 8px; }
.sk-aktion-text { flex: 1; font-size: 15px; line-height: 1.35; }
@keyframes punkte { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
#chat-form { display: flex; gap: 9px; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 0.5px solid var(--sep); align-items: center; }
.chat-foto {
  width: 38px; height: 38px; min-width: 38px; border-radius: 50%; border: none;
  background: var(--card2); color: var(--tint); display: grid; place-items: center; cursor: pointer;
}
.chat-foto svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#chat-input { flex: 1; border-radius: 999px; background: var(--card2); padding: 10px 16px; }
#chat-form .knopf {
  width: 38px; height: 38px; min-width: 38px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
}

/* ---------- Vollbild-Scanner: Apples Code-Scanner als Vorbild — ruhiger Sucher, kein Kamera-Chrome ---------- */
#scan-overlay { position: fixed; inset: 0; z-index: 70; background: #000; display: none; }
#scan-overlay.offen { display: block; }
#scan-overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-rahmen {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: min(78vw, 340px); height: min(46vw, 210px);
  border-radius: 24px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.45);
  outline: 2.5px solid rgba(255,255,255,.9); outline-offset: -1px;
  transition: outline-color .2s;
}
#scan-overlay.treffer .scan-rahmen { outline-color: var(--jade-hell); box-shadow: 0 0 0 200vmax rgba(0,0,0,.45), 0 0 24px rgba(124,195,170,.6); }
.scan-hinweis {
  position: absolute; left: 0; right: 0; top: calc(44% + min(23vw, 105px) + 22px);
  text-align: center; color: rgba(255,255,255,.85); font-size: 15px; letter-spacing: -0.2px;
}
.scan-zu {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(40,40,44,.7); color: #fff; font-size: 15px; font-weight: 700;
  display: grid; place-items: center; cursor: pointer;
}

/* ---------- PIN-Gate (Punkt 8): Vollbild-Sperre im App-Look ---------- */
#pin-gate {
  position: fixed; inset: 0; z-index: 96; background: var(--bg);
  display: none; place-items: start center;
  /* Box im oberen Drittel: das Eingabefeld bleibt über der iOS-Tastatur,
     Safari muss die Seite nicht verschieben (kein "Wandern" mehr) */
  padding: calc(14vh + env(safe-area-inset-top)) 24px 24px;
}
#pin-gate.zeig { display: grid; }
.pg-box { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 300px); }
.pg-logo { width: 54px; height: 54px; margin-bottom: 6px; }
.pg-box h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.pg-sub { font-size: 14px; color: var(--label2); text-align: center; line-height: 1.4; margin-bottom: 8px; }
.pg-box input { text-align: center; font-size: 22px; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
.pg-box input::placeholder { letter-spacing: normal; font-size: 16px; }

/* PIN-Punkte (07.08.): wachsende Reihe statt Text — die App erlaubt 4-8
   Stellen, feste 6er-iOS-Punkte würden das verschweigen. Echtes Eingabefeld
   bleibt darunter aktiv (Fokus/Tastatur/Caret), nur sein Text wird unsichtbar. */
.pg-pinwrap { position: relative; width: 100%; }
.pg-pinwrap input { color: transparent; caret-color: var(--label2); }
.pg-pinwrap input::placeholder { color: var(--label3); }
.pg-dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 11px; pointer-events: none; }
.pg-dots i { width: 13px; height: 13px; border-radius: 50%; background: var(--label); animation: pg-dot-pop .18s var(--ios-kurve) backwards; }
@keyframes pg-dot-pop { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pg-dots i { animation: none; } }
.pg-fehler { min-height: 18px; font-size: 13.5px; color: var(--rot); }
.pg-box .knopf { width: 100%; padding: 13px; font-size: 16.5px; border-radius: 14px; }
#pin-gate.wackel .pg-box { animation: wackeln .4s; }
@keyframes wackeln { 0%,100% { transform: none; } 25% { transform: translateX(-9px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

/* ---------- Toast (iOS-HUD-artig) ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(16px); z-index: 60;
  background: var(--glas-stark); backdrop-filter: var(--glas-blur); -webkit-backdrop-filter: var(--glas-blur);
  border: none; color: var(--label); font-weight: 600; letter-spacing: -0.2px;
  border-radius: 999px; padding: 10px 20px; font-size: 15px; opacity: 0; pointer-events: none;
  transition: all .3s var(--ios-kurve); box-shadow: var(--glas-kante), 0 8px 26px rgba(0,0,0,.5);
}
#toast.zeig { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#toast.levelup { color: var(--label); }
.toast-aktion {
  background: none; border: none; cursor: pointer;
  color: var(--tint); font-weight: 700; font-size: 15px; letter-spacing: -0.2px;
  margin-left: 12px; padding: 4px 2px; /* bequemes Tipp-Ziel im Toast */
}

/* ---------- Chat v2 (Bereich 7): Profi-Team als Karten statt schwebende Icons ---------- */
#profi-liste { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 0 16px; }
.profi-blase {
  position: relative; overflow: hidden; cursor: pointer; color: var(--label);
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 15px 10px 13px; border-radius: 18px;
  background: var(--card2); box-shadow: var(--glas-kante);
  transition: transform .18s var(--ios-kurve);
  font: inherit; letter-spacing: inherit; border: none;
}
.profi-blase::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--pf) 22%, transparent), transparent 60%);
}
.profi-blase:active { transform: scale(.96); }
.profi-blase b { position: relative; font-size: 15px; letter-spacing: -0.2px; }
.profi-blase .pk { position: relative; font-size: 11px; color: var(--label3); line-height: 1.25; font-weight: 600; }
.profi-orb { position: relative; display: block; width: 68px; height: 68px; filter: drop-shadow(0 5px 16px color-mix(in srgb, var(--pf) 45%, transparent)); }
.profi-orb .anker-kern { width: 100%; height: 100%; }
.profi-orb .ring.aussen { animation: kreisen 11s linear infinite; }
.profi-orb .ring.innen { animation: kreisen 16s linear infinite reverse; }
.profi-orb .glut { animation: atmen 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

/* ---------- Looksmaxxing-Analyse ---------- */
.looks-kopf { display: flex; align-items: center; gap: 15px; padding: 8px 0 14px; }
.looks-kopf .score-ring { min-width: 84px; }
.looks-kopf-txt b { font-size: 15px; }
.looks-kopf-txt p { font-size: 14px; color: var(--label2); margin-top: 3px; line-height: 1.4; }
.looks-kat { display: flex; align-items: center; gap: 11px; padding: 7px 0 2px; }
.looks-kat .lk-name { width: 96px; font-size: 15px; }
.looks-kat .lk-bar { flex: 1; height: 6px; background: var(--card2); border-radius: 99px; overflow: hidden; }
.looks-kat .lk-bar > span { display: block; height: 100%; border-radius: 99px; transition: width .5s var(--ios-kurve); }
.looks-kat .lk-score { width: 26px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lk-notiz { font-size: 12.5px; color: var(--label2); padding: 0 0 6px 107px; margin-top: -2px; }
.fokus-zeile { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 15px; line-height: 1.4; border-top: 0.5px solid var(--sep); }
.fokus-zeile:first-of-type { border-top: none; }
.fokus-punkt { width: 8px; height: 8px; min-width: 8px; border-radius: 50%; margin-top: 7px; }
.looks-verlauf { display: flex; align-items: flex-end; gap: 7px; height: 96px; padding: 8px 0 2px; }
.lv-punkt { flex: 1; max-width: 30px; border-radius: 5px 5px 2px 2px; min-height: 4px; opacity: .85; }
.analyse-laeuft { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--label2); padding: 8px 0; }
.analyse-fehler { font-size: 14px; color: var(--rot); padding: 8px 0; }
.spin { width: 18px; height: 18px; min-width: 18px; border: 2.5px solid var(--card3); border-top-color: var(--orange); border-radius: 50%; animation: dreh .8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.foto-hinweis { font-size: 12px; text-align: center; padding: 4px 0 8px; }

/* ---------- Selbsterklärung: Fußnoten (Settings-Stil) + Willkommens-Sheet ---------- */
.fussnote {
  font-size: 13px; color: var(--label2); line-height: 1.4;
  padding: 2px 0 12px; letter-spacing: -0.1px;
}
#intro, .blatt {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ios-kurve);
}
#intro.zeig, .blatt.zeig { opacity: 1; pointer-events: auto; }
.i-karte {
  background: var(--card); border-radius: 24px 24px 0 0; width: 100%; max-width: 640px;
  padding: 30px 26px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(40px); transition: transform .38s var(--ios-kurve);
}
#intro.zeig .i-karte, .blatt.zeig .i-karte { transform: none; }
.i-karte h3 { font-size: 27px; font-weight: 700; letter-spacing: -0.5px; text-align: center; margin-bottom: 22px; }
.i-zeile { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 18px; }
.i-zeile svg { width: 30px; height: 30px; min-width: 30px; stroke: var(--tint); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.i-zeile svg .voll { fill: var(--tint); stroke: none; }
.i-zeile b { display: block; font-size: 15.5px; letter-spacing: -0.2px; }
.i-zeile p { font-size: 13.5px; color: var(--label2); line-height: 1.4; margin-top: 1px; }
.i-karte .knopf { width: 100%; margin-top: 8px; padding: 14px; font-size: 17px; border-radius: 14px; }

/* Rang-Sheet */
.level-badge { cursor: pointer; transition: opacity .12s; font: inherit; color: inherit; letter-spacing: inherit; }
.level-badge:active { opacity: .6; }
.rang-aktuell { text-align: center; margin-bottom: 20px; }
.rang-aktuell b { font-size: 21px; letter-spacing: -0.3px; display: block; }
.rang-aktuell span { font-size: 14px; color: var(--label2); }
.rang-zeile { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 0.5px solid var(--sep); font-size: 15.5px; }
.rang-zeile:first-of-type { border-top: none; }
.rang-zeile .rz-mark { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; border: 1.6px solid var(--label3); display: grid; place-items: center; font-size: 12px; color: transparent; }
.rang-zeile.erreicht .rz-mark { background: var(--tint); border-color: var(--tint); color: #fff; }
.rang-zeile.jetzt { font-weight: 700; }
.rang-zeile.jetzt .rz-name::after { content: " · aktuell"; font-weight: 500; font-size: 12.5px; color: var(--tint); }
.rang-zeile .rz-name { flex: 1; }
.rang-zeile .rz-ab { font-size: 13px; color: var(--label3); font-variant-numeric: tabular-nums; }
.rang-zeile:not(.erreicht) { color: var(--label2); }

/* Fokus direkt eintippen */
#fokus-text { cursor: pointer; }
.fokus-input { margin: 2px 0 12px; }
.hilfe-link {
  display: block; text-align: center; color: var(--tint); font-size: 15px;
  padding: 4px 0 14px; cursor: pointer; background: none; border: none; width: 100%;
}

/* ---------- Belohnungs-Momente (ruhige Oberfläche, satisfying Feedback) ---------- */

/* +XP steigt vom Tipp-Punkt auf */
.xp-float {
  position: fixed; z-index: 70; font-size: 15px; font-weight: 700; color: var(--jade-hell);
  pointer-events: none; font-variant-numeric: tabular-nums;
  animation: xp-steig .95s var(--ios-kurve) forwards;
}
@keyframes xp-steig {
  0% { opacity: 0; transform: translateY(6px) scale(.85); }
  18% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-38px); }
}

/* Glanz-Sweep über wachsende Balken */
.xp-bar, .boss-hp { position: relative; }
.schimmer::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(100deg, transparent 25%, rgba(255,255,255,.4) 50%, transparent 75%);
  animation: sweep .8s ease;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Serien-Chip pulst, wenn die Serie wächst */
.streak-flamme.puls { animation: serien-puls .6s var(--ios-kurve); }
@keyframes serien-puls {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); background: rgba(255,159,10,.22); }
  100% { transform: scale(1); }
}

/* Feier-Overlay: Apple-Pay-Moment (Ring zeichnet sich, Haken, Titel) */
#feier {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(0,0,0,.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; transition: opacity .28s var(--ios-kurve);
}
#feier.zeig { opacity: 1; }
#feier .f-box { text-align: center; transform: scale(.92); transition: transform .32s var(--ios-kurve); }
#feier.zeig .f-box { transform: scale(1); }
#feier .f-ring { stroke: var(--gruen); stroke-width: 4; fill: none; stroke-linecap: round;
  stroke-dasharray: 289; stroke-dashoffset: 289; }
#feier.zeig .f-ring { animation: ring-zeichnen .55s var(--ios-kurve) forwards; }
@keyframes ring-zeichnen { to { stroke-dashoffset: 0; } }
#feier .f-haken { stroke: var(--gruen); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 48; stroke-dashoffset: 48; }
#feier.zeig .f-haken { animation: ring-zeichnen .3s .45s var(--ios-kurve) forwards; }
#feier .f-titel { font-size: 24px; font-weight: 700; letter-spacing: -0.4px; margin-top: 16px; }
#feier .f-sub { font-size: 15px; color: var(--label2); margin-top: 4px; }

footer { text-align: center; color: var(--label3); font-size: 12px; margin-top: 22px; }

/* ============ Punkt 1: Wochen-Rückblick ============ */
/* Auslöser-Karte oben im Fortschritt-Tab */
.rueckblick-karte {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(63,146,118,.20), rgba(63,146,118,.06));
  border: 0.5px solid rgba(124,195,170,.28); border-radius: 16px;
  padding: 15px 16px; margin: 2px 0 16px; text-align: left; color: var(--label);
  box-shadow: var(--glas-kante); transition: transform .12s var(--ios-kurve);
}
.rueckblick-karte:active { transform: scale(.985); }
.rueckblick-karte .rk-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rueckblick-karte .rk-text b { font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.rueckblick-karte .rk-text small { font-size: 12.5px; color: var(--label2); }
.rueckblick-karte .rk-pfeil { font-size: 24px; color: var(--jade-hell); font-weight: 300; }

/* Vollbild-Overlay */
#rueckblick-overlay {
  position: fixed; inset: 0; z-index: 75; display: none;
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  align-items: flex-end; justify-content: center;
}
#rueckblick-overlay.offen { display: flex; animation: rb-ein .25s var(--ios-kurve); }
@keyframes rb-ein { from { opacity: 0; } to { opacity: 1; } }
.rb-blatt {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 30px 20px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,.5), var(--glas-kante);
  animation: rb-hoch .32s var(--ios-kurve);
}
@keyframes rb-hoch { from { transform: translateY(28px); } to { transform: translateY(0); } }
.rb-zu {
  position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--card3); color: var(--label2); font-size: 15px; line-height: 30px; text-align: center;
}
.rb-laden { text-align: center; color: var(--label2); padding: 40px 10px; font-size: 14px; }

.rb-kopf { text-align: center; margin-bottom: 18px; }
.rb-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--jade-hell); }
.rb-kopf h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; margin-top: 3px; }

.rb-held { text-align: center; margin: 8px 0 20px; }
.rb-xp { font-size: 52px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.rb-xp span { font-size: 20px; font-weight: 600; color: var(--label2); margin-left: 6px; letter-spacing: 0; }
.rb-vergleich { font-size: 13.5px; color: var(--label2); margin-top: 8px; }
.rb-vergleich.hoch { color: var(--gruen); }
.rb-vergleich.runter { color: var(--orange); }

.rb-chart { margin: 6px 4px 22px; }
.chart .saeule.zukunft .balken-v { background: var(--card2); opacity: .5; }
.chart .saeule.zukunft .cl, .chart .saeule.zukunft .cx { opacity: .4; }

.rb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-kachel { background: var(--card2); border-radius: 14px; padding: 15px 14px; }
.rb-gross { font-size: 26px; font-weight: 750; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.rb-gross span { font-size: 15px; font-weight: 600; color: var(--label2); letter-spacing: 0; }
.rb-klein { font-size: 12.5px; color: var(--label2); margin-top: 3px; }
.rb-extra { text-align: center; font-size: 13px; color: var(--label2); margin-top: 14px; }

.rb-anker {
  display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 15px 16px;
  background: rgba(63,146,118,.10); border-left: 3px solid var(--jade); border-radius: 12px;
}
.rb-anker-logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.rb-anker-satz { font-size: 14.5px; line-height: 1.42; color: var(--label); font-style: italic; }
.rb-fuss { text-align: center; font-size: 12px; color: var(--label3); margin-top: 22px; }

/* ============ Wave 2 (Bereich 5): Essen-Tagesziel als zwei Ringe ============
   Bewusst OHNE drop-shadow/Filter — Scroll-Lehre vom 28.07. */
.essen-ringe { display: flex; justify-content: space-evenly; gap: 10px; padding: 10px 0 4px; }
.ering { text-align: center; }
.ering-wrap { position: relative; width: 124px; height: 124px; margin: 0 auto; }
.ering-wrap > svg { transform: rotate(-90deg); display: block; }
.er-spur { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 11; }
.er-voll { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ios-kurve); }
#er-kcal { stroke: var(--gruen); }
#er-kcal.rot { stroke: #ff453a; }
#er-protein { stroke: var(--teal); }
.ev-gruen { color: var(--gruen); }
.ev-gruen.rot, #er-kcal-wert.rot { color: #ff453a; }
.ev-teal { color: var(--teal); }

/* Essen v2: ehrliche Formel unter den Ringen */
.ev-formel { display: flex; justify-content: space-evenly; align-items: center; margin: 2px 0 12px; padding-top: 12px; border-top: 1px solid var(--sep); }
.evf { text-align: center; }
.evf b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.evf b.rot { color: #ff453a; }
.evf span { font-size: 9.5px; color: var(--label3); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.evf.op { color: var(--label3); font-size: 15px; font-weight: 700; }

/* Essen v2: Mahlzeiten-Slots — Farbe mit Bedeutung (Gelb/Grün/Indigo/Rosa) */
.slot { border-radius: 16px; background: var(--card2); box-shadow: var(--glas-kante); padding: 11px 12px; margin: 0 0 9px; }
.slot:last-child { margin-bottom: 12px; }
.slot-kopf { display: flex; align-items: center; gap: 12px; }
.slot-kopf .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.slot-kopf .ic svg { width: 20px; height: 20px; stroke-width: 2.1; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.s-fr .ic { background: linear-gradient(180deg, #ffe066, #f0b400); } .s-fr .ic svg { stroke: #1a1200; }
.s-mi .ic { background: linear-gradient(180deg, #6ee7a0, #28a05a); } .s-mi .ic svg { stroke: #03180c; }
.s-ab .ic { background: linear-gradient(180deg, #8cabff, #3d63e0); } .s-ab .ic svg { stroke: #0a1233; }
.s-sn .ic { background: linear-gradient(180deg, #ffb3c2, #f06a8a); } .s-sn .ic svg { stroke: #33101b; }
.slot-kopf .tx { flex: 1; min-width: 0; }
.slot-kopf .tx b { font-size: 14.5px; font-weight: 750; letter-spacing: -0.015em; display: block; }
.slot-kopf .tx span { font-size: 11.5px; color: var(--label3); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-kopf .kcal { text-align: right; margin-right: 2px; }
.slot-kopf .kcal b { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.slot-kopf .kcal span { font-size: 10px; color: var(--label3); font-weight: 600; }
.s-fr .kcal b { color: #ffd60a; } .s-mi .kcal b { color: var(--gruen); } .s-ab .kcal b { color: #8cabff; } .s-sn .kcal b { color: #ff8fa3; }
.slot-kopf .plus { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--card3); color: var(--label2); font-size: 19px; font-weight: 600; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.16); flex: none; cursor: pointer; transition: transform .15s var(--ios-kurve); }
.slot-kopf .plus:active { transform: scale(.88); }
.slot-eintrag { display: flex; align-items: center; gap: 10px; padding: 8px 0 2px 52px; }
.slot-eintrag .en { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.slot-eintrag .ew { font-size: 12px; color: var(--label2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Essen v2: Wochentrend */
.ev-spark { display: flex; align-items: flex-end; gap: 5px; height: 64px; padding: 6px 0 0; }
.ev-spark i { flex: 1; border-radius: 5px 5px 3px 3px; background: rgba(74,222,128,.7); }
.ev-spark i.leer { background: var(--card2); }
.ev-spark i.heute { background: var(--gruen); }
.ev-wtage { display: flex; gap: 5px; margin: 4px 0 12px; }
.ev-wtage span { flex: 1; text-align: center; font-size: 9.5px; color: var(--label3); font-weight: 650; }
.ering-mitte { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ering-mitte b { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ering-mitte span { font-size: 11px; color: var(--label3); font-weight: 600; margin-top: 1px; }
.ering-label { font-size: 12px; color: var(--label2); font-weight: 650; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .er-voll { transition: none; } }

/* ============ Wave 2 (Bereich 6): Aktivitäten-Katalog als Chip-Wolke ============ */
.akt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.akt-chip {
  background: var(--card2); border: none; border-radius: 999px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; color: var(--label); cursor: pointer;
  transition: transform .12s var(--ios-kurve), background .12s;
}
.akt-chip b { color: var(--rot); font-weight: 750; font-size: 12.5px; margin-left: 3px; }
.akt-chip:active { transform: scale(.95); background: var(--card3); }
