/* Security-Awareness-Schulung – Design v2 (modern)
   Die Markenfarbe (--brand …) kommt aus /theme.css und wird in den Einstellungen gewählt. */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #5b6577;
  --line: #e4e8ef;
  --line-strong: #cfd6e1;
  --brand: #1f4e79;
  --brand-dark: #163a5a;
  --brand-soft: #e7eff7;
  --brand-text: #1f4e79;
  --on-brand: #ffffff;
  --ok: #15803d;   --ok-soft: #e8f6ee;   --ok-line: #bfe3cc;   --ok-ink: #14532d;
  --fail: #c0362c; --fail-soft: #fdeeec; --fail-line: #f5c9c3; --fail-ink: #7f1d1d;
  --warn: #b45309; --warn-soft: #fef5e4; --warn-line: #f6dcaa; --warn-ink: #78350f;
  --open: #475569; --open-soft: #eef1f5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 380px at 50% -120px, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    var(--bg);
  color: var(--text); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; letter-spacing: -.015em; }
h1 { font-size: 1.9rem; margin: .1em 0 .7em; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; font-weight: 650; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
small { font-size: .85em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ---------- Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line); color: var(--text);
}
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #fff)); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand .shield { width: 36px; height: 36px; color: var(--brand-text); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-weight: 650; letter-spacing: -.01em; }
.brand small { color: var(--muted); }
.logo-badge { display: flex; align-items: center; height: 44px; }
.logo-badge .logo { height: 40px; width: auto; max-width: 160px; object-fit: contain; display: block; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: nowrap; min-width: 0; }
.nav a { white-space: nowrap; color: var(--muted); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 550; font-size: .95rem; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); background: var(--open-soft); }
.nav a.active { color: var(--brand-text); background: var(--brand-soft); }
.userbox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox .who { font-size: .9rem; color: var(--muted); }
.userbox .who::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--ok-soft);
}
.topbar .btn-ghost { background: transparent; }
@media (max-width: 960px) {
  .topbar-inner { gap: 8px 16px; padding: 10px 16px 8px; }
  .nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -4px; padding-bottom: 2px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
}
@media (max-width: 1120px) { .userbox .who { display: none; } }
@media (max-width: 960px) { .userbox .who { display: inline; } }
@media (max-width: 560px) {
  .userbox .who { display: none; }
  .brand { gap: 10px; min-width: 0; flex: 1; }
  .brand-text { min-width: 0; }
  .brand-text strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand small { display: none; }
  .logo-badge { height: 34px; }
  .logo-badge .logo { height: 32px; max-width: 96px; }
  .brand .shield { width: 30px; height: 30px; }
  .container { padding-top: 22px; }
  h1 { font-size: 1.55rem; }
  .status { padding: 18px; gap: 14px; }
  .status-icon { width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; }
}

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 32px 20px 56px; flex: 1; }
.container.wide { max-width: 1200px; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 22px 16px 28px; border-top: 1px solid var(--line); }

