/* ==========================================================
   SCM Trainer – Swiss minimal
   Grau-weisse Flächen, Tinte + Limette als Akzent, Pill-Buttons
   ========================================================== */
:root {
  --bg: #f1f1ee; --surface: #ffffff; --surface-2: #f7f7f4; --surface-3: #e9e9e4;
  --ink: #161a19; --ink-2: #232826; --text: #161a19; --text-2: #4c514f; --muted: #8e928f; --soft: #a9ada9;
  --line: #e4e4de; --line-2: #d4d4cd;
  --lime: #cfee63; --lime-2: #bfe24a; --lime-soft: #f0f8d4; --lime-ink: #3d5207;
  --accent: var(--ink); --accent-soft: var(--lime-soft); --on-accent: #ffffff;
  --ok: #3f7d1f; --ok-soft: #eef8d6; --bad: #d4462b; --bad-soft: #fceae5; --warn: #9a6a00; --warn-soft: #faf1d9;
  --block: #161a19; --block-soft: #e9e9e4; --ss: #4c514f; --ss-soft: #f0f8d4; --lk: #6b5a1d; --lk-soft: #f4efdc;
  --m-master: #161a19; --m-know: #b9de45; --m-learn: #cfcfc8; --m-new: #e9e9e4; --m-err: #e0563c;
  --radius: 18px; --radius-s: 12px; --pill: 999px;
  --tabbar-h: 64px; --top-h: 64px;
  --font: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1211; --surface: #181c1b; --surface-2: #1e2321; --surface-3: #282e2c;
  --ink: #ecefe9; --ink-2: #d6dad4; --text: #ecefe9; --text-2: #b9beb9; --muted: #868b88; --soft: #6d726f;
  --line: #262b29; --line-2: #343a37;
  --lime-soft: #26300f; --lime-ink: #d9f27e; --on-accent: #0f1211;
  --ok: #a9d95a; --ok-soft: #1f2a12; --bad: #ff7a61; --bad-soft: #3a1a14; --warn: #f0c25a; --warn-soft: #34290f;
  --block: #ecefe9; --block-soft: #282e2c; --ss: #d9f27e; --ss-soft: #26300f; --lk: #e8cf7a; --lk-soft: #2f2a14;
  --m-master: #ecefe9; --m-learn: #4a504d; --m-new: #282e2c; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1211; --surface: #181c1b; --surface-2: #1e2321; --surface-3: #282e2c;
  --ink: #ecefe9; --ink-2: #d6dad4; --text: #ecefe9; --text-2: #b9beb9; --muted: #868b88; --soft: #6d726f;
  --line: #262b29; --line-2: #343a37;
  --lime-soft: #26300f; --lime-ink: #d9f27e; --on-accent: #0f1211;
  --ok: #a9d95a; --ok-soft: #1f2a12; --bad: #ff7a61; --bad-soft: #3a1a14; --warn: #f0c25a; --warn-soft: #34290f;
  --block: #ecefe9; --block-soft: #282e2c; --ss: #d9f27e; --ss-soft: #26300f; --lk: #e8cf7a; --lk-soft: #2f2a14;
  --m-master: #ecefe9; --m-learn: #4a504d; --m-new: #282e2c; color-scheme: dark; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); min-height: 100dvh; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: clamp(1.9rem, 5.2vw, 2.9rem); font-weight: 500; line-height: 1.06; letter-spacing: -.03em; margin: 0 0 10px; }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.8rem); font-weight: 500; line-height: 1.12; letter-spacing: -.025em; margin: 0; }
h3 { font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; margin: 0; }
p { margin: 6px 0; }
.soft { color: var(--soft); }
.muted { color: var(--muted); } .small { font-size: .86rem; } .tiny { font-size: .75rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.lead { color: var(--text-2); max-width: 54ch; font-size: .98rem; }

/* Abschnitts-Label: «● LEVELS» */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 35%, transparent); }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

