/* Mathix – ruhiges, klares Design für Jugendliche (12–16). Keine externen Schriften (Datenschutz). */
:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #eef2f7; --line: #d8dee8; --text: #1b2330; --muted: #5a6577;
  --brand: #1d4e89; --brand-2: #2f6fb8; --focus: #f2a900;
  --as1: #1e7d45; --as2: #1f5fbf; --as3: #7340b8;
  --as1-bg: #e3f4ea; --as2-bg: #e3edfb; --as3-bg: #efe7fa;
  --st-grey: #7d8594; --st-red: #c0392b; --st-orange: #c46a00; --st-green: #1e7d45;
  --good: #1e7d45; --good-bg: #e6f5ec; --bad: #b3261e; --bad-bg: #fcebe9; --warn: #8a5a00; --warn-bg: #fff4dc;
  /* Mathematische Farbsprache */
  --c-a: #1f5fbf; --c-b: #c25a00; --c-p: #1e7d45; --c-q: #7340b8;
  --c-prop: #1e7d45; --c-inv: #1f5fbf; --c-lin: #c0392b;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12161d; --surface: #1a2029; --surface-2: #232b36; --line: #333d4b; --text: #e7ebf2; --muted: #a3adbd;
  --brand: #7fb0ec; --brand-2: #9cc3f2;
  --as1: #5fcf8b; --as2: #7fb0ff; --as3: #c39bf5; --as1-bg: #173225; --as2-bg: #172a46; --as3-bg: #2b1f40;
  --st-grey: #98a1b0; --st-red: #ff8a7d; --st-orange: #ffb35c; --st-green: #5fcf8b;
  --good: #5fcf8b; --good-bg: #163323; --bad: #ff8a7d; --bad-bg: #3a1d1a; --warn: #ffcf70; --warn-bg: #3a2e12;
  --c-a: #7fb0ff; --c-b: #ffab5c; --c-p: #5fcf8b; --c-q: #c39bf5; --c-prop: #5fcf8b; --c-inv: #7fb0ff; --c-lin: #ff8a7d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; }
p { margin: .4em 0 .8em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: .5rem; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .strong { font-weight: 700; }
.good { color: var(--good); font-weight: 600; } .bad { color: var(--bad); font-weight: 600; }

/* Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .8rem; padding: .55rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; display: flex; gap: .4rem; align-items: center; white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 8px; background: var(--brand); color: #fff; font-size: 1.1rem; }
[data-theme="dark"] .brand-mark { color: #12161d; }
.search { flex: 1; max-width: 460px; }
.search input { width: 100%; padding: .5rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
.top-links { display: flex; gap: 1rem; } .top-links a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.top-links a:hover { color: var(--brand-2); }
.btn.menu-btn { display: none; }

/* Layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 110px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 1rem .7rem; position: sticky; top: 56px; height: calc(100vh - 56px); overflow: auto; }
main { padding: 1.4rem clamp(1rem, 3vw, 2.4rem) 3rem; max-width: 1100px; width: 100%; min-width: 0; }
main:focus { outline: none; }
.footer { padding: 1rem 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: .6rem; flex-wrap: wrap; }

/* Seitennavigation */
.nav-year > summary { font-weight: 700; padding: .45rem .5rem; border-radius: 8px; cursor: pointer; list-style: none; }
.nav-year > summary::-webkit-details-marker { display: none; }
.nav-year > summary::before { content: '▸'; display: inline-block; width: 1rem; transition: transform .15s; }
.nav-year[open] > summary::before { transform: rotate(90deg); }
.nav-group { margin: .2rem 0 .4rem 1rem; }
.nav-group-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: .5rem 0 .15rem .4rem; }
.nav-ch { display: flex; gap: .45rem; align-items: baseline; padding: .3rem .5rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .92rem; }
.nav-ch .num { font-weight: 700; min-width: 1.8rem; }
.nav-ch.disabled { color: var(--muted); }
.nav-ch.active, .nav-ch:hover { background: var(--surface-2); }
.nav-ch.active { box-shadow: inset 3px 0 0 var(--brand); }
.nav-sub { margin: .1rem 0 .4rem 2.4rem; display: grid; }
.nav-sub a { font-size: .86rem; padding: .18rem .5rem; color: var(--muted); text-decoration: none; border-radius: 6px; }
.nav-sub a.active, .nav-sub a:hover { color: var(--text); background: var(--surface-2); }
.nav-missing { font-size: .82rem; color: var(--muted); margin: .2rem .5rem .5rem 1.4rem; }
.tag { font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }

