/* ==========================================================================
   QHSE-Portal – Gestaltung
   Ruhige Flächen, klare Typografie (Inter, lokal), Linien-Icons (Lucide), hell und dunkel
   ========================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/inter/inter-latin-wght-normal.woff2) format('woff2-variations');
  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: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/vendor/inter/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f9fafb; --text: #0f172a; --muted: #5b6678; --line: #e5e7eb; --line-strong: #cbd5e1;
  --primary: #2563eb; --primary-2: #1d4ed8; --primary-soft: #eff4ff; --on-primary: #fff;
  /* Flächen mit Text (Knöpfe, aktive Schritte): Kontrast mind. 4,5 : 1; Fokusrahmen: mind. 3 : 1 */
  --fill: #2563eb; --fill-2: #1d4ed8; --on-fill: #fff; --focus: #1d4ed8;
  --accent: var(--primary); --accent-on: var(--on-primary); --accent-ink: var(--primary); --accent-soft: var(--primary-soft);
  --danger: #b91c1c; --warn: #b45309; --ok: #047857;
  --red-bg: #fef2f2; --yellow-bg: #fffbeb; --green-bg: #ecfdf5; --grey-bg: #f1f5f9; --blue-bg: #eff6ff;
  --radius: 14px; --radius-sm: 10px; --side: 248px; --top: 60px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .04); --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px -6px rgb(15 23 42 / .08);
  --shadow-lg: 0 12px 32px -12px rgb(15 23 42 / .25); --ring: 0 0 0 3px rgb(37 99 235 / .18);
  color-scheme: light;
}
/* Dunkelmodus: automatisch nach Gerät, außer „Hell“ gewählt; fest bei „Dunkel“ */
@media (prefers-color-scheme: dark) {
:root:not([data-theme=light]) { --bg: #0b1020; --surface: #121a2b; --surface-2: #0f1626; --text: #e6eaf2; --muted: #93a1b8; --line: #222c40; --line-strong: #33405a;
    --primary: #4f8cff; --primary-2: #7aa7ff; --primary-soft: #16233f; --on-primary: #fff;
    --fill: #2563eb; --fill-2: #1d4ed8; --on-fill: #fff; --focus: #7aa7ff;
    --danger: #f87171; --warn: #fbbf24; --ok: #34d399;
    --red-bg: #2a1518; --yellow-bg: #2a2110; --green-bg: #0f2a22; --grey-bg: #1a2335; --blue-bg: #14213b;
    --shadow-sm: none; --shadow: 0 1px 0 rgb(255 255 255 / .02) inset, 0 6px 20px -10px rgb(0 0 0 / .6); --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / .7);
    --ring: 0 0 0 3px rgb(79 140 255 / .3); color-scheme: dark; }

}
:root[data-theme=dark] { --bg: #0b1020; --surface: #121a2b; --surface-2: #0f1626; --text: #e6eaf2; --muted: #93a1b8; --line: #222c40; --line-strong: #33405a;
    --primary: #4f8cff; --primary-2: #7aa7ff; --primary-soft: #16233f; --on-primary: #fff;
    --fill: #2563eb; --fill-2: #1d4ed8; --on-fill: #fff; --focus: #7aa7ff;
    --danger: #f87171; --warn: #fbbf24; --ok: #34d399;
    --red-bg: #2a1518; --yellow-bg: #2a2110; --green-bg: #0f2a22; --grey-bg: #1a2335; --blue-bg: #14213b;
    --shadow-sm: none; --shadow: 0 1px 0 rgb(255 255 255 / .02) inset, 0 6px 20px -10px rgb(0 0 0 / .6); --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / .7);
    --ring: 0 0 0 3px rgb(79 140 255 / .3); color-scheme: dark; }


* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-feature-settings: 'cv11', 'ss01'; background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .3rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.08rem; margin: 0 0 .85rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .98rem; margin: 1rem 0 .5rem; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .mt { margin-top: 1rem; } .right { text-align: right; }
.pre { white-space: pre-wrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke-width: 1.9; vertical-align: -3px; }
.inline-ico svg.i { width: 16px; height: 16px; color: var(--muted); }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
/* Sprunglink „Zum Inhalt“: erst bei Tastaturbedienung sichtbar */
.skip-link { position: fixed; left: .75rem; top: -4rem; z-index: 100; background: var(--fill); color: var(--on-fill); padding: .6rem 1rem; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-lg); }
.skip-link:focus { top: .75rem; text-decoration: none; }
main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Layout */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 30; display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); color: var(--text); }
.brand { color: var(--text); font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: .6rem; font-size: 1.02rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand:hover { text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.who { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 500; font-size: .9rem; padding: .25rem .5rem .25rem .25rem; border-radius: 99px; }
.who:hover { background: var(--grey-bg); text-decoration: none; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.menu-btn { display: none; background: none; border: 0; color: var(--text); padding: .35rem; border-radius: 8px; cursor: pointer; }
.menu-btn svg.i { width: 22px; height: 22px; }
.sidebar { position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line);
  padding: .9rem .7rem; overflow-y: auto; z-index: 25; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sidebar a, .navbtn { display: flex; gap: .7rem; align-items: center; padding: .48rem .7rem; border-radius: 9px; color: var(--text); font-size: .92rem; font-weight: 500;
  background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left; }
.sidebar a svg.i, .navbtn svg.i { color: var(--muted); }
.sidebar a:hover, .navbtn:hover { background: var(--grey-bg); text-decoration: none; }
.sidebar a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar a.active svg.i { color: var(--primary); }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 1rem .7rem .35rem; font-weight: 600; }
.nav-sec summary.nav-group { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; border-radius: 9px; padding-right: .5rem; user-select: none; }
.nav-sec summary.nav-group::-webkit-details-marker { display: none; }
.nav-sec summary.nav-group:hover { color: var(--text); }
.nav-sec summary .i { width: 15px; height: 15px; transition: transform .15s; }
.nav-sec:not([open]) summary .i { transform: rotate(-90deg); }
.sidebar-foot { margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; }
.sidebar-foot .me { align-items: center; line-height: 1.25; }
.sidebar-foot .me .avatar { width: 34px; height: 34px; }
.main { margin-left: var(--side); padding: calc(var(--top) + 1.75rem) 2rem 3rem; max-width: calc(1360px + var(--side)); }
.main-plain { padding: 1rem; }
.nav-backdrop, .bottombar { display: none; }

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 .75rem; }
  /* Menü am Handy: über der unteren Leiste (sonst verdeckt sie „Abmelden“), eigenes Scrollen ohne die Seite dahinter mitzuziehen
     (iOS), Abstand für den Home-Balken; ohne Unschärfe-Effekt, der iPhones beim Scrollen ausbremst */
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); z-index: 45; width: min(var(--side), 86vw);
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgb(15 23 42 / .5); z-index: 40; touch-action: none; }
  .main { margin-left: 0; padding: calc(var(--top) + 1rem) 1rem 96px; }
  .hide-sm { display: none; }
  .bottombar { display: flex; position: fixed; inset: auto 0 0 0; z-index: 30; padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .45rem; font-size: .7rem; font-weight: 500; color: var(--muted); }
  .bottombar a svg.i { width: 22px; height: 22px; }
  .bottombar a.active { color: var(--primary); }
  .bottombar a .fab { display: grid; place-items: center; width: 46px; height: 46px; margin-top: -1.35rem; border-radius: 16px; background: var(--danger); color: #fff;
    box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--danger) 70%, transparent); }
  .bottombar a .fab svg.i { width: 24px; height: 24px; stroke-width: 2.4; }
  .bottombar a:hover { text-decoration: none; }
}

/* Komponenten */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .9rem; margin-bottom: 1.5rem; }
.page-head .muted { font-size: .95rem; }
.actions-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }
.cards .card { margin-bottom: 0; }
.cards { margin-bottom: 1.25rem; }
.card > .cards:last-child { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1rem 1.25rem; color: var(--text);
  display: block; box-shadow: var(--shadow); overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
a.kpi:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.kpi .n { font-size: 1.85rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: .82rem; margin-top: .15rem; overflow-wrap: anywhere; hyphens: auto; }
.kpi.red::before { background: var(--danger); } .kpi.yellow::before { background: var(--warn); } .kpi.green::before { background: var(--ok); }
.kpi.red .n { color: var(--danger); }

.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: .92rem; font-weight: 550; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--fill); border-color: var(--fill); color: var(--on-fill); box-shadow: 0 1px 2px rgb(37 99 235 / .25), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover { background: var(--fill-2); border-color: var(--fill-2); color: var(--on-fill); }
.btn-danger { background: #c81e1e; border-color: #c81e1e; color: #fff; box-shadow: 0 1px 2px rgb(220 38 38 / .3); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; color: #fff; }
.btn-ok { background: #047857; border-color: #047857; color: #fff; }
.btn-ok:hover { background: #065f46; color: #fff; }
.btn-sm { padding: .34rem .7rem; font-size: .85rem; border-radius: 9px; }
.btn-sm svg.i { width: 16px; height: 16px; }
.btn-block { width: 100%; justify-content: center; padding: .85rem; font-size: 1.02rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-align: left; }

form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 550; font-size: .88rem; }
input, select, textarea { font: inherit; font-size: .95rem; font-weight: 400; padding: .58rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=file] { padding: .45rem; }
select:not([multiple]) { min-height: calc(1.55em + 1.16rem + 2px); } /* gleiche Höhe wie Text- und Datumsfelder */
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
/* Karten nebeneinander: Abstand zur nächsten Karte immer gleich (wie zwischen einzelnen Karten) */
.grid2:has(> .card), .grid3:has(> .card) { margin-bottom: 1.25rem; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } .span2, .span3 { grid-column: auto; } }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 150px; flex: 1; max-width: 280px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .2rem .9rem; font-weight: 400; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .55rem .8rem; background: var(--surface-2); }

.table-wrap { overflow-x: auto; }
.table-wrap:focus-visible { outline-offset: -2px; }
.card.table-wrap { padding: 0; }
.card.table-wrap > table th:first-child, .card.table-wrap > table td:first-child { padding-left: 1.25rem; }
/* Überschrift, Text und Schaltflächen in Tabellen-Karten mit demselben Innenabstand wie in normalen Karten */
.card.table-wrap > :not(table):not(.table-search):not(details):not(form) { margin-left: 1.4rem; margin-right: 1.4rem; }
.card.table-wrap > :first-child:not(table) { margin-top: 1.25rem; }
.card.table-wrap > :last-child:not(table) { margin-bottom: 1.25rem; }
.card.table-wrap > table th:last-child, .card.table-wrap > table td:last-child { padding-right: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
/* Spalten mit Plakette oder reinem Wert (z. B. 3 n. i. O. / 0, „offen“ / Datum): Text der Plakette bündig mit dem übrigen Text */
td.tdb > .badge { margin-left: -.6rem; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--grey-bg) 55%, transparent); }
tr:last-child td { border-bottom: 0; }
/* Beschriftung höchstens 45 % breit, Werte brechen um statt aus der Karte zu laufen (schmale Karten, Tablet) */
dl.props { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: .45rem 1.5rem; margin: 0; }
dl.props dt { color: var(--muted); overflow-wrap: break-word; } dl.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { dl.props { grid-template-columns: 1fr; } dl.props dd { margin-bottom: .4rem; } }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .6rem; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--grey-bg); color: var(--muted); white-space: nowrap; letter-spacing: .01em; }
.badge.red, .st-neu, .st-offen, .st-gesperrt, .st-nicht_ok, .st-abweichung { background: var(--red-bg); color: var(--danger); }
.badge.yellow, .st-in_bearbeitung, .st-in_arbeit, .st-mangel, .st-pruefung, .st-entwurf, .st-nebenabweichung, .st-geplant { background: var(--yellow-bg); color: var(--warn); }
.badge.green, .st-ok, .st-abgeschlossen, .st-erledigt, .st-wirksam, .st-freigegeben, .st-positiv, .st-durchgefuehrt { background: var(--green-bg); color: var(--ok); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .45rem; background: var(--muted); vertical-align: 1px; }
.dot.red { background: var(--danger); box-shadow: 0 0 0 3px var(--red-bg); } .dot.yellow { background: var(--warn); box-shadow: 0 0 0 3px var(--yellow-bg); } .dot.green { background: var(--ok); box-shadow: 0 0 0 3px var(--green-bg); }
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; font-size: .93rem; }
.flash-ok { background: var(--green-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-err { background: var(--red-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-info { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); display: flex; align-items: center; gap: .5rem; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.list li > :last-child { flex-shrink: 0; }
.list li:last-child { border-bottom: 0; }

/* Prozesslandkarte */
.pmap { display: grid; gap: 1rem; }
.pmap .band { border-radius: var(--radius); padding: 1.1rem; border: 1px solid var(--line); }
.pmap .band h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.band.fuehrung { background: var(--yellow-bg); } .band.kern { background: var(--green-bg); } .band.unterstuetzung { background: var(--grey-bg); }
.pmap .procs { display: flex; flex-wrap: wrap; gap: .75rem; }
.proc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem 1rem; min-width: 190px; color: var(--text); box-shadow: var(--shadow-sm); }
.band.kern .proc { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-right: 1.8rem; }
.proc:hover { text-decoration: none; border-color: var(--primary); }

/* Risikomatrix */
.matrix { border-collapse: separate; border-spacing: 3px; width: auto; }
.matrix td, .matrix th { width: 46px; height: 38px; text-align: center; padding: 0; border: 0; border-radius: 6px; font-weight: 700; background: none; }
.matrix td.green { background: var(--green-bg); } .matrix td.yellow { background: var(--yellow-bg); } .matrix td.red { background: var(--red-bg); }

/* Schulungs-Quiz */
.quiz-q { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .75rem; background: var(--surface-2); }
.quiz-q.wrong { border-color: var(--danger); background: var(--red-bg); }
.quiz-q label { font-weight: 400; flex-direction: row; gap: .5rem; padding: .35rem 0; }
.course-content { font-size: 1.02rem; }
.video { position: relative; padding-top: 56.25%; margin: 1rem 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }

/* Matrix Schulungen */
.tmatrix th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 160px; text-transform: none; vertical-align: bottom; }
.tmatrix td.c { text-align: center; font-size: .78rem; }
.norms .nc { text-align: center; width: 3.2rem; color: var(--ok); }
/* Rechtsregister: Neuerungen aus der Überwachung */
.legal-update { border-top: 1px solid var(--line); padding: .7rem 0; }
.legal-update:first-of-type { border-top: 0; }
.legal-update.open { border-left: 3px solid var(--danger); padding-left: .75rem; }
.legal-update .lu-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.legal-update p { margin: .4rem 0; }
.lu-form { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.lu-form input { flex: 1 1 18rem; }
/* Energie: Monatswerte erfassen */
.energy-grid .rowlabel { white-space: nowrap; font-weight: 600; padding-right: .6rem; }
.energy-grid .cost-row .rowlabel { font-weight: 400; padding-left: 1rem; }
.energy-grid td { padding: .2rem; }
.energy-grid input { width: 5.6rem; min-width: 4.5rem; padding: .3rem .4rem; text-align: right; font-variant-numeric: tabular-nums; }
.energy-grid .cost-row input { font-size: .85em; }
.energy-grid .cost-row th, .energy-grid .cost-row td { border-top: 0; }
.tmatrix td.c.red { background: var(--red-bg); } .tmatrix td.c.yellow { background: var(--yellow-bg); } .tmatrix td.c.green { background: var(--green-bg); }

.login-box { max-width: 400px; margin: 10vh auto; }
.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .85rem; margin-bottom: 1.5rem; }
.big-actions a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1rem; text-align: center; color: var(--text); font-weight: 600;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease; }
.big-actions a span { display: block; font-size: 1.75rem; margin-bottom: .25rem; }
.big-actions a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.big-actions a.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; border-color: transparent; }

