:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #1b2433;
  --muted: #5b6678;
  --border: #d9dfeb;
  --accent: #2456d6;
  --accent-soft: #e3ebff;
  --good: #1f7d3d;
  --good-bg: #e4f5ea;
  --bad: #c0392b;
  --bad-bg: #fbe9e7;
  --warn: #b7791f;
  --warn-bg: #fdf3dc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .05);
  --font: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141d;
    --surface: #171e2b;
    --surface-2: #1f2838;
    --text: #e6ebf5;
    --muted: #93a0b8;
    --border: #2b3750;
    --accent: #6c97ff;
    --accent-soft: #1c2a4d;
    --good: #55c27a;
    --good-bg: #16301f;
    --bad: #ff7d6e;
    --bad-bg: #3a1e1b;
    --warn: #f0b955;
    --warn-bg: #3a2f17;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- Buttons & Eingaben ---------- */
.btn { border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 4px 10px; font-size: 14px; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.field { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
label.field input { margin-top: 4px; color: var(--text); }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 4px 0 4px; font-size: 24px; letter-spacing: -.01em; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }
.error-msg { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }
.auth-switch { margin-top: 14px; text-align: center; font-size: 14px; }
.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- Kopf ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.brand small { display: block; font-weight: 600; font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }
.user-menu { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; flex: none; object-fit: cover; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.danger { color: #d93025; }
.icon-btn.danger:hover { color: #fff; background: #d93025; border-color: #d93025; }
.track-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }
.track-FISI { --tc: #d9650b; --tb: #fff0e1; }
.track-FIAE { --tc: #7c3aed; --tb: #f1e8ff; }
.track-tag.track-FISI, .track-tag.track-FIAE { color: var(--tc); background: var(--tb); border-color: var(--tc); }
@media (prefers-color-scheme: dark) {
  .track-FISI { --tc: #ffa24d; --tb: #3a2512; }
  .track-FIAE { --tc: #b794ff; --tb: #2b1f4a; }
}
.avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-preview .avatar { width: 64px; height: 64px; font-size: 26px; }
.lb-help { font-size: 13px; margin: -6px 0 10px; }
.lb-rank { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; }
.lb-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.user-name { font-weight: 600; }

.hero h1 { margin: 8px 0 4px; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.hero p { margin: 0 0 16px; color: var(--muted); max-width: 60ch; }
.pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pill { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
button.pill { cursor: pointer; }
button.pill:hover { border-color: var(--accent); }
.pill .v { font-family: var(--mono); font-size: 26px; font-weight: 700; display: block; }
.pill .l { font-size: 13px; color: var(--muted); }
.pill.good .v { color: var(--good); }
.pill.bad .v { color: var(--bad); }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }

/* ---------- Bestenliste ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.lb-row { display: grid; grid-template-columns: 22px 34px minmax(120px, 300px) 1fr 52px; align-items: center; gap: 10px; padding: 6px 0; }
.lb-row.you .lb-name { font-weight: 700; }
.tag-you { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.lb-pct { font-family: var(--mono); text-align: right; font-size: 14px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top: 16px; align-items: stretch; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.topics { position: relative; padding: 0; min-height: 360px; }
.topics-scroll { position: absolute; inset: 0; overflow: auto; padding: 8px; border-radius: var(--radius); }
@media (max-width: 860px) { .topics { height: 360px; } }
.group-head, .collapse-head { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: none; cursor: pointer; text-align: left; padding: 8px 6px; border-radius: 8px; color: var(--text); }
.group-head:hover, .collapse-head:hover { background: var(--surface-2); }
.group-head .gt { flex: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.group-head .cnt { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.collapse-head h2 { margin: 0; }
.chev { display: inline-block; transition: transform .15s; color: var(--muted); width: 14px; }
.chev.open { transform: rotate(90deg); }
.progress-card .collapse-head { padding: 0 0 4px; }
.topic-btn { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.topic-btn:hover { background: var(--surface-2); }
.topic-btn.active { background: var(--accent-soft); border-color: var(--accent); }
.topic-btn .row1 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.topic-btn .cnt { font-family: var(--mono); color: var(--muted); font-size: 13px; white-space: nowrap; }
.topic-btn .bar-track { margin-top: 6px; height: 5px; }
.topics hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* ---------- Quiz ---------- */
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.qtopic { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }
.qcounter { font-family: var(--mono); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.flag-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 2px 8px; cursor: pointer; filter: grayscale(1); opacity: .7; }
.flag-btn.active { filter: none; opacity: 1; border-color: var(--bad); background: var(--bad-bg); }
.question { font-size: 20px; font-weight: 600; line-height: 1.35; margin: 4px 0 16px; white-space: pre-wrap; }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.choice:hover:not(.locked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.choice .letter { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 14px; }
.choice .exp { display: none; margin-top: 6px; font-size: 14px; color: var(--muted); }
.choice.locked { cursor: default; }
.choice.locked .exp { display: block; }
.choice.correct { border-color: var(--good); background: var(--good-bg); }
.choice.correct .letter { background: var(--good); color: #fff; }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.wrong .letter { background: var(--bad); color: #fff; }
.choice.missed { border-color: var(--warn); background: var(--warn-bg); border-style: dashed; }
.choice.dim { opacity: .65; }
.multi-hint { font-size: 14px; color: var(--muted); }
.feedback { min-height: 28px; margin: 14px 0 4px; font-weight: 700; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.open-row { display: flex; gap: 8px; }
.verdict { font-weight: 700; margin: 14px 0 8px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.answer-box { border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); white-space: pre-wrap; }
.answer-box b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 2px; }
.answer-box.good-box { background: var(--good-bg); }
.answer-box.bad-box { background: var(--bad-bg); }
.quiz-anim { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Tabelle ---------- */
.progress-card { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 8px; }
td { padding: 8px; border-top: 1px solid var(--border); font-size: 14px; }
td.mono, td.pct { font-family: var(--mono); white-space: nowrap; }
td.pct { text-align: right; }
td.bar { width: 28%; min-width: 80px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(8, 12, 20, .55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 760px; max-height: 88vh; display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px; overflow: auto; }
.review-item { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 18px; }
.review-item:last-child { border: none; margin: 0; }
.rt-row { margin-bottom: 12px; }
.rt-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.section-title { margin: 22px 0 10px; font-size: 16px; }
.section-title:first-child { margin-top: 0; }
.inline-check { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.inline-check input { width: auto; }
.ok-msg { background: var(--good-bg); color: var(--good); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.footer { text-align: center; margin-top: 32px; color: var(--muted); font-size: 13px; }

.side-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted, #8a93a6); font-weight: 700; padding: 6px 4px 2px; }
.qsrc { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted, #8a93a6); }

.auth-logo { display: block; width: 64px; height: 64px; border-radius: 16px; margin: 0 0 14px; }
.bar-fill.track-FISI, .bar-fill.track-FIAE { background: var(--tc); }

.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lb-head h2 { margin: 0; }
.pill-tabs { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; gap: 2px; }
.pill-tab { border: none; background: transparent; color: var(--muted); padding: 5px 14px; border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 600; }
.pill-tab.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.lb-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.lb-pager .icon-btn:disabled { opacity: .35; cursor: default; }
.lb-hint { font-size: 12px; }
#root section.card:focus { outline: none; }
#root section.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grp-card { border: 1px solid var(--border); border-top: 4px solid var(--tc); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.grp-card.lead { background: var(--tb); border-color: var(--tc); }
.grp-title { display: flex; align-items: center; gap: 8px; }
.grp-title .track-tag { margin-left: 0; font-size: 14px; }
.grp-score { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--tc); margin: 6px 0 8px; }
.grp-card .lb-sub { margin-top: 6px; }

.grp-card { transition: transform .2s; }
.grp-card.lead { transform: scale(1.04); box-shadow: 0 6px 22px rgba(0,0,0,.12); z-index: 1; position: relative; }
.grp-card.lead .grp-score { font-size: 48px; }
.grp-card.lead .grp-title .track-tag { font-size: 16px; }
.crown { color: #e8a317; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.grp-grid { padding: 6px 8px; }

.qctx { margin: -6px 0 14px; padding: 10px 14px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 8px; white-space: pre-wrap; font-size: 16px; }
.qcode { margin: -6px 0 14px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 14px; line-height: 1.5; overflow-x: auto; white-space: pre; tab-size: 4; }
.qtable-wrap { margin: -6px 0 14px; overflow-x: auto; }
.qtable { border-collapse: collapse; font-size: 15px; width: auto; min-width: 50%; }
.qtable caption { text-align: left; color: var(--muted); font-size: 13px; padding-bottom: 4px; }
.qtable th, .qtable td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.qtable thead th { background: var(--surface-2); }
.qfig { margin: -6px 0 14px; padding: 0; text-align: center; }
.qfig img { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; }

/* Rechtsgrundlage */
.lawbox { margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--accent, #6366f1); }
.lawbox[hidden] { display: none; }
.law-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.law-item + .law-item { margin-top: 10px; }
.law-ref { font-weight: 700; }
.law-ref a { font-weight: 500; font-size: 13px; margin-left: 6px; color: var(--accent, #6366f1); text-decoration: none; }
.law-ref a:hover { text-decoration: underline; }
.law-text { margin-top: 2px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.law-note { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* Adaptiver Modus */
.adaptive-toggle { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--accent-soft); cursor: pointer; font-weight: 600; font-size: 14px; }
.adaptive-toggle small { grid-column: 2; font-weight: 400; color: var(--muted); font-size: 12px; }

/* Ansichts-Tabs */
.view-tabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.view-tab { border: 1px solid var(--border); background: var(--surface); color: var(--muted); padding: 9px 16px; border-radius: 99px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.view-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 var(--bad); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Prüfungssimulation */
.exam-view > .card { margin-bottom: 16px; }
.exam-head { display: flex; align-items: center; gap: 10px; }
.exam-head h2 { margin: 0; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.exam-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.exam-card h3 { margin: 0; font-size: 16px; }
.exam-card p { margin: 0; font-size: 13px; }
.exam-secs { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 4px; font-size: 13px; }
.exam-secs li { display: flex; justify-content: space-between; gap: 10px; }
.exam-secs li .mono { color: var(--muted); white-space: nowrap; }
.exam-card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exam-rules { margin-top: 6px; font-size: 14px; }
.exam-rules summary { cursor: pointer; font-weight: 600; }
.exam-rules ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--muted); }
.exam-trend { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding: 6px 0; border-bottom: 1px dashed var(--border); margin-bottom: 8px; background: linear-gradient(to top, transparent calc(50% - 1px), var(--border) calc(50% - 1px), var(--border) 50%, transparent 50%); }
.exam-trend .tbar { flex: 1; max-width: 46px; border-radius: 6px 6px 0 0; display: flex; justify-content: center; font-size: 11px; font-family: var(--mono); color: #fff; }
.exam-trend .tbar span { margin-top: 2px; }
.exam-trend .tbar.ok { background: var(--good); }
.exam-trend .tbar.no { background: var(--bad); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.table-wrap { overflow-x: auto; }
.nowrap { white-space: nowrap; }

.exam-between { text-align: center; padding: 36px 16px; }
.exam-between .actions { justify-content: center; }
.exam-next-name { font-size: 20px; font-weight: 700; margin: 4px 0; }
.exam-top { position: sticky; top: 0; z-index: 5; }
.exam-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.exam-top-row.sub { margin: 6px 0 4px; font-size: 13px; }
.exam-secname { font-weight: 700; }
.exam-clock { text-align: center; }
.exam-clock small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.exam-clock .mono { font-size: 26px; font-weight: 700; }
.exam-clock.low .mono { color: var(--warn); }
.exam-clock.crit .mono { color: var(--bad); }
.nav-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.nav-chip { min-width: 30px; height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: var(--mono); font-size: 13px; cursor: pointer; position: relative; }
.nav-chip.done { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.nav-chip.cur { outline: 2px solid var(--accent); outline-offset: 1px; font-weight: 700; }
.nav-chip.flag::after { content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.exam-qmeta { display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.exam-qmeta .flag-btn { margin-left: auto; }
.exam-qmeta .over { color: var(--bad); font-weight: 700; }

.exam-result { border-left: 6px solid var(--bad); }
.exam-result.passed { border-left-color: var(--good); }
.exam-verdict { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.exam-verdict .big { font-size: 28px; font-weight: 800; }
.exam-result.passed .big { color: var(--good); }
.exam-result.failed .big { color: var(--bad); }
.exam-score .mono { font-size: 30px; font-weight: 700; }
.exam-grade { margin-left: 12px; font-weight: 700; }
.exam-part { margin: 8px 0; padding: 8px 12px; border-radius: 10px; }
.exam-part.ok { background: var(--good-bg); }
.exam-part.no { background: var(--bad-bg); }
.exam-part ul { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }
.exam-items h4 { margin: 14px 0 6px; }
.exam-item { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; background: var(--surface); }
.exam-item > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 26px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; }
.exam-item > summary::-webkit-details-marker { display: none; }
.exam-item.right > summary .ei-icon { color: var(--good); }
.exam-item.wrong > summary .ei-icon { color: var(--bad); }
.ei-icon { font-weight: 800; text-align: center; }
.ei-title small { color: var(--muted); font-weight: 400; }
.ei-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ei-meta.over { color: var(--bad); }
.ei-body { padding: 4px 12px 12px; }
.ei-body .review-item { border: none; padding: 0; }
@media (max-width: 640px) { .exam-item > summary { grid-template-columns: 22px 1fr; } .ei-meta { display: none; } .exam-top-row { flex-wrap: wrap; } }

/* Tester-Modus & Räume */
.tester-btn { transition: box-shadow .2s, color .2s, background .2s; }
.tester-btn:not(.active) { opacity: .75; }
.tester-btn.active { color: #b45309; background: #fff7d6; border-color: #f5b301; box-shadow: 0 0 0 2px rgba(245,179,1,.35), 0 0 14px 3px rgba(245,179,1,.75); }
.tester-btn.active svg { filter: drop-shadow(0 0 3px rgba(245,179,1,.9)); }
.tester-btn.locked { cursor: not-allowed; }
.tester-btn:disabled:not(.active) { opacity: .45; }
@media (prefers-color-scheme: dark) { .tester-btn.active { color: #ffd34d; background: #3a2f0a; } }
.tester-badge { font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; background: #fff0b8; color: #8a5a00; border: 1px solid #f5b301; }
.tag-room { font-size: 11px; background: var(--surface-2); color: var(--muted); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.lb-head { flex-wrap: wrap; gap: 8px; }
.tester-note { background: var(--warn-bg); border-radius: 8px; padding: 6px 10px; }

/* ---- Benachrichtigungen, Tickets, Räume ---- */
.has-badge { position: relative; }
.nbadge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.nbadge[hidden] { display: none; }
.bell-btn.has-unread { color: var(--accent); border-color: var(--accent); }
.bell-btn.has-unread svg { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .bell-btn.has-unread svg { animation: none; } }
.notif { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.notif.unread { border-color: var(--accent); background: var(--accent-soft); }
.notif.clickable { cursor: pointer; }
.notif.clickable:hover { border-color: var(--accent); }
.notif-icon { font-size: 20px; line-height: 1.2; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; }
.notif-body, .notif-time { font-size: 13px; }
.notif-actions { display: flex; gap: 8px; margin-top: 8px; }
.ticket-row { display: flex; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.ticket-row:hover, .ticket-row:focus-visible { border-color: var(--accent); outline: none; }
.ticket-id { color: var(--muted); min-width: 38px; font-family: var(--mono); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-title { font-weight: 600; overflow-wrap: anywhere; }
.ticket-meta { font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.chip-open { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip-in_progress { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip-done { color: var(--good); background: var(--good-bg); border-color: transparent; }
.chip-rejected { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.chip-staff { color: var(--accent); background: var(--accent-soft); border-color: transparent; margin-left: 6px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 99px; padding: 3px; gap: 2px; margin-left: auto; }
.seg-btn { border: 0; background: transparent; color: var(--muted); padding: 4px 14px; border-radius: 99px; cursor: pointer; font: inherit; font-size: 14px; }
.seg-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); font-weight: 600; }
.ticket-qbox { margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.ticket-qbox summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.ticket-snap { margin-top: 10px; }
.ticket-qref { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.ticket-thread { margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.tmsg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.tmsg.staff { border-color: var(--accent); background: var(--accent-soft); }
.tmsg-head { font-size: 13px; margin-bottom: 4px; }
.tmsg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
label.field textarea { margin-top: 4px; width: 100%; resize: vertical; }
.ticket-view textarea { width: 100%; resize: vertical; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.member-main { flex: 1; min-width: 0; }
.code-box { padding: 6px 12px; border: 1px dashed var(--border); border-radius: 8px; letter-spacing: .15em; font-size: 18px; background: var(--surface-2); }
.report-link { margin-top: 8px; }
.footer a { color: var(--accent); }
a.btn { text-decoration: none; }
.notif-system { white-space: pre-line; font-size: 14px; color: var(--text); margin-top: 6px; line-height: 1.5; }
.status-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.status-bar .seg { flex-wrap: wrap; }
.modal-wide { max-width: min(1240px, 96vw); }
.admin-users { width: 100%; table-layout: auto; }
.admin-users th, .admin-users td { padding: 6px 6px; }
.admin-users select { width: 100%; max-width: 150px; padding: 4px 6px; font-size: 13px; }
.admin-users td { vertical-align: top; }
.admin-users td:last-child, .row-actions { display: table-cell; }
.admin-users td:last-child .btn, .row-actions .btn { margin: 0 4px 4px 0; }
.admin-users .inline-check { white-space: nowrap; }
.form-grid > * { min-width: 0; }
.form-grid select { width: 100%; }
.modal-body select { max-width: 100%; }