/* Karten & Knöpfe */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card.soft { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.two-col { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; align-items: start; }
.row { display: flex; align-items: center; } .row.gap { gap: .6rem; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grow { flex: 1; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: .55rem 1rem; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; }
[data-theme="dark"] .btn { color: #10151c; }
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--brand-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); }
.btn.sm { padding: .35rem .7rem; min-height: 36px; font-size: .9rem; }
.btn.icon { background: transparent; color: var(--text); border-color: var(--line); min-width: 44px; justify-content: center; padding: .3rem .6rem; }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
[data-theme="dark"] .btn.active { color: #10151c; }
.btn.key { min-width: 0; justify-content: center; background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.key.primary { background: var(--brand); color: #fff; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.seg .btn { background: var(--surface); color: var(--text); border-color: var(--line); }
.seg .btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
[data-theme="dark"] .seg .btn.active { color: #10151c; }
select, input[type="text"], input[type="number"], input[type="search"], textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }
label.slider { display: inline-flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
input[type="range"] { accent-color: var(--brand); width: min(320px, 100%); height: 28px; }

/* Anforderungsstufen */
.lvl { display: inline-block; font-size: .78rem; font-weight: 800; padding: .1rem .5rem; border-radius: 6px; letter-spacing: .02em; }
.lvl-1 { background: var(--as1-bg); color: var(--as1); border: 1px solid var(--as1); }
.lvl-2 { background: var(--as2-bg); color: var(--as2); border: 1px solid var(--as2); }
.lvl-3 { background: var(--as3-bg); color: var(--as3); border: 1px solid var(--as3); }
.level-picker { display: flex; gap: .5rem; flex-wrap: wrap; }
.level-btn { font: inherit; cursor: pointer; border-radius: 12px; padding: .6rem .9rem; border: 2px solid var(--line); background: var(--surface); color: var(--text); text-align: left; min-width: 150px; }
.level-btn b { display: block; } .level-btn span { font-size: .85rem; color: var(--muted); }
.level-btn.l1[aria-pressed="true"] { border-color: var(--as1); background: var(--as1-bg); }
.level-btn.l2[aria-pressed="true"] { border-color: var(--as2); background: var(--as2-bg); }
.level-btn.l3[aria-pressed="true"] { border-color: var(--as3); background: var(--as3-bg); }
.level-btn.l1 b { color: var(--as1); } .level-btn.l2 b { color: var(--as2); } .level-btn.l3 b { color: var(--as3); }

/* Lernstand */
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.st-grey { color: var(--st-grey); } .st-red { color: var(--st-red); } .st-orange { color: var(--st-orange); } .st-green { color: var(--st-green); }
.status .ic { font-weight: 800; }
.prelim { font-size: .75rem; color: var(--muted); font-style: italic; }
.goal-row { display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.goal-row:last-child { border-bottom: 0; }
.goal-id { font-weight: 800; color: var(--muted); margin-right: .4rem; }
.goal-actions { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-2); }

/* Kapitel-Kopf und Unternavigation */
.ch-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ch-num { font-weight: 800; color: var(--brand-2); }
.subnav { display: flex; gap: .25rem; overflow-x: auto; padding-bottom: .3rem; margin: .4rem 0 1.2rem; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.subnav a { white-space: nowrap; padding: .45rem .75rem; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; }
.subnav a.active { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.entry-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.entry { display: block; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.entry b { display: block; font-size: 1.02rem; margin-bottom: .2rem; } .entry span { color: var(--muted); font-size: .9rem; }
.entry:hover { border-color: var(--brand-2); }
.entry .ic { font-size: 1.4rem; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.2rem; align-items: center; }

/* Aufgaben */
.task-head { display: flex; gap: .6rem; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.task-num { font-weight: 700; color: var(--muted); }
.task-type { font-size: .85rem; color: var(--muted); }
.task-prompt { font-size: 1.05rem; }
.task-fields { margin-top: .8rem; display: grid; gap: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.num-row { display: flex; align-items: center; gap: .5rem; }
.num-input { font-size: 1.2rem !important; padding: .55rem .8rem !important; width: min(260px, 100%); border-width: 2px !important; border-radius: 10px !important; }
.unit { font-weight: 600; color: var(--muted); }
.field.ok .num-input, .field.ok .choice-set { border-color: var(--good) !important; }
.field.bad .num-input { border-color: var(--bad) !important; }
.field-msg { font-size: .88rem; min-height: 1.1em; margin-top: .2rem; }
.field.ok .field-msg { color: var(--good); } .field.bad .field-msg { color: var(--bad); }
.choice-set { border: 2px solid transparent; border-radius: 12px; padding: .2rem; margin: 0; display: grid; gap: .45rem; }
.choice-set legend { font-weight: 600; margin-bottom: .3rem; padding: 0; }
.choice { display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand); flex: none; }
.choice:has(input:checked) { border-color: var(--brand-2); background: var(--as2-bg); }
.choice-set.compact .choice { padding: .45rem .7rem; }
.task-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.feedback { margin-top: .8rem; border-radius: 10px; }
.feedback:empty { display: none; }
.feedback.good, .feedback.bad, .feedback.warn { padding: .8rem 1rem; }
.feedback.good { background: var(--good-bg); border-left: 4px solid var(--good); }
.feedback.bad { background: var(--bad-bg); border-left: 4px solid var(--bad); }
.feedback.warn { background: var(--warn-bg); border-left: 4px solid var(--warn); }
.hints { display: grid; gap: .5rem; margin-top: .6rem; }
.hint { background: var(--warn-bg); border-radius: 10px; padding: .6rem .9rem; border-left: 4px solid var(--warn); }
.solution:empty { display: none; }
.solution { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: .8rem; }
.answer-line { background: var(--surface-2); padding: .5rem .8rem; border-radius: 8px; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .4rem; margin: .6rem 0; max-width: 560px; }
.figure.small { max-width: 300px; }
.figure svg { width: 100%; height: auto; display: block; }
.figure.interactive svg { touch-action: none; cursor: crosshair; }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: .6rem 0; }
.valtable { border-collapse: collapse; min-width: 220px; }
.valtable th, .valtable td { border: 1px solid var(--line); padding: .4rem .9rem; text-align: center; font-variant-numeric: tabular-nums; }
.valtable th { background: var(--surface-2); font-weight: 700; }
.valtable td.q { color: var(--bad); font-weight: 800; }
.valtable tr.hl td { background: var(--as2-bg); }
.valtable .cell { width: 6rem; text-align: center; }
.calc-col { color: var(--muted); }

/* Operatortabelle */
.optable { display: grid; grid-template-columns: 52px auto 52px; grid-template-rows: auto auto; align-items: center; justify-content: start; gap: 0 .2rem; margin: .5rem 0; }
.optable .op-head { display: none; }
.op-cells { display: grid; grid-template-columns: auto auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; grid-row: 1 / span 2; grid-column: 2; }
.op-cell { padding: .45rem 1rem; border-bottom: 1px solid var(--line); text-align: center; min-width: 5.5rem; font-variant-numeric: tabular-nums; }
.op-cell:nth-child(odd) { border-right: 1px solid var(--line); color: var(--c-a); }
.op-cell:nth-child(even) { color: var(--c-b); }
.op-cell:nth-last-child(-n+2) { border-bottom: 0; }
.op-cell.q { font-weight: 800; color: var(--bad); }
.op-cell.hl { background: var(--warn-bg); font-weight: 800; animation: pulse 1s ease 1; }
.op-arrow { grid-row: 1 / span 2; position: relative; height: 70px; display: flex; align-items: center; justify-content: center; }
.op-arrow.op-left { grid-column: 1; color: var(--c-a); } .op-arrow.op-right { grid-column: 3; color: var(--c-b); }
.op-svg { width: 30px; height: 64px; }
.op-label { position: absolute; font-size: .85rem; font-weight: 800; background: var(--surface); padding: 0 .15rem; white-space: nowrap; }
.op-left .op-label { right: 32px; } .op-right .op-label { left: 32px; }
.op-spacer { display: none; }
@keyframes pulse { from { background: var(--focus); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Stepper */
.stepper { background: var(--surface-2); border-radius: 12px; padding: .8rem 1rem; margin: .6rem 0; }
.stepper-title { font-weight: 700; margin-bottom: .3rem; }
.steps { margin: 0; padding-left: 1.4rem; display: grid; gap: .55rem; }
.step-op { font-weight: 600; } .step-why { color: var(--muted); font-size: .92rem; }
.step-new { animation: fadein .35s ease; }
.step-new .step-op { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--focus) 35%, transparent) 60%); display: inline; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.step-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.step-count { font-size: .85rem; color: var(--muted); }

/* Theorie */
.phase { border-left: 3px solid var(--line); padding: .2rem 0 .6rem 1rem; margin: 0 0 1.1rem; }
.phase-title { display: flex; align-items: center; gap: .5rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.phase-nr { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; }
[data-theme="dark"] .phase-nr { color: #10151c; }
.rule { border: 2px solid var(--c-p); border-radius: 12px; padding: .7rem 1rem; background: var(--good-bg); margin: .5rem 0; }
.rule-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rule-title { font-weight: 800; }
.fav { background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: var(--muted); min-width: 44px; min-height: 44px; }
.fav[aria-pressed="true"] { color: var(--focus); }
.readout { background: var(--surface-2); border-radius: 10px; padding: .55rem .9rem; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.ca { color: var(--c-a); font-weight: 700; } .cb { color: var(--c-b); font-weight: 700; } .cp { color: var(--c-p); font-weight: 700; } .cq { color: var(--c-q); font-weight: 700; }
.deepen { border: 1px solid var(--line); border-radius: 12px; padding: .5rem .9rem; margin: .5rem 0; background: var(--surface); }
.deepen summary { cursor: pointer; font-weight: 700; }
.prediction .pred-out { color: var(--muted); font-size: .92rem; margin-top: .3rem; }
.pred-echo.good { color: var(--good); font-weight: 600; } .pred-echo.warn { color: var(--warn); font-weight: 600; }
.rect-viz svg { width: 100%; max-width: 360px; }
.rect-fill { fill: color-mix(in srgb, var(--c-a) 14%, transparent); }
.edge-a { stroke: var(--c-a); stroke-width: 4; } .edge-b { stroke: var(--c-b); stroke-width: 4; }
.lab-a { fill: var(--c-a); font-weight: 700; font-size: 13px; } .lab-b { fill: var(--c-b); font-weight: 700; font-size: 13px; }
.dots-viz svg { width: 100%; max-width: 520px; }
.dot { fill: var(--c-p); } .dot-lab { font-size: 11px; fill: var(--c-a); font-weight: 700; } .dot-lab.cb { fill: var(--c-b); }
.tabs { display: flex; gap: .3rem; margin: .3rem 0; }
.tab { font: inherit; font-weight: 600; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.meter { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; max-width: 420px; }
.meter-bar { height: 100%; background: var(--good); width: 2%; }
.meter.over .meter-bar { background: var(--bad); }
ul.clean { padding-left: 1.1rem; } ul.clean li { margin: .3rem 0; }

/* SVG-Grafik */
.g-grid { stroke: var(--line); stroke-width: 1; }
.g-axis { stroke: var(--text); stroke-width: 1.6; }
.g-arrowhead { fill: var(--text); }
.g-tick { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.g-label { font-size: 13px; fill: var(--text); font-weight: 600; font-family: var(--font); }
.g-curve { fill: none; stroke-width: 3; stroke-linecap: round; }
.g-curve.soft { opacity: .45; stroke-dasharray: 6 5; }
.g-wrong { fill: none; stroke: var(--c-lin); stroke-width: 2; stroke-dasharray: 4 4; }
.g-point { fill: var(--c-b); stroke: var(--surface); stroke-width: 2.5; }
.g-point.drag { cursor: grab; }
.g-dot { fill: var(--c-a); }
.g-plabel { font-size: 13px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.g-help { stroke-width: 1.6; stroke-dasharray: 5 4; }
.ca-stroke { stroke: var(--c-a); } .cb-stroke { stroke: var(--c-b); }
.cp-circle { fill: none; stroke: var(--line); stroke-width: 2; } .cp-line { stroke: var(--c-a); stroke-width: 1.4; opacity: .75; } .cp-dot { fill: var(--c-b); }
.tk-basin { fill: var(--surface-2); stroke: var(--text); stroke-width: 2; } .tk-water { fill: color-mix(in srgb, var(--c-inv) 55%, transparent); }
.tk-pipe { fill: none; stroke: var(--muted); stroke-width: 8; stroke-linecap: round; }
.tk-t { font-size: 13px; font-weight: 700; fill: var(--text); font-family: var(--font); } .tk-big { font-size: 26px; font-weight: 800; fill: var(--text); }
.ca-fill { fill: var(--c-a); } .cb-fill { fill: var(--c-b); }
.tank-sim svg { width: 100%; max-width: 420px; }

/* Werkzeuge */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.calc-out { font-size: 1.4rem; font-weight: 700; min-height: 2rem; margin: .4rem 0; font-variant-numeric: tabular-nums; }
.calc-out.err { color: var(--bad); font-size: 1rem; }
.calc-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; max-width: 320px; }
.calc-hist { font-size: .9rem; color: var(--muted); padding-left: 1.2rem; }
.verdict { margin-top: .6rem; }
.tools-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); max-width: 560px; width: 95vw; max-height: 90vh; }
.tools-dialog::backdrop { background: rgba(10,15,25,.45); }
.plot-ctrl { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }

/* Statische Aufgaben (Auswertung, Druck) */
.task-static { border-bottom: 1px solid var(--line); padding: .8rem 0; break-inside: avoid; }
.ts-fields { list-style: none; padding: 0; } .ts-fields > li { margin: .45rem 0; }
.ts-options { list-style: none; padding-left: .5rem; } .ts-options li.correct { font-weight: 700; color: var(--good); }
.blank { display: inline-block; width: 9rem; border-bottom: 1.5px solid var(--text); height: 1.2rem; vertical-align: bottom; }
.ts-given.ok { color: var(--good); } .ts-given.bad { color: var(--bad); }
.ts-solution { background: var(--surface-2); padding: .6rem .9rem; border-radius: 10px; margin-top: .4rem; }
.ts-steps { margin: .3rem 0 0; }

/* Diverses */
.notice { border-left: 4px solid var(--brand-2); background: var(--as2-bg); padding: .7rem 1rem; border-radius: 10px; margin: .8rem 0; }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.kpi div { background: var(--surface-2); border-radius: 12px; padding: .7rem .9rem; }
.kpi b { display: block; font-size: 1.5rem; }
.chart svg { width: 100%; max-width: 640px; height: auto; }
.progress-steps { display: flex; gap: .3rem; flex-wrap: wrap; margin: .4rem 0; }
.progress-steps span { width: 1.6rem; height: .5rem; border-radius: 4px; background: var(--surface-2); }
.progress-steps span.done { background: var(--brand-2); } .progress-steps span.ok { background: var(--good); } .progress-steps span.bad { background: var(--bad); } .progress-steps span.unk { background: var(--st-grey); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; }
.form-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; }
.form-grid legend { font-weight: 700; }
.checklist label { display: flex; gap: .4rem; align-items: flex-start; margin: .25rem 0; }
.qr svg { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 8px; }
.copy-row { display: flex; gap: .4rem; } .copy-row input { flex: 1; }
.path { counter-reset: p; list-style: none; padding: 0; }
.path > li { counter-increment: p; border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem .7rem 3rem; margin: .5rem 0; position: relative; background: var(--surface); }
.path > li::before { content: counter(p); position: absolute; left: .9rem; top: .7rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; }
.path-steps { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.path-steps a, .path-steps span { font-size: .85rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.path-steps .done { background: var(--good-bg); border-color: var(--good); }
.err-item { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: .6rem 0; background: var(--surface); }
.badge-open { color: var(--bad); } .badge-work { color: var(--st-orange); } .badge-done { color: var(--good); }
.missing-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.2rem; color: var(--muted); }
.loading { color: var(--muted); }
.not-impl { font-size: .8rem; color: var(--warn); }
.print-only { display: none; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 56px; width: 290px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top-links { display: none; }
  .two-col, .hero { grid-template-columns: 1fr; }
  html { font-size: 16px; }
}
@media (max-width: 520px) { .search { display: none; } }

@media print {
  .topbar, .sidebar, .footer, .subnav, .no-print, .task-actions, .btn { display: none !important; }
  .layout { display: block; } main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block; }
  .figure { max-width: 11cm; border: 0; }
  .page-break { break-before: page; }
  a { color: #000; text-decoration: none; }
}

/* Ergänzungen */
[hidden] { display: none !important; }
.det-steps { padding-left: 1.4rem; display: grid; gap: .45rem; }
.det-step { font: inherit; color: var(--text); text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; }
.det-step:hover { background: var(--surface-2); }
.det-step[aria-pressed="true"] { border: 2px solid var(--warn); background: var(--warn-bg); }
.det-step.det-wrong { border: 2px solid var(--bad); background: var(--bad-bg); }
.glossary dt { margin-top: .6rem; } .glossary dd { margin: .1rem 0 .4rem 1rem; }
.note { width: 100%; margin: .4rem 0; }
.check { display: inline-flex; gap: .4rem; align-items: center; }
button.entry { font: inherit; text-align: left; cursor: pointer; }
button.entry:disabled { opacity: .55; cursor: not-allowed; }
.mini-task .card { box-shadow: none; }
select { max-width: 100%; }

/* ===== Mathix – Feinschliff Design ===== */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --line: #e3e7ed; --text: #161b26; --muted: #667085;
  --brand: #2343a8; --brand-2: #2f55c8; --accent: #f05a28;
  --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.05);
}
[data-theme="dark"] { --bg: #0f131a; --surface: #171c25; --surface-2: #1f2531; --line: #2a3140; --text: #e9edf3; --muted: #9aa4b5; --brand: #8fa8ff; --brand-2: #a9bcff; --accent: #ff8a5c; }
body { letter-spacing: -0.005em; }
h1 { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-top: .2rem; }
h3 { font-size: 1.02rem; font-weight: 700; }
.topbar { border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(6px); }
.brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; gap: 0; }
.brand .x { color: var(--accent); }
.card { border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; }
.card > h2:first-child { margin-bottom: .7rem; }
.btn { border-radius: 10px; font-weight: 600; }
.btn.ghost { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn.ghost:hover { border-color: var(--brand-2); color: var(--brand-2); }
.sidebar { background: var(--bg); border-right: 1px solid var(--line); }
.nav-ch .tag { display: none; }
.nav-ch.disabled { opacity: .55; }
.nav-group-title { font-weight: 700; }

/* Kapitelkopf + Tabs */
.ch-head h1 { margin: .1rem 0 0; }
.ch-num { color: var(--accent); }
.subnav { gap: .35rem; border-bottom: 0; padding: .3rem 0 .6rem; margin: .8rem 0 1.4rem; }
.subnav a { border-radius: 999px; padding: .42rem .85rem; font-size: .9rem; color: var(--muted); background: transparent; }
.subnav a:hover { color: var(--text); background: var(--surface-2); }
.subnav a.active { color: #fff; background: var(--brand); box-shadow: none; }
[data-theme="dark"] .subnav a.active { color: #0f131a; }

/* Stufenwahl als Segmente */
.level-picker { display: inline-flex; gap: 0; background: var(--surface-2); border-radius: 12px; padding: 4px; flex-wrap: nowrap; }
.level-btn { min-width: 64px; border: 0; background: transparent; border-radius: 9px; padding: .45rem .9rem; text-align: center; }
.level-btn b { font-size: .95rem; }
.level-btn span { display: none; }
.level-btn[aria-pressed="true"] { background: var(--surface) !important; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.level-btn.l1[aria-pressed="true"], .level-btn.l2[aria-pressed="true"], .level-btn.l3[aria-pressed="true"] { border: 0; }

/* Einstiegskacheln */
.entry-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.entry { position: relative; padding: 1.1rem 1.2rem 1.1rem; border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.entry:hover { transform: translateY(-1px); border-color: var(--brand-2); }
.entry b { font-size: 1rem; padding-right: 1.4rem; }
.entry::after { content: '→'; position: absolute; right: 1rem; top: 1.05rem; color: var(--muted); font-weight: 700; }
.entry span { font-size: .88rem; }
.entry .num-big { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; color: var(--brand); line-height: 1.1; margin-bottom: .2rem; }

/* Übersicht */
.hero { grid-template-columns: 1.1fr 1fr; gap: 1.6rem; }
.lead { font-size: 1.08rem; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 0; padding: 0; list-style: none; }
.chips li { background: var(--surface-2); border-radius: 999px; padding: .3rem .75rem; font-size: .88rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1.6rem 0 .7rem; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .9rem; font-weight: 600; text-decoration: none; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.stat { background: var(--surface-2); border-radius: 12px; padding: .7rem .8rem; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }
.goal-row { padding: .8rem 0; }
.goal-text { font-weight: 500; }
.kpi div { border-radius: 12px; }
.phase { border-left: 2px solid var(--line); }
.phase-title { font-size: .82rem; }
.rule { background: color-mix(in srgb, var(--c-p) 7%, var(--surface)); border-width: 1.5px; }
.notice { border-left-width: 3px; }
.figure { border-radius: 14px; }
.footer { font-size: .8rem; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.two-col > .card { margin-bottom: 0; height: 100%; }
/* Glossar */
.az { display: flex; flex-wrap: wrap; gap: .25rem; position: sticky; top: 56px; background: var(--bg); padding: .5rem 0; z-index: 5; }
.az a { min-width: 2rem; text-align: center; padding: .25rem .4rem; border-radius: 8px; text-decoration: none; font-weight: 700; color: var(--brand); }
.az a:hover { background: var(--surface-2); }
.az-letter { color: var(--accent); font-size: 1.4rem; margin: 1.2rem 0 .5rem; }
.gl-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.gl-card h3 { margin: 0; }
.gl-card p { margin: .4rem 0; }
.gl-ex { background: var(--surface-2); border-radius: 8px; padding: .4rem .65rem; font-size: .93rem; }
.gl-meta { font-size: .82rem; color: var(--muted); }
.gl-meta a { color: var(--muted); }
.row > select { width: auto; flex: 0 1 auto; }
.subnav2 { display: flex; gap: .2rem; flex-wrap: wrap; margin: -.6rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.subnav2 a { padding: .4rem .75rem; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav2 a.active { color: var(--brand); border-color: var(--brand); }
#login-btn { min-height: 38px; font-weight: 700; }
.check-item { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item .src { font-size: .85rem; color: var(--muted); }
.result-big { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; }
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  .rule, .deepen, .gl-card, .stepper, figure { break-inside: avoid; }
  .rule { border: 1.5px solid #1e7d45; background: #fff; }
  .deepen { border: 1px solid #ccc; }
  .deepen summary { list-style: none; }
  .step-controls, .fav, input[type=search], .check { display: none !important; }
  h2 { break-after: avoid; margin-top: 1rem; }
  .two-col { grid-template-columns: 1fr 1fr; }
  .stepper { background: #f4f4f4; }
}
.clock { max-width: 220px; }
.ck-face { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.ck-tick { stroke: var(--muted); stroke-width: 1.2; } .ck-tick.big { stroke: var(--text); stroke-width: 2.5; }
.ck-num { font-size: 15px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.ck-h { stroke: var(--c-b); stroke-width: 6; stroke-linecap: round; } .ck-m { stroke: var(--c-a); stroke-width: 4; stroke-linecap: round; }
.ck-pin { fill: var(--text); }
.choice .choice-text svg { width: 100%; max-width: 340px; display: block; }
.vessel { width: 100%; max-width: 160px; } .vs-line { stroke: var(--text); stroke-width: 3; stroke-linejoin: round; }
.choice .choice-text svg.vessel { max-width: 110px; }
.road svg { width: 100%; max-width: 560px; }
.hero-row { display: block; padding: .45rem 0; color: inherit; text-decoration: none; border-top: 1px solid var(--line, #e5e7eb); }
.hero-row:first-of-type { border-top: 0; }
.hero-row .bar { margin-top: .3rem; }
.hero-row:hover b { text-decoration: underline; }
/* Diagnose: Selbsteinschätzung, Vergleich, Klassenübersicht */
.self-row .seg .btn[aria-pressed="true"].self-green { background: var(--st-green, #15803d); color: #fff; border-color: transparent; }
.self-row .seg .btn[aria-pressed="true"].self-orange { background: var(--st-orange, #c2410c); color: #fff; border-color: transparent; }
.self-row .seg .btn[aria-pressed="true"].self-red { background: var(--st-red, #b91c1c); color: #fff; border-color: transparent; }
.dot { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.dot::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: currentColor; }
.dot.st-green { color: var(--st-green, #15803d); } .dot.st-orange { color: var(--st-orange, #c2410c); } .dot.st-red { color: var(--st-red, #b91c1c); }
.diag-table td, .class-table td, .class-table th { vertical-align: top; }
.result-code { width: 100%; font-family: ui-monospace, monospace; font-size: .75rem; word-break: break-all; }
.st-bg-green { background: color-mix(in srgb, #16a34a 18%, transparent); }
.st-bg-orange { background: color-mix(in srgb, #ea580c 18%, transparent); }
.st-bg-red { background: color-mix(in srgb, #dc2626 18%, transparent); }
.st-bg-grey { color: var(--muted, #6b7280); }
.class-table td.cell { text-align: center; white-space: nowrap; }
.class-table .mis { font-size: .7rem; }
.print-grid td.c { text-align: center; width: 4.5rem; }
.print-grid .box { font-size: 1.1rem; }
.diag-item { break-inside: avoid; margin: .8rem 0; }
.diag-goal { font-size: .85rem; color: var(--muted, #6b7280); border-bottom: 1px solid var(--line, #e5e7eb); padding-bottom: .2rem; margin-bottom: .3rem; }
.diag-table td:first-child, .diag-table th:first-child, .class-table td:first-child { text-align: left; }
.print-grid td:first-child, .print-grid th:first-child { text-align: left; } .class-table td:first-child { white-space: nowrap; }

/* ===================== Mathix – lebendiger ===================== */
:root { --ink: #121a33; --ink-2: #1f2b55; --ch: var(--brand); --hl: #ffb547; }
body { background:
  radial-gradient(circle at 1px 1px, rgba(35,67,168,.08) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
[data-theme="dark"] body { background: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
.btn.big { padding: .75rem 1.35rem; font-size: 1.02rem; border-radius: 12px; }
.btn.on-dark { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); }
.btn.on-dark:hover { background: rgba(255,255,255,.14); }

/* Banner (Startseite, Kapitel) */
.banner { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: center;
  border-radius: 22px; padding: 2rem 2.2rem; margin-bottom: 1.6rem; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, var(--ink-2) 0%, var(--ink) 60%); box-shadow: 0 18px 40px -22px rgba(18,26,51,.7); }
.banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 24px 24px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 70%); }
.banner > * { position: relative; z-index: 1; }
.banner h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.05; letter-spacing: -.035em; margin-bottom: .6rem; color: #fff; }
.banner .hl { background: linear-gradient(90deg, #ffb547, #ff7a45); -webkit-background-clip: text; background-clip: text; color: transparent; }
.banner .lead { color: rgba(255,255,255,.82); font-size: 1.08rem; max-width: 34rem; }
.banner .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: #7cf0d8; margin-bottom: .6rem; }
.banner-art svg { width: 100%; height: auto; display: block; border-radius: 16px; }
.banner .muted { color: rgba(255,255,255,.7) !important; }
.banner .chips li { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.18); }
.ch-banner { background: radial-gradient(130% 150% at 0% 0%, color-mix(in srgb, var(--ch) 55%, var(--ink)) 0%, var(--ink) 65%); }
.banner-figure { background: var(--surface); border-radius: 16px; padding: .4rem; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); color: var(--text); }
.banner .level-picker { background: rgba(255,255,255,.1); }
.banner .level-btn { color: #fff; }
.banner .level-btn[aria-pressed="true"] { background: #fff; }
.banner .level-btn.l1[aria-pressed="true"] { color: var(--as1); } .banner .level-btn.l2[aria-pressed="true"] { color: var(--as2); } .banner .level-btn.l3[aria-pressed="true"] { color: var(--as3); }
@media (max-width: 820px) { .banner { grid-template-columns: 1fr; padding: 1.5rem; } }

/* Kapitelkarten Startseite */
.ch-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.ch-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.ch-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--ch) 60%, transparent); }
.ch-card-art { background: color-mix(in srgb, var(--ch) 10%, var(--surface)); border-bottom: 3px solid var(--ch); padding: .4rem .6rem 0; }
.mini-graph .g-tick, .mini-graph .g-label, .mini-graph .g-plabel { display: none; }
.mini-graph .g-curve { stroke: var(--ch) !important; stroke-width: 4; }
.mini-graph .g-point { fill: var(--ch); }
.ch-card-body { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.1rem 1rem; }
.ch-card-num { display: inline-block; font-weight: 800; color: var(--ch); margin-right: .4rem; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--ch, var(--good)); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .6s; }
.ring-t { font-size: 13px; font-weight: 800; fill: var(--text); font-family: var(--font); }

/* Kacheln mit Icons */
.entry.tool, .entry.tile { display: flex; flex-direction: column; gap: .15rem; }
.tool-ic { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; margin-bottom: .5rem;
  color: var(--ch, var(--brand)); background: color-mix(in srgb, var(--ch, var(--brand)) 13%, transparent); transition: transform .2s; }
.entry:hover .tool-ic { transform: rotate(-6deg) scale(1.08); }
.entry.tile { border-top: 3px solid var(--ch); }

/* Kapitelfarbe */
.chapter .ch-num { color: var(--ch); }
.chapter .subnav a.active { background: var(--ch); }
.chapter .phase-nr { background: var(--ch); }
.chapter .phase { border-left-color: color-mix(in srgb, var(--ch) 30%, var(--line)); }
.chapter .stat-row { align-items: center; }
.stat-ring { margin-right: .4rem; }

/* Diagnose-Zusammenfassung */
.diag-summary { display: flex; align-items: center; gap: 1.1rem; padding: .9rem 1.1rem; margin: .4rem 0 1rem; border-radius: 16px;
  background: color-mix(in srgb, var(--ch) 9%, var(--surface)); }
.diag-summary .big-num { font-size: 1.6rem; letter-spacing: -.02em; }

/* Belohnung */
.task { position: relative; }
.streak { display: inline-block; padding: .1rem .55rem; margin-right: .35rem; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #fff;
  background: linear-gradient(90deg, #ff7a45, #f2a900); animation: pop .35s ease-out; }
.feedback.good { animation: pop .3s ease-out; }
.burst { position: absolute; left: 50%; bottom: 3.2rem; width: 0; height: 0; pointer-events: none; z-index: 5; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 2px; animation: fly .8s cubic-bezier(.2,.7,.3,1) forwards; }
.burst i:nth-child(odd) { border-radius: 50%; }
@keyframes fly { from { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.4) rotate(220deg); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .streak, .feedback.good, .shake, .ch-card, .tool-ic { animation: none !important; transition: none !important; } }
@media print { .banner { background: none !important; color: #000; box-shadow: none; } .banner::after { display: none; } body { background: #fff !important; } }
.banner .level-btn b { color: rgba(255,255,255,.78); }
.banner .level-btn[aria-pressed="true"] b { color: inherit; }
.banner .level-btn:hover b { color: #fff; }
