:root {
  --bg: #f4f5f8; --bg2: #ffffff; --bg3: #eceef3; --fg: #1c1e26; --fg2: #5b6070; --line: #dfe2ea;
  --accent: #4f7cff; --accent-fg: #fff; --ok: #2fa36b; --bad: #d9534f; --warn: #e0a33f;
  --l0: #d9534f; --l1: #e8813f; --l2: #e0a33f; --l3: #c9c33f; --l4: #7fbf4f; --l5: #2fa36b;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --nav-h: 62px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161c; --bg2: #1e2129; --bg3: #262a34; --fg: #e8eaf0; --fg2: #9aa0b0; --line: #30343f;
    --accent: #6b90ff; --shadow: 0 1px 2px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg);
  -webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: .6rem 1rem; background: var(--bg3); color: var(--fg); min-height: 44px; }
button:hover { filter: brightness(.97); }
button:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn-ok { background: var(--ok); color: #fff; } .btn-bad { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-sm { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; }
.btn-xs { min-height: 30px; padding: .2rem .55rem; font-size: .8rem; border-radius: 8px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; background: var(--bg2); min-height: 44px; }
textarea { min-height: 110px; resize: vertical; font-family: inherit; }
label { display: block; font-size: .85rem; color: var(--fg2); margin-bottom: .25rem; }
.field { margin-bottom: .75rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 140px; }
.row.tight > * { flex: 0 0 auto; }
.muted { color: var(--fg2); font-size: .9rem; }
.small { font-size: .85rem; }
.right { margin-left: auto; }
.hidden { display: none !important; }
.wrap { max-width: 1560px; margin: 0 auto; padding: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); grid-auto-flow: dense; }
.card.span2 { grid-column: span 2; }
@media (max-width: 700px) { .card.span2 { grid-column: 1 / -1; } }
.card { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.card h2 { display: flex; align-items: center; gap: .5rem; }
.card h2 .right { font-size: .85rem; font-weight: 400; color: var(--fg2); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .6rem 0; border-top: 1px solid var(--line); display: flex; gap: .6rem; align-items: center; }
.list li:first-child { border-top: 0; }
.list li .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg3); color: var(--fg2); }
.tag.subj { color: #fff; background: var(--subj, var(--accent)); }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--bg3); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 1rem); transform: translateX(-50%); background: var(--fg); color: var(--bg);
  padding: .7rem 1.1rem; border-radius: 12px; z-index: 300; box-shadow: var(--shadow); max-width: 92vw; }
.toast.err { background: var(--bad); color: #fff; }

/* Kopf und Navigation */
header.top { display: flex; align-items: center; gap: 1rem; padding: .7rem 1rem; background: var(--bg2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50; }
header.top .brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
header.top .brand img { width: 28px; height: 28px; border-radius: 8px; }
header.top nav { display: flex; gap: .25rem; }
header.top nav a { padding: .45rem .8rem; border-radius: 10px; color: var(--fg2); font-weight: 500; }
header.top nav a.active { background: var(--bg3); color: var(--fg); }
header.top .status { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg2); display: inline-block; }
.dot.live { background: var(--ok); } .dot.poll { background: var(--warn); }
nav.bottom { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--bg2); border-top: 1px solid var(--line); z-index: 100; }
nav.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--fg2); font-size: .7rem; }
nav.bottom a .ico { display: flex; } nav.bottom a svg { width: 24px; height: 24px; }
nav.bottom a.active { color: var(--accent); }
@media (max-width: 900px) {
  header.top nav { display: none; }
  nav.bottom { display: flex; }
  .wrap { padding: .75rem; }
  .grid { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { body { padding-bottom: 1rem; } .toast { bottom: 1.5rem; } }

/* Dashboard */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg2); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1.1rem; align-items: center; }
.hero .art { position: absolute; inset: 0; background-size: cover; background-position: center right; opacity: .35; pointer-events: none; }
@media (prefers-color-scheme: dark) { .hero .art { opacity: .28; } }
.hero > * { position: relative; }
.hero .streak { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.hero .streak small { font-size: .95rem; font-weight: 500; color: var(--fg2); margin-left: .35rem; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--bg3); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }
.start-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.start-buttons button { min-height: 92px; font-size: 1.05rem; font-weight: 700; border-radius: 16px; background: var(--accent); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; }
.start-buttons button span { font-size: 2rem; line-height: 1; }
.start-buttons button small { font-weight: 500; opacity: .9; }
.levels { display: flex; gap: 3px; height: 14px; border-radius: 6px; overflow: hidden; background: var(--bg3); }
.levels div { transition: flex .4s; }
.levels .l0 { background: var(--l0); } .levels .l1 { background: var(--l1); } .levels .l2 { background: var(--l2); }
.levels .l3 { background: var(--l3); } .levels .l4 { background: var(--l4); } .levels .l5 { background: var(--l5); }
.level-legend { display: flex; justify-content: space-between; font-size: .72rem; color: var(--fg2); margin-top: .25rem; }
.level-legend span { display: flex; flex-direction: column; align-items: center; min-width: 2.4em; }
.level-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; margin-bottom: 2px; }
.level-legend span:nth-child(1)::before { background: var(--l0); } .level-legend span:nth-child(2)::before { background: var(--l1); }
.level-legend span:nth-child(3)::before { background: var(--l2); } .level-legend span:nth-child(4)::before { background: var(--l3); }
.level-legend span:nth-child(5)::before { background: var(--l4); } .level-legend span:nth-child(6)::before { background: var(--l5); }

