/* ==========================================================================
   PORZELLAN — gemeinsames Erscheinungsbild aller Module (DESIGN.md)

   Einbinden im <head> jedes Moduls, NACH dem eigenen <style>:
     <script src="static/darstellung.js"></script>
     <link rel="stylesheet" href="static/porzellan.css">
   (tools/porzellan-umstellen.py erledigt das und ersetzt die fest eingetragenen Farben.)

   Wie es wirkt: Alle fünf Module benutzen dieselben 30 Variablennamen (--bg, --surface,
   --ink, --gold …). Diese Datei belegt sie neu — mit höherer Spezifität (html:root statt
   :root), deshalb spielt die Reihenfolge keine Rolle. „--gold“ heißt aus historischen Gründen
   so und ist jetzt der Akzent (Blaugrün). Darunter stehen die gemeinsamen Bausteine (Knöpfe,
   Dialoge, Meldungen) — nur Aussehen, keine Geometrie, damit kein Modul-Layout bricht.

   Hell / Dunkel / Automatisch: data-thema="hell|dunkel|auto" am <html>, gesetzt von
   static/darstellung.js. Ohne Attribut gilt Automatisch (folgt dem Betriebssystem).

   Seit dem Umbau auf das Layout aus design/vorschau-final.html (Sebastian, 22.09.) stehen
   hier auch die gemeinsamen Bausteine der Arbeitsfläche: Bühne mit Kacheln und Zoom
   (.buehne/.szene/.fenster), die Anmeldekarte (.anmeldung) und seit feature-127 (G176) die Leiste
   oben (.leiste, Abschnitt „Leiste oben“). Die Logik dazu liegt in static/buehne.js. Alle Module
   benutzen dieselben Klassen — kein Modul baut sich diese Teile selbst, sonst laufen sie auseinander.
   ========================================================================== */

/* ---------- Schriften: selbst gehostet (SIL OFL 1.1, Lizenzen unter static/fonts/) ----------
   Archivo = Auftritt (Marke, Überschriften), Public Sans = Text und Bedienung,
   JetBrains Mono = alle Zahlen. Google Fonts ist im Praxisnetz nicht erreichbar. */
/* Selbst gehostete Schriften (SIL OFL 1.1, Lizenzen daneben) — erzeugt aus der Google-Fonts-Auslieferung, Teilmengen latin + latin-ext */
@font-face{font-family:'Archivo'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/Archivo-400-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:'Archivo'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/Archivo-400-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:'Archivo'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/Archivo-500-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:'Archivo'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/Archivo-500-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:'Archivo'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/Archivo-600-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:'Archivo'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/Archivo-600-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:'Archivo'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/Archivo-700-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:'Archivo'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/Archivo-700-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:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/JetBrainsMono-400-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:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/JetBrainsMono-400-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:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/JetBrainsMono-500-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:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/JetBrainsMono-500-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:'JetBrains Mono'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/JetBrainsMono-700-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:'JetBrains Mono'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/JetBrainsMono-700-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:'Public Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/PublicSans-400-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:'Public Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/PublicSans-400-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:'Public Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/PublicSans-500-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:'Public Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('fonts/PublicSans-500-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:'Public Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/PublicSans-600-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:'Public Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/PublicSans-600-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:'Public Sans'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/PublicSans-700-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:'Public Sans'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/PublicSans-700-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;}

html:root{
  /* Schriften — selbst gehostet, sobald die Dateien freigegeben sind; bis dahin Systemschrift */
  --auftritt:"Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans:"Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:"JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Porzellan hell */
  --bg:#EEF1F2; --surface:#FFFFFF; --surface-tief:#FAFCFC; --nut:#E3E9EB;
  --ink:#111A1D; --ink-soft:#556569; --faint:#8A999E; --border:#D2DADD;
  --gold:#0E6E6B; --gold-bright:#0A5451; --gold-deep:#7FB9B6; --akz-wash:#DCEFEE;
  --nav-bg:#FFFFFF;
  --green:#15704A; --green-bg:#DFF0E7; --yellow:#9A5B00; --yellow-bg:#FAEBD8; --red:#AB2318; --red-bg:#FAE3E1;
  /* neu, für die bisher fest eingetragenen Farben */
  --feld:#F6F8F9; --auf-gold:#FFFFFF; --auf-rot:#FFFFFF; --gold-rgb:14,110,107; --ton:17,26,29; --kontrast-rgb:17,26,29;
  --blau:#2F5E9E; --blau-bg:#E3ECF8; --blau-linie:#9DB8DE; --blau-rgb:47,94,158;
  --grau:#5E6B70; --grau-bg:#E9EDEF; --grau-linie:#B8C2C6; --grau-rgb:94,107,112;
  --green-linie:#A9D6BD; --yellow-linie:#E9C68E; --green-rgb:21,112,74; --red-rgb:171,35,24;
  --licht:rgba(255,255,255,.9); --overlay:rgba(17,26,29,.42);
  /* Personalmodul (schichtplanung-ki) benutzt teils eigene Namen — sie folgen den obigen */
  --card:var(--surface); --grouped-bg:var(--bg); --blue:var(--blau);
  --schatten-klein:0 1px 2px rgba(17,26,29,.10), 0 1px 1px rgba(17,26,29,.06);
  --schatten-gross:0 18px 48px rgba(17,26,29,.16), 0 2px 8px rgba(17,26,29,.08);
  /* Namen aus den Vorlagen (design/): Aliasse auf die Namen der Module, damit die
     abgenommenen Stile 1:1 übernommen werden können */
  --flaeche:var(--surface); --flaeche-tief:var(--surface-tief); --soft:var(--ink-soft); --linie:var(--border);
  --akz:var(--gold); --akz-hell:#12817D; --akz-tief:#0A5451; --auf-akz:var(--auf-gold); --ctrl:#72858B;
  --ok:var(--green); --ok-wash:var(--green-bg); --warn:var(--yellow); --warn-wash:var(--yellow-bg);
  --err:var(--red); --err-wash:var(--red-bg); --text:var(--sans); --daten:var(--mono);
  --boden:rgba(17,26,29,.20); --leitlinie:rgba(17,26,29,.35); --zahn:#FBFAF6; --zahn-kante:#A79C85;
  /* Abstände, Radien, Bewegung — dieselben Stufen wie in den Vorlagen */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:24px; --s6:32px; --s7:48px;
  --r-sm:4px; --r-md:9px; --r-lg:16px; --r-xl:22px; --r-pill:999px;
  --schnell:120ms; --normal:200ms; --ease:cubic-bezier(.2,.8,.2,1);
  --feder:cubic-bezier(.22,1.18,.36,1); --ruhig:cubic-bezier(.4,0,.2,1);
  color-scheme:light;
}
html:root[data-thema="dunkel"]{
  --bg:#0B1417; --surface:#132024; --surface-tief:#16262B; --nut:#091114;
  --ink:#E8EFF0; --ink-soft:#93A7AC; --faint:#6C8087; --border:#27393E;
  --gold:#45C2B6; --gold-bright:#5AD3C7; --gold-deep:#2A7F77; --akz-wash:#0F2E2E;
  --nav-bg:#0F1B1F;
  --green:#4FBE8B; --green-bg:#0E2A1F; --yellow:#E0A64A; --yellow-bg:#2B2113; --red:#EE7A6B; --red-bg:#2E1512;
  --feld:#0E181B; --auf-gold:#06191A; --auf-rot:#1A0D0A; --gold-rgb:69,194,182; --ton:0,0,0; --kontrast-rgb:255,255,255;
  --blau:#8FB4EC; --blau-bg:#14202E; --blau-linie:#5A8CDC; --blau-rgb:90,140,220;
  --grau:#A4B1B5; --grau-bg:#1A2428; --grau-linie:#52606A; --grau-rgb:150,150,150;
  --green-linie:#1E3B2B; --yellow-linie:#4A3B14; --green-rgb:79,190,139; --red-rgb:238,122,107;
  --licht:rgba(255,255,255,.07); --overlay:rgba(0,0,0,.6);
  --schatten-klein:0 1px 2px rgba(0,0,0,.4);
  --schatten-gross:0 18px 48px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
  --akz-hell:#5AD3C7; --akz-tief:#2A9E93; --ctrl:#587880;
  --boden:rgba(0,0,0,.55); --leitlinie:rgba(232,239,240,.30); --zahn:#EDEAE0; --zahn-kante:#6B6555;
  color-scheme:dark;
}
@media (prefers-color-scheme: dark){
  html:root[data-thema="auto"], html:root:not([data-thema]){
    --bg:#0B1417; --surface:#132024; --surface-tief:#16262B; --nut:#091114;
    --ink:#E8EFF0; --ink-soft:#93A7AC; --faint:#6C8087; --border:#27393E;
    --gold:#45C2B6; --gold-bright:#5AD3C7; --gold-deep:#2A7F77; --akz-wash:#0F2E2E;
    --nav-bg:#0F1B1F;
    --green:#4FBE8B; --green-bg:#0E2A1F; --yellow:#E0A64A; --yellow-bg:#2B2113; --red:#EE7A6B; --red-bg:#2E1512;
    --feld:#0E181B; --auf-gold:#06191A; --auf-rot:#1A0D0A; --gold-rgb:69,194,182; --ton:0,0,0; --kontrast-rgb:255,255,255;
    --blau:#8FB4EC; --blau-bg:#14202E; --blau-linie:#5A8CDC; --blau-rgb:90,140,220;
    --grau:#A4B1B5; --grau-bg:#1A2428; --grau-linie:#52606A; --grau-rgb:150,150,150;
    --green-linie:#1E3B2B; --yellow-linie:#4A3B14; --green-rgb:79,190,139; --red-rgb:238,122,107;
    --licht:rgba(255,255,255,.07); --overlay:rgba(0,0,0,.6);
    --schatten-klein:0 1px 2px rgba(0,0,0,.4);
    --schatten-gross:0 18px 48px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.35);
    --akz-hell:#5AD3C7; --akz-tief:#2A9E93; --ctrl:#587880;
    --boden:rgba(0,0,0,.55); --leitlinie:rgba(232,239,240,.30); --zahn:#EDEAE0; --zahn-kante:#6B6555;
    color-scheme:dark;
  }
}

/* ---------- Grundlage ---------- */
html body{background:var(--bg); color:var(--ink); font-family:var(--sans); -webkit-font-smoothing:antialiased;
  transition:background-color 200ms, color 200ms;}
html h1, html h2{font-family:var(--auftritt); letter-spacing:-.01em;}
html :focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
html ::selection{background:rgba(var(--gold-rgb),.22);}

/* Während des Umschaltens keine Übergänge (darstellung.js setzt die Klasse für zwei Bilder) */
html.thema-wechsel *, html.thema-wechsel *::before, html.thema-wechsel *::after{transition:none !important;}

/* ---------- Knöpfe: echte Plastizität, Licht von oben links ---------- */
html .btn{background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0)) , var(--gold); color:var(--auf-gold);
  border-radius:9px; box-shadow:inset 0 1px 0 rgba(255,255,255,.28), 0 1px 2px rgba(var(--ton),.22), 0 2px 6px rgba(var(--gold-rgb),.18);
  transition:filter 120ms, box-shadow 120ms, transform 120ms;}
