/* Copyright (c) 2026 MF Funktechnik GbR, Michael Fritsch. Alle Rechte vorbehalten.
   Nutzung nur mit schriftlicher Erlaubnis des Rechteinhabers (siehe LIZENZ.txt). */
/* Feuerwehr-Lernportal – helles, freundliches Design
   Layout: eine ruhige Spalte für Teilnehmende (Handy zuerst), breiter Arbeitsbereich für Admins.
   Akzent: Signalrot der Feuerwehr, ergänzt um Warnstreifen-Gelb als Erkennungsdetail. */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #1b2333;
  --ink-2: #3a4458;
  --muted: #667085;
  --line: #e2e8f0;
  --line-2: #cfd8e3;
  --red: #d7261e;
  --red-ink: #b31d16;
  --red-soft: #fff0ee;
  --sun: #ffc533;
  --sun-soft: #fff7dd;
  --ok: #18874a;
  --ok-soft: #e7f6ed;
  --bad: #c42b2b;
  --bad-soft: #fdeeee;
  --info: #2459c7;
  --info-soft: #ebf1fe;
  --shadow: 0 1px 2px rgba(27, 35, 51, .06), 0 4px 16px rgba(27, 35, 51, .06);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; }
a { color: var(--info); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Kopfzeile mit Warnstreifen ---------- */
.topbar {
  background: var(--red);
  color: #fff;
  position: relative;
}
.topbar::after {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--sun) 0 12px, #fff 12px 24px);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; color: #fff; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: #fff;
  display: grid; place-items: center; flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title { font-weight: 800; font-size: 1.02rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .8rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 0; }
.topbar-inner { flex-wrap: nowrap; }
.topbar-inner > .btn, .topbar-inner > #user-box { flex: none; }
.divider { border-top: 1px solid var(--line); }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.12); }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wrap.wide { max-width: 1100px; }

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-head > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Knöpfe ---------- */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.2;
  min-height: 44px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f0c4c4; }
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 12px 20px; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); font: inherit; cursor: pointer; text-decoration: underline; }

/* ---------- Formulare ---------- */
label { font-weight: 600; font-size: .92rem; display: flex; flex-direction: column; gap: 6px; }
label.inline { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--font-num); font-size: .88rem; min-height: 320px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--red); flex: none; margin-top: 2px; }
.code-input { font-family: var(--font-num); font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }

