:root {
  --bg: #f5f3ee;
  --flaeche: #fffdf9;
  --flaeche-2: #efece5;
  --linie: #ddd8cd;
  --text: #1f2126;
  --text-2: #5b5f66;
  --akzent: #0d6b6b;
  --akzent-2: #0a5656;
  --akzent-hell: #d9eeec;
  --ok: #217a3c;
  --ok-hell: #e1f2e5;
  --fehler: #b3322b;
  --fehler-hell: #f8e3e1;
  --info: #7a5a10;
  --info-hell: #f6edd3;
  --code-bg: #ebe7de;
  --term-bg: #16181d;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(30, 30, 20, .06), 0 2px 8px rgba(30, 30, 20, .05);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171b; --flaeche: #1d2025; --flaeche-2: #252930; --linie: #343941; --text: #e8e6e1; --text-2: #a3a7ae;
    --akzent: #4fb8b0; --akzent-2: #6fcac2; --akzent-hell: #1d3634; --ok: #5cc27a; --ok-hell: #1b3022;
    --fehler: #ef7d74; --fehler-hell: #3a2020; --info: #e2bd62; --info-hell: #352d17; --code-bg: #2a2e35;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171b; --flaeche: #1d2025; --flaeche-2: #252930; --linie: #343941; --text: #e8e6e1; --text-2: #a3a7ae;
  --akzent: #4fb8b0; --akzent-2: #6fcac2; --akzent-hell: #1d3634; --ok: #5cc27a; --ok-hell: #1b3022;
  --fehler: #ef7d74; --fehler-hell: #3a2020; --info: #e2bd62; --info-hell: #352d17; --code-bg: #2a2e35;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--akzent); }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; white-space: nowrap; }
pre { background: var(--code-bg); padding: .8em 1em; border-radius: 8px; overflow-x: auto; line-height: 1.5; position: relative; }
pre code { white-space: pre; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .94em; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .5em .7em; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); font-size: .9em; background: var(--flaeche-2); }
blockquote { margin: 1em 0; padding: .6em 1em; border-left: 3px solid var(--akzent); background: var(--flaeche-2); border-radius: 0 8px 8px 0; font-style: italic; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
.versteckt { display: none !important; }

/* ---------- Kopfzeile ---------- */
header.kopf {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  padding: .55rem 1.2rem; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: .55rem; font-weight: 650; text-decoration: none; color: var(--text); white-space: nowrap; }
.marke svg { width: 26px; height: 26px; }
nav.haupt { display: flex; gap: .2rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav.haupt a { padding: .35rem .7rem; border-radius: 7px; text-decoration: none; color: var(--text-2); white-space: nowrap; font-size: .95em; }
nav.haupt a:hover { background: var(--flaeche-2); color: var(--text); }
nav.haupt a.aktiv { background: var(--akzent-hell); color: var(--akzent-2); font-weight: 600; }
.fortschritt-mini { display: flex; align-items: center; gap: .5rem; font-size: .85em; color: var(--text-2); white-space: nowrap; }
.balken { width: 90px; height: 6px; background: var(--flaeche-2); border-radius: 3px; overflow: hidden; }
.balken > i { display: block; height: 100%; background: var(--akzent); border-radius: 3px; transition: width .4s; }
.knopf-klein { background: none; border: 1px solid var(--linie); color: var(--text-2); border-radius: 7px; padding: .25rem .6rem; font-size: .85em; }
.knopf-klein:hover { color: var(--text); border-color: var(--text-2); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--linie); background: var(--flaeche);
  color: var(--text); padding: .45rem .9rem; border-radius: 8px; font-size: .93em; line-height: 1.3; text-decoration: none;
}
.knopf:hover { border-color: var(--text-2); }
.knopf.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; font-weight: 600; }
.knopf.primaer:hover { background: var(--akzent-2); }
.knopf.gefahr { color: var(--fehler); }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .2rem; }