.type-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.type-pick label { min-width: 0; overflow-wrap: anywhere; hyphens: auto; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: .7rem; flex-direction: row; align-items: center; gap: .5rem; cursor: pointer; font-weight: 600; }
.type-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.photo { max-width: 100%; max-height: 380px; border-radius: 8px; border: 1px solid var(--line); }

@media print {
  .topbar, .sidebar, .bottombar, .no-print, .flash { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
}

/* GHS-Piktogramm (vereinfacht: rote Raute mit Nummer) */
.ghs { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin: .15rem .35rem .15rem .15rem; transform: rotate(45deg); border: 2px solid #c0392b; background: #fff; vertical-align: middle; }
.ghs b { transform: rotate(-45deg); font-size: .7rem; color: #000; }
.ghs.big { width: 2.2rem; height: 2.2rem; font-size: .85rem; }

/* Plattform-Verwaltung */
.ptop { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; background: var(--fill); color: var(--on-fill); padding: .7rem 1rem; margin: -1rem -1rem 1.25rem; }
.ptop .brand { color: #fff; }
.pwrap { max-width: 1200px; margin: 0 auto; }
.ptop .btn-primary { background: #fff; color: var(--primary); border-color: #fff; font-weight: 600; }

.tmatrix td.c.grey { background: var(--grey-bg); color: var(--muted); }
.badge.grey { background: var(--grey-bg); color: var(--muted); }
.tmatrix th.rot { height: 210px; max-width: 2.6rem; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .org-legend { display: none; } }

/* Formatierte Inhalte (Editor und Anzeige) */
.editor-wrap { background: var(--surface); border-radius: 8px; }
.editor-wrap .ql-toolbar { border-radius: 8px 8px 0 0; border-color: var(--line); background: var(--grey-bg); }
.editor-wrap .ql-container { border-radius: 0 0 8px 8px; border-color: var(--line); font: inherit; font-size: 1rem; }
.editor-wrap .ql-editor { min-height: inherit; }
.editor-wrap .ed-table, .editor-wrap .ed-row, .editor-wrap .ed-col, .editor-wrap .ed-del { width: auto !important; font-size: .8rem; font-weight: 700; color: var(--text); }
.editor-area { min-height: 320px; }
.rich { line-height: 1.6; }
.rich h1 { font-size: 1.45rem; margin: 1.4rem 0 .5rem; } .rich h2 { font-size: 1.2rem; margin: 1.2rem 0 .4rem; } .rich h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; }
.rich img { max-width: 100%; border-radius: 6px; }
.rich table { border-collapse: collapse; margin: .8rem 0; width: auto; }
.rich td, .rich th { border: 1px solid var(--line); padding: .35rem .6rem; }
.rich blockquote { border-left: 4px solid var(--primary-2); margin: .8rem 0; padding: .3rem .9rem; background: var(--grey-bg); }
.rich .ql-align-center { text-align: center; } .rich .ql-align-right { text-align: right; } .rich .ql-align-justify { text-align: justify; }
.rich .ql-indent-1 { padding-left: 2em; } .rich .ql-indent-2 { padding-left: 4em; } .rich .ql-indent-3 { padding-left: 6em; }
.rich li[data-list="bullet"] { list-style-type: disc; } .rich ol li[data-list="bullet"] { list-style-type: disc; }
.rich ol:has(> li[data-list="bullet"]) { list-style-type: disc; }
.toc { font-size: .9rem; } .toc a { display: block; padding: .15rem 0; } .toc .l2 { padding-left: 1rem; } .toc .l3 { padding-left: 2rem; }
.st-ersetzt, .st-verworfen { background: var(--grey-bg); color: var(--muted); }
.doc-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1.25rem; align-items: start; }
.doc-layout .toc { position: sticky; top: 76px; }
@media (max-width: 1100px) { .doc-layout { grid-template-columns: 1fr; } .doc-layout .toc { position: static; order: -1; } }
.diff { white-space: pre-wrap; line-height: 1.7; }
.diff ins { background: var(--green-bg); color: var(--ok); text-decoration: none; border-bottom: 2px solid var(--ok); }
.diff del { background: var(--red-bg); color: var(--danger); }
.workflow { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .85rem; margin: .4rem 0 .8rem; }
.workflow span { padding: .2rem .6rem; border-radius: 99px; background: var(--grey-bg); color: var(--muted); }
.workflow span.done { background: var(--green-bg); color: var(--ok); } .workflow span.now { background: var(--fill); color: var(--on-fill); }
.news-card { display: block; color: var(--text); }
.news-card:hover { text-decoration: none; border-color: var(--primary-2); }
.news-card.unread { border-left: 4px solid var(--warn); }
.news-important { border: 2px solid var(--danger); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }
.news-list li > span:first-child { min-width: 0; flex-shrink: 1; overflow-wrap: anywhere; }

/* Prozesse: Landkarte, Editor, Diagramm */
.pmap-io { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.proc.draft { border-style: dashed; }
.proc-add { color: var(--muted); border-style: dashed; display: flex; align-items: center; justify-content: center; }
.diagram-wrap { overflow-x: auto; }
.diagram-wrap svg { max-width: none; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.diagram-wrap svg a:hover rect, .diagram-wrap svg a:hover polygon, .diagram-wrap svg a:hover path { stroke-width: 2.6; }
.peditor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ppreview { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 1150px) { .peditor { grid-template-columns: 1fr; } .ppreview { position: static; max-height: none; } }
.pstep { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 8px; padding: .6rem .7rem; background: var(--surface); }
.pstep.st-start { border-left-color: var(--ok); } .pstep.st-end { border-left-color: var(--danger); } .pstep.st-decision { border-left-color: var(--warn); }
.pstep.st-doc { border-left-color: var(--muted); } .pstep.st-sub { border-left-color: var(--primary-2); }
.pstep-head { display: flex; gap: .4rem; align-items: center; }
.pstep-head select { width: 150px; flex: none; } .pstep-head input { flex: 1; min-width: 0; }
.pnr { font-weight: 700; min-width: 1.6rem; text-align: center; color: var(--muted); }
.pbtns { display: flex; gap: .15rem; } .pbtns button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: .3rem .5rem; cursor: pointer; color: var(--text); }
.pstep-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.pstep-row label { flex: 1; min-width: 150px; font-size: .8rem; }
.pstep details { margin-top: .4rem; } .pstep summary { color: var(--primary-2); }
.pinsert { display: block; margin: .25rem auto; border: 1px dashed var(--line); background: none; border-radius: 99px; padding: .1rem .8rem; font-size: .75rem; color: var(--muted); cursor: pointer; }
.pinsert:hover { color: var(--primary-2); border-color: var(--primary-2); }
.step-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.steps-table tr:target { background: var(--yellow-bg); }
@media (max-width: 640px) { .pstep-head { flex-wrap: wrap; } .pstep-head select { width: auto; } }
.aprog th.c, .aprog td.c { text-align: center; padding: .35rem .2rem; min-width: 2.6rem; }
.achip { display: inline-block; padding: .1rem .35rem; border-radius: 6px; font-size: .78rem; font-weight: 600; margin: 1px; background: var(--grey-bg); color: var(--text); }
.achip:hover { text-decoration: none; outline: 2px solid var(--primary-2); }
.achip.st-geplant { background: var(--blue-bg); color: var(--primary); } .achip.st-durchgefuehrt { background: var(--yellow-bg); color: var(--warn); } .achip.st-abgeschlossen { background: var(--green-bg); color: var(--ok); }
.aplus { display: inline-block; width: 1.6rem; color: var(--line); font-weight: 700; border-radius: 6px; }
.aprog tr:hover .aplus { color: var(--muted); } .aplus:hover { background: var(--grey-bg); color: var(--primary-2) !important; text-decoration: none; }
.ppreview .diagram-wrap svg { width: 100%; max-width: 100%; }

/* Dokumente: Ordnerbaum, Export-Menü, Rechte */
.doc-browser { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.folder-tree { padding: .5rem; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.folder-tree a { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .6rem; border-radius: 6px; color: var(--text); text-decoration: none; font-size: .9rem; }
.folder-tree a:hover { background: var(--grey-bg); }
.folder-tree a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
@media (max-width: 900px) { .doc-browser { grid-template-columns: minmax(0, 1fr); } .folder-tree { position: static; max-height: 240px; } }
tr.group-row td { background: var(--surface-2); font-weight: 600; font-size: .8rem; color: var(--muted); letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
details.menu { position: relative; }
details.menu > .menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 300px; padding: .4rem; display: flex; flex-direction: column; margin: 0; box-shadow: var(--shadow-lg); }
details.menu > .menu-list a { padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--text); }
details.menu > .menu-list a:hover { background: var(--grey-bg); }
.access-box { border-top: 1px solid var(--line); padding-top: .75rem; }
.access-box details { margin: .3rem 0; }
.access-box .checks { max-height: 180px; }
@media (max-width: 640px) { details.menu > .menu-list { left: 0; right: auto; min-width: 260px; } }

/* Berechtigungsgruppen */
.perm-matrix th { vertical-align: top; min-width: 150px; text-transform: none; }
.perm-matrix .rw { display: inline-flex; flex-direction: row; gap: .7rem; align-items: center; }
.perm-matrix .rw label { display: inline-flex; flex-direction: row; align-items: center; gap: .3rem; margin: 0; font-size: .78rem; color: var(--muted); white-space: nowrap; font-weight: 400; }
.perm-matrix .rw input { margin: 0; width: auto; }
.perm-matrix td.c { padding-top: .45rem; padding-bottom: .45rem; }
.perm-matrix .rw input:checked + span { color: var(--text); }
.perm-matrix th input { width: 100%; }
.perm-matrix td.c { text-align: center; }
.perm-matrix .new-col { background: var(--grey-bg); }
.perm-matrix td:first-child { white-space: nowrap; }
#zuordnung select { min-width: 150px; }

/* Organigramm: Baum von oben nach unten, Linien per CSS; Gesellschafts-Auswahl, Zoom */
.org-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .85rem; border: 1px solid var(--line); border-radius: 99px; font-size: .86rem; font-weight: 500;
  color: var(--text); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-sm); }
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip .muted { font-size: .78rem; }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip.active .muted { color: color-mix(in srgb, var(--surface) 70%, transparent); }
.zoom { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.zoom .btn { border: 0; border-radius: 0; box-shadow: none; min-width: 2.5rem; justify-content: center; background: none; }
.zoom .btn + .btn { border-left: 1px solid var(--line); }
.zoom .btn:hover { background: var(--grey-bg); }
.org-wrap { overflow: auto; padding: 1.75rem 1rem 1.5rem; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  background-color: var(--surface); background-image: radial-gradient(color-mix(in srgb, var(--line-strong) 55%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.org { width: max-content; min-width: 100%; --c: var(--line-strong); }
.org ul { display: flex; justify-content: center; padding: 22px 0 0; margin: 0; position: relative; list-style: none; }
.org > ul { padding-top: 0; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 22px 7px 0; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 1.5px solid var(--c); }
.org li::after { right: auto; left: 50%; border-left: 1.5px solid var(--c); }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 1.5px solid var(--c); border-radius: 0 10px 0 0; }
.org li:first-child::after { border-radius: 10px 0 0 0; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid var(--c); }
.org > ul > li:only-child { padding-top: 0; }
.org ul.stack { flex-direction: column; align-items: center; }
.org ul.stack > li { padding: 12px 0 0; }
.org ul.stack > li::before { display: none; }
.org ul.stack > li::after { display: block; left: 50%; width: 0; height: 12px; border-top: 0; border-left: 1.5px solid var(--c); border-radius: 0; }
.org ul.wrap { flex-wrap: wrap; align-items: flex-start; gap: 18px 8px; max-width: 1480px; margin-top: 22px; padding: 18px 14px;
  border: 1.5px dashed var(--c); border-radius: 18px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.org ul.wrap::before { top: -24px; height: 22px; }
.org ul.wrap > li { padding-top: 0; }
.org ul.wrap > li::before, .org ul.wrap > li::after { display: none; }
.onode { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 196px; padding: .8rem .8rem .7rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-align: center; font-size: .82rem;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s; }
.onode::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1px; height: 3px; border-radius: 0 0 3px 3px; background: var(--rc, var(--line-strong)); }
.onode:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.otitle { font-weight: 650; font-size: .88rem; line-height: 1.3; letter-spacing: -.005em; }
.ounit { font-size: .72rem; color: var(--muted); }
.opeople { display: flex; flex-direction: column; align-items: center; gap: .3rem; margin-top: .15rem; }
.oavatars { display: flex; }
.oav { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-left: -6px; font-size: .68rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--rc, var(--primary)), color-mix(in srgb, var(--rc, var(--primary)) 55%, #000)); border: 2px solid var(--surface); }
.oav:first-child { margin-left: 0; }
.oav.more { background: var(--grey-bg); color: var(--muted); }
.onames { font-size: .76rem; color: var(--text); opacity: .85; line-height: 1.3; }
.ovacant { font-size: .74rem; color: var(--muted); font-style: italic; margin-top: .1rem; }
.orole { display: inline-flex; align-items: center; gap: .35rem; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: .1rem; }
.orole i { width: 7px; height: 7px; border-radius: 50%; background: var(--rc, var(--line-strong)); }
.onode.vacant { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.onode.vacant .otitle { color: var(--muted); }
.onode.staff { border-style: dashed; }
.onode.role-admin, .onode-mini.role-admin { --rc: #8b5cf6; } .onode.role-qhse, .onode-mini.role-qhse { --rc: #10b981; }
.onode.role-fuehrung, .onode-mini.role-fuehrung { --rc: #3b82f6; } .onode.role-mitarbeiter, .onode-mini.role-mitarbeiter { --rc: #94a3b8; }
.onode-mini { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin: 0 .3rem 0 .8rem; vertical-align: -1px; background: var(--rc); }
.org-legend { margin: -.5rem 0 1.25rem; }
.org-list { display: none; padding-left: 0; margin: 0; } .org-list ul { padding-left: 1.1rem; border-left: 1.5px solid var(--line); margin: .2rem 0 .2rem .4rem; }
.org-list li { list-style: none; padding: .3rem 0; }
@media (max-width: 900px) { .org { display: none; } .org-list { display: block; } .org-wrap { background-image: none; padding: 1rem; } .org-legend { display: none; } .org-toolbar .zoom { display: none; } }
@media print { .org-wrap { overflow: visible; background: none; } .org { display: block !important; zoom: 1 !important; } .org-list { display: none !important; } .onode { box-shadow: none; } }

/* Icons in Texten und Listen */
.li-ico { display: inline-flex; align-items: center; gap: .45rem; }
.li-ico svg.i { width: 16px; height: 16px; color: var(--muted); }
.h-ico { display: flex; align-items: center; gap: .5rem; } .h-ico svg.i { color: var(--primary); }
.badge svg.i { width: 13px; height: 13px; }
.btn svg.i { width: 16px; height: 16px; }
.big-actions a span svg.i { width: 30px; height: 30px; stroke-width: 1.7; color: var(--primary); }
.big-actions a.danger span svg.i { color: #fff; }
.result-ico svg.i { width: 64px; height: 64px; } .result-ico.ok { color: var(--ok); } .result-ico.no { color: var(--danger); }
.flash strong svg.i { vertical-align: -3px; }

/* Branding (Plattform-Verwaltung) */
.brand-row { display: flex; gap: .5rem; align-items: center; }
.brand-row input[type=color] { width: 3rem; height: 2.5rem; padding: .2rem; flex: none; cursor: pointer; }
.brand-preview { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.brand-preview img { max-height: 56px; max-width: 220px; border-radius: 8px; background: #fff; padding: .35rem .5rem; border: 1px solid var(--line); }
.swatch { width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--line); display: inline-block; }

/* Branding im Kundenportal */
.brand img.brand-logo { width: auto; height: 34px; max-width: 170px; object-fit: contain; border-radius: 6px; }
.brand-name { font-weight: 650; }
.login-head { text-align: center; margin-bottom: 1.25rem; }
.login-head .login-logo { max-height: 72px; max-width: 260px; object-fit: contain; margin-bottom: .5rem; }
.avatar { background: linear-gradient(135deg, var(--brand, var(--primary)), var(--brand-accent, #7c3aed)); }

/* Sprachumschalter */
.lang-switch { display: flex; align-items: center; gap: .3rem; color: var(--muted); margin: 0; }
.lang-switch .i { width: 1.05rem; height: 1.05rem; }
.lang-switch select { width: auto; border: 1px solid transparent; background: transparent; padding: .3rem 1.6rem .3rem .4rem; font-size: .85rem; color: var(--text); border-radius: 8px; min-height: 0; }
.lang-switch select:hover, .lang-switch select:focus { border-color: var(--line-strong); background: var(--surface); }
.login-lang { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; }
.nav-lang { display: grid; gap: .1rem; padding: .25rem .5rem .5rem; }
.nav-lang .lang-switch select { flex: 1; width: 100%; }
@media (max-width: 900px) { .topbar .lang-switch { display: none; } }
/* Rechts-nach-links-Sprachen (z. B. Persisch) in Schulungsinhalten */
[dir="rtl"] { text-align: right; }
.lang-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.card-sub { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: 1rem; background: var(--surface-2); }
.card-sub h3 { margin: 0 0 .35rem; font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.lang-pick { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; }
.lang-pick .check { font-size: .85rem; }
@media (max-width: 640px) { .topbar .btn-danger span { display: none; } .topbar .btn-danger { padding-inline: .55rem; } }

/* ---- Gefährdungsbeurteilung: Assistent ---- */
.wiz-steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1rem; counter-reset: none; }
.wiz-steps li { flex: 1; display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.wiz-steps li span { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--grey-bg); font-size: .8rem; flex: none; }
.wiz-steps li.active { border-color: var(--primary); color: var(--text); box-shadow: var(--ring); }
.wiz-steps li.active span, .wiz-steps li.done span { background: var(--fill); color: var(--on-fill); }
.wiz.js .wiz-step { display: none; }
.wiz.js .wiz-step.active { display: block; }
.wiz-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; padding: .7rem 0; margin-top: 1rem; background: linear-gradient(to top, var(--bg) 75%, transparent); }
.wiz-nav .wiz-count { flex: 1; text-align: center; }
.wiz:not(.js) .wiz-nav [data-prev], .wiz:not(.js) .wiz-nav [data-next] { display: none; }
@media (max-width: 900px) { .wiz-nav { bottom: calc(64px + env(safe-area-inset-bottom)); } }
/* Vorlagen-Kacheln: alle gleich hoch und breit (auch über mehrere Gruppen), Text höchstens drei Zeilen */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); grid-auto-rows: 7.2rem; gap: .5rem; }
.tpl-h { font-size: .9rem; font-weight: 600; margin: 1.1rem 0 .5rem; color: var(--muted); }
.tpl { display: flex; min-width: 0; position: relative; }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl > span { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; text-align: center; padding: .7rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500; font-size: .88rem; line-height: 1.3; cursor: pointer; }
.tpl > span:hover { border-color: var(--line-strong); }
.tpl .tpl-l { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.tpl > span .i { width: 1.5rem; height: 1.5rem; flex: none; color: var(--primary); }
.tpl input:checked + span { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.tpl input:focus-visible + span { outline: 2px solid var(--primary); }
@media (max-width: 640px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 8rem; } .tpl .tpl-l { -webkit-line-clamp: 4; } }
.tpl-docs ul { margin: .4rem 0 0 1.2rem; padding: 0; }
.tpl-docs a { white-space: normal; }
dd .tpl-docs { margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.ck-intro { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.ck-intro p { margin: 0; flex: 1 1 320px; }
.ck-group > summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none; font-weight: 600; }
.ck-group > summary::-webkit-details-marker { display: none; }
.ck-group > summary .ck-gname { flex: 1; }
.ck-gico { width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.ck-group[open] > summary { margin-bottom: .75rem; }
.ck-item { border-top: 1px solid var(--line); padding: .8rem 0; }
.ck-item.typ .ck-q::after { content: '●'; color: var(--primary); font-size: .6rem; margin-left: .4rem; vertical-align: middle; }
.ck-item.missing { background: var(--red-bg); margin: 0 -.75rem; padding: .8rem .75rem; border-radius: var(--radius-sm); }
.ck-item.is-done { color: var(--muted); }
.ck-q { font-weight: 500; margin-bottom: .5rem; }
.seg { display: grid; grid-template-columns: 1fr 1.4fr; gap: .4rem; max-width: 420px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .6rem .5rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--surface); min-height: 44px; }
.seg-no input:checked + span { background: var(--grey-bg); border-color: var(--muted); color: var(--text); }
.seg-yes input:checked + span { background: var(--yellow-bg); border-color: var(--warn); color: var(--warn); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.wiz.js .ck-detail { display: none; }
.wiz.js .ck-item.yes .ck-detail, .ck-detail.open { display: block; }
.ck-detail { margin-top: .8rem; padding: .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.ck-sub { font-weight: 600; font-size: .85rem; margin: .2rem 0 .5rem; display: flex; align-items: center; gap: .35rem; }
.ck-measure { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--line-strong); }
.ck-need { display: none; }
.ck-item.need .ck-need { display: inline-flex; }
.ck-residual { margin-top: .6rem; }
.ck-residual > summary { cursor: pointer; font-size: .85rem; color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0 .2rem; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 99px; padding: .32rem .7rem; font-size: .8rem; cursor: pointer; text-align: left; line-height: 1.3; }
.chip b { color: var(--primary); margin-right: .15rem; }
.chip:hover { border-color: var(--primary); }
.chip.used { background: var(--primary-soft); border-color: var(--primary); }
/* Antippbare Risikomatrix */
.rpick-grid { display: grid; grid-template-columns: minmax(70px, 1.3fr) repeat(5, minmax(40px, 1fr)); gap: 3px; max-width: 520px; }
.rpick-corner { display: flex; flex-direction: column; justify-content: flex-end; font-size: .62rem; color: var(--muted); line-height: 1.2; }
.rpick-sh, .rpick-ph { display: flex; flex-direction: column; justify-content: center; font-size: .66rem; color: var(--muted); line-height: 1.15; overflow: hidden; }
.rpick-sh { text-align: center; align-items: center; padding-bottom: 2px; }
.rpick-sh b, .rpick-ph b { color: var(--text); font-size: .8rem; }
.rpick-sh span { hyphens: auto; overflow-wrap: anywhere; }
.rpick-ph { padding-right: 4px; }
.rpick-cell { position: relative; display: grid; place-items: center; min-height: 42px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: .85rem; border: 2px solid transparent; }
.rpick-cell input { position: absolute; opacity: 0; pointer-events: none; }
.rpick-cell.green { background: var(--green-bg); color: var(--ok); }
.rpick-cell.yellow { background: var(--yellow-bg); color: var(--warn); }
.rpick-cell.red { background: var(--red-bg); color: var(--danger); }
.rpick-cell:has(input:checked) { border-color: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); transform: scale(1.04); }
.rpick-cell:has(input:focus-visible) { outline: 2px solid var(--primary); }
.rpick-out { margin-top: .5rem; line-height: 1.5; }
.risk-legend { display: grid; gap: .35rem; }
.danger { color: var(--danger); }
.ck-list-group { margin-bottom: .8rem; }
.ck-list-group h3 { font-size: .9rem; margin: .6rem 0 .3rem; display: flex; gap: .4rem; align-items: center; }
.ck-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; font-size: .88rem; }
.ck-list li { display: flex; gap: .5rem; align-items: flex-start; }
.ck-list li .i { flex: none; margin-top: .15rem; }
.ck-list li.ja .i { color: var(--warn); } .ck-list li.nein .i { color: var(--ok); }
.matrix-pair { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.ck-cols { columns: 2 340px; column-gap: 2rem; }
.ck-cols .ck-list-group { break-inside: avoid; }
.rr-edit > summary { cursor: pointer; color: var(--primary); list-style: none; }
.wiz-nav [hidden] { display: none !important; }
.wiz-nav .wiz-count { white-space: nowrap; }

/* ---- Schulung: Präsentation Folie für Folie ---- */
fieldset.form-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem 1rem; margin: 0; }
fieldset.form-group legend { font-weight: 600; padding: 0 .4rem; display: flex; align-items: center; gap: .4rem; }
.presenter { padding: .9rem; }
.presenter.is-full { background: #111; color: #eee; border-radius: 0; border: 0; margin: 0; padding: 0; overflow: hidden; }
.presenter.is-full .pres-inner { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; padding: .6rem .8rem calc(.6rem + env(safe-area-inset-bottom)); }
/* Gedrehte Ansicht (Handy hochkant, Folie quer): Inhalt um 90° im Uhrzeigersinn drehen */
.presenter.pres-rot .pres-inner { position: absolute; top: 0; left: 0; transform-origin: top left; transform: rotate(90deg) translateY(-100%);
  padding: calc(.35rem + env(safe-area-inset-right)) .6rem .35rem; }

.presenter.pres-full { position: fixed; inset: 0; z-index: 2000; width: 100vw; height: 100vh; height: 100dvh; contain: layout paint size; }
.presenter:fullscreen { width: 100vw; height: 100vh; }
.presenter.is-full .pres-stage { flex: 1; min-height: 0; background: #111; }
.presenter.is-full .pres-stage canvas { box-shadow: none; }
.presenter.is-full .pres-head .small { color: #bbb; }
body.pres-lock { overflow: hidden; }
.pres-fs .fs-off { display: none; align-items: center; gap: .35rem; }
.presenter.is-full .pres-fs .fs-on { display: none; }
.presenter.is-full .pres-fs .fs-off { display: inline-flex; }
.pres-fs .fs-on { display: inline-flex; }
.pres-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.pres-head .pres-page { font-weight: 700; }
.pres-head .small { flex: 1; }
.pres-bar { height: 6px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; margin-bottom: .6rem; }
.pres-bar > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.pres-stage { position: relative; display: flex; justify-content: center; align-items: center; min-height: 240px; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; touch-action: pan-y; }
.pres-stage canvas { display: block; max-width: 100%; box-shadow: var(--shadow); background: #fff; }
.pres-loading { position: absolute; }
.presenter.ready .pres-loading { display: none; }
.pres-error { position: absolute; inset: auto 1rem; }
.pres-nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .7rem; }
.pres-nav .btn { min-height: 46px; min-width: 7.5rem; justify-content: center; }
.pres-nav .btn:disabled { opacity: .55; cursor: not-allowed; }
.pres-wait { font-variant-numeric: tabular-nums; }
.quiz-locked { display: flex; align-items: center; gap: .9rem; color: var(--muted); }
.quiz-locked > .i { width: 1.6rem; height: 1.6rem; flex: none; }
.pres-wait[hidden] { display: none; }

/* Kompakte Vollbild-Ansicht (Handy quer bzw. gedreht): Knöpfe seitlich, Folie nutzt die volle Höhe */
.presenter.pres-compact .pres-inner { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) 3.2rem; grid-template-rows: 4px auto auto minmax(0, 1fr); column-gap: .45rem; row-gap: .35rem;
  padding: .35rem max(.45rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.45rem, env(safe-area-inset-left)); }
/* Kompakt (Handy quer oder gedreht): alle Knöpfe in schmalen Spalten links und rechts – die Folie bekommt die volle Höhe */
.presenter.pres-compact .pres-head { display: contents; }
.presenter.pres-compact .pres-head .small, .presenter.pres-compact .pres-tip { display: none; }
.presenter.pres-compact .pres-bar { grid-row: 1; grid-column: 1 / -1; height: 4px; margin: 0; }
.presenter.pres-compact .pres-page { grid-column: 1; grid-row: 2; font-size: .7rem; font-weight: 600; text-align: center; white-space: normal; line-height: 1.15; color: #bbb; }
.presenter.pres-compact .pres-zoom { grid-column: 1; grid-row: 3; }
.presenter.pres-compact .pres-fs { grid-column: 3; grid-row: 2; }
.presenter.pres-compact .pres-rotate { grid-column: 3; grid-row: 3; }
.presenter.pres-compact .pres-head .btn { justify-self: center; align-self: start; width: 2.6rem; min-height: 2.3rem; padding: .3rem; justify-content: center; }
.presenter.pres-compact .pres-fs .fs-off > span, .presenter.pres-compact .rot-hint, .presenter.pres-compact .fs-txt { display: none; }
.presenter.pres-compact .pres-stage { grid-column: 2; grid-row: 2 / 5; border-radius: 6px; }
.presenter.pres-compact .pres-nav { display: contents; }
.presenter.pres-compact .pres-nav .btn { grid-row: 4; align-self: center; min-width: 0; width: 100%; min-height: 6.5rem; padding: 0; }
.presenter.pres-compact .pres-nav .btn > span { display: none; }
.presenter.pres-compact [data-prev] { grid-column: 1; }
.presenter.pres-compact [data-next] { grid-column: 3; }
.presenter.pres-compact .pres-wait { grid-column: 2; grid-row: 4; align-self: end; justify-self: center; margin-bottom: .4rem; z-index: 1; opacity: .9; }

/* Zoom der Folie */
.pres-stage.zoomed { display: block; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pres-stage.zoomed canvas { max-width: none; margin: 0 auto; }
.pres-zoom .z-out, .presenter.is-zoomed .pres-zoom .z-in { display: none; }
.presenter.is-zoomed .pres-zoom .z-out { display: inline-flex; }
.pres-tip { display: flex; gap: .6rem; align-items: flex-start; grid-column: 1 / -1; background: #2a2f3a; color: #e5e7eb; border-radius: 8px; padding: .4rem .6rem; margin-bottom: .35rem; }
.pres-tip[hidden] { display: none; }
.pres-tip span { flex: 1; }
.pres-tip button { color: #e5e7eb; }

/* Dreh-Knopf: nur im Vollbild, Handy hochkant, Folie quer */
.pres-rotate { display: none; }
.pres-turn { position: absolute; inset: 0; margin: auto; height: max-content; width: max-content; max-width: 90%; z-index: 3; background: rgba(17,17,17,.88); color: #fff; border-radius: 99px;
  padding: .45rem .9rem; font-size: .9rem; display: flex; gap: .45rem; align-items: center; pointer-events: none; transition: opacity .4s; }
.pres-turn[hidden] { display: none; }
.presenter.can-rot .pres-rotate { display: inline-flex; align-items: center; gap: .35rem; }
.presenter.pres-rot .pres-rotate .rot-hint { display: none; }
.presenter.is-full .pres-head .small { display: none; }
.presenter.is-full .pres-head .pres-page { flex: 1; }
@media (max-width: 480px) { .presenter.is-full .pres-fs .fs-off > span { display: none; } }
.presenter .pres-page { white-space: nowrap; }

/* ---- Unterschrift ---- */
.sign-box h2 { display: flex; align-items: center; gap: .45rem; }
.sign-qr { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.sign-qr img { border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.sign-qr > div { flex: 1 1 260px; }
.sign-qr .wait-dots::after { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-left: .4rem; border-radius: 50%; background: var(--primary); animation: signpulse 1.2s infinite ease-in-out; vertical-align: middle; }
@keyframes signpulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.sign-canvas { position: relative; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.sign-canvas canvas { display: block; width: 100%; height: 220px; touch-action: none; cursor: crosshair; border-radius: var(--radius-sm); }
.sign-line { position: absolute; left: 1rem; right: 1rem; bottom: 2.2rem; border-top: 1px solid #cbd5e1; padding-top: .2rem; font-size: .75rem; color: #94a3b8; pointer-events: none; }
.sign-img { display: block; max-width: 100%; width: 360px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-top: .75rem; }
.sign-mobile { max-width: 560px; margin: 1rem auto; }
.sign-mobile .sign-canvas canvas { height: 260px; }
@media (max-width: 640px) { .sign-qr img { width: 160px; height: 160px; } }
.sign-box [hidden] { display: none !important; }

/* ---- Besucher / Präsenz-Termine ---- */
.public-wrap { max-width: 620px; margin: 1rem auto 2rem; }
.public-wrap .login-head h1 { font-size: 1.45rem; }
.public-lang { display: flex; justify-content: center; margin-top: 1rem; }
.rq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.qr-setup { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start; } .qr-setup img { width: 180px; height: 180px; }
@media (max-width: 640px) { .qr-setup { grid-template-columns: 1fr; } }
.session-qr { text-align: center; }
.session-qr .actions-row { justify-content: center; }
.qr-big { width: 300px; max-width: 100%; height: auto; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.sig-thumb { max-height: 38px; max-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: 4px; display: block; }
.visitor-pass { text-align: center; border-top: 6px solid var(--ok); }
.visitor-pass.pending { border-top-color: var(--warn); }
.visitor-pass dl.props { text-align: left; max-width: 420px; margin: 1rem auto; }
.visitor-pass .sign-img { margin: .5rem auto 0; }
label[hidden] { display: none !important; }

/* Gebuchte Module */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.pkg { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pkg.on .i { color: var(--ok); } .pkg.off { color: var(--muted); } .pkg.off .i { color: var(--muted); }
.pkg .i { flex: none; margin-top: .15rem; }
.pkg-table tr.muted-row td { color: var(--muted); }
.pkg-table input[type=checkbox] { width: 1.15rem; height: 1.15rem; }
.demo-banner { border: 2px solid var(--warn); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; }
.demo-banner form { margin: 0; }

/* ---- Hilfe ---- */
.help-btn { padding: .35rem .5rem; }
.help-btn svg.i { width: 1.15rem; height: 1.15rem; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 60; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.help-drawer[hidden] { display: none; }
.help-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.help-drawer-body { overflow: auto; padding: 1rem; flex: 1; -webkit-overflow-scrolling: touch; }
.hp-tabs { display: flex; gap: .25rem; margin-bottom: .9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .2rem; }
.hp-tabs button { flex: 1; display: flex; gap: .35rem; align-items: center; justify-content: center; border: 0; background: none; padding: .45rem .3rem; border-radius: 8px; font: inherit; font-size: .88rem; color: var(--muted); cursor: pointer; }
.hp-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.hp-tour { margin-bottom: 1rem; }
.hp-chat { display: flex; flex-direction: column; gap: .55rem; max-height: 52vh; overflow: auto; margin-bottom: .6rem; }
.hp-msg { padding: .55rem .75rem; border-radius: 12px; max-width: 92%; line-height: 1.45; font-size: .93rem; }
.hp-msg p { margin: .2rem 0; } .hp-msg ol, .hp-msg ul { margin: .25rem 0; padding-left: 1.2rem; }
.hp-msg.bot { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.hp-msg.me { background: var(--fill); color: var(--on-fill); align-self: flex-end; }
.hp-sources { margin-top: .45rem; display: flex; flex-direction: column; gap: .2rem; }
.hp-ask { display: flex; gap: .4rem; align-items: flex-end; }
.hp-ask textarea { flex: 1; resize: vertical; min-height: 2.6rem; }
.hp-contact { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.hp-contact-msg.ok { color: var(--ok); } .hp-contact-msg.err { color: var(--danger); }
.help-article h3, .help-article h4 { margin: 1.1rem 0 .4rem; }
.help-article li { margin: .2rem 0; }
.help-article code { background: var(--surface-2); padding: 0 .3rem; border-radius: 4px; overflow-wrap: anywhere; }
.help-video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 1rem; border-radius: var(--radius-sm); overflow: hidden; background: #000; }
.help-video iframe, .help-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.help-video:has(> a) { aspect-ratio: auto; background: none; }
.help-search { display: flex; gap: .5rem; align-items: center; }
.help-search input { flex: 1; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; margin-top: 1rem; }
.help-tile { display: flex; gap: .75rem; align-items: center; color: var(--text); margin: 0; }
.help-tile:hover { text-decoration: none; border-color: var(--primary); }
.help-tile .badge { margin-left: .4rem; }
.help-ico { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.help-toc { display: flex; flex-direction: column; gap: .1rem; position: sticky; top: calc(var(--top) + 1rem); }
.help-toc a { display: flex; gap: .5rem; align-items: center; padding: .3rem .4rem; border-radius: 8px; color: var(--text); font-size: .9rem; }
.help-toc a.active { background: var(--primary-soft); font-weight: 600; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; } }
/* Handbuch */
.hb-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; margin-top: 1rem; }
.hb-chapter { margin: 0; }
.hb-chapter h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.hb-chapter ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.hb-article h2 { margin: 1.8rem 0 .5rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.hb-article h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hb-article h2, .hb-article h3, .hb-article h4 { scroll-margin-top: calc(var(--top) + 1rem); }
.hb-fig { margin: .8rem 0 1.2rem; text-align: center; }
.hb-fig img { max-width: 100%; max-height: 80vh; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.hb-fig figcaption { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.hb-table td, .hb-table th { vertical-align: top; }
.hb-table th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
.hb-toc h3.mt { margin-top: .9rem; }
.hb-results-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.hb-results-head h2 { margin: 0; }
.hb-hit { display: block; padding: .75rem .6rem; margin: 0 -.6rem; border-top: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.hb-hit:hover { text-decoration: none; background: var(--surface-2); }
.hb-hit-title { display: block; font-weight: 650; font-size: 1.02rem; color: var(--primary); }
.hb-hit-ch { display: block; font-size: .8rem; color: var(--muted); margin: .1rem 0 .3rem; }
.hb-hit-text { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .9rem; color: var(--text); line-height: 1.45; }
.hb-hit mark, .hb-article mark.hb-hl { background: #fde68a; color: #1f2937; border-radius: 3px; padding: 0 .1em; }
.hb-article mark.hb-hl.current { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }
.hb-hlbar { display: flex; gap: .4rem .75rem; flex-wrap: wrap; align-items: center; font-size: .88rem; padding: .5rem .75rem; margin: 0 0 1rem; border-radius: var(--radius-sm); background: var(--yellow-bg); }
.hb-hlbar span { margin-right: auto; display: inline-flex; gap: .35rem; align-items: center; }
.hb-pager { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.hb-toc { max-height: calc(100vh - var(--top) - 2rem); overflow-y: auto; }
.hb-toc h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 0 0 .3rem; }
.provider-card p { margin: .4rem 0; }
.tour-shade { position: fixed; inset: 0; z-index: 70; }
.tour-box { position: fixed; z-index: 71; border-radius: 10px; box-shadow: 0 0 0 9999px rgb(15 23 42 / .55), 0 0 0 3px var(--primary); pointer-events: none; transition: all .2s ease; }
.tour-tip { position: fixed; z-index: 72; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .9rem 1rem; border: 1px solid var(--line); }
.tour-tip p { margin: .35rem 0 .7rem; }
.tour-nav { display: flex; justify-content: space-between; gap: .5rem; }
@media print { .help-drawer, .help-btn { display: none !important; } }

/* ---- Testumgebung ---- */
.test-banner { position: fixed; top: 0; left: 0; right: 0; height: 1.6rem; line-height: 1rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 80; background: repeating-linear-gradient(135deg, #f59e0b 0 14px, #fbbf24 14px 28px); color: #1f1300;
  font-weight: 700; font-size: .8rem; text-align: center; padding: .3rem .6rem; letter-spacing: .02em; }
body.is-test, body:has(> .test-banner) { padding-top: 1.6rem; }
body.is-test .topbar { top: 1.6rem; }
body.is-test .help-drawer { top: 1.6rem; }
body.is-test .sidebar { top: calc(var(--top) + 1.6rem); }

/* ---- Gefahrstofflagerung ---- */
.storage-findings { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .45rem; }
.storage-findings li { display: flex; gap: .5rem; align-items: flex-start; }
.storage-findings li > svg { flex: none; margin-top: .15rem; }
.storage-findings .lv-over > svg { color: var(--danger); } .storage-findings .lv-warn > svg { color: var(--warn); } .storage-findings .lv-ok > svg { color: var(--ok); } .storage-findings .lv-info > svg { color: var(--muted, #667); }
/* Sicherheitsdatenblatt suchen / auslesen */
.sds-panel .actions-row label.btn { cursor: pointer; }
.sds-results { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.sds-results li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid var(--border, #e3e6ea); border-radius: 8px; padding: .6rem .8rem; flex-wrap: wrap; }
.sds-results li > div:first-child { min-width: 0; overflow-wrap: anywhere; flex: 1 1 260px; }
.sds-changed { outline: 2px solid var(--warn, #d69e2e); outline-offset: 1px; background: color-mix(in srgb, var(--warn, #d69e2e) 8%, transparent); }
.spinner { display: inline-block; width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
/* PSA-Verzeichnis */
.psa-matrix th.psa-col { text-align: center; vertical-align: bottom; min-width: 70px; font-weight: 500; }
.psa-matrix th.psa-col a { display: flex; flex-direction: column; align-items: center; gap: .2rem; color: inherit; font-size: .78rem; line-height: 1.15; }
.psa-matrix td.psa-cell { text-align: center; }
.psa-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; }
.psa-dot.fixed { background: var(--ok, #2f855a); }
.psa-dot.rec { border: 2px solid var(--warn, #d69e2e); background: transparent; }
.psa-legend { margin: .3rem 0 0; flex-basis: 100%; }
.psa-own { margin: .2rem 0 .8rem; padding-left: 1.1rem; }
/* Begehung mit Checkliste */
.walk-item { padding: .8rem 0; border-top: 1px solid var(--line); }
.walk-item:first-of-type { border-top: 0; }
.walk-q { font-weight: 500; margin-bottom: .5rem; }
.walk-seg { display: grid; grid-template-columns: 1fr 1fr .6fr; gap: .4rem; max-width: 460px; }
.walk-seg input { position: absolute; opacity: 0; pointer-events: none; }
.walk-seg span { display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .6rem .4rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--surface); min-height: 44px; }
.walk-seg input:focus-visible + span { outline: 2px solid var(--primary); }
.ws-ok input:checked + span { background: var(--green-bg, #e6f4ea); border-color: var(--ok); color: var(--ok); }
.ws-bad input:checked + span { background: var(--red-bg); border-color: var(--danger); color: var(--danger); }
.ws-na input:checked + span { background: var(--grey-bg); border-color: var(--muted); }
.walk-detail { display: none; margin-top: .7rem; padding: .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.walk-item:has(input[value="mangel"]:checked) .walk-detail, .walk-item:has(textarea:not(:placeholder-shown)) .walk-detail { display: grid; gap: .6rem; }
.walk-action { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .6rem; }
@media (max-width: 640px) { .walk-action { grid-template-columns: 1fr; } }
.walk-bar { position: sticky; bottom: 70px; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; z-index: 5; }
.check-thumb { max-width: 120px; max-height: 90px; border-radius: 6px; margin-top: .3rem; display: block; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
/* ASA-Sitzungen */
.badge.blue { background: var(--blue-bg); color: var(--primary); }
.text-danger { color: var(--danger); }
.btn-danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.asa-item { padding: .8rem 0; border-top: 1px solid var(--line); }
.asa-item:first-of-type { border-top: 0; }
.asa-item.done { color: var(--muted); }
.asa-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.asa-head .badge { margin-left: .3rem; }
.asa-edit { display: grid; grid-template-columns: 2.4fr 1fr 1.2fr 1fr; gap: .5rem .7rem; margin-top: .5rem; align-items: end; }
.asa-edit .check { grid-column: span 2; }
.asa-edit label { font-size: .85rem; }
@media (max-width: 760px) { .asa-edit { grid-template-columns: 1fr 1fr; } .asa-edit .asa-dec { grid-column: 1 / -1; } }
.asa-edit.asa-edit-min { display: block; margin-top: .2rem; }
@media (max-width: 640px) { .walk-bar { position: static; } }
.progress { height: 8px; background: var(--grey-bg); border-radius: 99px; overflow: hidden; margin-top: .3rem; } .progress span { display: block; height: 100%; background: var(--primary); }
.ghs-img { vertical-align: middle; margin: 1px 2px 1px 0; }

/* Kontext & Risiken: SWOT-Raster */
.ctx-tabs .btn { gap: .35rem; }
.swot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.swot .card { margin: 0; }
.swot-q { border-top: 4px solid var(--line-strong); }
.swot-S { border-top-color: var(--ok); } .swot-W { border-top-color: var(--danger); } .swot-O { border-top-color: var(--primary); } .swot-T { border-top-color: var(--warn); }
.matrix td.blue { background: var(--blue-bg); }
@media (max-width: 760px) { .swot { grid-template-columns: 1fr; } }

/* Fortschritt in Schritten (z. B. Veränderungsmanagement) */
ol.steps { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: st; }
ol.steps li { counter-increment: st; padding: .3rem .75rem; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: .85rem; }
ol.steps li::before { content: counter(st) '. '; }
ol.steps li.done { background: var(--green-bg); color: var(--ok); }
ol.steps li.current { background: var(--fill); color: var(--on-fill); font-weight: 600; }
.cov { border-top: 4px solid var(--line-strong); } .cov-red { border-top-color: var(--danger); } .cov-yellow { border-top-color: var(--warn); } .cov-green { border-top-color: var(--ok); }
.fishbone-wrap { overflow-x: auto; margin: .5rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.fishbone-wrap svg { min-width: 720px; width: 100%; height: auto; display: block; }

/* Umfragen */
.survey-link { display: flex; gap: 1rem; align-items: center; }
.survey-form { display: grid; gap: 1rem; }
.sq { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 0; }
.sq legend { font-weight: 600; padding: 0 .3rem; }
.scale { display: flex; gap: .35rem; flex-wrap: wrap; }
.scale label { flex: 1; min-width: 2.4rem; }
.scale input { position: absolute; opacity: 0; }
.scale span { display: block; text-align: center; padding: .55rem 0; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; font-weight: 600; }
.scale input:checked + span { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.scale input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.scale.nps label { min-width: 2rem; }
.scale-legend { display: flex; justify-content: space-between; margin-top: .25rem; }
.bars { display: grid; gap: .3rem; max-width: 640px; }
.bar-row { display: grid; grid-template-columns: 11rem 1fr 2.5rem; gap: .5rem; align-items: center; }
.bar { background: var(--grey-bg); border-radius: 4px; height: .9rem; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); }
.bar .b1 { background: var(--danger); } .bar .b2 { background: #e67e22; } .bar .b3 { background: var(--warn); } .bar .b4 { background: #7cb342; } .bar .b5 { background: var(--ok); }
@media (max-width: 560px) { .bar-row { grid-template-columns: 7rem 1fr 2rem; } }

/* Kennzahlen-Cockpit: Monatsbalken (eine Serie je Diagramm) */
.section-title { font-size: 1rem; margin: 1.2rem 0 .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi-fig { margin: 0; }
.kpi-chart { width: 100%; height: auto; display: block; margin-top: .4rem; }
.kc-grid { stroke: var(--line); stroke-width: 1; }
.kc-ax { font-size: 10.5px; fill: var(--muted); }
.kc-val { font-size: 11px; font-weight: 600; fill: var(--text); }
.kc-fill { fill: var(--primary); }
.kc-hit { fill: transparent; }
.kc-bar:hover .kc-fill { opacity: .75; }
.kc-bar:hover .kc-hit { fill: var(--grey-bg); }
.norms a.ev { color: inherit; } .norms a.ev:hover { color: var(--primary); } .norms a.ev-missing { color: var(--muted); }

/* Einführung beim ersten Start */
.intro-dialog { border: 0; border-radius: var(--radius); padding: 1.25rem 1.5rem; width: min(760px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.intro-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.intro-dialog h2 { margin-top: 0; }
.intro-dialog video, .intro-dialog iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; margin: .5rem 0; }
/* „Neu im Portal“ (Hinweis auf der Übersicht und Hilfe → Was ist neu) */
.wn-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
.wn-list { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .75rem; }
.wn-item { display: grid; grid-template-columns: 2.25rem 1fr; gap: .75rem; align-items: start; }
.wn-item p { margin: .25rem 0 .35rem; }
.wn-ico { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.wn-ico svg { width: 1.15rem; height: 1.15rem; }
.wn-links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
.wn-links a, .wn-links .linkbtn { display: inline-flex; align-items: center; gap: .3rem; }
.wn-links svg { width: 1rem; height: 1rem; }
.wn-links .linkbtn.active { font-weight: 600; }
.wn-page .wn-item { padding: 1rem 0; border-top: 1px solid var(--line); }
.wn-page .wn-item:first-of-type { border-top: 0; padding-top: 0; }
.wn-page .help-video { max-width: 640px; margin: .5rem 0; }
.wn-date { font-size: .85rem; color: var(--muted); }
.intro-off { margin: .5rem 0; padding: .4rem .6rem; border-radius: 8px; transition: background .3s; }
.intro-off.highlight { background: var(--yellow-bg); font-weight: 600; }

/* App installieren / Push-Mitteilungen */
.pwa-card { border-left: 4px solid var(--primary); }
.pwa-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.pwa-head h2 { margin: 0; }
.pwa-steps ol { margin: .3rem 0 .6rem 1.2rem; padding: 0; }
.pwa-push { margin-top: .5rem; }

/* Sortierbare Tabellen und Suchfeld (tables.js) */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable:focus-visible { color: var(--text); }
th.sortable::after { content: '↕'; margin-left: .35em; opacity: .35; font-size: .9em; }
th.sortable[aria-sort="ascending"]::after { content: '↑'; opacity: 1; }
th.sortable[aria-sort="descending"]::after { content: '↓'; opacity: 1; }
.table-search { display: flex; align-items: center; gap: .75rem; margin: 0 0 .75rem; flex-wrap: wrap; }
.card.table-wrap > .table-search { margin: .25rem 1.25rem .75rem; }
.table-search input { max-width: 320px; flex: 1 1 200px; }
@media print { th.sortable::after { content: none; } }

.readlist-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .7rem 1rem; margin-bottom: 1rem; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); }
.readlist-bar .i { color: var(--primary); }
.readlist-actions { display: grid; gap: .5rem; }

/* Übersicht: Hinweiszeilen, Einrichtungs-Checkliste, Abschnittsköpfe */
.hintbar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .6rem .9rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .9rem; }
.hintbar > span { flex: 1 1 240px; }
.hintbar > .i { color: var(--muted); flex: none; }
.hintbar form { margin: 0; }
.setup-card .setup-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.setup-card .setup-head h2 { margin: 0; flex: 1; }
.setup-bar { height: 6px; background: var(--grey-bg); border-radius: 99px; margin: .7rem 0 .4rem; overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--primary); }
.setup-steps { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .35rem; }
.setup-steps li { display: flex; gap: .55rem; align-items: center; }
.setup-steps li .i { color: var(--muted); flex: none; }
.setup-steps li.done { color: var(--muted); text-decoration: line-through; }
.setup-steps li.done .i { color: var(--ok); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.4rem 0 .6rem; }
.card .section-head { margin: 0 0 .5rem; }
.section-head h2 { margin: 0; }
.kpis-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.my-tasks .list li { gap: .6rem; }
.my-tasks .list li form { margin: 0; flex: none; }
.task-readlist .btn, .task-important .btn { flex: none; }
@media (max-width: 560px) {
  .my-tasks .list li.task-readlist, .my-tasks .list li.task-important { flex-wrap: wrap; }
  .my-tasks .list li.task-readlist > .btn, .my-tasks .list li.task-important > form { flex: 1 1 100%; }
  .my-tasks .list li.task-readlist > .btn, .my-tasks .list li.task-important > form .btn { width: 100%; justify-content: center; }
  .type-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .type-tiles label { min-height: 92px; font-size: .88rem; }
}

/* Meldung in drei Schritten */
.report-steps { display: grid; gap: 1.1rem; }
.report-steps .rs-rest { display: grid; gap: 1.1rem; }
.rs-step { display: grid; grid-template-columns: 2rem 1fr; gap: .8rem; align-items: start; }
.rs-num { width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 700; display: grid; place-items: center; }
.rs-body { min-width: 0; display: grid; }
.type-tiles label { flex-direction: column; text-align: center; justify-content: center; gap: .35rem; min-height: 86px; }
.type-tiles input { position: absolute; opacity: 0; pointer-events: none; }
.type-tiles label .i { width: 26px; height: 26px; color: var(--primary); }
.type-tiles label:has(input[value=unfall]) .i { color: var(--danger); }
.photo-btn { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: .6rem; min-height: 64px; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; background: var(--surface-2); }
.photo-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-btn .i { width: 26px; height: 26px; color: var(--primary); }
.photo-preview { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); margin-top: .5rem; object-fit: cover; }
.rs-more summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.rs-more-body { display: grid; gap: 1rem; margin-top: .8rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; }

/* Gesamtsuche in der Kopfzeile */
.gsearch { position: relative; flex: 0 1 360px; margin: 0 1rem; display: flex; align-items: center; }
.gsearch > .i { position: absolute; left: .7rem; color: var(--muted); pointer-events: none; }
.gsearch input { padding-left: 2.2rem; padding-right: 3.6rem; height: 38px; background: var(--surface-2); }
.gsearch kbd { position: absolute; right: .6rem; font: 600 .68rem/1 inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: .2rem .35rem; background: var(--surface); }
.gsearch-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; max-height: 70vh; overflow: auto; padding: .4rem; z-index: 60; box-shadow: var(--shadow-lg); }
.gsearch-pop .gs-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .5rem .55rem .2rem; }
.gsearch-pop a { display: flex; flex-direction: column; padding: .4rem .55rem; border-radius: 7px; color: var(--text); text-decoration: none; }
.gsearch-pop a small { color: var(--muted); font-size: .78rem; }
.gsearch-pop a:hover, .gsearch-pop a.sel { background: var(--primary-soft); }
.gsearch-pop .gs-all { color: var(--primary); font-weight: 600; border-top: 1px solid var(--line); margin-top: .3rem; border-radius: 0 0 7px 7px; }
.gsearch-pop .gs-none { padding: .6rem; color: var(--muted); }
.gsearch-mobile { display: none; }
.search-page-form { display: flex; gap: .6rem; }
@media (max-width: 760px) { .gsearch { display: none; } .gsearch-mobile { display: inline-flex; } }

/* „Ansicht als …“ */
.viewas-bar { position: sticky; top: calc(var(--top) + .5rem); z-index: 20; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .6rem .9rem; margin-bottom: 1rem;
  border-radius: var(--radius-sm); background: var(--yellow-bg); border: 1px solid var(--warn); }
.viewas-bar > span { flex: 1 1 260px; }
.viewas-bar form { margin: 0; }
.viewas-start { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: 900px; }

/* Branding des Kunden (body.branded): Kopfzeile in der Hauptfarbe, Akzentstreifen, Akzent an Fortschritt, „Neu“, Leseliste, aktivem Menüpunkt.
   Ohne Branding bleibt alles neutral. Ampel- und Warnfarben (Rot/Gelb/Grün) bleiben immer fest. */
.badge.new { background: var(--yellow-bg); color: var(--warn); }
.branded .badge.new { background: var(--accent-soft); color: var(--accent-ink); }
.branded .topbar { background: var(--brand); color: var(--brand-on); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.branded .topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-accent)); }
.branded .topbar .brand, .branded .topbar .who, .branded .topbar .menu-btn { color: var(--brand-on); }
.branded .topbar .who:hover { background: color-mix(in srgb, var(--brand-on) 14%, transparent); }
.branded .topbar .brand img { background: #fff; padding: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-on) 25%, transparent); }
.branded .topbar .brand img.brand-logo { padding: 3px 6px; border-radius: 8px; }
.branded .gsearch input { background: color-mix(in srgb, var(--brand-on) 14%, transparent); border-color: color-mix(in srgb, var(--brand-on) 28%, transparent); color: var(--brand-on); }
.branded .gsearch input::placeholder, .branded .gsearch > .i { color: color-mix(in srgb, var(--brand-on) 75%, transparent); }
.branded .gsearch kbd { background: transparent; color: color-mix(in srgb, var(--brand-on) 75%, transparent); border-color: color-mix(in srgb, var(--brand-on) 30%, transparent); }
.branded .gsearch input:focus { background: var(--surface); color: var(--text); }
.branded .topbar .btn-danger { box-shadow: 0 0 0 2px color-mix(in srgb, #fff 70%, transparent); }
.branded .sidebar a.active { box-shadow: inset 3px 0 0 var(--accent); }
.branded .setup-bar span { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.branded .readlist-bar { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.branded .readlist-bar .i { color: var(--accent-ink); }
.branded .my-tasks h2 .badge { background: var(--accent); color: var(--accent-on); }
.branded .task-readlist .li-ico > .i { color: var(--accent-ink); }
/* Dunkelmodus: automatisch nach Gerät, außer „Hell“ gewählt; fest bei „Dunkel“ */
@media (prefers-color-scheme: dark) {
:root:not([data-theme=light]) .branded .topbar { background: color-mix(in srgb, var(--surface) 92%, var(--brand)); color: var(--text); }:root:not([data-theme=light]) .branded .topbar .brand,:root:not([data-theme=light]) .branded .topbar .who,:root:not([data-theme=light]) .branded .topbar .menu-btn { color: var(--text); }:root:not([data-theme=light]) .branded .topbar .who:hover { background: var(--grey-bg); }:root:not([data-theme=light]) .branded .gsearch input { background: var(--surface-2); border-color: var(--line); color: var(--text); }:root:not([data-theme=light]) .branded .gsearch input::placeholder,:root:not([data-theme=light]) .branded .gsearch > .i,:root:not([data-theme=light]) .branded .gsearch kbd { color: var(--muted); border-color: var(--line); }

}
:root[data-theme=dark] .branded .topbar { background: color-mix(in srgb, var(--surface) 92%, var(--brand)); color: var(--text); }:root[data-theme=dark] .branded .topbar .brand,:root[data-theme=dark] .branded .topbar .who,:root[data-theme=dark] .branded .topbar .menu-btn { color: var(--text); }:root[data-theme=dark] .branded .topbar .who:hover { background: var(--grey-bg); }:root[data-theme=dark] .branded .gsearch input { background: var(--surface-2); border-color: var(--line); color: var(--text); }:root[data-theme=dark] .branded .gsearch input::placeholder,:root[data-theme=dark] .branded .gsearch > .i,:root[data-theme=dark] .branded .gsearch kbd { color: var(--muted); border-color: var(--line); }


/* Anmeldeseite im Firmenlook */
.branded.plain { background:
  radial-gradient(1000px 600px at 5% -10%, color-mix(in srgb, var(--brand) 38%, transparent), transparent 70%),
  radial-gradient(900px 560px at 105% 110%, color-mix(in srgb, var(--brand-accent) 34%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.branded .login-head .login-logo { max-height: 110px; max-width: 320px; background: #fff; padding: .6rem .9rem; border-radius: 14px; box-shadow: var(--shadow-sm); }
.branded .login-box .card { border-top: 4px solid var(--brand); }

/* hidden-Attribut immer respektieren (auch bei Knöpfen mit eigener Anzeige) */
[hidden] { display: none !important; }
/* KI-Prüfungsfragen: Prüfen und Freigeben */
.qd-q { display: grid; gap: .6rem; }
.qd-q.qd-off { border-style: dashed; background: var(--surface-2); }
.qd-q.qd-off :is(strong, summary, input, .muted) { color: var(--muted); }
.qd-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.qd-opts { display: grid; gap: .4rem; }
.qd-opt { display: flex; gap: .5rem; align-items: center; } .qd-opt > input { flex: 1; }
.qd-opt .check { flex: 0 0 auto; min-width: 3rem; }
.qd-letter { flex: 0 0 2.4rem; font-weight: 600; color: var(--muted); }
.qd-tr { display: grid; gap: .35rem; margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.qd-foot { position: sticky; bottom: 0; z-index: 5; box-shadow: var(--shadow-sm); }
.qg-draft { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
/* Buchung zusätzlicher Benutzer */
.seat-dialog { max-width: 30rem; width: calc(100vw - 2rem); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.seat-dialog::backdrop { background: rgb(15 23 42 / .5); }
.seat-dialog h2 { font-size: 1.15rem; margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: center; }
.seat-dialog .seat-price { background: var(--primary-soft); border-radius: 10px; padding: .8rem 1rem; margin: .8rem 0; }
.seat-dialog .seat-price b { display: block; font-size: 1.25rem; color: var(--primary); } .seat-dialog .seat-price span { font-size: .85rem; color: var(--muted); }
.seat-dialog ul { margin: .4rem 0 1rem; padding-left: 1.1rem; }
.seat-info { display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: center; }

/* Zwei-Faktor-Anmeldung */
.mfa-codes { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; line-height: 1.7; background: var(--surface-2); padding: .8rem 1rem; border-radius: 8px; columns: 2; max-width: 22rem; }
.mfa-steps { padding-left: 1.2rem; display: grid; gap: .9rem; }
.mfa-qr { margin: .6rem 0; }
.mfa-qr img { background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line, #dfe4ea); }
.mfa-secret { font-size: .95rem; letter-spacing: .05em; word-break: break-all; }
/* Plattform: Daten bereinigen */
.cl-areas td:nth-child(2) { width: 6rem; }
.cl-areas td:last-child { width: 9rem; text-align: right; }
.cl-all { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.cl-confirm { display: grid; gap: .9rem; }
.cl-confirm ul { margin: 0; }
/* IT-Risikobewertung (Evaluierung, Zusatzmodul NIS2) */
.it-assets { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.it-group { margin-top: 1.2rem; }
.it-group h3 { display: flex; align-items: center; gap: .45rem; margin: 0 0 .4rem; }
.it-item { border-top: 1px solid var(--line); padding: .7rem 0; display: grid; grid-template-columns: 1fr auto; gap: .4rem 1rem; }
.it-item.done { color: var(--muted); }
.it-q .muted { margin-top: .15rem; }
.it-ans { display: flex; gap: .3rem 1rem; flex-wrap: wrap; align-items: flex-start; }
.it-ans label.check { white-space: nowrap; }
.it-detail { grid-column: 1 / -1; display: none; gap: .7rem; background: var(--surface-2, var(--bg)); border-radius: var(--radius-sm); padding: .8rem; }
.it-item:has(input[value="ja"]:checked) .it-detail, .it-own .it-detail { display: grid; }
.it-own { grid-template-columns: 1fr; }
.it-rate { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .6rem; align-items: end; }
.it-rate label { font-size: .82rem; }
.it-residual > .small { grid-column: 1 / -1; }
.it-score { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding-bottom: .35rem; }
.it-scales { margin-bottom: .5rem; }
.it-scales ol { padding-left: 1.2rem; margin: .3rem 0; }
.it-approval { border-left: 4px solid var(--warn, #d97706); }
.it-approval.ok { border-left-color: var(--ok, #16a34a); }
.it-accept { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .35rem; }
.it-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .5rem; min-width: min(560px, 80vw); }
.it-risks td { vertical-align: top; }
.it-nis { margin-top: .6rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--yellow-bg); font-size: .9rem; }
.it-nis.ok { background: var(--green-bg, var(--surface-2)); }
@media (max-width: 640px) { .it-item { grid-template-columns: 1fr; } }
/* Passkeys (Face ID / Fingerabdruck) und automatisches Abmelden */
.pk-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.pk-btn svg { width: 1.25rem; height: 1.25rem; }
.pk-first { display: grid; gap: .6rem; margin-bottom: .9rem; text-align: center; }
.pk-first p { margin: 0; }
.pk-list { width: 100%; margin: .5rem 0 .8rem; font-size: .9rem; }
.pk-list th, .pk-list td { padding: .35rem .5rem .35rem 0; text-align: left; }
.login-notice { display: flex; gap: .5rem; align-items: flex-start; margin-bottom: .9rem; }
.login-notice svg { flex: none; width: 1.1rem; height: 1.1rem; margin-top: .1rem; }
.idle-policy { margin-top: .75rem; }
.mfa-policy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.mfa-policy select { width: auto; display: inline-block; margin: 0 .3rem; }
.mfa-policy label { display: inline-flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .2rem; margin: 0; }

/* NIS2 */
.nis-result .badge { font-size: 1rem; padding: .35rem .7rem; }
.nis-free { border-left: 4px solid var(--ok); }
.nis-reasons { margin: .4rem 0 .6rem 1.1rem; }
.nis-bar { grid-template-columns: minmax(10rem, 16rem) 1fr 3rem; margin: .35rem 0; }
@media (max-width: 640px) { .nis-bar { grid-template-columns: 1fr 4rem 2.6rem; } }
.nis-urgent { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.nis-urgent span { flex: 1; min-width: 14rem; }
.nis-deadlines { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.nis-deadline { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; border-left-width: 5px; }
.nis-deadline.red { border-left-color: var(--danger); } .nis-deadline.yellow { border-left-color: var(--warn); } .nis-deadline.green { border-left-color: var(--ok); }
.nis-deadline .when { font-size: 1.15rem; font-weight: 600; }
.nis-report { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; max-height: 22rem; overflow: auto; }
.nis-rep { width: 100%; border-collapse: collapse; margin-bottom: .6rem; } .nis-rep td { border-bottom: 1px solid var(--line); padding: .35rem .4rem; vertical-align: top; }
.kv th { text-align: left; font-weight: 600; padding: .3rem .8rem .3rem 0; width: 16rem; vertical-align: top; } .kv td { padding: .3rem 0; }
@media print { .nis-print { border: 0; box-shadow: none; padding: 0; } .nis-print h4 { break-after: avoid; } .nis-rep tr { break-inside: avoid; } }
a.kpi-card { display: block; color: inherit; text-decoration: none; } a.kpi-card:hover { border-color: var(--primary); }
/* NIS2-Maßnahmenkatalog: eine Tabelle, feste Spalten, Bereiche als Zwischenzeilen */
.nis-catalog { table-layout: fixed; width: 100%; min-width: 880px; }
.nis-catalog col.c-key { width: 3.6rem; } .nis-catalog col.c-status { width: 9rem; } .nis-catalog col.c-resp { width: 10rem; }
.nis-catalog col.c-evidence { width: 28%; } .nis-catalog col.c-date { width: 7.5rem; }
.nis-catalog td { vertical-align: top; overflow-wrap: anywhere; }
.nis-catalog tr.nis-area td { background: var(--surface-2); padding-top: .8rem; padding-bottom: .8rem; border-top: 1px solid var(--line); }
.nis-area-head { display: flex; align-items: center; gap: .8rem; }
.nis-area-head .nis-area-bar { width: 7rem; flex: none; height: .5rem; }

/* Betriebsanweisungen: Erstellen aus der Evaluierung bzw. am Gefahrstoff; Abschnittsköpfe farbig je Art
   (Arbeitsmittel/Tätigkeit blau, Gefahrstoff orange, biologische Arbeitsstoffe grün) */
.ba-topics { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-bottom: .6rem; }
.ba-mode { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .9rem .7rem; margin: 0 0 .8rem; display: grid; gap: .35rem; }
.ba-mode legend { font-weight: 600; font-size: .85rem; padding: 0 .3rem; }
.ba-subst { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; gap: .3rem; }
.ba-make { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
.ba-doc { --ba: #1d4ed8; }
.ba-doc.ba-gefahrstoff { --ba: #ea580c; }
.ba-doc.ba-bio { --ba: #15803d; }
.ba-doc h2 { background: var(--ba); color: #fff; padding: .3rem .7rem; border-radius: 4px; font-size: 1rem; margin-top: 1.2rem; }
.ba-doc h3 { color: var(--ba); }
@media print { .ba-doc h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.ba-doc.ba-gefahrstoff.ba-rot { --ba: #dc2626; }
.ba-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ba-sw { display: inline-block; width: 1.4rem; height: .8rem; border-radius: 3px; vertical-align: middle; }
.ba-sw[data-c="blau"] { background: #1d4ed8; } .ba-sw[data-c="orange"] { background: #ea580c; } .ba-sw[data-c="rot"] { background: #dc2626; } .ba-sw[data-c="gruen"] { background: #15803d; }

/* Testphase: Hinweis auf allen Seiten, Testvereinbarung */
.trial-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; margin-bottom: 1rem; border-radius: var(--radius-sm); background: var(--yellow-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: .9rem; }
.trial-bar > .i { color: var(--warn); flex: none; }
.trial-terms h2 { font-size: 1rem; margin-top: 1.1rem; }
.trial-terms ol { padding-left: 1.4rem; display: grid; gap: .35rem; }
/* Eskalation (Verwaltung → E-Mail) */
.esc-form input[type=number] { max-width: 8rem; }
.esc-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .1rem .8rem; max-height: 14rem; overflow: auto; margin-top: .4rem; }
/* Anmeldung mit Microsoft */
.ms-btn svg { vertical-align: -2px; margin-right: .3rem; background: #fff; border-radius: 2px; padding: 1px; }
.sso-login { display: grid; gap: .5rem; } .sso-login p { margin: 0; text-align: center; }
.sso-card h2 svg { vertical-align: -2px; } .sso-steps { padding-left: 1.2rem; margin: .5rem 0 0; } .sso-steps li { margin-bottom: .7rem; }

/* Befähigungsausweis (badge.js): Ansicht nach dem Scan, Karte in Benutzer und Mein Konto */
.badge-photo { width: 96px; height: 128px; object-fit: cover; border-radius: 10px; background: var(--surface-2); flex: none; }
.badge-nophoto { display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; color: var(--muted); }
.badge-person { display: flex; gap: 1rem; align-items: center; }
.badge-person h2 { margin: 0 0 .2rem; font-size: 1.35rem; }
.badge-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.badge-list li { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border-radius: 10px; border: 1px solid var(--line); }
.badge-list li.ok { background: color-mix(in srgb, var(--ok, #16a34a) 9%, transparent); border-color: color-mix(in srgb, var(--ok, #16a34a) 35%, transparent); }
.badge-list li.expired { background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.badge-list li.ok .badge-dot { color: var(--ok, #16a34a); }
.badge-list li.expired .badge-dot { color: var(--danger); }
.badge-dot svg { width: 22px; height: 22px; }
.badge-invalid { border-color: var(--danger); }
.badge-invalid h2 { color: var(--danger); display: flex; gap: .4rem; align-items: center; }
.badge-admin-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.badge-admin-row > div:first-of-type { flex: 1; min-width: 220px; }
.badge-admin-qr { width: 120px; height: 120px; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.badge-admin-photo { display: grid; gap: .35rem; justify-items: center; text-align: center; max-width: 150px; }
.badge-photo-form label.btn { cursor: pointer; }

/* Online-Vertrag (routes/contract.js) */
.contract-done h2 { color: var(--ok); display: flex; gap: .4rem; align-items: center; }
.trial-bar { flex-wrap: wrap; }
.trial-bar > span { flex: 1 1 14rem; }
.trial-bar .btn { white-space: normal; text-align: left; }
.contract-prices { width: 100%; }
.contract-prices td:last-child, .contract-prices th:last-child { text-align: right; }
.contract-docs .btn { white-space: normal; text-align: left; max-width: 100%; }

/* Rechnungen (Plattform, invoices.js) */
.inv-draft { border: 1px solid var(--line); border-radius: 10px; padding: .8rem; margin-top: .9rem; }
.inv-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.inv-lines input { width: 100%; min-width: 6rem; }
.inv-run { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.inv-run label { font-weight: 600; margin: 0; }
.inv-run input { width: auto; }
.inv-run .btn { align-self: stretch; }

/* Offline-Modus (public/offline.js, views/offline.ejs) */
.offline-pill { position: fixed; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; background: var(--warn); color: #fff; padding: .45rem .8rem; border-radius: 999px; font-size: .85rem; box-shadow: var(--shadow-sm); text-decoration: none; max-width: calc(100vw - 24px); }
@media (min-width: 900px) { .offline-pill { bottom: 16px; } }
.offline-list, .offline-links { margin: .3rem 0; padding-left: 1.1rem; }
.offline-list li { margin: .3rem 0; }
.offline-list li button { margin-left: .5rem; color: var(--danger); }
.offline-saved { border-color: var(--ok); }
.offline-saved h2 { color: var(--ok); display: flex; gap: .4rem; align-items: center; }
.trial-bar.contract-bar { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.trial-bar.contract-bar > .i { color: var(--primary); }

/* Hilfe → Support & Service (support.js) */
.support-cards { align-items: start; }
.support-cards .card { margin-bottom: 0; }
.support-left { font-size: 1.05rem; }
.support-current td { font-weight: 600; }
.support-bar { display: inline-block; width: 4.5rem; height: .5rem; border-radius: 1rem; background: var(--line); vertical-align: middle; overflow: hidden; }
.support-bar i { display: block; height: 100%; background: var(--accent); }
.support-choices { border: 0; padding: 0; margin: 0 0 .8rem; display: grid; gap: .5rem; }
.support-choice { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.support-choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.support-choice > span { display: flex; flex-direction: column; gap: .15rem; }
.support-choice input[type=radio] { width: auto; flex: none; margin: .2rem 0 0; }

/* ---------- Produktprüfung (productcheck) ---------- */
.form-grid { display: grid; gap: .9rem; }
.grid4 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 760px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.qc-bad { color: var(--danger); font-weight: 600; }
.qc-progress { height: 8px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; margin: .5rem 0 .3rem; max-width: 520px; }
.qc-progress span { display: block; height: 100%; background: var(--ok); }
/* Phasen der Prüfung: eine Reihe gleich großer Kacheln (bis 5 nebeneinander), Inhalt immer an derselben Stelle */
.qc-phases { display: grid; grid-template-columns: repeat(var(--qc-n, 4), minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.qc-phase-tile { display: flex; flex-direction: column; gap: .55rem; color: var(--text); border-top: 5px solid var(--qc-color); margin: 0; padding: 1rem; min-width: 0; }
.qc-phase-tile:hover { text-decoration: none; border-color: var(--line-strong); border-top-color: var(--qc-color); }
.qc-tile-top { display: flex; align-items: center; justify-content: space-between; }
.qc-tile-no { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--qc-color); color: #1f2937; }
.qc-tile-go { color: var(--muted); display: inline-flex; }
.qc-phase-tile.is-done .qc-tile-go { color: #059669; }
.qc-tile-title { font-size: .95rem; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
.qc-tile-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.qc-tile-bar span { display: block; height: 100%; background: var(--qc-color); }
.qc-phase-tile.is-done .qc-tile-bar span { background: #059669; }
.qc-tile-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; }
.qc-tile-foot { margin-top: auto; font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) { .qc-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .qc-phases { grid-template-columns: 1fr; } }
.qc-phase { border-left: 8px solid var(--qc-color); }
.qc-phase-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.qc-phase-title { border-bottom: 5px solid var(--qc-color); display: inline-block; padding-bottom: .15rem; }
.qc-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.qc-items td { vertical-align: top; }
.qc-add, .qc-upload { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-top: .8rem; }
.qc-colors { display: flex; gap: .4rem; margin-top: .3rem; }
.qc-color { width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--line-strong); cursor: pointer; display: block; }
.qc-color input { opacity: 0; }
.qc-color:has(input:checked) { outline: 3px solid var(--primary); outline-offset: 2px; }
.qc-kind { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .9rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
form:has(.qc-kind input[value=number]:not(:checked)) .qc-number { display: none; }
.qc-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .7rem; margin: .6rem 0; }
.qc-fig { margin: 0; position: relative; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.qc-fig img, .qc-fig video { display: block; width: 100%; max-height: 320px; object-fit: contain; background: #fff; }
.qc-fig figcaption { font-size: .82rem; padding: .35rem .5rem; }
.qc-fig form { padding: 0 .5rem .5rem; }
.qc-fig.qc-gut { border-color: var(--ok); }
.qc-fig.qc-falsch { border-color: var(--danger); }
.qc-verdict { position: absolute; top: .4rem; left: .4rem; display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--ok); }
.qc-falsch .qc-verdict { background: var(--danger); }
.qc-verdict svg.i { width: 14px; height: 14px; }
.qc-nav { margin-bottom: 1rem; }
.qc-item { border-left: 7px solid var(--line-strong); transition: border-color .15s, opacity .15s; scroll-margin-top: 90px; }
.qc-item.qc-ok { border-left-color: var(--ok); } .qc-item.qc-nok { border-left-color: var(--danger); } .qc-item.qc-na { border-left-color: var(--muted); border-left-style: dashed; }
.qc-item.qc-busy { opacity: .6; } .qc-item.qc-err { outline: 2px solid var(--danger); }
.qc-item-head { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: start; }
.qc-no { font-weight: 700; background: var(--grey-bg); border-radius: 8px; padding: .25rem .5rem; font-variant-numeric: tabular-nums; }
.qc-text { font-weight: 500; font-size: 1.02rem; }
.qc-text2 { color: var(--muted); font-size: .9rem; font-style: italic; margin-top: .15rem; }
.qc-state { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.qc-ok .qc-state { color: var(--ok); } .qc-nok .qc-state { color: var(--danger); } .qc-na .qc-state { color: var(--muted); }
.qc-howto { margin: .6rem 0 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem .7rem; background: var(--surface-2); }
.qc-howto summary { cursor: pointer; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: .4rem; min-height: 36px; }
.qc-pre { white-space: pre-line; margin: .4rem 0; }
.qc-form fieldset { border: 0; padding: 0; margin: .8rem 0 0; min-width: 0; display: grid; gap: .7rem; }
.qc-seg { max-width: 560px; }
.qc-seg span { min-height: 52px; font-size: 1rem; }
.qc-value { max-width: 320px; }
.qc-input { display: flex; align-items: center; gap: .4rem; }
.qc-input input { font-size: 1.25rem; font-weight: 600; max-width: 10rem; }
.qc-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem .9rem; }
.qc-subs label { min-height: 40px; }
.qc-subs input { width: 22px; height: 22px; }
.qc-extra { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.qc-photo-btn { cursor: pointer; }
.qc-photos { display: flex; gap: .4rem; flex-wrap: wrap; }
.qc-thumb { position: relative; }
.qc-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.qc-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.qc-note { flex: 1; min-width: 14rem; }
.qc-note textarea { min-height: 2.4rem; }
.qc-by { margin-top: .4rem; }
.qc-check2 { margin-top: .5rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qc-dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.qc-dl dt { color: var(--muted); }
.qc-dl dd { margin: 0; }
/* Produktprüfung: Sprache der Prüftexte, Protokollsprache, Übersetzungen im Editor */
.qc-lang { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.qc-lang .i { margin: 0 .3rem 0 .45rem; color: var(--muted); }
.qc-lang a { padding: .3rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 2.4rem; text-align: center; }
.qc-lang a:hover { text-decoration: none; color: var(--text); }
.qc-lang a.active { background: var(--text); color: var(--surface); }
.qc-pdf { display: inline-flex; gap: 0; }
.qc-pdf select { width: auto; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.qc-pdf .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.qc-tr { border: 1px dashed var(--line-strong); border-radius: 10px; padding: .5rem .8rem; }
.qc-tr > summary { cursor: pointer; font-weight: 600; }
.qc-tr fieldset { border: 0; padding: 0; margin: .5rem 0 0; display: grid; gap: .5rem; }
.qc-tr legend { font-weight: 600; margin-bottom: .2rem; }
.qc-cap { margin: .3rem 0; }
.qc-cap form { margin-top: .3rem; }
/* Produktprüfung Etappe 2/3: Hinweise, Messmittel, Maßnahme/Meldung, Auswertung */
.hintbar.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.hintbar.warn > .i { color: var(--warn); }
.qc-gauge select { max-width: 100%; }
.qc-warn { display: flex; gap: .4rem; align-items: center; color: var(--warn); margin: .3rem 0; }
.qc-follow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-top: .6rem; }
.qc-follow .badge { white-space: normal; }
.qc-mini > summary { list-style: none; }
.qc-mini > summary::-webkit-details-marker { display: none; }
.qc-mini[open] { flex: 1 1 100%; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.qc-mini form { margin-top: .5rem; }
.qc-inline { display: inline; }
.qc-bar { display: flex; }
.qc-bar span { height: 100%; }
.qc-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.qc-key.b5 { background: var(--ok); } .qc-key.b3 { background: var(--warn); }
/* Produktprüfung: Standort (GPS) und Lageskizze */
.qc-pos { display: flex; gap: .35rem; align-items: center; color: var(--muted); margin: .3rem 0; }
.qc-sketch { width: 100%; height: auto; max-height: 420px; display: block; }
.qc-sk-bg { fill: var(--surface-2); stroke: var(--line); }
.qc-sk-n path { fill: var(--muted); } .qc-sk-n text, .qc-sk-scale text { fill: var(--muted); font-size: 12px; font-weight: 600; }
.qc-sk-scale line { stroke: var(--muted); stroke-width: 3; }
.qc-sk-pt circle { stroke: var(--surface); stroke-width: 2; } .qc-sk-pt text { fill: var(--text); font-size: 12px; font-weight: 600; }
.qc-sk-nok circle { fill: var(--danger); } .qc-sk-ok circle { fill: var(--ok); } .qc-sk-na circle, .qc-sk-open circle { fill: var(--muted); }
.qc-sk-pt:hover circle { stroke: var(--text); }
.qc-key.qc-sk-key-nok { background: var(--danger); } .qc-key.qc-sk-key-ok { background: var(--ok); }
/* Produktprüfung: Luftbild / Lageplan mit Punkten, Markieren am Tablet */
.btn-link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
.qc-map { margin: 0 0 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.qc-map-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.qc-map-head > span:first-child { display: flex; flex-direction: column; gap: .1rem; }
.qc-zoom { display: inline-flex; gap: .3rem; }
.qc-map-view { overflow: auto; max-height: 70vh; background: var(--surface-2); -webkit-overflow-scrolling: touch; }
.qc-map-inner { position: relative; width: 100%; }
.qc-map-inner img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.qc-pin { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); display: block; text-decoration: none; }
.qc-pin > span { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; white-space: nowrap; }
.qc-pin-nok { background: var(--danger); width: 26px; height: 26px; z-index: 2; } .qc-pin-ok { background: var(--ok); } .qc-pin-na { background: var(--muted); }
.qc-pin:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 1px 4px rgba(0,0,0,.45); text-decoration: none; }
.qc-pin-other { opacity: .55; pointer-events: auto; }
.qc-pin-cur { background: var(--primary); width: 28px; height: 28px; z-index: 3; animation: qcpulse 1.2s ease-out 1; }
.qc-pin-cur > span { display: none; }
@keyframes qcpulse { from { box-shadow: 0 0 0 0 rgba(37,99,235,.6); } to { box-shadow: 0 0 0 18px rgba(37,99,235,0); } }
.qc-map-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .5rem .8rem; flex-wrap: wrap; }
.qc-markinfo { display: flex; gap: .35rem; align-items: center; color: var(--muted); margin: .3rem 0; }
.qc-mark-dlg { width: min(1100px, 96vw); max-height: 94vh; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; background: var(--surface); color: var(--text); }
.qc-mark-dlg::backdrop { background: rgba(15,23,42,.55); }
.qc-mark-head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.qc-mark-view { max-height: 72vh; cursor: crosshair; }
/* Abgleich mit Microsoft 365 */
.code-block { white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; margin: .4rem 0; }
.msync-map td select { width: 100%; }
/* Datenschutz: Beschreibungslisten und Formulare in einer Zeile */
.dl { display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; }
@media (max-width: 640px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: .4rem; } }
form.inline { display: inline; }
.ds-risk td { vertical-align: top; }
.pledge-text { white-space: pre-wrap; line-height: 1.6; }

/* Barrierefreiheit (WCAG 2.1 AA) */
/* Links im Fließtext nicht nur an der Farbe erkennbar */
main p a:not(.btn):not(.badge), main li a:not(.btn):not(.badge):not(.tab), main dd a:not(.btn), .help-article a:not(.btn), .flash a,
main .muted a:not([class]), main .small a:not([class]), main div > a:not([class]):not(table a):not(h1 a):not(h2 a):not(h3 a) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
/* Inhalte dürfen breite Tabellen nicht über die Seitenbreite hinausdrücken */
.help-layout > *, .doc-layout > *, .hb-layout > * { min-width: 0; }
.help-article pre, .help-article .table-wrap { max-width: 100%; overflow-x: auto; }
/* Sehr schmale Bildschirme (320 px, 400 % Zoom): Kopfzeile kompakt */
@media (max-width: 420px) {
  .topbar { gap: .4rem; padding: 0 .6rem; }
  .topbar-right { gap: .3rem; }
  .topbar .brand > span, .topbar .brand-name { display: none; }
  .topbar .who { padding: 0; }
  .list li { flex-wrap: wrap; }
  .list li > :last-child { flex-shrink: 1; }
  .wiz-steps { flex-wrap: wrap; }
  .wiz-steps li { flex: 1 1 40%; }
}
.auto-hint { align-self: center; white-space: nowrap; }
/* Hinweis vor der automatischen Abmeldung */
dialog.idle-dlg { max-width: 440px; width: calc(100% - 2rem); border: 1px solid var(--line); color: var(--text); padding: 1.4rem 1.5rem; }
dialog.idle-dlg::backdrop { background: rgb(15 23 42 / .45); }
dialog.idle-dlg h2 { margin-bottom: .5rem; }
dialog.idle-dlg .idle-left { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .4rem 0 1rem; }

/* Nicht zutreffende Zeilen (z. B. Rechtsregister): gedämpft, aber lesbar */
tr.na-row td, tr.na-row td * { color: var(--muted); }
tr.na-row td a { color: var(--primary); }
/* Links in Tabellenzellen mit weiterem Inhalt und in Editor-Inhalten unterstreichen */
main td a:not([class]):not(:only-child), .ql-editor a, .rich a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.ql-snow .ql-editor a, .ql-editor a { color: var(--primary); }
.filters input[type=checkbox], .filters input[type=radio] { flex: none; min-width: 0; }
/* Lange Wörter (z. B. „Aerosolpackungslagerungsverordnung“) umbrechen statt die Seite zu verbreitern */
main { overflow-wrap: break-word; }
/* Hauptüberschriften nie automatisch trennen (Safari trennte sonst z. B. „Ener-gy“ in Deutsch/Englisch): Umbruch nur zwischen Wörtern,
   gleichmäßig auf die Zeilen verteilt; nur ein Wort, das gar nicht passt, wird umbrochen */
main h1 { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: break-word; text-wrap: balance; }
/* Zwischenüberschriften und Hilfetexte: Trennung nur bei langen Wörtern (mind. 5 Buchstaben vor und nach der Trennstelle) */
main h2, main h3, .help-article { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; hyphenate-limit-chars: 12 5 5; -webkit-hyphenate-limit-before: 5; -webkit-hyphenate-limit-after: 5; }
.grid2 > *, .grid3 > *, .cards > * { min-width: 0; }
@media (max-width: 420px) {
  .btn { white-space: normal; text-align: left; }
  .badge { white-space: normal; }
  input[type=file] { max-width: 100%; min-width: 0; }
  .page-head > * { min-width: 0; }
}
fieldset { min-width: 0; }
/* Datumsfelder (Safari auf iPad/iPhone): nicht breiter als die Spalte, Datum linksbündig, gleiche Höhe wie andere Felder */
input[type=date], input[type=time], input[type=datetime-local], input[type=month], input[type=week] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: calc(1.55em + 1.16rem + 2px); min-height: 0; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input::-webkit-datetime-edit { padding: 0; }
form label > input, form label > select, form label > textarea { min-width: 0; max-width: 100%; }
/* Deutlicher Fokusrahmen auch in Formularfeldern (Tastatur) */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline-offset: 2px; }
.grid2 > h2.span2 { margin-bottom: 0; } .grid2 > p.span2 { margin: 0; }
/* Unternehmensgruppe: Auswahl der Gesellschaft */
.entity-chips { align-items: center; }
.entity-chips > span { display: inline-flex; align-items: center; gap: .3rem; margin-right: .2rem; }
.ent-table td .badge { white-space: normal; }

/* Auswahl der Gesellschaft in der Kopfleiste (Unternehmensgruppe) */
/* Eigene Farben statt der Kopfleiste: mit Firmenfarbe ist deren Schrift weiß (sonst weiß auf weiß, auch in der aufgeklappten Liste) */
.entity-scope { display: flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 8px; padding: 0 .35rem; background: var(--surface, #fff); color: var(--text); }
.entity-scope select { border: 0; background: transparent; max-width: 14rem; padding: .35rem .2rem; font: inherit; font-size: .85rem; color: var(--text); }
.entity-scope option { background: var(--surface, #fff); color: var(--text); }
.entity-scope.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
@media (max-width: 640px) { .entity-scope select { max-width: 8.5rem; } }
.ent-tags { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .2rem .8rem; margin-bottom: .6rem; }
/* Hallenpläne (Evaluierung) */
.fp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.fp-tile { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: inherit; }
.fp-tile img { width: 100%; height: 9rem; object-fit: cover; border-radius: 6px; background: var(--grey-bg); margin-bottom: .4rem; }
.fp-plan { position: relative; width: 100%; background: var(--grey-bg); border-radius: 6px; overflow: hidden; }
.fp-plan img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; user-select: none; -webkit-user-drag: none; }
.fp-area { position: absolute; border: 2px solid; border-radius: 4px; display: flex; align-items: flex-start; overflow: hidden; text-decoration: none; font-size: .75rem; }
.fp-area span { background: rgba(255,255,255,.88); color: #111; padding: 0 .25rem; border-radius: 3px; margin: 2px; max-width: calc(100% - 4px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-red { border-color: #dc2626; background: rgba(220,38,38,.22); }
.fp-yellow { border-color: #d97706; background: rgba(217,119,6,.22); }
.fp-green { border-color: #16a34a; background: rgba(22,163,74,.2); }
.fp-grey { border-color: #64748b; background: rgba(100,116,139,.18); }
.fp-overdue { outline: 3px dashed #dc2626; outline-offset: 2px; }
.fp-other { border-color: #94a3b8; background: rgba(148,163,184,.15); pointer-events: none; }
.fp-own { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 25%, transparent); cursor: pointer; }
.fp-ghost { pointer-events: none; }
.fp-draw { cursor: crosshair; }
.fp-legend .fp-key { display: inline-block; width: .9rem; height: .9rem; border: 2px solid; border-radius: 3px; vertical-align: middle; margin: 0 .2rem 0 .6rem; }
.fp-legend .fp-key.fp-overdue { border-color: transparent; outline-offset: -1px; }

/* ASA: externes Protokoll prüfen */
.asa-imp-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem 1rem; margin: 0 0 .9rem; min-width: 0; }
.asa-imp-item legend { font-weight: 600; padding: 0 .4rem; }
.asa-imp-item.muted .grid2 { opacity: .45; }

/* Organigramm: Beauftragte (aus dem Bereich Beauftragte, auch extern ohne Stelle) */
.onode.expert, .onode-mini.role-expert { --rc: #0ea5e9; }
.onode.expert { background: color-mix(in srgb, #0ea5e9 6%, var(--surface)); }
div.onode.expert:hover { transform: none; }
.onode.expert .otitle { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- Organigramm (neu): Konzernbaum, je Gesellschaft oberste Stelle, Stab, Bereiche als Spalten ---------- */
.org-toolbar { align-items: flex-end; }
.org-where { font-size: .95rem; }
.org-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-left: auto; }
.org-search { display: flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 0 .6rem; min-width: 260px; }
.org-search input { border: 0; padding: .5rem 0; min-width: 0; flex: 1; background: none; box-shadow: none; }
.org-search input:focus { box-shadow: none; }
.org-search .i { color: var(--muted); width: 1rem; height: 1rem; flex: none; }
.org-next { margin-top: 1.25rem; }
.org-sec { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; position: sticky; left: 0; }
.org-zoom { width: max-content; min-width: 100%; }
.ocw, .og { --c: var(--line-strong); display: flex; flex-direction: column; align-items: center; width: max-content; min-width: 100%; margin: 0 auto; }
.oc-top { display: flex; justify-content: center; }
.oc-stem { width: 2px; height: 1.4rem; background: var(--c); flex: none; }
.oc-staff { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 1100px; padding: 1.1rem .9rem .9rem; border: 1.5px dashed var(--c); border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.oc-staff-l { position: absolute; top: -.7rem; left: 1rem; padding: 0 .45rem; background: var(--surface); color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.oc-staff .oc-card { width: 232px; }
.oc-cols { display: flex; align-items: flex-start; justify-content: center; }
.oc-col { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 1.4rem .4rem 0; width: 232px; flex: none; }
.og .oc-col { width: auto; padding-left: .7rem; padding-right: .7rem; align-items: center; }
.oc-col::before { content: ''; position: absolute; top: 0; left: 0; right: 0; border-top: 2px solid var(--c); }
.oc-col:first-child::before { left: 50%; } .oc-col:last-child::before { right: 50%; }
.oc-cols.one > .oc-col::before { display: none; }
.oc-cols.many { position: relative; flex-wrap: wrap; gap: 1.2rem .4rem; max-width: calc(4 * 232px + 2.2rem); padding: 1.3rem .9rem 1rem; border: 1.5px dashed var(--c); border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.oc-cols.many > .oc-col { padding-top: 0; }
.oc-cols.many > .oc-col::before, .oc-cols.many > .oc-col::after { display: none; }
.oc-col::after { content: ''; position: absolute; top: 0; left: calc(50% - 1px); width: 2px; height: 1.4rem; background: var(--c); }
.oc-rows { display: flex; flex-direction: column; gap: .45rem; margin: .55rem 0 0 .9rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.oc-row { margin-left: calc(var(--d, 0) * .85rem); }
.oc-card { position: relative; display: flex; flex-direction: column; gap: .15rem; padding: .55rem .75rem .55rem .85rem; border: 1px solid var(--line); border-left: 4px solid var(--rc, var(--line-strong));
  border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); text-align: left; min-width: 0; transition: box-shadow .12s, border-color .12s, opacity .15s; }
a.oc-card:hover { text-decoration: none; box-shadow: var(--shadow); border-color: var(--line-strong); border-left-color: var(--rc, var(--line-strong)); }
.oc-card .oc-t { font-weight: 600; font-size: .9rem; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.oc-card .oc-p { font-size: .86rem; line-height: 1.3; }
.oc-card .oc-s { font-size: .78rem; color: var(--muted); }
.oc-card .oc-vac { color: var(--muted); font-style: italic; }
.oc-card .oc-tag { align-self: flex-start; margin-top: .15rem; font-size: .7rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 .45rem; }
.oc-card.vacant { background: var(--surface-2); border-style: dashed; border-left-style: solid; box-shadow: none; }
.oc-card.vacant .oc-t { color: color-mix(in srgb, var(--text) 75%, var(--muted)); }
.oc-card.staff { border-style: dashed; border-left-style: solid; }
.oc-card.role-admin { --rc: #8b5cf6; } .oc-card.role-qhse { --rc: #10b981; } .oc-card.role-fuehrung { --rc: #3b82f6; } .oc-card.role-mitarbeiter { --rc: #94a3b8; }
.oc-card.expert { --rc: #0ea5e9; background: color-mix(in srgb, #0ea5e9 6%, var(--surface)); }
.oc-card.oc-root { width: 300px; padding: .8rem 1rem; text-align: center; align-items: center; border-left-width: 1px; border-top: 5px solid var(--rc, var(--line-strong)); }
.oc-card.oc-root .oc-t { font-size: 1.02rem; } .oc-card.oc-root .oc-p { font-size: .95rem; }
.oc-card.oc-head { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--rc, var(--line-strong)) 7%, var(--surface)); }
.oc-card.oc-head .oc-t { font-size: .95rem; }
.oc-loose { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.oc-loose h3 { font-size: .9rem; color: var(--muted); margin: 0 0 .6rem; }
.oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem; }
.searching [data-q]:not(.hit) { opacity: .3; }
[data-q].hit { outline: 3px solid #f59e0b; outline-offset: 2px; opacity: 1; }
.og-wrap { padding: 2rem 1rem; }
.og-node { display: flex; flex-direction: column; align-items: center; }
.og-card { display: flex; flex-direction: column; gap: .55rem; width: 100%; min-width: 280px; padding: 1rem 1.2rem; border: 1px solid var(--line); border-top: 5px solid var(--primary); border-radius: 14px;
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
a.og-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); border-color: var(--line-strong); border-top-color: var(--primary); }
.og-name { display: flex; gap: .45rem; align-items: center; font-weight: 700; font-size: 1.02rem; line-height: 1.25; white-space: nowrap; }
.og-lead .muted { white-space: nowrap; }
/* Konzernbaum: Töchter einer Reihe gleich breit (so breit wie der längste Name) */
.og .oc-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; justify-content: center; align-items: stretch; }
.og .oc-col > .og-node { width: 100%; }
.og-node { min-width: 280px; }
.og > .og-node > .og-card { width: auto; }
.og-orphans { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.og-orphans h3 { font-size: .9rem; color: var(--muted); margin: 0 0 .8rem; }
.og-orph-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.badge.orange { background: color-mix(in srgb, #f97316 16%, var(--surface)); color: #c2410c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .badge.orange { color: #fdba74; } }
:root[data-theme=dark] .badge.orange { color: #fdba74; }
.og-name .i { color: var(--primary); flex: none; }
.og-lead { font-size: .9rem; }
.og-stats { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .84rem; color: var(--muted); }
.og-stats b { color: var(--text); }
.og-stats .og-vac b { color: #b45309; }
.og-open { font-size: .85rem; font-weight: 600; color: var(--primary); }
@media (max-width: 900px) {
  .org-wrap:not(.og-wrap) { display: none; } .org-list { display: block; }
  .og-wrap { padding: 1rem; } .og, .og-node { width: 100%; min-width: 0; } .og .oc-cols { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
  .og-card { min-width: 0; } .og-name, .og-lead .muted { white-space: normal; }
  .og .oc-col { padding: 1rem 0 0; } .og .oc-col::before { display: none; } .og-card { width: 100%; }
  .org-search { min-width: 0; width: 100%; } .org-tools { width: 100%; }
}
@media print {
  .org-wrap { overflow: visible; background: none; box-shadow: none; } .org-zoom { zoom: 1 !important; }
  .org-next { break-before: page; } .org-list { display: none !important; } .oc-card, .og-card { box-shadow: none; } .searching [data-q] { opacity: 1; } [data-q].hit { outline: 0; }
}
.org-list .ol-line { display: inline-block; border-radius: 6px; padding: 0 .2rem; }
.org-list a { text-decoration: none; }
/* Konzernbaum: Kacheln ohne Töchter in einer Reihe gleich hoch */
.og .oc-col > .og-node { flex: 1; }
.og .oc-col > .og-node > .og-card:only-child { flex: 1; }
/* Gesellschaft in Gründung: Kachel orange statt Kennzeichen (Schrift bleibt in einer Linie) */
.og-card.founding { border-top-color: #f97316; background: color-mix(in srgb, #f97316 7%, var(--surface)); }
a.og-card.founding:hover { border-top-color: #f97316; }
.og-legend { text-align: center; margin: 1.2rem 0 0; }
.og-swatch { display: inline-block; width: 1.4rem; height: .7rem; border-radius: 3px; border-top: 3px solid #f97316; background: color-mix(in srgb, #f97316 12%, var(--surface)); vertical-align: -1px; }
/* Listen mit Ampelpunkt vorne: Punkt in eigener Spalte, umbrechender Text bleibt bündig daneben */
.list li > span:has(> .dot:first-child) { position: relative; padding-left: 1.15rem; }
.list li > span > .dot:first-child { position: absolute; left: .1rem; top: .45em; margin: 0; }

/* Benutzerformular: Häkchen „Zugang zum Portal“ */
.access-box { padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius, 8px); background: var(--surface-2, transparent); }
.access-box p { margin: .25rem 0 0; }

/* Auswahllisten mit Suchfeld (selectsearch.js) */
.ss { position: relative; display: block; }
.ss-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }
.ss-input { width: 100%; }
.ss-input:not(:focus) { text-overflow: ellipsis; }
.ss:not(.ss-multi) .ss-input { padding-right: 1.9rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .65rem center; }
.ss-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 60; margin: 0; padding: .25rem 0; list-style: none; max-height: 16rem; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.ss-list li { padding: .45rem .75rem; cursor: pointer; font-weight: 400; line-height: 1.3; }
.ss-list li.on, .ss-list li:hover { background: var(--surface-2); color: var(--text); }
.ss-list li.on { box-shadow: inset 3px 0 0 var(--accent, #2563eb); }
.ss-list li[aria-selected="true"] { font-weight: 600; }
.ss-list li.ss-none { color: var(--muted); cursor: default; }
.ss-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .35rem; }
.ss-chips:empty { display: none; }
.ss-chip { display: inline-flex; align-items: center; gap: .15rem; padding: .15rem .25rem .15rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .88em; font-weight: 500; }
.ss-x { border: 0; background: none; cursor: pointer; font-size: 1.05rem; line-height: 1; padding: .1rem .35rem; border-radius: 999px; color: var(--muted); }
.ss-x:hover, .ss-x:focus-visible { background: var(--line); color: var(--text); }

/* Stellen kopieren */
.copy-scope { display: grid; gap: .35rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.copy-list { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .55rem; }
.copy-list li { padding-left: calc(var(--d, 0) * 1.6rem); display: grid; gap: .15rem; }
.copy-list li input { max-width: 36rem; }
@media (max-width: 640px) { .copy-list li { padding-left: calc(var(--d, 0) * .8rem); } }
.copy-src { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 0 0 .8rem; }
.copy-src div { display: grid; gap: .05rem; }
.copy-src dt { color: var(--muted); }
.copy-src dd { margin: 0; font-weight: 500; }
.copy-warn { flex-wrap: nowrap; align-items: flex-start; }
.copy-warn > div { flex: 1; min-width: 0; }
.copy-warn ul { margin: .35rem 0 0; padding-left: 1.2rem; }
/* Matrizen (Schulungen, Qualifikationen): Kopfzeile und Namensspalte bleiben beim Scrollen stehen, Spaltennamen schräg und vollständig */
.card.table-wrap.mx-wrap { max-height: calc(100vh - var(--top, 60px) - 2rem); overflow: auto; overscroll-behavior: contain; }
.tmatrix.mx { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.tmatrix.mx thead { position: sticky; top: 0; z-index: 3; }
.tmatrix.mx thead th { background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.tmatrix.mx th.mx-col { height: 11.5rem; width: 5.6rem; min-width: 5.6rem; max-width: 5.6rem; padding: 0; vertical-align: bottom; text-transform: none; letter-spacing: 0; }
.tmatrix.mx .mx-hd { position: relative; height: 11.5rem; }
.tmatrix.mx .mx-hd > * { position: absolute; left: calc(50% - .3rem); bottom: .5rem; z-index: 1; transform-origin: 0 100%; transform: rotate(-50deg);
  width: 12.5rem; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.2; overflow-wrap: anywhere; }
.tmatrix.mx .mx-hd > a { color: var(--primary); }
.tmatrix.mx th.mx-end, .tmatrix.mx td.mx-end { width: 9rem; min-width: 9rem; padding: 0; background: none; border: 0; }
.tmatrix.mx thead th.mx-end { background: var(--surface); }
.tmatrix.mx .mx-person { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; min-width: 13rem; max-width: 17rem; box-shadow: 1px 0 0 var(--line); }
.tmatrix.mx thead .mx-person { z-index: 4; vertical-align: bottom; }
.tmatrix.mx tbody .mx-person { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.tmatrix.mx .mx-name { display: block; }
.tmatrix.mx .mx-sub { display: block; font-size: .76rem; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmatrix.mx td.c { min-width: 5.6rem; white-space: nowrap; border-left: 1px solid var(--surface); }
.tmatrix.mx tbody tr:hover > * { box-shadow: inset 0 1px 0 var(--primary), inset 0 -1px 0 var(--primary); }
.tmatrix.mx tbody tr:hover > .mx-person { color: var(--primary); }
.tmatrix.mx .mx-on { background-image: linear-gradient(color-mix(in srgb, var(--primary) 9%, transparent), color-mix(in srgb, var(--primary) 9%, transparent)); }
.tmatrix.mx thead .mx-on .mx-hd > * { color: var(--primary); text-decoration: underline; }
@media print { .card.table-wrap.mx-wrap { max-height: none; overflow: visible; } .tmatrix.mx thead, .tmatrix.mx .mx-person { position: static; } .tmatrix.mx .mx-end { display: none; } }
@media (max-width: 640px) { .tmatrix.mx .mx-person { min-width: 9rem; max-width: 10rem; } .tmatrix.mx th.mx-col, .tmatrix.mx .mx-hd { height: 9rem; } }
/* Präsentation am Handy (ohne Vollbild): Hinweis in eigener Zeile, Vollbild-Knopf mit Text */
.pres-fs .fs-on { gap: .35rem; }
@media (max-width: 640px) { .presenter:not(.is-full) .pres-head .small { order: 9; flex-basis: 100%; } .presenter:not(.is-full) .pres-head .pres-page { flex: 1; } }
/* Silbentrennung (wo erlaubt) nur bei langen Wörtern – kurze Wörter wie „Energy“ bleiben ganz (wird vererbt) */
html { hyphenate-limit-chars: 12 5 5; -webkit-hyphenate-limit-before: 5; -webkit-hyphenate-limit-after: 5; }
/* Querformat im Ersatz-Vollbild (iPhone): Seite darf darunter scrollen, damit ein Wisch die Safari-Leiste ausblendet */
body.pres-lock.pres-swipe { overflow: auto; }
body.pres-swipe { min-height: calc(100vh + 240px); }
.pres-land { position: absolute; left: .5rem; right: .5rem; bottom: .5rem; z-index: 3; display: flex; gap: .6rem; align-items: flex-start; background: rgba(17,17,17,.9); color: #f3f4f6; border-radius: 10px; padding: .45rem .7rem; }
.pres-land[hidden] { display: none; }
.pres-land span { flex: 1; }
.pres-land button { color: #f3f4f6; }

/* NIS2: Billigung durch die Geschäftsleitung (Unterschrift im Verlauf, im Nachweisbericht) */
.appr-sig-sm { height: 34px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 4px; }
.appr-sig { height: 70px; max-width: 260px; object-fit: contain; background: #fff; border-bottom: 1px solid var(--line); }
.nis-appr-rep { break-inside: avoid; }
/* Datenschutz: Formular für Betroffenenanfragen (auch eingebettet in die Website des Kunden) */
.dp-public.is-embed { margin-top: 0; }
body.plain:has(.dp-public.is-embed) { background: transparent; }

/* Vorlagenpaket Richtlinien: offene Stellen gelb hervorheben (auch im Dokument, bis sie ersetzt sind) */
.ph-open { background: #fff1a8; color: #5c4600; padding: 0 .2em; border-radius: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .ph-open { background: #5c4a00; color: #fff3c4; } }
:root[data-theme=dark] .ph-open { background: #5c4a00; color: #fff3c4; }
.pol-preview { max-width: 860px; }