html .btn:hover{filter:brightness(1.06);}
html .btn:active{transform:translateY(1px); box-shadow:inset 0 2px 4px rgba(var(--ton),.28);}
html .btn.secondary{background:var(--surface); color:var(--ink); box-shadow:inset 0 1px 0 var(--licht), 0 0 0 1px var(--border), var(--schatten-klein);}
html .btn.secondary:hover{background:var(--surface-tief); filter:none;}

/* ---------- Eingabefelder ---------- */
html input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), html select, html textarea{
  background:var(--feld); color:var(--ink); border-color:var(--border);}
html input:focus, html select:focus, html textarea:focus{border-color:var(--gold);}

/* ---------- Dialoge, Glocke, Meldungen: neutrale Tiefe statt Goldschein ---------- */
html .modal-overlay{background:var(--overlay);}
html .modal, html .bell-panel, html #leiste-menue{border:1px solid var(--border); box-shadow:inset 0 1px 0 var(--licht), var(--schatten-gross);}
html .toast{border:1px solid var(--border); box-shadow:var(--schatten-gross);}

/* ---------- Popup der Leiste (Buehne.popup, struktur-09): ein Fenster für alle Seiten ----------
   Eigene Klassen statt .modal-overlay/.modal: Nicht jede Seite lädt shared/common.css, und Lager,
   Teamraum und Praxis bringen eigene .modal-Regeln mit. Maße wie der Dialog, den die Übersicht bis
   dahin aus common.css und den beiden Regeln oben hatte. Gezeigt mit style.display='flex'. */
html .schiene-popup{position:fixed; inset:0; z-index:60; display:flex; align-items:center; justify-content:center;
  padding:var(--s5); background:var(--overlay); animation:schiene-popup-ein 150ms ease-out;}
html .schiene-popup .karte{background:var(--surface); color:var(--ink); border:1px solid var(--border); border-radius:10px;
  padding:var(--s5); width:340px; max-width:100%; box-sizing:border-box; text-align:center;
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-gross); animation:schiene-popup-karte 150ms ease-out;}
html .schiene-popup h3{margin:0 0 var(--s1); font-size:15px; font-weight:600; color:var(--gold-bright);}
html .schiene-popup p{margin:0 0 var(--s4); font-size:12.5px; color:var(--ink-soft);}
html .schiene-popup .btn{display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font:inherit;
  font-size:12.5px; font-weight:700; padding:var(--s1) var(--s2); border:1px solid var(--gold);}
/* Ein Hinweis mit Ausweg hat zwei Knöpfe (feature-139: „Ohne Rahmen öffnen“, „In eigenem Fenster öffnen“) */
html .schiene-popup .btn + .btn{margin-left:var(--s2);}
html .schiene-popup .btn[hidden]{display:none;}
@keyframes schiene-popup-ein{from{opacity:0;} to{opacity:1;}}
@keyframes schiene-popup-karte{from{opacity:0; transform:scale(.96);} to{opacity:1; transform:scale(1);}}
@media (prefers-reduced-motion: reduce){ html .schiene-popup, html .schiene-popup .karte{animation:none;} }
html .save-fail-banner{background:var(--red-bg); color:var(--red); border-bottom-color:var(--red); box-shadow:var(--schatten-klein);}