/* ---------- Shell ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.08rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.brand .logo { display: none; }
.brand small { font-weight: 500; color: var(--muted); font-size: .78rem; letter-spacing: 0; }
.topnav { display: none; gap: 4px; margin: 0 auto; }
.topnav a { text-decoration: none; color: var(--text-2); padding: 8px 14px; border-radius: var(--pill); font-size: .9rem; font-weight: 500; }
.topnav a:hover { color: var(--text); background: var(--surface-3); }
.topnav a.active { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn { border: 0; background: transparent; color: var(--text-2); width: 40px; height: 40px; border-radius: var(--pill); display: grid; place-items: center; cursor: pointer; font-size: 1.05rem; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.countdown-pill { margin-left: auto; font-size: .8rem; font-weight: 600; color: #161a19; background: var(--lime); padding: 8px 14px; border-radius: var(--pill); white-space: nowrap; text-decoration: none; }

main { max-width: 1040px; margin: 0 auto; padding: 36px 20px calc(var(--tabbar-h) + 40px); }
main.session { max-width: 760px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600; position: relative; }
.tabbar a .ico { font-size: 1.15rem; line-height: 1; width: 40px; height: 26px; display: grid; place-items: center; border-radius: var(--pill); }
.tabbar a.active { color: var(--text); }
.tabbar a.active .ico { background: var(--lime); color: #161a19; }
.badge { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--bad); color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; }
.topnav .badge { position: static; display: inline-grid; margin-left: 6px; vertical-align: 1px; }
@media (min-width: 860px) { .topnav { display: flex; } .tabbar { display: none; } main { padding-bottom: 64px; } }
@media (max-width: 520px) {
  .top { padding: 0 14px; } main { padding: 24px 14px calc(var(--tabbar-h) + 32px); }
  .brand { white-space: nowrap; } .brand small { display: none; }
  .countdown-pill { padding: 6px 11px; margin-left: auto; }
}
.foot { text-align: center; color: var(--muted); font-size: .72rem; padding: 0 16px calc(var(--tabbar-h) + 24px); }
@media (min-width: 860px) { .foot { padding-bottom: 36px; } }

/* ---------- Controls ---------- */
.btn { font: 500 .93rem var(--font); cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  min-height: 44px; padding: 10px 20px; border-radius: var(--pill); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s, background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-accent); }
.btn.primary:hover { background: var(--ink-2); }
.btn.lime { background: var(--lime); border-color: var(--lime); color: #161a19; }
.btn.lime:hover { background: var(--lime-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.block { width: 100%; }
.btn.lg { min-height: 54px; font-size: 1rem; padding: 12px 24px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.arrow { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text); font-size: .85rem; transition: background .15s, transform .2s; }
.btn.primary .arrow { background: rgba(255,255,255,.14); color: inherit; }
.btn.lime .arrow { background: rgba(22,26,25,.1); color: #161a19; }
.btn:hover .arrow, a:hover > .arrow, button:hover > .arrow { transform: rotate(45deg); }
.btn.withArrow { padding-right: 7px; }
input, select, textarea { font: 400 16px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 10px 14px; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--lime) 55%, transparent); border-color: var(--text); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { width: 100%; min-height: 130px; resize: vertical; line-height: 1.5; }
kbd { font: 500 .7rem var(--mono); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: 500 .82rem var(--font); padding: 8px 15px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--text); color: var(--text); }
.chip.on { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; font: 500 .72rem var(--font); padding: 4px 10px; border-radius: var(--pill); white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); background: transparent; }
.tag.Block { background: var(--ink); border-color: var(--ink); color: var(--on-accent); }
.tag.Selbststudium { background: var(--lime); border-color: var(--lime); color: #161a19; }
.tag.lk { border-color: transparent; background: var(--lk-soft); color: var(--lk); }
.tag.own { border-style: dashed; color: var(--muted); }
.tag.typ { color: var(--text-2); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; border: 1px solid transparent; }
.card + .card { margin-top: 12px; }
@media (max-width: 520px) { .card { padding: 18px; border-radius: 16px; } }

/* Hero: dunkles Panel mit Limette */
.hero { background: var(--ink); color: #f1f3ee; display: grid; gap: 28px; padding: 28px; position: relative; overflow: hidden; }
:root[data-theme="dark"] .hero { background: #1d2220; color: #ecefe9; border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #1d2220; color: #ecefe9; border-color: var(--line); } }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 18px, color-mix(in srgb, var(--lime) 22%, transparent) 18px 20px); pointer-events: none; }
.hero .eyebrow { color: #c5cac4; margin: 0; }
.hero .big { font-size: clamp(3.6rem, 13vw, 6rem); font-weight: 500; line-height: .9; letter-spacing: -.05em; color: var(--lime); }
.hero .big small { font-size: .3em; letter-spacing: -.01em; color: #f1f3ee; margin-left: 10px; font-weight: 500; }
.hero .sub { color: #aab0aa; font-size: .9rem; }
.hero-grid { display: grid; gap: 24px; position: relative; z-index: 1; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: end; } }
.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.12); }
.today-grid div { padding: 14px 0 0; }
.today-grid div + div { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
.today-grid b { display: block; font-size: 1.9rem; font-weight: 500; line-height: 1; letter-spacing: -.03em; color: var(--lime); }
.today-grid span { font-size: .75rem; color: #aab0aa; }
.hero .btn.lime { position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); padding: 18px 20px; min-width: 0; }
@media (max-width: 639px) { .stat:first-child { grid-column: 1 / -1; } }
.week { flex-wrap: wrap; }
.stat b { display: block; font-size: 1.9rem; font-weight: 500; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); }
.goal { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; width: 68px; height: 68px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; font-size: .84rem; }
.week { display: flex; gap: 4px; margin-top: 10px; }
.week i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-3); }
.week i.l1 { background: color-mix(in srgb, var(--lime) 40%, var(--surface-3)); }
.week i.l2 { background: var(--lime); }
.week i.l3 { background: var(--ink); }
.week i.today { outline: 1.5px solid var(--text); outline-offset: 1.5px; }

/* Fortschrittsbalken */
.mbar { display: flex; height: 6px; border-radius: var(--pill); overflow: hidden; background: var(--m-new); gap: 2px; }
.mbar i { display: block; height: 100%; border-radius: 2px; }
.mbar i[style*="width:0.00%"] { display: none; }
.mbar .m-master { background: var(--m-master); } .mbar .m-know { background: var(--m-know); } .mbar .m-learn { background: var(--m-learn); } .mbar .m-err { background: var(--m-err); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

/* Einheiten als Liste mit Trennlinien (Akkordeon-Look) */
.unit-list { display: grid; border-top: 1px solid var(--line-2); }
.unit-row { display: grid; grid-template-columns: 82px 1fr 34px; gap: 4px 18px; align-items: center; padding: 18px 2px; border-bottom: 1px solid var(--line-2);
  text-decoration: none; color: var(--text); background: transparent; transition: background .15s; }
.unit-row:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.unit-row .tag { justify-self: start; }
.unit-row h3 { font-size: 1.05rem; }
.unit-row .meta { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.unit-row .body { min-width: 0; }
.unit-row .arrow { grid-row: 1; grid-column: 3; }
@media (max-width: 520px) { .unit-row { grid-template-columns: 1fr 30px; } .unit-row .tag { grid-column: 1; } .unit-row .body { grid-column: 1; } .unit-row .arrow { grid-column: 2; grid-row: 1 / span 2; } }

/* Lernstrategie-Karten («for body»-Stil) */
.tips { display: grid; gap: 10px; }
@media (min-width: 640px) { .tips { grid-template-columns: 1fr 1fr; } }
.tip { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 6px; position: relative; }
.tip .k { font-size: .72rem; color: var(--muted); }
.tip b { font-weight: 500; font-size: 1.05rem; letter-spacing: -.01em; }
.tip p { font-size: .88rem; color: var(--text-2); margin: 0; }
.tip .ico { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 1rem; }

/* ---------- Unit page ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; text-decoration: none; color: var(--text-2); margin-bottom: 18px; }
.back::before { content: "←"; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); display: inline-grid; place-items: center; }
.unit-head { display: grid; gap: 12px; }
.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
@media (min-width: 640px) { .actions-grid { grid-template-columns: repeat(4, 1fr); } }
details.goals { background: var(--surface); border-radius: var(--radius); padding: 0; }
details.goals summary { cursor: pointer; font-weight: 500; padding: 18px 22px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.goals summary::-webkit-details-marker { display: none; }
details.goals summary::after { content: "+"; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; transition: transform .2s; }
details.goals[open] summary::after { transform: rotate(45deg); }
details.goals ul { margin: 0; padding: 0 22px 20px 40px; color: var(--text-2); font-size: .92rem; }
.task-list { display: grid; margin-top: 14px; border-top: 1px solid var(--line-2); }
.task-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line-2);
  background: transparent; cursor: pointer; text-align: left; font: inherit; color: var(--text); width: 100%; }
.task-row:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.task-row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.task-row .t small { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--m-new); box-shadow: inset 0 0 0 1px var(--line-2); }
.dot.err { background: var(--m-err); box-shadow: none; } .dot.b1, .dot.b2 { background: var(--m-learn); box-shadow: none; } .dot.b3 { background: var(--m-know); box-shadow: none; } .dot.b4, .dot.b5 { background: var(--m-master); box-shadow: none; }

/* ---------- Session player ---------- */
.session-top { position: sticky; top: var(--top-h); z-index: 10; background: var(--bg); padding: 10px 0 16px; display: flex; align-items: center; gap: 14px; }
.session-top .icon-btn { background: var(--surface); }
.progress { flex: 1; height: 4px; background: var(--surface-3); border-radius: var(--pill); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ink); border-radius: var(--pill); transition: width .35s cubic-bezier(.2,.7,.2,1); }
.counter { font-size: .82rem; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.q-card { background: var(--surface); border-radius: var(--radius); padding: 28px; animation: rise .25s ease-out; }
@media (max-width: 520px) { .q-card { padding: 18px; border-radius: 16px; } main.session { padding-left: 10px; padding-right: 10px; } }
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.q-title { font-size: clamp(1.2rem, 3.4vw, 1.45rem); font-weight: 500; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 12px; }
.q-title .num { color: var(--soft); }
.ctx { background: var(--surface-2); border-radius: var(--radius-s); padding: 14px 16px; margin: 12px 0; white-space: pre-wrap; font-size: .93rem; color: var(--text-2); overflow-x: auto; }
.ctx table { border-collapse: collapse; margin: 8px 0; font-size: .86rem; white-space: nowrap; background: var(--surface); border-radius: 10px; overflow: hidden; }
.ctx th, .ctx td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.ctx th { background: var(--surface-3); font-weight: 600; color: var(--text); font-size: .8rem; }
.ctx td.n { text-align: right; font-variant-numeric: tabular-nums; }
.q-text { font-weight: 500; margin: 16px 0 14px; white-space: pre-wrap; font-size: 1.02rem; }

.tf-list { display: grid; gap: 10px; }
.tf-item { border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 14px; display: grid; gap: 12px; }
.tf-item .stmt { white-space: pre-wrap; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: var(--pill); }
.seg button { font: 500 .9rem var(--font); min-height: 40px; border-radius: var(--pill); border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.sel { background: var(--ink); color: var(--on-accent); }
.tf-item.ok { border-color: var(--ok); background: var(--ok-soft); } .tf-item.bad { border-color: var(--bad); background: var(--bad-soft); }
.sol-hint { font-size: .85rem; font-weight: 600; }
.sol-hint.ok { color: var(--ok); } .sol-hint.bad { color: var(--bad); }

.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-s); cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--text); }
.opt .mark { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--line-2); border-radius: 50%; margin-top: 1px; display: grid; place-items: center; font-size: .72rem; color: transparent; }
.opt.multi .mark { border-radius: 7px; }
.opt.sel { border-color: var(--ink); background: var(--surface-2); }
.opt.sel .mark { border-color: var(--ink); background: var(--ink); color: var(--on-accent); }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); } .opt.ok .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); } .opt.bad .mark { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.missed { border-color: var(--ok); border-style: dashed; }
.opt .key { margin-left: auto; flex: none; }
@media (hover: none) { .opt .key { display: none; } }

.match { display: grid; gap: 8px; }
.match-row { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s); }
@media (min-width: 640px) { .match-row { grid-template-columns: 1fr minmax(190px, 42%); align-items: center; } }
.match-row select { width: 100%; }
.match-row.ok { border-color: var(--ok); background: var(--ok-soft); } .match-row.bad { border-color: var(--bad); background: var(--bad-soft); }

