/* =====================================================================================================
   Design "edel" – gemeinsame Bausteine (Basis). Stand 18.11.2026, Konzept "warmedel" + Gutachten.
   Nur eingebunden bei DESIGN_STIL == 'edel' (base.html), liegt UEBER design-freundlich.css und UNTER
   css/edel/<gruppe>.css. Firmenfarbe kommt vorberechnet aus templates/_edel/basis_kopf.html:
   --we-marke (abgedunkelt, Weiss darauf >= 5,5:1), --we-marke-zart, --we-marke-ring; --brand-primary = --we-marke.
   Verbindliche Regeln fuer die Seitengruppen: SPEZ.md im Werkstatt-Ordner.
   Nachbesserung 19.11.2026: ein Kopfmuster (Bildkachel rechts statt Fotoband), helle Tabellenkoepfe auch bei
   .table-dark, sichtbarer Tastatur-Fokus an Knoepfen, Kopfknoepfe ohne Wortbruch, Kopf am Tablet umbrechend,
   Seitenleiste ohne Ueberstand, gruene Firmenfarbe getrennt von Status-Gruen.
   Leitidee: ruhige Akademie mit Gesicht. Geruest bleibt Strich fuer Strich gleich, neu sind die Bauteile
   (Siegel + Markenstrich am Seitentitel, Kennzahl-Bildkarten, Register-Tabellen, Lasche fuer die aktive Seite).
   Kein Lila, kein Glas, kein Leuchten, keine Verlaeufe als Schmuck.
   ===================================================================================================== */

