: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 */
  /* Kante der Karten: hell ein Hauch Rand und Schatten, dunkel eine feine Lichtkante (keine Unschärfe: Inhalt, nicht Glas) */
  --edge: 0 0 0 0.5px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.05);
  --hair: 0.5px solid var(--sep);
  --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;
    --edge: 0 0 0 0.5px rgba(255, 255, 255, 0.2), 0 -0.5px 0 0.5px rgba(255, 255, 255, 0.08);
    --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; }

/* Glasleiste wie in iOS (Liquid Glass): durchscheinend mit Unschärfe, Lichtkante oben links, Auswahl als Glaslinse */
.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;
  isolation: isolate;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 58%, transparent), color-mix(in srgb, var(--card) 44%, transparent));
  -webkit-backdrop-filter: blur(22px) saturate(1.9) brightness(1.04);
  backdrop-filter: blur(22px) saturate(1.9) brightness(1.04);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06), 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),
    inset 0 0 14px rgba(255, 255, 255, 0.18);
}
.content:has(+ .tabbar) { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
/* Glaslinse hinter der Auswahl (Reiterleiste, Auswahlleisten), gleitet mit Feder (placeLens in app.js) */
.lens {
  position: absolute;
  z-index: -1;
  top: var(--pad);
  bottom: var(--pad);
  left: var(--pad);
  width: calc((100% - 2 * var(--pad) - (var(--n, 1) - 1) * var(--gap)) / var(--n, 1));
  border-radius: var(--lr);
  transform: translateX(calc(var(--i, 0) * (100% + var(--gap))));
  will-change: transform;
}
.lens[hidden] { display: none; }
.tabbar { --pad: 4px; --gap: 4px; --lr: 30px; }
.tabbar .lens {
  background: var(--fill);
  box-shadow: inset 1px 1px 0.5px -0.5px rgba(255, 255, 255, 0.85), inset -1px -1px 0.5px -0.5px rgba(255, 255, 255, 0.4), 0 1px 4px rgba(0, 0, 0, 0.06);
}
.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: color 0.25s var(--ease), transform 0.4s var(--spring);
}
.tab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab:active { transform: scale(0.92); transition-duration: 0.08s; }
.tab[aria-current="page"] { color: var(--blue); }

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

.list { background: var(--card); border-radius: 12px; overflow: hidden; margin-bottom: 20px; box-shadow: var(--edge); }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  text-align: left;
}
.row { position: relative; }
/* Trennlinien wie in iOS: haarfein und ab dem Text eingerückt */
.row + .row::before, .stat + .stat::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: var(--hair); pointer-events: none; }
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 { position: relative; }
.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 */
/* Auswahlleiste: Glasrinne mit gleitender Linse */
.seg { --pad: 3px; --gap: 2px; --lr: 9px; position: relative; isolation: isolate; display: flex; gap: var(--gap); padding: var(--pad); border-radius: 12px; margin-bottom: 14px;
  background: var(--fill); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 0 0 0.5px var(--sep); }
.seg button { flex: 1; min-width: 0; min-height: 40px; border-radius: 9px; font-size: 0.8824rem; font-weight: 500; color: var(--label2); transition: color 0.25s var(--ease), transform 0.4s var(--spring); }
.seg button[aria-pressed="true"] { color: var(--label); font-weight: 600; }
.seg button:active { transform: scale(0.94); transition-duration: 0.08s; }
.seg .lens { background: var(--seg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04),
  inset 1px 1px 0.5px -0.5px rgba(255, 255, 255, 0.95), inset -1px -1px 0.5px -0.5px rgba(255, 255, 255, 0.5); }
.seg.lvseg button { min-height: 44px; font-size: 1rem; }
.lvinfo { margin-top: -6px; }

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

.week { background: var(--card); border-radius: 16px; padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--edge); }
.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; box-shadow: var(--edge); }
.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; box-shadow: var(--edge); }
.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: var(--hair); }