/* ---------- Umschalter Hell / Dunkel / Automatisch — ein Baustein für alle Module ----------
   <div class="darstellung-wahl" role="group" aria-label="Darstellung">
     <button type="button" data-thema-wahl="hell">Hell</button>
     <button type="button" data-thema-wahl="dunkel">Dunkel</button>
     <button type="button" data-thema-wahl="auto">Automatisch</button>
   </div>
   Keine eigenen Klassen (.btn) und keine Inline-Stile an den Knöpfen — aria-pressed setzt
   static/darstellung.js, das Aussehen kommt von hier. */
html .darstellung-wahl{display:inline-flex; gap:2px; padding:3px; border-radius:10px; background:var(--nut);
  box-shadow:inset 0 1px 2px rgba(var(--ton),.12);}
html .darstellung-wahl [data-thema-wahl]{all:unset; box-sizing:border-box; cursor:pointer; font:600 12.5px/1.2 var(--sans);
  color:var(--ink-soft); padding:6px 11px; border-radius:8px; transition:background-color 150ms, color 150ms;}
html .darstellung-wahl [data-thema-wahl]:hover{color:var(--ink);}
html .darstellung-wahl [data-thema-wahl]:focus-visible{outline:2px solid var(--gold); outline-offset:1px;}
html .darstellung-wahl [data-thema-wahl][aria-pressed="true"]{background:var(--surface); color:var(--ink);
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-klein);}
/* Zeichen statt Schrift (feature-127, G176, E3 B, E4 A): static/darstellung.js setzt Sonne, Mond und für Automatisch halb
   Sonne, halb Mond in die Knöpfe, der Name steht als Hinweis daran. Beim Umschalten öffnet sich die neue Farbe als Kreis
   vom Knopf aus: die neue Ansicht liegt oben und wird ohne Überblenden aufgezogen. */
html .darstellung-wahl [data-thema-wahl]{display:inline-flex; align-items:center; justify-content:center;}
html .darstellung-wahl [data-thema-wahl]:has(svg){padding:6px 9px;}
html .darstellung-wahl [data-thema-wahl] svg{width:16px; height:16px; display:block; flex:0 0 auto;}
html::view-transition-old(root), html::view-transition-new(root){animation:none; mix-blend-mode:normal;}
html::view-transition-old(root){z-index:1;}
html::view-transition-new(root){z-index:2;}

/* ---------- Datumsfelder folgen der Darstellung ----------
   Aus der Gold-Welt steht in den Modulen input[type=date]{color-scheme:dark} — in Hell wäre das
   Kalender-Symbol dann hell auf hellem Feld und kaum zu sehen. */
html input[type="date"], html input[type="time"], html input[type="datetime-local"], html input[type="month"]{color-scheme:inherit;}

/* ---------- Wasserzeichen (body::before in allen Modulen) ----------
   Das Logo war für fast Schwarz abgestimmt (0,5). Auf Porzellan: hell 0,06, dunkel 0,12 —
   präsent genug, um die Marke zu tragen, leise genug für leere Ansichten. Zentral, damit die
   Module nicht auseinanderlaufen; eigene Regeln der Module dafür sind damit überflüssig. */
html body::before{opacity:.06;}
html:root:root[data-thema="dunkel"] body::before{opacity:.12;}
@media (prefers-color-scheme: dark){
  html:root:root[data-thema="auto"] body::before, html:root:root:not([data-thema]) body::before{opacity:.12;}
}

/* ==========================================================================
   ARBEITSFLÄCHE — Leiste oben · Bühne mit Kacheln (design/vorschau-final.html)
   Markup je Modul (die Leiste: Abschnitt „Leiste oben“ unten):
     <div class="huelle">
       <header class="leiste" id="leiste"></header>          ← füllt Buehne.leiste()
       <main class="inhalt">
         <div class="buehne"><div class="szene" id="szene" data-kacheln="4">
           <div class="hintergrund" id="hintergrund"></div>
           <section id="tab-…"> … </section>                 ← wird durch Buehne.kacheln() zur .fenster
         </div></div>
         <div class="weitere" id="weitere"></div>             ← Kacheln jenseits der gewählten Anzahl
       </main>
     </div>
   ========================================================================== */
html .etikett{font-size:10px; font-weight:800; letter-spacing:.11em; text-transform:uppercase; color:var(--faint);}
html .mono{font-family:var(--mono); font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1;}
html .huelle{min-height:100vh; position:relative; z-index:1;}
/* ---------- Inhalt und Werkzeuge des Moduls (die Werkzeuge stehen in der zweiten Zeile der Leiste) ---------- */
html .inhalt{display:flex; flex-direction:column; min-width:0; padding:var(--s5); max-width:none;}
html .werkzeuge{display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; position:relative;}
html .werkzeuge .btn{white-space:nowrap;}
html .lauf{display:inline-flex; align-items:center; gap:8px; font-family:var(--mono); font-size:12px; white-space:nowrap;
  color:var(--akz-tief); background:var(--akz-wash); border-radius:var(--r-pill); padding:5px 13px;}
html .lauf .puls{width:6px; height:6px; border-radius:50%; background:var(--gold); animation:puls 2.4s ease-in-out infinite;}
@keyframes puls{0%,100%{opacity:1;} 50%{opacity:.25;}}
html .segment{display:inline-flex; background:var(--nut); border-radius:var(--r-md); padding:3px; gap:2px;
  box-shadow:inset 0 1px 2px rgba(var(--ton),.12);}
html .segment button{all:unset; box-sizing:border-box; font:600 12.5px/1.2 var(--sans); cursor:pointer;
  padding:5px 11px; border-radius:calc(var(--r-md) - 3px); color:var(--ink-soft);
  display:inline-flex; align-items:center; gap:6px; transition:all 140ms var(--ease); white-space:nowrap;}
html .segment button svg{width:14px; height:14px;}
html .segment button[aria-pressed="true"]{background:var(--surface); color:var(--ink);
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-klein);}
html .segment button:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
html .segment.klein button{font-size:11.5px; padding:3px 9px;}
html .gruppenlabel{font-size:11px; font-weight:700; color:var(--faint); margin-right:2px; white-space:nowrap;}
/* Zählerknopf (Glocke, Nachrichten) oben rechts in der Leiste */
html .werkzeuge .bell-btn{all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:6px; font:600 13px/1.2 var(--sans);
  color:var(--ink-soft); padding:7px 11px; border-radius:var(--r-md); border:1px solid var(--border);
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-tief) 100%); box-shadow:inset 0 1px 0 var(--licht), var(--schatten-klein);
  white-space:nowrap;}
html .werkzeuge .bell-btn:hover{color:var(--ink); border-color:var(--ctrl);}
html .werkzeuge .bell-btn .icon svg{width:15px; height:15px; display:block;}
html .werkzeuge .bell-count{background:var(--red); color:var(--auf-rot); font-family:var(--mono); font-size:10.5px; padding:1px 7px;
  border-radius:var(--r-pill); font-weight:700;}
html .bell-panel{position:fixed; left:auto; right:var(--s5); top:72px; width:min(380px, calc(100vw - 48px)); z-index:70;}

/* ---------- Die Bühne: 2 · 4 · 6 Kacheln, feste Plätze a–f ---------- */
html .buehne{position:relative; flex:1 1 auto; min-height:480px;}
html .szene{position:absolute; inset:0; display:grid; gap:var(--s3);
  grid-template-columns:repeat(2, minmax(0,1fr)); grid-template-rows:repeat(2, minmax(0,1fr));
  grid-template-areas:"a b" "c d";}