/* ---------- 0  Schriften (lokal) ---------- */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('../fonts/fraunces-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: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('../fonts/fraunces-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('../fonts/instrument-sans-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: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url('../fonts/instrument-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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; }

/* ---------- 1  Tokens ---------- */
:root {
    /* Flaechen: Kalkstein statt Creme (nicht der bekannte KI-Cremeton), Karten fast weiss */
    --we-papier: #f3f2ef;
    --we-flaeche: #fffefc;
    --we-flaeche-2: #ecebe6;
    --we-tinte: #1b1f27;
    --we-text: #2b303a;
    --we-leise: #5b606c;          /* 5,6 auf Papier, 5,3 auf flaeche-2 */
    --we-linie: #e2e0d9;
    --we-linie-stark: #cbc8bf;
    --we-rahmen: #858278;         /* Feldrahmen, 3,9:1 auf Weiss */
    --we-nacht: #161a21;          /* Seitenleiste, Fusszeile */
    --we-nacht-2: #20252e;
    --we-nacht-linie: #2f3540;
    --we-nacht-text: #c6c3bb;     /* 9,9 auf Nacht */
    --we-hell: #fffefc;           /* Schrift auf Marke / Nacht */
    --we-messing: #7f5f24;        /* nur Zertifikat */
    --we-messing-hell: #c9a66b;
    /* Status: Text / Grund / Kante */
    --we-erfolg: #2c6a43; --we-erfolg-bg: #e4efe6; --we-erfolg-kante: #4f8f64;
    --we-warn: #6e4a0e;   --we-warn-bg: #f6ead2;   --we-warn-kante: #c4952f;
    --we-bernstein: #d8a23c;      /* volle Warnflaeche (Knopf, Zaehler), Tinte darauf 7,3:1 */
    --we-gefahr: #a5352a; --we-gefahr-bg: #f7e4df; --we-gefahr-kante: #c4574a;
    --we-info: #24495d;   --we-info-bg: #e5edf0;   --we-info-kante: #5f8798;
    /* Firmenfarbe: Rueckfall, falls basis_kopf.html fehlt (wird dort ueberschrieben) */
    --we-marke: #1b1f27;
    --we-marke-zart: #e8e8e7;
    --we-marke-ring: rgba(27, 31, 39, .28);
    /* Wo die Firmenfarbe nah an Status liegt: Fortschritt, Primaer-Etikett, Weiter-Knopf. Standard = Marke bzw. Erfolg.
       Bei gruener Firmenfarbe (Farbton nah an --we-erfolg) setzt base.html (<style id="edel-marke-gruen">) neutrale
       Werte, damit "in Bearbeitung" nicht wie "fertig" aussieht und es nur EIN Gruen fuer Knoepfe gibt. */
    --we-fortschritt: var(--we-marke);
    --we-etikett-marke: var(--we-marke);
    --we-etikett-marke-bg: var(--we-marke-zart);
    --we-etikett-marke-kante: transparent;
    --we-knopf-weiter: var(--we-erfolg);
    --we-knopf-weiter-hover: #23573a;
    /* Schrift */
    --we-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --we-sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    /* Form */
    --we-rund: 10px;
    --we-rund-bild: 14px;
    --we-rund-klein: 8px;
    --we-rund-etikett: 6px;
    --we-schatten: 0 14px 32px -18px rgba(27, 31, 39, .35);   /* nur Ausklappmenue + Modal */
    --we-motiv-filter: saturate(.86) contrast(1.03);           /* KI-Motive einheitlich stimmen, Firmen-Kursbilder nie */
    /* Bewegung */
    --we-ease: cubic-bezier(.2, .7, .2, 1);
    --we-kurz: .16s;
    --we-normal: .32s;
    /* design-freundlich.css auf die edel-Werte umlenken */
    --df-text: var(--we-text);
    --df-muted: var(--we-leise);
    --df-line: var(--we-linie);
    --df-flaeche: var(--we-papier);
    --df-rund: var(--we-rund);
    --df-rund-klein: var(--we-rund-klein);
    --df-schatten: none;
    --df-brand-zart: var(--we-marke-zart);
    --df-brand-ring: var(--we-marke-ring);
}

/* ---------- 2  Grundlage ---------- */
html body {
    font-family: var(--we-sans); font-size: 1rem; line-height: 1.55;
    background: var(--we-papier); color: var(--we-text);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--we-serif); font-weight: 540; color: var(--we-tinte); letter-spacing: -.012em;
    font-optical-sizing: auto; line-height: 1.18;
}
h4, h5, h6, .h4, .h5, .h6 { font-family: var(--we-sans); font-weight: 600; color: var(--we-tinte); letter-spacing: -.003em; }
body a { color: var(--we-marke); text-underline-offset: .18em; }
body a:hover { color: var(--we-tinte); }
::selection { background: var(--we-marke-zart); color: var(--we-tinte); }
:focus-visible { outline: 2px solid var(--we-marke); outline-offset: 2px; }
.navbar-custom :focus-visible, .sidebar :focus-visible, footer :focus-visible { outline-color: var(--we-hell); }
.text-muted { color: var(--we-leise) !important; }
.text-primary { color: var(--we-marke) !important; }
.text-success { color: var(--we-erfolg) !important; }
.text-warning { color: #8a5d0c !important; }     /* live #ffc107 auf Weiss = 1,6:1 */
.text-danger { color: var(--we-gefahr) !important; }
.text-info { color: #1f6680 !important; }
.text-secondary { color: var(--we-leise) !important; }
.text-dark { color: var(--we-tinte) !important; }
.bg-light { background-color: var(--we-flaeche-2) !important; }
.border-bottom, .border-top { border-color: var(--we-linie) !important; }
hr { color: var(--we-linie-stark); opacity: 1; }
small, .small { font-size: .875rem; }
.font-monospace, code { font-variant-numeric: tabular-nums; }

/* ---------- 3  Kopfzeile (Firmenfarbe als Flaeche, wie live) ---------- */
html body nav.navbar-custom {
    background-color: var(--we-marke) !important; min-height: 60px;
    border-bottom: 1px solid rgba(0, 0, 0, .22); box-shadow: none;
}
body .navbar-custom .navbar-brand {
    font-family: var(--we-serif); font-weight: 560; font-size: 1.4rem; letter-spacing: -.01em;
    color: var(--we-hell) !important; display: inline-flex; align-items: center; min-height: 44px;
}
body .navbar-custom .navbar-brand i {
    width: 2rem; height: 2rem; display: inline-grid; place-items: center; flex: 0 0 auto;
    font-size: .9rem; border-radius: 50%; background: transparent; color: var(--we-hell);
    border: 1px solid rgba(255, 254, 252, .5);
}
body .navbar-custom .nav-link.dropdown-toggle,
body .navbar-custom .nav-link.dropdown-toggle:hover,
body .navbar-custom .nav-link.dropdown-toggle:focus {
    color: var(--we-hell) !important; background: transparent; box-shadow: none;
    min-height: 44px; display: inline-flex; align-items: center; gap: .1rem; flex-wrap: wrap;
    padding: .25rem .9rem !important; border: 1px solid rgba(255, 254, 252, .4); border-radius: var(--we-rund-klein);
    font-weight: 600; white-space: normal; overflow-wrap: anywhere;
}
body .navbar-custom .nav-link.dropdown-toggle:hover { background: rgba(255, 255, 255, .08); }

/* Ausklappmenue */
body .dropdown-menu {
    background: var(--we-flaeche); border: 1px solid var(--we-linie); border-radius: var(--we-rund);
    box-shadow: var(--we-schatten); padding: .35rem;
}
body .dropdown-item {
    min-height: 44px; display: flex; align-items: center; border-radius: 6px; padding: .5rem .8rem;
    color: var(--we-text);
}
body .dropdown-item i { color: var(--we-marke); width: 1.25rem; }
body .dropdown-item:hover, body .dropdown-item:focus { background: var(--we-marke-zart); color: var(--we-tinte); }
body .dropdown-item:active { background: var(--we-marke); color: var(--we-hell); }
body .dropdown-item:active i { color: var(--we-hell); }
.dropdown-divider { border-color: var(--we-linie); }

/* ---------- 4  Seitenleiste (dunkel, wie live) + Lasche fuer die aktive Seite (Regeln in basis_kopf.html) ---------- */
html body .sidebar { background-color: var(--we-nacht) !important; border-right: 1px solid var(--we-nacht-linie); }
/* Liste ohne Spaltenumbruch: Bootstraps .nav hat flex-wrap:wrap; in einer Spalte macht das jede Zeile so breit wie den
   laengsten Eintrag, und die Eintraege ragen bei 992-1439 px ueber die Leiste auf die helle Seite. */
body .sidebar .nav.flex-column { flex-wrap: nowrap; }
/* Eintrag: Symbol als haengender Einzug, Text darf umbrechen (Silbentrennung), der Zaehler steht rechts und rutscht
   in die naechste Zeile, wenn kein Platz ist (wie live). Nichts ragt aus der Leiste. */
body .sidebar .nav-link {
    display: block; position: relative; min-height: 44px; margin: 2px .25rem 2px 0; padding: .75rem .55rem .75rem 2.35rem;
    border-radius: 0 var(--we-rund-klein) var(--we-rund-klein) 0; color: var(--we-nacht-text);
    font-size: .9375rem; font-weight: 500; line-height: 1.3; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
    transition: background-color var(--we-kurz), color var(--we-kurz);
}
body .sidebar .nav-link::after { content: ''; display: table; clear: both; }
body .sidebar .nav-link > i {
    position: absolute; left: .5rem; top: .75rem; width: 1.4rem; height: 1.22rem; margin: 0 !important;
    display: flex; align-items: center; justify-content: center; opacity: .82; font-size: .95rem;
}
body .sidebar .nav-link:hover { background: var(--we-nacht-2); color: var(--we-hell); }
body .sidebar .nav-link .badge { float: right; margin: .05rem 0 0 .3rem !important; }
/* Schmale Leiste (col-md-3 / col-lg-2 bei 768-1439 px = 165-240 px): etwas kleiner, damit seltener getrennt wird */
@media (min-width: 768px) and (max-width: 1439.98px) {
    body .sidebar .nav-link { font-size: .9rem; }
    body .sidebar .nav-link > i { height: 1.17rem; font-size: .9rem; }
}
body .sidebar .badge.bg-warning { background: var(--we-bernstein) !important; color: var(--we-tinte) !important; }
/* "Naechster Kurs": kleine Bildkarte (Inline-Stile aus base.html: Hintergrund ueberschreibbar, Randfarbe nicht) */
body .sidebar .mt-3.p-3.rounded.border {
    background: var(--we-nacht-2) !important; border-style: none !important;
    box-shadow: inset 0 0 0 1px var(--we-nacht-linie); border-radius: 12px !important; margin: 1rem .75rem 0 .5rem;
}
body .sidebar .mt-3.p-3.rounded.border > .small:first-child { font-weight: 600; letter-spacing: .02em; margin-bottom: .55rem; }
body .sidebar .mt-3.p-3.rounded.border > .d-flex { flex-direction: column; align-items: stretch !important; gap: .55rem; }
body .sidebar .mt-3.p-3.rounded.border > .d-flex > img {
    width: 100% !important; height: auto !important; aspect-ratio: 7 / 5; border-radius: 8px !important; margin: 0 !important;
}
body .sidebar .mt-3.p-3.rounded.border > .d-flex > .flex-grow-1 { font-family: var(--we-serif); font-size: 1rem; line-height: 1.3; color: var(--we-hell) !important; }
body .sidebar .mt-3.p-3.rounded.border > .btn { margin-top: .8rem !important; }
body .sidebar .mt-3.p-2.rounded.border {
    background: transparent !important; border-style: none !important; border-top: 1px solid var(--we-nacht-linie) !important;
    border-radius: 0 !important; margin: 1.25rem .75rem 1rem .5rem; padding: 1rem .25rem 0 !important; color: var(--we-nacht-text) !important;
    line-height: 1.5;
}
body .sidebar .mt-3.p-2.rounded.border strong { color: var(--we-hell); font-weight: 600; }
body .sidebar .mt-3.p-2.rounded.border a { color: var(--we-hell) !important; display: inline-block; padding: .35rem 0; }

/* ---------- 5  Seitenkopf: Serif-Titel, Symbol als Siegel, Markenstrich; optional Kopfband ---------- */
main > .d-flex.border-bottom {
    position: relative; border-bottom: 1px solid var(--we-linie-stark) !important;
    padding-top: 1.6rem !important; padding-bottom: 1.1rem !important; margin-bottom: 1.75rem !important; gap: .75rem 1rem;
}
main > .d-flex.border-bottom::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 56px; height: 3px; background: var(--we-marke);
}
main h1.h2, main > .d-flex.border-bottom h1 {
    font-size: clamp(1.75rem, 1.35rem + 1.2vw, 2.4rem); display: flex; align-items: center; gap: .8rem; margin: 0;
    min-width: 0; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
}
main h1.h2 > i, main > .d-flex.border-bottom h1 > i {
    flex: 0 0 auto; width: 2.6rem; height: 2.6rem; display: inline-grid; place-items: center; margin: 0 !important;
    font-size: 1rem; border-radius: 50%; background: var(--we-flaeche); color: var(--we-marke);
    border: 1px solid var(--we-linie-stark);
}
main > .d-flex.border-bottom img[alt="Logo"] { max-height: 44px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
main > .d-flex.border-bottom > .btn-toolbar { gap: .5rem; }
main > .d-flex.border-bottom > .btn-toolbar > .btn-group { margin-right: 0 !important; }
/* Ein Kopfmuster fuer alle Seiten: Titel steht immer oben links an derselben Stelle (auch neben einer Bildkachel). */
@media (min-width: 768px) {
    main > .d-flex.border-bottom { align-items: flex-start !important; }
}
/* Tablet und kleiner Laptop (768-1199 px): Knopfleiste rutscht unter den Titel, statt Titel und Knoepfe zu quetschen
   ("Fir-men Da-sh-board", abgeschnittener "Schulungskalender"). Reihenfolge bleibt; ab 1200 px wie live. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    main > .d-flex.border-bottom { flex-wrap: wrap !important; }
    main > .d-flex.border-bottom > .d-flex:has(> img, > .badge) { flex-wrap: wrap; row-gap: .75rem; min-width: 0; }
}
/* Bildkachel (nur Einstiegsseiten): Gruppe setzt am Body  --we-kopfband: url(..); --we-kopfband-anzeige: block;
   optional --we-kopfband-fokus: 50% 35%. Die Kachel ist das ::before des Seitenkopfs (kein neues Markup) und steht
   rechts neben dem Titel, vor einer vorhandenen Knopfleiste; am Handy als flaches Band unter dem Titel.
   Der Titel steht dadurch auf allen Seiten an derselben Stelle (frueher: Fotoband ueber dem Titel). */
main > .d-flex.border-bottom::before {
    content: ''; display: var(--we-kopfband-anzeige, none); order: 1; flex: 0 0 9.5rem;
    height: 6.25rem; margin-left: auto; align-self: flex-start; border-radius: var(--we-rund-bild);
    background: var(--we-flaeche-2) var(--we-kopfband, none) var(--we-kopfband-fokus, 50% 40%) / cover no-repeat;
    filter: var(--we-motiv-filter); box-shadow: inset 0 0 0 1px rgba(27, 31, 39, .06);
}
main > .d-flex.border-bottom > :not(:first-child) { order: 2; }
@media (min-width: 768px) and (max-width: 1199.98px) {
    main > .d-flex.border-bottom::before { flex-basis: 7.5rem; height: 5rem; }
}

/* ---------- 6  Karten ---------- */
html body .card {
    background: var(--we-flaeche); border: 1px solid var(--we-linie); border-radius: var(--we-rund);
    box-shadow: none !important;
}
body .card > .card-header:first-child { border-radius: calc(var(--we-rund) - 1px) calc(var(--we-rund) - 1px) 0 0; }
body .card > .card-footer:last-child { border-radius: 0 0 calc(var(--we-rund) - 1px) calc(var(--we-rund) - 1px); }
body .card-header { background: transparent; border-bottom: 1px solid var(--we-linie); padding: 1rem 1.25rem; }
body .card-header .card-title, body .card-header h5, body .card-header h4 {
    font-family: var(--we-serif); font-weight: 540; font-size: 1.3rem; color: var(--we-tinte); letter-spacing: -.008em;
}
body .card-header h6 { font-weight: 600; }
body .card-header .card-title > i, body .card-header h5 > i, body .card-header h4 > i, body .card-body > h5.card-title > i {
    font-size: .85em; color: var(--we-marke); opacity: .9;
}
body .card-body { padding: 1.25rem; }
body .card-body > h5.card-title { font-family: var(--we-serif); font-weight: 540; font-size: 1.3rem; }
body .card-footer { background: var(--we-papier); border-top: 1px solid var(--we-linie); }
body .card.bg-light { background: var(--we-flaeche-2) !important; }
body .card.border-info, body .card.border-primary, body .card.border-warning, body .card.border-danger, body .card.border-success {
    border-color: var(--we-linie) !important; border-top-width: 3px !important;
}
body .card.border-info { border-top-color: var(--we-info-kante) !important; }
body .card.border-primary { border-top-color: var(--we-marke) !important; }
body .card.border-warning { border-top-color: var(--we-warn-kante) !important; }
body .card.border-danger { border-top-color: var(--we-gefahr-kante) !important; }
body .card.border-success { border-top-color: var(--we-erfolg-kante) !important; }
/* Farbige Kartenkoepfe -> ruhiger Kopf mit 3-px-Oberkante, Bedeutung bleibt ueber Farbe + Symbol */
html body .card-header.text-white[class*="bg-"], html body .card-header.bg-warning {
    background: var(--we-flaeche) !important; color: var(--we-tinte) !important; border-top: 3px solid var(--we-marke);
}
html body .card-header.text-white[class*="bg-"] *:not(.btn):not(.badge):not(.btn *):not(.badge *) { color: var(--we-tinte) !important; }
html body .card-header.bg-info { border-top-color: var(--we-info-kante); }
html body .card-header.bg-danger { border-top-color: var(--we-gefahr-kante); }
html body .card-header.bg-warning { border-top-color: var(--we-warn-kante); }
html body .card-header.bg-success { border-top-color: var(--we-erfolg-kante); }
html body .card-header.bg-dark, html body .card-header.bg-secondary { border-top-color: var(--we-tinte); }

/* ---------- 7  Kennzahl-Karten (allgemein; Bilder setzt die Gruppe ueber --we-bild + --we-kennbild-anzeige) ----------
   KA = Akzentkante  .card[class*="border-left-"]            (Firmen-/Superadmin-Dashboard)
   KZ = zentriert    .card.text-center mit .card-title + .card-text   (Mitarbeiter-Start, Gruppen-Uebersicht)
   KF = Farbflaeche  .card.text-white.bg-*                     (Schulungsmatrix) -> Papierkarte mit Statuskante */
.row > div > .card[class*="border-left-"],
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text) {
    position: relative; overflow: hidden; text-align: left !important; padding: 0 !important;
}
.row > div > .card[class*="border-left-"]::before,
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text)::before {
    content: ''; display: var(--we-kennbild-anzeige, none); aspect-ratio: 2 / 1;
    background: var(--we-flaeche-2) var(--we-bild, none) var(--we-bild-fokus, 50% 50%) / cover no-repeat;
    filter: var(--we-motiv-filter); border-bottom: 1px solid var(--we-linie);
}
.row > div > .card[class*="border-left-"] > .card-body,
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body { position: relative; padding: 1.15rem 1.25rem 1.2rem; }
/* Zahl */
.row > div > .card[class*="border-left-"] .h5,
.row > div > .card.text-center > .card-body > .card-title {
    font-family: var(--we-serif); font-size: 2.4rem; font-weight: 500 !important; line-height: 1.05; letter-spacing: -.01em;
    color: var(--we-tinte) !important; font-variant-numeric: lining-nums tabular-nums; margin: .1rem 0 .35rem;
}
/* Beschriftung: Satzschreibung, leise, >= .8125rem */
.row > div > .card[class*="border-left-"] .text-xs,
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text) .card-text {
    font-size: .9rem; font-weight: 600; text-transform: none !important; letter-spacing: 0;
    color: var(--we-leise) !important; margin: 0 0 .15rem !important;
}
.row > div > .card[class*="border-left-"] .row.no-gutters { align-items: flex-start !important; }
.row > div > .card[class*="border-left-"] .col.mr-2 { min-width: 0; }
/* Symbol als Siegel oben rechts (ohne Bild in der Karte), auf der Bildkante (mit Bild) */
.row > div > .card[class*="border-left-"] .col-auto { position: static; }
.row > div > .card[class*="border-left-"] .col-auto > i.fa-2x,
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body > i.fa-2x {
    position: absolute; top: var(--we-siegel-oben, 1rem); right: 1rem; width: 44px; height: 44px; margin: 0 !important;
    display: grid; place-items: center; font-size: 1rem !important; border-radius: 50%;
    background: var(--we-flaeche); color: var(--we-marke) !important; border: 1px solid var(--we-linie-stark);
}
.row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body:has(> i.fa-2x) { padding-right: 4.25rem; }
.row > div > .card[class*="border-left-"] .col.mr-2 { padding-right: 3.25rem; }
/* KF: Farbflaechen-Kennzahlen (weiss auf Gelb live!) -> Papier, Statuskante, Zahl in Serif */
html body .card.text-white[class*="bg-"] {
    background: var(--we-flaeche) !important; color: var(--we-tinte) !important; border-top: 3px solid var(--we-marke) !important;
}
html body .card.text-white.bg-success { border-top-color: var(--we-erfolg-kante) !important; }
html body .card.text-white.bg-warning { border-top-color: var(--we-warn-kante) !important; }
html body .card.text-white.bg-info { border-top-color: var(--we-info-kante) !important; }
html body .card.text-white.bg-danger { border-top-color: var(--we-gefahr-kante) !important; }
html body .card.text-white[class*="bg-"] h4, html body .card.text-white[class*="bg-"] h3 {
    font-family: var(--we-serif); font-size: 2.2rem; font-weight: 500; line-height: 1.05; color: var(--we-tinte); font-variant-numeric: lining-nums tabular-nums;
}
html body .card.text-white[class*="bg-"] p, html body .card.text-white[class*="bg-"] small { color: var(--we-leise); font-weight: 600; }
html body .card.text-white[class*="bg-"] i.fas, html body .card.text-white[class*="bg-"] i.fa { color: var(--we-marke); opacity: .85; }
/* Symbol traegt die Statusfarbe der Karte (nie Firmenfarbe fuer Status, sonst "in Bearbeitung" gruen bei gruener Firma) */
html body .card.text-white.bg-success i.fas, html body .card.text-white.bg-success i.fa { color: var(--we-erfolg); }
html body .card.text-white.bg-warning i.fas, html body .card.text-white.bg-warning i.fa { color: #8a5d0c; }
html body .card.text-white.bg-info i.fas, html body .card.text-white.bg-info i.fa { color: var(--we-info); }
html body .card.text-white.bg-danger i.fas, html body .card.text-white.bg-danger i.fa { color: var(--we-gefahr); }
/* Am Handy: Kennzahl-Zeilen 2 x 2 (nur echte Kennzahl-Zeilen, nie .row.mb-4 allgemein!) */

/* ---------- 8  Tabellen als ruhige Register ---------- */
body .table { color: var(--we-text); --bs-table-hover-bg: var(--we-marke-zart); }
body .table > :not(caption) > * > * { border-bottom-color: var(--we-linie); padding: .75rem .75rem; }
body .table-sm > :not(caption) > * > * { padding: .5rem .55rem; }
body .table > :not(:first-child) { border-top: 1px solid var(--we-linie-stark); }
body .table > thead > tr > th, body .table > thead > tr > td {
    background: var(--we-flaeche-2); color: var(--we-leise); font-size: .875rem; font-weight: 600;
    text-transform: none; letter-spacing: .005em; border-bottom: 1px solid var(--we-linie-stark); vertical-align: bottom;
}
body .table > tbody > tr > td { vertical-align: middle; font-variant-numeric: tabular-nums; }
body .table-hover > tbody > tr:hover > * { --bs-table-accent-bg: var(--we-marke-zart); }
body .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: rgba(27, 31, 39, .025); }
/* Live dunkle Koepfe (.table-dark: Tickets, Dokument- und Schulungsmatrix) -> derselbe helle Registerkopf wie ueberall.
   Klassen im Markup bleiben. Haarlinie als Innenschatten, damit sie auch am klebenden (sticky) Kopf stehen bleibt. */
