/* Schrift Manrope (SIL Open Font License, public/fonts/OFL.txt) – lokal, damit nichts von Google geladen wird */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/*
 * Farbwelten (v1.9): data-theme an <html> = nacht | tag | messing | messinghell.
 * Gesetzt von index.php (vor dem Start, kein Aufblitzen) und app.js (Einstellung „Darstellung“, „auto“ folgt dem System:
 * dunkel = Nacht, hell = Tag). Ohne Attribut gilt Nacht bzw. Tag nach Systemeinstellung.
 */
:root, :root[data-theme="nacht"] {
  --bg: #14101f; --bg-2: #1b1530; --surface: #221b36; --surface-2: #2e2549; --border: #3a3058;
  --text: #f2eefb; --muted: #b3a9cf; --accent: #f5c542; --accent-ink: #241500; --primary: #8b5cf6; --primary-ink: #fff;
  --good: #34c77b; --good-ink: #062b16; --bad: #ef5a6f; --warn: #f0a33a; --info: #5aa9ef;
  --red-suit: #e0475b; --black-suit: #1b1b22; --card-bg: #fffdf7;
  --tab: #1b1530; --sheet: #1d1731; --scrim: rgba(8, 5, 18, .64); --credit-bg: #2c2410; --credit-ink: #f5c542;
  --bar-xp: linear-gradient(90deg, #f5c542, #34c77b); --bar-min: linear-gradient(90deg, #8b5cf6, #5aa9ef);
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
:root[data-theme="tag"] {
  --bg: #f6f3fc; --bg-2: #efeaf9; --surface: #ffffff; --surface-2: #efe8fb; --border: #ddd3f0;
  --text: #1f1733; --muted: #5e5378; --accent: #9a5c07; --accent-ink: #fff; --primary: #6d3fe0; --primary-ink: #fff;
  --good: #1f7a4a; --good-ink: #fff; --bad: #c0334a; --warn: #a85d00; --info: #2a6fb5;
  --red-suit: #c8324a; --black-suit: #1b1b22; --card-bg: #fffdf7;
  --tab: #ffffff; --sheet: #ffffff; --scrim: rgba(31, 23, 51, .42); --credit-bg: #fbf1e1; --credit-ink: #6b3f00;
  --bar-xp: linear-gradient(90deg, #d99a1e, #2f9e63); --bar-min: linear-gradient(90deg, #6d3fe0, #3d8ad6);
  --shadow: 0 6px 20px rgba(60, 30, 120, .12);
  color-scheme: light;
}
:root[data-theme="messing"] {
  --bg: #141110; --bg-2: #1a1613; --surface: #1f1a17; --surface-2: #2c2520; --border: #3a312a;
  --text: #f3ece1; --muted: #b9ac9a; --accent: #d9a648; --accent-ink: #1d1408; --primary: #a8323f; --primary-ink: #fff;
  --good: #7cb88a; --good-ink: #10200f; --bad: #e0606d; --warn: #e0a040; --info: #79a8d8;
  --red-suit: #c8394b; --black-suit: #1b1b22; --card-bg: #fffdf7;
  --tab: #1a1613; --sheet: #1c1714; --scrim: rgba(10, 8, 6, .66); --credit-bg: #2b2214; --credit-ink: #e2b45e;
  --bar-xp: linear-gradient(90deg, #d9a648, #7cb88a); --bar-min: linear-gradient(90deg, #a8323f, #d9a648);
  --shadow: 0 6px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
:root[data-theme="messinghell"] {
  --bg: #f6f1e9; --bg-2: #efe7da; --surface: #fffdf9; --surface-2: #eee4d4; --border: #e0d3bf;
  --text: #201a15; --muted: #67594a; --accent: #8a5c12; --accent-ink: #fff; --primary: #8e2433; --primary-ink: #fff;
  --good: #2f6b3b; --good-ink: #fff; --bad: #b3263a; --warn: #9a5a00; --info: #2f5f8f;
  --red-suit: #a3283c; --black-suit: #1b1b22; --card-bg: #fffdf7;
  --tab: #fffdf9; --sheet: #fffdf9; --scrim: rgba(32, 26, 21, .42); --credit-bg: #f6ead3; --credit-ink: #5e3d06;
  --bar-xp: linear-gradient(90deg, #c08a2a, #3d8a4d); --bar-min: linear-gradient(90deg, #8e2433, #c08a2a);
  --shadow: 0 6px 20px rgba(70, 40, 10, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f6f3fc; --bg-2: #efeaf9; --surface: #ffffff; --surface-2: #efe8fb; --border: #ddd3f0;
    --text: #1f1733; --muted: #5e5378; --accent: #9a5c07; --accent-ink: #fff; --primary: #6d3fe0; --primary-ink: #fff;
    --good: #1f7a4a; --good-ink: #fff; --bad: #c0334a; --warn: #a85d00; --info: #2a6fb5;
    --tab: #ffffff; --sheet: #ffffff; --scrim: rgba(31, 23, 51, .42); --credit-bg: #fbf1e1; --credit-ink: #6b3f00;
    --bar-xp: linear-gradient(90deg, #d99a1e, #2f9e63); --bar-min: linear-gradient(90deg, #6d3fe0, #3d8ad6);
    color-scheme: light;
  }
}
:root { --radius: 14px; --tabbar-h: 68px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button { font: inherit; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; }
input[type="range"] { padding: 0; accent-color: var(--primary); }
input[type="checkbox"] { width: auto; accent-color: var(--primary); }

.page { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 0 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.topbar h1 { flex: 1; min-width: 0; font-size: 1.2rem; line-height: 1.2; font-weight: 800; margin: 0; overflow-wrap: anywhere; hyphens: auto; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.brand-dot { color: var(--accent); font-size: 1.4rem; width: 40px; text-align: center; }
main { display: flex; flex-direction: column; gap: 14px; }

.hero {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.hero h2 { margin: 0; font-size: 1.35rem; line-height: 1.3; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; }
.hero-stats { display: flex; gap: 24px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; line-height: 1; }
.hero-stats span { color: var(--muted); font-size: .85rem; }

.section-title { margin: 12px 0 0; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.section-title.red { color: var(--red-suit); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: transform .1s;
}
.tile:not(:disabled):active { transform: scale(.98); }
.tile:disabled { opacity: .5; cursor: default; }
.tile-icon { font-size: 1.6rem; width: 40px; text-align: center; }
.tile-text { flex: 1; display: flex; flex-direction: column; }
.tile-text small { color: var(--muted); }

.btn {
  border: 1px solid var(--border); background: var(--surface); padding: 10px 16px; border-radius: 12px; cursor: pointer;
  font-weight: 600;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.good { background: var(--good); border-color: var(--good); color: var(--good-ink); }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.link { background: none; border: none; color: var(--accent); padding: 6px 0; font-weight: 500; }
.btn.wide { width: 100%; }
.btn.big { padding: 16px; font-size: 1.05rem; }
.hero .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hero .btn.secondary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row select { width: auto; }
.grow { flex: 1; }
.center { text-align: center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.field .row { gap: 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }

.hint { color: var(--muted); margin: 0; }
.small, .hint.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.ok-text { color: var(--good); margin: 0; }
.warn-text { color: var(--warn); margin: 0; }
.ok-text p, .warn-text p { margin: 2px 0; }
.counter { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; }
.toast { background: var(--surface-2); border: 1px solid var(--border); padding: 10px 14px; border-radius: 12px; }

.badge { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge-ok { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.badge-warn { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.badge-bad { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.badge-info { background: color-mix(in srgb, var(--info) 20%, transparent); color: var(--info); }

.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.step-n {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--surface-2); border: 2px solid var(--primary);
}
.steps li.done .step-n { background: var(--good); border-color: var(--good); color: #062b16; }
.step-text { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.step-text small { color: var(--muted); }
.chev { color: var(--muted); font-size: 1.4rem; }

/* Spielkarten */
.pcard {
  position: relative; background: var(--card-bg); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  border: 1px solid #d9d2c3; display: inline-grid; place-items: center; flex: none; font-family: Georgia, "Times New Roman", serif;
}
.pcard.red { color: var(--red-suit); }
.pcard.black { color: var(--black-suit); }
.pcard-sm { width: 38px; height: 54px; border-radius: 6px; }
.pcard-md { width: 70px; height: 100px; }
.pcard-lg { width: 110px; height: 156px; border-radius: 14px; }
.pcard-corner { position: absolute; top: 4px; left: 6px; font-size: .8rem; line-height: 1; text-align: center; font-weight: 700; }
.pcard-sm .pcard-corner { display: none; }
.pcard-center { font-size: 2.2rem; line-height: 1; }
.pcard-lg .pcard-center { font-size: 3.6rem; }
.pcard-sm .pcard-center { font-size: 1rem; position: absolute; bottom: 4px; }
.pcard-corner.flip { top: auto; left: auto; bottom: 4px; right: 6px; transform: rotate(180deg); }
.pcard-lg .pcard-corner { font-size: 1.05rem; top: 6px; left: 8px; }
.pcard-lg .pcard-corner.flip { top: auto; left: auto; bottom: 6px; right: 8px; }
.pcard-value { display: none; }
.pcard-sm .pcard-value { display: block; position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-size: .95rem; font-weight: 700; }
.pcard-back { background: repeating-linear-gradient(45deg, #5b2d91, #5b2d91 6px, #44206f 6px, #44206f 12px); }
.card-inline { font-weight: 700; white-space: nowrap; }
.card-inline.red, td.red, .red { color: var(--red-suit); }

/* Eingabe */
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker-suits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.suit-btn {
  display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; font-size: 1.8rem; line-height: 1.1;
  background: var(--card-bg); border: 2px solid transparent; border-radius: 12px; cursor: pointer;
}
.suit-btn small { font-size: .7rem; color: #555; font-family: system-ui; }
.suit-btn.red { color: var(--red-suit); }
.suit-btn.black { color: var(--black-suit); }
.suit-btn.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.picker-values { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.value-btn { min-height: 54px; font-size: 1.35rem !important; }
.suit-btn { min-height: 64px; }
.value-btn, .numpad-grid button {
  padding: 12px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 700;
  font-size: 1.1rem; cursor: pointer;
}
.value-btn.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.numpad { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin: 0 auto; width: 100%; }
.numpad-display { text-align: center; font-size: 2rem; font-weight: 800; min-height: 2.6rem; letter-spacing: .1em; }
.numpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad-grid button { padding: 14px 0; font-size: 1.3rem; }
.numpad-grid button.ok { background: var(--primary); border-color: var(--primary); color: #fff; }
button:disabled { cursor: default; }

/* Fragen / Lernen */
.question, .intro { display: flex; flex-direction: column; gap: 14px; }
.q { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.q p { margin: 0; font-size: 1.05rem; }
.q h2, .intro h2 { margin: 0; font-size: 1.8rem; }
.sub { color: var(--muted); margin: 0; }
.big-num { font-size: 3.6rem; font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.intro.center { align-items: center; }
.intro.center p { margin: 0; }
.instruction { background: color-mix(in srgb, var(--primary) 15%, transparent); border-left: 3px solid var(--primary); padding: 10px 12px; border-radius: 8px; text-align: left; }
.code-line { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.link-visual { display: flex; align-items: center; justify-content: center; gap: 16px; }
.link-part { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.link-plus { font-size: 1.6rem; color: var(--muted); }
.link-visual.small .big-num { font-size: 2.2rem; }
.station { margin: 0; padding: 8px 12px; background: var(--surface); border-radius: 10px; border: 1px dashed var(--border); }
.scene { font-style: italic; margin: 0; }
.hints { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hint-line { margin: 0; padding: 8px 12px; background: var(--surface); border-radius: 10px; width: 100%; }
.reveal { display: flex; flex-direction: column; gap: 12px; }
.reveal h2 { margin: 0; }
.feedback { border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--border); }
.feedback h3 { margin: 0; font-size: 1.1rem; line-height: 1.25; }
/* „Weiter“ gleich neben der Rückmeldung – immer sichtbar, auch wenn die Lösung darunter lang ist */
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-head .btn { flex: none; min-width: 110px; min-height: 48px; }
/* Abfrage (Karteikasten, Sofort-Test, Üben): ohne Tab-Leiste, nach der Antwort kompakte Frage */
body:has(.question) .tabbar, body:has(.question) .teacher-fab { display: none; }
body:has(.question) { padding-bottom: env(safe-area-inset-bottom); }
.question.answered .q { padding: 0; gap: 4px; }
.question.answered .q > p:not(.sub) { display: none; }
.question.answered .q h2 { font-size: 1.35rem; }
.question.answered .big-num { font-size: 2.4rem; }
.question.answered .pcard-lg { width: 70px; height: 100px; border-radius: 10px; }
.question.answered .pcard-lg .pcard-center { font-size: 2.2rem; }
.question.answered .pcard-lg .pcard-corner { font-size: .8rem; top: 4px; left: 6px; }
.question.answered .pcard-lg .pcard-corner.flip { top: auto; left: auto; bottom: 4px; right: 6px; }
.question.answered .reveal h2 { font-size: 1.4rem; }
.question.answered .reveal p, .feedback .solution p { margin: 0; }
.question .reveal .center p { margin: 4px 0 0; }
.feedback p { margin: 0; }
.feedback.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.feedback.slow, .feedback.hinted { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.feedback.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.solution { display: flex; flex-direction: column; gap: 8px; }
.flash-ok { animation: flashok .25s; }
.flash-bad { animation: flashbad .25s; }
@keyframes flashok { from { background: color-mix(in srgb, var(--good) 30%, transparent); } }
@keyframes flashbad { from { background: color-mix(in srgb, var(--bad) 30%, transparent); } }
.seq-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.seq-setup { display: flex; flex-direction: column; gap: 10px; }
.seq-setup h3 { margin: 6px 0 0; font-size: 1rem; }
/* Sequenz kompakt: Karte, Felder und Kartenwahl passen am Handy ohne Scrollen */
.seq-drill { gap: 10px; }
.seq-drill .q { padding: 0; gap: 6px; }
.seq-drill .big-num { font-size: 2.6rem; }
.seq-drill .q p { font-size: .95rem; }
.seq-slot { width: 44px; height: 60px; border-radius: 8px; border: 1px dashed var(--border); display: grid; place-items: center; color: var(--muted); }
.seq-slot.ok { border: 2px solid var(--good); }
.seq-slot.bad { border: 2px solid var(--bad); }

.done-box { display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 12px 0; }
.done-box h2, .done-box h3 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 1.6rem; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat.good strong { color: var(--good); }
.stat.bad strong { color: var(--bad); }

/* Listen */
.lex-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lex-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.lex-key { min-width: 38px; text-align: center; }
.num { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.lex-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lex-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.scene-preview { font-style: italic; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.lex-code { font-family: ui-monospace, Menlo, monospace; color: var(--muted); font-size: .85rem; }
.editor, .scene-editor, .card-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.editor, .scene-editor { margin-top: 6px; background: var(--surface-2); }
.card-box h3 { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: .9rem; }
.chip:disabled { opacity: .45; text-decoration: line-through; }
.suggestions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.suggestion {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.suggestion small { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; }
.ai-box { display: flex; flex-direction: column; gap: 8px; }
.palace-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.stations { margin: 0; padding-left: 22px; color: var(--muted); font-size: .9rem; }
.stations .more { list-style: none; margin-left: -22px; }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }

.boxbar { display: flex; flex-direction: column; gap: 6px; }
.boxbar-track { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.boxbar-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .75rem; color: var(--muted); }
.legend::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: currentColor; }
.box-1 { --c: #ef5a6f; } .box-2 { --c: #f0833a; } .box-3 { --c: #f0c03a; } .box-4 { --c: #b6d84a; }
.box-5 { --c: #5cc77b; } .box-6 { --c: #3fb3a8; } .box-7 { --c: #5a8def; }
.boxbar-seg { background: var(--c); }
.legend.box-1::before, .legend.box-2::before, .legend.box-3::before, .legend.box-4::before,
.legend.box-5::before, .legend.box-6::before, .legend.box-7::before { background: var(--c); }
.daychart { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding: 8px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
.daycol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.daybar { width: 100%; background: linear-gradient(var(--accent), var(--primary)); border-radius: 4px 4px 0 0; min-height: 2px; }
.daycol small { font-size: .65rem; color: var(--muted); }

/* Methode */
.prose { line-height: 1.6; }
.prose h2 { font-size: 1.2rem; margin: 24px 0 8px; color: var(--accent); }
.prose h3 { font-size: 1rem; margin: 16px 0 6px; }
.prose .lead { font-size: 1.05rem; }
.prose ul { padding-left: 20px; }
.examples { columns: 2; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td small { color: var(--muted); }

/* Handy: Kartenwerte in Reihen à 5 (A–5, 6–10, J Q K mittig) – große Tippflächen statt 7 schmaler Knöpfe */
@media (max-width: 600px) {
  .picker-values { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .picker-values .value-btn { flex: 0 0 calc((100% - 4 * 8px) / 5); min-height: 60px; font-size: 1.5rem !important; }
  .suit-btn { min-height: 76px; font-size: 2.1rem; }
}
@media (max-width: 420px) {
  .big-num { font-size: 3rem; }
  .prose table { font-size: .8rem; }
}

/* PoC: Sync-Anzeige */
.boot { text-align: center; color: #b3a9cf; padding-top: 30vh; font-family: system-ui, sans-serif; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.sync-dot.sync-ok { background: var(--good); }
.sync-dot.sync-off { background: var(--bad); }
.sync-dot.sync-busy { background: var(--warn); }
.sync-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.4rem; letter-spacing: .12em; text-align: center; margin: 0; padding: 10px; background: var(--surface-2); border-radius: 10px; user-select: all; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .9em; }

/* Sprache */
.mic-wrap { display: inline-flex; flex-direction: column; gap: 2px; }
.btn.mic.rec { border-color: var(--bad); color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.recorder { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rec-time { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rec-time small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.rec-time.over { color: var(--bad); }

/* Präsentationscoach */
.coach-hero { background: linear-gradient(135deg, #5b2340, #2b1a4a); }
.hero-list { margin: 0; padding-left: 18px; color: #e5dcf7; font-size: .92rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tab { flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.script-text { line-height: 1.75; font-size: 1.05rem; }
.script-text p { margin: 0 0 10px; }
.mark { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin: 0 2px; vertical-align: 1px; line-height: 1.5; }
.mark.pause { background: color-mix(in srgb, var(--info) 22%, transparent); color: var(--info); }
.mark.pause.long { background: color-mix(in srgb, var(--info) 38%, transparent); }
.mark.audience { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.mark.action { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.emph { color: var(--accent); }
.legend-line { line-height: 1.9; }
.changes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.diff { display: flex; flex-direction: column; gap: 2px; }
.diff del { color: var(--bad); }
.diff ins { color: var(--good); text-decoration: none; }
.regie li { padding: 4px 0; }
.cue { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; }
.cue small { color: var(--muted); }
.outline li { padding: 6px 0; font-size: 1.05rem; }
.outline .hidden-line { color: var(--muted); }
.quote { font-style: italic; color: var(--muted); }
.alternatives { padding-left: 18px; }
.alternatives li { margin: 6px 0; }
details summary { cursor: pointer; color: var(--muted); }

/* Admin */
.voice-row { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.voice-pick li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.voice-pick audio { height: 32px; max-width: 220px; }

/* Shows */
.big-tabs .tab { flex: 1; padding: 10px 12px; font-size: 1rem; }
.icon-btn.small { width: 32px; height: 32px; font-size: 1rem; border-radius: 9px; }
.icon-btn:disabled { opacity: .35; }
.show-total { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.show-total strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.show-total.tone-ok strong { color: var(--good); }
.show-total.tone-warn strong { color: var(--warn); }
.show-total.tone-bad strong { color: var(--bad); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tl-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.tl-item.block { background: var(--surface-2); border-style: dashed; }
.tl-item.missing { border-color: var(--bad); }
.tl-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.tl-time { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; min-width: 44px; }
.tl-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tl-title small { color: var(--muted); }
.tl-actions { display: flex; gap: 4px; }
.tl-details { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.tl-transition { padding: 6px 12px 8px 66px; border-top: 1px dashed var(--border); cursor: pointer; }
.tl-transition small { color: var(--muted); font-style: italic; }
.muted { color: var(--muted); }
.run-clock { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.run-clock > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; }
.run-clock strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.run-clock small { color: var(--muted); font-size: .75rem; }
.run-clock .over strong { color: var(--bad); }
.run-title { margin: 0; }
.sheet td { vertical-align: top; }
.packlist li { padding: 4px 0; }

@media print {
  body { background: #fff !important; color: #000; }
  .topbar, .no-print, .btn, .mic-wrap { display: none !important; }
  .page { max-width: none; padding: 0; }
  .print-sheet, .print-sheet small, .print-sheet td, .print-sheet th { color: #000; }
  .sheet th, .sheet td { border-bottom: 1px solid #999; }
}

/* Konten & Guthaben */
.credit-badge { flex: none; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 800; font-size: .85rem; text-decoration: none; white-space: nowrap; }
.credit-big { font-size: 2.2rem; font-weight: 900; color: var(--accent); margin: 0; }
.landing { padding-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.landing form { gap: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.user-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.user-detail input.narrow { width: 90px; flex: none; }
.user-detail .row input { flex: 1; min-width: 140px; }

/* ---------- Präsentationscoach v0.7 ---------- */
.combo { position: relative; display: flex; }
.combo input { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.combo-toggle { width: 44px; border: 1px solid var(--border); border-left: 0; background: var(--surface-2); color: var(--text);
  border-radius: 0 10px 10px 0; font-size: 1rem; cursor: pointer; }
.combo-toggle:disabled { opacity: .5; }
.combo-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto;
  list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.combo-list button { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; color: var(--text); border-radius: 8px; font: inherit; cursor: pointer; }
.combo-list button:hover, .combo-list button.active { background: var(--surface-2); }
.multi-combo { display: flex; flex-direction: column; gap: 8px; }
.chip-static { cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.chip-x { border: 0; background: none; color: var(--muted); font-size: 1.05rem; cursor: pointer; padding: 0 2px; line-height: 1; }

.markup-editor { display: flex; flex-direction: column; gap: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; }
.tb { min-width: 38px; height: 36px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 8px; cursor: pointer; font: inherit; font-size: .95rem; }
.tb-bold { font-weight: 800; }
.tb-italic { font-style: italic; }
.tb-underline { text-decoration: underline; }

.mark.look { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary); }
.mark.effect { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); }
.mark.warn { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.script-h { margin: 14px 0 6px; color: var(--accent); }

.facts .fact { display: flex; flex-direction: column; gap: 2px; }
.facts .fact > span, .facts summary { font-size: .8rem; color: var(--muted); font-weight: 600; }
.facts .fact p { margin: 0; white-space: pre-line; }
.facts .assumptions ul { margin: 2px 0; padding-left: 18px; }

.change { border-left: 3px solid var(--border); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.change.ja { border-color: var(--good); }
.change.nein { border-color: var(--bad); opacity: .7; }
.improve textarea, .clarify textarea { width: 100%; }
.regie-edit { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }

.beat.playing { outline: 2px solid var(--primary); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 4px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.trend-col small { font-size: .7rem; color: var(--muted); }
.trend-bar { width: 100%; max-width: 28px; min-height: 4px; background: linear-gradient(180deg, var(--primary), var(--info)); border-radius: 6px 6px 2px 2px; }
.mini-progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.mini-progress > div { height: 100%; background: var(--good); }
.card-box > .row.between > .btn.link { white-space: nowrap; }
.reaction-row input { width: 100%; }
.narrow-field { flex-direction: row; align-items: center; gap: 6px; }
.narrow-field input { width: 70px; }

/* ---------- Virtuelle Zuschauer & Repertoire (v0.8) ---------- */
.card-box.inner { background: var(--surface-2); box-shadow: none; }
.grow { flex: 1; min-width: 0; }
.bubbles { display: flex; flex-direction: column; gap: 6px; }
.bubble { align-self: flex-start; max-width: 90%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface-2);
  border: 1px solid var(--border); animation: pop .25s ease-out; }
.bubble.sound { font-style: italic; color: var(--muted); }
.bubble.big { font-size: 1.1rem; margin: 6px 0; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.rec-hint { color: var(--bad); }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.step-edit { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); }
.step-edit .grow { display: flex; flex-direction: column; gap: 4px; }
.step-no { font-weight: 700; color: var(--muted); padding-top: 10px; min-width: 18px; }
.step-tools { display: flex; flex-direction: column; gap: 2px; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.checklist .check { font-size: 1rem; }

/* ---------- Kartentechnik (v0.9) ---------- */
.tech-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tech-chip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tech-chip small { margin-left: auto; color: var(--muted); font-size: .75rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex: none; vertical-align: middle; }
.dot.status-lernen { background: var(--warn); }
.dot.status-ueben { background: var(--info); }
.dot.status-sicher { background: var(--good); }
.rep-counter { text-align: center; padding: 10px 0; }
.rep-counter strong { font-size: 2.6rem; }
.rating-buttons { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Zauberschule (v1.0) ---------- */
.goal-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.goal-bar > div { height: 100%; background: var(--bar-xp); transition: width .4s; }
.goal-bar.minutes > div { background: var(--bar-min); }
.path { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.path-node { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; padding: 4px; }
.path-node.right { margin-left: 34px; }
.path-node .node { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none;
  background: var(--surface-2); border: 3px solid var(--border); }
.path-node.open .node { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 25%, var(--surface)); }
.path-node.done .node { border-color: var(--good); background: var(--good); color: #062b16; }
.path-node.current .node { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); animation: pulse 1.8s infinite; }
.path-node.locked { opacity: .55; cursor: not-allowed; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--accent) 15%, transparent); } }
.partner-link { align-self: flex-start; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.badge-tile { font: inherit; color: inherit; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); opacity: .4; filter: grayscale(1); text-align: center; }
.badge-tile span { font-size: 1.6rem; }
.badge-tile small { hyphens: manual; overflow-wrap: break-word; line-height: 1.2; }
.badge-tile.earned { opacity: 1; filter: none; border: 1px solid var(--accent); }
.badge-earned { font-size: 1.05rem; }
.exercise { display: flex; flex-direction: column; gap: 12px; padding-bottom: 150px; }
.ex-title { margin: 4px 0; font-size: 1.25rem; line-height: 1.35; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option { text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; }
.option.selected { border-color: var(--info); background: color-mix(in srgb, var(--info) 18%, var(--surface)); }
.option:disabled { cursor: default; }
.order-answer { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
/* Zuordnen: eine Tabelle mit zwei Spalten, alle Zeilen gleich hoch (grid-auto-rows: 1fr) */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; margin-bottom: 12px; }
.match-grid .option { font-size: .9rem; padding: 10px; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; }
.match-grid .option.picking { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 45%, transparent); }
.pair-0 { --pc: #5aa9ef; } .pair-1 { --pc: #34c77b; } .pair-2 { --pc: #f0a33a; }
.pair-3 { --pc: #c084fc; } .pair-4 { --pc: #ef5a6f; } .pair-5 { --pc: #e0b326; }
.option[class*="pair-"] { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, var(--surface)); }
.speak-line { margin: 0; padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 8px; font-size: 1.1rem; }
.feedback-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 6px;
  max-width: 640px; margin: 0 auto; border-radius: 16px 16px 0 0; z-index: 30; }
.feedback-bar.ok { background: color-mix(in srgb, var(--good) 28%, var(--bg)); }
.feedback-bar.bad { background: color-mix(in srgb, var(--bad) 28%, var(--bg)); }
.feedback-bar p { margin: 0; }
.option.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 20%, var(--surface)); }
.option.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 18%, var(--surface)); }

/* ---------- Videos (v1.1) ---------- */
.yt { display: flex; flex-direction: column; gap: 6px; }
.yt-frame { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-placeholder { background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); border: 1px solid var(--border); }
.yt-ph-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; }
.yt-ph-title { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-note { color: var(--muted); font-size: .72rem; max-width: 34ch; }
.yt-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; }
.yt-meta small { color: var(--muted); }
.lesson-video { display: flex; flex-direction: column; gap: 6px; }
.label-small { color: var(--muted); font-weight: 600; }
.node-sm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem;
  background: var(--surface-2); border: 2px solid var(--border); }
.node-sm.done { background: var(--good); border-color: var(--good); color: #062b16; }
.video-list .lex-main strong { font-size: .95rem; line-height: 1.3; }
.chip-active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 20%, var(--surface)); }
/* Platzhalter wächst mit dem Inhalt (auf schmalen Handys reicht 16:9 nicht für Titel + Hinweis) */
.yt-frame.yt-placeholder { aspect-ratio: auto; min-height: 190px; }
.yt-placeholder .yt-ph-inner { position: static; min-height: 190px; }

/* ---------- Video-Notizen: Ablauf zum Abhaken (v1.2) ---------- */
.video-notes p { margin: 0; }
.steps-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.check-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.check-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.check-step .step-text { flex: 1 1 200px; min-width: 0; }
.check-step.ok .step-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--good); }
.check-step.ueben .step-text { color: var(--warn); }
.step-buttons { display: flex; gap: 4px; }
.step-btn { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; }
.step-btn.ok.on { background: var(--good); border-color: var(--good); color: #062b16; }
.step-btn.ueben.on { background: var(--warn); border-color: var(--warn); color: #2b1a00; }
.tips { margin: 0; padding-left: 18px; }
.btn.left { text-align: left; }

/* Adminbereich: Video-Notizen */
.admin-video-list { max-height: 360px; overflow-y: auto; margin: 8px 0; }
.admin-video-list .lex-row.active { outline: 2px solid var(--accent); }
.admin-video-edit { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; display: grid; gap: 8px; }
.admin-video-edit h4 { margin: 0; }
.note-edit { display: grid; gap: 6px; }

/* Adminbereich: Tabs und Download-Symbol je Video */
.admin-tabs { position: sticky; top: calc(env(safe-area-inset-top) + 56px); z-index: 5; background: var(--bg); padding: 6px 0; margin: 0 0 4px; }
.admin-save { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.admin-video-item { display: flex; align-items: center; gap: 6px; }
.admin-video-item .lex-row { flex: 1; min-width: 0; }
.fetch-icon { flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 1.05rem; }
button.fetch-icon { cursor: pointer; }
button.fetch-icon:hover { border-color: var(--accent); }
.fetch-icon.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); font-weight: 700; }
.fetch-icon.failed { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }

/* Zauberschule: Stufen, Kurse, Grundlagen, weitere Videos (v1.4) */
.stufe { margin: 18px 0 6px; }
.stufe-title { margin: 0 0 2px; font-size: 1.15rem; }
.kurs-list .lex-main small { display: block; }
.legacy-playlists > summary { cursor: pointer; padding: 4px 0; }
.legacy-playlists[open] > summary { margin-bottom: 8px; }
.legacy-playlists .card-box { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; }
.foundations { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; }
.foundations-label { flex-basis: 100%; color: var(--muted); }
.foundations .chip-link { border-radius: 10px; padding: 5px 10px; max-width: 100%; line-height: 1.3; }
.foundations .chip-link small { color: var(--muted); }
.foundations .chip-link.more { cursor: pointer; color: var(--accent); font: inherit; }
.chip-link { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: inherit; }
.chip-link.done { border-color: var(--good, #2e7d32); }
.plus-video { margin-top: 8px; }
.plus-video > summary { cursor: pointer; font-size: .9rem; padding: 4px 0; }
.lex-row.static { cursor: default; }
.lex-list.sub { margin: 0 0 6px 28px; }
.path-node.locked { opacity: .55; cursor: pointer; }
.part-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 6px; }
.part-row > a { grid-column: 1 / -1; }
@media (max-width: 520px) { .part-row { grid-template-columns: 1fr 1fr; } .part-row > span { grid-column: 1 / -1; } }

/* Kein „Scroll Anchoring“: nachgeladene Inhalte über dem Video sollen die Seite nicht nach unten schieben */
html, body { overflow-anchor: none; }
.area-buttons { margin-top: 8px; }
/* „Für später merken“ und „In meine Tricks“ nebeneinander, je halbe Breite */
.lesson-tools { display: flex; gap: 8px; margin: 6px 0 8px; }
.lesson-tools > * { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
.later-btn { white-space: normal; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.minutes-goal { margin: 8px 0 4px; }
.minutes-goal small { color: inherit; }
.goal-bar.thin { height: 6px; }
.freeze-badge { white-space: nowrap; }
.freeze-box { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.badge-mine { font-size: .75rem; color: var(--accent); font-weight: 600; }

/* Suche (v1.6) */
.search-page { display: grid; gap: 4px; }
.search-filters .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }
.search-filters .chip svg { color: var(--accent); flex: none; }
.search-filters .chip.on svg { color: inherit; }
.search-filters .chip small { opacity: .75; font-variant-numeric: tabular-nums; }
.sheet .btn.primary.wide { display: flex; align-items: center; justify-content: center; gap: 8px; }
.search-results .lex-main { min-width: 0; }
.search-snippet { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.search-area { color: var(--accent); opacity: .85; display: grid; place-items: center; flex: none; }
.search-results mark, .search-snippet mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Mein Profil (#/profil) */
.hero-stats.clickable { cursor: pointer; }
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
.profile-head h2 { margin: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); flex: none; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat-card .stat-icon { grid-row: span 2; font-size: 1.6rem; }
.stat-card strong { font-size: 1.25rem; line-height: 1.1; }
.stat-card small { color: var(--muted, inherit); opacity: .8; }
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; margin: 8px 0; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.week-day.today small:last-child { font-weight: 700; }
.week-bar { width: 100%; max-width: 28px; height: 90px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.week-bar div { width: 100%; background: var(--accent); border-radius: 8px 8px 0 0; }
.week-day.goal .week-bar div { background: var(--good); }
.week-xp { min-height: 1.1em; font-size: .75rem; }
.week-mark { font-size: .9rem; }
.area-stats li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.area-stats li:last-child { border-bottom: 0; }
.area-stats b { text-align: right; }
.badge-list { display: flex; flex-direction: column; gap: 6px; }
.badge-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); opacity: .55; }
.badge-row.earned { opacity: 1; border: 1px solid var(--accent); }
.badge-row .badge-icon { font-size: 1.6rem; }
.badge-row small { display: block; opacity: .8; }

/* Abzeichen-Stufen und Pop-up */
.badge-icon-wrap { position: relative; font-size: 1.6rem; }
.badge-icon-wrap .badge-medal { position: absolute; right: -14px; bottom: -6px; font-size: .95rem; font-style: normal; }
.badge-tile.tier-silber { border-color: #c9d1dc; }
.badge-tile.tier-gold, .badge-row.tier-gold { border-color: #f5c542; box-shadow: 0 0 0 1px #f5c54255; }
.badge-tile.tier-diamant, .badge-row.tier-diamant { border-color: #7fd8ff; box-shadow: 0 0 10px #7fd8ff66; }
.badge-tile.tier-bronze, .badge-row.tier-bronze { border-color: #c98b4e; }
.tier-chip { font-size: .8rem; padding: 1px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.next-tier { margin-top: 4px; }
.badge-row .goal-bar { margin-top: 4px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.modal { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.badge-modal { animation: pop .35s ease-out; }
.badge-modal.tier-gold { border-color: #f5c542; } .badge-modal.tier-diamant { border-color: #7fd8ff; } .badge-modal.tier-bronze { border-color: #c98b4e; } .badge-modal.tier-silber { border-color: #c9d1dc; }
.badge-modal h2 { margin: 0; }
.badge-hero { position: relative; font-size: 4rem; line-height: 1; margin: 6px 0; }
.badge-hero .badge-medal { position: absolute; right: -22px; bottom: -6px; font-size: 1.8rem; }
.badge-tier { font-weight: 700; margin: 0; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Einstieg (#/start) */
.journey { display: flex; flex-direction: column; gap: 12px; }
.journey h2 { margin: 4px 0 0; }
.journey-dots { display: flex; gap: 6px; justify-content: center; }
.journey-dots span { width: 28px; height: 6px; border-radius: 3px; background: var(--surface-2); }
.journey-dots span.on { background: var(--accent); }
.choice-list, .choice-grid { display: grid; gap: 8px; }
.choice-grid { grid-template-columns: repeat(2, 1fr); }
.choice { font: inherit; color: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; }
.choice small { opacity: .8; }
.choice.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.choice-icon { font-size: 1.5rem; }
.plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-item { font: inherit; color: inherit; width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.plan-item.first { border: 2px solid var(--accent); }
.btn.grow { flex: 1; }
.journey-card { border: 2px solid var(--accent); }

/* Fußzeile (alle Seiten) und Rechtstexte */
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; padding: 14px 16px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.app-footer-links { display: flex; gap: 16px; }
.legal-text { line-height: 1.6; }
.legal-text h2 { font-size: 1.05rem; margin: 20px 0 6px; }
.legal-text p, .legal-text ul { margin: 0 0 10px; }

/* ---------- v1.9: Kopfzeile, Tab-Leiste, Menüs von unten, Farbwahl ---------- */
.brand-home { display: grid; place-items: center; width: 44px; height: 40px; flex: none; }
.logo { display: block; overflow: visible; }
.avatar-btn { position: relative; flex: none; width: 48px; height: 48px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center;
  font-weight: 800; font-size: 1rem; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.avatar.big { width: 52px; height: 52px; font-size: 1.3rem; flex: none; }
.avatar-btn .credit-badge { position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .68rem; font-weight: 800; line-height: 16px; }
.avatar-btn .sync-dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; box-shadow: 0 0 0 2px var(--bg); }
.with-icon { display: inline-flex; align-items: center; gap: 4px; }
.hero-stats strong.with-icon svg { color: var(--accent); }
.memdeck-icon { color: var(--accent); font-size: 2rem; line-height: 1; font-weight: 400;
  font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", system-ui, sans-serif; font-variant-emoji: text; }
.tile-icon { color: var(--accent); display: grid; place-items: center; }
.tile .tile-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-2); font-size: 1.6rem; flex: none; }
.btn.secondary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
body:has(.feedback-bar) { padding-bottom: 0; }
body:has(.feedback-bar) .tabbar { display: none; }
.admin-save { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--tab); border-top: 1px solid var(--border); padding: 4px max(4px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); }
.tab-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 54px; justify-content: center; border: 0; background: none;
  color: var(--muted); font-size: .75rem; font-weight: 600; cursor: pointer; }
.tab-btn.on { color: var(--accent); font-weight: 800; }
.sheet-scrim { position: fixed; inset: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 28; background: var(--scrim); }
.sheet { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 29; max-width: 720px; margin: 0 auto;
  max-height: calc(100dvh - var(--tabbar-h) - 40px); overflow-y: auto; box-sizing: border-box; background: var(--sheet); color: var(--text);
  border: 1px solid var(--border); border-bottom: 0; border-radius: 24px 24px 0 0; padding: 8px 18px 16px;
  display: flex; flex-direction: column; gap: 10px; animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(30px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.sheet-head { display: flex; align-items: center; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.25rem; font-weight: 800; }
.sheet-close { width: 44px; height: 44px; border: 0; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sheet-cta { text-align: left; background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 800; padding: 14px; }
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li + li { border-top: 1px solid var(--border); }
.sheet-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 2px; border: 0; background: none; color: var(--text);
  font-size: 1rem; text-align: left; cursor: pointer; }
.sheet-list b { flex: 1; }
.sheet-list small { color: var(--muted); font-weight: 600; }
.sheet-icon { width: 30px; display: grid; place-items: center; color: var(--accent); }
.sheet-icon .memdeck-icon { font-size: 1.6rem; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--accent); color: var(--muted); }
.search-field input { border: 0; background: transparent; padding: 13px 0; outline: none; width: 100%; font-size: 1.05rem; color: var(--text); }
.sheet-person { display: flex; align-items: center; gap: 14px; border: 0; background: none; color: var(--text); text-align: left; padding: 4px 0; cursor: pointer; }
.sheet-person b { display: block; font-size: 1.1rem; }
.sheet-person small { color: var(--muted); }
.sheet-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.sheet-stats div { padding: 10px 4px; border-radius: 12px; background: var(--surface-2); }
.sheet-stats b { display: block; font-size: 1.2rem; }
.sheet-stats small { color: var(--muted); font-size: .75rem; }
.sheet-credits { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--credit-bg); color: var(--credit-ink); font-size: .95rem; }
.sheet-credits span { display: inline-flex; align-items: center; gap: 6px; }
.sheet-label { margin: 4px 0 0; font-weight: 800; font-size: .9rem; }
.sheet-foot { display: flex; align-items: center; gap: 16px; padding-top: 6px; font-size: .85rem; }
.sheet-foot .btn.link { margin-left: auto; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-opt { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer; font-size: .9rem; }
.theme-opt.on { border-color: var(--accent); }
.theme-opt b { display: block; line-height: 1.2; }
.theme-opt small { color: var(--muted); font-size: .75rem; }
.theme-swatch { display: flex; flex: none; }
.theme-swatch i { width: 14px; height: 28px; display: block; }
.theme-swatch i:first-child { border-radius: 6px 0 0 6px; } .theme-swatch i:last-child { border-radius: 0 6px 6px 0; }

/* ---------- Landingpage (v1.9): Standard Samt & Messing hell, Farbwahl oben ---------- */
.lp { font-size: 17px; line-height: 1.6; padding-bottom: 8px; }
.lp-wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.lp-nav-in { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.lp-brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.lp-brand b { font-weight: 800; white-space: nowrap; }
.lp-themes { display: flex; gap: 6px; }
.lp-theme-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); font-weight: 700; }
.lp-theme { display: flex; width: 30px; height: 30px; padding: 0; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); cursor: pointer; background: none; }
.lp-theme i { flex: 1; height: 100%; display: block; }
.lp-theme.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.lp-btn { display: inline-block; padding: 15px 22px; border-radius: 14px; font-weight: 800; font-size: 1rem; cursor: pointer; border: 1px solid var(--border); background: none; color: var(--text); text-decoration: none; }
.lp-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lp-btn.small { padding: 9px 14px; font-weight: 700; white-space: nowrap; }
.lp-hero { padding-top: 44px; padding-bottom: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: center; }
.lp-hero-text { display: flex; flex-direction: column; gap: 18px; }
.lp-hero h1 { margin: 0; font-weight: 800; font-size: clamp(40px, 9vw, 70px); line-height: 1.04; letter-spacing: -.025em; }
.lp-eyebrow { margin: 0; color: var(--accent); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: .8rem; }
.lp-soft { color: color-mix(in srgb, var(--text) 78%, var(--bg)); margin: 0; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Kartenfächer: --fan (0…1) folgt der Scroll-Position; die rechte Karte liegt oben (DOM-Reihenfolge) */
.lp-fan { --fan: 0; position: relative; height: 300px; }
.lp-card { position: absolute; top: 30px; left: calc(50% - 75px); width: 150px; height: 212px; border-radius: 14px; background: var(--card-bg); color: #1b1b22;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .3); border: 1px solid rgba(0, 0, 0, .08); font-weight: 800; transform-origin: 50% 120%; will-change: transform; }
.lp-card.red { color: var(--red-suit); }
.lp-card .corner { position: absolute; top: 10px; left: 12px; font-size: 20px; line-height: 1.05; }
.lp-card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 60px; }
.lp-card.l { transform: rotate(calc(-9deg - 11deg * var(--fan))) translate(calc(-62px - 14px * var(--fan)), calc(10px * var(--fan))); }
.lp-card.m { top: 10px; transform: translateY(calc(-22px * var(--fan))); }
.lp-card.r { transform: rotate(calc(9deg + 11deg * var(--fan))) translate(calc(62px + 14px * var(--fan)), calc(10px * var(--fan))); }
.lp-sec { padding-top: 40px; padding-bottom: 40px; }
.lp-sec h2 { margin: 0 0 20px; font-weight: 800; font-size: clamp(28px, 6vw, 42px); line-height: 1.12; letter-spacing: -.02em; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lp-steps li { border-top: 2px solid var(--accent); padding-top: 14px; }
.lp-steps span { font-size: .9rem; font-weight: 800; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.lp-steps h3 { margin: 6px 0; font-size: 1.3rem; font-weight: 800; }
/* Gestapelte Bereichskarten: ALLE gleich hoch, damit sie exakt aufeinanderliegen; langer Abstand = lange Standzeit */
.lp-stack { display: flex; flex-direction: column; gap: 50vh; padding-bottom: 30vh; }
.lp-stack-card { position: sticky; top: calc(84px + var(--i) * 12px); height: 300px; overflow: hidden; box-sizing: border-box; padding: 26px;
  border-radius: 22px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) calc(100% - var(--i) * 6%), var(--accent));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
.lp-stack-card h3 { margin: 6px 0 8px; font-size: 1.65rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.lp-label { margin: 0; color: var(--accent); font-weight: 800; }
@media (min-width: 700px) { .lp-stack-card { height: 240px; } }
.lp-dran { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; align-items: center; }
.lp-dran h2 { margin-bottom: 12px; }
.lp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.lp-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lp-nums b { display: block; font-size: 1.75rem; line-height: 1.1; }
.lp-nums span, .lp-row span { font-size: .9rem; color: var(--muted); }
.lp-row { display: flex; justify-content: space-between; }
.lp-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.lp-bar.thin { height: 8px; }
/* --p (0…1) setzt useLandingMotion beim Scrollen: füllt sich nach unten, leert sich nach oben */
.lp-bar .fill { --p: 0; height: 100%; border-radius: 5px; transform-origin: left; transform: scaleX(var(--p)); transition: transform .12s linear; }
.lp-bar .fill.xp { background: var(--bar-xp); } .lp-bar .fill.min { background: var(--bar-min); }
.lp-badges { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.lp-badges span { padding: 6px 12px; border-radius: 999px; font-size: .88rem; font-weight: 600; border: 1px solid; }
.lp-badges .bronze { border-color: #c98b4e; } .lp-badges .silber { border-color: #a7b1bf; } .lp-badges .gold { border-color: var(--accent); }
.lp-not { border: 1px dashed var(--border); border-radius: 22px; padding: 26px; }
.lp-not h2 { font-size: clamp(24px, 5vw, 32px); margin-bottom: 14px; }
.lp-not ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.lp-login { display: flex; flex-direction: column; gap: 16px; }
.lp-cta { background: var(--accent); color: var(--accent-ink); border-radius: 26px; padding: 28px 24px; }
.lp-cta h2 { margin: 0 0 10px; }
.lp-cta p { margin: 0; }
.lp-form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; width: 100%; }
.lp .rv { opacity: .25; transform: translateY(28px); transition: opacity .7s ease-out, transform .7s ease-out; }
.lp .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lp .rv, .lp-bar .fill { opacity: 1; transform: none; transition: none; }
  .lp-card { transition: none; }
  .lp-fan { --fan: 0 !important; }
}
body:has(.lp) { padding-bottom: 0; }

/* Einführung je Bereich */
.module-intro { border: 2px solid var(--accent); }
.module-intro h3 { margin: 0; }
.module-intro ol { margin: 4px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.module-intro .btn { align-self: flex-start; }

/* Grafiken/Bilder in Erklärkarten (modules/course/figures.js) */
.lesson-fig { margin: 0 0 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.lesson-fig svg, .lesson-fig img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.lesson-fig svg text { font-family: inherit; }
.lesson-fig figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; text-align: center; }

/* Zauberlehrer-Chat (modules/course/Teacher.js): schwebender Knopf über der Tab-Leiste, Fenster von unten */
.teacher-fab { position: fixed; right: max(16px, calc(50vw - 360px + 16px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 27;
  display: flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; box-shadow: 0 6px 20px rgba(0, 0, 0, .28); }
.teacher-fab span { font-size: 1.4rem; line-height: 1; }
body:has(.feedback-bar) .teacher-fab { display: none; }
body:has(.teacher-fab) main { padding-bottom: 72px; }
.teacher-scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
.teacher-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-width: 720px; margin: 0 auto; box-sizing: border-box;
  height: min(88dvh, 760px); display: flex; flex-direction: column; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--sheet); color: var(--text); border: 1px solid var(--border); border-bottom: 0; border-radius: 24px 24px 0 0; animation: sheet-up .22s ease-out; }
.teacher-panel .sheet-head { gap: 8px; }
.teacher-ctx { display: flex; gap: 6px; flex-wrap: wrap; }
.teacher-ctx .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teacher-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.teacher-msg { max-width: 88%; padding: 9px 12px; border-radius: 16px; line-height: 1.45; }
.teacher-msg p { margin: 0; white-space: pre-wrap; }
.teacher-msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.teacher-msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.teacher-msg.busy { opacity: .7; font-style: italic; }
.teacher-ex { margin-top: 6px !important; padding-top: 6px; border-top: 1px solid var(--border); }
.teacher-input { display: flex; flex-direction: column; gap: 6px; }
.teacher-input textarea { resize: none; }
.teacher-threads { overflow-y: auto; flex: 1; }
.teacher-open { margin-top: 8px; }

/* Videomarken: „Zum Trick“/Kapitel unter dem Video, Admin-Knöpfe über dem Video (sichtbar beim Darüberfahren) */
.yt-marks { display: flex; flex-wrap: wrap; gap: 6px; }
.yt-marks .chip { font-size: .85rem; }
.yt-marks .yt-jump { border-color: var(--accent); font-weight: 700; }
.yt-admin { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px;
  max-width: 70%; opacity: .25; transition: opacity .15s; }
.yt-frame:hover .yt-admin, .yt-admin:focus-within { opacity: 1; }
@media (hover: none) { .yt-admin { opacity: .9; } }
.yt-admin button { border: 0; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer;
  background: rgba(0, 0, 0, .7); color: #fff; }
.yt-admin small { background: rgba(0, 0, 0, .6); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: .7rem; }
.yt-admin .yt-admin-msg { flex-basis: 100%; text-align: right; background: rgba(0, 0, 0, .8); }
/* Admin: Transkript mit markiertem relevanten Bereich */
.tr-view { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; font-size: .85rem; background: var(--surface); }
.tr-line { display: flex; gap: 8px; align-items: baseline; padding: 3px 6px; border-radius: 6px; margin: 0; }
.tr-line time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; min-width: 3.4em; }
.tr-line span:nth-child(2) { flex: 1; }
.tr-line.in, .tr-in { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.tr-line.out { opacity: .45; }
.tr-set { display: none; gap: 4px; flex: none; }
.tr-line:hover .tr-set, .tr-line:focus-within .tr-set { display: inline-flex; }
@media (hover: none) { .tr-set { display: inline-flex; } }
.tr-set button { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; font-size: .72rem; padding: 1px 6px; cursor: pointer; }

/* Adminbereich Video-Notizen am großen Monitor: Liste links, Transkript & Notizen rechts (mobil unverändert) */
.av-cols, .av-left, .av-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.av-pick { display: none; }
@media (min-width: 1100px) {
  .page:has(.admin-videos) { max-width: min(1500px, 96vw); }
  .av-cols { display: grid; grid-template-columns: minmax(340px, 34%) 1fr; gap: 20px; align-items: start; }
  .av-left { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
  .av-left .admin-video-list { max-height: none; }
  .av-right { min-width: 0; }
  .av-pick { display: block; margin-top: 40px; text-align: center; }
  .admin-videos .tr-view { max-height: 60vh; }
}
.tr-line.est time { color: var(--accent); font-style: italic; }
.tr-est-note { border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.tr-est-note .btn { margin-left: 4px; }

/* Bild zum Aufdecken (figures.js RevealFigure): normale Fassung, darüber die hervorgehobene – Tippen, Maus, einmal beim Hineinscrollen */
.lesson-fig.reveal { padding: 0; overflow: hidden; }
.reveal-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.reveal-btn img { display: block; width: 100%; height: auto; max-height: none; }
.reveal-hi { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.reveal.on .reveal-hi { opacity: 1; animation: reveal-glow 2.4s ease-in-out infinite; }
.reveal.peek .reveal-hi { opacity: 1; }
@media (hover: hover) { .reveal-btn:hover .reveal-hi { opacity: 1; } }
@keyframes reveal-glow { 50% { opacity: .72; } }
.lesson-fig.reveal figcaption { margin: 0; padding: 10px 14px; text-align: left; color: var(--text); font-size: .9rem; border-top: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .reveal-hi { transition: none; } .reveal.on .reveal-hi { animation: none; } }