.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.order-list li { display: flex; gap: 12px; align-items: center; padding: 10px 10px 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--surface); }
.order-list li .pos { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: .8rem; }
.order-list li span.txt { flex: 1; }
.order-list li .mv { display: flex; gap: 4px; }
.order-list li .mv button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: .9rem; }
.order-list li .mv button:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
.order-list li .mv button:disabled { opacity: .3; }
.order-list li.ok { border-color: var(--ok); background: var(--ok-soft); } .order-list li.bad { border-color: var(--bad); background: var(--bad-soft); }

.num-list { display: grid; gap: 4px; }
.num-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.num-row:last-child { border-bottom: 0; }
@media (min-width: 640px) { .num-row { grid-template-columns: 1fr auto; align-items: center; gap: 16px; } }
.num-row .inp { display: flex; align-items: center; gap: 8px; }
.num-row input { width: 100%; max-width: 180px; text-align: right; font-variant-numeric: tabular-nums; }
.num-row .unit { color: var(--muted); font-size: .88rem; min-width: 2ch; }
.num-row.ok input { border-color: var(--ok); background: var(--ok-soft); } .num-row.bad input { border-color: var(--bad); background: var(--bad-soft); }
.num-row .sol { grid-column: 1 / -1; font-size: .85rem; color: var(--ok); font-weight: 600; }

