/* ZFA Trainer – Apple-inspiriertes Design */
:root {
  --bg: #f5f5f7; --card: #ffffff; --ink: #1d1d1f; --muted: #6e6e73; --line: rgba(0, 0, 0, .09); --fill: rgba(120, 120, 128, .12);
  --brand: #0071e3; --brand-2: #2997ff; --brand-ink: #ffffff; --soft: rgba(0, 113, 227, .10);
  --ok: #248a3d; --ok-bg: rgba(52, 199, 89, .14); --bad: #d70015; --bad-bg: rgba(255, 59, 48, .12); --warn: #b25000; --warn-bg: rgba(255, 159, 10, .16);
  --shadow: 0 1px 1px rgba(0, 0, 0, .03), 0 8px 30px rgba(0, 0, 0, .06);
  --radius: 22px; --radius-s: 14px;
  --glass: rgba(245, 245, 247, .78);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --ink: #f5f5f7; --muted: #98989f; --line: rgba(255, 255, 255, .12); --fill: rgba(120, 120, 128, .28);
    --brand: #0a84ff; --brand-2: #64d2ff; --brand-ink: #ffffff; --soft: rgba(10, 132, 255, .18);
    --ok: #30d158; --ok-bg: rgba(48, 209, 88, .17); --bad: #ff6961; --bad-bg: rgba(255, 69, 58, .18); --warn: #ffb340; --warn-bg: rgba(255, 159, 10, .2);
    --shadow: 0 1px 1px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .4); --glass: rgba(0, 0, 0, .72);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.47 var(--font); letter-spacing: -.011em; min-height: 100vh; overflow-x: clip; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.022em; font-weight: 700; }
h1 { font-size: 2.1rem; letter-spacing: -.03em; }
button, select, textarea, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 65%, transparent); outline-offset: 2px; border-radius: 10px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 22px 110px; }
.sp { flex: 1; }
.hint { color: var(--muted); font-size: .88rem; }
.grid { display: grid; gap: 16px; }
.grid > *, .opts > *, .start > * { min-width: 0; }

/* ---------- Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--fill); color: var(--brand); border-radius: 999px; padding: 10px 20px; font-weight: 600; font-size: .96rem; transition: transform .1s, background .15s, filter .15s; white-space: nowrap; }
.btn:hover { filter: brightness(.96); }
.btn:active { transform: scale(.97); }
a.btn { color: var(--brand); }
.btn.primary, a.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 14px; font-size: .86rem; }
.btn.big { padding: 15px 26px; font-size: 1.05rem; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: 1rem; }
.icon-btn:hover { color: var(--ink); }
.icon-btn.danger:hover { color: var(--bad); }

/* ---------- Kopfzeile / Tab-Leiste */
.top { position: sticky; top: 0; z-index: 30; backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); background: var(--glass); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1040px; margin: 0 auto; padding: 0 22px; height: 52px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(145deg, #2997ff, #0071e3); display: grid; place-items: center; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); font-weight: 600; font-size: .92rem; padding: 6px 13px; border-radius: 999px; }
.nav a.on { background: var(--fill); color: var(--ink); }
.nav a:hover { color: var(--ink); }
.user { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fill); color: var(--ink); font-weight: 700; font-size: .85rem; }
.user .menu { position: absolute; right: 0; top: 42px; min-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px; display: none; }
.user.open .menu { display: block; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-size: .95rem; }
.menu button:hover { background: var(--fill); }
.menu .danger { color: var(--bad); }
.tabbar { display: none; }
@media (max-width: 700px) {
  .top .in { gap: 10px; padding: 0 16px; }
  .top .nav { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); background: var(--glass); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 600; padding: 4px 0; }
  .tabbar a.on { color: var(--brand); }
  .tabbar svg { width: 24px; height: 24px; }
  .wrap { padding: 0 16px 100px; }
  h1 { font-size: 1.75rem; }
}