.hero { background: var(--card); border-radius: 16px; padding: 20px 16px 16px; margin-bottom: 20px; text-align: center; box-shadow: var(--edge); }
.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; background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: var(--edge); }
.group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 16px; cursor: pointer; list-style: none; transition: background-color 0.35s var(--ease); }
.group summary:active { background: var(--fill); transition: 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-bottom: var(--hair); }
.group[open] summary .chev { transform: rotate(90deg); }
.group .list { margin: 0; border-radius: 0; box-shadow: none; }

/* ---------- 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; box-shadow: var(--edge); }
.rule.plain { background: none; padding: 0; margin: 0; }
.rule p { margin: 10px 0; }
.q .rule p { font-size: 1rem; }

/* ---------- Karteikarte: eine Karte auf dem Stapel, Kopf mit roter Linie, Rückseite nach dem Umdrehen ---------- */

.deck { position: relative; isolation: isolate; margin-bottom: 18px; }
/* die nächsten Karten der Runde liegen darunter */
.deck::before, .deck::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -9px;
  height: 40px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--edge);
  opacity: 0.85;
}
.deck::after { left: 26px; right: 26px; bottom: -17px; opacity: 0.55; z-index: -1; }
.deck::before { z-index: 0; }
.deck.d1::after, .deck.d0::before, .deck.d0::after { display: none; }
.card {
  position: relative;
  z-index: 1;
  min-height: clamp(220px, 34vh, 340px);
  display: flex;
  flex-direction: column;
  text-align: center;
  background: var(--card);
  border-radius: 20px;
  padding: 12px 18px 22px;
  box-shadow: var(--edge), 0 8px 24px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) { .card { box-shadow: var(--edge), 0 10px 28px rgba(0, 0, 0, 0.55); } }
.cmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-size: 0.7647rem;
  color: var(--label2);
  text-align: left;
  /* wie die rote Kopflinie einer Karteikarte */
  border-bottom: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
}
.cmeta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boxes { display: inline-flex; gap: 4px; flex: none; }
.boxes i { width: 7px; height: 7px; border-radius: 50%; background: var(--fill); }
.boxes i.on { background: var(--blue); }
.tag { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--label); font-weight: 600; }
.card .qhead { margin-bottom: 10px; }
.card .qtext { font-size: 1.6471rem; margin: auto 0; padding: 6px 0; }
.card .rule.plain { text-align: left; }
.card .speak { justify-content: center; }
.card .solrow { justify-content: center; }
.qecho { color: var(--label2); font-size: 0.9412rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.cres { font-size: 1.1765rem; font-weight: 700; margin-bottom: 10px; }
.csol { font-size: 1.2941rem; font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.card.back .solrow { font-size: 1.2941rem; font-weight: 600; margin: auto 0; }
.card.back .qback { margin: auto 0; font-size: 1.6471rem; font-weight: 600; }
.card.back .qback.long { text-align: left; font-size: 1.1765rem; font-weight: 400; }
.card.back.ok { box-shadow: 0 0 0 2px var(--green), 0 8px 24px rgba(0, 0, 0, 0.08); }
.card.back.ok .cres { color: var(--green); }
.card.back.bad { box-shadow: 0 0 0 2px var(--red), 0 8px 24px rgba(0, 0, 0, 0.08); }
.card.back.bad .cres { color: var(--red); }
/* Austeilen und Umdrehen */
.card.deal { animation: deal 0.34s var(--ease) both; }
.card.flipin { animation: flipin 0.46s var(--ease) both; transform-origin: 50% 50%; }
@keyframes deal { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
@keyframes flipin { from { transform: perspective(1100px) rotateY(-88deg); } }
.pace { margin-top: -8px; }

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

.q { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--edge); }
.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; box-shadow: var(--edge); }
.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; box-shadow: var(--edge); }
.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, .navbtn.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; box-shadow: var(--edge); }
.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 12px 36px 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), inset 0 0 14px rgba(255, 255, 255, 0.05); }
  .tabbar .lens { box-shadow: inset 1px 1px 0.5px -0.5px rgba(255, 255, 255, 0.35), inset -1px -1px 0.5px -0.5px rgba(255, 255, 255, 0.15); }
  .seg .lens { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 1px 1px 0.5px -0.5px rgba(255, 255, 255, 0.3), inset -1px -1px 0.5px -0.5px 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; }