/* Tafel */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
@media (max-width: 600px) { .board { grid-template-columns: 1fr; } }
.board .photo { background: var(--bg3); border-radius: 12px; overflow: hidden; position: relative; transition: box-shadow .5s, outline-color .5s; outline: 3px solid transparent; }
.board .photo.new { outline-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 30%, transparent); }
.board .photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #000; cursor: zoom-in; }
.board .photo .meta { padding: .5rem .6rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .85rem; }
.board .photo .actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .6rem .6rem; }
.board .empty { grid-column: 1 / -1; }
.empty { padding: 1.5rem; text-align: center; color: var(--fg2); border: 1px dashed var(--line); border-radius: 12px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 400; display: flex; flex-direction: column; }
.lightbox .bar { display: flex; gap: .5rem; padding: .6rem; align-items: center; color: #fff; }
.lightbox .bar button { background: rgba(255,255,255,.15); color: #fff; }
.lightbox .stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pan-x pan-y pinch-zoom; }
.lightbox .stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .15s; transform-origin: center center; }
.lightbox .stage.zoomed { display: block; }
.lightbox .stage.zoomed img { max-width: none; max-height: none; width: 200%; }

/* Termine */
.deadline .days { font-weight: 800; font-size: 1.3rem; min-width: 3.2em; text-align: center; }
.deadline .days.soon { color: var(--bad); }
.deadline .days small { display: block; font-size: .65rem; font-weight: 500; color: var(--fg2); }

