:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #ffffff;
  --label: #000000;
  --label2: rgba(60, 60, 67, 0.6);
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --blue: #007aff;
  --fr: #8944ab; /* systemPurple (barrierefreie Variante): französische Wörter in deutschen Texten */
  --green: #248a3d;
  --red: #d70015;
  --green-bg: rgba(52, 199, 89, 0.16);
  --red-bg: rgba(255, 59, 48, 0.14);
  --bar: rgba(249, 249, 249, 0.94);
  --seg: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --label: #ffffff;
    --label2: rgba(235, 235, 245, 0.6);
    --sep: rgba(84, 84, 88, 0.6);
    --fill: rgba(120, 120, 128, 0.24);
    --blue: #0a84ff;
    --fr: #da8fff;
    --green: #30d158;
    --red: #ff6961;
    --green-bg: rgba(48, 209, 88, 0.2);
    --red-bg: rgba(255, 69, 58, 0.22);
    --bar: rgba(29, 29, 31, 0.94);
    --seg: #636366;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { overscroll-behavior: none; font-size: 17px; }
/* Dynamic Type: folgt der Textgröße aus den iOS-Einstellungen */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
html, body { height: 100%; margin: 0; overflow: hidden; }
/* Die Seite selbst scrollt nie: nur .content, sonst zieht iOS die Reiterleiste mit */
body { position: fixed; inset: 0; width: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
  background: var(--bg);
  color: var(--label);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
  cursor: pointer;
}

#app {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  height: 100vh;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ---------- Navigation ---------- */

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--bar);
  border-bottom: 1px solid var(--sep);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.nav > :first-child { justify-self: start; }
.nav > :last-child { justify-self: end; }
.navbtn { color: var(--blue); min-height: 44px; padding: 0 8px; transition: opacity 0.3s var(--ease); }
.navbtn:active { opacity: 0.4; transition: none; }
.navbtn:disabled { color: var(--label2); }
.navtitle { font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 56vw; }
.navinfo { color: var(--label2); padding: 0 8px; font-variant-numeric: tabular-nums; }
.timer { font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 8px; }
.timer.warn { color: var(--red); }

.prog { height: 3px; background: var(--fill); }
.prog i { display: block; height: 100%; background: var(--blue); transition: width 0.4s var(--ease); }

.content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.content.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }

h1.title { font-size: 2rem; line-height: 1.12; margin: 8px 0 4px; letter-spacing: 0.01em; }
h1.title.top { margin-top: calc(8px + env(safe-area-inset-top)); }
.nav + .content h1.title.top { margin-top: 8px; }
.lead { color: var(--label2); margin: 0 0 20px; }

.tabbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 34px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--sep),
    inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.9), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.5);
}
.content:has(+ .tabbar) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.tab {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.6471rem;
  color: var(--label2);
  transition: opacity 0.3s var(--ease);
}
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab:active { opacity: 0.55; transition: none; }
.tab[aria-current="page"] { color: var(--blue); background: var(--fill); }

/* ---------- Listen ---------- */

.list { background: var(--card); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  text-align: left;
}
.row + .row { border-top: 1px solid var(--sep); }
button.row { transition: background-color 0.35s var(--ease); }
button.row:active { background: var(--fill); transition: none; }
button.row:disabled b { color: var(--label2); }
.row b { display: block; font-weight: 600; }
.row small { display: block; color: var(--label2); font-size: 0.8235rem; }
.chev { color: var(--label2); font-size: 1.2941rem; }
.tick { flex: none; width: 24px; height: 24px; color: var(--blue); }
.tick svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sectionhead { color: var(--label2); font-size: 0.7647rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 8px 16px 6px; }

.stat { padding: 10px 16px; }
.stat + .stat { border-top: 1px solid var(--sep); }
.stat .top { display: flex; justify-content: space-between; gap: 12px; }
.stat .top span:last-child { color: var(--label2); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); }
.empty { color: var(--label2); padding: 16px; }

/* Schalter wie in den iOS-Einstellungen */
.switch { flex: none; position: relative; width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, 0.32); transition: background-color 0.25s var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }

/* Auswahl aus wenigen Werten */
.seg { display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--fill); margin-bottom: 14px; }
.seg button { flex: 1; min-height: 40px; border-radius: 8px; font-size: 0.8824rem; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--seg); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

/* ---------- Heute ---------- */