.cloze { white-space: pre-wrap; line-height: 2.6; }
.cloze input, .cloze select { margin: 0 3px; padding: 5px 12px; min-height: 38px; max-width: 100%; vertical-align: baseline; }
.cloze select { padding-right: 34px; }
.cloze input { width: 11em; }
.g-ok { border-color: var(--ok) !important; background-color: var(--ok-soft) !important; }
.g-bad { border-color: var(--bad) !important; background-color: var(--bad-soft) !important; }
.g-sol { color: var(--ok); font-weight: 600; font-size: .86rem; }

.feedback { margin-top: 18px; border-radius: var(--radius-s); padding: 16px 18px; display: grid; gap: 8px; animation: rise .22s ease-out; border: 1px solid transparent; }
.feedback.ok { background: var(--ok-soft); } .feedback.bad { background: var(--bad-soft); } .feedback.part { background: var(--warn-soft); } .feedback.neutral { background: var(--surface-2); border-color: var(--line); }
.feedback .head { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.feedback .head::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.feedback.ok .head { color: var(--ok); } .feedback.ok .head::before { background: var(--ok); }
.feedback.bad .head { color: var(--bad); } .feedback.bad .head::before { background: var(--bad); }
.feedback.part .head { color: var(--warn); } .feedback.part .head::before { background: var(--warn); }
.feedback.neutral .head::before { background: var(--lime-2); }
.feedback .expl { white-space: pre-wrap; font-size: .92rem; color: var(--text-2); }
.feedback .expl b { color: var(--text); font-weight: 600; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.selfgrade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.selfgrade .btn { min-height: 58px; flex-direction: column; gap: 0; font-size: .88rem; padding: 6px; border-radius: var(--radius-s); }
.selfgrade .btn small { font-weight: 400; color: var(--muted); font-size: .72rem; }
.selfgrade .btn[data-r="ok"] { background: var(--lime); border-color: var(--lime); color: #161a19; }
.selfgrade .btn[data-r="ok"] small { color: #3d4a1a; }

.action-bar { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 9; margin-top: 16px; display: flex; gap: 8px; align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 0; }
@media (min-width: 860px) { .action-bar { bottom: 14px; } }
.action-bar .btn.primary { flex: 1; }
.hotkeys { font-size: .74rem; color: var(--muted); display: none; gap: 16px; margin-top: 10px; justify-content: center; }
@media (hover: hover) and (min-width: 860px) { .hotkeys { display: flex; } }

.summary { text-align: center; padding: 40px 22px; }
.summary .score { font-size: clamp(3.4rem, 12vw, 5rem); font-weight: 500; line-height: 1; margin: 12px 0; letter-spacing: -.05em; }
.summary .row { justify-content: center; margin-top: 22px; }

/* ---------- Exam ---------- */
.exam-bar { position: sticky; top: calc(var(--top-h) + 8px); z-index: 10; display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--on-accent);
  border-radius: var(--pill); padding: 8px 8px 8px 22px; margin-bottom: 14px; }
.exam-bar .muted { color: color-mix(in srgb, var(--on-accent) 60%, transparent); }
.exam-bar .btn.primary { background: var(--lime); border-color: var(--lime); color: #161a19; }
.timer { font: 600 1.15rem var(--mono); font-variant-numeric: tabular-nums; color: var(--lime); }
:root[data-theme="dark"] .timer { color: #2c3a08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .timer { color: #2c3a08; } }
.timer.low { color: var(--bad) !important; }
.palette { display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0 18px; }
.palette a { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 .72rem var(--font); text-decoration: none; color: var(--text-2); background: var(--surface); }
.palette a.done { background: var(--ink); color: var(--on-accent); }
.palette a.r-ok { background: var(--ok-soft); color: var(--ok); } .palette a.r-bad { background: var(--bad-soft); color: var(--bad); } .palette a.r-part { background: var(--warn-soft); color: var(--warn); }
.exam-q { scroll-margin-top: calc(var(--top-h) + 90px); }
.exam-q + .exam-q { margin-top: 12px; }
.pts { font-size: .76rem; font-weight: 600; color: var(--muted); margin-left: auto; }
table.plan { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.plan td, table.plan th { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.plan th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.checklist { display: grid; }
.checklist label { display: flex; gap: 14px; align-items: center; padding: 13px 2px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .95rem; }
.checklist input { width: 22px; height: 22px; min-height: 0; accent-color: #161a19; flex: none; }
.checklist label.done span { color: var(--muted); text-decoration: line-through; }
.hist { display: flex; align-items: flex-end; gap: 8px; height: 110px; margin-top: 26px; }
.hist div { flex: 1; max-width: 40px; background: var(--lime); border-radius: 8px 8px 3px 3px; position: relative; min-height: 4px; }
.hist div span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: .7rem; color: var(--muted); }
.two-col { display: grid; gap: 12px; }
.two-col > * { min-width: 0; }
.two-col > .card + .card { margin-top: 0; }
.hero-grid > * { min-width: 0; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- Tools / Rechner ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.calc-card { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; text-decoration: none; color: var(--text); display: grid; gap: 6px; min-height: 130px; align-content: space-between; transition: background .15s; }
.calc-card:hover { background: var(--surface-2); }
.calc-card h3 { margin: 0; font-size: 1.05rem; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; background: var(--surface); border-radius: var(--radius); padding: 22px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.out { margin-top: 12px; background: var(--surface); border-radius: var(--radius); padding: 18px 22px; overflow-x: auto; }
.out table { border-collapse: collapse; width: 100%; }
.out td, .out th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.out td:first-child, .out th:first-child { text-align: left; white-space: normal; }
.out b { font-weight: 600; }
.formula { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.scroll { overflow-x: auto; }
.sim input { width: 72px; min-height: 36px; padding: 4px 8px; }
.result { font-weight: 600; } .result.ok { color: var(--ok); } .result.part { color: var(--warn); } .result.fail { color: var(--bad); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0; }

.fcards { display: grid; gap: 10px; }
@media (min-width: 640px) { .fcards { grid-template-columns: 1fr 1fr; } }
.fcard { background: var(--surface); border: 0; border-radius: var(--radius); padding: 20px 22px; cursor: pointer; text-align: left; font: inherit; color: var(--text); display: grid; gap: 10px; }
.fcard b { font-weight: 500; font-size: 1.02rem; letter-spacing: -.01em; }
.fcard .f { font-family: var(--mono); font-size: .84rem; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-s); white-space: pre-wrap; line-height: 1.5; transition: color .2s, text-shadow .2s; }
.fcard .f.hide { color: transparent; text-shadow: 0 0 10px var(--soft); user-select: none; }
.fcard .group { font-size: .72rem; color: var(--muted); }
.feature { display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--text); background: var(--lime); border-radius: var(--radius); padding: 24px; margin: 20px 0 8px; }
.feature h3 { color: #161a19; } .feature .small { color: #3d4a1a; }
.feature .sym { font-size: 2.2rem; color: #161a19; line-height: 1; }
.feature .arrow { background: #161a19; color: var(--lime); }

.settings { display: grid; }
.settings > label, .settings > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings > :last-child { border-bottom: 0; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; color: var(--text); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%); background: var(--ink); color: var(--on-accent); padding: 11px 18px; border-radius: var(--pill); font-size: .88rem; z-index: 50; animation: rise .2s; }
@media (min-width: 860px) { .toast { bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