/* Quiz */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.6rem; }
.countdown.warn { color: var(--bad); }
.qcard { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.qcard .prompt { font-size: 1.2rem; font-weight: 600; margin: .5rem 0 1rem; white-space: pre-wrap; }
.options { display: grid; gap: .6rem; }
.option { display: flex; gap: .75rem; align-items: center; text-align: left; width: 100%; padding: .9rem 1rem; border-radius: 12px;
  background: var(--bg3); border: 2px solid transparent; min-height: 56px; font-size: 1.02rem; }
.option .box { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--fg2); flex: none; display: grid; place-items: center; font-size: .8rem; }
.option.multi .box { border-radius: 6px; }
.option.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg3)); }
.option.sel .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.option.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, var(--bg3)); }
.option.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--bg3)); }
.option.missed { border-color: var(--ok); border-style: dashed; }
.gap-input { display: inline-block; width: 9em; min-height: 40px; padding: .3rem .5rem; margin: 0 .2rem; }
.feedback { margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; }
.feedback.ok { background: color-mix(in srgb, var(--ok) 15%, var(--bg2)); }
.feedback.bad { background: color-mix(in srgb, var(--bad) 15%, var(--bg2)); }
.feedback .lvl { font-size: .85rem; color: var(--fg2); }
.explain { margin-top: .75rem; padding: .9rem 1rem; border-radius: 12px; background: var(--bg3); font-size: .95rem; }
.explain p { margin: .3rem 0; }
.quiz-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.quiz-actions .btn-primary { flex: 1 1 200px; min-height: 52px; font-size: 1.05rem; }
.summary .big { font-size: 3rem; font-weight: 800; }
.fallen li { flex-direction: column; align-items: flex-start; gap: .2rem; }
.exam-progress { display: flex; gap: .3rem; flex-wrap: wrap; }
.exam-progress span { width: 22px; height: 22px; border-radius: 6px; background: var(--bg3); display: grid; place-items: center; font-size: .7rem; cursor: pointer; }
.exam-progress span.done { background: var(--accent); color: #fff; }
.exam-progress span.cur { outline: 2px solid var(--fg); }

/* Listen: Notizen, Dateien, Fragen */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.filters > * { flex: 1 1 150px; min-width: 120px; }
.note-item { cursor: pointer; }
.note-body { white-space: pre-wrap; }
.md img { max-width: 100%; } .md pre { overflow: auto; background: var(--bg3); padding: .6rem; border-radius: 8px; }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: .2rem .5rem; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.25rem; text-align: center; color: var(--fg2); background: var(--bg2); }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); }
.dropzone input[type=file] { display: none; }
.thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg3); flex: none; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--fg2); }
.qlist li { flex-direction: column; align-items: stretch; gap: .35rem; }
.qlist .qhead { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qlist .qprompt { font-weight: 600; }
.qlist .qopts { margin: 0; padding-left: 1.2rem; font-size: .9rem; color: var(--fg2); }
.qlist .qopts .ok { color: var(--ok); font-weight: 600; }
.lvl-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; font-size: .8rem; font-weight: 700; }
.chapter-row { padding-left: 1.25rem; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .modal-bg { align-items: center; } }
.modal { background: var(--bg2); border-radius: 18px 18px 0 0; width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; padding: 1.1rem; }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.modal h2 { display: flex; align-items: center; }
.modal h2 .close { margin-left: auto; }
.subject-icon { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg3); }
.subject-icon.ph { display: grid; place-items: center; color: #fff; font-weight: 800; }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: .3rem 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 25%, transparent); } 100% { background: transparent; } }
.flash { animation: flash 2.5s ease-out; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.login .box { width: 100%; max-width: 400px; background: var(--bg2); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.login .hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--bg3); }
.login form { padding: 1.25rem; }
.login button { width: 100%; min-height: 50px; }
.login .err { color: var(--bad); min-height: 1.4em; margin: .5rem 0 0; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero .start-buttons { width: 100%; }
}

/* Lernplan */
.plan-item { padding: .6rem 0; border-top: 1px solid var(--line); }
.plan-item:first-of-type { border-top: 0; }
.plan-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.plan-today { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.plan-today .row.tight { flex: 0 0 auto; }
.pill.soon { background: color-mix(in srgb, var(--bad) 18%, var(--bg3)); color: var(--bad); font-weight: 600; }
.plan-days li.today { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 10px; padding-left: .4rem; padding-right: .4rem; }
.plan-days li.done .plan-date strong { color: var(--ok); }
.plan-days li.exam .plan-date strong { color: var(--bad); }
.plan-date { min-width: 3.4em; text-align: center; line-height: 1.1; }
.plan-date small { display: block; font-size: .65rem; color: var(--fg2); }
.mini-bar { flex: 0 0 120px; height: 8px; border-radius: 999px; background: var(--bg3); overflow: hidden; }
.mini-bar > div { height: 100%; background: var(--accent); border-radius: 999px; }

/* Stundenplan */
.timetable h2 .right { display: flex; gap: .25rem; }
.lessons li.now { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; padding-left: .4rem; padding-right: .4rem; }
.lessons .time { min-width: 3.6em; text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lessons .time small { display: block; font-size: .7rem; color: var(--fg2); }

/* Bilder in Notizen */
textarea.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg2)); }
.img-tools { margin-top: .35rem; }

/* Karteikarte */
.flashcard { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 1.25rem; border-radius: 16px; cursor: pointer;
  background: var(--bg3); border: 2px solid var(--line); transition: transform .35s, background .35s; perspective: 800px; user-select: none; }
.flashcard:hover { border-color: var(--accent); }
.flashcard .face .prompt { font-size: 1.35rem; margin: 0 0 .5rem; }
.flashcard .hint { margin-top: .5rem; }
.flashcard.flipped { background: color-mix(in srgb, var(--ok) 12%, var(--bg2)); border-color: var(--ok); cursor: default; animation: flip .35s ease-out; }
.flashcard .answer { font-size: 1.2rem; font-weight: 600; white-space: pre-wrap; margin: .3rem 0 .5rem; }
@keyframes flip { 0% { transform: rotateY(90deg); opacity: .2; } 100% { transform: rotateY(0); opacity: 1; } }