.week { background: var(--card); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.wdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.wd small { display: block; font-size: 0.7647rem; color: var(--label2); margin-bottom: 4px; }
.wd.today small { color: var(--label); font-weight: 600; }
.dot { display: grid; place-items: center; width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; background: var(--fill); color: #fff; font-style: normal; font-size: 0.8235rem; font-weight: 700; }
.dot.on { background: var(--blue); }
.wd.today .dot:not(.on) { box-shadow: inset 0 0 0 2px var(--blue); background: transparent; }
.wline { text-align: center; color: var(--label2); font-size: 0.8235rem; margin-top: 10px; }
.dot.part { background: var(--fill); box-shadow: inset 0 0 0 2px var(--blue); }
.dot.rest { background: var(--fill); color: var(--label2); }
.streak { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.streak .snum { font-size: 2.1176rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stext b { display: block; font-weight: 600; }
.stext small { display: block; color: var(--label2); font-size: 0.8235rem; }
.flame svg { display: block; width: 30px; height: 30px; fill: var(--fill); }
.flame.on svg { fill: var(--blue); }
.goal { margin-top: 12px; }
.goal .top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.8824rem; }
.goal .top span:last-child { color: var(--label2); font-variant-numeric: tabular-nums; }
.celebrate { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border-radius: 16px; padding: 18px 16px; margin-bottom: 16px; text-align: center; }
.celebrate .flame svg { width: 40px; height: 40px; }
.celebrate .snum { font-size: 2.8235rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.celebrate small { color: var(--label2); }
.badge { margin: 6px 0; padding: 6px 12px; border-radius: 999px; background: var(--fill); font-weight: 600; font-size: 0.8824rem; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 6px; }
.bdg { display: flex; flex-direction: column; align-items: center; color: var(--label2); }
.bdg.on { color: var(--label); }
.bdg b { font-variant-numeric: tabular-nums; }
.bdg small { font-size: 0.7059rem; }
.gstreak { display: flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--label2); }
.gstreak.done { color: var(--label); }
.gstreak .flame svg { width: 22px; height: 22px; }
.textin.sep { border-top: 1px solid var(--sep); }

.hero { background: var(--card); border-radius: 16px; padding: 20px 16px 16px; margin-bottom: 20px; text-align: center; }
.hnum { font-size: 3.5294rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hsub { color: var(--label2); margin: 6px 0 16px; }
.hero .hint { margin-top: 10px; }

/* ---------- Lernen: Niveaus zum Aufklappen ---------- */

.group { margin-bottom: 12px; }
.group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 16px; background: var(--card); border-radius: 12px; cursor: pointer; list-style: none; }
.group summary::-webkit-details-marker { display: none; }
.group summary b { display: block; font-weight: 600; }
.group summary small { display: block; color: var(--label2); font-size: 0.8235rem; }
.group summary .chev { transition: transform 0.25s var(--ease); }
.group[open] summary { border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--sep); }
.group[open] summary .chev { transform: rotate(90deg); }
.group[open] .list { border-radius: 0 0 12px 12px; }

/* ---------- Französisch in deutschen Texten ---------- */

.fr { color: var(--fr); }
.forms { display: block; margin: 6px 0 6px 12px; }
.forms .fr { display: block; line-height: 1.5; }
.rule p.formsonly { margin: 0; }
.rule p.formsonly .forms { margin: 0 0 0 12px; }
.rule p.formsonly:last-child { margin-bottom: 10px; }

/* ---------- Regel ---------- */

.rule { background: var(--card); border-radius: 12px; padding: 6px 16px; margin-bottom: 20px; }
.rule.plain { background: none; padding: 0; margin: 0; }
.rule p { margin: 10px 0; }
.q .rule p { font-size: 1rem; }

/* ---------- Aufgabe ---------- */

.q { background: var(--card); border-radius: 16px; padding: 16px; }
.q.small { padding: 12px; background: var(--fill); border-radius: 12px; }
.q.back { margin-top: 12px; animation: rise 0.35s var(--ease) both; }
.qhead { color: var(--label2); font-size: 0.8235rem; margin-bottom: 6px; }
.qtext { font-size: 1.5294rem; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.qsub { color: var(--label2); margin-top: 6px; }
.qex { margin-top: 10px; font-style: italic; }
.qback { font-size: 1.1765rem; line-height: 1.4; }
.hint { color: var(--label2); font-size: 0.8824rem; }
.q .hint { margin-top: 8px; }
.trans { color: var(--label2); margin-top: 4px; }

.speak { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.speak.big { justify-content: center; margin: 8px 0 4px; }
.spk { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 22px; background: var(--fill); color: var(--blue); transition: transform 0.4s var(--spring); }
.spk:active { transform: scale(0.92); transition-duration: 0.07s; }
.spk svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spk.txt { padding: 0 16px; font-size: 0.8824rem; font-weight: 500; }
.speak.big .spk:not(.txt) { width: 72px; height: 72px; border-radius: 36px; background: var(--blue); color: #fff; }
.speak.big .spk:not(.txt) svg { width: 34px; height: 34px; }
.spk.small { flex: none; background: transparent; }

.ansin {
  -webkit-user-select: text;
  user-select: text;
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--blue);
  background: var(--card);
  color: var(--label);
  font: inherit;
  font-size: 1.2941rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.ansin::placeholder { color: var(--label2); font-size: 1rem; }
.ansin.ok { background: var(--green-bg); border-color: var(--green); animation: pop 0.45s var(--spring); }
.ansin.bad { background: var(--red-bg); border-color: var(--red); animation: nudge 0.4s var(--ease); }

.order { margin-top: 14px; display: grid; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips.line { min-height: 68px; background: var(--card); padding: 10px; border-radius: 14px; border: 2px solid transparent; }
.chips.line.ok { background: var(--green-bg); border-color: var(--green); animation: pop 0.45s var(--spring); }
.chips.line.bad { background: var(--red-bg); border-color: var(--red); animation: nudge 0.4s var(--ease); }
.chips.pool { justify-content: center; padding: 4px 0; }
.chip {
  min-width: 44px;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 1.1765rem;
  display: inline-grid;
  place-items: center;
  transition: transform 0.4s var(--spring), background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.chips.pool .chip { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 0 0.5px var(--sep); }
.chip:active { background: var(--blue); color: #fff; transform: scale(0.95); transition-duration: 0.08s; }
.chips.pool .chip.ghost { background: var(--fill); color: transparent; box-shadow: none; }
.ph { color: var(--label2); padding: 0 6px; }

.banner { animation: rise 0.4s var(--ease) both; margin-top: 14px; padding: 14px 16px; border-radius: 14px; }
.banner.ok { background: var(--green-bg); color: var(--green); }
.banner.bad { background: var(--red-bg); color: var(--red); }
.banner b { display: block; font-size: 1.1765rem; }
.banner div { color: var(--label); margin-top: 4px; }
.banner .trans { color: var(--label2); }
.solrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.1765rem; }
.fbrow { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
.fbrow .navbtn { font-size: 0.8824rem; }

.solution { margin-top: 12px; background: var(--card); border-radius: 14px; padding: 4px 16px; }
.solution summary { min-height: 44px; display: flex; align-items: center; color: var(--blue); cursor: pointer; }

.qnav { overscroll-behavior-x: contain; scrollbar-width: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--sep); background: var(--bar); }
.qn { flex: none; min-width: 44px; min-height: 44px; border-radius: 22px; background: var(--fill); font-variant-numeric: tabular-nums; transition: transform 0.4s var(--spring); }
.qn.done { background: color-mix(in srgb, var(--blue) 22%, transparent); }
.qn:active { transform: scale(0.92); transition-duration: 0.08s; }
.qn.cur { background: var(--blue); color: #fff; font-weight: 600; }

/* ---------- Dock: Akzentleiste und Aktionen ---------- */

/* schwebende Ebene über dem Inhalt: Material statt Rahmen */
.dock {
  margin: 0 8px calc(8px + env(safe-area-inset-bottom));
  padding: 12px;
  border-radius: 32px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px var(--sep);
}
/* über der Tastatur gibt es keinen Home-Balken: kompakter */
#app.kb .dock { margin-bottom: 8px; padding: 8px; border-radius: 26px; }

.accbar { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-bottom: 10px; padding: 0 2px; }
.accbar::-webkit-scrollbar { display: none; }
#app.kb .accbar { margin-bottom: 8px; }
.acc {
  flex: none;
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 1.2941rem;
  transition: transform 0.4s var(--spring), background-color 0.3s var(--ease);
}
.acc:active { transform: scale(0.92); background: rgba(120, 120, 128, 0.3); transition-duration: 0.07s; }

.actions { display: flex; gap: 8px; }
.btn {
  flex: 1;
  min-height: 52px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  padding: 0 20px;
  transition: transform 0.4s var(--spring), filter 0.3s var(--ease);
}
.btn:active { transform: scale(0.97); filter: brightness(0.92); transition-duration: 0.07s; }
.btn:disabled { opacity: 0.35; }
.btn.secondary { background: var(--fill); color: var(--label); font-weight: 500; }
.btn.flex0 { flex: 0 0 auto; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-text { color: var(--red); }
.actions.col { flex-direction: column; }
.actions.spaced { margin-bottom: 20px; }
.hint.centered { text-align: center; margin: 0; }
.hint.pad { margin: 12px 16px 16px; }
.gap { height: 20px; }

.textin {
  -webkit-user-select: text;
  user-select: text;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--label);
  font: inherit;
  font-size: 1rem;
  outline: none;
}
.textin.inline { padding-left: 0; flex: 1; min-width: 0; }

/* ---------- Ergebnis ---------- */

.grade { text-align: center; padding: 12px 0 20px; }
.gnum { font-size: 4.9412rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.gof { font-size: 2rem; color: var(--label2); font-weight: 600; }
.gname { font-size: 1.2941rem; font-weight: 600; margin-top: 4px; }
.gsub { color: var(--label2); margin-top: 6px; }

.rtask { background: var(--card); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.rtask summary { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none; }
.rtask summary::-webkit-details-marker { display: none; }
.mark { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-size: 0.8824rem; font-weight: 700; color: #fff; flex: none; }
.rtask.ok .mark { background: var(--green); }
.rtask.bad .mark { background: var(--red); }
.rbody { padding: 0 16px 14px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.cmp small { display: block; color: var(--label2); font-size: 0.7647rem; }
.cmp > div { background: var(--fill); border-radius: 10px; padding: 8px 12px; overflow-wrap: anywhere; }

/* ---------- Bestätigungsdialog ---------- */

.sheet-bg { animation: fade-in 0.3s var(--ease) both; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { animation: sheet-up 0.45s var(--ease) both; width: 100%; max-width: 560px; background: var(--card); border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.sheet h3 { margin: 0; font-size: 1.1765rem; }
.sheet p { margin: 0 0 6px; color: var(--label2); }

@media (min-width: 700px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; padding-bottom: 16px; animation-name: sheet-pop; }
  .qtext { font-size: 1.7647rem; }
}

/* ---------- Bewegung ---------- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-pop { from { opacity: 0; transform: scale(0.94); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { transform: scale(0.97); } }
@keyframes nudge { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }

/* Seitenwechsel wie in iOS: neue Seite von rechts, die alte rückt ein Stück mit; Reiter blenden über */
::view-transition-group(root) { animation-duration: 0.38s; animation-timing-function: var(--ease); }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; animation-duration: 0.38s; animation-timing-function: var(--ease); }
html[data-vt="fade"]::view-transition-old(root), html[data-vt="fade"]::view-transition-new(root) { animation-duration: 0.2s; }
html[data-vt="push"]::view-transition-new(root) { animation-name: vt-in-right; z-index: 2; }
html[data-vt="push"]::view-transition-old(root) { animation-name: vt-out-left; z-index: 1; }
html[data-vt="pop"]::view-transition-new(root) { animation-name: vt-in-left; z-index: 1; }
html[data-vt="pop"]::view-transition-old(root) { animation-name: vt-out-right; z-index: 2; }
@keyframes vt-in-right { from { transform: translateX(100%); } }
@keyframes vt-out-left { to { transform: translateX(-28%); } }
@keyframes vt-in-left { from { transform: translateX(-28%); } }
@keyframes vt-out-right { to { transform: translateX(100%); } }

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

/* ---------- Zurück-Knopf: runder Glasknopf mit Lichtkante ---------- */

.backbtn {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--label);
  transition: transform 0.4s var(--spring);
}
.backbtn::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card) 62%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px var(--sep),
    inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.95),
    inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.55);
}
.backbtn svg {
  position: relative;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.backbtn:active { transform: scale(0.9); transition-duration: 0.07s; }
@media (prefers-color-scheme: dark) {
  .backbtn::before {
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.5),
      0 0 0 0.5px var(--sep),
      inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.4),
      inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.18);
  }
  .tabbar { box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 0 0.5px var(--sep), inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, 0.3), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, 0.12); }
}

/* am Handy größer (Laptop und iPad bleiben bei 44 pt) */
@media (max-width: 699px) {
  .backbtn { width: 52px; height: 52px; }
  .backbtn::before { inset: 4px; }
  .backbtn svg { width: 26px; height: 26px; }
}

/* ---------- Große Titel, Haptik ---------- */

.nav.lg { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease); }
.nav.lg .navtitle { opacity: 0; transition: opacity 0.2s var(--ease); }
.nav.lg.show { background: var(--bar); border-bottom-color: var(--sep); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.nav.lg.show .navtitle { opacity: 1; }
.nav.lg + .content h1.title { margin-top: 0; }

.haptic { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
