
:root{--bg:#eef3f8;--card:#fff;--text:#172033;--muted:#667085;--line:#d8e0ea;--primary:#285f9b;--primary2:#347cc2;--good:#19724d;--bad:#b42318;--softgood:#eaf7f0;--softbad:#fff0ef;--softwarn:#fff8e7;--shadow:0 12px 30px rgba(30,50,80,.10)}
*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:linear-gradient(180deg,#e9f0f7,#f8fafc 48%,#eef3f8);color:var(--text);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer}.wrap{max-width:1200px;margin:auto;padding:22px}.top{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}h1{font-size:clamp(30px,5vw,48px);margin:0 0 7px;line-height:1.05}.subtitle{margin:0;color:var(--muted);line-height:1.45}.scorebar{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;min-width:310px}.stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px;text-align:center}.stat b{display:block;font-size:22px}.stat span{font-size:12px;color:var(--muted)}.grid{display:grid;grid-template-columns:315px 1fr;gap:18px}.panel,.card{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow)}.panel{padding:16px;height:fit-content}.panel h2{margin:0 0 12px;font-size:17px}.mode-list{display:grid;gap:8px}.mode{width:100%;text-align:left;border:1px solid var(--line);background:#fff;padding:10px 11px;border-radius:12px;font-weight:750;color:var(--text)}.mode:hover{background:#f7fbff;border-color:#9db8d3}.mode.active{background:#eaf3fc;border-color:#79a7d4;color:#174a7a}.mode small{display:block;color:var(--muted);font-weight:500;margin-top:2px;line-height:1.25}.controls{border-top:1px solid var(--line);margin-top:16px;padding-top:16px;display:grid;gap:12px}label{font-size:13px;color:var(--muted);font-weight:750}select{width:100%;margin-top:5px;border:1px solid var(--line);border-radius:10px;padding:9px;background:#fff}.toggle{display:flex;align-items:center;gap:8px;color:var(--text);font-size:14px}.toggle input{width:18px;height:18px}.smallbtn,.secondary{border:1px solid var(--line);background:#fff;border-radius:11px;padding:9px 11px;font-weight:750}.note{background:var(--softwarn);border:1px solid #efd18c;border-radius:12px;padding:10px 11px;font-size:13px;color:#6a520d;line-height:1.45}.card{padding:clamp(18px,3vw,34px);min-height:650px;display:flex;flex-direction:column}.task-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.pill{background:#eff5fb;color:#315d86;border-radius:999px;padding:7px 11px;font-size:13px;font-weight:800}.taskno{font-size:13px;color:var(--muted)}.prompt{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;min-height:450px;padding:14px 0}.question{font-size:clamp(23px,4vw,40px);font-weight:850;margin:10px 0 18px;line-height:1.25;max-width:900px}.hint{color:var(--muted);font-size:15px;line-height:1.5;max-width:850px}.funcbox{font-size:clamp(27px,5vw,45px);font-weight:850;background:#f7f9fc;border:1px solid var(--line);border-radius:16px;padding:15px 22px;margin:12px 0 20px}.answer-row{display:flex;gap:10px;justify-content:center;align-items:center;flex-wrap:wrap;width:100%}.answer-input{width:170px;text-align:center;font-size:21px;font-weight:800;border:2px solid #b8c7d7;border-radius:13px;padding:10px 12px;outline:none}.answer-input.wide{width:min(340px,85vw)}.answer-input:focus,.mini:focus{border-color:var(--primary2);box-shadow:0 0 0 4px rgba(52,124,194,.12)}.primary{border:0;background:var(--primary);color:#fff;border-radius:13px;padding:12px 18px;font-weight:800}.choice-grid{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;max-width:900px}.choice{border:2px solid #b8c7d7;background:#fff;border-radius:13px;padding:12px 16px;font-size:17px;font-weight:800;min-width:140px}.ftable{border-collapse:collapse;margin:14px auto 20px;font-size:17px;max-width:100%}.ftable th,.ftable td{border:1px solid #bac7d4;padding:9px 12px;text-align:center;min-width:70px}.ftable th{background:#eef4fa}.mini{width:76px;text-align:center;border:2px solid #b8c7d7;border-radius:8px;padding:6px;font-weight:800;font-size:16px}.graph-wrap{width:min(610px,96%);background:#fff;border:1px solid var(--line);border-radius:14px;padding:8px;margin:10px auto 16px}.graph{width:100%;height:auto;display:block;touch-action:none;user-select:none}.graphhelp{font-size:13px;color:var(--muted);margin-top:-5px;margin-bottom:8px}.graph-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:8px 0}.feedback{border-radius:14px;padding:12px 15px;font-weight:750;min-height:49px;display:flex;align-items:center;justify-content:center;text-align:center;visibility:hidden}.feedback.show{visibility:visible}.feedback.good{background:var(--softgood);color:var(--good)}.feedback.bad{background:var(--softbad);color:var(--bad)}.bottom-actions{display:flex;justify-content:space-between;gap:10px;margin-top:14px}.next{border:0;background:#172033;color:#fff;border-radius:12px;padding:11px 16px;font-weight:800}.next:disabled{opacity:.4;cursor:not-allowed}.steps{width:min(840px,96%);background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:16px;text-align:left;margin-top:16px;line-height:1.5}.steps li{margin:5px 0}.context{max-width:820px;background:#f7f9fc;border:1px solid var(--line);border-radius:15px;padding:16px 18px;line-height:1.55;font-size:18px;margin:10px 0 18px;text-align:left}.badge-level{display:inline-block;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800;background:#fff0e8;color:#8a3b1e;margin-left:5px}@media(max-width:850px){.top{flex-direction:column}.scorebar{width:100%;min-width:0}.grid{grid-template-columns:1fr}.panel{order:2}.card{order:1}.ftable{font-size:15px}.ftable th,.ftable td{padding:7px 7px;min-width:54px}.mini{width:60px}}


/* V54: native mathematische Darstellung und mehrstufige Aufgaben */
math.math-inline,
math.math-equation{
  font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;
  color:inherit;
  line-height:1;
}
math.math-inline{
  display:inline-block;
  font-size:1em;
  vertical-align:-0.18em;
  margin:0 .06em;
}
math.math-equation{
  display:inline-block;
  font-size:1.08em;
  vertical-align:-0.10em;
}
.funcbox math.math-equation{font-size:1.05em}
.normalform-source{
  max-width:760px;margin:14px auto 18px;padding:18px 20px;
  background:#f7f9fc;border:1px solid var(--line);border-radius:16px;
  text-align:center;font-size:clamp(27px,5vw,42px);font-weight:850;color:#173a59
}
.normalform-row{
  max-width:760px;margin:10px auto;display:grid;grid-template-columns:minmax(0,1fr) auto auto auto auto;
  gap:8px;align-items:center;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fafcfd
}
.normalform-row .eqname{font-weight:900;color:#244b69}
.normalform-row .answer-input{width:90px}
.normalform-status{max-width:760px;margin:10px auto;padding:10px 12px;border-radius:10px;font-weight:800;display:none}
.normalform-status.show{display:block}.normalform-status.good{background:#e7f5eb;color:#286340}.normalform-status.bad{background:#fde9e6;color:#913b32}
.intersection-legend{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin:10px 0 8px}
.intersection-legend span{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:999px;background:#f5f8fa;font-weight:850;color:#3d5669}
.line-dot{width:12px;height:12px;border-radius:50%;display:inline-block}.line-dot.blue{background:#347cc2}.line-dot.orange{background:#d97941}
.intersection-tools{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:10px 0}
.intersection-tools button.active{box-shadow:0 0 0 3px rgba(40,95,155,.18)}
.intersection-points{max-width:760px;margin:8px auto;color:#65798a;text-align:center;font-size:.9rem}
.intersection-answer{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}
@media(max-width:700px){.normalform-row{grid-template-columns:1fr auto auto}.normalform-row .eqname{grid-column:1/-1}}