/* Dokument-Viewer */
.viewer .viewer-stage { flex: 1; overflow: auto; background: #3a3d45; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.viewer canvas.page { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.5); max-width: 100%; height: auto; }
.viewer .viewer-text { width: 100%; max-width: 900px; background: var(--bg2); color: var(--fg); border-radius: 12px; padding: 1rem; }
.viewer .viewer-text pre { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: .85rem; margin: 0; }

/* Import-Dialog */
.steps { display: grid; gap: .5rem; margin-bottom: .75rem; }
.step { padding: .6rem .75rem; border-radius: 10px; background: var(--bg3); }

/* Statistik */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.kpi { background: var(--bg2); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; }
.kpi .v { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .8rem; color: var(--fg2); margin-top: .2rem; }
.hm-wrap { overflow-x: auto; padding-bottom: .25rem; }
.hm { display: inline-flex; flex-direction: column; gap: 3px; min-width: 100%; }
.hm-months, .hm-body { display: flex; gap: 3px; }
.hm-months > div { width: 13px; font-size: .65rem; color: var(--fg2); overflow: visible; white-space: nowrap; }
.hm-days { display: flex; flex-direction: column; gap: 3px; width: 22px !important; flex: none; }
.hm-days > div { height: 13px; font-size: .65rem; color: var(--fg2); line-height: 13px; }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg3); display: inline-block; }
.hm-cell.future { background: transparent; }
.hm-cell.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--bg3)); }
.hm-cell.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--bg3)); }
.hm-cell.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--bg3)); }
.hm-cell.l4 { background: var(--accent); }
.hm-cell.today { outline: 2px solid var(--fg); outline-offset: -1px; }
.hm-legend { display: flex; align-items: center; gap: 3px; margin-top: .5rem; }
.chart-wrap { overflow-x: auto; }
.chart svg { width: 100%; min-width: 520px; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { font-size: 11px; fill: var(--fg2); font-family: inherit; }
.chart .lbl.dl { fill: var(--fg); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .5rem; font-size: .85rem; }
.legend i, .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.table-wrap { overflow-x: auto; }
.stat-table { border-collapse: collapse; font-size: .85rem; width: 100%; }
.stat-table th, .stat-table td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; text-align: left; white-space: nowrap; }
.stat-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { nav.bottom a { font-size: .62rem; } }
.round-progress { margin-bottom: .75rem; }
.round-progress > div { background: var(--accent); }
.lessons li.cancelled .grow > div:first-child strong { text-decoration: line-through; color: var(--fg2); }
.lessons .lesson-actions { flex: 0 0 auto; }
.tag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, var(--bg3)); margin-left: .4rem; }
@media (max-width: 600px) { .lessons li { flex-wrap: wrap; } .lessons .lesson-actions { width: 100%; justify-content: flex-end; } }
/* Stundenplan-Raster */
.tt-grid { position: relative; margin-left: 44px; border-left: 1px solid var(--line); }
.tt-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.tt-hour span { position: absolute; left: -44px; top: -.55em; width: 40px; text-align: right; font-size: .7rem; color: var(--fg2); font-variant-numeric: tabular-nums; }
.tt-block { position: absolute; box-sizing: border-box; border-radius: 6px; padding: 3px 6px; overflow: hidden; cursor: pointer; font-size: .8rem; line-height: 1.2;
  background: var(--bg3); border-left: 4px solid var(--fg2); }
.tt-block.known { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg3)); }
.tt-block.now { outline: 2px solid var(--accent); }
.tt-block.cancelled { background: color-mix(in srgb, var(--bad) 12%, var(--bg3)); border-left-color: var(--bad); }
.tt-block.cancelled .tt-code { text-decoration: line-through; color: var(--fg2); }
.tt-block .tt-x { text-decoration: none; color: var(--bad); font-weight: 500; font-size: .7rem; }
.tt-code { font-weight: 700; }
.tt-room { color: var(--fg2); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-now { position: absolute; left: -6px; right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.tt-now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

.quiz, .stats { max-width: 1100px; margin: 0 auto; }
.stats .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.card.full { grid-column: 1 / -1; }
.board .photo { max-width: 420px; }