/* ---------- Anmeldung */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .hero { background: radial-gradient(120% 90% at 0% 0%, #2997ff 0%, #0071e3 45%, #003e8a 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 26px; position: relative; overflow: hidden; }
.auth .hero::after { content: ""; position: absolute; width: 560px; height: 560px; right: -180px; bottom: -200px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.auth .hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.auth .hero p { font-size: 1.15rem; max-width: 34ch; opacity: .92; margin: 0; }
.auth .hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth .hero li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 12px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: .78rem; }
.auth .hero .brand { color: #fff; }
.auth .panel { display: grid; place-items: center; padding: 32px; }
.auth form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.seg-ctl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); padding: 3px; border-radius: 11px; gap: 2px; }
.seg-ctl button { border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink); transition: background .15s, box-shadow .15s; }
.seg-ctl button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
@media (prefers-color-scheme: dark) { .seg-ctl button.on { background: #636366; } }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
input.t, textarea.t, select.t { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
input.t:focus, textarea.t:focus, select.t:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--soft); }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .9rem; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth .hero { padding: 30px 24px; } .auth .hero ul { display: none; } .auth .panel { padding: 24px 20px 40px; } }

/* ---------- Übersicht */
.hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 34px 0 18px; }
.countdown { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .86rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--line); }
.stats { grid-template-columns: repeat(4, 1fr); }
.stat .n { font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .84rem; font-weight: 500; margin-top: 2px; }
.two { grid-template-columns: 1.4fr 1fr; align-items: start; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 38px 0 14px; }
.section-h h2 { font-size: 1.5rem; }
.bar { height: 7px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--brand)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.mastery { display: grid; gap: 15px; }
.mastery .row { display: grid; gap: 6px; }
.mastery .row .t { display: flex; justify-content: space-between; font-size: .92rem; font-weight: 600; }
.mastery .row .t span:last-child { color: var(--muted); font-weight: 500; }
.exams { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.exam { display: flex; flex-direction: column; gap: 10px; color: inherit; transition: transform .2s, box-shadow .2s; position: relative; cursor: pointer; }
.exam:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0, 0, 0, .12); }
.exam .num { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(145deg, #2997ff, #0071e3); }
.exam h3 { font-size: 1.12rem; }
.exam p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); align-items: center; }
.dots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--fill); margin-right: 3px; }
.dots i.on { background: #ff9f0a; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--brand)) 16%, transparent); color: color-mix(in srgb, var(--c, var(--brand)) 70%, var(--ink)); }
.badge { position: absolute; top: 16px; right: 16px; font-weight: 700; font-size: .78rem; padding: 4px 11px; border-radius: 999px; }
.badge.done { background: var(--ok-bg); color: var(--ok); } .badge.mid { background: var(--warn-bg); color: var(--warn); } .badge.low { background: var(--bad-bg); color: var(--bad); } .badge.draft { background: var(--soft); color: var(--brand); }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--c, var(--brand)) calc(var(--p) * 1%), var(--fill) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-t); width: 86px; height: 86px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.recent { display: grid; gap: 6px; }
.recent a { display: flex; align-items: center; gap: 12px; color: inherit; padding: 9px 10px; border-radius: 14px; }
.recent a:hover { background: var(--fill); }
.recent .g { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--soft); color: var(--brand); flex: none; }
.recent .x { flex: 1; min-width: 0; }
.recent .x b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; font-weight: 600; }
.recent .x small { color: var(--muted); }
.empty { color: var(--muted); padding: 6px 0; }
.linkcard { display: flex; gap: 16px; align-items: center; color: inherit; }
.linkcard:hover { box-shadow: 0 14px 40px rgba(0, 0, 0, .12); }