/* ---------- Pillen und Chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.warn { background: var(--sun-soft); color: #8a5a00; border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lg-badge {
  align-self: flex-start; max-width: 100%;
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem;
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.lg-badge .sw { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .62rem; font-weight: 800; }

/* ---------- Fortschritt ---------- */
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }
.bar.red > span { background: var(--red); }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center; }
.ring > span { width: 66px; height: 66px; border-radius: 50%; background: var(--surface); display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ---------- Teilnehmenden-Ansicht ---------- */
.hero-join { text-align: left; }
.hero-join h1 { font-size: 1.75rem; }
.action-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; font: inherit; color: inherit;
  box-shadow: var(--shadow); min-width: 0;
}
.tile:hover { border-color: var(--red); }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tile .ico.red { background: var(--red-soft); color: var(--red); }
.tile .ico.sun { background: var(--sun-soft); color: #9a6400; }
.tile .ico.ok { background: var(--ok-soft); color: var(--ok); }
.tile b { display: block; font-size: 1rem; }
.tile:disabled { opacity: .6; cursor: default; }
.tile:disabled:hover { border-color: var(--line); }

.modlist { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.moditem {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
}
.moditem:hover { border-color: var(--red); }
.modnum { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; color: var(--ink-2); }
.moditem.done .modnum { background: var(--ok); color: #fff; border-color: var(--ok); }
.moditem .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.moditem .title { font-weight: 700; }
.moditem .chev { color: var(--muted); flex: none; }

.lesson { font-size: 1.02rem; color: var(--ink); max-width: 65ch; }
.lesson h2 { font-size: 1.22rem; margin: 1.4em 0 .5em; }
.lesson h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
.lesson > :first-child { margin-top: 0; }
.lesson p { margin: .6em 0; }
.lesson ul { margin: .5em 0; padding-left: 1.3em; }
.lesson li { margin: .3em 0; }
.lesson li::marker { color: var(--red); }
.lesson strong { font-weight: 700; }

/* Quiz */
.qhead { display: flex; align-items: center; gap: 12px; }
.qhead .bar { flex: 1; }
.question { font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer;
  font: inherit; color: inherit; font-weight: 500;
}
.option:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.option.sel { border-color: var(--red); background: var(--red-soft); }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option:disabled { cursor: default; }
.option .mark { width: 24px; height: 24px; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center;
  background: var(--surface); margin-top: 1px; }
.option .mark.radio { border-radius: 50%; }
.option .mark.check { border-radius: 6px; }
.option.sel .mark { border-color: var(--red); background: var(--red); color: #fff; }
.option.correct .mark { border-color: var(--ok); background: var(--ok); color: #fff; }
.option.wrong .mark { border-color: var(--bad); background: var(--bad); color: #fff; }
.feedback { border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.feedback.ok { background: var(--ok-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback .fb-title { font-weight: 800; }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.bad .fb-title { color: var(--bad); }
.sticky-actions {
  position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent);
  padding-top: 16px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px;
}
.sticky-actions .btn { flex: 1; }

.timer {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px;
}
.timer .t { font-family: var(--font-num); font-size: 1.15rem; font-weight: 700; }
.timer.low { background: var(--bad); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.qgrid button { min-height: 40px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--surface);
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.qgrid button.answered { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.qgrid button.current { outline: 3px solid var(--sun); }

.result-big { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.result-big .pct { font-size: 3rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1; }

.codebox { font-family: var(--font-num); font-size: 1.6rem; font-weight: 700; letter-spacing: .15em;
  background: var(--sun-soft); border: 2px dashed var(--sun); border-radius: 12px; padding: 12px; text-align: center; }

/* ---------- Admin ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; font: inherit; font-weight: 650;
  color: var(--muted); cursor: pointer; margin-bottom: -1px;
}
.tabs button.active { color: var(--red); border-bottom-color: var(--red); }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: .85rem; color: var(--muted); }

.kurslist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kurscard { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.kurscard:hover { border-color: var(--red); }
.kurscard.gesperrt, .kurscard.archiviert { background: var(--surface-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
td.wrap-cell { white-space: normal; min-width: 240px; }
.heat { display: flex; gap: 3px; }
.heat span { width: 16px; height: 16px; border-radius: 4px; background: var(--line); }

.qr-panel { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-panel canvas { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px; width: 200px; height: 200px; image-rendering: pixelated; flex: none; }
.qr-panel .grow { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.linkfield { font-family: var(--font-num); font-size: .88rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; word-break: break-all; user-select: all; }

.qr-full { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); text-align: center; color: #111; }
.qr-full canvas { width: min(70vh, 86vw); height: min(70vh, 86vw); image-rendering: pixelated; }
.qr-full .big { font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 800; }
.qr-full .codeline { font-family: var(--font-num); font-size: clamp(1rem, 2.4vw, 1.5rem); }

.editor-answers { display: flex; flex-direction: column; gap: 8px; }
.ans-row { display: flex; gap: 8px; align-items: center; }
.ans-row input[type=text] { flex: 1; min-width: 0; }
.ans-row .right { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; white-space: nowrap; }

.qitem { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.qitem.inactive { opacity: .6; background: var(--surface-2); }
.qitem ul { margin: 0; padding-left: 1.2em; }
.qitem li.r { color: var(--ok); font-weight: 600; }

.log { font-size: .85rem; }
.log td { white-space: normal; }

.authbox { max-width: 460px; width: 100%; margin: 0 auto; }
.secret { font-family: var(--font-num); font-size: 1rem; letter-spacing: .08em; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.qr-setup { display: flex; justify-content: center; }
.qr-setup canvas { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; }
.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.color-input { width: 64px; height: 44px; padding: 2px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); }

/* Dialog */
.overlay { position: fixed; inset: 0; background: rgba(20, 27, 40, .45); z-index: 40; display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.dialog { background: var(--surface); border-radius: 16px; width: 100%; max-width: 640px; padding: 22px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); margin-top: 4vh; }
.dialog.small { max-width: 440px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.toast-host { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 520px; font-weight: 550; pointer-events: auto; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.notice { background: var(--sun-soft); border: 1px solid #f3dc9a; border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.notice.info { background: var(--info-soft); border-color: #cbd9fb; }
.notice.bad { background: var(--bad-soft); border-color: #f2c7c7; }
.foot { text-align: center; font-size: .8rem; color: var(--muted); padding-bottom: 24px; }

@media (max-width: 560px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
  .brand-sub { max-width: 52vw; }
  .qr-panel canvas { width: 160px; height: 160px; }
}

@media print {
  .topbar, .tabs, .no-print, .toast-host { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Rechtliche Seiten ---------- */
.legal { max-width: 72ch; gap: 10px; }
.legal h2 { font-size: 1.12rem; margin-top: 18px; }
.legal h3 { font-size: 1rem; margin-top: 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.legal .lead { color: var(--ink); font-size: 1.02rem; }
.ds-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ds-missing { background: var(--sun-soft); border: 1px dashed var(--sun); border-radius: 10px; padding: 10px 12px; color: #7a5200; font-weight: 600; }
.ds-stand { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.legal-links { display: flex; gap: 18px; justify-content: center; font-size: .85rem; padding-block: 8px 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.legal-links a { color: var(--muted); }

/* ---------- Bibliothek ---------- */
.doclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.docitem { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.docitem.inactive { opacity: .6; background: var(--surface-2); }
.docitem .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.docitem .grow .row { margin-top: 6px; }
.docnum { flex: none; min-width: 74px; text-align: center; font-weight: 800; font-size: .82rem; letter-spacing: .02em;
  color: var(--red); background: var(--red-soft); border-radius: 8px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .docitem { flex-direction: column; gap: 8px; } .docnum { min-width: 0; } }

/* ---------- Lizenz ---------- */
.legal-links { flex-wrap: wrap; }
.legal-links .copyright { color: var(--muted); flex-basis: 100%; text-align: center; }
.license-text { white-space: pre-wrap; word-break: break-word; font-family: var(--font-num); font-size: .82rem; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0; color: var(--ink-2); }
.doclist.mine .docitem { border-color: #f3c3bf; border-left: 4px solid var(--red); }

/* ---------- Schritt-Listen und Bilder in Lerninhalten ---------- */
.lesson ol.steps-list { list-style: none; counter-reset: step; padding-left: 0; margin: .6em 0; display: flex; flex-direction: column; gap: 8px; }
.lesson ol.steps-list li { counter-increment: step; position: relative; padding-left: 42px; min-height: 30px; margin: 0; }
.lesson ol.steps-list li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 800; font-size: .9rem; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.lesson-img { margin: 1em 0; display: flex; flex-direction: column; gap: 6px; }
.lesson-img img { width: 100%; max-width: 520px; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.lesson-img figcaption { font-size: .85rem; color: var(--muted); }
.lesson ol.steps-list li .lesson-img { margin: .6em 0 .4em; }
.img-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.img-slot { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.img-slot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); display: block; }
.img-slot-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.img-slot-body p { margin: 0; }