/* ---------- Übersicht ---------- */
main.seite { max-width: 1080px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }
.held { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; margin-bottom: 2.2rem; }
.held h1 { font-size: 2.1rem; margin: .2rem 0 .6rem; }
.held p { color: var(--text-2); margin: 0 0 1rem; max-width: 36em; }
.held .karte { padding: 1.2rem 1.4rem; }
.ueber-zahl { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.ueber-zahl small { font-size: .9rem; color: var(--text-2); font-weight: 500; }
.balken.gross { width: 100%; height: 10px; border-radius: 5px; margin: .8rem 0 .4rem; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); }
.modulliste { display: grid; gap: .7rem; }
.modul-zeile {
  display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1.1rem;
  text-decoration: none; color: var(--text); transition: border-color .15s;
}
.modul-zeile:hover { border-color: var(--akzent); }
.modul-nr { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--flaeche-2); color: var(--text-2); }
.modul-zeile.fertig .modul-nr { background: var(--ok-hell); color: var(--ok); }
.modul-zeile.zuletzt .modul-nr { background: var(--akzent); color: #fff; }
.modul-zeile h3 { margin: 0; font-size: 1.05rem; }
.modul-zeile p { margin: .15rem 0 0; color: var(--text-2); font-size: .92em; }
.modul-meta { text-align: right; font-size: .85em; color: var(--text-2); white-space: nowrap; }
.modul-meta b { color: var(--text); font-weight: 600; }
.abschnitt-titel { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 2rem 0 .7rem; font-weight: 600; }
.maschinen { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.maschine { padding: .8rem 1rem; font-size: .92em; }
.maschine b { display: block; }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); margin-right: .4rem; vertical-align: middle; }
.punkt.an { background: var(--ok); }

