/* Lenterve-Schriften, lokal eingebunden (DSGVO, kein Google Fonts). Lizenz: SIL OFL 1.1, siehe fonts/ */
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("fonts/manrope-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("fonts/manrope-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/space-grotesk-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700; src: url("fonts/space-grotesk-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  /* Marke und Signalfarben: wie im Team-Portal */
  --brand: #635BFF; --play: #9B5CFF; --radio: #21C7D9;
  --ok: #25C58A; --warn: #F5B83D; --bad: #F05D5E; --info: #4DA3FF; --on-color: #171923;

  /* Hell: Die Seite hat den Hintergrund, alles andere (Leisten, Karten, Dialoge, Buttons, Felder) den Sekundärhintergrund. */
  --page: #FFFFFF;
  --surface: #E9ECF1;
  --hover: #F4F5F8;
  --ink: #171923;

  --line: color-mix(in srgb, var(--ink) 13%, var(--surface));
  --muted: color-mix(in srgb, var(--ink) 68%, var(--surface));
  --inset: color-mix(in srgb, var(--ink) 4%, var(--surface));   /* kleine Flächen in Karten (Hinweise, Vorschauen) */
  --accent-ink: #FFFFFF;
  --accent-text: color-mix(in srgb, var(--brand) 78%, var(--ink));
  --focus: var(--brand);
  --radius: 10px; --radius-sm: 7px;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", "Manrope", system-ui, sans-serif;

  /* Alte Namen dieses Stylesheets, auf die neuen Werte abgebildet */
  --indigo: var(--brand);
  --indigo-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: var(--surface); --bg2: var(--surface);
  --text: var(--ink);
  --ok-text: color-mix(in srgb, var(--ok) 60%, var(--ink));
  --err: var(--bad);
  --err-text: color-mix(in srgb, var(--bad) 65%, var(--ink));
  --warn-text: color-mix(in srgb, var(--warn) 45%, var(--ink));
  --font: var(--font-ui); --head: var(--font-head);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #1B1E28;
    --surface: #14171F;
    --hover: #171B23;
    --ink: #F4F5F7;
    --accent-text: color-mix(in srgb, var(--brand) 55%, var(--ink));
    --focus: color-mix(in srgb, var(--brand) 60%, var(--ink));
    --indigo-soft: color-mix(in srgb, var(--brand) 22%, transparent);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--page); color: var(--ink); font: 500 15px/1.55 var(--font-ui); min-height: 100vh; }
body.pub { font-size: 16px; line-height: 1.6; }   /* Bewerber-Seite: etwas größer */
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.06rem; color: var(--muted); max-width: 62ch; }

/* Kopfleiste: wie im Team-Portal (drei Marken-Punkte, Sekundärhintergrund, feine Linie) */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top)) 24px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar > :last-child:not(:first-child) { margin-left: auto; }
.brand { display: inline-flex; align-items: center; font-family: var(--font-head); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; text-decoration: none; color: inherit; }
.brand::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-right: 38px; background: var(--brand); box-shadow: 13px 0 0 var(--play), 26px 0 0 var(--radio); }
.brand small { font-family: var(--font-ui); font-weight: 600; font-size: 15px; color: var(--muted); padding-left: 14px; margin-left: 14px; border-left: 1px solid var(--line); letter-spacing: 0; }
.wrap { max-width: 800px; margin: 0 auto; padding: 2.25rem 1.25rem 8rem; }
.wrap.wide { max-width: 1120px; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem); }

/* Zeitleiste: das eine auffällige Element */
.drain { position: fixed; top: 0; left: 0; right: 0; height: 5px; z-index: 30; background: var(--indigo-soft); }
.drain span { display: block; height: 100%; background: var(--indigo); transform-origin: left center; transition: transform .3s linear; }
.drain.low span { background: var(--err); }
.timer {
  font-family: var(--head); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1rem;
  padding: .35rem .85rem; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); white-space: nowrap;
}
.timer.low { background: rgba(240, 93, 94, .16); color: var(--err-text); }
.langsw { display: flex; gap: .35rem; }
.adminlink { font-size: .8rem; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 1px solid transparent; }
.adminlink:hover { color: var(--indigo); border-color: var(--indigo); }
.flagbtn { width: 2.1rem; height: 1.6rem; padding: 0; border: 2px solid transparent; border-radius: 5px; overflow: hidden; cursor: pointer; background: var(--surface); line-height: 0; opacity: .55; transition: opacity .15s, border-color .15s; }
.flagbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flagbtn:hover { opacity: .85; }
.flagbtn.is-active { opacity: 1; border-color: var(--indigo); }