body .table > thead.table-dark > tr > th, body .table > thead.table-dark > tr > td, body .table-dark > tr > th {
    background: var(--we-flaeche-2) !important; color: var(--we-leise) !important; border-color: var(--we-linie) !important;
    border-bottom-color: var(--we-linie-stark) !important; box-shadow: inset 0 -1px 0 var(--we-linie-stark);
}
body .table > thead.table-dark, body .table > thead.table-dark > tr { color: var(--we-leise); border-color: var(--we-linie) !important; }
/* Matrizen: Kopfzellen tragen Kurs-/Dokumenttitel -> Tinte, Kategorie darunter leise. Die Matrix-Seite setzt eigene
   Regeln mit ID (#trainingMatrixTable), darum hier mit hoeherer Spezifitaet. */
html body .table#instructionsMatrixTable > thead.table-dark > tr > th,
html body .table#trainingMatrixTable > thead.table-dark > tr > th:is(.sticky-col, .sticky-header, th) {
    background: var(--we-flaeche-2) !important; color: var(--we-tinte) !important; box-shadow: inset 0 -1px 0 var(--we-linie-stark);
}
html body .table#trainingMatrixTable > thead.table-dark .text-muted,
html body .table#instructionsMatrixTable > thead.table-dark .text-muted { color: var(--we-leise) !important; }
body .table > thead.table-light > tr > th { background: var(--we-flaeche-2); }
body .table td > strong:first-child, body .table td > a > strong { color: var(--we-tinte); font-weight: 600; }
/* Breite Tabellen scrollen in der Karte statt die Seite zu verbreitern */
body .card-body:has(> table, > .table-responsive) { overflow-x: auto; }
body .table-responsive { -webkit-overflow-scrolling: touch; }

/* ---------- 9  Knoepfe ---------- */
body .btn {
    border-radius: var(--we-rund-klein); font-weight: 600; letter-spacing: .003em; line-height: 1.5;
    padding: .55rem 1rem; box-shadow: none;
    transition: background-color var(--we-kurz), border-color var(--we-kurz), color var(--we-kurz), box-shadow var(--we-kurz);
}
body .btn-sm { padding: .4rem .75rem; font-size: .875rem; }
body .btn-lg { padding: .75rem 1.4rem; font-size: 1.0625rem; }
body .btn:active { transform: translateY(1px); }
body .btn:focus, body .btn:focus-visible { box-shadow: 0 0 0 .2rem var(--we-marke-ring); }
/* Tastatur-Fokus: Bootstraps ".btn:focus { outline: 0 }" ist spezifischer als :focus-visible aus Abschnitt 2, darum
   hier eigens. 2-px-Linie in Firmenfarbe mit Abstand (>= 4,9:1 auf Papier), der Ring bleibt zusaetzlich.
   Auf dunklem Grund (Kopfzeile, Seitenleiste, Fuss, dunkle Hinweise) helle Linie. */