/* ---------- Modul-Ansicht mit Terminal ---------- */
.arbeitsplatz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); height: calc(100vh - 49px); height: calc(100dvh - 49px); }
.arbeitsplatz.ohne-terminal { grid-template-columns: 1fr; }
.arbeitsplatz.ohne-terminal .terminal-spalte { display: none; }
.inhalt-spalte { overflow-y: auto; padding: 2rem 2.2rem 5rem; }
.inhalt { max-width: 760px; margin: 0 auto; }
.modul-kopf .kicker { color: var(--akzent); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.modul-kopf h1 { font-size: 1.9rem; margin: .3rem 0 .5rem; }
.ziel { background: var(--akzent-hell); border-radius: var(--radius); padding: .8rem 1.1rem; margin: 1rem 0 1.5rem; }
.ziel p { margin: 0; }
.ziel b { color: var(--akzent-2); }
.text-abschnitt h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.admonition { border-radius: var(--radius); padding: .7rem 1rem; margin: 1.2rem 0; background: var(--flaeche-2); border-left: 4px solid var(--text-2); }
.admonition > p:first-child { font-weight: 650; margin: 0 0 .3rem; }
.admonition > p:last-child { margin-bottom: 0; }
.admonition.tip, .admonition.note { border-color: var(--akzent); background: var(--akzent-hell); }
.admonition.warning { border-color: var(--info); background: var(--info-hell); }
.admonition.danger { border-color: var(--fehler); background: var(--fehler-hell); }
.vm-hinweis { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.2rem; margin: 1.5rem 0; border: 1px dashed var(--akzent); border-radius: var(--radius); background: var(--flaeche); }
.vm-hinweis p { margin: 0 0 .6rem; }

.uebung { margin: 2rem 0; overflow: hidden; }
.uebung-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.2rem .6rem; }
.uebung-kopf h3 { margin: 0; font-size: 1.15rem; }
.uebung-kopf .etikett { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--akzent); }
.abzeichen { font-size: .8rem; border-radius: 99px; padding: .15rem .65rem; background: var(--flaeche-2); color: var(--text-2); white-space: nowrap; }
.abzeichen.ok { background: var(--ok-hell); color: var(--ok); font-weight: 600; }
.uebung-rumpf { padding: 0 1.2rem 1.1rem; }
.warum { border-left: 3px solid var(--akzent); padding: .1rem 0 .1rem .9rem; color: var(--text-2); margin: .3rem 0 1rem; }
.warum b { color: var(--text); }
.warum p { margin: .2rem 0; }
.formular { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; }
.formular label { display: flex; flex-direction: column; font-size: .85em; color: var(--text-2); gap: .2rem; }
.formular input { padding: .4rem .6rem; border: 1px solid var(--linie); border-radius: 7px; background: var(--flaeche); color: var(--text); min-width: 12em; }
.ergebnis { margin: .9rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--linie); }
.ergebnis li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .3rem; padding: .45rem 0; border-bottom: 1px solid var(--linie); font-size: .95em; }
.ergebnis li .zeichen { font-weight: 700; }
.ergebnis li.ok .zeichen { color: var(--ok); }
.ergebnis li.fehler .zeichen { color: var(--fehler); }
.ergebnis li.info .zeichen { color: var(--info); }
.ergebnis .tipp { display: block; color: var(--text-2); font-size: .92em; }
.ergebnis-kopf { margin-top: 1rem; padding: .6rem .9rem; border-radius: 8px; font-weight: 600; }
.ergebnis-kopf.ok { background: var(--ok-hell); color: var(--ok); }
.ergebnis-kopf.fehler { background: var(--fehler-hell); color: var(--fehler); }
.erklaerung { background: var(--ok-hell); border-radius: 8px; padding: .4rem .9rem; margin-top: .6rem; }
.aufklapp { margin-top: .6rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); }
.aufklapp > summary { padding: .5rem .9rem; cursor: pointer; font-weight: 600; font-size: .93em; list-style: none; display: flex; align-items: center; gap: .5rem; }
.aufklapp > summary::-webkit-details-marker { display: none; }
.aufklapp > summary::before { content: "›"; font-size: 1.2em; transition: transform .15s; color: var(--text-2); }
.aufklapp[open] > summary::before { transform: rotate(90deg); }
.aufklapp > div { padding: 0 .9rem .6rem; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--linie); font-size: .9em; }
.werkzeuge .knopf { font-size: .85em; padding: .3rem .7rem; color: var(--text-2); }

.quiz { padding: 1rem 1.2rem; margin: 2rem 0; }
.quiz h3 { margin: 0 0 .6rem; font-size: 1.1rem; }
.frage { padding: .7rem 0; border-top: 1px solid var(--linie); }
.frage > div > p:first-child { margin-top: 0; font-weight: 600; }
.antworten { display: grid; gap: .35rem; margin-top: .4rem; }
.antworten label { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .7rem; border: 1px solid var(--linie); border-radius: 8px; cursor: pointer; background: var(--flaeche); }
.antworten label:hover { border-color: var(--text-2); }
.antworten label p { margin: 0; }
.antworten input { margin-top: .35rem; accent-color: var(--akzent); }
.antworten label.richtig { border-color: var(--ok); background: var(--ok-hell); }
.antworten label.falsch { border-color: var(--fehler); background: var(--fehler-hell); }
.frage input[type=text] { padding: .45rem .6rem; border: 1px solid var(--linie); border-radius: 8px; width: min(100%, 22em); background: var(--flaeche); color: var(--text); }
.frage .rueckmeldung { margin-top: .4rem; font-size: .93em; padding: .4rem .7rem; border-radius: 7px; }
.frage .rueckmeldung.richtig { background: var(--ok-hell); }
.frage .rueckmeldung.falsch { background: var(--fehler-hell); }
.frage .rueckmeldung p { margin: .2rem 0; }

.modul-fuss { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }

