/* Hangzhou Hanyu – Prototyp
   Layout: Ein-Bildschirm-App. Kopfzeile oben, scrollender Inhalt, fünf Tabs unten in der Daumenzone.
   Farbwelt "Seladon und Tusche": Porzellanweiß, Tuscheschwarz, Seladongrün als Akzent, Siegelrot nur für Siegel und Markierungen. */

:root {
  --bg: #F4F6F3;
  --surface: #FFFFFF;
  --surface-2: #EAEFEB;
  --fg: #1A1F1C;
  --muted: #4F5C55;
  --line: #D9E0DC;
  --accent: #5E9C80;
  --accent-ink: #2F6B52;
  --accent-soft: #DCEBE2;
  --seal: #B8432F;
  --seal-soft: #F3DCD6;
  --ok: #2B744A;
  --warn: #8A6200;
  --bad: #B8432F;
  --tone1: #B8432F;
  --tone2: #8A6200;
  --tone3: #2B744A;
  --tone4: #3A68AB;
  --tone0: #4F5C55;
  /* Ab 0.9.15 (P14): Hauptknopf und Flächen mit Schrift darauf mindestens 4,5:1 (weiß auf #3F7D62: 4,86) */
  --accent-strong: #3F7D62;
  --on-accent: #FFFFFF;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-zh: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 10px 28px -14px rgba(20, 30, 25, 0.22);
  --nav-h: 64px;
  /* Safe Areas: Dynamic Island und Statusleiste oben, Home-Leiste unten, Kamera-Aussparung im Querformat */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121715; --surface: #1B2320; --surface-2: #232D28; --fg: #E8ECE9; --muted: #9AA8A1; --line: #2B3531;
    --accent: #8CC4A8; --accent-ink: #BFE1CF; --accent-soft: #1F3A2E; --seal: #D9674F; --seal-soft: #3A221D;
    --ok: #7CC497; --warn: #D9A94A; --bad: #E0735C;
    --tone1: #E0735C; --tone2: #D9A94A; --tone3: #7CC497; --tone4: #7FA7E8; --tone0: #9AA8A1; --accent-strong: #8CC4A8; --on-accent: #10241B;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121715; --surface: #1B2320; --surface-2: #232D28; --fg: #E8ECE9; --muted: #9AA8A1; --line: #2B3531;
  --accent: #8CC4A8; --accent-ink: #BFE1CF; --accent-soft: #1F3A2E; --seal: #D9674F; --seal-soft: #3A221D;
  --ok: #7CC497; --warn: #D9A94A; --bad: #E0735C;
  --tone1: #E0735C; --tone2: #D9A94A; --tone3: #7CC497; --tone4: #7FA7E8; --tone0: #9AA8A1; --accent-strong: #8CC4A8; --on-accent: #10241B;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: var(--sat); z-index: 10; background: var(--bg);
}
* { box-sizing: border-box; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea, label, .tab, .card { touch-action: manipulation; }
/* iOS vergrößert die Seite beim Tippen in Felder unter 16 px; das bleibt so aus. */
input, select, textarea { font-size: max(16px, 1em); }
/* Lange drücken liest vor: kein Auswahl- oder Kontextmenü auf den Lerninhalten (Eingabefelder bleiben normal). */
.zh:not(input):not(textarea), .de-main, .de-big, .de-big-inline { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.zh { font-family: var(--font-zh); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }

/* ---------- App-Rahmen ---------- */
#app {
  height: 100%;
  height: 100dvh;
  padding-top: var(--sat);
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px var(--line); }
}
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, var(--sal));
  padding-right: max(16px, var(--sar));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-zh { font-size: 1.35rem; color: var(--accent-ink); }
.brand-name { font-weight: 800; letter-spacing: -0.01em; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--seal); color: #fff; font-weight: 800; display: grid; place-items: center;
  font-family: var(--font-zh); font-size: 1.1rem;
}
#view {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-left: max(16px, var(--sal));
  padding-right: max(16px, var(--sar));
  padding-block: 14px calc(var(--nav-h) + 24px + var(--sab));
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { #view { scroll-behavior: auto; } }
.screen { display: flex; flex-direction: column; gap: 16px; }
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.screen-head .eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

/* ---------- Tabs unten ---------- */
.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 6;
  display: flex; justify-content: space-around;
  padding-top: 6px;
  padding-bottom: max(6px, calc(var(--sab) - 6px));
  padding-left: max(8px, var(--sal));
  padding-right: max(8px, var(--sar));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; min-height: 52px; border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-ink); }
.tab[aria-current="page"] svg { color: var(--accent); }

/* ---------- Bausteine ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.accent { background: var(--accent-soft); border-color: transparent; }
.card.seal-bg { background: var(--seal-soft); border-color: transparent; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.btn {
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.primary:disabled { opacity: 0.45; cursor: default; }
.btn.ghost { background: transparent; }
.btn.seal { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent; font-size: 0.85rem; font-weight: 700; color: var(--fg);
}
.chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.chip.red { background: var(--seal-soft); color: var(--seal); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; white-space: nowrap; }
.subtabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.subtabs button { flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--muted); }
.subtabs button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.progress.seal > span { background: var(--seal); }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi span { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pill-tone { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 0.8rem; font-weight: 800; color: #fff; }
.t1 { color: var(--tone1); } .t2 { color: var(--tone2); } .t3 { color: var(--tone3); } .t4 { color: var(--tone4); } .t0 { color: var(--tone0); }
.bg-t1 { background: var(--tone1); } .bg-t2 { background: var(--tone2); } .bg-t3 { background: var(--tone3); } .bg-t4 { background: var(--tone4); } .bg-t0 { background: var(--tone0); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + var(--sab)); transform: translateX(-50%);
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 20; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow);
}
.hint-box { border-left: 3px solid var(--accent); padding: 6px 12px; color: var(--muted); font-size: 0.92rem; background: var(--surface-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* ---------- Heute ---------- */
.hero-today { display: flex; flex-direction: column; gap: 6px; }
.hero-today .greet { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-today .greet .zh { color: var(--accent-ink); margin-right: 8px; }
.countdown { display: flex; align-items: baseline; gap: 8px; }
.countdown b { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--seal); }
.plan-card { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.plan-card .icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-family: var(--font-zh); font-size: 1.5rem; flex: none; }
.plan-card .body { flex: 1; min-width: 0; }
.plan-card .body b { display: block; }
.plan-card .body span { color: var(--muted); font-size: 0.88rem; }
.plan-card.done .icon { background: var(--surface-2); color: var(--muted); }
.skill-row { display: grid; grid-template-columns: 84px 1fr 64px; align-items: center; gap: 10px; font-size: 0.9rem; }
.skill-row .num { text-align: right; color: var(--muted); font-weight: 700; }
.zdt { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; }
.zdt .writer { width: 140px; height: 140px; border-radius: var(--radius); background: var(--surface-2); display: grid; place-items: center; }
.zdt .py { font-size: 1.1rem; font-weight: 700; }
.streak-dots { display: flex; gap: 6px; }
.streak-dots span { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: var(--muted); }
.streak-dots span.on { background: var(--accent-strong); color: var(--on-accent); }
.streak-dots span.today { outline: 2px solid var(--seal); outline-offset: 2px; }