html .szene[data-kacheln="2"]{grid-template-rows:minmax(0,1fr); grid-template-areas:"a b";}
html .szene[data-kacheln="6"]{grid-template-columns:repeat(3, minmax(0,1fr)); grid-template-areas:"a b c" "d e f";}
html .szene[data-kacheln="2"] [data-platz="c"], html .szene[data-kacheln="2"] [data-platz="d"],
html .szene[data-kacheln="2"] [data-platz="e"], html .szene[data-kacheln="2"] [data-platz="f"],
html .szene[data-kacheln="4"] [data-platz="e"], html .szene[data-kacheln="4"] [data-platz="f"],
html .szene [data-platz="w"], html .szene .fenster[hidden]{display:none;}
/* :where() hat Spezifität null — .fenster.gross muss den Platz zurücksetzen können */
:where([data-platz="a"]){grid-area:a;} :where([data-platz="b"]){grid-area:b;} :where([data-platz="c"]){grid-area:c;}
:where([data-platz="d"]){grid-area:d;} :where([data-platz="e"]){grid-area:e;} :where([data-platz="f"]){grid-area:f;}

html .hintergrund{position:absolute; inset:0; z-index:10; border-radius:var(--r-lg);
  background:rgba(var(--ton),.26); opacity:0; pointer-events:none; transition:opacity 380ms var(--ease);}
html .szene[data-zoom] .hintergrund{opacity:1; pointer-events:auto; cursor:zoom-out;}

html .fenster{position:relative; min-width:0; min-height:0; overflow:hidden; margin:0;
  border:1px solid var(--border); border-radius:var(--r-lg);
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-tief) 100%);
  box-shadow:inset 0 1px 0 var(--licht), 0 1px 1px rgba(var(--ton),.06), 0 4px 8px rgba(var(--ton),.08), 0 14px 28px rgba(var(--ton),.09);
  display:flex; flex-direction:column; cursor:zoom-in;
  transition:filter 380ms var(--ease), opacity 380ms var(--ease), box-shadow 380ms var(--ease), border-color var(--normal) var(--ease);}
html .fenster:hover{border-color:var(--ctrl);
  box-shadow:inset 0 1px 0 var(--licht), 0 2px 2px rgba(var(--ton),.07), 0 8px 16px rgba(var(--ton),.10), 0 22px 40px rgba(var(--ton),.11);}
html .fenster:focus-visible{outline:2px solid var(--gold); outline-offset:3px;}
html .szene[data-zoom] .fenster:not(.gross){filter:blur(3.5px) saturate(.92); opacity:.62; pointer-events:none;}
/* grid-area:auto ist Pflicht: ein absolut positioniertes Rasterelement mit Rasterplatz
   nimmt sonst diesen Platz als Bezugsrahmen und bleibt stehen, statt in die Mitte zu wandern. */
html .szene .fenster.gross{display:flex; position:absolute; z-index:20; inset:4% 7%; grid-area:auto; cursor:default;
  border-color:var(--ctrl); background:var(--surface);
  box-shadow:inset 0 1px 0 var(--licht), 0 4px 6px rgba(var(--ton),.09), 0 18px 36px rgba(var(--ton),.14), 0 48px 90px rgba(var(--ton),.18);}
html .zoomecke{position:absolute; top:var(--s3); right:var(--s3); z-index:2; font-size:15px; line-height:1; color:var(--faint);
  opacity:0; transform:translateY(-3px); transition:opacity var(--normal) var(--ease), transform var(--normal) var(--ease); pointer-events:none;}
html .fenster:hover .zoomecke, html .fenster:focus-visible .zoomecke{opacity:1; transform:none;}
html .fenster.gross .zoomecke{display:none;}
html .fenster .taste-hinweis{font-family:var(--mono); font-size:10px; color:var(--faint); border:1px solid var(--border);
  border-radius:var(--r-sm); padding:0 5px; margin-left:6px; vertical-align:1px;}
html .fenster.gross .taste-hinweis{display:none;}
html .f-kopf{display:flex; align-items:flex-start; justify-content:space-between; gap:var(--s3);
  padding:var(--s4) var(--s5) var(--s3) var(--s4); flex:0 0 auto; min-width:0;}
html .f-kopf > div:first-child{min-width:0;}
html .f-kopf h2{font-family:var(--auftritt); font-weight:650; font-size:17px; letter-spacing:-.015em; margin:3px 0 0; color:var(--ink);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
html .fenster.gross .f-kopf h2{font-size:21px;}
html .f-kopf .rechts{display:flex; align-items:center; gap:var(--s2); flex-wrap:wrap; justify-content:flex-end; flex:0 0 auto;}
html .stand{font-family:var(--mono); font-size:10.5px; color:var(--faint); white-space:nowrap;}
html .stand.live{color:var(--akz-tief);}
html .stand.live::before{content:""; display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--gold);
  margin-right:5px; vertical-align:1px; animation:puls 2.4s ease-in-out infinite;}
html .f-koerper{padding:0 var(--s4) var(--s4); overflow:auto; flex:1 1 auto; min-height:0; min-width:0; cursor:auto;}
/* Klein ist die Kachel ein Fenster auf die Ansicht: Breites (Werkzeugleisten, Tabellen) wird
   rechts beschnitten statt einen Querbalken zu bekommen — herausheben zeigt alles. */
html .fenster:not(.gross) .f-koerper{overflow-x:hidden;}
html .f-koerper > *{min-width:0;}
/* Sprachumschalter (nur bei mehreren Sprachen sichtbar) in der Werkzeugleiste */
html .werkzeuge #global-lang-switch{display:inline-flex; align-items:center; gap:6px;}
html .werkzeuge #global-lang-label{margin:0;} html .werkzeuge #global-lang-select{margin:0; font-size:12.5px; padding:5px 8px;}
/* Innerhalb einer Kachel gibt es keine zweite Überschrift der Ansicht — die steht im Kachelkopf */
html .f-koerper > h2:first-child{display:none;}
html .f-koerper > h2:first-child + .subtitle{display:none;}
html .f-koerper .card{margin-bottom:var(--s3);}
html .f-koerper > .card:last-child{margin-bottom:0;}
/* Kacheln jenseits der gewählten Anzahl: eine Zeile Chips unter der Bühne */
html .weitere{flex:0 0 auto; display:flex; align-items:center; gap:var(--s2); flex-wrap:wrap; margin-top:var(--s3); min-height:0;}
html .weitere:empty{display:none;}
html .weitere .gruppenlabel{margin-right:var(--s1);}
html .weitere button{all:unset; box-sizing:border-box; cursor:pointer; font:600 12.5px/1.2 var(--sans); color:var(--ink-soft);
  padding:6px 12px; border-radius:var(--r-pill); border:1px solid var(--border);
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-tief) 100%); box-shadow:inset 0 1px 0 var(--licht), var(--schatten-klein);
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;}
html .weitere button:hover{color:var(--ink); border-color:var(--ctrl);}
html .weitere button .zahl{font-family:var(--mono); font-size:11px; color:var(--faint);}
html .weitere button .zahl:empty{display:none;}
html .weitere button:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}