/* Terminal-Spalte */
.terminal-spalte { display: flex; flex-direction: column; background: var(--term-bg); border-left: 1px solid #000; min-height: 0; }
.term-reiter { display: flex; align-items: center; gap: .25rem; padding: .4rem .5rem 0; background: #0f1115; }
.term-reiter button { background: none; border: 0; color: #9aa0a8; padding: .45rem .9rem; border-radius: 7px 7px 0 0; font-size: .9em; display: flex; align-items: center; gap: .45rem; }
.term-reiter button.aktiv { background: var(--term-bg); color: #f1f1f1; }
.term-reiter button small { color: #6d737c; font-size: .8em; }
.term-reiter .rechts { margin-left: auto; display: flex; gap: .3rem; padding-bottom: .3rem; }
.term-reiter .rechts button { border-radius: 6px; padding: .25rem .6rem; font-size: .8em; border: 1px solid #2c3038; }
.term-reiter .rechts button:hover { color: #fff; border-color: #555; }
.term-status { width: 7px; height: 7px; border-radius: 50%; background: #666; }
.term-status.verbunden { background: #4cc270; }
.terminals { flex: 1; position: relative; min-height: 0; }
.terminals > div { position: absolute; inset: 0; padding: .5rem 0 .3rem .6rem; }
.term-fuss { color: #858b94; font-size: .78em; padding: .35rem .8rem; border-top: 1px solid #262a31; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.term-fuss b { color: #c9ccd1; font-weight: 600; }
.term-umschalter { display: none; }

/* ---------- Rechenzentrum / BMC ---------- */
.bmc { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.2rem 3rem; }
.bmc-kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: #1f2a33; color: #e9eef2; border-radius: var(--radius) var(--radius) 0 0; padding: .8rem 1.2rem; }
.bmc-kopf h1 { font-size: 1.1rem; margin: 0; font-weight: 600; }
.bmc-kopf small { color: #a9b6c1; }
.bmc-leiste { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .88em; }
.bmc-leiste span { display: flex; align-items: center; gap: .35rem; }
.bmc-rahmen { display: grid; grid-template-columns: 200px 1fr; border: 1px solid var(--linie); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--flaeche); min-height: 280px; }
.bmc-menue { border-right: 1px solid var(--linie); padding: .6rem; display: flex; flex-direction: column; gap: .15rem; background: var(--flaeche-2); }
.bmc-menue button { text-align: left; background: none; border: 0; padding: .5rem .7rem; border-radius: 7px; color: var(--text-2); }
.bmc-menue button.aktiv { background: var(--flaeche); color: var(--text); font-weight: 600; box-shadow: var(--schatten); }
.bmc-panel { padding: 1.1rem 1.4rem; }
.bmc-panel h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.bmc-panel p.leise, .leise { color: var(--text-2); font-size: .92em; }
.wertetabelle td:first-child { color: var(--text-2); width: 40%; }
.optionen { display: grid; gap: .45rem; margin: .7rem 0; }
.optionen label { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .8rem; border: 1px solid var(--linie); border-radius: 8px; cursor: pointer; }
.optionen label small { display: block; color: var(--text-2); }
.konsole-box { margin-top: 1.2rem; }
.konsole-leiste { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.konsole-leiste .gruppe { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.vnc-flaeche { background: #000; border-radius: 8px; aspect-ratio: 16 / 10; position: relative; overflow: hidden; display: grid; place-items: center; color: #8a8f96; }
.vnc-flaeche > div.vnc-ziel { position: absolute; inset: 0; }
.vnc-flaeche .vnc-meldung { position: relative; z-index: 2; text-align: center; padding: 1rem; max-width: 30em; }
.ereignisse { font-family: var(--mono); font-size: .82em; max-height: 340px; overflow-y: auto; }
.ereignisse div { padding: .3rem 0; border-bottom: 1px solid var(--linie); display: grid; grid-template-columns: 11.5em 1fr; gap: .6rem; }
.ereignisse .warnung { color: var(--info); }
.ereignisse .fehler { color: var(--fehler); }
.datenblatt { font-family: var(--mono); font-size: .88em; }

/* ---------- Checkliste / Glossar ---------- */
.checkliste h2 { font-size: 1.25rem; margin: 2rem 0 .5rem; }
.ck-punkt { display: grid; grid-template-columns: 1.6rem 1fr; gap: .4rem; padding: .5rem 0; border-bottom: 1px solid var(--linie); }
.ck-punkt input { width: 1.1rem; height: 1.1rem; margin-top: .25rem; accent-color: var(--akzent); }
.ck-punkt p { margin: 0; }
.ck-punkt .detail { color: var(--text-2); font-size: .9em; }
.ck-punkt.erledigt > div > p:first-child { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--linie); }
.notfall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.notfall .karte { padding: .8rem 1rem; }
.notfall h3 { margin: 0 0 .3rem; font-size: 1rem; color: var(--fehler); }
.notfall p, .notfall ol { margin: .3rem 0; font-size: .93em; }
.glossar-suche { width: 100%; padding: .6rem .9rem; border: 1px solid var(--linie); border-radius: 9px; background: var(--flaeche); color: var(--text); font-size: 1rem; margin: .5rem 0 1rem; }
.glossar dl { margin: 0; }
.glossar dt { font-weight: 650; margin-top: 1rem; scroll-margin-top: 70px; }
.glossar dt small { font-weight: 400; color: var(--text-2); margin-left: .4rem; }
.glossar dd { margin: .15rem 0 0; color: var(--text-2); }
.glossar dd p { margin: 0; }
.glossar dt.blitz { background: var(--info-hell); border-radius: 4px; }
.buchstaben { display: flex; flex-wrap: wrap; gap: .2rem; }
.buchstaben a { padding: .1rem .45rem; text-decoration: none; border-radius: 5px; font-size: .9em; }
.buchstaben a:hover { background: var(--flaeche-2); }

/* Glossar-Begriffe im Text */
.g { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline dotted var(--akzent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; cursor: help; }
.g:hover { color: var(--akzent-2); }
.g-pop { position: fixed; z-index: 60; max-width: 340px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 9px; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); padding: .7rem .9rem; font-size: .92em; }
.g-pop b { display: block; margin-bottom: .2rem; }
.g-pop a { font-size: .85em; }

/* Job-Fenster */
.job { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; width: min(420px, calc(100vw - 2rem)); background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); padding: .9rem 1rem; }
.job h4 { margin: 0 0 .4rem; display: flex; align-items: center; gap: .5rem; }
.job pre { max-height: 160px; font-size: .78em; margin: .4rem 0; white-space: pre-wrap; }
.dreher { width: 14px; height: 14px; border: 2px solid var(--linie); border-top-color: var(--akzent); border-radius: 50%; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.meldung { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; font-size: .92em; box-shadow: var(--schatten); }

/* ---------- Login ---------- */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-karte { width: min(380px, 100%); padding: 2rem; }
.login-karte h1 { font-size: 1.4rem; margin: .8rem 0 .3rem; }
.login-karte label { display: block; margin-top: 1rem; font-size: .9em; color: var(--text-2); }
.login-karte input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); color: var(--text); margin-top: .25rem; }
.login-karte .knopf { width: 100%; justify-content: center; margin-top: 1.4rem; padding: .6rem; }
.login-fehler { background: var(--fehler-hell); color: var(--fehler); padding: .5rem .8rem; border-radius: 8px; margin-top: 1rem; font-size: .92em; }
.login-fehler:empty { display: none; }

/* ---------- Schmal ---------- */
@media (max-width: 980px) {
  .held { grid-template-columns: 1fr; }
  .maschinen { grid-template-columns: 1fr; }
  .arbeitsplatz { display: block; height: auto; }
  .inhalt-spalte { overflow: visible; padding: 1.4rem 1rem 6rem; }
  .terminal-spalte { position: fixed; left: 0; right: 0; bottom: 0; height: 58vh; z-index: 40; transform: translateY(100%); transition: transform .25s; }
  .terminal-spalte.offen { transform: none; }
  .term-umschalter { display: flex; position: fixed; right: 1rem; bottom: 1rem; z-index: 45; background: var(--term-bg); color: #fff; border: 0; border-radius: 99px; padding: .65rem 1.1rem; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
  .terminal-spalte.offen ~ .term-umschalter { bottom: calc(58vh + .6rem); }
  .bmc-rahmen { grid-template-columns: 1fr; }
  .bmc-menue { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--linie); }
  .notfall { grid-template-columns: 1fr; }
  .fortschritt-mini .balken { display: none; }
  header.kopf { padding: .45rem 1rem .3rem; gap: .3rem .8rem; flex-wrap: wrap; }
  header.kopf nav.haupt { order: 3; flex-basis: 100%; margin: 0 -.3rem; }
  .fortschritt-mini { margin-left: auto; }
  .arbeitsplatz { height: auto; }
}
@media (max-width: 560px) {
  .modul-zeile { grid-template-columns: 2.2rem 1fr; }
  .modul-meta { grid-column: 2; text-align: left; }
  .uebung-kopf { flex-direction: column; gap: .4rem; }
  .held h1 { font-size: 1.6rem; }
}

/* ---------- Druck ---------- */
@media print {
  header.kopf, .knopf, .knopfreihe, .term-umschalter, .job, .g-pop, .glossar-suche, .buchstaben { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main.seite { padding: 0; max-width: none; }
  .karte { box-shadow: none; border-color: #bbb; }
  .ck-punkt { break-inside: avoid; padding: .25rem 0; }
  .ck-punkt input { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border: 1.5px solid #000; border-radius: 2px; }
  .ck-punkt.erledigt > div > p:first-child { text-decoration: none; color: #000; }
  .notfall { grid-template-columns: 1fr 1fr; }
  .notfall .karte { break-inside: avoid; }
  .checkliste h2 { break-after: avoid; margin-top: 1.2rem; }
  .seitenumbruch { break-before: page; }
  code { background: none !important; padding: 0; font-weight: 600; }
  a { color: #000; text-decoration: none; }
  .g { text-decoration: none; }
}

/* Lange Befehle in Fliesstext und Listen duerfen umbrechen (sonst seitlicher Scroll auf dem Handy) */
@media (max-width: 980px) {
  :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
  .inhalt, .seite { overflow-wrap: break-word; }
  li { overflow-wrap: anywhere; }
}

/* Rechenzentrum auf breiten Bildschirmen: Bedienung links, Konsole rechts (kein Scrollen beim Installieren) */
@media (min-width: 1180px) {
  .bmc { max-width: 1680px; display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 0 1.2rem; align-items: start; }
  .bmc-kopf { grid-column: 1 / -1; border-radius: var(--radius); margin-bottom: 1rem; }
  .bmc-rahmen { grid-template-columns: 1fr; border-top: 1px solid var(--linie); border-radius: var(--radius); }
  .bmc-menue { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--linie); border-radius: var(--radius) var(--radius) 0 0; }
  .bmc-menue button { padding: .35rem .6rem; font-size: .9em; }
  .bmc-panel { padding: 1rem 1.1rem; font-size: .95em; }
  .konsole-box { margin-top: 0; position: sticky; top: 64px; }
  .vnc-flaeche { max-height: calc(100vh - 190px); }
}

/* Kopier-Knopf: nie mitmarkieren, nie mitkopieren */
.kopier-knopf { position: absolute; top: .4rem; right: .4rem; opacity: .75; user-select: none; -webkit-user-select: none; }
.kopier-knopf:hover { opacity: 1; }