/* ---------- Zurückwischen: Kante wirft Schatten, solange die Seite dem Finger folgt ---------- */

#app.dragging { box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18); }

/* ---------- Kontrast erhöhen: deutlichere Kanten und Linien ---------- */

@media (prefers-contrast: more) {
  :root { --edge: 0 0 0 1px rgba(0, 0, 0, 0.3); --sep: rgba(60, 60, 67, 0.45); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --edge: 0 0 0 1px rgba(255, 255, 255, 0.4); --sep: rgba(235, 235, 245, 0.45); }
}

/* ---------- Fragen an Claude: Blatt von unten mit Verlauf und Eingabe ---------- */

.navr { display: flex; align-items: center; gap: 2px; }
.iconbtn { display: grid; place-items: center; width: 44px; height: 44px; color: var(--blue); transition: opacity 0.3s var(--ease); }
.iconbtn:active { opacity: 0.4; transition: none; }
.iconbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
/* Der Chat liegt in der App (nicht über dem ganzen Fenster): die App wird bei offener Tastatur
   auf den sichtbaren Bereich verkleinert, so sitzt das Eingabefeld immer direkt über der Tastatur */
.sheet-bg.chatbg { position: absolute; overscroll-behavior: none; touch-action: none; }
.sheet.chat { height: 88%; max-height: 760px; display: flex; flex-direction: column; gap: 0; padding: 8px 0 0; touch-action: auto; }
#app.kb .sheet.chat { height: calc(100% - 6px); max-height: none; animation: none; }
#app.kb .chatbar { padding-bottom: 8px; }
.chathead, .chatseg { flex: none; }
.chathead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px 8px 16px; border-bottom: var(--hair); }
.chathead small { color: var(--label2); font-size: 0.7647rem; text-align: center; }
.chathead .navbtn { justify-self: end; font-weight: 600; }
.chatlog { flex: 1; min-height: 0; overflow-y: scroll; overscroll-behavior: contain; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-user-select: text; user-select: text; }
.chatlog .hint.pad { margin: 4px 0 8px; }
.chatlog .bad { color: var(--red); }
.chips.sugg { background: none; padding: 0; min-height: 0; justify-content: flex-start; }
.chips.sugg .chip { font-size: 0.9412rem; min-height: 40px; background: var(--fill); }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.4; overflow-wrap: anywhere; animation: rise 0.3s var(--ease) both; }
.msg p { margin: 0; }
.msg p + p, .msg ul + p, .msg p + ul { margin-top: 8px; }
.msg ul { margin: 0; padding-left: 18px; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--fill); border-bottom-left-radius: 6px; }
.typing { color: var(--label2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.chatbar { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: var(--hair); }
.chatbar textarea { flex: 1; resize: none; min-height: 44px; max-height: 132px; padding: 11px 16px; font-size: 1rem; line-height: 1.3; -webkit-user-select: text; user-select: text; border-radius: 22px; border: 0.5px solid var(--sep); background: var(--fill); color: var(--label); font: inherit; outline: none; }
.sendbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; transition: transform 0.4s var(--spring); }
.sendbtn:active { transform: scale(0.92); transition-duration: 0.07s; }
.sendbtn:disabled { opacity: 0.35; }
.sendbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.seg.chatseg { margin: 10px 16px 0; }
.seg.chatseg button { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.seg.chatseg b { font-size: 0.8824rem; }
.seg.chatseg small { font-size: 0.7059rem; color: var(--label2); font-weight: 400; }
/* bei offener Tastatur zählt jeder Pixel für den Verlauf */
#app.kb .seg.chatseg { margin-top: 6px; }
#app.kb .seg.chatseg button { min-height: 36px; }
#app.kb .seg.chatseg small { display: none; }

/* ---------- Antwortfeld in der Leiste: sitzt immer direkt über der Tastatur ---------- */

.ansin.docked { margin: 0 0 10px; min-height: 50px; padding: 8px 18px; border-radius: 25px; font-size: 1.1765rem; background: var(--card); }
#app.kb .ansin.docked { margin-bottom: 8px; min-height: 46px; }
/* bei offener Tastatur: Karte kompakt oben, damit Aufgabe und Eingabe zugleich zu sehen sind */
#app.kb .content { padding-top: 8px; }
#app.kb .deck { margin-bottom: 8px; }
#app.kb .deck::before, #app.kb .deck::after { display: none; }
#app.kb .card { min-height: 0; padding: 8px 14px 12px; }
#app.kb .cmeta { margin-bottom: 8px; padding-bottom: 6px; }
#app.kb .card .qhead { margin-bottom: 4px; }
#app.kb .card .qtext, #app.kb .q .qtext { font-size: 1.2941rem; margin: 0; padding: 2px 0; }
#app.kb .q { padding: 10px 14px; }
#app.kb .speak { margin-top: 6px; }
.ansrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ansrow .ansin.docked { margin: 0; flex: 1; min-width: 0; }
.kbonly { display: none; }
#app.kb .kbonly { display: grid; }
#app.kb .ansrow { margin-bottom: 8px; }
#app.kb .dock:has(.ansrow) .actions { display: none; }
#app.kb .accbar { margin-bottom: 0; }
.timein { font: inherit; color: var(--blue); background: var(--fill); border: 0; border-radius: 8px; padding: 6px 10px; min-height: 36px; -webkit-user-select: text; user-select: text; }

/* ---------- Üben ---------- */

.row.big { min-height: 68px; }
.ricon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 1.0588rem; }
.row.big > span:nth-child(2) { flex: 1; }

/* Blitzrunde: zwei Spalten mit Wörtern */
.pscore { text-align: center; margin: 4px 0 14px; }
.pscore b { display: block; font-size: 2.8235rem; line-height: 1; font-variant-numeric: tabular-nums; }
.pscore small { color: var(--label2); }
.ptime { font-weight: 600; }
.ptime b { font-variant-numeric: tabular-nums; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pcol { display: grid; gap: 10px; }
.ptile {
  min-height: 60px; padding: 8px 10px; border-radius: 14px; background: var(--card); box-shadow: var(--edge);
  font-size: 1rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere;
  transition: transform 0.4s var(--spring), background-color 0.2s var(--ease);
}
.ptile:active { transform: scale(0.96); transition-duration: 0.07s; }
.ptile.sel { background: var(--blue); color: #fff; box-shadow: none; }
.ptile.bad { background: var(--red-bg); color: var(--red); animation: nudge 0.4s var(--ease); }
.ptile.new { animation: pop-in 0.35s var(--spring) both; }
.pcol:last-child .ptile:not(.sel):not(.bad) { color: var(--fr); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } }

/* ---------- Schreiben ---------- */

.wtask { font-size: 1.0588rem; line-height: 1.4; margin: 2px 0 6px; }
.writein {
  display: block; width: 100%; min-height: 180px; margin-top: 14px; padding: 14px 16px; resize: vertical;
  border-radius: 16px; border: 0.5px solid var(--sep); background: var(--card); box-shadow: var(--edge);
  color: var(--label); font: inherit; font-size: 1.0588rem; line-height: 1.45; outline: none;
  -webkit-user-select: text; user-select: text;
}
.writein:focus { border-color: var(--blue); }
#app.kb .writein { min-height: 120px; }
.wres p { margin: 0; font-size: 1.0588rem; line-height: 1.5; -webkit-user-select: text; user-select: text; }
.row.mist .fix { display: block; font-size: 1.0588rem; }
.row.mist s { color: var(--red); }
.row.mist b { color: var(--green); display: inline; }

/* ---------- Lesen ---------- */

.reading p { margin: 0 0 12px; font-size: 1.1176rem; line-height: 1.6; -webkit-user-select: none; user-select: none; }
.reading p:last-child { margin-bottom: 0; }
.reading .w { border-radius: 4px; cursor: pointer; transition: background-color 0.2s var(--ease); }
.reading .w:active, .reading .w.on { background: color-mix(in srgb, var(--fr) 25%, transparent); }
.glossbar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px;
  padding: 12px 14px 12px 18px; border-radius: 18px; animation: rise 0.25s var(--ease) both;
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 0 0 0.5px var(--sep);
}
.glossbar b { color: var(--fr); font-size: 1.1176rem; }
.glossbar small { display: block; color: var(--label2); font-size: 0.8235rem; }
.glossbar .muted { color: var(--label2); }
.row.rq b { font-weight: 500; }
.row.rq .ans { color: var(--label); margin-top: 4px; }

/* ---------- Piktogramme ---------- */

.picto { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ricon .picto { width: 22px; height: 22px; stroke-width: 1.9; }
.dot .picto { width: 16px; height: 16px; stroke-width: 2.6; }
.dot.rest .picto { stroke-width: 2.2; }
.hnum.done { display: grid; place-items: center; color: var(--green); }
.hnum.done .picto { width: 60px; height: 60px; stroke-width: 2.2; }
.mark .picto { width: 15px; height: 15px; stroke: #fff; stroke-width: 2.8; }

/* Fächer: Hub und Verwaltung */
.hubrow { min-height: 72px; justify-content: flex-start; }
.hubrow > span:nth-child(2) { flex: 1; min-width: 0; }
.hubicon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--fill); color: var(--blue); }
.hubicon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hubbtn { padding-left: 0; }
/* Verwaltung: Personen mit Anfangsbuchstaben, Fächer als kleine Symbole, Schalter je Fach */
.avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 600; font-size: 1.05rem; color: #fff;
  background: linear-gradient(180deg, #a1a1aa, #7c7c85); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.prow, .arow { justify-content: flex-start; }
.prow > span:nth-child(2), .arow > span:nth-child(2) { flex: 1; min-width: 0; }
.arow[aria-disabled="true"] .switch { opacity: 0.5; }
.hubicon.sm { width: 32px; height: 32px; border-radius: 9px; }
.hubicon.sm svg { width: 21px; height: 21px; }
.minis { flex: none; display: flex; gap: 4px; }
.mini { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--fill); color: var(--label3, var(--label2)); opacity: 0.45; }
.mini.on { color: var(--blue); opacity: 1; }
.mini svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tag { font-style: normal; font-size: 0.7059rem; font-weight: 600; color: var(--blue); background: var(--fill); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px; }
.phead { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 4px; }
.phead .avatar { width: 84px; height: 84px; font-size: 2.2rem; }
.phead .title { margin: 12px 0 2px; }
.sectionhead.ahead { display: flex; align-items: center; gap: 8px; text-transform: none; }
.sectionhead.ahead span:not(.hubicon) { flex: 1; font-weight: 600; color: var(--label); font-size: 0.9412rem; }

/* ---------- Mathe (js/mathui.js): Rechnung, Felder, Zahlenfeld, Lösungsweg ---------- */

.mq { font-size: 1.1765rem; }
.expr { font-size: 1.6471rem; line-height: 1.5; text-align: center; margin: 12px 0 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.q.small .expr { font-size: 1.2941rem; }
.mq.blitz .expr { font-size: 2.4rem; margin: 8px 0; }
.mq sup, .step sup { font-size: 0.65em; line-height: 0; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 0.12em; font-size: 0.9em; }
.frac > span { padding: 0 0.2em; }
.frac > span:first-child { border-bottom: 0.08em solid currentColor; }
.frac.fin { font-size: 0.8em; margin: 2px 0; }
.frac.fin > span.slot { min-width: 2.1em; min-height: 1.3em; padding: 0 0.35em; border-radius: 8px; background: var(--fill); text-align: center; border-bottom: 0; }
.frac.fin > span.slot:first-child { margin-bottom: 0.12em; }

.fields { display: grid; gap: 10px; margin-top: 14px; }
.field { display: block; width: 100%; min-height: 64px; text-align: left; padding: 8px 16px 10px; border-radius: 14px; background: var(--card); border: 2px solid transparent; box-shadow: var(--edge); }
.field.active { border-color: var(--blue); }
.field.ok { background: var(--green-bg); border-color: var(--green); animation: pop 0.45s var(--spring); }
.field.bad { background: var(--red-bg); border-color: var(--red); animation: nudge 0.4s var(--ease); }
.flabel { display: block; font-size: 0.7647rem; color: var(--label2); }
.fval { display: block; font-size: 1.7647rem; line-height: 1.3; min-height: 39px; font-variant-numeric: tabular-nums; }
.field.active:not([data-kind="frac"]) .fval::after,
.field.active .slot.cur::after { content: ""; display: inline-block; width: 2px; height: 0.95em; margin-left: 2px; vertical-align: -0.1em; background: var(--blue); animation: caret 1.1s steps(1) infinite; }
.field.active .slot.cur { box-shadow: inset 0 0 0 2px var(--blue); }
@keyframes caret { 50% { opacity: 0; } }
.unit { color: var(--label2); font-size: 1.1765rem; margin-left: 6px; }

.morder { margin-top: 14px; }
.orderlabel { font-size: 0.7647rem; color: var(--label2); margin: 12px 4px 6px; }
.chip.num { position: relative; min-width: 64px; min-height: 64px; font-size: 1.4118rem; font-variant-numeric: tabular-nums; }
.chip.num small { position: absolute; top: 2px; left: 6px; font-size: 0.6471rem; color: var(--label2); }
.chip.ok { background: var(--green-bg); }
.chip.bad { background: var(--red-bg); }

.step { padding: 6px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.step + .step { border-top: 1px solid var(--sep); }
.solution .orderlabel { margin-left: 0; }

.keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.key { height: clamp(48px, 7vh, 62px); border-radius: 999px; background: var(--fill); color: var(--label); font-size: 1.6471rem; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none; display: grid; place-items: center; transition: transform 0.4s var(--spring), background-color 0.3s var(--ease); }
.key:active { transform: scale(0.94); background: rgba(120, 120, 128, 0.3); transition-duration: 0.07s; }
.key:disabled { opacity: 0.25; }
.key.fn { background: transparent; color: var(--label2); font-size: 1.4118rem; }
.key.fn:active { background: var(--fill); }
.key.small { font-size: 0.9412rem; }
.key.wide { grid-column: span 2; }
.key.blank { visibility: hidden; }
.key svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .key { transition: none; } .key:active { transform: none; } }

.counter { display: flex; align-items: center; gap: 4px; flex: none; }
.counter output { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.cbtn { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); color: var(--blue); font-size: 1.4118rem; transition: transform 0.4s var(--spring); }
.cbtn:active { transform: scale(0.9); transition-duration: 0.08s; }
.cbtn:disabled { color: var(--label2); opacity: 0.4; }
.sum { text-align: center; color: var(--label2); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
b.blue { color: var(--blue); font-weight: 500; }

/* schriftliche Multiplikation (js/math/hard.js) */
.wmul { display: inline-block; margin: 6px 0; font-variant-numeric: tabular-nums; color: var(--label); }
.wrow { display: flex; line-height: 1.5; }
.wrow span { flex: 0 0 0.68em; text-align: center; }
.wrow.whead { border-bottom: 1px solid var(--sep); }
.wrow.whead span:not(:empty) { font-weight: 600; }
.wrow:not(.whead):not(.wsum) { color: var(--label2); }
.wrow.wsum { border-top: 1px solid var(--sep); font-weight: 600; color: var(--label); }

/* ---------- Fachwechsel wie beim Aufklappen des iPhone Duo (js/warp.js) ---------- */

.warp { position: fixed; inset: 0; z-index: 1000; overflow: hidden; pointer-events: none; perspective: 1400px; will-change: transform, opacity; }
.warp .panel { position: absolute; inset: 0; overflow: hidden; background: #000; will-change: clip-path, transform; }
.warp .emb { position: absolute; inset: 0; overflow: hidden; will-change: transform; }
/* weiche Ebene: einmal unscharf gezeichnet, zur äußeren Kante hin sichtbar (wie die Duo-Unschärfe) */
.warp .emb.soft { filter: blur(26px) saturate(1.3); opacity: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 8%, #000 70%); mask-image: linear-gradient(90deg, transparent 8%, #000 70%); }
.warp .shade { position: absolute; inset: 0; opacity: 0; background: linear-gradient(90deg, transparent 18%, rgba(0, 0, 0, 0.55) 60%, #000 100%); }
.warp .flag { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.warp .flag.fr { background: linear-gradient(90deg, #002654 0 33.34%, #fff 33.34% 66.67%, #ce1126 66.67%); }
/* Stoff: weiche Falten und Licht von oben links */
.warp .cloth { position: absolute; inset: 0; mix-blend-mode: soft-light; background:
  linear-gradient(104deg, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0.45) 14%, rgba(0, 0, 0, 0.3) 30%, rgba(255, 255, 255, 0.4) 47%,
    rgba(0, 0, 0, 0.35) 63%, rgba(255, 255, 255, 0.35) 79%, rgba(0, 0, 0, 0.4) 100%),
  radial-gradient(130% 90% at 20% 0%, rgba(255, 255, 255, 0.5), transparent 55%),
  radial-gradient(120% 80% at 90% 110%, rgba(0, 0, 0, 0.6), transparent 60%); }
/* Falten auch auf Weiß sichtbar */
.warp .cloth::after { content: ""; position: absolute; inset: 0; mix-blend-mode: multiply;
  background: linear-gradient(104deg, rgba(0, 0, 0, 0.1) 0%, transparent 14%, rgba(0, 0, 0, 0.09) 30%, transparent 47%, rgba(0, 0, 0, 0.1) 63%, transparent 79%, rgba(0, 0, 0, 0.12) 100%); }
.warp .sheen { position: absolute; inset: -20% -60%; mix-blend-mode: overlay;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%); }
.warp .board { position: absolute; inset: 0; color: #fff; font-family: ui-rounded, -apple-system, system-ui, sans-serif;
  background: radial-gradient(120% 85% at 50% 30%, #5856d6 0%, #2b2a7a 45%, #0e0e24 100%); }
.warp .board .grid { position: absolute; inset: 0; background-image:
  linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px; -webkit-mask-image: radial-gradient(90% 70% at 50% 40%, #000, transparent); mask-image: radial-gradient(90% 70% at 50% 40%, #000, transparent); }
.warp .board span { position: absolute; transform: translate(-50%, -50%); font-weight: 600; opacity: 0.6; text-shadow: 0 0 28px rgba(170, 175, 255, 0.9); }
.warp .lift, .warp .rim { position: absolute; border-radius: 32px; opacity: 0; will-change: transform, opacity; }
.warp .lift { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35); }
.warp .rim { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), inset 0 1px 0 1px rgba(255, 255, 255, 0.25); }
.warp .glare { position: absolute; inset: -10% -40%; opacity: 0; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0.15) 54%, transparent 66%); }
.warp .bloom { position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(70% 55% at 50% 50%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25) 45%, transparent 75%); }
.warplabel { position: absolute; inset: 0; display: grid; place-items: center; }
.warplabel span { padding: 14px 30px; border-radius: 999px; font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; color: #fff;
  background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.25), 0 12px 40px rgba(0, 0, 0, 0.3); }

/* Auswahl in einer Listenzeile (Kapitel des Schulbuchs): wie eine iOS-Wertzeile, tippen öffnet die Systemauswahl */
.pick { flex: none; max-width: 52%; font: inherit; color: var(--blue); background: var(--fill); border: 0; border-radius: 8px; padding: 6px 10px; min-height: 36px; text-overflow: ellipsis; }

/* Umzug auf die neue Adresse (movedHTML) */
.moveicon { width: 88px; height: 88px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
.movesteps { text-align: left; max-width: 420px; margin: 4px auto 8px; padding-left: 1.4em; color: var(--label); line-height: 1.45; }
.movesteps li { margin: 6px 0; }
.warn { color: var(--red); }