/* ---------- Checkliste */
.cl-sec .hd { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cl-sec .hd h3 { flex: 1; font-size: 1.15rem; min-width: 200px; }
.cl-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.cl-item input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; flex: none; border: 2px solid var(--muted); border-radius: 50%; display: grid; place-items: center; transition: all .15s; margin: 1px 0 0; cursor: pointer; opacity: .8; }
.cl-item input:checked { background: var(--ok); border-color: var(--ok); opacity: 1; }
.cl-item input:checked::after { content: "✓"; color: #fff; font-weight: 700; font-size: .85rem; }
.cl-item.done span { color: var(--muted); }

/* ---------- Klausur-Start */
.crumbs { padding: 22px 0 4px; font-weight: 500; font-size: .95rem; color: var(--muted); }
.start { max-width: 700px; margin: 6px auto 0; display: grid; gap: 16px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .modes { grid-template-columns: 1fr; } }
.mode { text-align: left; border: 2px solid transparent; background: var(--fill); border-radius: var(--radius-s); padding: 14px 16px; display: grid; gap: 4px; }
.mode.on { border-color: var(--brand); background: var(--soft); }
.mode b { font-size: 1rem; } .mode span { color: var(--muted); font-size: .88rem; }

/* ---------- Klausur-Ablauf */
.runbar { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); border-bottom: 1px solid var(--line); }
.runbar .in { max-width: 820px; margin: 0 auto; padding: 10px 20px; display: grid; gap: 10px; }
.runbar .row { display: flex; align-items: center; gap: 12px; }
.runbar .title { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); font-size: .9rem; }
.pbar { height: 4px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s; }
.pdots { display: flex; gap: 6px; flex-wrap: wrap; }
.pdots button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--fill); font-size: .7rem; font-weight: 700; color: var(--muted); padding: 0; }
.pdots button.ans { background: var(--soft); color: var(--brand); }
.pdots button.ok { background: var(--ok-bg); color: var(--ok); } .pdots button.bad { background: var(--bad-bg); color: var(--bad); }
.pdots button.cur { outline: 2px solid var(--brand); outline-offset: 2px; }
.run { max-width: 820px; margin: 0 auto; padding: 22px 20px 130px; }
.q { padding: 26px; display: grid; gap: 18px; animation: pop .28s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q .qh { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q .type { font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.q h2 { font-size: 1.4rem; line-height: 1.25; }
.casebox { background: var(--warn-bg); padding: 13px 16px; border-radius: var(--radius-s); font-size: .98rem; }
.casebox b { color: var(--warn); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border: 2px solid transparent; border-radius: var(--radius-s); background: var(--fill); transition: border-color .12s, background .12s, transform .08s; }
.opt:hover { background: var(--soft); }
.opt:active { transform: scale(.99); }
.opt .k { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); }
.opt.square .k { border-radius: 8px; }
.opt.sel { border-color: var(--brand); background: var(--soft); }
.opt.sel .k { background: var(--brand); color: #fff; }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); } .opt.ok .k { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); } .opt.bad .k { background: var(--bad); color: #fff; }
.opt.miss { border-style: dashed; }
.locked .opt, .locked .pill, .locked select, .locked .seg button, .locked .mv, .locked textarea { pointer-events: none; }
.row-i { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 2px solid transparent; border-radius: var(--radius-s); background: var(--fill); }
.row-i.ok { border-color: var(--ok); background: var(--ok-bg); } .row-i.bad { border-color: var(--bad); background: var(--bad-bg); }
.row-i .ans { grid-column: 1 / -1; font-size: .86rem; color: var(--ok); font-weight: 600; }
.pillset { display: inline-flex; gap: 4px; background: var(--card); padding: 3px; border-radius: 999px; }
.pill { border: 0; background: none; border-radius: 999px; padding: 6px 15px; font-weight: 600; font-size: .9rem; }
.pill.sel { background: var(--brand); color: var(--brand-ink); }
.row-i.match, .row-i.lab { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .row-i.match { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } .row-i.lab { grid-template-columns: 36px minmax(0, 1fr); } }
.row-i.lab .num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 0; background: var(--card); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: .86rem; }
.seg button.sel { background: var(--brand); color: var(--brand-ink); }
.row-i.sorty { grid-template-columns: 1fr; }
@media (min-width: 700px) { .row-i.sorty { grid-template-columns: 1fr auto; } }
.olist { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.olist li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 2px solid transparent; border-radius: var(--radius-s); background: var(--fill); cursor: grab; user-select: none; }
.olist li.drag { opacity: .4; } .olist li.over { border-color: var(--brand); }
.olist li.ok { border-color: var(--ok); background: var(--ok-bg); } .olist li.bad { border-color: var(--bad); background: var(--bad-bg); }
.olist .n { width: 28px; height: 28px; border-radius: 50%; background: var(--card); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
.olist .mvs { display: flex; gap: 4px; }
.mv { border: 0; background: var(--card); border-radius: 50%; width: 32px; height: 32px; padding: 0; color: var(--muted); }
.mv:hover { color: var(--brand); }
.cloze { line-height: 2.7; font-size: 1.08rem; }
.cloze select { display: inline-block; width: auto; max-width: 100%; border: 0; background: var(--fill); border-radius: 10px; padding: 4px 10px; margin: 0 3px; font-weight: 600; color: var(--brand); }
.cloze select.ok { background: var(--ok-bg); color: var(--ok); } .cloze select.bad { background: var(--bad-bg); color: var(--bad); }
.cloze .fix { color: var(--ok); font-weight: 600; font-size: .9rem; }
.imgfig { position: relative; width: min(460px, 100%); margin: 0 auto; border-radius: 16px; overflow: hidden; background: var(--fill); }
.imgfig img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); pointer-events: none; }
.pin.dot { background: #ff375f; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 55, 95, .55); } 70% { box-shadow: 0 0 0 14px rgba(255, 55, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 55, 95, 0); } }
textarea.t { min-height: 120px; resize: vertical; }
.keys { display: grid; gap: 6px; }
.keys .k { display: flex; gap: 8px; font-weight: 600; font-size: .9rem; padding: 7px 12px; border-radius: 10px; }
.keys .k.ok { background: var(--ok-bg); color: var(--ok); } .keys .k.bad { background: var(--bad-bg); color: var(--bad); }
.model { background: var(--soft); border-radius: var(--radius-s); padding: 13px 16px; font-size: .95rem; white-space: pre-wrap; }
.model b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); margin-bottom: 3px; }
.fb { border-radius: var(--radius-s); padding: 15px 18px; display: grid; gap: 4px; }
.fb.ok { background: var(--ok-bg); } .fb.part { background: var(--warn-bg); } .fb.bad { background: var(--bad-bg); }
.fb b { font-size: 1rem; } .fb.ok b { color: var(--ok); } .fb.part b { color: var(--warn); } .fb.bad b { color: var(--bad); }
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.dock .in { max-width: 820px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 10px; align-items: center; }