/* ---------- Zeichen ---------- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.char-cell { aspect-ratio: 1; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.char-cell .zh { font-size: 1.7rem; line-height: 1; }
.char-cell .dots { display: flex; gap: 2px; }
.char-cell .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.char-cell .dots i.on { background: var(--accent); }
.char-cell.active { border-color: var(--accent); background: var(--accent-soft); }
.writer-box { position: relative; width: min(100%, 300px); aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius); background: var(--surface-2); overflow: hidden; touch-action: none; }
.writer-box svg { display: block; width: 100%; height: 100%; }
.writer-box .gridlines { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.writer-box .gridlines line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 6; }
.char-meta { display: flex; flex-direction: column; gap: 10px; }
.char-meta .headline { display: flex; align-items: baseline; gap: 12px; }
.char-meta .headline .py { font-size: 1.4rem; font-weight: 800; }
.char-meta .headline .de { color: var(--muted); font-size: 1rem; }
.word-list { display: flex; flex-direction: column; gap: 6px; }
.word { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface-2); border: 0; width: 100%; text-align: left; }
.word .zh { font-size: 1.15rem; min-width: 64px; }
.word .py { font-weight: 700; }
.word .de { color: var(--muted); margin-left: auto; text-align: right; font-size: 0.9rem; }
.quiz-status { min-height: 24px; font-weight: 700; }
.deck { position: relative; height: 320px; }
.flashcard {
  position: absolute; inset: 0; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; user-select: none; touch-action: pan-y;
  transition: transform 0.25s ease, opacity 0.25s ease; will-change: transform;
}
.flashcard.under { transform: scale(0.95) translateY(10px); opacity: 0.6; }
.flashcard .zh { font-size: 5rem; line-height: 1; }
.flashcard .back { display: none; text-align: center; }
.flashcard.flipped .back { display: block; }
.flashcard .tag { position: absolute; top: 16px; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; opacity: 0; }
.flashcard .tag.left { left: 16px; background: var(--seal-soft); color: var(--seal); }
.flashcard .tag.right { right: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.deck-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Sätze ---------- */
.answer-row { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: var(--radius); border: 1px dashed var(--line); background: var(--surface); }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  min-height: 46px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-family: var(--font-zh); font-size: 1.25rem; font-weight: 600; box-shadow: var(--shadow); color: var(--fg);
}
.tile.used { opacity: 0.25; pointer-events: none; }
/* Pinyin-Hilfe: kleine Aussprachezeile über den Zeichen */
.ruby { display: block; font-family: var(--font-ui); font-size: 0.68rem; font-weight: 700; color: var(--muted); line-height: 1.15; text-align: center; letter-spacing: 0.01em; }
.tile .ruby { margin-bottom: 2px; }
.char-cell .ruby { font-size: 0.58rem; line-height: 1; }
.chip.starter { flex-direction: column; gap: 0; padding: 4px 12px; min-height: 44px; }
.flashcard.flipped .front-py { display: none; }
.tile.in { background: var(--accent-soft); border-color: var(--accent); }
.feedback { border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.feedback.ok { background: var(--accent-soft); color: var(--accent-ink); }
.feedback.bad { background: var(--seal-soft); color: var(--seal); }
.pattern { font-family: var(--font-zh); font-size: 1.4rem; }
.pattern .slot { display: inline-block; min-width: 2.2em; border-bottom: 3px solid var(--seal); color: var(--seal); text-align: center; }
.register { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.register button { flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; color: var(--muted); font-size: 0.88rem; }
.register button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }

/* ---------- Sprechen ---------- */
.phrase-card { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.phrase-card .zh { font-size: 2.6rem; line-height: 1.15; }
.phrase-card .py { font-size: 1.2rem; font-weight: 700; }
.syllables { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.syl { border: 0; border-radius: 10px; padding: 6px 10px; background: var(--surface-2); font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; }
.syl small { font-weight: 700; font-size: 0.7rem; opacity: 0.9; }
.mic-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mic {
  width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--seal); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px -10px var(--seal);
}
.mic svg { width: 36px; height: 36px; }
.mic.listening { animation: pulse 1.2s ease-in-out infinite; }
.mic:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .mic.listening { animation: none; outline: 3px solid var(--seal); outline-offset: 4px; } }
.align { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.align .c { font-family: var(--font-zh); font-size: 1.8rem; padding: 2px 8px; border-radius: 8px; border-bottom: 4px solid transparent; }
.align .c.ok { border-color: var(--ok); }
.align .c.miss { border-color: var(--bad); color: var(--bad); }
.align .c.extra { border-color: var(--warn); color: var(--warn); opacity: 0.8; }
.score { display: flex; align-items: center; gap: 12px; }
.ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.pitch { width: 100%; height: 90px; border-radius: var(--radius-s); background: var(--surface-2); display: block; }
.pair-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.pair { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pair .zh { font-size: 1.6rem; }
.pair .py { font-weight: 800; }
.pair .de { font-size: 0.75rem; color: var(--muted); text-align: center; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.4; white-space: pre-line; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--accent-soft); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble .zh { font-size: 1.2rem; }
.chat-input { display: flex; gap: 8px; }
.chat-input input { flex: 1; min-width: 0; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); padding: 0 16px; background: var(--surface); }

/* ---------- Familie ---------- */
.person-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
.person-scroll::-webkit-scrollbar { display: none; }
.person { flex: none; width: 112px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.person .zh { font-size: 1.5rem; color: var(--accent-ink); line-height: 1.1; }
.person .de { font-size: 0.8rem; font-weight: 700; }
.person .py { font-size: 0.75rem; color: var(--muted); }
.person.active { border-color: var(--accent); background: var(--accent-soft); }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); }
.phrase .zh { font-size: 1.2rem; }
.phrase .py { font-size: 0.88rem; font-weight: 700; color: var(--accent-ink); }
.phrase .de { font-size: 0.88rem; color: var(--muted); grid-column: 1 / -1; }
.phrase .acts { display: flex; gap: 6px; grid-row: 1 / span 2; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--fg); }
.iconbtn svg { width: 20px; height: 20px; }
details.acc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.acc summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; font-weight: 800; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.acc[open] summary::after { content: "–"; }
details.acc .acc-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--fg); }
.place { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); }
.place .zh { font-size: 1.3rem; grid-row: 1 / span 2; align-self: center; min-width: 70px; }
.place .top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.place .top b { font-size: 0.95rem; }
.place .top span { font-size: 0.85rem; color: var(--accent-ink); font-weight: 700; }
.place .note { font-size: 0.85rem; color: var(--muted); }

