:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --text: #16212e;
  --muted: #5b6878;
  --line: #dde3ea;
  --primary: #2c3d86;
  --primary-2: #3a4fa3;
  --accent: #4a63bf;
  --ok: #1b7f4b;
  --ok-bg: #e5f5ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #9a5b00;
  --warn-bg: #fff4dd;
  --info-bg: #e8f1fb;
  --head: #d6e4f0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 33, 54, .06), 0 4px 16px rgba(16, 33, 54, .06);
  --side: 248px;
  --side-bg: #1f2a5c;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--primary-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.stack > * + * { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: #e7eef7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; }
.brand { flex-wrap: wrap; }
.brand img.mark { width: 36px; height: 36px; }
.brand .logobox { width: 100%; background: #fff; border-radius: 10px; padding: 10px 12px; text-align: center; }
.brand .logobox img { max-width: 100%; max-height: 96px; display: inline-block; }
.logoprev { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.logoprev img { max-height: 80px; max-width: 280px; display: block; }
.brand b { display: block; font-size: .95rem; line-height: 1.2; color: #fff; }
.brand span { font-size: .75rem; opacity: .75; }
.nav { padding: 6px 10px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #dbe6f2; text-decoration: none; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .sep { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; }
.me { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; }
.me b { display: block; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.me button { margin-top: 8px; background: transparent; color: #dbe6f2; border: 1px solid rgba(255,255,255,.3); padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1180px; width: 100%; }
.topbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 50; transform: translateX(-102%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .scrim { position: fixed; inset: 0; background: rgba(10,20,30,.4); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: var(--side-bg); color: #fff; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .topbar svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .topbar b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main { padding: 18px 14px 80px; }
  h1 { font-size: 1.35rem; }
}

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flat { box-shadow: none; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.pagehead { margin-bottom: 20px; }
.pagehead p { color: var(--muted); margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--primary); color: #fff; min-height: 44px; }
.btn:hover { background: var(--primary-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--primary); border-color: var(--line); }
.btn.sec:hover { background: var(--surface-2); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--bad); }
.btn.ghost { background: transparent; color: var(--primary-2); border: 0; padding: 8px 10px; min-height: 36px; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .9rem; }
.btn.wide { width: 100%; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; border: 1px solid #c8d1dc; border-radius: 9px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .opt:focus-within { outline: 3px solid rgba(74,99,191,.35); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; margin: 0; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 9px; padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.note { background: var(--info-bg); border-radius: 9px; padding: 12px 14px; font-size: .92rem; }
.note.warn { background: var(--warn-bg); color: #5c3b00; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #e9eef4; color: #3a4757; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--primary-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--primary); border-color: var(--accent); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--head); font-size: .82rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f5f8fb; }
td.qtext { max-width: 520px; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar { height: 8px; background: #e6ebf1; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.low i { background: #d9822b; }
.bar.vlow i { background: var(--bad); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.6rem; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }

/* ---------- Fragen beantworten ---------- */
.runner { max-width: 820px; margin: 0 auto; }
.runhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; }
.timer.low { background: var(--bad-bg); color: var(--bad); border-color: #f3c4bf; }
.progress { height: 6px; background: #e3e9f0; border-radius: 99px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--accent); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(16px, 3vw, 28px); }
.qmeta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .85rem; margin-bottom: 10px; flex-wrap: wrap; }
.qtext-big { font-size: 1.12rem; font-weight: 600; white-space: pre-wrap; margin-bottom: 16px; }
.qimg { max-width: 100%; max-height: 380px; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 16px; display: block; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; font-weight: 400; margin: 0; transition: border-color .1s, background .1s; }
.opt:hover { border-color: #b5c3d3; }
.opt input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.opt.sel { border-color: var(--primary-2); background: #f1f6fc; }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.missed { border-color: var(--ok); border-style: dashed; }
.opt .tag { margin-left: auto; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.feedback { margin-top: 16px; border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback .expl { font-weight: 400; color: var(--text); margin-top: 6px; white-space: pre-wrap; }
.runnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 18px; }
.qgrid button { min-height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); }
.qgrid button.done { background: #e2ecf8; color: var(--primary); border-color: #c4d6ec; }
.qgrid button.cur { outline: 3px solid var(--accent); outline-offset: 1px; }
.result { text-align: center; padding: 28px 16px; }
.result .big { font-size: 3rem; font-weight: 800; line-height: 1; margin: 10px 0; }
.result .big.ok { color: var(--ok); }
.result .big.bad { color: var(--bad); }

/* ---------- Editor ---------- */
.optedit { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.optedit .ok { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; white-space: nowrap; margin: 0; }
.optedit .ok input { width: 20px; height: 20px; accent-color: var(--ok); }
.versions .v { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.imp-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.imp-item.problem { border-color: #f0b4ad; background: #fffafa; }
.imp-item .opts-mini { margin: 8px 0 0; display: grid; gap: 4px; }
.imp-item .opts-mini label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .92rem; }
.imp-item .opts-mini input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--ok); }

/* ---------- Dialog und Hinweis ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: #fff; border-radius: 14px; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 760px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; background: var(--surface-2); border: 1px dashed #b9c4d0; border-radius: 9px; padding: 12px; text-align: center; user-select: all; letter-spacing: .05em; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1d2a3a; color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 200; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--side-bg) 0%, var(--primary) 60%, var(--accent) 130%); }
.authbox { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; }
.authbox .head { padding: 24px 26px 14px; display: flex; gap: 14px; align-items: center; }
.authbox .head img { width: 46px; height: 46px; }
.authbox .head.haslogo { flex-direction: column; align-items: flex-start; }
.authbox .head.haslogo { align-items: center; text-align: center; }
.authbox .head.haslogo img { width: auto; height: auto; max-width: 200px; max-height: 130px; }
.authbox .head b { display: block; font-size: 1.15rem; line-height: 1.25; }
.authbox .head span { color: var(--muted); font-size: .85rem; }
.authbox form { padding: 8px 26px 26px; }

/* ---------- Protokoll / Druck ---------- */
.prot-q { border-top: 1px solid var(--line); padding: 14px 0; break-inside: avoid; }
.prot-q .o { display: flex; gap: 8px; padding: 3px 0; font-size: .95rem; }
.prot-q .o .m { width: 64px; flex: none; font-size: .8rem; font-weight: 700; }
.prot-q .o.r .m { color: var(--ok); }
.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; word-break: break-all; color: var(--muted); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; }
@media print {
  .side, .topbar, .noprint, #toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* Kopftabelle wie in den QM-Dokumenten */
table.meta { border: 1px solid #9fb3c8; margin: 16px 0; font-size: .9rem; }
table.meta th, table.meta td { border: 1px solid #9fb3c8; padding: 6px 10px; }
table.meta th { background: var(--head); width: 16%; white-space: normal; }
table.meta td { background: #fff; width: 34%; font-weight: 600; }
.doctitle { border-bottom: 3px solid var(--primary); padding-bottom: 8px; }
@media print { body { font-size: 9pt; } table.meta { font-size: 9pt; } .qimg { max-height: 160px !important; } }

/* ---------- Prüfungsbogen / Lösungsbogen ---------- */
.printdoc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 900px; margin: 0 auto; font-size: 10.5pt; line-height: 1.45; }
.pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--primary); padding-bottom: 8px; }
.pd-head h1 { margin: 2px 0; font-size: 1.5rem; }
.pd-head img { max-height: 70px; max-width: 160px; }
.pd-title { font-weight: 700; color: var(--primary); }
td.blank { height: 26px; }
td.sign { height: 46px; }
.pd-hint { font-size: 9pt; color: var(--muted); border-left: 3px solid var(--head); padding: 4px 10px; margin: 6px 0 10px; }
.pd-q { border-top: 1px solid #9fb3c8; padding: 10px 0 12px; break-inside: avoid; page-break-inside: avoid; }
.pd-qh { display: flex; gap: 12px; align-items: baseline; margin-bottom: 4px; }
.pd-qh span { color: var(--muted); font-size: 9pt; }
.pd-qh .pd-score { margin-left: auto; color: var(--text); }
.pd-text { white-space: pre-wrap; margin-bottom: 6px; }
.pd-img { max-width: 100%; max-height: 7cm; display: block; margin: 6px 0; }
.pd-opts { display: grid; gap: 3px; }
.pd-opt { display: flex; gap: 8px; align-items: flex-start; }
.pd-opt .box { font-size: 13pt; line-height: 1; width: 18px; flex: none; }
.pd-opt.ok { color: var(--ok); font-weight: 700; }
.pd-lines div { border-bottom: 1px solid #9aa6b4; height: var(--pdlh, 8mm); }
.pd-sol { background: var(--ok-bg); border-radius: 6px; padding: 6px 10px; margin: 6px 0; white-space: pre-wrap; }
.pd-end { margin-top: 18px; break-inside: avoid; }
@page { size: A4; margin: 15mm 15mm 12mm; }
@media print {
  .printdoc { border: 0; padding: 0; max-width: none; font-size: 10pt; }
  .pd-head img { max-height: 60px; }
}

ul.hints { margin: 6px 0 12px; padding-left: 0; list-style: none; }
ul.hints li { position: relative; padding-left: 22px; margin-bottom: 9px; }
ul.hints li::before { content: "●"; position: absolute; left: 3px; top: 0; color: #8a94a3; font-size: .8em; line-height: 1.8; }
ul.hints li.decl::before { content: "▶"; color: #8a94a3; font-size: .85em; line-height: 1.6; }
.pd-cover { margin-top: 14px; }
.pd-cover h3 { font-size: 11pt; margin: 0 0 6px; }
.pd-cov { break-after: page; page-break-after: always; }
.pd-cover-end { margin-top: 4px; }
.pd-endh { margin: 12px 0 4px; font-size: 10.5pt; }
.pd-cov .pd-end { margin-top: 0; }
.modal ul.hints { font-size: .92rem; }

* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

.pd-meta, .pd-cover-end, .pd-end { table-layout: fixed; width: 100%; }
.pd-meta th, .pd-meta td, .pd-cover-end th, .pd-end th { vertical-align: middle; width: auto; }
.pd-meta td.big { height: 62px; }
.pd-meta td.mid { height: 42px; }
.pd-end td.sign { height: 56px; }
.pd-sub { font-weight: 400; font-size: 8pt; color: var(--muted); }
.pd-end th { width: 22%; }
.pd-cover-end td.blank { height: 42px; }
input[readonly] { background: var(--surface-2); color: var(--muted); }

.pd-opts-inline { display: flex; gap: 28px; flex-wrap: wrap; margin: 4px 0 2px 4px; }
.pd-opts-inline .pd-opt { display: inline-flex; gap: 6px; align-items: center; }

.chip { display: inline-flex; gap: 4px; align-items: baseline; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.chip b { color: var(--primary); }
.chip.on { background: var(--head); border-color: #b7cbe0; }

/* Fragen durchblättern: Miniaturansicht */
.thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 12px; scroll-snap-type: x proximity; }
.thumb { flex: none; width: 150px; height: 150px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); overflow: hidden; scroll-snap-align: center; position: relative; }
.thumb:hover { border-color: #b7cbe0; }
.thumb.on { border-color: var(--primary); background: #f1f6fc; box-shadow: 0 0 0 2px rgba(44, 61, 134, .15); }
.thumb .tn { font-weight: 700; color: var(--primary); font-size: .9rem; display: flex; justify-content: space-between; align-items: baseline; }
.thumb .tn small { color: var(--muted); font-weight: 400; font-size: .72rem; }
.thumb img { width: 100%; height: 44px; object-fit: contain; background: #fff; border-radius: 4px; }
.thumb .tt { font-size: .74rem; line-height: 1.25; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.thumb img + .tt { -webkit-line-clamp: 3; }
.thumb .tb { margin-top: auto; display: flex; gap: 6px; align-items: center; font-size: .7rem; }
.thumb .d { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ok); }
.thumb .d.warn { background: #d99a00; } .thumb .d.bad { background: var(--bad); }
.thumb .ts { color: var(--bad); } .thumb .tf { color: var(--primary-2); font-weight: 600; }
.qcard.browse .qimg { max-height: 460px; }
@media (max-width: 640px) { .thumb { width: 116px; height: 120px; } }
.bnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: nowrap; }
.bnav b { text-align: center; }
@media (max-width: 640px) { .bnav .btn span { display: none; } .bnav .btn { padding-left: 16px; padding-right: 16px; } }
.qnav { position: sticky; top: 0; z-index: 5; background: var(--bg, #f3f6fa); padding: 8px 0; margin: -8px 0 8px; }
.qnav > span { text-align: center; }
.editgrid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); align-items: start; }
@media (max-width: 900px) { .editgrid { grid-template-columns: minmax(0, 1fr); } .qnav { top: 52px; } }

/* Themen-Auswahl mit Chips */
.tpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tpick .chip { padding: 4px 6px 4px 12px; align-items: center; }
.tpick .chip .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 2px 6px; border-radius: 50%; line-height: 1; }
.tpick .chip .x:hover { background: rgba(0,0,0,.08); color: var(--bad); }
.tpick select { max-width: 260px; width: auto; }
details.topicchips summary { cursor: pointer; color: var(--primary-2); font-size: .9rem; margin-bottom: 4px; }
details.topicchips:not([open]) { margin-bottom: 12px; }

/* Übungsfreigabe */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; margin: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 12px; background: #c9d3df; position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 21px; }
.switch input:disabled { opacity: .45; cursor: not-allowed; }
.switch input:checked + span { color: var(--ok); }
.switch input:not(:checked) + span { color: var(--muted); }
.qpick { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
.qpick img { max-width: 140px; max-height: 70px; object-fit: contain; border-radius: 4px; border: 1px solid var(--line); }
.qpick:has(input:not(:checked)) { opacity: .65; background: #f6f7f9; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; margin: 16px -4px 0; box-shadow: 0 -4px 12px rgba(0,0,0,.05); border-radius: 10px 10px 0 0; }

/* Prüfungsarten */
.badge.kind { background: #e8eefb; color: var(--primary); }
button.chip { cursor: pointer; font: inherit; font-size: .85rem; }
.kindrow .chip { padding: 4px 10px; }
.thumb .tk { color: var(--primary); font-weight: 600; }

/* Auswahl im Fragenpool / Prüfungsarten je Thema */
.selbar { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0; gap: 10px; }
.selbar #selinfo { flex: 1 1 260px; }
tr.sel td { background: #eef3fb; }
td.selcell { cursor: pointer; width: 36px; }
.kindtab th.c, .kindtab td.c { text-align: center; }
.kcell { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; margin: 0; font-size: .75rem; color: var(--muted); }
.kcell input { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }
.kcell.part input { outline: 2px dashed #d99a00; outline-offset: 1px; }
.kcell.part span { color: #a86f00; font-weight: 600; }
.kcell.all span { color: var(--primary); font-weight: 600; }
@media (max-width: 900px) { .selbar { top: 52px; } }

/* Reihenfolge, Zuordnung, Lückentext */
.ordlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ordlist li { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.ordlist li[draggable="true"] { cursor: grab; }
.ordlist li.drag { opacity: .5; }
.ordlist li.over { border-color: var(--primary-2); background: #f1f6fc; }
.ordlist li.right { border-color: var(--ok); background: var(--ok-bg); }
.ordlist li.wrong { border-color: var(--bad); background: var(--bad-bg); }
.ordlist .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--head); color: var(--primary); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ordlist .ordbtn { display: flex; gap: 4px; flex: none; }
.ordlist .tag { font-size: .8rem; font-weight: 700; color: var(--bad); white-space: nowrap; }
.matchtab { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.mrow.right { border-color: var(--ok); background: var(--ok-bg); }
.mrow.wrong { border-color: var(--bad); background: var(--bad-bg); }
.mrow .ml { font-weight: 600; }
.mrow select { width: 100%; }
@media (max-width: 640px) { .mrow { grid-template-columns: 1fr; } }
.gaptext { line-height: 2.3; white-space: pre-wrap; }
.gapw { display: inline-flex; flex-direction: column; vertical-align: baseline; }
.gapw input { display: inline-block; width: auto; padding: 2px 8px; margin: 0 2px; border: 0; border-bottom: 2px solid var(--primary-2); border-radius: 4px 4px 0 0; background: #f1f6fc; font: inherit; font-weight: 600; min-height: 0; }
.gapw.right input { border-color: var(--ok); background: var(--ok-bg); }
.gapw.wrong input { border-color: var(--bad); background: var(--bad-bg); text-decoration: line-through; }
.gapw.right > b { color: var(--ok); border-bottom: 2px solid var(--ok); padding: 0 4px; }
.gapsol { font-size: .8rem; color: var(--ok); font-weight: 700; line-height: 1.2; padding-left: 4px; }
.gapdemo { display: inline-block; min-width: 60px; border-bottom: 2px solid var(--primary-2); color: var(--muted); font-size: .75rem; text-align: center; margin: 0 2px; }
.matchedit { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto; }
/* Druck */
.pd-ord, .pd-match table { border-collapse: collapse; margin: 4px 0 6px; }
.pd-ord td, .pd-match td { padding: 4px 8px; vertical-align: top; }
.pd-box { width: 28px; height: 22px; border: 1px solid #333; text-align: center; }
.pd-match { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pd-gap { line-height: 2.2; white-space: pre-wrap; }
.pd-gapline { display: inline-block; min-width: 110px; border-bottom: 1px solid #333; color: #888; font-size: 7pt; vertical-align: bottom; text-align: left; }
.pd-gapsol { border-bottom: 1px solid #333; padding: 0 4px; }
.ordlist li, .mrow, .gaptext { text-align: left; }
.ordlist li > .grow { flex: 1 1 auto; }
/* Druck: gleich große Kästchen für Reihenfolge/Zuordnung */
td.pd-boxcell { width: 9mm; padding: 3px 6px 3px 0 !important; vertical-align: top; border: 0 !important; }
.pd-box2 { display: inline-flex; align-items: center; justify-content: center; width: 6mm; height: 6mm; border: 1px solid #333; border-radius: 1px; font-size: 9pt; box-sizing: border-box; }
.pd-ord td, .pd-match td { vertical-align: top; }
.lnctl { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.lnctl b { min-width: 22px; text-align: center; }
.pd-gap-w { display: inline-block; width: 18mm; }
/* Themengewichtung */
.wtopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 16px; }
.wtopic { display: flex; align-items: center; gap: 8px; justify-content: space-between; border-radius: 8px; padding: 2px 6px; }
.wtopic.on { background: #f1f6fc; }
.wtopic .check { margin: 0; flex: 1; }
.wtopic .etc { width: 86px; flex: none; }
.wtopic .etc:disabled { opacity: .35; }
/* 1.7.0: Quelle/Wiedervorlage, Sammeldruck */
a.kpi { text-decoration: none; color: inherit; display: block; }
.kpi.warnkpi { border-color: #e0b44c; background: #fff8e6; }
.kpi.warnkpi b { color: #8a5a00; }
.srcline { margin-top: 2px; }
.pbreak { margin-top: 18px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
@media print { .pbreak { break-before: page; page-break-before: always; margin-top: 0; } }
/* 1.7.1: Fragenpool-Tabelle passt immer in die Breite (feste Spalten, Fragetext nimmt den Rest) */
.main { max-width: 1400px; }
table.pooltab { table-layout: fixed; width: 100%; min-width: 900px; }
table.pooltab td, table.pooltab th { overflow-wrap: anywhere; }
table.pooltab td.qtext { max-width: none; }
table.pooltab .badge { white-space: normal; }
table.pooltab { min-width: 720px; }
@media (max-width: 1250px) { table.pooltab col:nth-child(n+9), table.pooltab th:nth-child(n+9), table.pooltab td:nth-child(n+9) { display: none; } }
.me .ver { margin-top: 8px; font-size: .75rem; color: rgba(255,255,255,.55); }
/* 1.8.0: Richtig/Falsch-Aussagen */
.tftab { display: flex; flex-direction: column; gap: 8px; }
.tfrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; text-align: left; }
.tfrow.right { border-color: var(--ok); background: var(--ok-bg); }
.tfrow.wrong { border-color: var(--bad); background: var(--bad-bg); }
.tfbtns { display: flex; gap: 6px; }
.tfb { border: 2px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); min-width: 84px; text-align: center; }
.tfb.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.tfb:disabled { cursor: default; opacity: 1; }
.tfrow.wrong .tfb.on { background: var(--bad); border-color: var(--bad); }
.tfrow.right .tfb.on { background: var(--ok); border-color: var(--ok); }
@media (max-width: 640px) { .tfrow { grid-template-columns: 1fr; } .tfb { flex: 1; } }
.pd-tf { border-collapse: collapse; margin: 4px 0 6px; width: 100%; }
.pd-tf td, .pd-tf th { padding: 4px 8px; vertical-align: top; text-align: left; }
.pd-tf .c { text-align: center; width: 64px; }
.pd-tf thead th { font-size: .8rem; font-weight: 600; border-bottom: 1px solid #999; }
/* Lernfortschritt / Gruppen */
.prog td { vertical-align: middle; }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; }
/* 1.9.5: Fragenpool auf dem Handy als Kartenliste statt Tabelle */
@media (max-width: 700px) {
  .tablewrap:has(table.pooltab) { overflow: visible; }
  table.pooltab, table.pooltab tbody { display: block; width: 100%; min-width: 0; table-layout: auto; }
  table.pooltab colgroup, table.pooltab thead { display: none; }
  table.pooltab tr { display: grid; grid-template-columns: 30px auto auto auto 1fr; gap: 4px 12px; padding: 12px 12px 12px 8px; border-bottom: 1px solid var(--line); align-items: start; }
  table.pooltab td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: break-word; }
  table.pooltab td:nth-child(1) { grid-column: 1; grid-row: 1 / span 6; }
  table.pooltab td:nth-child(2) { grid-column: 2 / -1; grid-row: 1; font-size: .8rem; }
  table.pooltab td:nth-child(2)::before { content: "Nr. "; }
  table.pooltab td:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  table.pooltab td:nth-child(4) { grid-column: 2 / -1; grid-row: 3; font-size: .85rem; color: var(--muted); }
  table.pooltab td:nth-child(4)::before { content: "Thema: "; font-weight: 600; }
  table.pooltab td:nth-child(5) { grid-column: 2 / -1; grid-row: 4; }
  table.pooltab td:nth-child(5) .badge { display: inline-block; margin: 0 4px 2px 0; }
  table.pooltab td:nth-child(6) { grid-column: 2; grid-row: 5; font-size: .85rem; }
  table.pooltab td:nth-child(6)::before { content: "P. "; color: var(--muted); }
  table.pooltab td:nth-child(7) { grid-column: 3; grid-row: 5; font-size: .85rem; }
  table.pooltab td:nth-child(7)::before { content: "Min. "; color: var(--muted); }
  table.pooltab td:nth-child(8) { grid-column: 4 / -1; grid-row: 5; }
  table.pooltab td:nth-child(8) br, table.pooltab td:nth-child(8) .small { display: none; }
  table.pooltab td:nth-child(n+9) { display: none; }
  table.pooltab td.qtext .clip { -webkit-line-clamp: 3; }
}
@media (max-width: 700px) {
  table.pooltab td { background: transparent !important; }
  table.pooltab tr.sel { background: #e8eefb; }
}
/* Themenliste: Name immer lesbar */
table.topictab td:first-child { min-width: 260px; width: 55%; }
table.topictab td:first-child input { width: 100%; }
@media (max-width: 700px) {
  .tablewrap:has(table.topictab) { overflow: visible; }
  table.topictab, table.topictab tbody { display: block; width: 100%; }
  table.topictab thead { display: none; }
  table.topictab tr { display: grid; grid-template-columns: auto auto 1fr; gap: 8px 14px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
  table.topictab tr.hidden { display: none; }
  table.topictab td { display: block; padding: 0; border: 0; background: transparent !important; min-width: 0; width: auto; }
  table.topictab td:first-child { grid-column: 1 / -1; min-width: 0; width: auto; }
  table.topictab td:nth-child(2)::before { content: "Fragen: "; color: var(--muted); font-size: .85rem; }
  table.topictab td:nth-child(4) { justify-self: end; }
}
/* 1.9.7: Schutz der Fragen */
body.protect .main, body.protect .runner { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect input, body.protect textarea { -webkit-user-select: text; user-select: text; }
#wm { position: fixed; inset: 0; z-index: 40; pointer-events: none; background-repeat: repeat; }
body.qhidden .runner .qcard, body.qhidden .runner .qgrid { filter: blur(14px); }
#leavebox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20, 30, 60, .55); padding: 16px; }
#leavebox > div { background: #fff; border-radius: var(--radius); padding: 22px; max-width: 420px; text-align: center; box-shadow: var(--shadow); }
#leavebox h2 { margin-top: 0; }
@media print {
  body.protect .main > * { display: none !important; }
  body.protect .main::after { content: "Das Drucken der Fragen ist nicht erlaubt."; display: block; padding: 40px; font-size: 14pt; }
  #wm { display: none; }
}

/* 1.9.8: Prüfungsbogen mit eigener Seitenaufteilung und Fußzeile (Seite x von y, Nummer) */
.pd-pages { display: none; }
.pd-measure { position: absolute; left: -10000px; top: 0; width: 180mm; }
.printdoc.pd-flat { border: 0; padding: 0; max-width: none; width: 180mm; font-size: 10pt; border-radius: 0; margin: 0; }
.pd-flat table.meta { font-size: 9pt; }
.pd-flat .pd-head img { max-height: 60px; }
.pd-flat .noprint { display: none !important; }
@media print {
  body.pdpaged .main > .printdoc { display: none !important; }
  body.pdpaged .pd-pages { display: block; }
  .pd-page { position: relative; width: 180mm; height: 275mm; overflow: hidden; break-after: page; page-break-after: always; }
  .pd-page:last-child { break-after: auto; page-break-after: auto; }
  .pd-pagebody { height: 265mm; overflow: hidden; }
  .pd-foot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; border-top: 1px solid #9aa6b4; padding-top: 1.5mm; font: 8pt Arial, sans-serif; color: #4a5565; }
}

.pd-foot span:nth-child(2) { text-align: center; }
.pd-foot span:nth-child(3) { text-align: right; }

/* 1.10.0: Kennzeichnung der Installation */
.instbadge { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.instbadge.test { background: #f5a623; color: #2b1d00; }
.instbadge.prod { background: #2e9d5b; color: #fff; }
table.pooltab td:nth-child(7) .badge { white-space: nowrap; padding: 2px 6px; }
.imgdrop { border: 2px dashed transparent; border-radius: 10px; padding: 4px; } .imgdrop.over { border-color: var(--primary); background: #eef3fb; }
/* 1.13.0: Frage melden, Systemcheck */
.note.bad { background: var(--bad-bg, #fde8e6); color: var(--bad); }
.repline { text-align: right; margin-top: 10px; }
.repline .btn { color: var(--muted, #5b6878); font-size: .82rem; }
.replist { margin: 8px 0 0; padding-left: 18px; }
.replist li { margin-bottom: 8px; }
.ok-t { color: var(--ok); }
.sc { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #fff; }
.sc.ok { background: var(--ok); } .sc.warn { background: var(--warn); } .sc.bad { background: var(--bad); }
table.systab { width: 100%; margin: 6px 0 0; }
table.systab th { width: 34%; text-align: left; }
table.systab td { width: auto; font-weight: 500; }
table.systab td.ic { width: 36px; text-align: center; background: #fff; }
table.systab td, table.systab th { vertical-align: top; padding: 6px 8px; }
.tryb .badge { margin-top: 4px; display: inline-block; }
@media (max-width: 640px) { table.systab th { width: auto; } }
/* 1.14.0: Aufsicht, Ergebnismitteilung */
.suptime { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }
.suptime.low { color: var(--bad); }
details.xtra summary { cursor: pointer; color: var(--primary); }
.cert { max-width: 820px; margin: 0 auto; padding: 36px 44px; }
.certhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 3px solid var(--primary); padding-bottom: 10px; margin-bottom: 26px; }
.certhead img { max-height: 70px; max-width: 220px; }
.certorg { font-weight: 700; font-size: 1.05rem; }
.certtitle { font-size: 1.6rem; margin: 0 0 16px; color: var(--primary); }
table.certtab { width: 100%; }
table.certtab th { width: 32%; }
table.certtab td { width: auto; }
.certresult { font-size: 1.15rem; padding: 14px 16px; border-radius: 8px; margin: 18px 0; border: 2px solid; }
.certresult.ok { border-color: var(--ok); color: var(--ok); }
.certresult.bad { border-color: var(--bad); color: var(--bad); }
.certsign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; }
.certsign .line { border-bottom: 1px solid #16212e; min-height: 26px; padding-bottom: 2px; }
.certsign span { font-size: .82rem; color: var(--muted); }
.certfoot { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 640px) { .cert { padding: 20px 16px; } .certsign { grid-template-columns: 1fr; gap: 28px; margin-top: 36px; } .certhead img { max-height: 48px; max-width: 120px; } }
@media print { .cert { padding: 0; max-width: none; } .certresult { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* 1.15.0: Zwei-Faktor-Anmeldung */
input.otp { font-size: 1.4rem; letter-spacing: .25em; font-variant-numeric: tabular-nums; text-align: center; }
.steps2fa { padding-left: 20px; margin: 0; }
.steps2fa > li { margin-bottom: 14px; }
.qrbox { margin: 10px 0 6px; }
.qrbox svg { width: 200px; height: 200px; display: block; border: 1px solid var(--line); border-radius: 8px; }
.reccodes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; margin: 12px 0; }
.reccodes code { font-size: 1.05rem; padding: 6px 10px; background: var(--head); border-radius: 6px; text-align: center; letter-spacing: .05em; }
/* 1.16.0: Impressum/Datenschutz, App */
.legalnav { text-align: center; margin-top: 16px; font-size: .85rem; width: 100%; }
.legalnav a { color: rgba(255,255,255,.85); }
.legalnav.dark a { color: var(--primary); }
.legalside { font-size: .78rem; margin-top: 8px; opacity: .8; }
.legalside a { color: inherit; }
.legalpage { min-height: 100vh; background: linear-gradient(135deg, var(--side-bg), var(--primary-2)); padding: 24px 16px; }
.legalbox { background: #fff; max-width: 820px; margin: 0 auto; border-radius: 14px; padding: 28px 32px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.legalhead { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--primary); padding-bottom: 12px; margin-bottom: 18px; }
.legalhead img { max-height: 54px; max-width: 120px; }
.legalhead b { display: block; } .legalhead span { color: var(--muted); font-size: .88rem; }
.legaltext h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.legaltext p, .legaltext li { line-height: 1.55; }
.legaltext ul { padding-left: 20px; margin: 6px 0 10px; }
mark.todo { background: #fff1c2; color: #7a4b00; padding: 0 3px; border-radius: 3px; font-weight: 600; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.45; }
.appcard .appicon { width: 54px; height: 54px; border-radius: 12px; border: 1px solid var(--line); flex: none; }
.kbd { display: inline-block; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: .85em; }
@media (max-width: 640px) { .legalbox { padding: 20px 16px; } }
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } body { overscroll-behavior-y: none; } }
/* 1.17.1: Fragen mit Bild im Fragenpool */
.qthumb { float: right; width: 46px; height: 34px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; margin: 0 0 4px 8px; background: #fff; }
.badge.img { background: #e7f0ff; color: #1d4ed8; }
/* 1.20.0: personalisierte Prüfungsbögen */
td.pd-person { font-size: 1.15rem; font-weight: 700; height: 12mm; vertical-align: middle; }
.persbar .field label { font-size: .85rem; }
@media print { td.pd-person { font-size: 13pt; } }
/* 1.22.0: Prüfungsvorlage – Auswahl nach Prüfungsart */
.kindquick { background: var(--info-bg); border-radius: 9px; padding: 10px 12px; margin-bottom: 14px; }
.kindbulk .checks { max-height: 260px; overflow: auto; }
/* 1.23.0: Umfang nach Zeit oder Anzahl */
.umfang { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.umfang .check { margin: 0; }
.pd-pk { font-weight: 700; letter-spacing: .08em }
.badge.diff.d1 { background: #e3f4e8; color: #1d6b36; }
.badge.diff.d2 { background: #fff3dc; color: #7a5200; }
.badge.diff.d3 { background: #fde6e4; color: #a32116; }
.pd-versuch .vbox { display: inline-block; margin-right: 18px; white-space: nowrap; }
.pd-versuch .box { font-size: 1.1em; }
.thumb .tdf { font-size: .7rem; padding: 0 4px; border-radius: 4px; }
.thumb .tdf.d0 { display: none; }
.thumb .tdf.d1 { background: #e3f4e8; color: #1d6b36; }
.thumb .tdf.d2 { background: #fff3dc; color: #7a5200; }
.thumb .tdf.d3 { background: #fde6e4; color: #a32116; }
.diffrow kbd { font-size: .7rem; opacity: .6; margin-left: 3px; font-family: inherit; }
/* Bildgröße je Frage */
.qimg.isz-s { max-height: 220px; } .qimg.isz-m { max-height: 380px; } .qimg.isz-l { max-height: 600px; } .qimg.isz-xl { max-height: none; width: 100%; }
.qimg { cursor: zoom-in; }
.pd-img.isz-s { max-height: 4cm; max-width: 50%; } .pd-img.isz-m { max-height: 7cm; } .pd-img.isz-l { max-height: 11cm; } .pd-img.isz-xl { max-height: 22cm; width: 100%; object-fit: contain; }
/* Vollbild-Zoom */
.zoomov { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, .92); display: flex; flex-direction: column; }
.zoombar { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px; color: #fff; flex-wrap: wrap; }
.zoomarea { flex: 1; overflow: auto; text-align: center; cursor: grab; }
.zoomarea.drag { cursor: grabbing; }
.zoomimg { position: relative; display: inline-block; margin: 10px; background: #fff; }
.zoomimg img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.zbox { position: absolute; display: flex; align-items: center; justify-content: center; font-size: clamp(10px, 1.6vw, 22px); font-weight: 600; color: #1e3a8a; background: rgba(255, 255, 255, .85); overflow: hidden; text-align: center; line-height: 1.1; }
.zbox i { font-style: normal; opacity: .5; }
/* Bild beschriften */
.lblwrap { overflow-x: auto; margin-bottom: 4px; }
.lblimg { position: relative; display: inline-block; max-width: 100%; min-width: 560px; }
.lblimg.isz-s { width: 45%; } .lblimg.isz-m { width: 65%; } .lblimg.isz-l { width: 85%; } .lblimg.isz-xl { width: 100%; }
.lblimg img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; }
.lblbox { position: absolute; display: flex; }
.lblbox input { width: 100%; height: 100%; min-height: 22px; padding: 1px 4px; font-size: clamp(11px, 1.3vw, 15px); border: 2px solid var(--primary); border-radius: 3px; background: rgba(255, 255, 255, .95); }
.lblbox input.right { border-color: var(--ok); background: #e8f6ec; } .lblbox input.wrong { border-color: var(--bad); background: #fdecea; }
.lblbox .lblsol { width: 100%; display: flex; align-items: center; justify-content: center; font-size: clamp(10px, 1.2vw, 14px); font-weight: 600; color: var(--ok); background: rgba(255, 255, 255, .9); text-align: center; line-height: 1.1; }
.lbledit { cursor: crosshair; user-select: none; touch-action: none; }
.lblbox.ed { border: 2px dashed #d97706; background: rgba(251, 191, 36, .15); align-items: flex-start; }
.lblbox.ed b { background: #d97706; color: #fff; font-size: 11px; padding: 0 4px; border-radius: 0 0 4px 0; }
.lblbox.new { border-color: var(--primary); }
.bad-t { color: var(--bad); }
.pd-lbl { position: relative; display: block; margin: 6px 0; break-inside: avoid; }
.pd-lbl img { width: 100%; display: block; }
.pd-lbl.isz-s { width: 45%; } .pd-lbl.isz-m { width: 65%; } .pd-lbl.isz-l { width: 85%; } .pd-lbl.isz-xl { width: 100%; }
.pd-lblbox { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 8.5pt; line-height: 1.1; }
.pd-lblbox b { background: rgba(255, 255, 255, .9); color: #0a6b2e; }
@media print { .qimg.isz-xl, .qimg.isz-l { max-height: 12cm !important; } }
.pd-img, .pd-lbl img { cursor: zoom-in; }
@media print { .pd-img, .pd-lbl img { cursor: default; } }
/* 1.36: Doppelseitiger Druck (Aufgaben rechts, links Notizen bzw. ganzseitige Abbildung) und Seitenansicht */
.pd-imgref { margin: 6px 0; font-weight: 600; color: #2c3d86; }
.pd-imgpage { height: 263mm; display: flex; flex-direction: column; }
.pd-imgpage-h { border-bottom: 1px solid #9fb3c8; padding-bottom: 2mm; margin-bottom: 3mm; font-size: 10pt; }
.pd-fullimg { flex: 1; min-height: 0; width: 100%; object-fit: contain; object-position: top center; }
.pd-lbl.pd-lblpage { width: 100%; max-height: 250mm; }
.pd-lbl.pd-lblpage img { max-height: 250mm; object-fit: contain; }
.pd-notes-h { border-bottom: 1px solid #9fb3c8; padding-bottom: 2mm; margin-bottom: 2mm; font-size: 10pt; display: flex; flex-direction: column; gap: 1mm; }
.pd-notes-h span { font-size: 8pt; color: #5b6878; }
.pd-nl { height: 7.6mm; border-bottom: 1px solid #d6dde6; }
body.pdview .main > .printdoc { display: none !important; }
body.pdview .pd-pages { display: flex; flex-wrap: wrap; gap: 16px 10px; justify-content: center; }
body.pdview .pd-page { position: relative; width: 180mm; height: 275mm; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #c9d1de, 0 6px 18px rgba(16, 33, 54, .12); padding: 0; zoom: var(--pz, .62); outline: 15mm solid #fff; margin: 15mm; }
body.pdview .pd-pagebody { height: 265mm; overflow: hidden; }
body.pdview .pd-foot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; border-top: 1px solid #9aa6b4; padding-top: 1.5mm; font: 8pt Arial, sans-serif; color: #4a5565; }
@media print { body.pdview .pd-page { zoom: 1 !important; box-shadow: none; outline: 0; margin: 0; } body.pdview .pd-pages { display: block; } }
.qimg.isz-page { max-height: none; width: 100%; }
.lblimg.isz-page, .pd-lbl.isz-page { width: 100%; }
.pqprev { display: flex; flex-wrap: wrap; gap: 6mm; justify-content: safe center; overflow: auto; background: #e6e9ef; border-radius: 8px; padding: 4mm 0; }
.pqprev .pd-page { position: relative; width: 180mm; height: 275mm; overflow: hidden; background: #fff; box-shadow: 0 0 0 10mm #fff, 0 0 0 calc(10mm + 2px) #b8c1cf, 0 6mm 14mm 10mm rgba(0,0,0,.18); padding: 0; zoom: var(--pz, .5); flex: none; margin: 14mm; }
.pqprev .pd-pagebody { height: 265mm; overflow: hidden; }
.pqprev .pd-foot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; border-top: 1px solid #9aa6b4; padding-top: 1.5mm; font: 8pt Arial, sans-serif; color: #4a5565; }
.modal.wide:has(.pqprev) { max-width: min(1700px, 96vw); }

/* 1.36.1: Deckblatt passt immer auf Seite 1 – engere Stufen (zuerst Tabellen, zuletzt Schrift) */
.pd-cov table.meta { margin: 10px 0; } .pd-cov table.meta th, .pd-cov table.meta td { padding: 4px 8px; }
.pd-cov.pd-t1 table.meta th, .pd-cov.pd-t1 table.meta td, .pd-cov.pd-t2 table.meta th, .pd-cov.pd-t2 table.meta td { padding-top: 2px; padding-bottom: 2px; }
.pd-cov.pd-t1 table.meta, .pd-cov.pd-t2 table.meta { margin: 8px 0; }
.pd-cov.pd-t1 ul.hints li { margin-bottom: 4px; } .pd-cov.pd-t1 .pd-cover { margin-top: 8px; }
.pd-cov.pd-t1 .pd-meta td.big { height: 44px; } .pd-cov.pd-t1 .pd-meta td.mid, .pd-cov.pd-t1 .pd-cover-end td.blank { height: 30px; } .pd-cov.pd-t1 .pd-end td.sign { height: 42px; }
.pd-cov.pd-t2 ul.hints { font-size: 9.5pt; line-height: 1.3; margin: 4px 0 4px; } .pd-cov.pd-t2 ul.hints li { margin-bottom: 2px; }
.pd-cov.pd-t2 .pd-cover { margin-top: 6px; } .pd-cov.pd-t2 .pd-endh { margin-top: 8px; }
.pd-cov.pd-t2 .pd-meta td.big { height: 38px; } .pd-cov.pd-t2 .pd-meta td.mid, .pd-cov.pd-t2 .pd-cover-end td.blank { height: 28px; } .pd-cov.pd-t2 .pd-end td.sign { height: 40px; }
.pd-cov.pd-t3 ul.hints { font-size: 8.5pt; line-height: 1.25; margin: 3px 0 4px; } .pd-cov.pd-t3 ul.hints li { margin-bottom: 1px; }
.pd-cov.pd-t3 .pd-cover { margin-top: 4px; } .pd-cov.pd-t3 .pd-cover h3 { font-size: 10pt; margin-bottom: 3px; } .pd-cov.pd-t3 .pd-endh { margin: 6px 0 3px; }
.pd-cov.pd-t3 .pd-head img { max-height: 46px; } .pd-cov.pd-t3 .pd-head h1 { font-size: 1.25rem; }
.pd-cov.pd-t3 table.meta { font-size: 8.5pt; margin: 6px 0; } .pd-cov.pd-t3 table.meta th, .pd-cov.pd-t3 table.meta td { padding-top: 2px; padding-bottom: 2px; }
.pd-cov.pd-t3 .pd-meta td.big { height: 32px; } .pd-cov.pd-t3 .pd-meta td.mid, .pd-cov.pd-t3 .pd-cover-end td.blank, .pd-cov.pd-t3 td.blank { height: 24px; } .pd-cov.pd-t3 .pd-end td.sign { height: 36px; }
.pd-match.pd-match1 { grid-template-columns: 1fr; }
.pd-match.pd-match1 table { min-width: 60%; }
/* 1.39.1: Kästchengröße je Frage (Richtig/Falsch, Reihenfolge, Zuordnung) */
.pd-bx-m .pd-box2 { width: 10mm; height: 8mm; font-size: 11pt; } .pd-bx-m td.pd-boxcell { width: 13mm; }
.pd-bx-l .pd-box2 { width: 14mm; height: 10mm; font-size: 13pt; } .pd-bx-l td.pd-boxcell { width: 17mm; }
.pd-bx-xl .pd-box2 { width: 20mm; height: 13mm; font-size: 15pt; } .pd-bx-xl td.pd-boxcell { width: 23mm; }
.pd-bx-m .pd-match td, .pd-bx-l .pd-match td, .pd-bx-xl .pd-match td, .pd-bx-m .pd-ord td, .pd-bx-l .pd-ord td, .pd-bx-xl .pd-ord td, .pd-bx-m .pd-tf td, .pd-bx-l .pd-tf td, .pd-bx-xl .pd-tf td { vertical-align: middle; }
/* 1.40.2: Zuordnung – Breite der linken Spalte (Editor und online) */
#opts.mc-s .matchedit { grid-template-columns: 90px auto minmax(0,1fr) auto; }
#opts.mc-w .matchedit { grid-template-columns: minmax(0,2fr) auto minmax(0,1fr) auto; }
.matchtab.mc-s .mrow { grid-template-columns: minmax(2.5em, max-content) minmax(0, 1fr); }
.matchtab.mc-w .mrow { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 640px) { .matchtab.mc-s .mrow { grid-template-columns: minmax(2.5em, max-content) minmax(0, 1fr); } }
@media (max-width: 640px) { .matchtab.mc-w .mrow { grid-template-columns: 1fr; } }
/* 1.41.0: Zuordnung mit Bild links */
.mleft { display: flex; gap: 6px; align-items: center; min-width: 0; }
.mleft input { flex: 1; min-width: 0; }
.mthumb { width: 56px; height: 42px; object-fit: contain; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: zoom-in; flex: none; }
.mrow .ml img.mimg { display: block; max-width: 100%; max-height: 160px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; }
.mrow .ml .mcap { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.pd-mimg { max-width: 45mm; max-height: 30mm; margin: 2px 0; vertical-align: top; }
.pd-match > table { align-self: start; }
/* 1.41.1: Zuordnung im Druck – Zeilen mit Bild, Kästchen direkt daneben; Schreiblinie */
table.pd-mrows { border-collapse: collapse; width: auto !important; justify-self: start; }
table.pd-mrows td.pd-boxcell { padding-left: 10px !important; }
table.pd-mrows td { vertical-align: middle !important; padding: 4px 6px; border-bottom: 1px solid #d5dbe3; }
table.pd-mrows td.pd-mnr { font-weight: 700; width: 7mm; padding-left: 0; }
table.pd-mrows td.pd-mleft img.pd-mimg { display: block; max-width: 45mm; max-height: 25mm; margin: 0; }
.pd-mcap { font-size: 8.5pt; color: #4a5565; margin-top: 2px; }
table.pd-mrows.pd-mwrite { width: 100% !important; }
table.pd-mwrite td.pd-mleft { width: 50mm; }
table.pd-mwrite td.pd-mline { border-bottom: 1px solid #333; vertical-align: bottom !important; padding-bottom: 3px; }
/* 1.42.0: Bildposition (über / rechts / links neben der Frage) */
.qti { display: flex; gap: 16px; align-items: flex-start; }
.qti-left { flex-direction: row-reverse; }
.qti-t { flex: 1 1 auto; min-width: 0; }
.qti-i { flex: 0 0 auto; min-width: 0; } /* Bildspalte nur so breit wie das Bild */
.qti-i img { max-width: 380px; width: auto; margin-top: 0; display: block; }
.pd-q .qti-i img { max-width: 85mm; }
.qti-i img.isz-s { max-width: 200px; } .qti-i img.isz-m { max-width: 300px; }
.pd-q .qti-i img.isz-s { max-width: 40mm; } .pd-q .qti-i img.isz-m { max-width: 60mm; } .pd-q .qti-i img.isz-xl { width: auto; }
@media (max-width: 640px) { .qti, .qti-left { flex-direction: column-reverse; gap: 10px; } .qti-i { flex-basis: auto; } .qti-i img { max-width: 100%; } } /* Handy: Bild immer über der Frage */
.pd-q .qti { gap: 5mm; } .pd-q .qti-i .pd-img { margin: 0; }
.pzbar { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; } .pzval { min-width: 6.5em; text-align: center; }
.pqprev { max-height: 72vh; }
/* 1.42.4: Bild neben der Frage umflossen (Text und Antworten daneben) */
.qti-f { margin-bottom: 8px; }
.qti-f-left { float: left; margin-right: 16px; }
.qti-f-right { float: right; margin-left: 16px; }
.qti-f img { display: block; margin: 0; max-width: 380px; width: auto; }
.qti-f img.isz-s { max-width: 200px; } .qti-f img.isz-m { max-width: 300px; }
.pd-q .qti-f-left { margin-right: 5mm; } .pd-q .qti-f-right { margin-left: 5mm; } .pd-q .qti-f { margin-bottom: 2mm; }
.pd-q .qti-f img { max-width: 85mm; } .pd-q .qti-f img.isz-s { max-width: 40mm; } .pd-q .qti-f img.isz-m { max-width: 60mm; } .pd-q .qti-f img.isz-xl { width: auto; }
.pd-q, .qcard { display: flow-root; }
.runnav, .repline { clear: both; }
/* Antwortzeilen einzeln neben dem Bild (jede Zeile wird schmaler, unter dem Bild wieder volle Breite) */
.pd-q:has(.qti-f) .pd-opts, .qcard:has(.qti-f) .opts { display: block; }
.pd-q:has(.qti-f) .pd-opt { margin-bottom: 3px; }
.qcard:has(.qti-f) .opt { margin-bottom: 10px; }
.pd-q:has(.qti-f) .pd-lines, .pd-q:has(.qti-f) .pd-sol, .pd-q:has(.qti-f) .pd-match, .pd-q:has(.qti-f) table { clear: both; }
@media (max-width: 640px) { .qti-f-left, .qti-f-right { float: none; margin: 0 0 10px; } .qti-f img { max-width: 100% !important; } }
.qcard:has(.qti-f) .matchtab, .qcard:has(.qti-f) .ordlist, .qcard:has(.qti-f) .tftab { clear: both; }
/* 1.43.0: Heftrand 2 cm rechts (Rückseite im Duplex links); Seitenrand dafür 10 mm, Inhalt 180 mm wie bisher */
@media print { body.pdpaged .pd-page { margin-left: 10mm; margin-right: 0; } body.pdpaged .pd-page.pd-left { margin-left: 0; } } /* 1.44.2: Heftrand 2 cm links (Rückseite im Duplex rechts) */
/* 1.43.3: mehrzeilige Antworten und Leerzeilen */
textarea.optta { resize: vertical; min-height: 44px; overflow: hidden; line-height: 1.4; font: inherit; }
.opt > span, .pd-opt > span, .tft, .ordlist li .grow, .pd-tf td:first-child, .pd-ord td:last-child { white-space: pre-wrap; }
.pd-probehead { border: 1px dashed #9aa6b4; padding: 2mm 3mm; margin-bottom: 3mm; font-size: 9pt; color: #4a5565; }
/* 1.44.3: Bild als eigene Spalte – Frage und alle Antworten bündig daneben */
.qcol { display: flex; gap: 16px; align-items: flex-start; }
.qcol-right { flex-direction: row-reverse; }
.qcol-i { flex: 0 0 auto; }
.qcol-i img { display: block; margin: 0; max-width: 380px; width: auto; }
.qcol-i img.isz-s { max-width: 200px; } .qcol-i img.isz-m { max-width: 300px; }
.qcol-b { flex: 1 1 auto; min-width: 0; }
.pd-q .qcol { gap: 5mm; } .pd-q .qcol-i img { max-width: 85mm; } .pd-q .qcol-i img.isz-s { max-width: 40mm; } .pd-q .qcol-i img.isz-m { max-width: 60mm; } .pd-q .qcol-i img.isz-xl { width: auto; }
@media (max-width: 640px) { .qcol, .qcol-right { flex-direction: column; } .qcol-i img { max-width: 100% !important; } }
/* 1.45.0: Hilfsmittel je Frage */
.pd-aidref { margin: 4px 0; font-weight: 600; color: #2c3d86; }
.pd-aidpage .pd-aidbox { position: relative; flex: 1; overflow: hidden; }
.pd-aidimg { position: absolute; left: 50%; top: 50%; max-width: 100%; max-height: 100%; transform: translate(-50%, -50%); }
.pd-aidimg.rot90, .pd-aidimg.rot270 { max-width: 225mm; max-height: 180mm; } /* gedreht: lange Seite entlang der Seitenhöhe */
.pd-aidimg.rot90 { transform: translate(-50%, -50%) rotate(90deg); } .pd-aidimg.rot270 { transform: translate(-50%, -50%) rotate(-90deg); }
.aidbtn { margin: 4px 0 12px; }
.aidinfo { white-space: pre-wrap; }
/* 1.46.0: Hilfsmittel online (mehrere Dateien, PDF) */
.aidon { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
iframe.aidframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.modal.wide:has(iframe.aidframe) { max-width: min(1300px, 96vw); }
/* 1.46.1: mehrere Schreibzeilen je Eintrag (Zuordnung „Begriff selbst schreiben“) */
table.pd-mwrite td.pd-mlines { vertical-align: bottom !important; padding-bottom: 2px; }
.pd-mlines .pd-wl { border-bottom: 1px solid #333; height: var(--pdlh, 8mm); display: flex; align-items: flex-end; padding-bottom: 1px; }
.pd-bg { white-space: nowrap; }
/* 1.46.5: Schriftgröße in den Kästchen bei „Bild beschriften“ */
.lblimg.lfs-s .lblbox input, .lblimg.lfs-s .lblsol { font-size: 11px; }
.lblimg.lfs-m .lblbox input, .lblimg.lfs-m .lblsol { font-size: 16px; }
.lblimg.lfs-l .lblbox input, .lblimg.lfs-l .lblsol { font-size: 20px; }
.lblimg.lfs-xl .lblbox input, .lblimg.lfs-xl .lblsol { font-size: 26px; }
.pd-bx-s .pd-lblbox b { font-size: 7pt; } .pd-bx-m .pd-lblbox b { font-size: 10pt; } .pd-bx-l .pd-lblbox b { font-size: 12pt; } .pd-bx-xl .pd-lblbox b { font-size: 15pt; }
/* Bild beschriften – Teil 2 (Erläuterung der Bauteile) */
.lblbox .lbln, .lbln { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; }
.lblbox .lbln { position: absolute; left: -9px; top: -9px; z-index: 2; }
.p2sec { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.p2head { margin-bottom: 8px; }
.p2row { margin-bottom: 10px; }
.p2row label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-weight: 600; }
.p2row textarea { width: 100%; }
.p2sol { margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--ok-bg); font-size: .9rem; white-space: pre-wrap; }
.p2ed { margin-top: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.p2edrow { margin: -2px 0 6px 22px; } .p2edrow textarea { width: 100%; font-size: .9rem; }
.pd-lblbox .pd-lbln, .pd-lbln { display: inline-block; min-width: 13px; padding: 0 3px; border: 1px solid #000; border-radius: 7px; background: #fff; color: #000; font-size: 7.5pt; font-weight: 700; line-height: 1.25; text-align: center; }
.pd-lblbox .pd-lbln { position: absolute; left: -6px; top: -6px; }
.pd-p2 { margin-top: 10px; clear: both; }
.pd-p2t { margin: 4px 0 6px; }
.pd-p2row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; break-inside: avoid; }
.pd-p2h { min-width: 22px; padding-top: 6px; } .pd-p2row .pd-lines, .pd-p2row .pd-sol { flex: 1; }
.pd-p2h b { margin-left: 4px; } .pd-p2h { white-space: nowrap; }
/* Bild beschriften: Kästchen verschieben, Größe ändern, ausrichten */
.lbtools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.lbledit:focus { outline: none; }
.lblbox.ed { cursor: move; }
.lblbox.ed.sel { border-style: solid; border-color: var(--primary); background: rgba(37, 99, 235, .15); }
.lblbox.ed.sel b { background: var(--primary); }
.lblbox.ed .lbrz { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: #fff; border: 2px solid #d97706; border-radius: 2px; cursor: nwse-resize; }
.lblbox.ed.sel .lbrz { border-color: var(--primary); }
/* Bild beschriften: Schrift in den Kästchen mittig (Standard) oder linksbündig */
.lblbox input { text-align: center; }
.lblimg.lal-l .lblbox input { text-align: left; }
.lblimg.lal-l .lblbox .lblsol { justify-content: flex-start; text-align: left; padding-left: 4px; }
.pd-lbl.lal-l .pd-lblbox { justify-content: flex-start; text-align: left; padding-left: 3px; }
/* Reihenfolge: flexible Schritte */
.flexrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 10px 22px; color: var(--muted); }
.flexrow select { width: auto; padding: 2px 6px; font-size: .85rem; }
.pd-flex { font-size: 8pt; color: #0a6b2e; }
.flexrow select { height: auto; min-height: 0; padding: 2px 6px; } .flexrow .check span { font-size: .85rem; }
/* Anwesenheitsliste (Prüfungstermin) – nur im Druck */
.printonly { display: none; }
@media print { .printonly { display: block; } .attlist h1 { font-size: 16pt; margin: 0 0 4mm; } .atttab { width: 100%; border-collapse: collapse; margin-top: 6mm; } .atttab th, .atttab td { border: 1px solid #333; padding: 2mm; font-size: 10pt; text-align: left; } .atttab td { height: 9mm; } .atttab th:nth-child(7) { width: 45mm; } }

/* Unterlagen zur Prüfung: nur lesen */
.docview { max-width: 900px; margin: 0 auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.docview img { display: block; width: 100%; height: auto; margin: 0 0 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.docview.prot img { pointer-events: none; }
.docprintnote { display: none; }
@media print { body.docreading .docview.prot, body.docreading #ackbox { display: none !important; } body.docreading .docprintnote { display: block !important; font-size: 14pt; margin-top: 30mm; text-align: center; } }
.readbox { max-width: 980px; }
.letter { max-width: 180mm; margin: 0 auto 20px; padding: 14mm 16mm; background: #fff; border: 1px solid var(--line); }
.letter .lt-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--primary); padding-bottom: 6px; margin-bottom: 14mm; }
.letter .lt-to { margin-bottom: 10mm; font-weight: 600; }
.letter h2 { font-size: 15pt; }
.letter .lt-code td.lt-c { font-family: Menlo, Consolas, monospace; font-size: 15pt; letter-spacing: .08em; font-weight: 700; }
.letter .lt-qr { width: 40mm; text-align: center; }
.letter .lt-qr svg { width: 34mm; height: 34mm; }
@media print { .letter { border: 0; padding: 0; margin: 0; page-break-after: always; } }
/* Aktionsknöpfe in Tabellen umbrechen statt rechts abzuschneiden */
td.acts { white-space: normal; min-width: 160px; }
td.acts .btn { margin: 2px 4px 2px 0; }
/* Tabellen mit einstellbarer Spaltenbreite */
.rtab th .colgrip { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 2; }
.rtab th .colgrip::after { content: ''; position: absolute; left: 4px; top: 25%; height: 50%; border-left: 1px solid var(--line); }
.rtab th:hover .colgrip::after { border-left: 2px solid var(--primary); }

body.colresizing, body.colresizing * { cursor: col-resize !important; user-select: none; }
.rtab th { white-space: normal; }
.rtab td { overflow-wrap: break-word; }
.rtab .badge { white-space: normal; }
.actmenu { position: relative; display: inline-block; }
.actmenu .menu { display: none; position: absolute; right: 0; top: 100%; z-index: 30; min-width: 220px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; }
.actmenu.open .menu { display: flex; }
.actmenu .menu .btn { justify-content: flex-start; margin: 0; text-align: left; }
.tablewrap:has(.actmenu.open) { overflow: visible; }
#utab td.acts { white-space: nowrap; min-width: 0; }
/* Übersicht Teilnehmer × Themen */
.mxwrap { max-height: 75vh; overflow: auto; }
table.mx { border-collapse: separate; border-spacing: 0; width: auto; }
table.mx th, table.mx td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
table.mx thead th { position: sticky; top: 0; z-index: 2; background: var(--head, #d6e4f0); }
table.mx .mx-name { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 200px; max-width: 260px; font-weight: 400; }
table.mx thead .mx-name { z-index: 3; background: var(--head, #d6e4f0); font-weight: 700; }
table.mx th.mx-t { height: 200px; vertical-align: bottom; padding: 6px 4px; width: 38px; min-width: 38px; }
table.mx th.mx-t span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; max-height: 190px; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; }
table.mx td { text-align: center; width: 38px; min-width: 38px; padding: 4px; cursor: pointer; font-weight: 700; }
table.mx td.mx-a { background: #e5f4e4; color: #1b6e2f; }
table.mx td.mx-g { background: #eef3fb; color: #5b6f8f; font-weight: 400; }
table.mx td.mx-e:hover, table.mx td:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
table.mx .mx-n { display: block; font-size: .68rem; font-weight: 400; }
table.mx .mx-sum { text-align: center; font-weight: 700; width: 60px; cursor: default; }
.mx-key { display: inline-block; width: 22px; height: 18px; text-align: center; border: 1px solid var(--line); border-radius: 4px; margin-right: 4px; font-weight: 700; vertical-align: middle; line-height: 16px; }
.mx-key.mx-a { background: #e5f4e4; color: #1b6e2f; } .mx-key.mx-g { background: #eef3fb; color: #5b6f8f; }
@media print { .mxwrap { max-height: none; overflow: visible; } table.mx td.mx-a, table.mx td.mx-g, .mx-key { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.mxtip { position: fixed; z-index: 100; max-width: 340px; background: #1f2a44; color: #fff; padding: 8px 11px; border-radius: 8px; font-size: .85rem; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: none; }
.mxtip span { color: #c9d4ea; font-size: .8rem; }
table.mx .mx-hl { box-shadow: inset 0 0 0 9999px rgba(44, 61, 134, .07); }
table.mx thead th.mx-hl { box-shadow: inset 0 0 0 9999px rgba(44, 61, 134, .14); }
  .altprev { margin: -2px 0 4px 30px; line-height: 1.35; }
/* 1.60.2: mehr Abstand zwischen Aufgabentext und Antworten bzw. zwischen den Antworten im Druck */
.pd-text { margin-bottom: 3.5mm; }
.pd-opts { gap: 1.6mm; }
.pd-q:has(.qti-f) .pd-opt { margin-bottom: 1.6mm; }
/* Fragenpool: Fragenummer immer in einer Zeile */
table.pooltab td:nth-child(2), table.pooltab th:nth-child(2) { white-space: nowrap; overflow-wrap: normal; }
/* Lesehilfe Freitext */
.aidmatch { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }
.aidmatch ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9rem; }
.aidmatch li { display: flex; gap: 8px; padding: 2px 0; }
.aidmatch .am-i { width: 18px; flex: none; text-align: center; font-weight: 700; }
.aidmatch .am-ok { color: #1b6e2f; } .aidmatch .am-part { color: #8a5a00; } .aidmatch .am-no { color: var(--muted); }
/* Hilfe */
.helpwrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.helptoc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 14px 16px; font-size: .9rem; }
.helptoc ul { list-style: none; margin: 6px 0 0; padding: 0; }
.helptoc ul ul { margin: 2px 0 8px 10px; }
.helptoc li { margin: 3px 0; }
.helptoc a { text-decoration: none; color: var(--text); }
.helptoc a:hover { text-decoration: underline; }
.helpdoc { padding: 22px 28px; line-height: 1.55; }
.helpdoc h2 { margin: 28px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.helpdoc h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.helpdoc h3 { margin: 20px 0 8px; }
.helpdoc h4 { margin: 16px 0 6px; }
.helpdoc h2, .helpdoc h3, .helpdoc h4 { scroll-margin-top: 16px; transition: background .4s; border-radius: 6px; }
.helpdoc .hflash { background: var(--info-bg, #e8f0fb); }
.helpdoc p { margin: 8px 0; }
.helpdoc ul, .helpdoc ol { margin: 6px 0 10px; padding-left: 22px; }
.helpdoc li { margin: 3px 0; }
.helpdoc table { font-size: .92rem; }
.helpdoc td, .helpdoc th { vertical-align: top; }
mark.hm { background: #ffe58a; color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 900px) { .helpwrap { grid-template-columns: 1fr; } .helptoc { position: static; max-height: 260px; } .helpdoc { padding: 16px; } }
@media print { .helpwrap { display: block; } .helpdoc { border: 0; box-shadow: none; padding: 0; } .helpdoc h2 { break-before: page; border-top: 0; } .helpdoc h2:first-child { break-before: auto; } }