/* ---------- Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin-bottom: 20px; }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } .card { padding: 20px 18px; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line-strong)); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff), var(--brand));
  border-color: var(--brand-dark); color: var(--on-brand);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 4px 12px color-mix(in srgb, var(--brand) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--fail); }
.btn-danger:hover { border-color: var(--fail); background: var(--fail-soft); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; padding-top: 12px; padding-bottom: 12px; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 16px; color: #1e293b; }
.form input:not([type=checkbox]):not([type=radio]):not([type=color]), .form textarea, .form select, .table-tools input, .table-tools select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-weight: 400; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.form input:hover:not(:focus), .form textarea:hover:not(:focus), .form select:hover:not(:focus) { border-color: #b4bfcf; }
.form input:focus, .form textarea:focus, .form select:focus, .table-tools input:focus, .table-tools select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.form input::placeholder { color: #98a2b3; }
.form textarea { font-family: "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px 2px; margin: 0 0 18px; background: var(--surface-2); }
.form legend { font-weight: 700; padding: 0 8px; font-size: .95rem; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }

.alert { padding: 13px 16px 13px 44px; border-radius: 12px; margin-bottom: 18px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); position: relative; }
.alert::before { content: "i"; position: absolute; left: 14px; top: 13px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; background: var(--brand); font-family: Georgia, serif; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-error { background: var(--fail-soft); border-color: var(--fail-line); color: var(--fail-ink); }
.alert-error::before { content: "!"; background: var(--fail); font-family: inherit; }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); }
.alert-ok::before { content: "✓"; background: var(--ok); font-family: inherit; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.alert-warn::before { content: "!"; background: var(--warn); font-family: inherit; }
.tip { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .93rem; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 16px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 650; background: var(--open-soft); color: var(--open); white-space: nowrap; vertical-align: middle; letter-spacing: .01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-fail { background: var(--fail-soft); color: var(--fail); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-open { background: var(--open-soft); color: var(--open); }
.badge-admin { background: var(--brand-soft); color: var(--brand-text); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px 12px; }
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .55; }
.table .right { text-align: right; }
.table-scroll { overflow-x: auto; }

/* ---------- Anmeldung */
.login-wrap { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 0; align-items: stretch; margin-top: 3vh;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-card { margin: 0; border: 0; box-shadow: none; border-radius: 0; padding: 36px 36px 30px; }
.login-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.login-head h1 { margin: 0; font-size: 1.6rem; }
.login-head p { margin: 2px 0 0; font-size: .9rem; }
.login-head .shield { width: 50px; height: 50px; color: var(--brand-text); flex: none; }
.login-aside {
  position: relative; padding: 40px 40px 34px; color: #fff; overflow: hidden;
  background:
    radial-gradient(520px 320px at 110% -10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(420px 300px at -10% 110%, rgba(0, 0, 0, .22), transparent 60%),
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 85%, #fff), var(--brand-dark));
}
.login-aside::after {
  content: ""; position: absolute; right: -60px; bottom: -70px; width: 260px; height: 300px; opacity: .12;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.3 8 11 4.6-1.7 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.3 8 11 4.6-1.7 8-6 8-11V5l-8-3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.login-aside h2 { color: #fff; font-size: 1.45rem; margin-bottom: .9em; }
.login-aside .muted { color: rgba(255, 255, 255, .8); }
.ticks { list-style: none; padding: 0; position: relative; z-index: 1; }
.ticks li { padding-left: 34px; position: relative; margin-bottom: 14px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: var(--ok); background: #fff; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; margin-top: 0; }
  .login-card { padding: 26px 22px; min-width: 0; }
  .login-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .login-head > div { min-width: 0; overflow-wrap: anywhere; }
  .login-aside { padding: 26px 22px; }
}

/* ---------- Mitarbeiterübersicht */
.status { display: flex; gap: 18px; align-items: flex-start; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; border: 1px solid; box-shadow: var(--shadow); }
.status h2 { margin: 2px 0 4px; font-size: 1.25rem; }
.status p { margin: 0 0 8px; }
.status p.actions { margin: 12px 0 0; }
.status-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .15); }
.status-ok { background: linear-gradient(135deg, var(--ok-soft), var(--surface) 75%); border-color: var(--ok-line); } .status-ok .status-icon { background: linear-gradient(135deg, #22a055, var(--ok)); }
.status-fail { background: linear-gradient(135deg, var(--fail-soft), var(--surface) 75%); border-color: var(--fail-line); } .status-fail .status-icon { background: linear-gradient(135deg, #e0534a, var(--fail)); }
.status-warn { background: linear-gradient(135deg, var(--warn-soft), var(--surface) 75%); border-color: var(--warn-line); } .status-warn .status-icon { background: linear-gradient(135deg, #d97706, var(--warn)); }
.status-open { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 75%); border-color: color-mix(in srgb, var(--brand) 20%, transparent); } .status-open .status-icon { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 75%, #fff), var(--brand)); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 16px; }
.facts div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px; text-align: center; }
.facts strong { display: block; font-size: 1.55rem; line-height: 1.2; color: var(--brand-text); font-weight: 700; letter-spacing: -.02em; }
.facts span { font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) { .facts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Test */
.quiz-head { margin-bottom: 18px; }
.progress { margin-top: 10px; }
.progress .bar, .stat .bar { height: 8px; background: var(--open-soft); border-radius: 999px; overflow: hidden; }
.progress .bar span, .stat .bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 70%, #fff), var(--brand)); transition: width .35s ease; }
.progress #quiz-label { font-size: .85rem; margin-top: 6px; }
fieldset.question { border: 1px solid var(--line); min-width: 0; }
.question legend, .review header { display: flex; gap: 10px; align-items: center; padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.question legend + * { clear: both; }
.qnum { font-weight: 700; color: var(--brand-text); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.topic { font-size: .76rem; background: var(--brand-soft); color: var(--brand-text); padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.qtext { font-size: 1.15rem; font-weight: 650; margin: .5em 0 1.1em; line-height: 1.45; letter-spacing: -.005em; }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; }
.option:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); background: var(--surface-2); }
.option input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.option:has(input:focus-visible) { box-shadow: var(--ring); }
.quiz-nav { display: flex; gap: 10px; justify-content: space-between; }
.quiz-nav #quiz-next, .quiz-nav #quiz-submit { margin-left: auto; }
.stepper .nojs-submit { display: none; }
.nojs-submit { text-align: right; }

/* ---------- Auswertung */
.result-hero { display: flex; gap: 28px; align-items: center; padding: 26px 30px; border-radius: 20px; margin-bottom: 28px; border: 1px solid; box-shadow: var(--shadow); }
.result-hero.ok { background: linear-gradient(135deg, var(--ok-soft), var(--surface) 80%); border-color: var(--ok-line); --c: var(--ok); }
.result-hero.fail { background: linear-gradient(135deg, var(--fail-soft), var(--surface) 80%); border-color: var(--fail-line); --c: var(--fail); }
.result-hero h1 { margin-top: 0; }
.ring { --p: 0; flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--c) 12%, #fff) 0); }
.ring span { width: 100px; height: 100px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--c); box-shadow: inset 0 2px 6px rgba(15, 23, 42, .06); letter-spacing: -.02em; }
@media (max-width: 600px) { .result-hero { flex-direction: column; text-align: center; } .result-hero .actions { justify-content: center; } }
.filter-row { margin-bottom: 14px; }
.review { border-left: 4px solid var(--ok); }
.review.wrong { border-left-color: var(--fail); }
.review header { float: none; }
.review header .badge { margin-left: auto; }
.answers { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.answers li { padding: 9px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.answers li.correct { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok-ink); font-weight: 600; }
.answers li.correct::before { content: "✓ "; }
.answers li.chosen-wrong { background: var(--fail-soft); border-color: var(--fail-line); color: var(--fail-ink); }
.answers li.chosen-wrong::before { content: "✗ "; }
.explain { background: var(--brand-soft); padding: 12px 16px; border-radius: 10px; margin: 0; font-size: .95rem; }

/* ---------- Verwaltung */
.subnav { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-bottom: 22px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.subnav a { padding: 7px 14px; text-decoration: none; color: var(--muted); border-radius: 9px; font-weight: 600; font-size: .93rem; transition: background .15s, color .15s; }
.subnav a:hover { color: var(--text); background: var(--surface-2); }
.subnav a.active { color: var(--on-brand); background: var(--brand); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { --c: var(--brand); position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px; box-shadow: var(--shadow); overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.stat span { display: block; font-size: .78rem; color: var(--muted); font-weight: 550; }
.stat strong { font-size: 1.75rem; letter-spacing: -.02em; line-height: 1.3; }
.stat.ok { --c: var(--ok); } .stat.fail { --c: var(--fail); }
.stat.warn { --c: var(--warn); } .stat.open { --c: var(--open); }
.stat.quote { --c: var(--ok); }
.stat.quote .bar span { background: linear-gradient(90deg, #4cc27f, var(--ok)); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.table-tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-tools input { flex: 1 1 260px; width: auto; margin: 0; }
.table-tools select { flex: 0 1 200px; width: auto; margin: 0; }
details.menu { position: relative; display: inline-block; text-align: left; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.menu-body .btn, .menu-body form, .menu-body form .btn { width: 100%; justify-content: flex-start; border-color: transparent; box-shadow: none; }
.menu-body .btn:hover { border-color: transparent; background: var(--surface-2); }

.remind summary { cursor: pointer; font-weight: 600; }
.remind-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.remind-form label { margin: 0; }

/* Einstellungen */
h3 { font-size: 1rem; margin: 20px 0 8px; }
.small, table.small { font-size: .85rem; }
.center { text-align: center; }
.text-fail { color: var(--fail); }
.form label small { display: block; font-weight: 400; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; margin: 0 !important; }
.logo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.logo-preview { width: 160px; height: 80px; border: 1.5px dashed var(--line-strong); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); padding: 8px; }
.logo-preview img { max-width: 100%; max-height: 100%; }
.sig-preview { width: 220px; background: #fff; }
.color-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.color-row input[type=color] { width: 56px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; transition: transform .1s; }
.swatch:hover { box-shadow: 0 0 0 2px var(--text); transform: scale(1.08); }
.theme-preview { --pv: var(--brand); display: flex; gap: 10px; align-items: center; margin-bottom: 16px; font-size: .85rem; }
.theme-preview .tp-bar { background: var(--pv); color: #fff; padding: 7px 12px; border-radius: 8px; flex: 1; }
.theme-preview .tp-btn { background: var(--pv); color: #fff; padding: 7px 12px; border-radius: 8px; font-weight: 600; }
.theme-preview .tp-link { color: var(--pv); text-decoration: underline; }

/* Schwere Fragen */
.badge-hard { background: #fef3c7; color: #92400e; }
.question.hard, .review.hard { box-shadow: var(--shadow), inset 0 3px 0 #f59e0b; }

/* Logos auf Anmeldung / Zertifikat */
.login-logo { height: 56px; width: auto; max-width: 140px; object-fit: contain; flex: none; }
.cert-logo { height: 20mm; width: auto; max-width: 75mm; object-fit: contain; margin: 0 0 3mm; }
.logo-preview img { height: 100%; width: auto; object-fit: contain; }
.cert-emblem .shield { margin: 0 0 2mm; }

/* Zugangszettel (nur Druck) */
.print-only { display: none; }

/* ---------- Zertifikat */
.cert-body { background: #e9edf2; }
.cert-toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cert-sheet { padding: 28px 16px; overflow-x: auto; }
.cert { width: 297mm; height: 210mm; margin: 0 auto; background: #fff; padding: 12mm; box-shadow: 0 10px 40px rgba(0, 0, 0, .16); color: #1c2430; border-radius: 2px; }
.cert-frame { height: 100%; border: 2.5mm double var(--brand); padding: 10mm 18mm 8mm; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.cert-org { font-size: 13pt; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-text); font-weight: 600; }
.cert-emblem .shield { width: 22mm; height: 22mm; color: var(--brand-text); margin: 4mm 0 1mm; }
.cert-title { font-family: Georgia, "Times New Roman", serif; font-size: 40pt; color: var(--brand-dark); line-height: 1.1; letter-spacing: .04em; }
.cert-sub { font-size: 14pt; color: var(--muted); margin-bottom: 6mm; }
.cert-text { font-size: 12.5pt; margin: 2mm 0; line-height: 1.6; }
.cert-name { font-family: Georgia, "Times New Roman", serif; font-size: 28pt; font-weight: 700; margin: 2mm 0 0; border-bottom: 1px solid #c9d3df; padding: 0 12mm 1mm; letter-spacing: 0; }
.cert-dept { font-size: 11pt; color: var(--muted); margin: 1mm 0 2mm; }
.cert-topics { font-size: 9.5pt; color: var(--muted); max-width: 210mm; margin: 3mm 0 0; }
.cert-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 10mm; align-items: end; font-size: 10.5pt; }
.cert-line { border-bottom: 1px solid #333; height: 12mm; margin-bottom: 1.5mm; position: relative; }
/* Unterschrift steht auf der Linie und darf sie leicht überschreiten – wie bei einer echten Unterschrift */
.cert-signature { position: absolute; left: 50%; bottom: -2.5mm; transform: translateX(-50%); max-height: 19mm; max-width: 100%; object-fit: contain; }
.cert-sign small, .cert-meta small { color: var(--muted); font-size: 8.5pt; display: block; }
.cert-meta { font-size: 10pt; line-height: 1.5; }
.cert-meta small { word-break: break-all; }

/* ---------- Lernmodul */
.text-ok { color: var(--ok); font-weight: 600; }
.small-label { font-size: .85rem; margin-top: 6px; }
.step { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-size: .8em; font-weight: 700; margin-right: 8px; vertical-align: 2px; box-shadow: 0 3px 8px color-mix(in srgb, var(--brand) 30%, transparent); }
.learn-box .progress { margin: 6px 0 16px; }
.learn-progress { max-width: 520px; margin-bottom: 16px; }
.crumbs { margin: 0 0 12px; font-size: .9rem; color: var(--muted); }
.lesson-index { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.lesson-item { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.lesson-item:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.lesson-item a { text-decoration: none; }
.lesson-item a:hover { text-decoration: underline; }
.lesson-no { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand-text); }
.lesson-item.is-done .lesson-no { background: linear-gradient(135deg, #22a055, var(--ok)); color: #fff; }
.lesson { max-width: 820px; padding: 32px 38px; }
.lesson-head { border-bottom: 1px solid var(--line); margin-bottom: 22px; padding-bottom: 6px; }
.lesson-head h1 { margin-bottom: .2em; }
.lesson h2 { margin: 1.5em 0 .45em; font-size: 1.18rem; color: var(--brand-text); }
.lesson p { margin: 0 0 .85em; }
.lesson-list { margin: 0 0 1em; padding-left: 22px; }
.lesson-list li { margin-bottom: .4em; }
.lesson-list li::marker { color: var(--brand-text); }
.lesson code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.merke { background: linear-gradient(135deg, var(--ok-soft), var(--surface) 90%); border: 1px solid var(--ok-line); border-left: 4px solid var(--ok); border-radius: 12px; padding: 16px 20px; margin: 1.5em 0 .5em; }
.merke-title { display: block; color: var(--ok-ink); margin-bottom: 6px; }
.merke ul { margin: 0; padding-left: 20px; }
.merke li { margin-bottom: .3em; }
.kontakt { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); border-radius: 12px; padding: 12px 16px; margin: .5em 0 1em; }
.mail-example { margin: 1.1em 0 1.3em; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.mail-example figcaption { background: var(--warn-soft); color: var(--warn-ink); font-size: .83rem; font-weight: 650; padding: 7px 16px; border-bottom: 1px solid var(--warn-line); }
.mail-head { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; word-break: break-word; }
.mail-head span { color: var(--muted); display: inline-block; min-width: 64px; }
.mail-body { padding: 14px 16px; font-family: Georgia, "Times New Roman", serif; }
.mail-flags { margin: 0; padding: 12px 16px 14px 36px; background: var(--fail-soft); color: var(--fail-ink); font-size: .92rem; border-top: 1px solid var(--fail-line); }
.mail-flags li::marker { content: "⚠  "; }
.practice-wrap { max-width: 820px; margin-top: 28px; }
.practice-wrap > h2 { margin-bottom: .2em; }
.practice .option.is-right { border-color: var(--ok); background: var(--ok-soft); }
.practice .option.is-wrong { border-color: var(--fail); background: var(--fail-soft); }
.practice-feedback { margin-top: 12px; padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); font-size: .95rem; }
.practice-feedback.ok { background: var(--ok-soft); color: var(--ok-ink); }
.practice-feedback.fail { background: var(--fail-soft); color: var(--fail-ink); }
.practice-solution { margin-top: 12px; }
.practice-solution summary { cursor: pointer; color: var(--brand-text); font-weight: 600; }
.lesson-nav { max-width: 820px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; }
@media (max-width: 600px) { .lesson { padding: 20px 18px; } .lesson-nav { flex-direction: column-reverse; } .lesson-nav .btn, .lesson-nav form, .lesson-nav button { width: 100%; text-align: center; } }

/* Einstellungen: Lernmodul */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form fieldset.mode-choice { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; min-width: 0; background: none; }
.form label.mode-option { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 400; cursor: pointer; transition: border-color .15s, background .15s; }
.form label.mode-option:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.form label.mode-option input { margin-top: 3px; flex: none; }
.form label.mode-option span { display: grid; gap: 2px; }
.form label.mode-option small { margin-top: 0; }
.form label.mode-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.lesson-toggles { display: grid; gap: 4px; margin-bottom: 16px; }
.form .lesson-toggles label.check { margin: 0; font-size: .92rem; padding: 6px 8px; border-radius: 8px; }
.form .lesson-toggles label.check:hover { background: var(--surface-2); }
.form .lesson-toggles label.check small { display: inline; margin: 0; white-space: nowrap; }
.lesson-toggles label.check a { margin-left: auto; }

/* Einstellungen: ausklappbare Bereiche */
.settings-hint { margin: -6px 0 14px; font-size: .9rem; }
.settings-list { max-width: 920px; }
.settings-section { padding: 0; margin-bottom: 12px; overflow: hidden; }
.settings-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; padding: 16px 52px 16px 22px; position: relative; transition: background .15s; }
.settings-section > summary::-webkit-details-marker { display: none; }
.settings-section > summary:hover { background: var(--surface-2); }
.settings-section > summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.settings-section[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.settings-section[open] > summary { border-bottom: 1px solid var(--line); }
.ss-title { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.ss-sum { color: var(--muted); font-size: .88rem; min-width: 0; overflow-wrap: anywhere; }
.ss-body { padding: 20px 22px 22px; }
.ss-body > .form > :last-child { margin-bottom: 0; }
@media (max-width: 560px) { .settings-section > summary { padding: 14px 44px 14px 16px; } .ss-body { padding: 16px; } }

/* Testpostfach */
.testmail-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: start; }
.testmail-list { padding: 0; overflow: hidden; }
.testmail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.testmail-head form { margin: 0; }
.testmail-list ul { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.testmail-list li a { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.testmail-list li a:hover { background: var(--surface-2); }
.testmail-list li a.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.tm-subject { display: block; font-weight: 600; font-size: .93rem; word-break: break-word; }
.tm-meta { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; word-break: break-all; }
.testmail-view { min-width: 0; }
.tm-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 16px; font-size: .93rem; }
.tm-fields dt { color: var(--muted); }
.tm-fields dd { margin: 0; word-break: break-word; }
.tm-frame { display: block; width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 12px; background: #f4f6f9; }
.tm-text { margin-top: 14px; }
.tm-text summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.tm-text pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .85rem; }
@media (max-width: 860px) { .testmail-grid { grid-template-columns: 1fr; } .testmail-list ul { max-height: 260px; } }

/* Weniger Bewegung, falls im System so eingestellt */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ---------- Druck */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; display: block; }
  .topbar, .footer, .subnav, .actions, .alert, .no-print, h1, .cert-toolbar { display: none !important; }
  .container { padding: 0; max-width: none; }
  .print-only { display: block; }
  .slips { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .slip { border: 1px dashed #777; padding: 5mm 6mm; break-inside: avoid; font-size: 10.5pt; }
  .slip-head { font-weight: 700; border-bottom: 1px solid #ccc; padding-bottom: 2mm; margin-bottom: 2mm; }
  .slip td { padding: 1mm 3mm 1mm 0; }
  .slip .small { font-size: 8.5pt; color: #444; }
  .slip .mono { font-size: 12pt; }

  .cert-body { background: #fff; }
  .cert-sheet { padding: 0; overflow: visible; }
  .cert { box-shadow: none; margin: 0; page: cert; break-after: avoid; border-radius: 0; }
}
@page cert { size: A4 landscape; margin: 0; }