/* ---------- Zeig-Modus ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); color: var(--fg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding-top: calc(20px + var(--sat)); padding-bottom: calc(20px + var(--sab));
  padding-left: max(20px, var(--sal)); padding-right: max(20px, var(--sar));
}
.overlay .show-text { transform: rotate(180deg); text-align: center; display: flex; flex-direction: column; gap: 10px; }
.overlay .show-text .zh { font-size: clamp(2.4rem, 11vw, 4.2rem); line-height: 1.15; }
.overlay .show-text .py { font-size: 1.3rem; font-weight: 700; color: var(--accent-ink); }
.overlay .show-text .de { color: var(--muted); }
.overlay .divider { width: 60%; border-top: 2px dashed var(--line); }
.overlay .mine { text-align: center; color: var(--muted); font-size: 0.95rem; }
.overlay .reply { width: 100%; max-width: 480px; }

/* ---------- Profil ---------- */
.seal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.seal-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.seal-stamp {
  width: 64px; height: 64px; border-radius: 10px; background: var(--seal); color: #fff; display: grid; place-items: center;
  font-family: var(--font-zh); font-weight: 700; font-size: 1.25rem; line-height: 1; transform: rotate(-4deg); box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 5px rgba(255, 255, 255, 0.7);
  letter-spacing: 0.02em;
}
.seal-stamp.locked { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 3px var(--surface-2), inset 0 0 0 5px var(--line); transform: none; }
.seal-item b { font-size: 0.78rem; }
.seal-item span { font-size: 0.72rem; color: var(--muted); }
.friend { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.friend:last-child { border-bottom: 0; }
.friend .rank { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; }
.friend.me .rank { background: var(--accent-strong); color: var(--on-accent); }
.friend .xp { font-weight: 800; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.field input, .field select { min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { width: 48px; height: 28px; accent-color: var(--accent); }
.challenge { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.challenge:last-child { border-bottom: 0; }
.challenge .progress { grid-column: 1 / -1; }
.challenge .xp { font-weight: 800; color: var(--seal); font-size: 0.9rem; }
.footer-note { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 8px 0 0; }

/* ---------- Version 0.2: zwei Lernspuren, Spur-Chip, Karten, deutsche Typografie ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
#btn-track { min-height: 34px; padding: 0 12px; font-size: 0.78rem; font-weight: 800; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btn-track:empty { display: none; }

/* Karten mit Vorder- und Rückseite (beide Spuren) */
.flashcard .fc-front, .flashcard .fc-back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; width: 100%; }
.flashcard .fc-back { display: none; }
.flashcard.flipped .fc-front { display: none; }
.flashcard.flipped .fc-back { display: flex; }
.flashcard .fc-say { position: absolute; right: 12px; bottom: 12px; }
.back-info { display: flex; flex-direction: column; gap: 4px; text-align: center; }
/* 0.9.15: Erklärungen auf der Rückseite in Lesegröße statt in Zeichengröße (5rem galt sonst auch für lange chinesische Sätze),
   lange Texte bleiben in der Karte und lassen sich dort scrollen. */
.flashcard .back-info .zh { font-size: 1.1rem; line-height: 1.55; font-weight: 500; }
.back-info { max-width: 100%; overflow-wrap: anywhere; }
.flashcard { overflow-y: auto; overscroll-behavior: contain; }
.flashcard .fc-front, .flashcard .fc-back { justify-content: safe center; min-height: 100%; }
/* 0.9.15 (belohnungen): lange Sätze im Zeig-Modus kleiner, Anreden auf den Personenkarten höchstens drei Zeilen,
   Wendungen und Erklärungen bleiben in ihren Karten. */
.overlay .show-text .zh.long { font-size: clamp(1.7rem, 7.5vw, 2.6rem); line-height: 1.25; }
.overlay .show-text .de-big.long { font-size: clamp(1.4rem, 6vw, 2.1rem); }
.overlay .show-text { max-width: 100%; overflow-wrap: anywhere; }
.person .de { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.slang-card .de-main, .rw-hear .rw-opt-text { min-width: 0; overflow-wrap: anywhere; }
.rw-hear .quiz-opt .rw-opt-text { font-size: 1rem; line-height: 1.4; text-align: left; }

/* Artikel-Chips der · die · das (Spur Deutsch) */
.chip.art { font-weight: 800; min-height: 28px; padding: 0 10px; font-size: 0.8rem; letter-spacing: 0.02em; border-color: transparent; background: var(--surface-2); flex: none; }
/* Artikelfarben aus einer Quelle (--art-*, gleich ArticleColors in der App) */
.chip.art.art-der { color: var(--art-der); background: color-mix(in srgb, var(--art-der) 12%, transparent); }
.chip.art.art-die { color: var(--art-die); background: color-mix(in srgb, var(--art-die) 12%, transparent); }
.chip.art.art-das { color: var(--art-das); background: color-mix(in srgb, var(--art-das) 12%, transparent); }

/* Deutsche Lerninhalte: Manrope statt Serif, kräftig */
.de-main, .de-big, .de-big-inline { font-family: var(--font-ui); font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.de-big { font-size: clamp(1.5rem, 6.5vw, 2.3rem); line-height: 1.2; }
.de-big-inline { font-size: 1.2rem; }
.flashcard .de-big-inline { font-size: clamp(1.6rem, 7vw, 2.4rem); line-height: 1.2; }
.phrase.de-row .de-main { font-size: 1.05rem; }
.phrase .ipa { color: var(--muted); font-size: 0.85rem; grid-column: 1 / -1; font-weight: 400; }
.zh-small { font-size: 1rem; font-weight: 400; }
.tile.de { font-family: var(--font-ui); font-size: 1.05rem; font-weight: 700; }
.pattern.de { font-family: var(--font-ui); font-size: 1.15rem; font-weight: 700; }
.pattern-line { font-weight: 800; color: var(--accent-ink); font-size: 1.05rem; }
.prompt-zh { font-size: 1.2rem; }
.chip.small-chip { min-height: 24px; padding: 0 8px; font-size: 0.72rem; }
.word-card { gap: 4px; }

/* Einstellungen: Vorlesetempo */
input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--accent); margin: 0; }

/* Zeig-Modus für die Spur Deutsch */
.overlay .show-text .de-big { font-size: clamp(1.8rem, 8vw, 3rem); font-weight: 800; line-height: 1.2; }
.overlay .show-text .py.ipa { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.overlay .show-text .trans { font-size: 1.3rem; color: var(--muted); }

[hidden] { display: none !important; }
/* Kopfzeile: Marke bleibt einzeilig, wenn der Spur-Chip Platz braucht */
.brand { flex: 1 1 auto; white-space: nowrap; }
.brand-zh { flex: none; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .brand-name { display: none; } }

/* ---------- Version 0.3: Maskottchen 小墨, Streak, Termine, Sprüche, Spiele, Schreiben, Widgets, Profil ---------- */
:root { --m-happy: #5E9C80; --m-calm: #6FA88C; --m-worried: #C99A3E; --m-angry: #C4553E; --m-furious: #B8432F; --ink: #1A1F1C; --sweat: #6FA8DC; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --m-happy: #8CC4A8; --m-calm: #7DB596; --m-worried: #C9A96A; --m-angry: #D9674F; --m-furious: #E0523A; }
}
:root[data-theme="dark"] { --m-happy: #8CC4A8; --m-calm: #7DB596; --m-worried: #C9A96A; --m-angry: #D9674F; --m-furious: #E0523A; }

/* Der Tintentropfen: Kreis mit Spitze oben, Augen, Brauen, Mund. Farbe und Blick hängen an der Stimmung. */
.mascot { display: block; overflow: visible; flex: none; }
.mascot .face { fill: var(--m-calm); }
.mascot[data-mood="happy"] .face { fill: var(--m-happy); }
.mascot[data-mood="calm"] .face { fill: var(--m-calm); }
.mascot[data-mood="worried"] .face { fill: var(--m-worried); }
.mascot[data-mood="angry"] .face { fill: var(--m-angry); }
.mascot[data-mood="furious"] .face { fill: var(--m-furious); }
.mascot .ink { fill: var(--ink); }
.mascot .ink-stroke { stroke: var(--ink); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mascot .sweat { fill: var(--sweat); }
.mascot-wrap { display: inline-block; line-height: 0; }
.mascot.live { transform-origin: 50% 58%; animation: breathe 2.4s ease-in-out infinite; }
.mascot-wrap.angry { animation: shake 0.7s linear infinite; }
.mascot-wrap.furious { animation: shake 0.45s linear infinite; }
@keyframes breathe { 0%, 100% { transform: scale(0.97); } 50% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2px); } 40% { transform: translateX(2px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { .mascot.live, .mascot-wrap.angry, .mascot-wrap.furious { animation: none; } }
.mascot-btn { border: 0; background: none; padding: 0; line-height: 0; flex: none; border-radius: 50%; }

/* Streak-Karte */
.streak-card .mood-line { font-weight: 700; line-height: 1.3; }
.stages { display: flex; gap: 6px; margin-top: 12px; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 0.7rem; color: var(--muted); font-weight: 700; text-align: center; }
.stage b { font-size: 0.85rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.demo-tag { color: var(--seal); font-weight: 800; }

/* Termine mit Countdown */
.date-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.date-row:first-child { padding-top: 0; }
.date-row:last-child { border-bottom: 0; padding-bottom: 0; }
.days-badge { flex: none; width: 58px; height: 58px; border-radius: 14px; background: var(--seal-soft); color: var(--seal); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 3px; }
.days-badge b { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.days-badge small { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.days-badge.soon { background: var(--seal); color: #fff; }

/* Grundlagen-Zeile auf der Heute-Seite der Spur Deutsch */
.basics-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Sprüche */
.idiom-hero { text-align: center; }
.emoji-big { font-size: 2.6rem; line-height: 1.25; letter-spacing: 0.04em; }
.idiom-hero .de-big { margin-top: 6px; }
.idiom-hero .reveal { text-align: left; margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv b { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; }
.search { width: 100%; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px; }
.search::placeholder { color: var(--muted); }
details.acc.idiom summary { align-items: center; padding: 12px 14px; }
details.acc.idiom .sum { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
details.acc.idiom .sum .em { font-size: 1.15rem; flex: none; min-width: 1.8em; text-align: center; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
details.acc.idiom .sum .t { font-weight: 800; overflow-wrap: anywhere; line-height: 1.25; }
details.acc.idiom .sum .t.done { color: var(--accent-ink); }
.count-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tag-chips .chip { min-height: 30px; font-size: 0.78rem; padding: 0 10px; }

/* Spiele */
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 700; display: flex; align-items: center; gap: 10px; color: var(--fg); overflow-wrap: anywhere; line-height: 1.3; }
.quiz-opt .k { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 0.75rem; font-weight: 800; color: var(--muted); }
.quiz-opt.ok { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.quiz-opt.ok .k { background: var(--accent-strong); color: var(--on-accent); }
.quiz-opt.bad { background: var(--seal-soft); border-color: var(--seal); color: var(--seal); }
.quiz-opt.bad .k { background: var(--seal); color: #fff; }
.quiz-opt.dim { opacity: 0.5; }
.quiz-opt:disabled { cursor: default; }
.gap { display: inline-block; min-width: 2.4em; border-bottom: 2px solid var(--seal); color: var(--seal); text-align: center; line-height: 1; }
.q-text { font-size: 1.1rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.result-num { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; color: var(--accent-ink); line-height: 1; }
.result-num small { font-size: 1rem; color: var(--muted); letter-spacing: 0; font-weight: 700; }
.kind-desc { display: flex; flex-direction: column; gap: 4px; }

/* Schreiben: Rechtschreibung und Grammatik */
.sp-pair { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface-2); }
.sp-wrong { text-decoration: line-through; text-decoration-color: var(--seal); text-decoration-thickness: 2px; color: var(--seal); }
.sp-right { font-weight: 800; color: var(--accent-ink); }
.sp-q { padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.sp-q .fb { min-height: 1.2em; font-size: 0.85rem; font-weight: 700; }
.chip.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.chip.bad { background: var(--seal-soft); color: var(--seal); border-color: var(--seal); }
.rule-text { font-size: 0.95rem; line-height: 1.45; }

/* Widgets in Widget-Optik, fast quadratisch */
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.widget { aspect-ratio: 1 / 0.94; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; min-width: 0; overflow: hidden; }
.widget .w-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.widget .w-days { font-size: 1.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; display: block; }
.widget .w-label { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: block; }
.widget .w-eyebrow { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.widget .w-big { font-size: 1.9rem; line-height: 1.15; letter-spacing: 0.02em; }
.widget .w-big.zh { font-size: 2.8rem; line-height: 1.1; }
.widget .w-mid { font-weight: 800; font-size: 0.86rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.widget .w-line { font-size: 0.78rem; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget .w-foot { font-size: 0.7rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Benachrichtigungs-Vorschau als Toast */
.toast.notice { display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 18px; padding: 12px 16px; max-width: min(92vw, 440px); width: max-content; background: var(--surface); color: var(--fg); border: 1px solid var(--line); font-weight: 500; }
.toast.notice b { font-weight: 800; display: block; }
.toast.notice .notice-face { flex: none; line-height: 0; }
.toast.notice .notice-app { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; }

/* Profil: Optionslisten (Chat-Modell), Teilen-Text, Aufnahme-Studio */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--fg); }
.opt b { font-weight: 800; }
.opt span { color: var(--muted); font-size: 0.85rem; text-align: right; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.opt[aria-pressed="true"] span { color: var(--accent-ink); }
.share-out { width: 100%; min-height: 92px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); padding: 10px 12px; font: inherit; font-size: 0.8rem; line-height: 1.4; resize: vertical; overflow-wrap: anywhere; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--muted); font-weight: 700; text-align: center; }
.step b { font-size: 1.1rem; color: var(--accent-ink); }
.pill-note { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--seal-soft); color: var(--seal); font-size: 0.75rem; font-weight: 800; }

/* ---------- iPhone ---------- */
/* Größere Modelle (Plus, Pro Max, Air: 420 bis 440 pt) bekommen etwas mehr Rand und größere Tab-Beschriftungen. */
@media (min-width: 420px) {
  #view { padding-left: max(20px, var(--sal)); padding-right: max(20px, var(--sar)); }
  .topbar { padding-left: max(20px, var(--sal)); padding-right: max(20px, var(--sar)); }
  .tab { font-size: 0.75rem; }
  .tab svg { width: 26px; height: 26px; }
}
/* Querformat auf dem Handy: wenig Höhe, deshalb flachere Kopf- und Tableiste. */
@media (orientation: landscape) and (max-height: 500px) {
  :root { --nav-h: 52px; }
  .topbar { padding-block: 6px; }
  .tab { min-height: 44px; flex-direction: row; justify-content: center; gap: 6px; }
  .tab svg { width: 22px; height: 22px; }
}
/* Startbildschirm bis die App geladen ist */
.boot { padding: 40px 0; text-align: center; }
/* Knöpfe mit kurzem Text (Datum, 修改, Zurück) nie umbrechen, auch neben langem Text nicht. */
.btn.small { flex: none; white-space: nowrap; }

/* ================================================================================================
   Oberfläche wie in der Android-App 0.8.1 (shell.js): Kopfzeile mit Spurwahl und Zahnrad, vier Reiter mit
   Markierung hinter dem Symbol, Übersichten, Einstellungen in Kategorien, Anmeldebildschirm.
   Farben aus ui/theme/Theme.kt: Seladon dunkel als Hauptfarbe (Kontrast 4,5:1 mit Weiß), Tusche, Porzellan, Siegelrot.
   ================================================================================================ */
:root { --primary: #3F7D62; --on-primary: #FFFFFF; --muted: #56645D; --nav-h: 76px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --primary: #8CC4A8; --on-primary: #0F2B1F; --muted: #9AA8A1; } }
:root[data-theme="dark"] { --primary: #8CC4A8; --on-primary: #0F2B1F; --muted: #9AA8A1; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.tonal { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.nowrap { white-space: nowrap; flex: none; }
.accent-text { color: var(--primary); }
.seal-text { color: var(--seal); }
.eyebrow { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.eyebrow.seal { color: var(--seal); }
.card hr, .set-body hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.card.tonal { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.card { box-shadow: none; }
/* Karten der neuen Oberfläche: Inhalt untereinander mit gleichem Abstand wie AppCard (10 dp) */
.card.c2 { display: flex; flex-direction: column; gap: 10px; }
.chip.static { pointer-events: none; }

/* Kopfzeile: zurück, Name der App, Spurwahl, Zahnrad */
.topbar { border-bottom: 0; background: var(--bg); backdrop-filter: none; gap: 6px; padding-block: 6px; min-height: 60px; }
.topbar .brand { flex: 1; min-width: 0; align-items: center; gap: 8px; }
.topbar .brand-name { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-back { border: 0; background: transparent; width: 44px; height: 44px; margin-left: -10px; flex: none; }
.hdr-back svg { width: 24px; height: 24px; }
.track-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 6px 0 12px; border-radius: 999px; border: 1px solid var(--primary);
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.track-chip .zh { font-size: 1.05rem; }
.iconbtn.gear { width: 48px; height: 48px; border: 0; background: transparent; margin-right: -6px; }
.iconbtn.gear svg { width: 28px; height: 28px; }
.iconbtn.gear[aria-pressed="true"] { color: var(--primary); }
.track-menu { position: absolute; top: calc(100% - 4px); right: max(8px, var(--sar)); z-index: 40; min-width: 270px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.35); }
.track-menu .menu-label { padding: 8px 16px 4px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.track-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-item { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border: 0; background: transparent; text-align: left; min-height: 48px; }
.menu-item b { display: block; font-size: 1rem; }
.menu-item small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.3; }
.menu-item svg { color: var(--primary); flex: none; }
.menu-item:active { background: var(--surface-2); }

/* Reiter unten: Markierung hinter dem Symbol wie die NavigationBar von Material 3 */
.tabs { padding-top: 8px; border-top: 1px solid var(--line); }
.tab { min-height: 56px; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.tab-ind { display: grid; place-items: center; width: 64px; height: 32px; border-radius: 16px; transition: background-color 0.2s ease; }
.tab-ind svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--fg); font-weight: 800; }
.tab[aria-current="page"] .tab-ind { background: var(--accent-soft); color: var(--accent-ink); }
.tab[aria-current="page"] svg { color: var(--accent-ink); }

/* Heute */
.hero-today .greet .hello { color: var(--accent-ink); margin-right: 6px; }
:root[lang="de"] .hero-today .greet .hello { font-family: var(--font-zh); }
.goal-line { gap: 10px; }
.goal-line .progress { flex: 1; }
.goal-label { font-size: 0.85rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.goal-label.reached { color: var(--primary); }
.mascot-row { gap: 14px; align-items: center; }
.mascot-card .streak-dots { margin-top: 12px; }
.plan-card svg { color: var(--muted); flex: none; }
.basics { gap: 6px; align-items: center; }
.challenge-line { gap: 6px; }
.challenge-line .progress { flex: 1; }
.iod { gap: 10px; align-items: center; }
.iod-emoji { font-size: 2.2rem; line-height: 1; }
.de-big-inline { font-size: 1.3rem; }

/* Lernen und Üben: Übersichten */
.hub-head h2 { font-size: 1.35rem; }
.hub-head p { margin-top: 2px; }
.hub { gap: 10px; }
.hub-tile, .set-head { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; color: var(--fg); }
.hub-tile > svg, .set-head > svg { color: var(--muted); flex: none; }
.hub-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.hub-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-text b { font-size: 1.05rem; }
.hub-text span { color: var(--muted); font-size: 0.88rem; line-height: 1.35; }
.set-head .hub-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-tile:active, .set-head:active { background: var(--surface-2); }

/* Wir */
.kpi { gap: 4px; padding: 14px; }
.kpi-v { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.pill-input { flex: 1; min-width: 0; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); padding: 0 16px; background: var(--surface); }

/* Einstellungen */
.set-title { gap: 10px; color: var(--primary); }
.set-title h2 { color: var(--fg); }
.set-group { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.set-group.open { border-color: var(--primary); }
.set-group .set-head { border: 0; border-radius: 0; background: transparent; padding: 12px 14px; }
.set-group .hub-icon { width: 40px; height: 40px; }
.set-body { padding: 0 16px 16px; gap: 10px; }
.set-label { display: block; margin-top: 4px; }
.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.figure { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); text-align: center; }
.figure.on { background: var(--accent-soft); border-color: var(--primary); }
.figure b { font-size: 1.1rem; }
.figure span { font-size: 0.8rem; color: var(--muted); }
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* Maskottchen aus mascot.js: Bewegung je Stimmung wie in Mascot.kt (atmen, hüpfen, schwanken, wackeln, zittern) */
.mascot2 { display: block; overflow: visible; flex: none; }
.mascot2 .mascot-body { transform-box: view-box; transform-origin: 100px 180px; }
.mascot-happy .mascot-body, .mascot-sweet .mascot-body { animation: m-breathe 2.2s ease-in-out infinite; }
.mascot-calm .mascot-body { animation: m-breathe-soft 2.8s ease-in-out infinite; }
.mascot-proud .mascot-body { animation: m-hop 1.5s ease-out infinite; }
.mascot-sleepy .mascot-body { animation: m-sway 3.6s ease-in-out infinite; }
.mascot-surprised .mascot-body { animation: m-jolt 1.1s ease-out infinite; }
.mascot-worried .mascot-body { animation: m-wobble 0.9s ease-in-out infinite; }
.mascot-sad .mascot-body { animation: m-sink 3.2s ease-in-out infinite; }
.mascot-angry .mascot-body { animation: m-shake 1.4s linear infinite; }
.mascot-furious .mascot-body { animation: m-rage 0.8s linear infinite; }
@keyframes m-breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.97); } }
@keyframes m-breathe-soft { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.98); } }
@keyframes m-hop { 0% { transform: translateY(0); } 20% { transform: translateY(-15px); } 40% { transform: translateY(0); } 47% { transform: scaleY(0.96); } 55%, 100% { transform: scaleY(1); } }
@keyframes m-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes m-jolt { 0% { transform: translateY(0); } 12% { transform: translateY(-6px); } 25%, 100% { transform: translateY(0); } }
@keyframes m-wobble { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes m-sink { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(3px) scaleY(0.97); } }
@keyframes m-shake { 0%, 45%, 100% { transform: translateX(0); } 5%, 15%, 25%, 35% { transform: translateX(-2.5px); } 10%, 20%, 30%, 40% { transform: translateX(2.5px); } }
@keyframes m-rage { 0%, 25%, 50%, 75%, 100% { transform: translateX(0); } 12.5%, 62.5% { transform: translateX(-6px); } 37.5%, 87.5% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .mascot2 .mascot-body { animation: none !important; } }

/* Anmeldebildschirm (loader.js): gelernt wird nur mit Konto */
.gate { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px;
  padding: 20px max(16px, var(--sar)) calc(24px + var(--sab)) max(16px, var(--sal)); }
.gate-head { display: flex; align-items: center; gap: 12px; }
.gate-head > div:nth-child(2) { flex: 1; min-width: 0; }
.gate-mascot { flex: none; line-height: 0; }
.gate-zh { font-size: 1.4rem; color: var(--accent-ink); }
.gate h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.gate .chip { flex: none; }
.gate-msg { min-height: 1.3em; font-weight: 600; color: var(--muted); }
.gate-msg.bad { color: var(--bad); }
.gate .btn.ghost { align-self: center; border: 0; color: var(--primary); }
/* Anmeldung mit Google und E-Mail-Code (loader.js) */
.g-google { min-height: 44px; display: flex; justify-content: center; }
.g-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.g-or::before, .g-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.code-input { font-size: 1.6rem !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.g-legacy summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 6px 0; text-align: center; list-style: none; }
.g-legacy summary::-webkit-details-marker { display: none; }
.g-legacy[open] summary { margin-bottom: 8px; }
.gate h2 { font-size: 1.2rem; }
a.btn { text-decoration: none; }
/* Anmeldewege in den Einstellungen */
.way-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.way-row .btn { flex: none; }

/* Familie & Freunde (Reiter Wir) */
.ppl-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.ppl-row .ppl-av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; }
.ppl-row .ppl-av.today { background: var(--seal-soft); color: var(--fg); }
.ppl-text { display: grid; gap: 3px; min-width: 0; }
.ppl-text b { overflow-wrap: anywhere; }
.ppl-text p { margin: 0; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.friend-code { font-size: 1.9rem; font-weight: 800; color: var(--accent-ink); letter-spacing: .04em; }
.row.wrap { flex-wrap: wrap; }
h3.set-label { margin: 14px 0 6px; font-size: .95rem; }
.tally-row { display: grid; gap: 6px; }

/* Neuigkeiten (Reiter Wir) */
.feed { gap: 10px; }
.feed-item { display: grid; gap: 8px; }
.feed-head { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; }
.feed-av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-family: var(--font-zh); }
.feed-actions { display: flex; align-items: center; gap: 14px; }
.feed-like { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); padding: 4px 6px 4px 0; font: inherit; font-weight: 700; cursor: pointer; }
.feed-like.on { color: var(--seal); }
.feed-like svg, .feed-count svg { width: 22px; height: 22px; }
.feed-count { display: inline-flex; align-items: center; gap: 4px; }
.feed-likers { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.feed-likers svg { width: 16px; height: 16px; color: var(--seal); }
.feed-comments { display: grid; gap: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-s); }
.feed-c { overflow-wrap: anywhere; }
.feed-del { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0 4px; cursor: pointer; }
.feed-form { gap: 8px; }
.feed-form input { flex: 1; min-width: 0; }
.tab-ind { position: relative; }
.tab-badge { position: absolute; top: -4px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--seal); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }

/* Profil einer Person (Reiter Wir) */
.ppl-open { cursor: pointer; }
.ppl-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.person-head { display: flex; gap: 14px; align-items: center; margin: 10px 0 14px; }
.person-head h2 { margin: 0 0 6px; }
.person-av { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.person-av.today { background: var(--seal-soft); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grid-4 .kpi-v { font-size: 1.25rem; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto); grid-auto-columns: minmax(0, 1fr); gap: 3px; margin: 10px 0 6px; max-width: 340px; }
.hm-cell { width: 100%; aspect-ratio: 1; border-radius: 5px; border: 0; padding: 0; background: var(--surface-2); }
.hm-lab { display: flex; align-items: center; font-size: .7rem; line-height: 1; padding-right: 2px; }
.hm-pad { visibility: hidden; }
.hm-1 { background: #CFE4D8; } .hm-2 { background: #9CC7B0; } .hm-3 { background: #5E9C80; } .hm-4 { background: #2F6B52; }
.hm-cell.sel { outline: 2px solid var(--fg); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; gap: 4px; }
.hm-legend .hm-cell { width: 12px; height: 12px; aspect-ratio: auto; border-radius: 3px; }
svg.steps { width: 100%; height: auto; display: block; margin-top: 4px; }
svg.steps .axis { stroke: var(--line); stroke-width: 1; }
svg.steps path { fill: var(--accent); }
svg.steps .bar.sel path { fill: var(--accent-ink); }
svg.steps text { font-size: 9px; fill: var(--muted); }
.steps-pick { margin: 4px 0 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-1 { background: #24443A; } :root:not([data-theme="light"]) .hm-2 { background: #3D6D58; } :root:not([data-theme="light"]) .hm-3 { background: #6FA88C; } :root:not([data-theme="light"]) .hm-4 { background: #B4DDC7; } }
:root[data-theme="dark"] .hm-1 { background: #24443A; } :root[data-theme="dark"] .hm-2 { background: #3D6D58; } :root[data-theme="dark"] .hm-3 { background: #6FA88C; } :root[data-theme="dark"] .hm-4 { background: #B4DDC7; }

/* ---------- 0.9.0: Glocke, Mitteilungen, Anstupsen, Benachrichtigungen ---------- */
.iconbtn.bell { position: relative; width: 44px; height: 44px; border: 0; background: transparent; }
.iconbtn.bell svg { width: 24px; height: 24px; }
.iconbtn.bell[aria-pressed="true"] { color: var(--accent-ink); }
.tab-badge.bell-badge { top: 2px; right: 0; }
.note-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--fg); font: inherit; }
.note-item.unread { border-color: var(--accent); background: var(--accent-soft); }
.note-item .ppl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nudge-row { align-items: center; gap: 10px; margin: -4px 0 12px; }
.notify-rows { gap: 0; }
.notify-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notify-row:last-child { border-bottom: 0; }
.notify-row .row { gap: 6px; flex: none; }
.tg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem; font-weight: 700; cursor: pointer; background: var(--surface); }
.tg-chip input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.tg-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.tg-chip.off { opacity: 0.5; cursor: default; }
@media (max-width: 380px) { .notify-row { flex-direction: column; align-items: flex-start; } }

/* ---------- Chat-Training ---------- */
.chat-av { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.5rem; }
.chat-av.big { width: 52px; height: 52px; font-size: 1.8rem; border-radius: 14px; }
.chat-pick.suggested { border-color: var(--accent); box-shadow: var(--shadow); }
.chat-pick .chip { flex: none; }
.chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.chat.sim { margin: 8px 0 12px; }
.sim-b { position: relative; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.sim-b.fresh { animation: sim-in 0.22s ease-out; }
.sim-b.them { padding-right: 46px; }
.sim-b .py { font-size: 0.85rem; color: var(--muted); }
.sim-b .py.tap-py { display: none; }
.sim-b.show-tr .py.tap-py { display: block; }
.sim-b .tr { display: none; font-size: 0.85rem; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
.sim-b.show-tr .tr { display: block; }
.bubble.me.sim-b .tr, .bubble.me.sim-b .py { color: var(--accent-ink); opacity: 0.8; }
.sim-b .say-b { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); }
@keyframes sim-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sim-fb { border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.92rem; line-height: 1.45; }
.sim-fb.ok { background: var(--accent-soft); color: var(--accent-ink); }
.sim-fb.bad { background: var(--seal-soft); color: var(--seal); }
.sim-opts { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.sim-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.sim-opt .zh { font-size: 1.15rem; }
.sim-opt .py { font-size: 0.82rem; color: var(--muted); }
.sim-opt:active { background: var(--surface-2); }
.sim-opt.bad { border-color: var(--seal); background: var(--seal-soft); color: var(--seal); opacity: 0.7; text-decoration: line-through; cursor: default; }

/* ---------- Zuordnen auf Zeit ---------- */
.m-head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 4px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.m-time { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.m-time span { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.1s linear; }
.m-time.hurry span { background: var(--seal); animation: m-pulse 0.8s ease-in-out infinite; }
@keyframes m-pulse { 50% { opacity: 0.55; } }
.m-sec, .m-score { font-size: 1.15rem; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.m-col { display: flex; flex-direction: column; gap: 10px; }
.m-tile { min-height: 64px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; cursor: pointer; transition: transform 0.08s, background 0.15s, opacity 0.25s; touch-action: manipulation; }
.m-tile .zh { font-size: 1.3rem; font-weight: 600; }
.m-tile .py { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.m-tile:active { transform: scale(0.97); }
.m-tile.picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.m-tile.done { opacity: 0; pointer-events: none; transform: scale(0.92); }
.m-tile.bad { border-color: var(--seal); background: var(--seal-soft); color: var(--seal); animation: m-shake 0.35s; }
@keyframes m-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.m-medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.m-medal { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.m-medal span { font-size: 1.8rem; }
.m-medal b { font-size: 1.2rem; }
.m-medal small { color: var(--muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.m-big { font-size: 2.6rem; line-height: 1; }
.ok-text { color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .sim-b, .m-tile.bad, .m-time.hurry span { animation: none; } }

/* ---------- 0.9.3: Satzbaukasten mit Hilfen ---------- */
.tile.in.good { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset; }
.tile.in.bad { border-color: var(--bad); background: var(--seal-soft); color: var(--seal); box-shadow: 0 0 0 2px var(--bad) inset; }
.tile.glow { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 45%, transparent); animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--warn) 20%, transparent); } }
.sb-row { grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; }
.sb-row .btn { padding: 0 6px; font-size: 0.86rem; hyphens: auto; overflow-wrap: anywhere; line-height: 1.15; }
.hintbox { border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; padding: 10px 12px; font-size: 0.92rem; line-height: 1.45; }
.explain h3 { margin: 0; }
.gloss-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gloss { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); min-width: 44px; }
.gloss b { font-size: 1.05rem; } .gloss b.zh { font-size: 1.25rem; font-weight: 600; }
.gloss small { font-size: 0.75rem; color: var(--muted); } .gloss small.py { color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .tile.glow { animation: none; } }

/* ---------- 0.9.3: Einstieg (Pinyin, Zahlen, Bildwörter) ---------- */
.start-ic { font-weight: 800; font-size: 1.2rem; }
.py-sound { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--fg); font: inherit; cursor: pointer; }
.py-big { font-size: 1.4rem; font-weight: 800; color: var(--accent-ink); min-width: 2.6em; }
.py-tip { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.py-ex { font-size: 0.9rem; color: var(--muted); } .py-ex .zh { font-size: 1.1rem; color: var(--fg); } .py-ex .py { color: var(--accent-ink); }
.num-ex { display: grid; grid-template-columns: 4.5em 1fr; gap: 0 12px; align-items: baseline; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--fg); font: inherit; cursor: pointer; }
.num-ex .zh { font-size: 1.2rem; } .num-ex small { grid-column: 2; color: var(--accent-ink); }
.big-zh { font-size: 2rem; font-weight: 600; } .big-zh2 { font-size: 1.4rem; font-weight: 600; } .big-num { font-size: 2.2rem; font-weight: 800; }
.sim-opt.ok, .pic-opt.ok { border-color: var(--ok); background: var(--accent-soft); color: var(--accent-ink); }
.sim-opt.num-opt.bad { text-decoration: none; }
.num-opt b { font-size: 1.3rem; } .num-opt .zh { font-size: 1.3rem; } .num-opt .py { font-size: 0.8rem; color: var(--muted); }
.pic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.pic-group { margin-top: 18px; }
/* Artikelfarben der Spur Deutsch (ab 0.9.4), wie articleColor in der App: der blau, die rot, das grün */
:root { --art-der: #2563c9; --art-die: #c0392b; --art-das: #2b744a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --art-der: #8ab4f8; --art-die: #f28b82; --art-das: #81c995; } }
:root[data-theme="dark"] { --art-der: #8ab4f8; --art-die: #f28b82; --art-das: #81c995; }
.art { font-weight: 800; }
.art-der { color: var(--art-der); } .art-die { color: var(--art-die); } .art-das { color: var(--art-das); }
.art-word { font-weight: 700; font-size: 1.05rem; }
.art-word.pic-zh { font-size: 1.2rem; }
.art-word.big-de { font-size: 1.6rem; } .art-word.big-de2 { font-size: 1.25rem; }
.art-big { font-size: 1.5rem; }
.art-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; text-align: center; }
.art-noun { font-size: 1.9rem; font-weight: 800; }
.art-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.art-btn { height: 68px; border: 0; border-radius: 18px; font: inherit; font-size: 1.45rem; font-weight: 800; color: var(--bg); cursor: pointer; }
.art-bg-der { background: var(--art-der); } .art-bg-die { background: var(--art-die); } .art-bg-das { background: var(--art-das); }
.art-btn:active { transform: scale(0.97); }
.card.art-last, .art-last { display: flex; flex-direction: row; gap: 14px; align-items: center; text-align: left; }
.art-last.bad { border: 1.5px solid var(--bad); }
.art-mark { font-size: 1.5rem; color: var(--ok); } .art-last.bad .art-mark { color: var(--bad); }
.art-miss { gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.de-num-word { font-size: 1.4rem; font-weight: 800; margin: 6px 0; word-break: break-word; }
.start-ic.art-der { color: var(--art-der); font-size: 1rem; }
.pic-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pic-actions .btn { width: 100%; }
.m-topics .chip { margin: 0; }
@media (min-width: 560px) { .pic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pic-topic, .pic-word { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; text-align: center; }
.pic-topic .progress { width: 80%; }
.pic-word.secure { border: 2px solid var(--accent); }
.pic-word.open { grid-column: span 2; }
.pic-big { font-size: 2.4rem; line-height: 1.1; }
.pic-zh { font-size: 1.45rem; font-weight: 600; }
.pic-word .py, .pic-opt .py { font-size: 0.85rem; color: var(--accent-ink); }
.pic-de { font-size: 0.9rem; color: var(--muted); }
.pic-ex { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); } .pic-ex .zh { font-size: 1.05rem; }
.pic-huge { font-size: 4.5rem; line-height: 1.1; text-align: center; }
.pic-mid { font-size: 2.2rem; line-height: 1.1; }
.pic-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pic-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 92px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.pic-opt.bad { border-color: var(--seal); background: var(--seal-soft); color: var(--seal); }
.pic-opt small { font-size: 0.82rem; }

/* Aufgaben, Prüfen und Aufnahme-Studio (ab 0.9.6) */
.rv-item { border-left: 4px solid var(--line); }
.rv-item.ok { border-left-color: var(--ok); }
.rv-item.fix { border-left-color: var(--bad); }
.rv-main { font-size: 1.35rem; font-weight: 700; }
.rv-state { font-size: 1.2rem; font-weight: 800; }
.rv-item.ok .rv-state { color: var(--ok); } .rv-item.fix .rv-state { color: var(--bad); }
.rv-q { margin: 4px 0 0; font-weight: 600; }
.rv-extra { font-size: 0.92rem; }
.rv-opt { margin-top: 2px; } .rv-opt.ok { color: var(--ok); }
.rv-btns { gap: 8px; flex-wrap: wrap; }
.rv-note, .card textarea, .card input[type="text"] { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.card.st-row, .st-row { display: flex; flex-direction: row; gap: 10px; align-items: center; text-align: left; }
.st-row.has { border-left: 4px solid var(--ok); }
.st-row.rec { border: 2px solid var(--bad); }
.st-zh { font-size: 1.3rem; } .st-de { font-weight: 700; }
.st-btns { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.st-btns .btn { white-space: nowrap; }
.btn.danger { background: var(--bad); color: var(--bg); border-color: var(--bad); }
.bad-text { color: var(--bad); }

/* ---------- 0.9.10: QR-Karten im Profil (Aufbau wie „Mein QR-Code“ in WeChat) ---------- */
.card.qr-card { display: grid; gap: 14px; padding: 18px 18px 16px; }
.qr-head { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.qr-head svg { width: 26px; height: 26px; color: #E0A526; flex: none; }
.qr-who { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.qr-who .ppl-av { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.qr-who-t { display: grid; min-width: 0; }
.qr-who-t b { font-size: 1.15rem; overflow-wrap: anywhere; }
.qr-who-t span { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.qr-box { justify-self: center; width: min(100%, 290px); background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 0 0 1px var(--line); }
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-cap { margin: 0; color: var(--muted); font-size: .92rem; text-align: center; }
.qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 0.9.12: Stufen der Spiele ---------- */
.sb-meta { gap: 8px; }
.sb-meta .chip { white-space: nowrap; }
.stufe-card .row.wrap { gap: 8px; }
.stufe-card .chip { min-width: 44px; justify-content: center; }

/* ---------- 0.9.13: Tipps für den Start, Über ---------- */
.tip-wave { font-size: 1.8rem; flex: none; }
.card.tip-card { min-height: 260px; display: grid; gap: 10px; align-content: start; }
.tip-icon { font-size: 2.4rem; }
.tip-title { margin: 0; font-size: 1.25rem; }
.tip-text { margin: 0; white-space: pre-line; line-height: 1.55; }
.tip-dots { display: flex; justify-content: center; gap: 10px; padding: 6px 0; }
.tip-dot { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.tip-dot.on { background: var(--accent); }
.row .grow { flex: 1 1 0; }
.about-libs { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- 0.9.14: Nutzungsvereinbarung ---------- */
.license-text { white-space: pre-wrap; font: inherit; font-size: .85rem; line-height: 1.45; max-height: 360px; overflow: auto; margin: 0;
  padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink, inherit); }
.about-libs a { color: var(--accent); font-weight: 600; }

/* ===================== Ab 0.9.15: Heute, Themenwelten, Suche, Onboarding, Lernplan (home.js) ===================== */
/* Tippflächen mindestens 44 px (P15); sichtbar dürfen Chips, kleine Knöpfe und Unterreiter kleiner bleiben. */
.chip, .btn.small, .subtabs button { position: relative; }
.chip::after, .btn.small::after, .subtabs button::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; min-height: 100%; transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.grow { flex: 1; min-width: 0; }
.home-head { display: flex; flex-direction: column; gap: 4px; }
.streak-pill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 48px; padding: 2px 14px 2px 4px; margin-top: 6px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--fg); font-weight: 700; font-size: 0.92rem; text-align: left; }
.streak-pill svg { flex: none; }
.hint-strip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-radius: 14px; background: var(--seal-soft); color: var(--fg); text-align: left; font-size: 0.92rem; }
.hint-strip .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-strip[aria-expanded="true"] .grow { white-space: normal; }
.plan-steps { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 10px; }
.plan-step { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--fg); text-align: left; font-size: 0.98rem; }
.plan-step .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--accent-strong); display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; color: var(--on-accent); }
.plan-step.done .tick { background: var(--accent-strong); }
.plan-step.done > span:last-child { color: var(--muted); }
.ctx { display: flex; flex-direction: column; gap: 6px; }
.ctx-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ctx-track::-webkit-scrollbar { display: none; }
.ctx-item { flex: 0 0 100%; scroll-snap-align: start; background: var(--seal-soft); border-color: transparent; display: flex; flex-direction: column; gap: 8px; }
.ctx-head { gap: 10px; align-items: center; }
.ctx-icon { font-size: 1.6rem; line-height: 1; }
.ctx-item p { margin: 0; }
.ctx-word, .ctx-say { gap: 8px; align-items: center; flex-wrap: wrap; }
.ctx-dots { display: flex; justify-content: center; gap: 6px; }
.ctx-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.ctx-dots span.on { width: 8px; height: 8px; background: var(--accent-strong); }
.friends-strip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-2); font-size: 0.92rem; }
.wod { gap: 8px; align-items: center; }
.wod .art-word { flex: 1; }
.wod-zh .zh { font-size: 1.2rem; }
.more-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); text-align: left; }
.switch-row { gap: 12px; align-items: center; }
.switch-row input { width: 44px; height: 26px; accent-color: var(--accent-strong); flex: none; }
.home-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.home-sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.sheet { position: relative; width: min(560px, 100%); max-height: 88vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 16px 16px calc(16px + var(--sab)); display: flex; flex-direction: column; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-align: left; font-size: 1rem; }
.search-bar { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.search-bar input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none; }
.search-row { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 6px 4px 6px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.search-row .grow { display: flex; flex-direction: column; gap: 2px; }
.lvl-badge { display: inline-flex; align-items: center; padding: 0 8px; min-height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; font-weight: 800; }
.world-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.world-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 132px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--fg); text-align: left; }
.world-tile .progress { width: 100%; }
.world-icon { font-size: 1.6rem; line-height: 1; flex: none; }
.resume-row, .nav-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--fg); text-align: left; }
.resume-row { border: 0; background: transparent; padding: 6px 0; }
.resume-row .grow, .nav-row .grow { display: flex; flex-direction: column; gap: 4px; }
.nav-row > svg, .resume-row > svg { color: var(--muted); flex: none; }
.level-chips { align-items: center; }
.level-chips > .small { white-space: nowrap; flex: none; }
.tool-chips .chip { flex: none; }
.world-head h2 { display: flex; gap: 8px; align-items: center; }
.world-head .btn { margin-top: 10px; }
.world-body h3 { margin: 10px 0 0; }
.acc-card summary { cursor: pointer; font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.acc-card[open] summary { margin-bottom: 8px; }
.pic-row { gap: 10px; align-items: center; }
.onb-head { align-items: center; }
.onb-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); text-align: left; font-size: 1rem; }
.onb-opt .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.onb-opt[aria-checked="true"] { border: 2px solid var(--accent-strong); background: var(--accent-soft); }
.onb-opt[aria-checked="true"] .dot { border-color: var(--accent-strong); background: radial-gradient(circle, var(--accent-strong) 45%, transparent 50%); }
.onb-word { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 14px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--fg); text-align: left; }
.onb-word .grow { display: flex; flex-direction: column; gap: 2px; }
.onb-done { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding-top: 24px; }
.ok-text { color: var(--ok); font-weight: 700; } .bad-text { color: var(--bad); font-weight: 700; }
.world-switch { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.world-switch input { width: 22px; height: 22px; accent-color: var(--accent-strong); flex: none; }
.plan-btn { align-self: flex-start; }
.sheet > * { flex-shrink: 0; }
.world-switch .grow { display: flex; flex-direction: column; gap: 2px; }
.search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.hidden-worlds summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--muted); }
.hidden-worlds .stack { margin-top: 8px; }
/* ---------- 0.9.15: Üben geordnet (P5) und Grammatik-Spiele (drills.js) ---------- */
.hub-action { background: var(--accent-soft); border-color: transparent; }
.hub-action .hub-icon { background: var(--surface); }
.hub-sec { font-size: 1rem; margin: 14px 0 8px; }
.hub-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.hub-row .game-tile { flex: 0 0 156px; scroll-snap-align: start; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--fg); text-align: left; min-height: 112px; }
.game-tile:active { background: var(--surface-2); }
.game-tile b { font-size: 0.98rem; line-height: 1.25; }
.game-tile span:last-child { color: var(--muted); font-size: 0.82rem; line-height: 1.3; }
.game-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); font-size: 1.35rem; }
.dr-card { min-height: 120px; }
.dr-prompt { font-size: 1.35rem; line-height: 1.35; }
.dr-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-opt { flex: 1 1 96px; min-height: 56px; padding: 10px 14px; border-radius: 16px; border: 1.5px solid var(--accent); background: var(--surface); color: var(--fg); font-size: 1.15rem; font-weight: 800; }
.dr-opt.art-der { border-color: var(--art-der); color: var(--art-der); } .dr-opt.art-die { border-color: var(--art-die); color: var(--art-die); } .dr-opt.art-das { border-color: var(--art-das); color: var(--art-das); }
.dr-opt.bad, .dr-opt:disabled.bad { background: var(--seal-soft); border-color: var(--bad); opacity: 0.7; }
.dr-opt:active { background: var(--accent-soft); }
.dr-input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); font-size: max(16px, 1.1rem); }
.dr-built, .card.c2.dr-built { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; min-height: 52px; align-items: center; background: var(--surface-2); }
.dr-bank { gap: 8px; }
.dr-end { font-size: 1.2rem; }
.dr-sent, .card.c2.dr-sent { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; line-height: 1.6; }
.dr-word { font-size: 1.15rem; }
.dr-word.verb { font-weight: 800; color: var(--accent-ink); }
.dr-gap { min-width: 26px; min-height: 34px; border-radius: 8px; border: 1px dashed var(--line); background: var(--surface-2); color: var(--muted); padding: 0 4px; }
.dr-gap.live { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.dr-split { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; }
.dr-letter { min-width: 26px; min-height: 40px; border-radius: 8px; border: none; background: var(--surface-2); color: var(--fg); font-size: 1.25rem; font-weight: 800; padding: 0 4px; }
.dr-cut { color: var(--seal); font-size: 1.5rem; }
.dr-scaffold { font-size: 1.25rem; letter-spacing: 0.04em; color: var(--muted); }
.dr-explain.ok { border: 1.5px solid var(--ok); }
.dr-q { font-size: 1.2rem; line-height: 1.4; }
.dr-sq { text-align: left; justify-content: flex-start; }