html body .btn:focus-visible, html body .btn-check:focus-visible + .btn, html body .btn-close:focus-visible {
    outline: 2px solid var(--we-marke); outline-offset: 2px;
}
html body .navbar-custom .btn:focus-visible, html body .sidebar .btn:focus-visible, html body footer .btn:focus-visible,
html body .alert-dark .btn:focus-visible, html body .navbar-custom .btn-close:focus-visible { outline-color: var(--we-hell); }
body .btn-group > .btn, body .btn-group-sm > .btn { padding-left: .8rem; padding-right: .8rem; }
/* Primaer = Firmenfarbe (abgedunkelt), Hover dunkler ohne Farbrechnung; Fokus = Linie + Ring (nicht wie Hover) */
html body .btn-primary { background-color: var(--we-marke) !important; border-color: var(--we-marke) !important; color: var(--we-hell) !important; }
html body .btn-primary:hover { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .16); filter: none; }
html body .btn-primary:focus-visible { box-shadow: 0 0 0 .2rem var(--we-marke-ring); filter: none; }
html body .btn-primary:hover:focus-visible { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .16), 0 0 0 .2rem var(--we-marke-ring); }
html body .btn-outline-primary { background: var(--we-flaeche); color: var(--we-marke) !important; border-color: var(--we-linie-stark) !important; }
html body .btn-outline-primary:hover { background: var(--we-marke-zart) !important; color: var(--we-tinte) !important; border-color: var(--we-marke) !important; }
/* Weiter / Start bleibt gruen (gelernt) */
body .btn-success { background-color: var(--we-knopf-weiter); border-color: var(--we-knopf-weiter); color: var(--we-hell); }
body .btn-success:hover { background-color: var(--we-knopf-weiter-hover); border-color: var(--we-knopf-weiter-hover); color: var(--we-hell); }
body .btn-danger { background-color: var(--we-gefahr); border-color: var(--we-gefahr); color: var(--we-hell); }
body .btn-danger:hover { background-color: #8b2a21; border-color: #8b2a21; }
body .btn-warning { background-color: var(--we-bernstein); border-color: var(--we-bernstein); color: var(--we-tinte); }
body .btn-warning:hover { background-color: #c99231; border-color: #c99231; color: var(--we-tinte); }
body .btn-info { background-color: var(--we-info); border-color: var(--we-info); color: var(--we-hell); }
body .btn-info:hover { background-color: #1b3a4b; border-color: #1b3a4b; color: var(--we-hell); }
body .btn-secondary { background-color: #5b606c; border-color: #5b606c; color: var(--we-hell); }
body .btn-dark { background-color: var(--we-tinte); border-color: var(--we-tinte); color: var(--we-hell); }
body .btn-light { background: var(--we-flaeche); border-color: var(--we-linie-stark); color: var(--we-tinte); }
/* Umriss-Knoepfe: Flaeche + Haarlinie, Bedeutung ueber dunkle Statusschrift */
body .btn-outline-secondary, body .btn-outline-dark, body .btn-outline-info, body .btn-outline-success,
body .btn-outline-danger, body .btn-outline-warning, body .btn-outline-light {
    background: var(--we-flaeche); border-color: var(--we-linie-stark); color: var(--we-tinte);
}
body .btn-outline-info { color: var(--we-info); }
body .btn-outline-success { color: var(--we-erfolg); }
body .btn-outline-danger { color: var(--we-gefahr); }
body .btn-outline-warning { color: var(--we-messing); border-color: #b99a62; }          /* Zertifikat: Messing, live 1,6:1 */
body .btn-outline-secondary:hover, body .btn-outline-dark:hover, body .btn-outline-info:hover, body .btn-outline-success:hover,
body .btn-outline-light:hover { background: var(--we-flaeche-2); border-color: var(--we-tinte); color: var(--we-tinte); }
body .btn-outline-danger:hover { background: var(--we-gefahr-bg); border-color: var(--we-gefahr); color: var(--we-gefahr); }
body .btn-outline-warning:hover { background: #f4ead6; border-color: var(--we-messing); color: var(--we-messing); }
body .btn-link { color: var(--we-marke); font-weight: 600; }
body .btn-close { opacity: .6; }
/* Segmentschalter (btn-check-Gruppen) statt Bootstrap-Blau */
body .btn-group:has(> .btn-check) {
    background: var(--we-flaeche-2); padding: 3px; border-radius: var(--we-rund); gap: 2px; flex-wrap: wrap;
}
html body .btn-group:has(> .btn-check) > .btn {
    background: transparent !important; border: 1px solid transparent !important; color: var(--we-text) !important;
    border-radius: var(--we-rund-klein) !important; font-weight: 500;
}
html body .btn-group:has(> .btn-check) > .btn-check:checked + .btn {
    background: var(--we-flaeche) !important; border-color: var(--we-linie-stark) !important; color: var(--we-tinte) !important; font-weight: 600;
}
html body .btn-check:focus-visible + .btn { box-shadow: 0 0 0 .2rem var(--we-marke-ring) !important; }
html body .btn-check:checked + .btn-outline-primary, html body .btn-check:checked + .btn-outline-secondary,
html body .btn-check:checked + .btn-outline-success, html body .btn-check:checked + .btn-outline-info {
    background: var(--we-marke-zart) !important; color: var(--we-tinte) !important; border-color: var(--we-marke) !important;
}

/* ---------- 10  Abzeichen: Etiketten, Satzschreibung, >= .8125rem ---------- */
body .badge {
    border-radius: var(--we-rund-etikett); font-weight: 600; font-size: .8125rem; line-height: 1.25;
    padding: .28em .6em; letter-spacing: .005em; text-transform: none; font-variant-numeric: tabular-nums;
}
html body .badge.bg-primary {
    background: var(--we-etikett-marke-bg) !important; color: var(--we-etikett-marke) !important;
    box-shadow: inset 0 0 0 1px var(--we-etikett-marke-kante);
}
html body .badge.bg-success { background: var(--we-erfolg-bg) !important; color: var(--we-erfolg) !important; }
html body .badge.bg-warning { background: var(--we-warn-bg) !important; color: var(--we-warn) !important; }
html body .badge.bg-danger { background: var(--we-gefahr-bg) !important; color: var(--we-gefahr) !important; }
html body .badge.bg-info { background: var(--we-info-bg) !important; color: var(--we-info) !important; }
html body .badge.bg-secondary { background: var(--we-flaeche-2) !important; color: var(--we-tinte) !important; }
html body .badge.bg-light { background: var(--we-flaeche-2) !important; color: var(--we-tinte) !important; }
html body .badge.bg-dark { background: var(--we-tinte) !important; color: var(--we-hell) !important; }
html body .badge.rounded-pill { border-radius: 999px; }

/* ---------- 11  Hinweiskaesten ---------- */
html body .alert {
    border: 0; border-left: 3px solid var(--we-linie-stark); border-radius: var(--we-rund-klein);
    padding: .9rem 1.1rem; line-height: 1.5;
}
html body .alert-info { background: var(--we-info-bg); color: var(--we-info); border-left-color: var(--we-info-kante); }
html body .alert-warning { background: var(--we-warn-bg); color: var(--we-warn); border-left-color: var(--we-warn-kante); }
html body .alert-success { background: var(--we-erfolg-bg); color: var(--we-erfolg); border-left-color: var(--we-erfolg-kante); }
html body .alert-danger { background: var(--we-gefahr-bg); color: var(--we-gefahr); border-left-color: var(--we-gefahr-kante); }
html body .alert-primary { background: var(--we-marke-zart); color: var(--we-tinte); border-left-color: var(--we-marke); }
html body .alert-secondary, html body .alert-light { background: var(--we-flaeche-2); color: var(--we-text); border-left-color: var(--we-linie-stark); }
html body .alert-dark { background: var(--we-nacht-2); color: var(--we-hell); border-left-color: var(--we-tinte); }
.alert .alert-heading { font-family: var(--we-serif); font-weight: 560; color: inherit; }
.alert a:not(.btn) { color: inherit; text-decoration: underline; }
/* Hinweis mit Knopf: am Handy rutscht der Knopf unter den Text statt zweizeilig zu brechen */
html body .alert.d-flex { flex-wrap: wrap; gap: .6rem 1rem; }
html body .alert.d-flex > div:first-child { flex: 1 1 18rem; min-width: 0; }
html body .alert.d-flex > .btn, html body .alert.d-flex > a.btn { white-space: nowrap; }
html body .alert .btn { max-width: 100%; }
@media (max-width: 767.98px) { html body .alert.d-flex > .btn { white-space: normal; } }
html body .alert .btn-outline-dark { background: rgba(255, 254, 252, .7); }
.alert-dismissible .btn-close { padding: 1.15rem 1rem; }

/* ---------- 12  Formulare ---------- */
body .form-label, body label.form-label { font-size: .9375rem; font-weight: 600; color: var(--we-tinte); margin-bottom: .35rem; }
html body .form-control, html body .form-select {
    background-color: #fff; border: 1px solid var(--we-rahmen); border-radius: var(--we-rund-klein);
    color: var(--we-tinte); min-height: 2.625rem; padding: .5rem .8rem;
}
html body .form-select { padding-right: 2.25rem; }
html body .form-control-sm, html body .form-select-sm { min-height: 2.25rem; padding: .3rem .6rem; font-size: .875rem; }
html body .form-select-sm { padding-right: 2rem; }
html body textarea.form-control { min-height: 5rem; }
html body .form-control::placeholder { color: #767a84; }
html body .form-control:focus, html body .form-select:focus {
    border-color: var(--we-marke); box-shadow: 0 0 0 3px var(--we-marke-ring); outline: 0;
}
html body .form-control:disabled, html body .form-control[readonly] { background-color: var(--we-flaeche-2); }
html body .form-check-input { width: 1.15em; height: 1.15em; border: 1px solid var(--we-rahmen); }
html body .form-check-input:checked { background-color: var(--we-marke); border-color: var(--we-marke); }
html body .form-check-input:focus { box-shadow: 0 0 0 3px var(--we-marke-ring); border-color: var(--we-marke); }
body .form-text { color: var(--we-leise); }
body .input-group-text { background: var(--we-flaeche-2); border-color: var(--we-rahmen); color: var(--we-text); }
body .invalid-feedback, body .text-danger.small { color: var(--we-gefahr); }
body .form-control.is-invalid { border-color: var(--we-gefahr); }
body input[type="file"] { max-width: 100%; }
body .form-control[type="file"]::file-selector-button { background: var(--we-flaeche-2); color: var(--we-tinte); font-weight: 600; }

/* ---------- 13  Reiter / Aufklapper ---------- */
body .nav-tabs { border-bottom: 1px solid var(--we-linie-stark); gap: .25rem; }
body .nav-tabs .nav-link { border: 0; border-radius: var(--we-rund-klein) var(--we-rund-klein) 0 0; color: var(--we-leise); font-weight: 600; min-height: 44px; }
body .nav-tabs .nav-link.active { color: var(--we-tinte); background: transparent; box-shadow: inset 0 -3px 0 var(--we-marke); }
body .nav-pills .nav-link { border-radius: var(--we-rund-klein); color: var(--we-text); }
body .nav-pills .nav-link.active { background: var(--we-marke); color: var(--we-hell); }
body .accordion-item { background: var(--we-flaeche); border-color: var(--we-linie); }
body .accordion-item:first-of-type, body .accordion-item:first-of-type .accordion-button { border-top-left-radius: var(--we-rund); border-top-right-radius: var(--we-rund); }
body .accordion-item:last-of-type { border-bottom-left-radius: var(--we-rund); border-bottom-right-radius: var(--we-rund); }
body .accordion-button { font-weight: 600; color: var(--we-tinte); background: var(--we-flaeche); min-height: 44px; }
body .accordion-button:not(.collapsed) { background: var(--we-marke-zart); color: var(--we-tinte); box-shadow: inset 0 -1px 0 var(--we-linie); }
body .accordion-button:focus { box-shadow: 0 0 0 3px var(--we-marke-ring); border-color: var(--we-marke); }

/* ---------- 14  Modale (bleiben mittig) ---------- */
body .modal-content { background: var(--we-flaeche); border: 1px solid var(--we-linie); border-radius: var(--we-rund-bild); box-shadow: var(--we-schatten); }
body .modal-header { border-bottom: 1px solid var(--we-linie); padding: 1.1rem 1.25rem; }
body .modal-header.text-white[class*="bg-"] { background: var(--we-flaeche) !important; color: var(--we-tinte) !important; border-top: 3px solid var(--we-marke); border-radius: var(--we-rund-bild) var(--we-rund-bild) 0 0; }
body .modal-header.text-white[class*="bg-"] .btn-close-white { filter: none; }
body .modal-header.bg-danger { border-top-color: var(--we-gefahr-kante) !important; }
body .modal-header.bg-warning { border-top-color: var(--we-warn-kante) !important; }
body .modal-title { font-family: var(--we-serif); font-weight: 540; font-size: 1.3rem; color: var(--we-tinte); }
body .modal-footer { border-top: 1px solid var(--we-linie); background: var(--we-papier); border-radius: 0 0 var(--we-rund-bild) var(--we-rund-bild); gap: .5rem; }
body .modal-backdrop { background-color: var(--we-tinte); }
body .modal-backdrop.show { opacity: .55; }

/* ---------- 15  Fortschritt ---------- */
html body .progress { background: var(--we-flaeche-2); border-radius: 999px; overflow: hidden; font-size: .75rem; }
html body .progress-bar { background-color: var(--we-fortschritt); border-radius: 999px; color: var(--we-hell); font-weight: 600; transition: width .7s var(--we-ease); }
html body .progress-bar.bg-success { background-color: var(--we-erfolg) !important; }
html body .progress-bar.bg-warning { background-color: var(--we-bernstein) !important; color: var(--we-tinte); }
html body .progress-bar.bg-danger { background-color: var(--we-gefahr) !important; }
html body .progress-bar.bg-info { background-color: var(--we-info) !important; }
/* Balken mit Prozentzahl: hoch genug, damit die Zahl lesbar bleibt */
html body .progress:has(> .progress-bar:not(:empty)) { min-height: 1.125rem; }

/* ---------- 16  Listen, Leerzustaende, Seitenzahlen ---------- */
body .list-group-item { background: transparent; border-color: var(--we-linie); color: var(--we-text); }
body .list-group-item-action:hover, body .list-group-item-action:focus { background: var(--we-marke-zart); color: var(--we-tinte); }
body .list-group-item.active { background: var(--we-marke); border-color: var(--we-marke); color: var(--we-hell); }
/* Leerzustand: Symbol als Siegel, erster Satz in Serif */
.text-center.py-4 > i.fa-3x:first-child, .text-center.py-5 > i.fa-3x:first-child {
    width: 4.25rem; height: 4.25rem; display: inline-grid; place-items: center; font-size: 1.45rem;
    border-radius: 50%; background: var(--we-flaeche-2); color: var(--we-leise) !important; border: 1px solid var(--we-linie-stark);
}
.text-center.py-4 > i.fa-3x:first-child + p, .text-center.py-5 > i.fa-3x:first-child + p {
    font-family: var(--we-serif); font-size: 1.15rem; color: var(--we-tinte) !important; margin-bottom: .35rem;
}
.text-center.py-4 > p, .text-center.py-5 > p { max-width: 38ch; margin-left: auto; margin-right: auto; }
body .page-link { color: var(--we-marke); border-color: var(--we-linie); background: var(--we-flaeche); min-width: 2.5rem; text-align: center; }
body .page-link:hover { background: var(--we-marke-zart); color: var(--we-tinte); }
body .page-item.active .page-link { background: var(--we-marke); border-color: var(--we-marke); color: var(--we-hell); }
body .page-item:first-child .page-link { border-radius: var(--we-rund-klein) 0 0 var(--we-rund-klein); }
body .page-item:last-child .page-link { border-radius: 0 var(--we-rund-klein) var(--we-rund-klein) 0; }

/* ---------- 17  Fusszeile ---------- */
html body footer.bg-dark { background: var(--we-nacht) !important; border-top: 1px solid var(--we-nacht-linie); padding: 1.75rem 0 !important; }
footer.bg-dark h6 { color: var(--we-nacht-text); font-family: var(--we-serif); font-weight: 540; font-size: 1.05rem; letter-spacing: 0; margin-bottom: .5rem !important; }
footer.bg-dark a { color: #e9e6df !important; min-height: 44px; display: inline-flex; align-items: center; }
footer.bg-dark a:hover { color: var(--we-hell) !important; text-decoration: underline !important; }
footer.bg-dark a i { opacity: .7; }
footer.bg-dark .text-muted { color: #9d9a92 !important; }
footer.bg-dark .d-flex.gap-3 { gap: .25rem 1.5rem !important; }

/* ---------- 18  Bewegung: ein ruhiger Auftakt beim Laden, sonst nur auf Handlung ---------- */
@keyframes we-auf { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    main > .d-flex.border-bottom { animation: we-auf .36s var(--we-ease) both; }
    .row:has(> div > .card[class*="border-left-"]) > div,
    .row:has(> div > .card.text-center > .card-body > .card-title + .card-text) > div,
    .row:has(> div > .card.text-white[class*="bg-"]) > div { animation: we-auf .36s var(--we-ease) both; }
    .row:has(> div > .card) > div:nth-child(2) { animation-delay: .05s; }
    .row:has(> div > .card) > div:nth-child(3) { animation-delay: .1s; }
    .row:has(> div > .card) > div:nth-child(n+4) { animation-delay: .15s; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 19  Handy (bis 767 px): keine neue Navigation, nur ruhiger und fingerfreundlich ---------- */
@media (max-width: 767.98px) {
    body .navbar-custom .navbar-brand { font-size: 1.15rem; margin-right: .5rem; }
    body .navbar-custom .navbar-brand i { width: 1.8rem; height: 1.8rem; font-size: .8rem; }
    main > .d-flex.border-bottom { padding-top: 1.25rem !important; margin-bottom: 1.25rem !important; }
    main h1.h2, main > .d-flex.border-bottom h1 { font-size: 1.6rem; gap: .6rem; }
    main h1.h2 > i, main > .d-flex.border-bottom h1 > i { width: 2.2rem; height: 2.2rem; font-size: .85rem; }
    /* Kopfknoepfe: gleich breite Spalten (meist 2), bei grosser Schrift von selbst 1 Spalte statt Woerter mitten
       im Wort zu brechen ("Schulu|ng anlege|n"). Reihenfolge bleibt. */
    main > .d-flex.border-bottom > .btn-toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); width: 100%; gap: .5rem; margin-bottom: 0 !important; }
    main > .d-flex.border-bottom > .btn-toolbar > .btn-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .5rem; margin: 0 !important; }
    /* Gruppenknoepfe einzeln (Abstand ueber gap, nicht ueber ms-2), damit sie auch untereinander sauber stehen */
    main > .d-flex.border-bottom > .btn-toolbar > .btn-group > .btn { margin: 0 !important; border-radius: var(--we-rund-klein) !important; }
    main > .d-flex.border-bottom > .btn-toolbar > .btn-group:has(> .btn:only-child) { grid-template-columns: 1fr; }
    main > .d-flex.border-bottom > .btn-toolbar > .btn:only-child { grid-column: 1 / -1; }
    main > .d-flex.border-bottom > .btn-toolbar .btn { white-space: normal; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; align-content: center; }
    /* Bildkachel am Handy: flaches Band unter dem Titel, ueber der Knopfleiste */
    main > .d-flex.border-bottom::before { flex: 1 0 100%; height: clamp(5.5rem, 3rem + 7vw, 9.5rem); margin-left: 0; }
    /* Logo + Titel: Logo darf ueber den Titel rutschen, statt den Titel in drei Zeilen zu pressen */
    main > .d-flex.border-bottom > .d-flex:has(> img, > .badge) { flex-wrap: wrap; row-gap: .75rem; }
    /* Kennzahlen 2 x 2 */
    .row:has(> div > .card[class*="border-left-"]),
    .row:has(> div > .card.text-center > .card-body > .card-title + .card-text),
    .row:has(> div > .card.text-white[class*="bg-"]) { margin-left: -6px; margin-right: -6px; }
    .row:has(> div > .card[class*="border-left-"]) > div,
    .row:has(> div > .card.text-center > .card-body > .card-title + .card-text) > div,
    .row:has(> div > .card.text-white[class*="bg-"]) > div {
        flex: 0 0 50%; max-width: 50%; padding-left: 6px; padding-right: 6px; margin-bottom: 12px !important;
    }
    .row > div > .card[class*="border-left-"] .h5, .row > div > .card.text-center > .card-body > .card-title,
    html body .card.text-white[class*="bg-"] h4 { font-size: 1.85rem; }
    .row > div > .card[class*="border-left-"] > .card-body,
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body { padding: .85rem .85rem .9rem; }
    .row > div > .card[class*="border-left-"] .text-xs,
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) .card-text { font-size: .8125rem; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
    .row > div > .card[class*="border-left-"] .col-auto > i.fa-2x,
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body > i.fa-2x { width: 36px; height: 36px; right: .7rem; top: var(--we-siegel-oben-handy, .7rem); font-size: .85rem !important; }
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body:has(> i.fa-2x) { padding-right: .85rem; padding-top: 3.1rem; }
    .row > div > .card[class*="border-left-"] .col.mr-2 { padding-right: 0; padding-top: 2.4rem; }
    .row > div > .card[class*="border-left-"]::before,
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text)::before { aspect-ratio: 16 / 9; }
    html body .card.text-white[class*="bg-"] .card-body { padding: .85rem; }
    html body .card.text-white[class*="bg-"] .card-body { position: relative; }
    html body .card.text-white[class*="bg-"] .card-body > .d-flex > div:first-child { min-width: 0; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
    html body .card.text-white[class*="bg-"] .card-body > .d-flex > div:first-child > p { font-size: .875rem; line-height: 1.35; }
    html body .card.text-white[class*="bg-"] .card-body > .d-flex > div:first-child > h4 { padding-right: 1.9rem; }
    html body .card.text-white[class*="bg-"] .card-body > .d-flex > .align-self-center { position: absolute; top: .85rem; right: .85rem; }
    html body .card.text-white[class*="bg-"] i.fa-2x { font-size: 1.15rem; }
    /* Karten, Tabellen */
    body .card-body { padding: 1rem; }
    body .card-header { padding: .85rem 1rem; }
    body .card-header .card-title, body .card-header h5 { font-size: 1.2rem; }
    body .table-responsive {
        background:
            linear-gradient(to right, var(--we-flaeche) 30%, rgba(255, 254, 252, 0)) left center / 2rem 100% no-repeat local,
            linear-gradient(to left, var(--we-flaeche) 30%, rgba(255, 254, 252, 0)) right center / 2rem 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, rgba(27, 31, 39, .18), transparent) left center / .7rem 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, rgba(27, 31, 39, .18), transparent) right center / .7rem 100% no-repeat scroll;
    }
    /* Klickflaechen >= 44 px, Text bleibt mittig (Innenabstand statt min-height) */
    body .btn { padding-top: .625rem; padding-bottom: .625rem; }
    body .btn-sm { padding-top: .6875rem; padding-bottom: .6875rem; }
    body .btn:not(.btn-close) { min-height: 44px; }
    /* Knoepfe in schmalen Rasterspalten (z. B. "Suchen" in col-2): duerfen schmaler werden statt ueberzustehen */
    body .d-grid > .btn { min-width: 0; padding-left: .4rem; padding-right: .4rem; white-space: normal; overflow-wrap: anywhere; }
    html body .form-control, html body .form-select, html body .form-control-sm, html body .form-select-sm { min-height: 44px; }
    body .page-link { min-height: 44px; min-width: 44px; display: grid; place-items: center; }
    body .modal-footer > .btn { flex: 1 1 auto; }
    h1, h2, h3, h4, h5, h6, .card-title { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
    /* Fusszeile kompakt in einer umbrechenden Zeile */
    html body footer.bg-dark { padding: 1.25rem 0 !important; margin-top: 2rem !important; }
    footer.bg-dark .d-flex.flex-column { flex-direction: row !important; flex-wrap: wrap; justify-content: center; gap: 0 1.1rem !important; }
}
/* Grobe Zeiger (Finger) auch am Tablet: 44 px */
@media (pointer: coarse) {
    body .btn:not(.btn-close), body .sidebar .nav-link, body .dropdown-item { min-height: 44px; }
    html body .form-control, html body .form-select { min-height: 44px; }
}

/* ---------- 20  Druck (Nachweise und Matrix werden fuer Audits gedruckt) ---------- */
@media print {
    html body { background: #fff !important; color: #000; }
    main::before, main > .d-flex.border-bottom::before, .card::before, .row > div > .card::before { display: none !important; }
    html body .card, html body .alert, html body .modal-content { box-shadow: none !important; }
    main > .d-flex.border-bottom { animation: none !important; padding-top: 0 !important; }
    html body nav.navbar-custom { background: #fff !important; border-bottom: 2px solid #000; }
    body .navbar-custom .navbar-brand, body .navbar-custom .navbar-brand i { color: #000 !important; border-color: #000; }
    * { animation: none !important; transition: none !important; }
}

/* ---------- 21  Feinschliff 20.11.2026: grosse Schrift am Handy, Tablet, Tabellen am PC ----------
   Gemessen mit Schrift 100/150/200 % (html font-size) bei 320-430 px und 768 px. Grundsatz: bei 100 % bleibt das Bild
   wie bisher, aber Abstaende wachsen nicht mehr mit der Schrift (sie fressen bei 200 % sonst bis zu 105 px je Seite),
   lange Woerter brechen mit Trennstrich statt seitlich abgeschnitten zu werden. */
@media (max-width: 767.98px) {
    /* Seitenraender: px statt rem (bei 100 % gleich: 12 px Rand, 24 px Rinne) */
    html body .container-fluid, html body main.main-content { padding-left: 12px; padding-right: 12px; }
    html body .row:not([class*=" g-"]):not([class^="g-"]):not([class*=" gx-"]):not([class^="gx-"]) { --bs-gutter-x: 24px; }
    html body .row:is(.g-1, .gx-1) { --bs-gutter-x: 4px; }
    html body .row:is(.g-2, .gx-2) { --bs-gutter-x: 8px; }
    html body .row:is(.g-3, .gx-3) { --bs-gutter-x: 16px; }
    html body .row:is(.g-4, .gx-4) { --bs-gutter-x: 24px; }
    html body .row:is(.g-5, .gx-5) { --bs-gutter-x: 48px; }
    /* Seiten mit eigenem .container in main (Kurs, Kapitel, Test, Ergebnis ...): kein zweiter Rand - Karten stehen
       am Handy so weit vom Rand wie auf der Startseite (12 statt 36 px) */
    html body main.main-content > .container, html body main.main-content > .container-fluid { padding-left: 0; padding-right: 0; }
    html body .card-body, html body .card-header, html body .card-footer { padding-left: 16px; padding-right: 16px; }
    html body .alert { padding-left: 14px; padding-right: 14px; }
    html body main .p-3:not(.card):not(.alert) { padding-left: 14px !important; padding-right: 14px !important; }
    html body main .p-4:not(.card):not(.alert) { padding-left: 16px !important; padding-right: 16px !important; }
    html body .list-group-item { padding-left: 12px; padding-right: 12px; }
    /* Lange Woerter brechen statt seitlich abgeschnitten zu werden. Silbentrennung NUR in kurzen Bausteinen (Bestaetigungs-
       satz, Etikett, Titel, Datenblatt) und nur ab 12 Zeichen - Fliesstext bleibt ohne Trennstriche wie bisher. */
    html body main :is(p, label, li, dd, dt, td, th, small, strong, span, a, .alert, .card-title, .btn, h4, h5, h6) { overflow-wrap: break-word; }
    html body main :is(label, .form-check-label strong, dd, dt, .badge, .card-title, h4, h5, h6) { -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 12 5 5; }
    html body main :is(.alert, .form-check, .list-group-item, .card-header) > div,
    html body main .d-flex > .flex-grow-1, html body main .form-check { min-width: 0; }
    html body main .form-check-label { min-width: 0; }
    /* Kurskopf: Beschreibung ist Flex-Kind (Huelle display:contents) - darf schmaler werden, sehr lange Woerter
       ("Pflichtunterweisung:") werden getrennt */
    html body main .card-header p { min-width: 0; -webkit-hyphens: auto; hyphens: auto; hyphenate-limit-chars: 12 5 5; }
    /* Etiketten duerfen umbrechen, statt aus der Karte zu ragen (ausser in Tabellen, die scrollen) */
    html body main .badge:not(table *) { white-space: normal; max-width: 100%; text-align: left; }
    /* Symbol-Knoepfe (nur Auge/Stift) 44 x 44 */
    html body main .btn:not(.btn-close) { min-width: 44px; }
    html body main .btn:not(table *) { white-space: normal; }   /* in Tabellen nicht: die scrollen, und "text-nowrap"-Zellen wuerden zu schmal berechnet */
    html body main .btn.btn-lg { padding-left: 20px; padding-right: 20px; max-width: 100%; }
    /* Seitentitel ist ein Flex-Kasten (Siegel + Text): der Text darf bei sehr grosser Schrift im Wort brechen */
    html body main h1.h2, html body main > .d-flex.border-bottom h1 { overflow-wrap: anywhere; }
    /* "Teilnahme bestaetigen" zieht sich live per Inline-Stil um -1rem in den Kartenrand - an den px-Rand angleichen */
    html body.seite-kurs #teilnahmeBestaetigen { margin-left: -16px; margin-right: -16px; }
    html body.seite-kurs #teilnahmeBestaetigen .card-body, html body.seite-kurs #teilnahmeBestaetigen .alert { padding-left: 8px; padding-right: 8px; }
    /* Fusszeile: der Trennstrich "|" steht nach dem Umbruch allein am Zeilenende */
    footer.bg-dark .d-flex > span.text-muted:not(:last-child) { display: none; }
}
/* Handy + Tablet: breite Knoepfe in Rasterspalten und Fusszeile brechen um statt ueberzustehen */
@media (max-width: 991.98px) {
    html body main .d-grid > .btn { white-space: normal; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
    html body footer.bg-dark .d-flex { flex-wrap: wrap; }
    html body main .list-group-item > .flex-grow-1, html body main .list-group-item > .flex-grow-1 > .d-flex { min-width: 0; }
    html body main .list-group-item > .flex-grow-1 small { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
    html body main .badge:not(table *) { white-space: normal; }
    /* Videosteuerung (Kapitel): Knopfzeile darf bei grosser Schrift umbrechen */
    html body main .custom-video-player .custom-controls { flex-wrap: wrap; row-gap: 8px; }
}
/* Tablet (768-991 px): neben der Seitenleiste bleiben fuer Kurs/Kapitel nur ~180 px rechte Spalte - zu schmal fuer
   "Weiter"-Knopf, Kursablauf und Unterschriftfeld (bei 150 % Schrift ragten sie heraus, Feld nur 156 px). Darum wie am Handy untereinander, gleiche
   Reihenfolge wie im Markup. Terminplan: 2 statt 3 Karten nebeneinander. */
@media (min-width: 768px) and (max-width: 991.98px) {
    :is(.seite-kurs, .seite-kapitel, .seite-unterschrift) main .row:has(> .col-md-8):has(> .col-md-4) > :is(.col-md-8, .col-md-4) { flex: 0 0 100%; max-width: 100%; width: 100%; }
    .seite-ma-kalender main .row > .col-md-4 { flex: 0 0 50%; max-width: 50%; width: 50%; }
}
/* Seitenleiste (Tablet 768-991 px, Leiste ~190 px): "Kurs oeffnen" im Kasten "Naechster Kurs" ragte bei grosser Schrift
   aus dem Knopf */
html body .sidebar .btn { white-space: normal; overflow-wrap: break-word; }
/* Finger am Tablet: Hilfe-Link in der Seitenleiste 44 px hoch */
@media (pointer: coarse) {
    body .sidebar .mt-3.p-2.rounded.border a { min-height: 44px; display: inline-flex; align-items: center; }
    html body main .btn:not(.btn-close) { min-width: 44px; }
}
/* Kennzahlkarten einer Reihe gleich hoch (2 x 2 am Handy, 4 nebeneinander am PC) */
.row:has(> div > .card.text-center > .card-body > .card-title + .card-text) > div > .card.text-center { height: 100%; }
/* Auswahlkaestchen in Tabellen (Mitarbeiter, Dashboard): live Browser-Standard 13 px -> 18 px in Firmenfarbe */
html body .table :is(th, td) > input[type="checkbox"]:not(.form-check-input) {
    width: 1.125rem; height: 1.125rem; accent-color: var(--we-marke); vertical-align: middle; cursor: pointer; margin: 0;
}
@media (pointer: coarse) {
    html body .table :is(th, td) > input[type="checkbox"]:not(.form-check-input) { width: 1.5rem; height: 1.5rem; }
}

/* ---------- 22  Feinschliff 21.11.2026: Kennzahlkarten bei grosser Schrift am Handy ----------
   2 x 2 nebeneinander war bei 150/200 % Schrift zu eng: Beschriftung in Silben zerhackt ("Einge-schrie-bene"),
   "6 UE" brach um, viel Leerraum durch gleich hohe Karten. Die Reihe ist ein Container; ist sie in rem gerechnet schmal
   (rem = Wurzelschrift, waechst mit der Schriftgroesse), steht eine Karte je Zeile: Bildband flacher, Zahl und
   Beschriftung in einer Zeile, sonst Beschriftung darunter - ohne Silbentrennung. Gilt bis 991 px (Tablet 768 px bei 200 %: Beschriftung stand
   in 2-Buchstaben-Stuecken). Bei 100 % bleibt alles wie bisher. */
@media (max-width: 991.98px) {
    .row:has(> div > .card.text-center > .card-body > .card-title + .card-text),
    .row:has(> div > .card[class*="border-left-"]),
    .row:has(> div > .card.text-white[class*="bg-"]) { container: edel-kennzahl / inline-size; }
}
@container edel-kennzahl (max-width: 18.5rem) {
    .row:has(> div > .card[class*="border-left-"]) > div,
    .row:has(> div > .card.text-center > .card-body > .card-title + .card-text) > div,
    .row:has(> div > .card.text-white[class*="bg-"]) > div { flex: 0 0 100%; max-width: 100%; }
    html body .row > div > .card[class*="border-left-"]::before,
    html body .row > div > .card.text-center:has(> .card-body > .card-title + .card-text)::before,
    html body.seite-ma-start .row > div > .card.text-center:has(> .card-body > .card-title + .card-text)::before { aspect-ratio: 4 / 1; }
    html body .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body,
    html body .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body:has(> i.fa-2x),
    html body.seite-ma-start .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) > .card-body:has(> i.fa-2x) {
        display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px;
        padding: 16px 52px 14px 16px;
    }
    .row > div > .card.text-center > .card-body > .card-title { flex: 0 0 auto; white-space: nowrap; margin: 0; }
    .row > div > .card.text-center:has(> .card-body > .card-title + .card-text) .card-text,
    .row > div > .card[class*="border-left-"] .text-xs,
    html body .card.text-white[class*="bg-"] .card-body > .d-flex > div:first-child {
        flex: 1 1 0; overflow-wrap: break-word; hyphens: manual;
    }
}

/* ---------- 23  Feinschliff 21.11.2026: hochgeladene Kursbilder ganz zeigen ----------
   Live laden Firmen ihre Kursbilder selbst hoch (static/uploads/bilder/, die App verkleinert nur, Seitenverhaeltnis
   bleibt): fast alles sind Titelfolien 16:9 mit Firmenlogo oben links und Fusszeile unten links, dazu reine Logos
   (Bahn 7:5, Firmenlogo 3:2). Im 7:5-Rahmen mit "cover" fehlten Logo-Rand und Fusszeile, am Handy (16:7) oben und
   unten, die Kursseite (2:1/3:1) schnitt Text ab, Logos wurden seitlich angeschnitten ("DS SECURIT").
   Darum nur fuer hochgeladene Bilder: ganz zeigen (contain) auf ruhiger, fast weisser Flaeche (= Folienrand) mit
   etwas Luft. Die mitgelieferten Fotos (uploads/roentgen-medien, img/edel) bleiben randlos (cover). Rahmen,
   Groessen und Seitenverhaeltnisse bleiben unveraendert. */
html body :is(
    .seite-ma-start .edel-ma-start-bild > img,
    .seite-ma-start .list-group-flush > .list-group-item .d-flex.align-items-start.mb-2 > img,
    .sidebar .mt-3.p-3.rounded.border img,
    .seite-kurs .edel-kurs-titelbild > img,
    .seite-unterschrift .edel-kurs-beleg-bild,
    .seite-firma-kurse .list-group-item > a.flex-grow-1 img,
    .seite-firma-kurs-form img[alt="Aktuelles Kurs-Bild"],
    .seite-sa-start .table td > .d-flex > img,
    .seite-sa-kurse .table td > .d-flex > img,
    .seite-sa-kurs-form .alert.alert-info img
)[src*="/uploads/bilder/"] {
    object-fit: contain !important; object-position: 50% 50% !important; background-color: #fcfcfb; padding: 3%;
}
/* Handy-Kursliste: Rahmen fuer hochgeladene Bilder 16:9 statt 16:7 - die ganze Folie steht sonst sehr klein in der Mitte */
@media (max-width: 767.98px) {
    html body.seite-ma-start .list-group-flush > .list-group-item .d-flex.align-items-start.mb-2 > img[src*="/uploads/bilder/"] { aspect-ratio: 16 / 9; }
}

/* ---------- 24  Feinschliff 22.11.2026: Safari (WebKit) + Verwaltung am Tablet/Handy ----------
   Gemessen in Chromium UND WebKit (Safari-Engine) mit iPhone SE/15/15 Pro Max, iPad Mini/Pro 11, Schrift 100/150/200 %.
   a) Seitenleiste am Tablet (768-1199 px): die Spaltenbreite war fest (col-md-3/col-lg-2 = 192 px bei 768 px). Bei grosser
      Schrift zerfielen die Menuewoerter in 2-Buchstaben-Stuecke ("Da|sh|bo|ard", "Di|en|sta|nw|eis|un|gen"), bei 100 %
      stand "Dienst-anwei-sungen" in drei Zeilen. Jetzt ist die Leiste mind. 13,5 rem breit (100 %: 216 statt 192 px bei
      768 px, 216 statt 170 px bei 1024 px - "Dienstanweisungen" passt in eine Zeile) und waechst mit der Schrift. Bleiben
      dem Inhalt keine 65 %, steht die Leiste als Menueblock UEBER dem Inhalt (Eintraege nebeneinander, umbrechend, nichts
      angeschnitten) - am iPad (768/834 px) ab ca. 130/140 % Schrift; mit Leiste daneben blieben dort nur 440-510 px
      Inhalt (Titel und Kacheln im Wort gebrochen). Leiste weiterhin mindestens so hoch wie der Bildschirm. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html body > .container-fluid > .row:has(> nav.sidebar) { flex-wrap: wrap; min-height: 100vh; }
    html body > .container-fluid > .row > nav.sidebar {
        flex: 1 1 max(25%, 13.5rem); width: auto; max-width: 100%; min-height: 0;
        container: edel-leiste / inline-size;
    }
    html body > .container-fluid > .row > nav.sidebar + main { flex: 999 1 0%; width: auto; max-width: 100%; min-width: 65%; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    html body > .container-fluid > .row > nav.sidebar { flex-basis: max(16.6667%, 13.5rem); }
}
/* Leiste als Block ueber dem Inhalt (nur dann ist sie breiter als 18 rem): Eintraege als Kacheln nebeneinander */
@container edel-leiste (min-width: 18rem) {
    html body .sidebar > .position-sticky { position: static; padding-top: .75rem !important; padding-bottom: .75rem; }
    html body .sidebar .nav.flex-column { flex-direction: row !important; flex-wrap: wrap; gap: 6px; padding: 0 .25rem; }   /* .flex-column ist bei Bootstrap !important */
    html body .sidebar .nav.flex-column > .nav-item { flex: 1 1 auto; }
    html body .sidebar .nav-link {
        margin: 0; height: 100%; border-radius: var(--we-rund-klein); padding-top: .6rem; padding-bottom: .6rem;
        -webkit-hyphens: manual; hyphens: manual; box-shadow: inset 0 0 0 1px var(--we-nacht-linie);
    }
    html body .sidebar .mt-3.p-3.rounded.border, html body .sidebar .mt-3.p-2.rounded.border { margin-left: .25rem; margin-right: .25rem; }
}
/* b) Seitentitel am Tablet: ohne Silbentrennung (aeltere iPhones/iPads, Safari ohne Woerterbuch) ragte "Dienstanweisungen"
      bei 200 % Schrift 100 px ueber den Rand - wie am Handy darf der Titel im Notfall im Wort brechen. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html body main h1.h2, html body main > .d-flex.border-bottom h1 { overflow-wrap: anywhere; min-width: 0; }
    html body main > .d-flex.border-bottom > :is(div, h1) { min-width: 0; }
}
/* c) Finger (Handy + Tablet): Auswahlkaestchen in Tabellen hatten 20-36 px Trefferflaeche. Jetzt 44 x 44 px Trefferflaeche,
      das sichtbare Kaestchen bleibt 22 px (Rest ist durchsichtiger Rand; negativer Aussenabstand: Zeilen werden nicht hoeher). */
@media (pointer: coarse) {
    html body .table :is(th, td) > input[type="checkbox"]:not(.edel-kein) {
        -webkit-appearance: none; appearance: none; box-sizing: border-box; flex-shrink: 0;
        width: 44px; height: 44px; margin: -11px; padding: 11px; border: 0; border-radius: 15px; vertical-align: middle; cursor: pointer;
        background: linear-gradient(var(--we-flaeche), var(--we-flaeche)) content-box;
        outline: 1.5px solid var(--we-rahmen); outline-offset: -11px; box-shadow: none;
    }
    /* "Dienstanweisung zuweisen" setzt die Kaestchengroesse per ID-Regel (nachweise.css) - dort gleich gross */
    html body.seite-nw-zuweisen #assignForm .table :is(th, td) > input[type="checkbox"] { width: 44px; height: 44px; margin: -11px; }
    html body .table :is(th, td) > input[type="checkbox"]:not(.edel-kein):checked {
        background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") center / 18px 18px no-repeat content-box,
            linear-gradient(var(--we-marke), var(--we-marke)) content-box;
        outline-color: var(--we-marke);
    }
    html body .table :is(th, td) > input[type="checkbox"]:not(.edel-kein):indeterminate {
        background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e") center / 18px 18px no-repeat content-box,
            linear-gradient(var(--we-marke), var(--we-marke)) content-box;
        outline-color: var(--we-marke);
    }
    html body .table :is(th, td) > input[type="checkbox"]:not(.edel-kein):focus-visible { outline: 2px solid var(--we-marke); outline-offset: -11px; box-shadow: 0 0 0 3px var(--we-marke-ring); }
    html body .table :is(th, td) > input[type="checkbox"]:not(.edel-kein):disabled { opacity: .45; cursor: not-allowed; }
    /* Einzelne Haekchen-Zeilen in Verwaltungsformularen ("Nur nicht registrierte", "E-Mails senden" ...): ganze Zeile 44 px */
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main .form-check:not(.form-check-inline):not(.form-switch):has(> .form-check-input + .form-check-label) {
        display: flex; flex-wrap: wrap; align-items: center; column-gap: .55rem; min-height: 44px; padding-left: 0; margin-bottom: 0;
    }
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main .form-check:not(.form-check-inline):not(.form-switch):has(> .form-check-input + .form-check-label) > .form-check-input { float: none; margin: 0; flex: 0 0 auto; }
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main .form-check:not(.form-check-inline):not(.form-switch):has(> .form-check-input + .form-check-label) > .form-check-label { flex: 1 1 0; min-width: 0; padding: .55rem 0; }
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main .form-check:not(.form-check-inline):not(.form-switch):has(> .form-check-input + .form-check-label) > :not(.form-check-input):not(.form-check-label) { flex: 1 0 100%; }
}
/* d) Safari bricht lange Woerter nur, wenn "overflow-wrap" am umgebenden BLOCK steht - die Regel aus Abschnitt 21 sitzt
      an Inline-Elementen (strong, label, span ...) und wirkt dort nur in Chrome. Folge in Safari bei 200 % Schrift am Handy:
      "Ich bestaetige, dass ich die Dienstanweisung ..." und "Kooperationspartner" ragten 5-10 px ueber den Rand.
      Jetzt erbt der ganze Inhaltsbereich "break-word" (bricht nur, wenn ein Wort allein nicht in die Zeile passt;
      Spaltenbreiten und Tabellen bleiben unveraendert). */
@media (max-width: 1199.98px) {
    html body main { overflow-wrap: break-word; }
    /* Beschriftungen sind (Bootstrap) inline-block: ohne Grenze so breit wie ihr laengstes Wort */
    html body main label { max-width: 100%; }
}
/* e) Kartenkopf mit Titel + Knopf ("Vorhandene Dienstanweisungen" + "Zusammenfassung herunterladen", Matrix-Legende):
      am Handy darf der Knopf unter den Titel rutschen, statt dass der Titel 60-70 px aus der Karte ragt. */
@media (max-width: 767.98px) {
    html body main .card-header > .d-flex:not(.flex-column) { flex-wrap: wrap; row-gap: .5rem; column-gap: .75rem; }
    html body main .card-header > .d-flex > :not(.btn) { min-width: 0; }
}
/* f) Superadmin "Benutzer verwalten", Import: 5 Felder in 2-3-2-2-2-Spalten - am Tablet stand "Kooperationspartner
      (extern)" in einer 100-px-Spalte und ragte bis 150 px heraus. 768-1199 px: Felder mind. 12 rem breit, umbrechend. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html body.seite-sa-benutzer form:has(input[name="users_file"]) .row > :is(.col-md-2, .col-md-3) { flex: 1 1 12rem; width: auto; }
}
/* g) Filter- und Eingabeformulare der Verwaltung am Tablet (768-1199 px): Rasterspalten col-md-1/-2 sind bei 768 px
      neben der Leiste 40-90 px schmal. Vorher lagen Beschriftungen uebereinander ("Kooperationspartner" ueber
      "Registriert", "Kategorie|Position|Abteilung" ineinander), Auswahlfelder zeigten nur den Pfeil. Spalten sind jetzt
      mind. 9,5 rem breit (bzw. ganze Zeile) und teilen sich den Rest der Zeile - breite Spalten bleiben wie bisher. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main form:is(.row, :not(.row) .row, :not(.row) > .row) > [class*="col-md-"],
    html body:is([class*="seite-firma"], [class*="seite-sa-"], [class*="seite-nw-"]) main form .row > [class*="col-md-"] { flex-grow: 1; min-width: min(100%, 9.5rem); }
}
/* h) Kopfknoepfe am Tablet: Knopfgruppe brach nicht um, die Knoepfe wurden gequetscht ("Unterschr|iften") -
      jetzt rutscht ein Knopf, der nicht mehr passt, in die naechste Zeile (wie schon auf dem Firmen-Dashboard). */
@media (min-width: 768px) and (max-width: 1199.98px) {
    main > .d-flex.border-bottom > .btn-toolbar,
    main > .d-flex.border-bottom > .btn-toolbar > .btn-group { flex-wrap: wrap; max-width: 100%; min-width: 0; row-gap: 6px; }
    main > .d-flex.border-bottom > .btn-toolbar .btn { flex-shrink: 0; max-width: 100%; }
}
