/* KI-Kompetenz-Schulung – eigenständiges Stylesheet (keine externen Ressourcen) */
:root {
  --blue-900: #0f2a52;
  --blue-700: #1d4b8f;
  --blue-500: #2f6fd1;
  --blue-50: #eef4fd;
  --gold: #f2b705;
  --ink: #1b2330;
  --muted: #5d6878;
  --line: #dde3ec;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e5f5ec;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #b3261e;
  --bad-bg: #fde8e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 82, .06), 0 4px 16px rgba(15, 42, 82, .06);
  font-size: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh;
}
a { color: var(--blue-700); }
a:hover { color: var(--blue-500); }
h1, h2, h3 { line-height: 1.25; color: var(--blue-900); }
h1 { font-size: 1.9rem; margin: .2em 0 .5em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.15rem; }
code { background: var(--blue-50); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 10px; top: 10px; background: #fff; padding: 8px; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--blue-500); margin: 0; }
.inline { display: inline; }

/* Header / Footer */
.site-header { background: var(--blue-900); color: #fff; border-bottom: 4px solid var(--gold); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand small { color: #c9d6ee; }
.brand:hover { color: #fff; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a, .link-button { color: #fff; text-decoration: none; font-weight: 500; }
.main-nav a:hover, .link-button:hover { color: var(--gold); }
.link-button { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.user-chip { background: rgba(255,255,255,.12); padding: 3px 10px; border-radius: 999px; font-size: .9rem; }
.site-footer { background: #fff; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 16px 0; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Bausteine */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card.narrow { max-width: 620px; }
.button {
  display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--blue-700);
  background: #fff; color: var(--blue-700); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.button:hover { background: var(--blue-50); color: var(--blue-700); }
.button.primary { background: var(--blue-700); color: #fff; }
.button.primary:hover { background: var(--blue-900); }
.button.ghost { border-color: var(--line); color: var(--blue-700); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-success { background: var(--ok-bg); border-color: #b7e2c8; color: var(--ok); }
.flash-error { background: var(--bad-bg); border-color: #f4bdb8; color: var(--bad); }
.flash-info { background: var(--blue-50); border-color: #c9daf6; color: var(--blue-900); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eceff4; color: var(--muted); white-space: nowrap; }
.badge-ok, .badge-valid { background: var(--ok-bg); color: var(--ok); }
.badge-warn, .badge-expiring { background: var(--warn-bg); color: var(--warn); }
.badge-bad, .badge-expired { background: var(--bad-bg); color: var(--bad); }
.badge-none { background: #eceff4; color: var(--muted); }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--blue-500); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--blue-500); border-radius: 999px; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; margin-top: 8px; }
.form input:not([type=checkbox]):not([type=radio]), .filter-bar input, .filter-bar select {
  font: inherit; padding: 9px 12px; border: 1px solid #c3ccd9; border-radius: 8px; background: #fff;
}
.form input:focus, .filter-bar input:focus, .filter-bar select:focus { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.form .button { margin-top: 16px; align-self: flex-start; }
.form select { font: inherit; padding: 9px 12px; border: 1px solid #c3ccd9; border-radius: 8px; background: #fff; }
.form .button-row .button { margin-top: 0; }

/* Einstellungen */
.subnav-secondary { margin-top: -8px; }
.subnav-secondary a { font-size: .925rem; }
.settings-form { max-width: 760px; }
.setting { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.setting .option { margin-bottom: 0; }
.setting .option.small { padding: 4px 10px; margin: 0; align-self: flex-start; }
.setting-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; }
.test-box { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 16px 14px; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.test-box legend { font-weight: 700; padding: 0 6px; }
.test-result pre { white-space: pre-wrap; word-break: break-word; background: #f6f8fb; border-radius: 8px; padding: 12px; margin: 0 0 8px; }
.test-ok { border-left: 4px solid var(--ok); }
.test-bad { border-left: 4px solid var(--bad); }
.inline-form { margin-top: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }

/* Login */
.login-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; margin-top: 4vh; }
.login-intro h1 { font-size: 2.3rem; }
.login-card h2 { margin-top: 0; }

/* Dashboard */
.hero { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.hero .intro p:first-child { margin-top: 0; }
.status-card { background: var(--blue-900); color: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.status-card .eyebrow { color: var(--gold); }
.status-card .status-big { font-size: 1.6rem; font-weight: 700; margin: .2em 0; }
.status-card .button { background: #fff; color: var(--blue-900); border-color: #fff; }
.status-valid { background: var(--ok); }
.status-expiring { background: #9a6700; }
.status-expired { background: var(--bad); }
.module-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.module-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.module-number { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--blue-50); color: var(--blue-700); font-size: 1.1rem; }
.module-item.is-done .module-number { background: var(--ok); color: #fff; }
.module-item.is-started .module-number { background: var(--gold); color: var(--blue-900); }
.module-body h3 { margin: 0 0 4px; }
.module-body h3 a { text-decoration: none; color: var(--blue-900); }
.module-body p { margin: 0; }
.module-body .meta { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.module-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.exam-card { margin-top: 32px; border-top: 4px solid var(--gold); }
.exam-card h2 { margin-top: 0; }
.facts { padding-left: 1.2em; }
.disclaimer { margin-top: 32px; font-size: .85rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 16px; }

/* Modulansicht */
.module-layout { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.module-toc { position: sticky; top: 20px; }
.module-toc h2 { margin: .2em 0 .6em; font-size: 1.2rem; }
.module-toc ol { padding-left: 1.3em; margin: 0 0 16px; font-size: .92rem; }
.module-toc li { margin: 4px 0; }
.module-toc li.current a { font-weight: 700; color: var(--blue-900); }
.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 0; font-size: 1.6rem; }
.prose h3 { margin-top: 1.6em; }
.prose img { max-width: 100%; }
.prose blockquote { margin: 1em 0; padding: 8px 18px; border-left: 4px solid var(--blue-500); background: var(--blue-50); border-radius: 0 8px 8px 0; }
.table-wrap { overflow-x: auto; margin: 1em 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: #fff; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--blue-50); color: var(--blue-900); font-weight: 600; }
tr.inactive td { opacity: .55; }
.admonition { border-radius: 8px; padding: 12px 18px; margin: 1.2em 0; border: 1px solid #c9daf6; background: var(--blue-50); }
.admonition > p.admonition-title { font-weight: 700; margin: 0 0 4px; color: var(--blue-900); }
.admonition > p:last-child { margin-bottom: 0; }
.admonition.warning, .admonition.caution { background: var(--warn-bg); border-color: #f3d58c; }
.admonition.warning > .admonition-title, .admonition.caution > .admonition-title { color: var(--warn); }
.admonition.danger { background: var(--bad-bg); border-color: #f4bdb8; }
.admonition.danger > .admonition-title { color: var(--bad); }
.admonition.tip, .admonition.success { background: var(--ok-bg); border-color: #b7e2c8; }
.admonition.tip > .admonition-title, .admonition.success > .admonition-title { color: var(--ok); }
.admonition.example { background: #f4f0fb; border-color: #dccff2; }
.admonition.example > .admonition-title { color: #5a3a8c; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager-end { display: flex; gap: 8px; flex-wrap: wrap; }

/* Test */
.attempt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.timer { position: fixed; top: 76px; right: 20px; box-shadow: var(--shadow); background: var(--blue-900); color: #fff; border-radius: var(--radius); padding: 10px 18px; text-align: center; min-width: 120px; z-index: 5; }
.timer strong { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.timer.is-low { background: var(--bad); }
.question { border: 1px solid var(--line); }
fieldset.question { margin: 0 0 18px; }
.question legend { display: flex; gap: 12px; align-items: baseline; padding: 0 6px; flex-wrap: wrap; }
.qno { font-weight: 700; color: var(--blue-700); margin: 0; }
.qtype { font-size: .82rem; color: var(--muted); }
.qtext { font-size: 1.08rem; font-weight: 600; margin: 4px 0 12px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; cursor: pointer; font-weight: 400 !important; }
.option:hover { background: var(--blue-50); }
.option input { margin-top: .3em; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--blue-700); }
.option:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); }
.question.is-missing { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-bg); }
.submit-bar { display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 4; }
.submit-bar .option { margin: 0; flex: 1 1 320px; }
.result-head { border-top: 6px solid var(--blue-500); }
.result-head.is-passed { border-top-color: var(--ok); }
.result-head.is-failed { border-top-color: var(--bad); }
.result-head h1 { margin-top: .2em; }
.score { font-size: 1.25rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.question.is-correct { border-left: 5px solid var(--ok); }
.question.is-wrong { border-left: 5px solid var(--bad); }
.solution { list-style: none; padding: 0; margin: 8px 0; }
.solution li { padding: 6px 10px; border-radius: 6px; margin: 4px 0; display: flex; gap: 10px; align-items: baseline; }
.solution li.sol-correct { background: var(--ok-bg); }
.solution li.sol-chosen:not(.sol-correct) { background: var(--bad-bg); }
.sol-mark { width: 1.1em; flex-shrink: 0; font-weight: 700; }
.sol-correct .sol-mark { color: var(--ok); }
.sol-chosen:not(.sol-correct) .sol-mark { color: var(--bad); }
.explanation { background: var(--blue-50); padding: 10px 14px; border-radius: 8px; margin-bottom: 4px; }
.reference { color: var(--muted); margin-top: 6px; }

/* Glossar */
.glossary dt { font-weight: 700; color: var(--blue-900); margin-top: 18px; font-size: 1.05rem; }
.glossary dd { margin: 4px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.glossary dd p { margin: .2em 0; }

/* Admin */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.subnav a { padding: 8px 14px; text-decoration: none; border-bottom: 3px solid transparent; font-weight: 500; }
.subnav a.active { border-bottom-color: var(--blue-700); color: var(--blue-900); font-weight: 700; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-top: 4px solid var(--line); }
.stat strong { display: block; font-size: 1.8rem; color: var(--blue-900); }
.stat.active { outline: 2px solid var(--blue-500); }
.stat-valid { border-top-color: var(--ok); }
.stat-expiring { border-top-color: var(--gold); }
.stat-expired { border-top-color: var(--bad); }
table.data td { font-size: .92rem; }
details summary { cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
ul.plain { list-style: none; padding: 0; }
ul.plain li { margin: 6px 0; }

/* Zertifikat */
.certificate-page { background: #e9edf3; }
.cert-toolbar { display: flex; justify-content: space-between; max-width: 820px; margin: 20px auto; padding: 0 20px; }
.certificate {
  max-width: 820px; margin: 0 auto 40px; background: #fff; padding: 56px 64px; text-align: center;
  border: 10px double var(--blue-900); box-shadow: var(--shadow);
}
.certificate h1 { font-size: 2.4rem; letter-spacing: .02em; margin: .2em 0 .8em; }
.cert-name { font-size: 1.9rem; font-weight: 700; color: var(--blue-900); margin: .3em 0 .1em; border-bottom: 2px solid var(--gold); display: inline-block; padding: 0 24px 4px; }
.cert-course { font-size: 1.3rem; font-weight: 600; color: var(--blue-700); }
.cert-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 32px 0 24px; }
.cert-facts div { border-top: 1px solid var(--line); padding-top: 8px; }
.cert-facts dt { font-size: .75rem; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.cert-facts dd { margin: 2px 0 0; font-weight: 600; }

/* Inhaltsblöcke (Kurs-Baukasten) */
.media-block { margin: 1.4em 0; }
.media-block img, .media-block video { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.media-block figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.check-block { border: 1px solid var(--line); border-left: 5px solid var(--blue-500); border-radius: 8px; padding: 14px 18px; margin: 1.4em 0; background: #fff; }
.check-block .qtext { margin-top: 2px; }
.check-options { list-style: none; padding: 0; margin: 8px 0 12px; }
.check-block .option.sol-correct { border-color: var(--ok); background: var(--ok-bg); }
.check-block .option.sol-wrong { border-color: var(--bad); background: var(--bad-bg); }
.check-feedback { font-weight: 600; margin: 10px 0 0; }
.check-feedback.is-ok { color: var(--ok); }
.check-feedback.is-wrong { color: var(--bad); }

/* Interaktive Blöcke: Zuordnen, Phishing-Detektiv, Szenario */
.match-block, .phish-block, .scenario-block { border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 8px; padding: 14px 18px; margin: 1.4em 0; background: #fff; }
.match-pool, .match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; }
.match-pool { padding: 8px; border: 1px dashed var(--line); border-radius: 8px; margin: 8px 0; }
.match-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.match-zone { border: 2px dashed var(--line); border-radius: 8px; padding: 8px; background: var(--bg); }
.match-zone-title { margin: 0 0 6px; font-weight: 700; color: var(--blue-900); }
.match-item { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: grab; max-width: 100%; }
.match-item select { font-size: .82rem; max-width: 100%; }
.match-item.sol-correct { border-color: var(--ok); background: var(--ok-bg); }
.match-item.sol-wrong { border-color: var(--bad); background: var(--bad-bg); }
.match-question { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400 !important; }
.match-row select { min-width: 200px; }
.phish-mail { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; background: var(--bg); }
.phish-head { padding: 8px 14px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 8px 8px 0 0; }
.phish-head p { margin: 2px 0; }
.phish-label { color: var(--muted); display: inline-block; min-width: 64px; }
.phish-body { padding: 4px 14px; }
.phish-spot { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; border-bottom: 1px dotted transparent; }
.phish-spot:hover, .phish-spot:focus-visible { border-bottom-color: var(--muted); }
.phish-spot.is-found { background: var(--warn-bg); outline: 2px solid var(--gold); border-radius: 3px; }
.phish-progress { font-weight: 600; }
.phish-progress.is-ok { color: var(--ok); }
.phish-hints li { margin: 4px 0; }
.scenario-step { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.scenario-step:first-of-type { border-top: 0; }
.scenario-choices { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin: 8px 0; }
.scenario-choice { text-align: left; white-space: normal; }
.scenario-choice.is-chosen.is-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.scenario-choice.is-chosen.is-wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.scenario-feedback { font-weight: 600; }
.scenario-feedback.is-ok { color: var(--ok); }
.scenario-feedback.is-wrong { color: var(--bad); }
.check-solution { margin-top: 10px; font-size: .95rem; }

/* Kurs-Baukasten: Verwaltung */
.preview-banner a { font-weight: 600; }
main .link-button { color: var(--blue-700); text-decoration: underline; }
main .link-button:hover { color: var(--blue-500); }
.card > h2:first-child { margin-top: 0; }
.publish-card.is-dirty { border-top: 4px solid var(--gold); }
.publish-head { display: flex; gap: 48px; flex-wrap: wrap; }
.publish-head p { margin: 2px 0; }
.publish-version { font-size: 1.4rem; font-weight: 700; color: var(--blue-900); }
.publish-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0 8px; }
.publish-form label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; gap: 4px; }
.publish-form input, .form textarea, .glossary-form input, .glossary-form textarea, #module-editor input:not([type=checkbox]):not([type=radio]):not([type=file]), #module-editor textarea, #module-editor select {
  font: inherit; padding: 8px 11px; border: 1px solid #c3ccd9; border-radius: 8px; background: #fff; width: 100%;
}
.publish-form input { min-width: 240px; }
.form textarea, #module-editor textarea { resize: vertical; line-height: 1.5; }
.danger-link { color: var(--bad); }
.button.danger { border-color: var(--bad); color: var(--bad); }
.button.danger:hover { background: var(--bad-bg); }
.button.small-button { padding: 5px 12px; font-size: .9rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin-top: 0; }
.sortable { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.sortable-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; flex-wrap: wrap; }
.module-admin-body { flex: 1 1 260px; display: flex; flex-direction: column; }
.sortable-buttons { display: flex; gap: 2px; }
.drag-handle { cursor: grab; color: var(--muted); font-size: 1.2rem; user-select: none; padding: 0 2px; }
.is-dragging { opacity: .45; }
.is-drop-target { outline: 2px dashed var(--blue-500); outline-offset: 2px; }
.icon-button { border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; padding: 2px 8px; font-size: .8rem; color: var(--blue-700); line-height: 1.6; }
.icon-button:hover { background: var(--blue-50); }
.icon-button.danger-icon { color: var(--bad); }
.audience-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 12px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.glossary-row { display: grid; grid-template-columns: 260px 1fr; gap: 10px; margin-bottom: 10px; }
.danger-zone { border-top: 4px solid var(--bad-bg); margin-top: 32px; }
.danger-zone h2 { margin-top: 0; font-size: 1.1rem; }

/* Kurs-Baukasten: Modul-Editor */
.editor-bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg); padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.editor-status { color: var(--muted); font-size: .92rem; }
.editor-status.is-dirty { color: var(--warn); font-weight: 600; }
.spacer { flex: 1; }
.editor-row { display: flex; gap: 14px; flex-wrap: wrap; }
.editor-row > * { flex: 1 1 200px; }
.editor-field { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; font-weight: 600; font-size: .92rem; }
.editor-field small { font-weight: 400; }
.editor-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.editor-preview { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.editor-preview .card { padding: 20px; }
.page-list, .question-list { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.page-list > .button, .question-list > .button { align-self: flex-start; }
.page-card, .question-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; }
.page-card.is-open { border-color: var(--blue-500); }
.page-head, .block-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-no { font-weight: 700; color: var(--blue-700); white-space: nowrap; }
#module-editor .page-title-input { flex: 1 1 200px; width: auto; font-weight: 600; }
.page-summary { margin: 6px 0 0 32px; }
.block-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.block-card { border: 1px solid var(--line); border-left: 4px solid var(--blue-50); border-radius: 8px; padding: 8px 12px; background: #fcfdff; }
.block-card.block-callout { border-left-color: var(--gold); }
.block-card.block-check { border-left-color: var(--blue-500); }
.block-card.block-image, .block-card.block-video { border-left-color: var(--ok); }
.block-body { margin-top: 6px; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--line); }
.md-toolbar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.md-toolbar button { border: 1px solid var(--line); background: #fff; border-radius: 6px; min-width: 32px; padding: 2px 8px; cursor: pointer; font-weight: 700; }
.md-toolbar button:hover { background: var(--blue-50); }
.md-toolbar span { margin-left: auto; }
.markdown-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem !important; }
.option-editor { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.option-editor > .link-button { align-self: flex-start; }
.option-row { display: flex; gap: 8px; align-items: center; }
.option-row input[type=text], .option-row input:not([type]) { flex: 1; }
.option-correct { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; white-space: nowrap; margin-right: 12px; }
.media-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
.media-thumb { grid-column: 1 / -1; max-width: 100%; max-height: 220px; border-radius: 6px; margin-bottom: 6px; }
.editor-tabs { margin-top: 8px; }

@media print {
  .no-print, .site-header, .site-footer { display: none !important; }
  body, .certificate-page { background: #fff; }
  .certificate { box-shadow: none; margin: 0 auto; }
  @page { size: A4 portrait; margin: 14mm; }
}

@media (max-width: 860px) {
  .hero, .login-layout, .module-layout, .grid-2 { grid-template-columns: 1fr; }
  .module-toc { position: static; }
  .module-item { grid-template-columns: 44px 1fr; }
  .module-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .editor-columns, .glossary-row, .media-picker { grid-template-columns: 1fr; }
  .editor-preview { position: static; max-height: none; }
  .cert-facts { grid-template-columns: repeat(2, 1fr); }
  .certificate { padding: 32px 20px; }
  .attempt-head { flex-direction: column; }
  .timer { top: auto; bottom: 90px; right: 12px; min-width: 96px; padding: 6px 12px; }
  .timer strong { font-size: 1.2rem; }
}

/* Nachschulung, Richtlinie, KI-Werkzeuge */
.badge-update { background: #e8eefc; color: var(--blue-700); }
.status-update { background: var(--blue-700); }
.stat-update { border-top-color: var(--blue-500); }
.module-item.is-outdated .module-number { background: var(--blue-500); color: #fff; }
.policy-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-left: 5px solid var(--gold); }
.policy-card.is-done { border-left-color: var(--ok); }
.policy-card h2 { margin: 0 0 4px; }
.policy-card p { margin: 0; }
.tool-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tool-head h2 { margin: 0 0 12px; font-size: 1.2rem; }
.tool-untersagt { border-left: 5px solid var(--bad); }
.tool-freigegeben { border-left: 5px solid var(--ok); }
.tool-eingeschraenkt { border-left: 5px solid var(--gold); }
.form textarea, .form select { font: inherit; padding: 9px 12px; border: 1px solid #c3ccd9; border-radius: 8px; background: #fff; }

/* Statistik: einfache Balken (eine Reihe, Wert steht daneben) */
.bar { display: inline-block; vertical-align: middle; width: 140px; height: 10px; background: var(--line); border-radius: 4px; overflow: hidden; margin-right: 8px; }
.bar span { display: block; height: 100%; background: var(--blue-500); border-radius: 0 4px 4px 0; }
.chart-table td { white-space: nowrap; }

/* Nachweis-Bericht */
.report-toolbar { max-width: 960px; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-toolbar .filter-bar { margin: 0; }
.report { max-width: 960px; margin: 0 auto 40px; background: #fff; padding: 40px 48px; box-shadow: var(--shadow); }
.report-head { display: flex; gap: 16px; align-items: flex-start; border-bottom: 3px solid var(--gold); margin-bottom: 8px; }
.report-head h1 { font-size: 1.6rem; margin: .1em 0 .2em; }
.report h2 { font-size: 1.2rem; margin-top: 1.6em; }
.report table { margin: .6em 0; }
.report tr.total td { font-weight: 700; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.report-kpis div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.report-kpis strong { display: block; font-size: 1.5rem; color: var(--blue-900); }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; font-size: .85rem; color: var(--muted); }
.signatures span { display: block; border-bottom: 1px solid var(--ink); height: 40px; margin-bottom: 4px; }
@media print {
  .report { box-shadow: none; padding: 0; max-width: none; }
  .report h2 { break-after: avoid; }
  .report tr { break-inside: avoid; }
}
@media (max-width: 860px) {
  .report { padding: 24px 16px; }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
}
.card > h2:first-child { margin-top: 0; }

/* Update per Klick: Live-Anzeige */
.update-headline { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; }
.update-steps { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.update-steps li { padding-left: 22px; position: relative; color: var(--muted); }
.update-steps li::before { position: absolute; left: 0; width: 16px; text-align: center; content: "○"; }
.update-steps li.step-done { color: var(--ok); }
.update-steps li.step-done::before { content: "✓"; }
.update-steps li.step-active { color: var(--blue-700); font-weight: 600; }
.update-steps li.step-active::before { content: "●"; animation: update-pulse 1.2s ease-in-out infinite; }
.update-steps li.step-failed { color: var(--bad); }
.update-steps li.step-failed::before { content: "✕"; }
@keyframes update-pulse { 50% { opacity: .25; } }
.update-log { background: #10182a; color: #d9e2f2; border-radius: 8px; padding: 12px; margin: 0; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .82rem; line-height: 1.45; }
.update-log:empty::before { content: "Noch keine Ausgabe."; color: #8a97ad; }
#update-connection.offline { color: var(--warn); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .update-steps li.step-active::before { animation: none; } }
.update-retry { margin-top: 12px; align-items: center; }
.scenario-step-edit { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
.scenario-step-edit legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.scenario-choice-edit { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.scenario-feedback-input { width: 100%; }
.plain-list { list-style: none; padding: 0; margin: 8px 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.inline-choices { border: 0; padding: 0; margin: 12px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-choices legend { font-weight: 600; margin-bottom: 4px; width: 100%; }
.inline-choices .option { margin: 0; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
/* Abzeichen und Abteilungsvergleich */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badge-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.achievement { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.achievement-icon { font-size: 1.7rem; line-height: 1; filter: grayscale(1); opacity: .45; }
.achievement.is-earned { border-style: solid; border-color: var(--gold); background: #fffaf0; color: var(--ink); }
.achievement.is-earned .achievement-icon { filter: none; opacity: 1; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: grid; grid-template-columns: minmax(120px, 2fr) 3fr 4em; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ranking li.is-own { font-weight: 700; background: var(--blue-50); }
.ranking-bar { height: 10px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.ranking-bar span { display: block; height: 100%; background: var(--blue-500); border-radius: 0 4px 4px 0; }
.ranking-value { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .ranking li { grid-template-columns: 1fr 4em; } .ranking-bar { grid-column: 1 / -1; grid-row: 2; } }