/* Buttons: wie im Team-Portal (Sekundärhintergrund, Hover, Markenfarbe) */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 14px/1.4 var(--font-ui); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--hover); border-color: color-mix(in srgb, var(--ink) 30%, var(--surface)); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; }
.btn.danger { color: var(--err-text); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { min-height: 34px; padding: 5px 11px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.pub .btn { min-height: 44px; padding: .7rem 1.1rem; font-size: .95rem; }   /* Bewerber: großzügige Tippflächen */
.pub .btn.small { min-height: 36px; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

/* Formulare */
.field { display: block; margin-bottom: 1.1rem; }
.field > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.field small, .hint { display: block; color: var(--muted); font-size: .84rem; margin-top: .35rem; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; min-height: 38px; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .75rem;
}
.pub input[type=text], .pub input[type=password], .pub input[type=number], .pub textarea, .pub select { min-height: 44px; padding: .6rem .8rem; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.fixedname { margin: 0; min-height: 44px; display: flex; align-items: center; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--inset); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; margin: .5rem 0; }
.check input { width: 1.15rem; height: 1.15rem; margin: .22rem 0 0; accent-color: var(--indigo); flex: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.1rem; }

/* Startseite */
.facts { display: flex; flex-wrap: wrap; gap: 1.25rem 2.75rem; margin: 1.75rem 0; padding: 1.25rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { display: flex; flex-direction: column; }
.facts b { font-family: var(--head); font-size: 1.55rem; line-height: 1.15; }
.facts span { color: var(--muted); font-size: .88rem; }

/* Lerntext */
.learn { font-size: 1.05rem; line-height: 1.75; }
.learn > * { max-width: 68ch; }
.learn h2, .learn h3, .learn h4 { margin-top: 1.6em; }
.learn > :first-child { margin-top: 0; }
.learn ul, .learn ol { padding-left: 1.3em; margin: 0 0 1em; }
.learn li { margin: .2em 0; }
.learn blockquote { margin: 1.2em 0; padding: .7em 1em; border-left: 3px solid var(--indigo); background: var(--indigo-soft); border-radius: 0 8px 8px 0; }
.learn code { background: var(--inset); padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.learn hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.after { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

/* Prüfungsbogen */
.qlist { list-style: none; margin: 0; padding: 0 clamp(1.25rem, 4vw, 2.25rem); }
.q { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0 1rem; padding: 1.75rem 0; border-top: 1px solid var(--line); }
.q:first-child { border-top: 0; }
.q-num { font-family: var(--head); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--muted); opacity: .4; font-variant-numeric: tabular-nums; transition: color .2s; }
.q.answered .q-num { color: var(--indigo); opacity: 1; }
.q fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { padding: 0; font-weight: 650; font-size: 1.08rem; line-height: 1.45; margin-bottom: .35rem; white-space: pre-wrap; }
.q-hint { font-size: .86rem; color: var(--muted); margin: 0 0 .6rem; }
.opt { position: relative; display: flex; gap: .85rem; align-items: flex-start; padding: .7rem .85rem; margin: .15rem -.85rem; border-radius: var(--radius-sm); cursor: pointer; }
.opt:hover { background: var(--hover); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.box { flex: none; width: 1.45rem; height: 1.45rem; margin-top: .06rem; border: 2px solid var(--muted); border-radius: 5px; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.opt.radio .box { border-radius: 50%; }
.opt input:checked + .box { background: var(--indigo); border-color: var(--indigo); }
.opt input:checked + .box::after { content: ""; width: .4rem; height: .75rem; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.opt.radio input:checked + .box::after { width: .5rem; height: .5rem; border: 0; border-radius: 50%; background: #fff; transform: none; }
.opt input:focus-visible + .box { outline: 2px solid var(--indigo); outline-offset: 3px; }
.opt:has(input:checked) { background: var(--indigo-soft); }

.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom)); }
.bottombar .in { max-width: 800px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wide + .bottombar .in, .bottombar.wide .in { max-width: 1120px; }

.done { text-align: center; padding-block: 3rem; }
.done .lead { margin-inline: auto; }
.done-mark { width: 4.5rem; height: 4.5rem; margin: 0 auto 1.5rem; border-radius: 16px; background: var(--brand); transform: rotate(45deg); display: grid; place-items: center; }
.done-mark::after { content: ""; width: 1rem; height: 1.9rem; border: solid #fff; border-width: 0 5px 5px 0; transform: rotate(0deg) translate(-2px, -3px); }

/* Badges, Hinweise */
.badge { display: inline-flex; align-items: center; font-family: var(--font); font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--inset); color: var(--muted); white-space: nowrap; vertical-align: middle; letter-spacing: 0; }
.badge.ok { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok-text); }
.badge.err { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--err-text); }
.badge.warn { background: color-mix(in srgb, var(--warn) 24%, transparent); color: var(--warn-text); }
.badge.info { background: color-mix(in srgb, var(--info) 18%, transparent); color: color-mix(in srgb, var(--info) 60%, var(--ink)); }
.errors { background: rgba(240, 93, 94, .1); border: 1px solid rgba(240, 93, 94, .4); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.25rem; color: var(--err-text); }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.toast { position: fixed; left: 50%; bottom: calc(5.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; background: var(--text); color: var(--bg); padding: .75rem 1.15rem; border-radius: var(--radius-sm); font-weight: 600; max-width: min(90vw, 480px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.err { background: var(--err); color: #fff; }

.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 18, .6); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: calc(1.25rem + env(safe-area-inset-top)) 1rem 1.25rem; }
.modal { width: 100%; max-width: 780px; margin: auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); }
.modal.narrow { max-width: 440px; }

/* Ausbilder-Bereich */
.row-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.row-head h1, .row-head h2 { margin: 0; }
.nav { display: flex; gap: .25rem; align-items: center; }
.nav .btn[aria-current="page"] { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); border-color: var(--brand); color: var(--accent-text); }
.list { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.item { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; align-items: center; justify-content: space-between; padding: 1.15rem 1.35rem; border-top: 1px solid var(--line); }
.person-item { align-items: flex-start; }
.due-banner { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: space-between; background: rgba(245, 184, 61, .12); border-color: rgba(245, 184, 61, .4); }
.portal-list { display: grid; gap: .9rem; margin-top: 1.25rem; }
.portal-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; }
.portal-card-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.portal-card-head b { font-size: 1.05rem; }
.portal-card-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin-top: .4rem; color: var(--muted); font-size: .88rem; }
.item:first-child { border-top: 0; }
.item h3 { margin: 0 0 .2rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.item p { margin: 0; }
.section { margin-bottom: 1.25rem; }
.segmented { display: inline-flex; background: var(--inset); border-radius: var(--radius-sm); padding: 3px; margin-bottom: .6rem; }
.segmented button { border: 0; background: transparent; color: var(--muted); font: 600 .85rem var(--font); padding: .45rem .9rem; border-radius: 8px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); color: var(--accent-text); }
.preview { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 1rem 1.25rem; min-height: 8rem; }

.qedit { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem 1rem; margin-bottom: .9rem; }
.qedit.critical { border-color: rgba(240, 93, 94, .55); }
.qedit-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.qedit-head b { font-family: var(--head); font-size: 1.5rem; color: var(--indigo); line-height: 1; flex: none; }
.qedit-head .qsum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qedit-head .actions { flex: none; }
.qmeta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin: .7rem 0 .9rem; }
.qmeta select { width: auto; }
.qmeta .inline { display: flex; align-items: center; gap: .5rem; font-size: .92rem; font-weight: 600; margin: 0; }
.qmeta input[type=number] { width: 5.5rem; }
.arow { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.arow input[type=text] { flex: 1; min-width: 0; }
.corr { display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; flex: none; width: 5.4rem; }
.corr input { width: 1.15rem; height: 1.15rem; accent-color: var(--ok); margin: 0; }
.corr:has(input:checked) { color: var(--ok-text); }

.tablewrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.tablewrap td.actions { white-space: nowrap; }
th { border-top: 0; font-size: .82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr:focus-visible { background: var(--hover); }
.flags { display: flex; flex-wrap: wrap; gap: .3rem; }

.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1.25rem 0; padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary div { display: flex; flex-direction: column; gap: .15rem; }
.summary b { font-family: var(--head); font-size: 1.35rem; }
.summary span { color: var(--muted); font-size: .86rem; }
.dq { padding: 1rem 0; border-top: 1px solid var(--line); }
.dq-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: .45rem; }
.dq-head p { margin: 0; font-weight: 650; white-space: pre-wrap; }
.dans { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem .65rem; border-radius: 8px; margin: .2rem 0; font-size: .95rem; }
.dans .mk { flex: none; width: 1.3rem; font-weight: 800; text-align: center; }
.dans.hit { background: rgba(37, 197, 138, .14); }
.dans.wrong { background: rgba(240, 93, 94, .14); }
.dans.miss { box-shadow: inset 0 0 0 1px rgba(37, 197, 138, .7); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .84rem; color: var(--muted); }

.login { max-width: 420px; margin: 8vh auto 0; }


/* Ablauf auf der Startseite (echte Reihenfolge) */
.steps { list-style: none; counter-reset: step; margin: 0 0 1.75rem; padding: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; column-gap: .75rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(step); grid-row: span 2; font-family: var(--head); font-weight: 700; font-size: 1.35rem; color: var(--indigo); line-height: 1.2; }
.steps b { font-weight: 700; }
.steps span { color: var(--muted); font-size: .9rem; }

/* Medien im Lerninhalt und in Fragen */
.media { margin: 0 0 1.5rem; max-width: 100% !important; }
.media img, .media video { display: block; width: 100%; max-height: 75vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--inset); }
.media audio { width: 100%; }
.media figcaption { font-size: .88rem; color: var(--muted); margin-top: .45rem; }
.q-media { margin: .25rem 0 .9rem; }
.q-media .media { margin-bottom: .75rem; }
.q textarea { margin-top: .25rem; }

/* Upload-Fragen */
.upl { margin-top: .4rem; }
.files { list-style: none; margin: 0 0 .6rem; padding: 0; }
.files li { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .45rem; }
.files img, .ficon { width: 3rem; height: 3rem; flex: none; border-radius: 7px; object-fit: cover; background: var(--inset); }
.ficon { display: grid; place-items: center; font-weight: 800; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.fname { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; font-size: .93rem; }
.fname small { display: block; font-weight: 500; color: var(--muted); }
.progress { height: 6px; border-radius: 99px; background: var(--indigo-soft); overflow: hidden; margin: .6rem 0; }
.progress span { display: block; height: 100%; background: var(--indigo); transform-origin: left center; transform: scaleX(0); transition: transform .2s; }

/* Editor: Themen */
.sedit { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.sedit-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.25rem; }
.snum { font-family: var(--head); font-size: 2rem; line-height: 1; color: var(--indigo); width: 2.2rem; }
.stitle { flex: 1; min-width: 220px; }
.stitle input { font-family: var(--head); font-weight: 600; font-size: 1.1rem; }
.stitle small { display: block; margin-top: .3rem; }
.sbody { border-top: 1px solid var(--line); padding: 1.25rem; background: var(--inset); border-radius: 0 0 var(--radius) var(--radius); }
.sbody > h3 { margin: 1.5rem 0 .4rem; }
.sbody > h3:first-child { margin-top: 0; }
.sbody > textarea, .sbody .preview { background: var(--surface); }
.check.inline { margin: 0; display: inline-flex; align-items: center; }
.check.inline input { margin-top: 0; }

/* Übersetzungsfelder (Englisch) im Editor */
.inlineflag { width: 1.15rem; height: .86rem; border-radius: 2px; object-fit: cover; vertical-align: -1px; margin-right: .3rem; flex: none; }
.trfield { opacity: .92; }
.trfield input, .trfield textarea { background: var(--inset); }
.arow-group { margin-bottom: .6rem; }
.arow-group .arow:first-child { margin-bottom: .3rem; }
.arow.tr { background: var(--inset); border-radius: var(--radius-sm); padding: .35rem .6rem; margin-left: 5.4rem; display: flex; align-items: center; gap: .4rem; }
.arow.tr .tr-inputwrap { flex: 1; display: flex; align-items: center; gap: .4rem; min-width: 0; }
.arow.tr input[type=text], .arow.tr textarea { border-color: transparent; background: transparent; padding-left: 0; }
.arow.tr textarea { flex: 1; resize: vertical; }
.trgo { flex: none; font-size: 1rem; padding: .3rem .45rem; }
.trfield .arow.tr { margin-left: 0; }
.field.trfield { margin-bottom: 1.1rem; }
.field.trfield > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.qtext-tr { margin: -.3rem 0 .8rem; }
@media (max-width: 560px) { .arow.tr { margin-left: 0; } }

.medit { margin: .6rem 0; }
.mlist { display: grid; gap: .5rem; margin-bottom: .6rem; }
.mitem { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.mitem input[type=text] { flex: 1; min-width: 160px; }
.mthumb { position: relative; width: 5.5rem; height: 3.6rem; flex: none; border-radius: 7px; overflow: hidden; background: var(--inset); display: grid; place-items: center; }
.mthumb img, .mthumb video { width: 100%; height: 100%; object-fit: cover; }
.mtype { position: absolute; left: .3rem; bottom: .25rem; font-size: .68rem; font-weight: 700; background: rgba(0,0,0,.6); color: #fff; padding: .05rem .35rem; border-radius: 4px; }
.mthumb .mtype:only-child { position: static; background: none; color: var(--muted); font-size: .8rem; }
.uset { padding: .75rem .9rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.uset .actions { gap: .4rem 1.1rem; margin: .4rem 0; }

/* Ergebnisse: Freitext, Dateien, Bewertung */
.dsec { margin: 1.75rem 0 .2rem; padding-top: 1rem; border-top: 2px solid var(--indigo-soft); }
.textans { white-space: pre-wrap; background: var(--inset); border-radius: 8px; padding: .7rem .9rem; font-size: .95rem; }
.afiles { display: grid; gap: .75rem; }
.afile img, .afile video { display: block; max-width: 100%; max-height: 360px; border-radius: 8px; margin-bottom: .3rem; background: var(--inset); }
.afile audio { width: 100%; }
.grade { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .7rem; padding: .6rem .75rem; border-radius: var(--radius-sm); background: var(--indigo-soft); }
.grade .inline { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; }
.grade input { width: 6rem; }

@media (max-width: 560px) {
  .q { grid-template-columns: 2.3rem 1fr; gap: 0 .6rem; }
  .q-num { font-size: 1.6rem; }
  .corr span { display: none; }
  .corr { width: auto; }
  .topbar { padding-inline: 1rem; }
  .brand small:not(#step) { display: none; }
  .brand small { font-size: .8rem; }
  .timer { font-size: .92rem; padding: .3rem .7rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Unterleiste im Ausbilder-Bereich (Tests / Ergebnisse, Sprache) */
.subbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.subbar .nav { gap: .35rem; }

/* Handy: weniger wichtige Spalten ausblenden, Team-Link in der Kopfleiste der Bewerber-Seite weglassen, Kopfleiste kompakter */
@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 560px) {
  .adminlink { display: none; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px 10px; }
  .brand::before { margin-right: 34px; }
}
@media (max-width: 640px) {
  .tablewrap th, .tablewrap td { padding: .55rem .5rem; }
  .tablewrap .badge { white-space: normal; text-align: center; }
  .tablewrap td:first-child, .tablewrap th:first-child { padding-left: .75rem; }
  .tablewrap td:last-child, .tablewrap th:last-child { padding-right: .75rem; }
}

/* Sprach-Umschalter im Editor: nur die Felder der gewählten Sprache zeigen */
.editlang { display: flex; gap: .5rem; margin: .5rem 0 1rem; position: sticky; top: 0; z-index: 5; padding: .5rem 0; background: var(--page); }
.editlang .flagbtn.big { width: auto; height: auto; display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 999px; font-weight: 600; font-size: .95rem; line-height: 1.2; border: 2px solid var(--line); background: var(--surface); color: var(--ink); opacity: .7; }
.editlang .flagbtn.big img { width: 26px; height: 19px; border-radius: 3px; }
.editlang .flagbtn.big.is-active { opacity: 1; border-color: var(--brand); }
.trfield, .sedit .arow.tr, .qedit .arow.tr { display: none; }