/* ---------- Anmeldekarte eines Moduls (ohne Sitzung, z. B. externe Praxis) ---------- */
html .anmeldung{min-height:100vh; display:grid; place-items:center; padding:var(--s5); position:relative; z-index:1;}
html .anmeldung .karte{width:min(420px, 100%); border-radius:var(--r-xl); border:1px solid var(--border); background:var(--surface);
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-gross); padding:var(--s6) var(--s5);}
html .anmeldung .marke{font-family:var(--auftritt); font-stretch:116%; font-weight:750; font-size:19px; line-height:1.15; letter-spacing:-.02em; color:var(--ink);}
html .anmeldung .marke span{display:block; font-family:var(--sans); font-weight:500; font-size:13px; letter-spacing:0; color:var(--ink-soft); margin-top:2px;}
html .anmeldung h2{font-family:var(--auftritt); font-weight:700; font-size:22px; letter-spacing:-.02em; margin:var(--s5) 0 var(--s1); color:var(--ink);}
html .anmeldung p{margin:0 0 var(--s3); color:var(--ink-soft); font-size:14px;}
html .anmeldung select{width:100%; font-size:14px; padding:10px 12px;}
html .anmeldung .fuss{display:flex; justify-content:space-between; align-items:center; gap:var(--s3); flex-wrap:wrap; margin-top:var(--s5);}
html .anmeldung .fuss .btn{text-decoration:none;}

@media (prefers-reduced-motion: reduce){
  html .lauf .puls, html .stand.live::before{animation:none;}
}
/* Unter 820 px: Kacheln untereinander, kein Zoom (Tablet/Handy erst am Projektende); die Leiste bricht um (unten) */
@media (max-width: 820px){
  html .buehne{min-height:0;}
  html .szene, html .szene[data-zoom], html .szene[data-kacheln]{position:static; display:grid; grid-template-columns:1fr; grid-template-rows:none; grid-template-areas:none;}
  :where([data-platz]){grid-area:auto;}
  html .szene[data-zoom] .fenster:not(.gross){filter:none; opacity:1; pointer-events:auto;}
  html .szene .fenster.gross{position:static; inset:auto;} html .hintergrund{display:none;} html .zoomecke{display:none;}
  html .fenster{min-height:250px; cursor:default;}
  html .bell-panel{right:var(--s3); top:var(--s3);}
}

/* ---------- Druck bleibt schwarz auf weiß; der Bühnenrahmen entfällt (die Leiste: Abschnitt „Leiste oben“) ---------- */
@media print{
  html:root{--bg:#fff; --surface:#fff; --ink:#000; --ink-soft:#333; --border:#999; --feld:#fff;}
  html .weitere, html .hintergrund, html .zoomecke{display:none !important;}
  html .szene{position:static; display:block;}
  html .fenster{display:block; box-shadow:none; border:0; filter:none !important; opacity:1 !important;}
  html .szene .fenster.gross{position:static;}
}

/* ---------- Protokoll-Fenster (feature-88, G141): Buehne.protokollFenster in static/buehne.js ----------
   Ein Fenster für die Protokolle in Labor, Praxis und Lager, in der Form des Fensters der Personalakte (G135): fest
   über der Seite, über die ganze Breite und unter der Leiste oben (die Regel mit html.mit-leiste im Abschnitt „Leiste
   oben“ setzt top, die Leiste bleibt frei, G79). Ebene 55: über der herausgehobenen Kachel (20) und der Glocke (in der
   Hülle), unter den Dialogen der Seiten (.modal-overlay 60), dem Popup der Leiste (60) und den Meldungen (.toast 200),
   damit alles sichtbar bleibt, was aus der Leiste oder aus dem Fenster aufgeht. Solange es offen ist, rollt die Seite
   dahinter nicht mit. Der Titel des Blatts steht am Bildschirm im Kopf des Fensters und nur im Druck auf dem Blatt. */
html .protokoll-schleier{display:none; position:fixed; top:0; right:0; bottom:0; left:0; z-index:55; background:var(--overlay);}
html .protokoll-schleier.offen{display:block;}
html .protokoll-fenster{position:absolute; top:4vh; bottom:4vh; left:4vw; right:4vw; display:flex; flex-direction:column;
  min-width:0; overflow:hidden; background:var(--surface); color:var(--ink); border:1px solid var(--ctrl); border-radius:var(--r-lg);
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-gross);}
html .protokoll-kopf{display:flex; align-items:flex-start; justify-content:space-between; gap:var(--s3); flex-wrap:wrap; flex:0 0 auto;
  padding:var(--s4) var(--s5) var(--s3); border-bottom:1px solid var(--border);}
html .protokoll-kopf > div:first-child{min-width:0;}
html .protokoll-kopf h2{font-family:var(--auftritt); font-weight:650; font-size:19px; letter-spacing:-.015em; margin:3px 0 0;
  color:var(--ink); overflow-wrap:anywhere;}
html .protokoll-knoepfe{display:flex; gap:var(--s2); flex-wrap:wrap; align-items:center;}
html .protokoll-knoepfe .btn{display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font:inherit;
  font-size:13px; font-weight:700; padding:var(--s2) var(--s3); border:1px solid var(--gold); white-space:nowrap;}
html .protokoll-knoepfe .btn.secondary{border-color:var(--border);}
html .protokoll-koerper{flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; overflow-wrap:anywhere;
  padding:var(--s4) var(--s5) var(--s5);}
html .protokoll-koerper:focus-visible{outline:2px solid var(--gold); outline-offset:-2px;}
html .protokoll-blatttitel{display:none;}
html .protokoll-blattkopf{margin:0 0 var(--s4);}
html .protokoll-blattkopf p{margin:0 0 var(--s1); font-size:13px; color:var(--ink-soft);}
html .protokoll-oben{margin:0 0 var(--s4); padding:var(--s3); border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface-tief);}
html .protokoll-zeile{display:flex; flex-wrap:wrap; align-items:baseline; gap:2px var(--s2); padding:var(--s2);
  border-bottom:1px solid var(--border); font-size:13px;}
html .protokoll-zeile:last-child{border-bottom:0;}
/* Zeilen aus Buehne.protokollZeile (feature-104): Zeit klein und abgesetzt, die Marke („offen“, „neu“) als Wort, der Text,
   darunter in eigener Zeile der Zusatz (.protokoll-sub, flex-basis 100 %). Eine anklickbare Zeile ist ein Knopf ohne
   Knopf-Aussehen über die ganze Breite: Praxis und Lager laden shared/common.css nicht, deshalb setzt .klick mit all:unset
   alles zurück und danach neu, was die Grundregel gesetzt hatte. .klick steht vor .offen, :hover und :focus-visible,
   sonst löschte all:unset Streifen und Rahmen; die letzte Knopfzeile hat wie jede letzte Zeile keine Linie unten. */
html .protokoll-zeile.klick{all:unset; display:flex; flex-wrap:wrap; align-items:baseline; gap:2px var(--s2); width:100%;
  box-sizing:border-box; padding:var(--s2); border-bottom:1px solid var(--border); font-size:13px; color:var(--ink);
  text-align:left; cursor:pointer;}
html .protokoll-zeile.klick:last-child{border-bottom:0;}
html .protokoll-zeile.offen{border-left:3px solid var(--gold); padding-left:calc(var(--s2) - 3px);}
html .protokoll-zeile.klick:hover{background:var(--akz-wash);}
html .protokoll-zeile.klick:focus-visible{outline:2px solid var(--gold); outline-offset:-2px;}
html .protokoll-zeit{flex:0 0 auto; font-size:12px; color:var(--ink-soft); font-variant-numeric:tabular-nums; white-space:nowrap;}
html .protokoll-marke{flex:0 0 auto; padding:0 6px; border:1px solid var(--gold); border-radius:var(--r-pill);
  background:var(--surface); color:var(--gold-bright); font-size:11px; font-weight:700; white-space:nowrap;}