/* ---------- Ergebnis */
.res-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 30px; }
@media (max-width: 640px) { .res-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.res-hero .ring { width: 150px; height: 150px; } .res-hero .ring::after { width: 118px; height: 118px; font-size: 2.1rem; }
.grade { display: inline-flex; gap: 10px; align-items: baseline; }
.grade b { font-size: 2.5rem; letter-spacing: -.03em; } .grade span { color: var(--muted); font-weight: 500; }
.rev { display: grid; gap: 10px; }
details.rv { border-radius: var(--radius-s); background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); }
details.rv > summary { list-style: none; display: flex; gap: 12px; align-items: center; padding: 13px 16px; cursor: pointer; font-weight: 500; }
details.rv > summary::-webkit-details-marker { display: none; }
details.rv .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: #fff; font-size: .8rem; }
details.rv .ic.ok { background: #34c759; } details.rv .ic.part { background: #ff9f0a; } details.rv .ic.bad { background: #ff3b30; }
details.rv .q { box-shadow: none; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-s) var(--radius-s); animation: none; background: transparent; }
details.rv .sc { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .88rem; }

/* ---------- Karteikarten */
.decks { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.deck { display: flex; flex-direction: column; gap: 12px; color: inherit; cursor: pointer; transition: transform .2s, box-shadow .2s; position: relative; }
.deck:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0, 0, 0, .12); }
.deck .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--c, var(--brand)); font-size: 1.2rem; }
.deck h3 { font-size: 1.12rem; } .deck p { margin: 0; color: var(--muted); font-size: .9rem; }
.deck.add { border: 2px dashed var(--line); background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center; min-height: 170px; color: var(--muted); font-weight: 600; }
.deck.add:hover { color: var(--brand); border-color: var(--brand); transform: none; box-shadow: none; }
.stagebar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--fill); gap: 2px; }
.stagebar i { display: block; height: 100%; min-width: 0; }
.s-new { background: #8e8e93; } .s-learning { background: #ff453a; } .s-young { background: #ff9f0a; } .s-mature { background: #30d158; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.legend b { color: var(--ink); font-weight: 600; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.duebadge { position: absolute; top: 18px; right: 18px; background: #ff3b30; color: #fff; font-weight: 700; font-size: .78rem; border-radius: 999px; padding: 3px 10px; }
.tpick { display: flex; flex-wrap: wrap; gap: 8px; }
.tpick button { border: 2px solid transparent; background: var(--fill); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: .9rem; display: inline-flex; gap: 8px; align-items: center; }
.tpick button .c { color: var(--muted); font-weight: 500; font-size: .82rem; }
.tpick button.on { background: var(--soft); border-color: var(--brand); color: var(--brand); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); border-radius: 999px; padding: 3px; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--card); font-weight: 700; font-size: 1.1rem; }
.stepper span { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.setrow { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.setrow:first-of-type { border-top: 0; }
.setrow .lbl b { display: block; font-size: .96rem; } .setrow .lbl span { color: var(--muted); font-size: .84rem; }
.cardlist { display: grid; }
.crow { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.crow:first-child { border-top: 0; }
.crow .tx { min-width: 0; }
.crow .tx b { display: block; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .tx small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .mb { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.crow .mb .bar { width: 90px; } .crow .mb span { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.crow .acts { display: flex; gap: 6px; }
.crow.off { opacity: .55; }
.tag { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.toolbar input.t { flex: 1; min-width: 160px; padding: 9px 14px; border-radius: 999px; }
.toolbar select.t { width: auto; border-radius: 999px; padding: 9px 14px; }

/* Lernansicht */
.study { max-width: 720px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 18px; }
.flip { perspective: 1400px; }
.fcard { position: relative; min-height: 340px; cursor: pointer; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.fcard.on { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 26px; padding: 34px 26px 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; overflow: auto; }
.face.back { transform: rotateY(180deg); }
.face .qt { font-size: 1.45rem; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; white-space: pre-wrap; }
.face .at { font-size: 1.2rem; font-weight: 500; line-height: 1.5; white-space: pre-wrap; max-width: 34em; }
.face .tp { position: absolute; top: 14px; left: 16px; }
.face .tap { position: absolute; bottom: 12px; color: var(--muted); font-size: .8rem; }
.face .imgfig { width: min(250px, 62%); flex: none; }
.fcard.img { min-height: 500px; }
.face { gap: 12px; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rate button { border: 0; border-radius: 16px; padding: 12px 6px; display: grid; gap: 2px; font-weight: 700; color: #fff; }
.rate button small { font-weight: 500; opacity: .9; font-size: .74rem; }
.rate .r0 { background: #ff3b30; } .rate .r1 { background: #ff9f0a; } .rate .r2 { background: #34c759; } .rate .r3 { background: #0a84ff; }
.rate button:active { transform: scale(.97); }
.studybar { display: flex; align-items: center; gap: 14px; }
.studybar .pbar { flex: 1; }
.kbd { display: none; color: var(--muted); font-size: .8rem; text-align: center; }
@media (hover: hover) { .kbd { display: block; } }
.sumgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.sumgrid div b { display: block; font-size: 1.7rem; letter-spacing: -.03em; }
.sumgrid div span { color: var(--muted); font-size: .8rem; }
@media (max-width: 560px) { .face .qt { font-size: 1.2rem; } .rate { gap: 6px; } .sumgrid { grid-template-columns: repeat(2, 1fr); } }

/* Dialog */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--card); border-radius: 24px; padding: 24px; display: grid; gap: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); animation: pop .22s ease; }
.sheet h3 { font-size: 1.3rem; }
.sheet .acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sheet textarea.t { min-height: 90px; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: rgba(29, 29, 31, .92); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 500; font-size: .92rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 80; max-width: 90vw; backdrop-filter: blur(10px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 70; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }

@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .runbar .title { display: none; } .runbar .in { padding: 8px 12px; } .runbar .row { justify-content: space-between; } .timer { flex: 1; text-align: center; }
  .run { padding: 14px 12px 120px; } .q { padding: 18px; } .dock .in { padding: 10px 12px; } .stat .n { font-size: 1.6rem; } .hello h1 { font-size: 1.6rem; }
  .crow { grid-template-columns: 1fr; } .crow .acts { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