html .protokoll-text{flex:1 1 16em; min-width:0;}
html .protokoll-sub{flex:0 0 100%; font-size:12px; color:var(--ink-soft);}
html .protokoll-leer{margin:0; font-size:13px; color:var(--faint);}
html:has(#protokoll-modal.offen){overflow:hidden;}
/* Bis 820 px rückt das Fenster näher an den Rand */
@media (max-width:820px){
  html .protokoll-fenster{top:2vh; bottom:2vh; left:2vw; right:2vw;}
}
/* Druck: nur das Blatt, über so viele Seiten wie nötig (Lage, Höhe und Rollen aufgehoben), ohne Knöpfe und ohne die
   Felder über dem Blatt, fest schwarz auf weiß, auch im Dunkelmodus. Die Klasse setzt der Druckknopf des Fensters. */
@media print{
  html body.printing-protokoll > :not(#protokoll-modal){display:none !important;}
  html body.printing-protokoll::before{display:none !important;}
  html:has(#protokoll-modal.offen){overflow:visible;}
  html body.printing-protokoll #protokoll-modal{display:block; position:static; background:#fff;}
  html body.printing-protokoll .protokoll-fenster{display:block; position:static; max-height:none; overflow:visible; border:none;
    border-radius:0; box-shadow:none; background:#fff; color:#000;}
  html body.printing-protokoll .protokoll-kopf, html body.printing-protokoll .protokoll-knoepfe,
  html body.printing-protokoll .protokoll-oben{display:none !important;}
  html body.printing-protokoll .protokoll-koerper{overflow:visible; max-height:none; padding:0;}
  html body.printing-protokoll .protokoll-blatttitel{display:block; margin:0 0 6pt; font-size:14pt; color:#000;}
  html body.printing-protokoll .protokoll-blattkopf p{color:#000; font-size:10pt;}
  html body.printing-protokoll .protokoll-zeile{break-inside:avoid; page-break-inside:avoid; border-bottom:1px solid #999; color:#000;
    font-size:10pt;}
  html body.printing-protokoll .protokoll-zeile.offen{border-left-color:#000;}
  html body.printing-protokoll .protokoll-zeit, html body.printing-protokoll .protokoll-marke,
  html body.printing-protokoll .protokoll-text, html body.printing-protokoll .protokoll-sub{color:#000;}
  html body.printing-protokoll .protokoll-zeit, html body.printing-protokoll .protokoll-sub{font-size:9pt;}
  html body.printing-protokoll .protokoll-marke{background:#fff; border-color:#000; font-size:8pt;}
  html body.printing-protokoll .protokoll-leer{color:#000;}
}

/* ---------- Rückfrage der Fenster (feature-132, G182): Buehne.seitenFenster in static/buehne.js ----------
   Fragt, bevor ein Fenster einer Seite, in dem etwas eingegeben und nicht gespeichert ist, per Klick daneben oder mit
   Esc zugeht. Ebene 100: über jedem Fenster der Seiten (.modal-overlay 60, inline bis 70 im Lager) und der Glocke
   (.bell-panel 70), unter den Meldungen (.toast 200). Das äußere Element trägt auch .modal-overlay, damit die Bühne und
   das Protokoll-Fenster es als offenen Dialog zählen und die Praxis es beim Abmelden mit allen Fenstern ausblendet. Sein
   Aussehen steht trotzdem vollständig hier: Labor, Praxis und Lager haben verschiedene Regeln für .modal-overlay und
   .modal, und Praxis und Lager laden shared/common.css nicht (deshalb auch der rote Knopf hier). Gezeigt mit
   style.display='flex'. Bis 820 px über die ganze Breite mit Rand, die Knöpfe teilen sich die Zeile. */
html .sf-schleier{position:fixed; top:0; right:0; bottom:0; left:0; z-index:100; display:flex; align-items:center;
  justify-content:center; box-sizing:border-box; padding:var(--s5); background:var(--overlay); animation:sf-ein 150ms ease-out;}
html .sf-rueckfrage{width:420px; max-width:100%; box-sizing:border-box; padding:var(--s5); background:var(--surface);
  color:var(--ink); border:1px solid var(--border); border-radius:var(--r-lg); text-align:left;
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-gross); animation:sf-karte 150ms ease-out;}
html .sf-rueckfrage h3{margin:0 0 var(--s2); font-family:var(--auftritt); font-size:17px; font-weight:650; letter-spacing:-.01em;
  color:var(--ink);}
html .sf-rueckfrage p{margin:0 0 var(--s5); font-size:13.5px; line-height:1.5; color:var(--ink-soft); overflow-wrap:anywhere;}
html .sf-rueckfrage .sf-knoepfe{display:flex; gap:var(--s2); justify-content:flex-end; flex-wrap:wrap;}
html .sf-rueckfrage .btn{display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font:inherit;
  font-size:13px; font-weight:700; padding:var(--s2) var(--s4); border:1px solid var(--gold); white-space:nowrap;}
html .sf-rueckfrage .btn.secondary{border-color:var(--border);}
html .sf-rueckfrage .btn.danger{background:var(--red); color:var(--auf-rot); border-color:var(--red);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(var(--ton),.22);}
html .sf-rueckfrage .btn:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
@keyframes sf-ein{from{opacity:0;} to{opacity:1;}}
@keyframes sf-karte{from{opacity:0; transform:scale(.96);} to{opacity:1; transform:scale(1);}}
@media (prefers-reduced-motion: reduce){ html .sf-schleier, html .sf-rueckfrage{animation:none;} }
@media (max-width:820px){
  html .sf-schleier{padding:var(--s3);}
  html .sf-rueckfrage{width:100%;}
  html .sf-rueckfrage .sf-knoepfe .btn{flex:1 1 auto;}
}

/* ==========================================================================
   LEISTE OBEN (feature-127, G176): Buehne.leiste in static/buehne.js
   Die Module als Leiste über die ganze Breite statt der Schiene links, darunter eine zweite Leiste je Modul.
   Gestaltung aus design/dashboard-entwurf.html (Abschnitt „Kopfleiste“), mit den Farben und Größen dieser Datei. Jede
   Regel steht unter .leiste, #leiste-menue, #leiste-flaeche oder .mit-leiste (die Klasse am
   <html> setzt Buehne.leiste): Die Startseite lädt diese Datei auch und hat eigene Klassen mit denselben Namen
   (.marke, .person, .toast).
   Markup (baut Buehne.leiste aus der Vorlage der Seite):
     <div class="huelle app" id="app">
       <header class="leiste" id="leiste">
         .leiste-zeile1: a.marke · nav.reiter (a[data-modul]) · nav.station · .leiste-rechts (.werkzeuge.leiste-oben,
                         .darstellung-wahl, .person > button.person-knopf)
         .leiste-zeile2: nav.krumen (h1.krume …) · nav.unterreiter (button.unterreiter-knopf) · .werkzeuge.leiste-werkzeuge
       </header>
       <main class="inhalt"> … Bühne … </main>
     </div>
     #leiste-flaeche, #leiste-menue am body
   ========================================================================== */
/* Die Hülle mit Leiste ist eine Spalte: Ein klebendes Element bleibt in seinem Rasterfeld, und in einer Rasterzeile so
   hoch wie die Leiste klebte sie nicht. Eine Kachel, zu der oeffnen() bis 820 px rollt, beginnt unter der Leiste. */
html.mit-leiste{scroll-padding-top:var(--leiste-hoehe, 0px);}
html.mit-leiste .huelle{display:flex; flex-direction:column;}
html.mit-leiste .huelle > main.inhalt{flex:1 1 auto;}
/* Klebt oben, bei jeder Breite; über der herausgehobenen Kachel (20), unter Dialogen und dem Popup (60) */
html .leiste{position:sticky; top:0; z-index:40; flex:0 0 auto; min-width:0;
  background:linear-gradient(180deg, var(--surface) 0%, var(--surface-tief) 100%); border-bottom:1px solid var(--border);
  box-shadow:inset 0 1px 0 var(--licht), 0 4px 18px rgba(var(--ton),.06);}
html .leiste [hidden]{display:none !important;}
/* Passt die erste Zeile nicht in die Breite, bricht sie um, bei jeder Breite: Die Reiter schrumpfen nie (sonst schnitt
   der Rand im Labor und in der Praxis „Personalmodul“ ab, ohne Hinweis), was daneben nicht passt, rutscht in eine Zeile
   darunter, die rechte Gruppe rechtsbündig (margin-left:auto). Nachtrag aus der Gegenprüfung von Teil Z, feature-127. */
html .leiste .leiste-zeile1{display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2) var(--s4); padding:var(--s3) var(--s5);
  min-width:0;}
html .leiste .marke{flex:0 0 auto; display:block; font-family:var(--auftritt); font-stretch:116%; font-weight:750; font-size:17px;
  line-height:1.1; letter-spacing:-.02em; color:var(--ink); text-decoration:none;}
html .leiste .marke span{display:block; margin-top:1px; font-family:var(--sans); font-stretch:normal; font-weight:500; font-size:12px;
  letter-spacing:0; color:var(--ink-soft);}
html .leiste .reiter{display:flex; align-items:center; gap:2px; padding:4px; border-radius:12px; background:var(--nut); flex:0 0 auto;
  min-width:0; box-shadow:inset 0 1px 2px rgba(var(--ton),.12); overflow-x:auto; scrollbar-width:none;}
html .leiste .reiter::-webkit-scrollbar, html .leiste .unterreiter::-webkit-scrollbar{display:none;}
html .leiste .reiter a, html .leiste .station a{display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:9px;
  font:600 13.5px/1.2 var(--sans); color:var(--ink-soft); text-decoration:none; white-space:nowrap;
  transition:color var(--schnell) var(--ease), background-color var(--schnell) var(--ease);}
html .leiste .reiter a:hover, html .leiste .station a:hover{color:var(--ink);}
html .leiste .reiter a:focus-visible, html .leiste .station a:focus-visible{outline:2px solid var(--gold); outline-offset:-2px;}
html .leiste .reiter a[aria-current="page"]{color:var(--auf-gold);
  background:linear-gradient(180deg, var(--akz-hell) 0%, var(--gold) 62%, var(--akz-tief) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28), 0 2px 2px rgba(var(--ton),.16), 0 5px 10px rgba(var(--ton),.18);}
html .leiste .reiter a svg, html .leiste .station a svg, html .leiste .person-knopf svg, html .leiste .krumen svg{width:15px; height:15px;
  flex:0 0 auto; display:block; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;}
html .leiste .reiter .zahl{display:inline-grid; place-items:center; min-width:20px; padding:2px 6px; border-radius:var(--r-pill);
  font:700 11px/1.2 var(--mono); font-variant-numeric:tabular-nums; color:var(--ink-soft); background:var(--surface);
  box-shadow:inset 0 0 0 1px var(--border);}
html .leiste .reiter .zahl:empty{display:none;}
html .leiste .reiter a[aria-current="page"] .zahl{color:var(--auf-gold); background:rgba(var(--ton),.2); box-shadow:none;}
html .leiste .reiter a.alarm .zahl{color:var(--auf-rot); background:var(--red); box-shadow:none;}
html .leiste .station{display:flex; align-items:center; flex:0 0 auto; padding-left:var(--s2); border-left:1px solid var(--border);}
html .leiste .leiste-rechts{margin-left:auto; display:flex; align-items:center; gap:var(--s2); flex:0 0 auto; min-width:0;}
html .leiste .leiste-oben{gap:var(--s2); flex-wrap:nowrap;}
html .leiste .person{position:relative; flex:0 0 auto; display:flex; align-items:center;}
html .leiste .person-knopf{all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:7px; max-width:220px;
  padding:6px 12px 6px 9px; border-radius:var(--r-pill); font:600 13px/1.2 var(--sans); color:var(--ink-soft);
  border:1px solid var(--border); background:linear-gradient(180deg, var(--surface) 0%, var(--surface-tief) 100%);
  box-shadow:inset 0 1px 0 var(--licht), var(--schatten-klein); transition:color var(--schnell) var(--ease), border-color var(--schnell) var(--ease);}
html .leiste .person-knopf:hover, html .leiste .person-knopf[aria-expanded="true"]{color:var(--ink); border-color:var(--ctrl);}
html .leiste .person-knopf:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}
html .leiste .person-knopf .text{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
html .leiste .person-knopf .text:empty{display:none;}
html .leiste .nicht-angemeldet{font-size:13px; font-weight:600; color:var(--ink-soft); white-space:nowrap;}
/* Zweite Leiste: wo man ist, die Kacheln des Moduls, rechts die Werkzeuge des Moduls */
html .leiste .leiste-zeile2{display:flex; align-items:stretch; gap:var(--s4); padding:0 var(--s5); min-height:44px; min-width:0;
  border-top:1px solid var(--border);}
html .leiste .krumen{display:flex; align-items:center; gap:6px; flex:0 0 auto; max-width:45%; min-width:0; overflow:hidden; white-space:nowrap;
  font-size:13px; color:var(--ink-soft);}
html .leiste .krumen h1.krume{flex:0 0 auto;}
html .leiste .krumen .krume{margin:0; min-width:0; overflow:hidden; text-overflow:ellipsis; font:inherit; letter-spacing:0; color:var(--ink-soft);}
html .leiste .krumen h1.krume{font-family:var(--auftritt); font-weight:700; font-size:15px; letter-spacing:-.01em; color:var(--ink);}
html .leiste .krumen .krume[aria-current="page"]{color:var(--ink); font-weight:650;}
html .leiste .krumen .weiter{flex:0 0 auto; display:flex; color:var(--faint);}
html .leiste .krumen .weiter svg{width:13px; height:13px;}
html .leiste .unterreiter{position:relative; display:flex; align-items:stretch; gap:2px; flex:1 1 auto; min-width:0; overflow-x:auto;
  scrollbar-width:none; padding-left:var(--s2); border-left:1px solid var(--border);}
html .leiste .unterreiter:empty{border-left:0;}
html .leiste .unterreiter-knopf{all:unset; box-sizing:border-box; cursor:pointer; display:inline-flex; align-items:center; gap:6px; padding:0 10px;
  font:600 13px/1 var(--sans); color:var(--ink-soft); white-space:nowrap; transition:color var(--schnell) var(--ease);}
html .leiste .unterreiter-knopf:hover, html .leiste .unterreiter-knopf[aria-current="page"]{color:var(--ink);}
html .leiste .unterreiter-knopf:focus-visible{outline:2px solid var(--gold); outline-offset:-2px;}
html .leiste .unterreiter-knopf .zahl{font:700 11px/1.2 var(--mono); font-variant-numeric:tabular-nums; color:var(--faint);}
html .leiste .unterreiter-knopf .zahl:empty{display:none;}
/* Der Strich unter dem gewählten Unterreiter rückt in 200 ms weiter, ohne sich zu dehnen (T10) */
html .leiste .unterstrich{position:absolute; bottom:0; left:0; width:0; height:2px; border-radius:2px 2px 0 0; background:var(--gold);
  pointer-events:none; transition:left var(--normal) var(--ease), width var(--normal) var(--ease);}
html .leiste .leiste-werkzeuge{margin-left:auto; flex:0 0 auto; flex-wrap:nowrap; gap:var(--s3);}
/* Menü am Namen: am body, über den Hinweisbändern (300); die Fläche darunter fängt den Klick daneben (T14) */
html #leiste-flaeche{position:fixed; inset:0; z-index:310; background:transparent;}
html #leiste-menue{position:fixed; z-index:320; box-sizing:border-box; width:260px; max-width:calc(100vw - 16px); padding:var(--s3);
  border-radius:var(--r-md); color:var(--ink); background:var(--surface);}
html #leiste-menue[hidden], html #leiste-flaeche[hidden]{display:none;}
html #leiste-menue label{display:block; margin:0 0 var(--s1); font-size:10px; font-weight:800; letter-spacing:.11em; text-transform:uppercase;
  color:var(--faint); font-variant:normal;}
html #leiste-menue .wer{font-weight:650; overflow-wrap:anywhere;}
html #leiste-menue .seit{font-size:13px; color:var(--ink-soft);}
html #leiste-menue select{width:100%; font-size:13px; padding:7px 8px; margin:0;}
html #leiste-menue .btn{display:flex; width:100%; margin-top:var(--s3); box-sizing:border-box; justify-content:center; text-decoration:none;}
/* Was die Leiste nicht verdecken darf, beginnt unter ihr (T9) */
html.mit-leiste .bell-panel{top:calc(var(--leiste-hoehe, 0px) + var(--s2));}
html.mit-leiste .save-fail-banner{top:var(--leiste-hoehe, 0px);}
html.mit-leiste .toast{top:calc(var(--leiste-hoehe, 0px) + 24px);}
html.mit-leiste .protokoll-schleier{top:var(--leiste-hoehe, 0px); left:0;}
/* Unter 1180 px: an Glocke, Nachrichten, „Einstempeln“ und am Namen nur Zeichen; der Text bleibt für Bildschirmleser
   und steht als Hinweis (title) am Knopf */
@media (max-width:1180px){
  html .leiste .leiste-oben .text, html .leiste .station .text, html .leiste .person-knopf .text{position:absolute !important; width:1px;
    height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0;}
  html .leiste .reiter a{padding:7px 11px;}
  html .leiste .person-knopf{padding:7px 9px;}
}
/* Unter 820 px: beide Zeilen brechen um, die Reiter und die Unterreiter je in eine eigene Zeile */
@media (max-width:820px){
  html .leiste .leiste-zeile1{flex-wrap:wrap; row-gap:var(--s2); padding:var(--s2) var(--s3);}
  html .leiste .reiter{order:3; flex:1 1 100%;}
  html .leiste .leiste-zeile2{flex-wrap:wrap; gap:0 var(--s3); padding:var(--s1) var(--s3) 0;}
  html .leiste .krumen{flex:1 1 auto; min-height:32px;}
  html .leiste .leiste-werkzeuge{flex-wrap:wrap; min-height:32px;}
  html .leiste .unterreiter{order:3; flex:1 1 100%; min-height:40px; margin:0 calc(-1 * var(--s3)); padding:0 var(--s2); border-left:0;
    border-top:1px solid var(--border);}
  html .leiste .unterreiter:empty{display:none;}
}
@media (prefers-reduced-motion: reduce){ html .leiste .unterstrich{transition:none;} }
/* Druck: die Leiste ohne erste Zeile, Unterreiter und Knöpfe; Brotkrumen und Etikett drucken mit (wie bisher
   Überschrift und Etikett). Die Hülle bleibt ein Block (der Änderungsverlauf druckt über mehrere Seiten). */
@media print{
  html.mit-leiste .huelle{display:block;}
  html .leiste{position:static; border:0; box-shadow:none; background:none;}
  html .leiste .leiste-zeile1, html .leiste .unterreiter, html .leiste .leiste-werkzeuge > :not(.etikett),
  html #leiste-menue, html #leiste-flaeche{display:none !important;}
  html .leiste .leiste-zeile2{border:0; padding:0; min-height:0;}
}

/* ---------- Rahmen (feature-139, G184): Buehne.rahmen in static/buehne.js ----------
   Die Hauptseite nach der Anmeldung legt jedes Modul als vollständige Seite über die ganze Fläche (#rahmen-module am body).
   Ebene 50: über ihrer Hülle (1), unter ihrem Popup (60), ihrer Rückfrage (100) und dem Menü am Namen (320). Zustände an
   data-zustand (V1): „laedt“ unsichtbar und ohne Klick unter dem sichtbaren Modul, damit der Browser es schon zeichnet;
   „sichtbar“; „verborgen“ (dazu inert). Umgeblendet wird ohne Bewegung (DESIGN.md „Motion“). Der Hintergrund deckt, bis
   die Seite des Moduls gezeichnet ist. */
html #rahmen-module > .rahmen-modul{position:fixed; top:0; right:0; bottom:0; left:0; width:100%; height:100%; margin:0;
  padding:0; border:0; display:block; z-index:50; background:var(--bg);}
html #rahmen-module > .rahmen-modul[data-zustand="laedt"]{z-index:49; opacity:0; pointer-events:none;}
html #rahmen-module > .rahmen-modul[data-zustand="verborgen"]{visibility:hidden; pointer-events:none;}
/* V6: der geklickte Reiter, solange sein Modul zum ersten Mal lädt: wie hervorgehoben, leicht abgesenkt; keine Sanduhr, kein Text */
html .leiste .reiter a[aria-busy="true"]{color:var(--auf-gold); opacity:.72;
  background:linear-gradient(180deg, var(--akz-hell) 0%, var(--gold) 62%, var(--akz-tief) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28), 0 2px 2px rgba(var(--ton),.16), 0 5px 10px rgba(var(--ton),.18);}
/* E5 B: In einer eingebetteten Seite (Klasse im-rahmen am <html>, nur der Baustein setzt sie) beginnt die abgedunkelte Fläche
   der Fenster, ihrer Rückfrage und des Popups unter der Leiste: Die Leiste bleibt hell und anklickbar, man wechselt mit
   offenem Fenster und findet es beim Zurückkommen offen vor. Ohne Rahmen bleibt die Leiste bei offenem Fenster abgedunkelt:
   Dort wäre ein Klick auf einen Reiter ein Seitenwechsel, der Eingetipptes im Fenster ohne Rückfrage verwirft. */
html.mit-leiste.im-rahmen .modal-overlay, html.mit-leiste.im-rahmen .sf-schleier,
html.mit-leiste.im-rahmen .schiene-popup{top:var(--leiste-hoehe, 0px);}
