:root {
  --navy-950: #070b16;
  --navy-900: #0b1222;
  --navy-800: #121b31;
  --navy-700: #1c2742;
  --navy-600: #2a3756;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e4e8f0;
  --line-2: #eef1f6;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --brand: #4f7492;
  --brand-600: #3f5f78;
  --brand-50: #eef3f7;
  --brand-100: #d6e2eb;
  --cyan: #06b6d4;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #e11d48;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, 0.35);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --rail-w: 252px;
  --chat-w: 420px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
/* Abgeschnittene Einträge in einzeiligen Feldern mit „…“ kürzen; den vollen Text zeigt der Tooltip (app.js) */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
/* Safari kürzt native Auswahllisten nur hart ab; ohne native Darstellung greift „…“ auch dort. Der Pfeil kommt als
   Hintergrundbild – als Einzeleigenschaften und mit höherer Spezifität, damit ein background-Kurzwert ihn nicht löscht. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; padding-right: 28px;
  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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(90deg, var(--navy-950), var(--navy-900) 60%, #141a3a);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--rail-w) - 16px); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand) 45%, #0891b2);
  box-shadow: 0 6px 18px -4px rgba(79, 116, 146, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { letter-spacing: 0.14em; font-size: 15px; }
.brand-text span { font-size: 11px; color: #94a3b8; }
.topbar .brand-text { flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; }
.topbar .brand { width: auto; min-width: calc(var(--rail-w) - 16px); }
.topbar .brand-text span::before { content: "·"; margin-right: 6px; }
.brand-logo { display: block; height: 44px; width: auto; flex: none; }
.brand-logo.lg { height: 132px; margin-bottom: 20px; }
.wz-title .brand-logo { height: 64px; }

.project-switch { position: relative; }
.project-btn {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px; padding: 6px 12px; color: #e2e8f0;
}
.project-btn:hover { background: rgba(255, 255, 255, 0.09); }
.project-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.project-name { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 16px; height: 16px; color: #94a3b8; }
.topbar-spacer { flex: 1; }

.engine-pill {
  display: flex; align-items: center; gap: 8px;
  height: 36px; font-size: 12px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
}
.engine-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.engine-pill.ai .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2); }
.engine-pill.offline .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }

.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 50;
}
.menu-right { left: auto; right: 16px; top: 50px; }
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px;
}
.menu button:hover { background: var(--bg); }
.menu button.current { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.menu .meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 8px 10px 4px; }

/* ---------- Buttons ---------- */
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.ghost-dark { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.08); color: #cbd5e1; }
.icon-btn.ghost-dark:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 9px 16px; font-weight: 600; border: 1px solid transparent;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 116, 146, 0.7); }
.btn-primary:hover { background: var(--brand-600); }
.btn-light { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.btn-light:hover { background: var(--bg); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-600); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover { background: var(--brand-50); }
.btn-glow {
  width: 100%; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand) 50%, #0891b2);
  box-shadow: 0 10px 24px -10px rgba(79, 116, 146, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-glow:hover { filter: brightness(1.08); }

/* ---------- Layout ---------- */
.layout {
  height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: var(--rail-w) var(--chat-w) 1fr;
  position: relative;
}
.layout.chat-collapsed { grid-template-columns: var(--rail-w) 52px 1fr; }

/* ---------- Rail ---------- */
.rail {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #cbd5e1;
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #7c8aa5; font-weight: 600;
}
.unit-list { list-style: none; margin: 0; padding: 4px 10px; overflow-y: auto; flex: 1; counter-reset: unit; }
.unit-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer; margin-bottom: 2px;
  border: 1px solid transparent;
}
.unit-item:hover { background: rgba(255, 255, 255, 0.05); }
.unit-item.active { background: rgba(79, 116, 146, 0.16); border-color: rgba(79, 116, 146, 0.35); color: #fff; }
.unit-num {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; flex: none;
}
.unit-meta { min-width: 0; flex: 1; }
.unit-meta strong { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.unit-meta small { display: flex; gap: 6px; font-size: 11px; color: #7c8aa5; margin-top: 2px; }
.badge-s { display: inline-flex; align-items: center; gap: 3px; }
.badge-s.ok { color: #34d399; }
.unit-actions { display: none; gap: 2px; }
.unit-item:hover .unit-actions { display: flex; }
.unit-actions button { border: 0; background: none; color: #7c8aa5; padding: 3px; border-radius: 6px; display: grid; }
.unit-actions button:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.unit-actions svg { width: 14px; height: 14px; }
.unit-connector { height: 10px; margin-left: 22px; border-left: 2px dotted rgba(148, 163, 184, 0.25); }
.rail-empty { padding: 14px; margin: 6px; border: 1px dashed rgba(148, 163, 184, 0.25); border-radius: 12px; font-size: 12.5px; color: #7c8aa5; line-height: 1.5; }
.rail-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.rail-hint { font-size: 11.5px; color: #7c8aa5; margin: 10px 2px 0; line-height: 1.45; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-right: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 15px; }
.chat-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.chat-collapsed .chat > :not(.chat-head) { display: none; }
.chat-collapsed .chat-head { padding: 14px 10px; justify-content: center; }
.chat-collapsed .chat-head > div { display: none; }
.chat-collapsed #collapseChat svg { transform: rotate(180deg); }

.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg.new { animation: rise 0.25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .avatar {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--brand);
}
.msg .bubble { min-width: 0; flex: 1; line-height: 1.55; color: var(--ink-2); }
.msg .bubble p { margin: 0 0 8px; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul { margin: 4px 0 8px; padding-left: 18px; }
.msg .bubble code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  flex: none; max-width: 85%; background: var(--brand); color: #fff;
  padding: 9px 13px; border-radius: 14px 14px 4px 14px; box-shadow: 0 4px 12px -6px rgba(79, 116, 146, 0.6);
}
.msg .card {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.card-head strong { font-size: 13px; }
.card-body { padding: 10px 12px; }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel); }

.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; color: var(--ink-2);
}
.chip:hover { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); }

.cat-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 10px 0 6px; }
.cat-title:first-child { margin-top: 0; }
.task-grid { display: flex; flex-direction: column; gap: 4px; }
.task {
  display: flex; align-items: flex-start; gap: 9px; padding: 7px 9px; border-radius: 9px; border: 1px solid transparent;
  cursor: pointer; user-select: none; font-size: 13px; color: var(--ink-2); background: none; text-align: left; width: 100%;
}
.task:hover { background: var(--panel); border-color: var(--line); }
.task .box {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #cbd5e1; flex: none; margin-top: 1px;
  display: grid; place-items: center; background: #fff; transition: all 0.12s;
}
.task .box svg { width: 12px; height: 12px; stroke-width: 3; color: #fff; opacity: 0; }
.task.on { color: var(--ink); }
.task.on .box { background: var(--brand); border-color: var(--brand); }
.task.on .box svg { opacity: 1; }
.task .src { margin-left: auto; font-size: 10.5px; color: var(--brand-600); background: var(--brand-50); border-radius: 6px; padding: 1px 6px; }
.task .del { margin-left: 4px; opacity: 0; color: var(--faint); border: 0; background: none; padding: 0; }
.task:hover .del { opacity: 1; }
.task .del:hover { color: var(--bad); }
.task .del svg { width: 14px; height: 14px; }
.add-task { display: flex; gap: 6px; margin-top: 10px; }
.add-task input {
  flex: 1; border: 1px dashed #cbd5e1; border-radius: 9px; padding: 7px 10px; font-size: 13px; background: #fff;
}
.add-task input:focus { outline: none; border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.counter { font-size: 12px; color: var(--muted); }

.ipo-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ipo-mini .col { border-radius: 9px; padding: 8px 7px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.ipo-mini h5 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.ipo-mini .col.i h5 { color: #0284c7; }
.ipo-mini .col.p h5 { color: var(--brand-600); }
.ipo-mini .col.o h5 { color: #059669; }
.ipo-mini ul { list-style: none; margin: 0; padding: 0; font-size: 12px; }
.ipo-mini li { padding: 4px 0; border-bottom: 1px dashed var(--line-2); line-height: 1.3; font-size: 11.5px; overflow-wrap: anywhere; hyphens: auto; }
.ipo-mini li:last-child { border: 0; }
.ipo-summary { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.reg-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.tag.hoch { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.tag.mittel { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag.niedrig { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.tag.brand { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }

.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.progress-note { font-size: 12px; color: var(--muted); margin-left: 6px; }

.chat-input { border-top: 1px solid var(--line); padding: 10px 14px 14px; background: var(--panel); }
.mode-switch { display: inline-flex; background: var(--bg); border-radius: 9px; padding: 3px; margin-bottom: 8px; }
.mode-switch button { border: 0; background: none; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 7px; color: var(--muted); }
.mode-switch button.on { background: var(--panel); color: var(--brand-600); box-shadow: var(--shadow-sm); }
.input-row { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; background: #fff; transition: box-shadow 0.15s, border-color 0.15s; }
.input-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.input-row textarea { flex: 1; border: 0; resize: none; outline: none; padding: 6px 0; max-height: 140px; line-height: 1.45; background: transparent; }
.send-btn { width: 36px; height: 36px; border-radius: 9px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; }
.send-btn:disabled { background: var(--brand-100); }

/* ---------- Workspace ---------- */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; gap: 4px; padding: 10px 16px 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.tabs button {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 14px 12px;
  font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--brand-600); border-bottom-color: var(--brand); }
.view { flex: 1; min-height: 0; position: relative; overflow: auto; }
#view-workflow { overflow: hidden; display: flex; flex-direction: column; }

.canvas-toolbar {
  position: absolute; top: 14px; left: 16px; right: 16px; z-index: 5;
  display: flex; gap: 10px; align-items: center; pointer-events: none;
}
.canvas-toolbar > * { pointer-events: auto; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; box-shadow: var(--shadow-sm); }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand-50); color: var(--brand-600); }
.canvas {
  flex: 1; position: relative; overflow: hidden; cursor: grab;
  background-color: #f7f8fb;
  background-image: radial-gradient(circle, #d5dae4 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.canvas.panning { cursor: grabbing; }
.canvas > svg { width: 100%; height: 100%; display: block; stroke: none; stroke-width: 1; fill: #000; }
.legend {
  position: absolute; bottom: 12px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  font-size: 11.5px; color: var(--ink-2); pointer-events: none;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.85); padding: 3px 8px; border-radius: 6px; }
.lg-line { width: 22px; height: 0; border-top: 2px solid var(--brand); }
.lg-line.manual { border-top-style: dashed; }
.lg-cp { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; }
.lg-cp.hoch { background: var(--bad); }
.lg-cp.mittel { background: var(--warn); }
.lg-cp.niedrig { background: var(--ok); }

.empty-state { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.empty-state > div { text-align: center; max-width: 420px; color: var(--muted); pointer-events: auto; }
.empty-state h3 { color: var(--ink); margin: 14px 0 6px; font-size: 17px; }
.empty-illu { width: 120px; height: 80px; margin: 0 auto; display: block; }

/* Diagramm */
.u-card { cursor: default; }
.u-shadow { filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.12)) drop-shadow(0 2px 3px rgba(15, 23, 42, 0.06)); }
.u-head { cursor: move; }
.u-title { font-weight: 700; font-size: 14px; fill: #fff; }
.u-sub { font-size: 11px; fill: rgba(255, 255, 255, 0.8); }
.u-sec { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
.u-item { font-size: 12px; fill: var(--ink-2); }
.u-step { font-size: 11.5px; fill: var(--muted); }
.u-stepnum { font-size: 9.5px; font-weight: 700; fill: #fff; }
.port { cursor: crosshair; transition: r 0.1s; }
.port:hover, .port.target { r: 7; }
.edge { fill: none; stroke-width: 2; transition: opacity 0.15s, stroke-width 0.15s; cursor: pointer; }
.edge-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.edge.manual { stroke-dasharray: 6 5; }
.edge-g:hover .edge, .edge-g.sel .edge { stroke-width: 3.2; }
.edge-label rect { fill: #fff; stroke: var(--line); }
.edge-label text { font-size: 11px; fill: var(--ink-2); font-weight: 500; }
.dim .edge-g:not(.hl) { opacity: 0.12; }
.dim .u-card:not(.hl) { opacity: 0.45; }
.cp { cursor: pointer; }
.cp-pulse { animation: pulse 2.2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0% { opacity: 0.6; transform: scale(1); } 70% { opacity: 0; transform: scale(2.2); } 100% { opacity: 0; } }
.drag-line { stroke: var(--brand); stroke-width: 2; stroke-dasharray: 5 4; fill: none; pointer-events: none; }

/* ---------- IPO-Übersicht ---------- */
.page { padding: 22px 24px 40px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.sipoc { display: flex; flex-direction: column; gap: 14px; }
.sipoc-row { display: grid; grid-template-columns: 220px 1fr 1.2fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.sipoc-row > div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.sipoc-row > div:first-child { border-left: 0; }
.sipoc-unit { display: flex; flex-direction: column; gap: 8px; position: relative; }
.sipoc-unit::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.sipoc-unit h4 { margin: 0; font-size: 15px; }
.sipoc-unit p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.sipoc h6 { margin: 0 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; }
.sipoc .c-i h6 { color: #0284c7; }
.sipoc .c-p h6 { color: var(--brand-600); }
.sipoc .c-o h6 { color: #059669; }
.sipoc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sipoc li { font-size: 13px; line-height: 1.35; }
.sipoc li small { display: block; color: var(--muted); font-size: 11.5px; }
.sipoc ol { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 6px; }
.sipoc ol li { counter-increment: st; display: flex; gap: 8px; }
.sipoc ol li::before { content: counter(st); width: 18px; height: 18px; border-radius: 6px; background: var(--brand-50); color: var(--brand-600); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
.pending { color: var(--faint); font-style: italic; font-size: 13px; }

/* ---------- Compliance-Matrix ---------- */
.matrix-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: auto; }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.matrix th, .matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.matrix thead th { position: sticky; top: 0; background: #f8fafc; font-size: 12px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); z-index: 1; }
.matrix th.reg { position: sticky; left: 0; background: var(--panel); min-width: 220px; z-index: 2; font-weight: 600; }
.matrix thead th.reg { background: #f8fafc; z-index: 3; }
.matrix td.cell { min-width: 150px; }
.cell-box { border-radius: 8px; padding: 7px 9px; font-size: 12px; line-height: 1.35; cursor: help; }
.cell-box.hoch { background: #fff1f2; color: #9f1239; }
.cell-box.mittel { background: #fffbeb; color: #92400e; }
.cell-box.niedrig { background: #ecfdf5; color: #065f46; }
.cell-box b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.section-title { margin: 28px 0 12px; font-size: 15px; }
.cp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cp-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.cp-card .route { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cp-card .route svg { width: 14px; height: 14px; }
.cp-card strong { font-size: 13.5px; }

/* ---------- Optimierung ---------- */
.kpi-row { display: grid; grid-template-columns: 260px repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 13px; }
.score { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; border: 0; }
.score small { color: #dbe6ef; }
.score .val { color: #fff; }
.gauge { width: 84px; height: 84px; flex: none; }
.gauge svg { width: 84px; height: 84px; }
.summary-box { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; line-height: 1.6; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.summary-box .meta { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.sug { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.15s, transform 0.15s; }
.sug:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.sug.done { opacity: 0.6; }
.sug-top { display: flex; align-items: center; gap: 8px; }
.sug-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sug h4 { margin: 0; font-size: 14.5px; line-height: 1.35; }
.sug p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.sug-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sug-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); }
.status-sel { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: var(--panel); }
.unit-dots { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* Status-Auswahl nie zusammendrücken: bei vielen Unit-Etiketten blieb sonst nur „o.“ von „offen“ */
.sug-foot .status-sel { flex: none; min-width: 112px; }
.unit-dot { font-size: 11px; padding: 2px 7px; border-radius: 6px; color: #fff; font-weight: 600; }
.gap-list { display: flex; flex-direction: column; gap: 8px; }
.gap { display: flex; gap: 12px; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 12px 14px; }
.gap svg { color: #d97706; margin-top: 1px; }
.gap strong { display: block; font-size: 13.5px; }
.gap span { font-size: 12.5px; color: #92400e; }

/* ---------- Drawer ---------- */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 680px; max-width: 100%; background: var(--panel);
  border-left: 1px solid var(--line); box-shadow: -20px 0 40px -20px rgba(15, 23, 42, 0.25);
  display: flex; flex-direction: column; z-index: 15; animation: slide 0.2s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px 24px; }
.d-sec { margin-top: 18px; }
.d-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.d-sec-head h5 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.d-list { display: flex; flex-direction: column; gap: 6px; }
.d-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fbfcfe; }
.d-item .fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.d-item input, .d-item select, .d-field input, .d-field textarea {
  width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; font-size: 13px;
}
.d-item input:hover, .d-field input:hover, .d-field textarea:hover { border-color: var(--line); background: #fff; }
.d-item input:focus, .d-item select:focus, .d-field input:focus, .d-field textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.d-item input.main { font-weight: 600; color: var(--ink); }
.d-item input.sub { font-size: 12px; color: var(--muted); }
.d-item select { width: auto; font-size: 12px; border-color: var(--line); background: #fff; }
.d-item .rm { border: 0; background: none; color: var(--faint); padding: 3px; border-radius: 6px; display: grid; }
.d-item .rm:hover { color: var(--bad); background: #fff1f2; }
.d-item .rm svg { width: 15px; height: 15px; }
.d-field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.d-field label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.d-field input, .d-field textarea { border-color: var(--line); background: #fff; padding: 7px 9px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(7, 11, 22, 0.55); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.welcome-card { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); animation: rise 0.3s ease; }
.welcome-hero {
  padding: 40px; color: #e2e8f0;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(79, 116, 146, 0.45), transparent 60%),
    radial-gradient(500px 300px at 100% 100%, rgba(8, 145, 178, 0.35), transparent 60%),
    var(--navy-900);
}
.welcome-hero h1 { margin: 22px 0 10px; font-size: 28px; letter-spacing: -0.02em; color: #fff; }
.welcome-hero p { color: #a5b4c8; line-height: 1.6; margin: 0; }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.steps b { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; }
.form { padding: 36px 36px 30px; display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin: 0 0 4px; font-size: 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); flex: 1; }
.form input, .form select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 400; background: #fff; }
/* Safari ignoriert Rahmen, Abstand und Höhe am nativen select – daher eigene Darstellung mit Pfeil */
.form select {
  -webkit-appearance: none; appearance: none; padding-right: 34px;
  background: #fff 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.form input:focus, .form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.form .row { display: flex; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.form-actions .btn-light:first-child { margin-right: auto; }
.btn-pair { display: grid; gap: 10px; width: max-content; margin-left: auto; }
.form-actions:has(.btn-pair) { align-items: flex-start; }
.btn-pair .btn { width: 100%; justify-content: center; }
.dialog { background: var(--panel); border-radius: 16px; padding: 24px; width: min(420px, 100%); box-shadow: var(--shadow-lg); }
.dialog h3 { margin: 0 0 8px; }
.dialog p { margin: 0; color: var(--muted); line-height: 1.5; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--navy-900); color: #fff; padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px;
  animation: rise 0.2s ease;
}
.toast.error { background: #9f1239; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6e3; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.rail ::-webkit-scrollbar-thumb { background: #2a3756; background-clip: content-box; }

@media (max-width: 1280px) {
  :root { --chat-w: 360px; --rail-w: 220px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .sipoc-row { grid-template-columns: 1fr; }
  .sipoc-row > div { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .rail, .chat { min-height: 300px; }
  .workspace { min-height: 80vh; }
  .welcome-card { grid-template-columns: 1fr; }
  .brand-text span, .engine-pill span:last-child { display: none; }
}

/* ---------- Druck ---------- */
@media print {
  body { overflow: visible; background: #fff; }
  .topbar, .rail, .chat, .tabs, .canvas-toolbar, .legend, .drawer, .sug-foot select { display: none !important; }
  .layout { display: block; height: auto; }
  .view { display: block !important; overflow: visible; page-break-after: always; }
  #view-workflow { height: 90vh; }
  .sug, .sipoc-row, .cp-card { break-inside: avoid; box-shadow: none; }
}

/* ---------- Benutzer, Anmeldung, Freigaben ---------- */
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: rgba(79, 116, 146, 0.18); border: 1px solid rgba(79, 116, 146, 0.35); color: var(--brand-100);
}
.share-btn:hover { background: rgba(79, 116, 146, 0.3); color: #fff; }
.share-btn svg { width: 16px; height: 16px; }
.access-pill { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.user-switch { position: relative; }
.user-btn { border: 0; background: none; padding: 0; }
.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), #0891b2); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}
.avatar-sm.lg { width: 40px; height: 40px; font-size: 14px; }
.user-menu { min-width: 280px; top: 46px; right: 0; }
.user-card { display: flex; gap: 12px; align-items: center; padding: 10px; }
.user-card strong { display: block; }
.user-card small { color: var(--muted); font-size: 12px; }

/* Helles Design (Anmeldung, Ersteinrichtung, Neues Projekt): weiß, Akzentfarbe makro resulting */
.brand-light {
  background: #fff; backdrop-filter: none;
}
.brand-light::before { content: ""; position: fixed; inset: 0 0 auto; height: 6px; background: var(--brand); }
.brand-light .welcome-card { border: 1px solid #e3eaf0; box-shadow: 0 24px 60px -24px rgba(79, 116, 146, 0.35); }
.brand-light .welcome-hero { background: var(--brand-50); color: #1f3447; border-right: 1px solid #e3eaf0; }
.brand-light .welcome-hero h1 { color: #1f3447; }
.brand-light .welcome-hero p { color: #4a5d6e; }
.brand-light .steps b { background: #fff; border-color: var(--brand-100); color: var(--brand); }
.brand-light .form h3 { color: #1f3447; }
.brand-light .btn-primary { background: var(--brand); box-shadow: 0 6px 16px -6px rgba(79, 116, 146, 0.7); }
.brand-light .btn-primary:hover { background: var(--brand-600); }
@media (max-width: 900px) { .brand-light .welcome-hero { border-right: 0; border-bottom: 1px solid #e3eaf0; } }
.form-hint { margin: -6px 0 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-hint.small { font-size: 12px; margin: 4px 0 0; text-align: center; }
.form-error { margin: 0; padding: 9px 12px; border-radius: 9px; background: #fff1f2; color: #be123c; font-size: 13px; border: 1px solid #fecdd3; }
.btn-block { width: 100%; padding: 11px 16px; }
.dialog.center { text-align: center; max-width: 440px; width: 100%; }
.form-dialog { display: flex; flex-direction: column; gap: 12px; }
.form-dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form-dialog input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.form-dialog input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }

.modal { width: min(1080px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise 0.2s ease; }
.modal-sm { width: min(620px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 18px 24px 24px; overflow-y: auto; }

.user-create, .share-add { display: flex; gap: 8px; flex-wrap: wrap; }
.user-create input, .user-create select, .share-add select {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; flex: 1; min-width: 140px;
}
.share-add select[name="role"] { flex: 0 0 140px; }
.user-create input:focus, .user-create select:focus, .share-add select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.secret-box { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 13px; line-height: 1.5; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.secret-box code { font-family: var(--mono); font-size: 14px; background: #fff; border: 1px solid #a7f3d0; padding: 4px 10px; border-radius: 8px; color: var(--ink); user-select: all; }
.role-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 14px 0 10px; }
.role-legend b { color: var(--ink-2); }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; }
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); background: #f8fafc; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.user-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.user-table tr:last-child td { border-bottom: 0; }
.user-table tr.inactive td { opacity: 0.55; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.user-cell small { display: block; color: var(--muted); font-size: 12px; }
.user-table select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; font-size: 12.5px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; white-space: nowrap; max-width: 300px; margin-left: auto; }
.you { font-size: 10.5px; font-weight: 700; color: var(--brand-600); background: var(--brand-50); padding: 1px 6px; border-radius: 6px; margin-left: 6px; }
.switch { position: relative; display: inline-flex; width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; border: 0; padding: 0; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.15s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(16px); }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }

.member-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.member .who { flex: 1; min-width: 0; }
.member .who strong { display: block; font-size: 13.5px; }
.member .who small { color: var(--muted); font-size: 12px; }
.member select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: #fff; font-size: 12.5px; }
.member .rm { border: 0; background: none; color: var(--faint); padding: 5px; border-radius: 8px; display: grid; }
.member .rm:hover { color: var(--bad); background: #fff1f2; }
.transfer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.transfer h5 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.readonly-note { display: flex; gap: 10px; align-items: flex-start; margin: 10px 14px 14px; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12.5px; line-height: 1.45; }
.readonly-note svg { color: #d97706; margin-top: 1px; }
body.readonly .chat-input,
body.readonly .add-task,
body.readonly .task .del,
body.readonly .card-foot,
body.readonly .quick-chips,
body.readonly .unit-actions,
body.readonly #addUnitBtn,
body.readonly #optimizeBtn,
body.readonly #autoLayout,
body.readonly [data-dr],
body.readonly .d-actions,
body.readonly [data-act="optimize"],
body.readonly .legend .muted { display: none !important; }
body.readonly .task { pointer-events: none; }
body.readonly .d-item input, body.readonly .d-field input, body.readonly .d-field textarea { pointer-events: none; }
.menu-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 10px 10px 4px; }
.menu .sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.menu button .grow { flex: 1; min-width: 0; }
body.readonly .status-sel { pointer-events: none; opacity: 0.7; }
.d-item input:disabled, .d-field input:disabled, .d-field textarea:disabled, .d-item select:disabled { background: transparent; color: var(--ink-2); opacity: 1; border-color: transparent; }
.member > .tag { flex: none; }

/* ---------- Prozesse ---------- */
.rail-head-2 { padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.unit-list { flex: 1 1 auto; min-height: 60px; }
.proc-rail { flex: none; overflow: visible; }
.proc-num { background: rgba(79, 116, 146, 0.22); color: var(--brand-100); }
.proc-num svg { width: 14px; height: 14px; }

#view-processes { overflow: hidden; }
.proc-main { height: 100%; }
.proc-list { border-right: 1px solid var(--line); background: var(--panel); padding: 14px 12px; overflow-y: auto; }
.proc-list-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.proc-group { font-size: 11px; font-weight: 600; color: var(--faint); margin: 12px 4px 6px; }
.proc-item { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 10px; margin-bottom: 4px; }
.proc-item:hover { background: var(--bg); }
.proc-item.active { background: var(--brand-50); border-color: var(--brand-100); }
.proc-item strong { display: block; font-size: 13px; }
.proc-item small { color: var(--muted); font-size: 11.5px; }
.proc-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.proc-head { padding: 12px 20px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.proc-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.proc-title-main { min-width: 0; }
.proc-tags { display: flex; gap: 6px; margin-bottom: 4px; }
.proc-title h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proc-title p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.proc-actions { display: flex; gap: 6px; flex: none; }
.proc-kpis { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.proc-kpis > span { font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.proc-kpis b { color: var(--ink); font-variant-numeric: tabular-nums; }
.proc-kpis .lt { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.proc-kpis .lt b { color: var(--brand-600); }
.proc-kpis s { color: var(--faint); }
.proc-insights { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.proc-insights details { display: flex; flex-direction: column; gap: 6px; }
.proc-insights details[open] { max-height: 180px; overflow-y: auto; }
.proc-insights summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--brand-600); padding: 2px 4px; }
.proc-insights details .insight { margin-top: 6px; }
.insight { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.insight svg { width: 16px; height: 16px; }
.insight span { flex: 1; }
.insight.info { background: var(--brand-50); color: var(--brand-600); }
.insight.ai { background: #f0fdfa; color: #115e59; }
.insight.warn { background: #fffbeb; color: #92400e; }
.proc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.proc-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proc-body { flex: 1; min-height: 0; position: relative; }
.proc-canvas { position: absolute; inset: 0; }
.proc-table { position: absolute; inset: 0; overflow: auto; padding: 18px 20px 30px; }
.p-node { cursor: pointer; }
.p-node:hover rect:first-of-type { filter: drop-shadow(0 6px 12px rgba(79, 116, 146, 0.18)); }
.click-row { cursor: pointer; }
.click-row:hover td { background: #f8fafc; }
.click-row.sel td { background: var(--brand-50); }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-600); font-weight: 700; }
.link-btn:hover { text-decoration: underline; }
.proc-empty { flex: 1; overflow: auto; display: grid; place-items: center; padding: 30px; }
.proc-empty-inner { width: 100%; max-width: 1080px; text-align: center; }
.proc-empty-inner h2 { margin: 0 0 8px; }
.proc-empty-inner p { color: var(--muted); line-height: 1.6; margin: 0 auto 22px; max-width: 560px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; text-align: left; }
.tpl-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-sm); transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.tpl-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.tpl-card small { color: var(--muted); font-size: 12px; }
.tpl-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); margin-bottom: 6px; }
.tpl-card.ai .tpl-icon { background: var(--brand); color: #fff; }
.proc-mini { margin: 0; padding-left: 20px; font-size: 12.5px; }
.proc-mini li { padding: 2px 0; }
.proc-mini small { display: block; color: var(--muted); font-size: 11px; }
.d-row { display: flex; gap: 10px; }
.d-row > .d-field { flex: 1; min-width: 0; }
.d-field select { border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; background: #fff; }
/* Gleiche Höhe für Auswahl- und Eingabefelder; Safari zeichnet das native select sonst niedriger */
.d-field input:not([type="checkbox"]), .d-field select { height: 34px; font-size: 13px; }
.d-field select {
  width: 100%; -webkit-appearance: none; appearance: none; padding-right: 30px; color: var(--ink);
  background: #fff 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.d-field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
/* Dauer: Zahl und Einheit in einem Feld */
.dur-input { display: flex; gap: 6px; }
.dur-input input { flex: 1; min-width: 0; }
.dur-input select { flex: 0 0 118px; width: 118px; }
.check-label { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 13px !important; color: var(--ink) !important; cursor: pointer; }
.check-label input { width: auto !important; }
body.readonly [data-proc-edit] { display: none !important; }

/* ---------- Compliance-Matrix & Optimierung: Einzelprozesse ---------- */
.cell-box + .cell-box { margin-top: 6px; }
.cell-box.proc { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.cell-box.proc.cond { background: #fffbeb; color: #92400e; border: 1px dashed #fcd34d; }
.cell-box small { display: block; margin-top: 2px; font-size: 11px; opacity: 0.75; }
.cmp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legend i.cell-box { width: 14px; height: 14px; padding: 0; border-radius: 4px; display: inline-block; }
.matrix .group-row th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding-top: 8px; padding-bottom: 4px; border-bottom: 0; }
.matrix .group-row th.grp-proc { color: var(--brand-600); }
.matrix .grp-start { border-left: 2px solid var(--brand-100); }
/* Kopfzeilen bleiben beim Scrollen stehen: die Matrix scrollt in ihrem eigenen Rahmen */
.matrix-wrap { max-height: calc(100vh - 150px); }
.matrix .group-row th { line-height: 14px; }
.matrix thead tr.group-row + tr th { top: 26px; }
/* Unit-Namen einzeilig, gekürzt mit „…“; der volle Name steht im Tooltip */
.matrix .th-unit { display: flex; align-items: center; gap: 6px; width: 0; min-width: 100%; }
.matrix .th-unit .tag { flex-shrink: 0; }
.matrix .th-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix th .link-btn { text-align: left; }
.cmp-tools { display: flex; align-items: center; gap: 10px; align-self: flex-end; }
.gate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.sug-top { justify-content: space-between; }
.sug-origin { font-size: 10.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.unit-dot.proc-dot { background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
.scorecard td, .scorecard th { white-space: nowrap; }
.page-head .seg { align-self: flex-end; }
.cmp-legend i.cell-box { border: 1px solid rgba(15, 23, 42, 0.12); }

/* ---------- Process & Compliance Wizard ---------- */
.wizard-btn {
  display: flex; align-items: center; gap: 10px; margin: 14px 12px 4px; padding: 10px 12px; border-radius: 12px; text-align: left;
  border: 1px solid rgba(79, 116, 146, 0.35); background: linear-gradient(135deg, rgba(79, 116, 146, 0.22), rgba(8, 145, 178, 0.14)); color: var(--brand-100);
}
.wizard-btn:hover { background: linear-gradient(135deg, rgba(79, 116, 146, 0.34), rgba(8, 145, 178, 0.22)); }
.wizard-btn strong { display: block; font-size: 12.5px; }
.wizard-btn small { display: block; font-size: 11px; color: #6b7f90; }
body.readonly .wizard-btn { display: none; }
.wizard-overlay { align-items: center; }
.wizard { width: min(1180px, 100%); height: min(860px, calc(100vh - 40px)); background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: rise 0.25s ease; }
.wz-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; background: var(--brand-50); color: #1f3447; border-top: 4px solid var(--brand); border-bottom: 1px solid #e3eaf0; }
.wz-title { display: flex; gap: 16px; align-items: center; }
.wz-title h3 { margin: 0; font-size: 22px; color: #1f3447; }
.wz-title p { margin: 4px 0 0; font-size: 15px; color: #6b7f90; }
.wz-head .icon-btn { background: #fff; border-color: #dbe4ec; color: #4a5d6e; }
.wz-steps { list-style: none; margin: 0; padding: 12px 22px; display: flex; gap: 6px; border-bottom: 1px solid var(--line); background: #f8fafc; overflow-x: auto; }
.wz-steps li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.wz-steps li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e2e8f0; color: var(--ink-2); font-size: 12px; }
.wz-steps li.on { background: var(--brand-50); color: var(--brand-600); }
.wz-steps li.on b { background: var(--brand); color: #fff; }
.wz-steps li.done b { background: var(--ok); color: #fff; }
.wz-steps li:hover { color: var(--ink); }
.wz-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.wz-foot { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); }
.wz-hint { flex: 1; text-align: right; font-size: 12.5px; color: var(--muted); }
.wz-hint.warn { color: #b45309; }
.wz-intro { position: relative; margin-bottom: 16px; padding-right: 120px; }
.wz-intro h4 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.01em; }
.wz-intro p { margin: 0; color: var(--muted); line-height: 1.5; max-width: 760px; }
.wz-intro-sub { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.wz-count { position: absolute; right: 0; top: 2px; font-size: 12px; font-weight: 700; color: var(--brand-600); background: var(--brand-50); padding: 4px 10px; border-radius: 999px; }
.wz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.wz-grid-lg { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.wz-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px 12px 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); transition: border-color 0.12s, background 0.12s, box-shadow 0.12s; }
.wz-card:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); }
.wz-card strong { font-size: 13.5px; line-height: 1.3; }
.wz-card small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.wz-check { position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #cbd5e1; display: grid; place-items: center; background: #fff; }
.wz-check svg { width: 12px; height: 12px; stroke-width: 3; color: #fff; opacity: 0; }
.wz-card.on { border-color: var(--brand); background: var(--brand-50); }
.wz-card.on .wz-check { background: var(--brand); border-color: var(--brand); }
.wz-card.on .wz-check svg { opacity: 1; }
.wz-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; color: var(--ink-2); margin-left: auto; }
.wz-card .wz-tag { position: static; order: -1; margin: 0 0 2px; }
.wz-tag.ai { background: var(--brand-50); color: var(--brand-600); }
.wz-custom { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.wz-custom input { flex: 1; min-width: 180px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 9px 12px; background: #fff; }
.wz-custom input:focus, .wz-describe textarea:focus, .wz-generate input:focus, .wz-generate textarea:focus, .wz-generate select:focus { outline: none; border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.wz-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }
.wz-note svg { width: 16px; height: 16px; flex: none; }
.wz-note.warn { color: #b45309; }
.wz-split { display: grid; grid-template-columns: 250px 1fr; gap: 18px; min-height: 100%; }
.wz-unitlist { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); padding-right: 14px; }
.wz-unitlist button { display: flex; justify-content: space-between; gap: 8px; align-items: center; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.wz-unitlist button:hover { background: var(--bg); }
.wz-unitlist button.on { background: var(--brand-50); border-color: var(--brand-100); font-weight: 600; }
.wz-unitlist small { font-size: 11px; color: #b45309; white-space: nowrap; }
.wz-unitlist small.ok { color: var(--ok); }
.wz-tasks-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.wz-tasks-head h4 { margin: 0; font-size: 17px; }
.wz-tasks-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.wz-unit-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 16px; }
.wz-unit-roles label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.wz-unit-roles input { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-weight: 400; background: #fff; }
.wz-unit-roles input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
@media (max-width: 900px) { .wz-unit-roles { grid-template-columns: 1fr; } }
.wz-mini-actions { display: flex; gap: 6px; }
.wz-tasklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin-top: 14px; }
.wz-task { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; cursor: pointer; background: #fff; }
.wz-task:hover { border-color: var(--brand-100); }
.wz-task.on { border-color: var(--brand); background: var(--brand-50); }
.wz-task input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.wz-task span { flex: 1; }
.wz-del { border: 0; background: none; color: var(--faint); padding: 2px; display: grid; }
.wz-del:hover { color: var(--bad); }
.wz-del svg { width: 14px; height: 14px; }
.wz-describe { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.wz-describe summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--brand-600); }
.wz-describe summary::-webkit-details-marker { display: none; }
.wz-describe summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s ease; flex: none; margin: 0 2px; }
.wz-describe[open] summary::before { transform: rotate(45deg); }
.wz-describe-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wz-describe textarea { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; resize: vertical; background: #fff; }
.wz-describe .btn { align-self: flex-start; }
.wz-tasks-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.wz-chip:hover { border-color: var(--brand-100); }
.wz-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-generate { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; max-width: 640px; }
.wz-generate label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.wz-generate input, .wz-generate textarea, .wz-generate select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.wz-generate .btn { align-self: flex-start; }
.wz-busy { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--muted); }
.wz-busy h4 { margin: 8px 0 0; color: var(--ink); font-size: 17px; }
.wz-busy .typing i { width: 10px; height: 10px; background: var(--brand); }
@media (max-width: 900px) { .wz-split { grid-template-columns: 1fr; } .wz-unitlist { border-right: 0; padding-right: 0; } }
.wz-task .wz-tag { flex: none; }


/* ---------- Regulatorische Anforderungen ---------- */
.floating-tip {
  position: fixed; z-index: 500; max-width: 340px; padding: 8px 11px; border-radius: 9px; pointer-events: none;
  background: var(--navy-900); color: #e2e8f0; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-lg);
}
.reg-section { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.reg-section > h4 { margin: 8px 0 0; font-size: 14px; }
.reg-section > p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.reg-select { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reg-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fbfcfe; display: flex; flex-direction: column; gap: 8px; }
.reg-group-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.reg-group-head strong { flex: 1; }
.reg-letter { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; }
.reg-all { border: 0; background: none; color: var(--brand-600); font-size: 11.5px; font-weight: 600; padding: 2px 4px; }
.reg-all:hover { text-decoration: underline; }
.reg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.reg-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.reg-chip:hover { border-color: var(--brand); color: var(--brand-600); }
.reg-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.reg-other { border: 1px dashed #cbd5e1; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; background: #fff; }
.reg-other:focus { outline: none; border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.welcome-card.fin { width: min(1180px, 100%); grid-template-columns: 320px 1fr; max-height: calc(100vh - 40px); }
.welcome-card.fin .form { overflow-y: auto; max-height: calc(100vh - 40px); }
.welcome-card.fin .welcome-hero h1 { font-size: 24px; }
.cell-box.missing { background: #fff1f2; color: #9f1239; border: 1px dashed #fda4af; }
.reg-badge { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--brand-50); color: var(--brand-600); vertical-align: middle; }
@media (max-width: 900px) { .reg-select { grid-template-columns: 1fr; } }
.wz-regs { margin-top: 22px; padding-top: 16px; }
.wz-regs h4 { font-size: 16px !important; }
.wz-count-inline { font-size: 12px; font-weight: 700; color: var(--brand-600); background: var(--brand-50); padding: 3px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }

/* ---------- Unternehmensprofil & Anwendbarkeitsprüfung ---------- */
.wz-profile { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.wz-profile label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.wz-profile select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; font: inherit; }
.wz-flaggroup { margin-top: 14px; }
.wz-flaggroup h5 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.wz-flaggroup .wz-chip { font-size: 12.5px; padding: 6px 12px; font-weight: 500; }
.reg-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.reg-summary .seg { margin-left: auto; }
.reg-pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.reg-pill.yes { background: #ecfdf5; color: #047857; }
.reg-pill.check { background: #fffbeb; color: #b45309; }
.reg-pill.no { background: #f1f5f9; color: var(--muted); }
.reg-group-block { margin-top: 18px; }
.reg-group-block h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-600); }
.reg-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.reg-row.st-yes { border-left-color: var(--ok); }
.reg-row.st-check { border-left-color: var(--warn); background: #fffdf5; }
.reg-row.st-no .reg-main { opacity: 0.7; }
.reg-main { flex: 1; min-width: 0; }
.reg-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reg-label { font-weight: 700; font-size: 14px; border-bottom: 1px dotted var(--faint); cursor: help; }
.reg-type { font-size: 11px; color: var(--muted); }
.reg-reason { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.reg-meta, .reg-cond { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.reg-meta a { color: var(--brand-600); }
.reg-meta .ok { color: var(--ok); font-weight: 600; }
.reg-meta .warn { color: #b45309; font-weight: 600; }
.reg-just { width: 100%; margin-top: 8px; border: 1px dashed #cbd5e1; border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 12.5px; background: #fff; }
.reg-just:focus { outline: none; border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
/* Feste Breite: „Vorschlag wiederherstellen“ erscheint erst nach der Entscheidung und verschob sonst den Kartentext */
.reg-actions { display: flex; flex-direction: column; gap: 6px; flex: none; width: 168px; }
.reg-actions .btn { white-space: normal; text-align: center; justify-content: center; }
.reg-other-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 18px; }
.reg-other { border: 1px dashed #cbd5e1; border-radius: 9px; padding: 8px 11px; font-size: 13px; background: #fff; font-weight: 400; }
.wz-gapbox { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; margin-bottom: 14px; font-size: 13px; }
.wz-gapbox svg { flex: none; color: #d97706; }
.wz-gapbox div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cat-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.cat-toolbar input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
.cat-summary { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 12.5px; }
.cat-table td { vertical-align: top; }
.cat-edit td { background: #f8fafc; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cat-grid label.wide { grid-column: 1 / -1; }
.cat-grid input, .cat-grid select, .cat-grid textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-weight: 400; background: #fff; }
@media (max-width: 900px) { .wz-profile, .cat-grid { grid-template-columns: 1fr; } }

/* ---------- Wizard: Reihenfolge und Abschlussoptionen ---------- */
.wz-order-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.wz-order-actions .btn { align-self: flex-start; }
.wz-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.wz-order li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: grab; }
.wz-order li:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); }
.wz-grip { color: var(--faint); font-size: 13px; letter-spacing: -2px; }
.wz-order-num { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.wz-order-name { flex: 1; min-width: 0; }
.wz-order-name strong { display: block; font-size: 13.5px; }
.wz-order-name small { color: var(--muted); font-size: 11.5px; }
.wz-order .icon-btn:disabled { opacity: 0.35; cursor: default; }
.wz-finish { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; max-width: 640px; }
.wz-finish h5 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.wz-finish label { display: flex !important; flex-direction: row !important; gap: 9px; align-items: flex-start; font-size: 13px !important; font-weight: 500 !important; color: var(--ink-2); line-height: 1.4; }
.wz-finish input { margin-top: 2px; accent-color: var(--brand); }

/* ---------- Helles App-Design: Kopfzeile und Seitenleiste wie die Anmeldeseite ---------- */
.topbar { background: #fff; color: #1f3447; border-top: 4px solid var(--brand); border-bottom: 1px solid #e3eaf0; }
.topbar .brand-text strong { color: #1f3447; }
.topbar .brand-text span, .project-label, .chev { color: #6b7f90; }
.project-btn { background: #fff; border-color: #dbe4ec; color: #1f3447; }
.project-btn:hover { background: var(--brand-50); }
.engine-pill { background: #fff; border-color: #dbe4ec; color: #1f3447; }
.icon-btn.ghost-dark { background: #fff; border-color: #dbe4ec; color: #4a5d6e; }
.icon-btn.ghost-dark:hover { background: var(--brand-50); color: var(--brand-600); }
.share-btn { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.share-btn:hover { background: var(--brand-100); color: var(--brand-600); }
.access-pill { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.avatar-sm { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }

.rail { background: var(--brand-50); color: #33475a; border-right: 1px solid #e3eaf0; }
.rail-head { color: #6b7f90; }
.rail-head-2, .rail-foot { border-top-color: #dbe4ec; }
.unit-item:hover { background: rgba(79, 116, 146, 0.08); }
.unit-item.active { background: #fff; border-color: var(--brand-100); color: #1f3447; box-shadow: var(--shadow-sm); }
.unit-meta strong { color: #1f3447; }
.unit-meta small, .rail-empty, .rail-hint { color: #6b7f90; }
.badge-s.ok { color: #059669; }
.unit-actions button { color: #6b7f90; }
.unit-actions button:hover { color: var(--brand-600); background: rgba(79, 116, 146, 0.12); }
.unit-connector { border-left-color: rgba(79, 116, 146, 0.25); }
.rail-empty { border-color: rgba(79, 116, 146, 0.3); }
.rail ::-webkit-scrollbar-thumb { background: #c5d3df; background-clip: content-box; }
.proc-num { background: var(--brand-100); color: var(--brand-600); }
.rail .proc-item:hover { background: rgba(79, 116, 146, 0.08); }
.rail .proc-item.active { background: #fff; border-color: var(--brand-100); }
.wizard-btn { background: #fff; border-color: var(--brand-100); color: #1f3447; box-shadow: var(--shadow-sm); }
.wizard-btn:hover { background: #fff; border-color: var(--brand); }
.wizard-btn svg { color: var(--brand); }
/* PACE Assistant: zweite Schaltfläche unter dem Wizard, auch im Nur-Lese-Modus sichtbar; hervorgehoben, solange der Chat offen ist */
.assistant-btn { margin-top: 8px; }
body.readonly .assistant-btn { display: flex; }
.layout:not(.chat-collapsed) .assistant-btn { border-color: var(--brand); background: var(--brand-50); }
.wizard-btn small { color: #6b7f90; }
.btn-glow { background: var(--brand); box-shadow: 0 8px 20px -10px rgba(79, 116, 146, 0.9); }
.btn-glow:hover { background: var(--brand-600); filter: none; }

/* ---------- Seitenleiste: Abschnitte ein- und ausklappen ---------- */
.rail-toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px 4px 0; margin-left: -2px; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; border-radius: 6px; }
.rail-toggle:hover { color: var(--brand-600); }
.rail-chev { width: 14px; height: 14px; transition: transform 0.15s ease; }
.rail-toggle[aria-expanded="true"] .rail-chev { transform: rotate(90deg); }
.rail-count:not(:empty) { margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--brand-100); color: var(--brand-600); font-size: 10.5px; letter-spacing: 0; }
.rail-foot { margin-top: auto; }

/* ---------- Seitenleiste: Untermenü der aktiven Ansicht ---------- */
.rail { overflow-y: auto; }
.rail-sub { flex: none; margin: 6px 10px 10px; padding: 8px; background: #fff; border: 1px solid var(--brand-100); border-radius: 12px; box-shadow: var(--shadow-sm); }
.rail-sub[hidden] { display: none; }
.rail-sub h5 { margin: 10px 8px 4px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #6b7f90; }
.rail-sub h5:first-child { margin-top: 2px; }
.rail-sub-group { display: flex; flex-direction: column; gap: 1px; }
.rail-sub-group:empty { display: none; }
.rail-sub button { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 6px 9px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: #33475a; cursor: pointer; }
.rail-sub button:hover:not(:disabled) { background: var(--brand-50); }
.rail-sub button:disabled { opacity: .5; cursor: default; }
.rail-sub button.on { background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-100); }
.rail-sub button.primary { background: var(--brand); color: #fff; }
.rail-sub button.primary:hover { background: var(--brand-600); }
.rail-sub button.danger { color: var(--bad); }

/* ---------- Interne Richtlinien ---------- */
.pol-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .pol-grid { grid-template-columns: 1fr; } }
.pol-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pol-head h4 { margin: 0; font-size: 14.5px; }
.pol-actions { display: flex; gap: 6px; align-items: center; }
.pol-actions .btn svg { width: 15px; height: 15px; }
.pol-actions a.btn { text-decoration: none; }
.pol-actions .btn.pol-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }
.pol-actions .btn.pol-del:hover:not(:disabled) { color: var(--bad); border-color: #fecdd3; background: #fff1f2; }
.pol-head .btn-primary svg { width: 15px; height: 15px; }
.pol-card p { margin: 0; font-size: 13px; }
.pol-file { line-height: 1.45; }
.pol-file .muted { font-size: 12px; }
.pol-summary { color: var(--ink-2); }
.pol-warn { display: flex; gap: 8px; align-items: flex-start; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 7px 9px; }
.pol-warn svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.pol-busy { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.pol-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-600); }
.pol-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.pol-rules li { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.pol-rules li .tag { align-self: flex-start; }
.pol-rules small { display: block; color: var(--muted); font-size: 11.5px; }
.pol-note { font-size: 12px; margin: 12px 0 0; }
.pol-apply { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.pol-apply-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pol-apply-head h4 { margin: 0 0 4px; font-size: 14.5px; }
.pol-apply-head p { margin: 0; font-size: 13px; max-width: 720px; }
.pol-apply-head .btn { flex-shrink: 0; }
.pol-apply-head .btn svg, .pol-prop-tools .btn svg { width: 15px; height: 15px; }
.pol-apply > .pol-busy, .pol-apply > p.muted { margin-top: 12px; }
.pol-prop-tools { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 8px; }
.pol-props { display: flex; flex-direction: column; gap: 8px; }
.pol-prop { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: 13px; }
.pol-prop:hover { border-color: var(--brand-100); background: var(--brand-50); }
.pol-prop input { margin-top: 3px; }
.pol-prop > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pol-prop-where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ink-2); }
.pol-old { color: var(--muted); text-decoration: line-through; }
.pol-new { color: var(--ink); font-weight: 500; }
.pol-precedence { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: 13px; color: var(--ink-2); }
.pol-precedence svg { width: 18px; height: 18px; color: var(--brand); flex-shrink: 0; margin-top: 1px; }
.pol-conflict { display: flex; gap: 8px; align-items: flex-start; color: #be123c; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 8px; padding: 7px 9px; font-size: 12.5px; margin: 4px 0 0; }
.pol-conflict svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.pol-rules li.conflict > div > span { text-decoration: line-through; color: var(--muted); }
.pol-rejected { margin-top: 12px; font-size: 13px; }
.pol-rejected summary { cursor: pointer; font-weight: 600; color: #be123c; }
.pol-rejected ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pol-rejected li { border: 1px solid #fecdd3; background: #fff8f8; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.pol-rejected small { color: #be123c; }

/* Filter „an einem Prozess beteiligte Business Units“ in der Reiterleiste */
.unit-focus { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.unit-focus[hidden] { display: none; }
.unit-focus select { height: 30px; max-width: 320px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; appearance: none; font: inherit; color: var(--ink); }
.unit-focus select.on { border-color: var(--brand); background-color: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.unit-focus select:focus { outline: 2px solid var(--brand-100); outline-offset: 1px; }
.unit-focus .link-btn { white-space: nowrap; }
.unit-focus .cond-toggle { height: 30px; border-color: #fcd34d; background: #fffbeb; color: #b45309; }
.unit-focus .cond-toggle.off { border-color: var(--line); background: #fff; color: var(--muted); }
.cond-tag { align-self: flex-start; border: 1px dashed #f59e0b; background: #fffbeb; color: #b45309; font-weight: 600; }
.matrix th .cond-tag { display: inline-block; margin-top: 4px; font-size: 10.5px; }


/* Demo-Video (Administratoren) */
.video-modal { position: relative; width: min(780px, 100%); }
.video-close { position: absolute; top: 14px; right: 14px; }
.video-hero { display: flex; flex-direction: column; align-items: center; padding: 28px 24px 4px; text-align: center; }
.video-hero .brand-logo.lg { height: 96px; margin-bottom: 10px; }
.video-hero h3 { margin: 0; font-size: 18px; }
.video-empty { text-align: center; margin: 4px 0; }
.video-file { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.video-file > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.video-file strong { overflow-wrap: anywhere; }
.video-file small { font-size: 12px; }
.video-file-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.video-general { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.video-general summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14px; }
.video-general summary::-webkit-details-marker { display: none; }
.video-general summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px; }
.video-general[open] summary::before { transform: rotate(45deg); }
.video-general summary small { margin-left: auto; font-weight: 400; font-size: 12px; }
.video-general .video-link { margin: 0 14px 14px; }
.vl-none { margin: 4px 0 0; font-size: 12.5px; }
.video-progress { display: flex; flex-direction: column; gap: 8px; }
.video-progress p { margin: 0; font-size: 13px; text-align: center; }
.video-bar { height: 8px; border-radius: 999px; background: var(--brand-50); overflow: hidden; }
.video-bar span { display: block; height: 100%; background: var(--brand); transition: width 0.2s ease; }
.video-link { margin-top: 16px; padding: 14px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.video-link label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.video-link p { margin: 0; font-size: 12px; line-height: 1.5; }
.video-link-row { display: flex; gap: 8px; }
.video-link-row input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 12.5px; background: var(--panel); }
.video-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.video-foot { justify-content: flex-end; }
.video-foot svg, .video-link svg { width: 16px; height: 16px; }
.video-links { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.video-links h4 { margin: 0; font-size: 14px; }
.video-links > p { margin: 0; font-size: 12px; line-height: 1.5; }
.vl-form { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 8px; margin-top: 4px; }
.vl-form select, .vl-form input { height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; background: var(--panel); min-width: 0; }
.vl-form select { appearance: none; padding-right: 28px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; }
.vl-form input:focus, .vl-form select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.vl-form input[name="company"] { grid-column: 1 / 3; }
.vl-exp { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.vl-exp input { flex: 1; }
.vl-form button { grid-column: 3; justify-self: end; }
.vl-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.vl-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; }
.vl-list li + li { border-top: 1px solid var(--line); }
.vl-list li.expired .vl-info strong { color: var(--muted); }
.vl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vl-info small { font-size: 12px; }
.vl-info .bad { color: var(--bad); font-weight: 600; }
.vl-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.vl-actions { display: flex; gap: 6px; }
.tag.good { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
@media (max-width: 640px) { .vl-form { grid-template-columns: 1fr 1fr; } .vl-form input[name="company"], .vl-exp, .vl-form button { grid-column: 1 / -1; } }
.vl-actions .btn.pol-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }
.vl-actions .btn svg { width: 15px; height: 15px; }
.vl-actions .btn.pol-del:hover { color: var(--bad); border-color: #fecdd3; background: #fff1f2; }

/* ---------- KI-Optimierung: Vergleich und Änderungsmarkierungen ---------- */
:root { --mk-added: #10b981; --mk-added-bg: #ecfdf5; --mk-changed: #d97706; --mk-changed-bg: #fffbeb; --mk-removed: #e11d48; --mk-removed-bg: #fff1f2; }
.compare-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 13px; }
.compare-bar[hidden] { display: none; }
.cmp-bar-title { display: flex; align-items: center; gap: 8px; color: var(--brand-600); }
.cmp-bar-title svg { width: 16px; height: 16px; }
.cmp-bar-stats { display: flex; gap: 10px; color: var(--ink-2); font-size: 12.5px; flex-wrap: wrap; }
.cmp-bar-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.cmp-bar-gap { flex: 1; }
.mk-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.mk-dot.added { background: var(--mk-added); }
.mk-dot.changed { background: var(--mk-changed); }
.mk-dot.removed { background: var(--mk-removed); }
.mk-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.mk-tag.added { background: var(--mk-added); }
.mk-tag.changed { background: var(--mk-changed); }
.mk-tag.removed { background: var(--mk-removed); }
.tag.mk-tag { border: 0; margin-left: 6px; }
/* Markierte Einträge in IPO-Übersicht, Checkliste und Compliance-Matrix */
li.mk { border-radius: 6px; padding-left: 6px !important; margin-left: -6px; }
li.mk-added { background: var(--mk-added-bg); box-shadow: inset 3px 0 var(--mk-added); }
li.mk-changed { background: var(--mk-changed-bg); box-shadow: inset 3px 0 var(--mk-changed); }
li.mk-removed { background: var(--mk-removed-bg); box-shadow: inset 3px 0 var(--mk-removed); text-decoration: line-through; color: var(--muted); }
.cell-box.mk-added { outline: 2px solid var(--mk-added); outline-offset: 1px; }
.cell-box.mk-changed { outline: 2px solid var(--mk-changed); outline-offset: 1px; }
.cell-box.mk-removed { outline: 2px dashed var(--mk-removed); outline-offset: 1px; opacity: 0.7; text-decoration: line-through; }
.cmp-legend .cell-box.mk { background: #fff; }
tr.mk-added > td:first-child, tr.mk-row.added > td:first-child { box-shadow: inset 4px 0 var(--mk-added); }
tr.mk-changed > td:first-child, tr.mk-row.changed > td:first-child { box-shadow: inset 4px 0 var(--mk-changed); }
tr.mk-removed > td:first-child, tr.mk-row.removed > td:first-child { box-shadow: inset 4px 0 var(--mk-removed); }
tr.mk-added { background: var(--mk-added-bg); }
tr.mk-changed { background: var(--mk-changed-bg); }
tr.mk-removed { background: var(--mk-removed-bg); }
/* Prüfseite „KI-Vergleich“ */
.opt-page { padding: 16px 20px 28px; }
.opt-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.opt-head h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.opt-head h3 svg { width: 16px; height: 16px; color: var(--brand); }
.opt-head p { margin: 0; color: var(--ink-2); line-height: 1.5; max-width: 900px; }
.opt-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex: none; }
.opt-legend span { display: inline-flex; align-items: center; gap: 5px; }
.opt-hint { font-size: 12px; margin: 8px 0 14px; }
.opt-grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .opt-grid { grid-template-columns: 1fr; } }
.opt-kpis td, .opt-kpis th { text-align: left; }
.opt-side h4, .opt-title { margin: 0 0 8px; font-size: 13.5px; }
.opt-side h4 + * { margin-top: 0; }
.opt-side p { color: var(--ink-2); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.opt-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.opt-title { margin-top: 22px; }
.mk-delta { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #f1f5f9; color: var(--ink-2); }
.mk-delta.good { background: var(--mk-added-bg); color: #047857; }
.mk-delta.bad { background: var(--mk-removed-bg); color: #be123c; }
.mk-warn { color: var(--bad); font-size: 12.5px; }
.mk-legal { margin-top: 16px; padding: 10px 14px; border: 1px solid #fecdd3; background: var(--mk-removed-bg); border-radius: 10px; font-size: 13px; }
.mk-legal ul { margin: 6px 0 0; padding-left: 18px; }
.opt-changes td { vertical-align: top; }
.opt-check { width: 34px; text-align: center; }
.opt-reason { max-width: 320px; color: var(--ink-2); font-size: 12.5px; }
.mk-diff { font-size: 12.5px; line-height: 1.5; margin-bottom: 4px; }
.mk-diff b { display: inline-block; min-width: 110px; color: var(--muted); font-weight: 600; }
.mk-diff del { color: #be123c; background: var(--mk-removed-bg); text-decoration: line-through; padding: 0 3px; border-radius: 3px; }
.mk-diff ins { color: #047857; background: var(--mk-added-bg); text-decoration: none; padding: 0 3px; border-radius: 3px; }
.mk-arrow { margin: 0 6px; color: var(--muted); }
.opt-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.opt-foot label { display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- Sicherheit: Nachvollziehbarkeit, 2FA, Richtlinie, Protokoll ---------- */
.audit-info { margin: 18px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.user-card small { display: block; }
.user-card .tag { margin-top: 4px; }
/* .brand (Kopfzeile) gibt sonst auch dem Etikett .tag.brand Breite und Flex-Layout */
.tag.brand { display: inline-flex; width: auto; min-width: 0; }
.twofa-state { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.twofa-state.on { background: #ecfdf5; color: #047857; }
.twofa-steps { margin: 0; padding-left: 20px; line-height: 1.5; }
.twofa-steps li { margin-bottom: 14px; }
.twofa-qr { width: 184px; height: 184px; margin: 10px 0 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.twofa-qr svg { width: 100%; height: 100%; display: block; }
.twofa-secret { display: block; margin-top: 6px; font-size: 13px; letter-spacing: 0.04em; word-break: break-all; }
.twofa-confirm { display: flex; gap: 8px; margin-top: 8px; }
.twofa-confirm input { width: 140px; height: 36px; font-size: 18px; letter-spacing: 0.15em; text-align: center; border: 1px solid var(--line); border-radius: 8px; }
.twofa-codes { columns: 2; font-size: 14px; line-height: 1.8; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--brand-50); }
.sec-form { display: flex; flex-direction: column; gap: 10px; }
.sec-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sec-form label small { color: var(--muted); font-size: 11.5px; }
.sec-form input[type="number"] { width: 120px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.proto-tabs { margin-bottom: 12px; }
.proto-table td { font-size: 12.5px; vertical-align: top; }
.proto-ua { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Anmeldung: Hinweis (z. B. Link angefordert, Sitzung abgelaufen) und Passwortregeln ---------- */
.auth-banner { margin: 0; padding: 9px 12px; border-radius: 9px; font-size: 13px; background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.auth-banner.ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.auth-rules { margin: -6px 0 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.auth-rules li.ok { color: #047857; }
a.link-btn { text-decoration: none; }
/* Kurze Formulare: Felder nicht auf die Kartenhöhe strecken (.form label hat flex: 1) */
#otpForm label, #forgotForm label, #setPwForm label { flex: 0 0 auto; }

/* ---------- Testumgebung: Banner „STAGING · Testumgebung“ (wie ProcureOne), nur bei data-env="staging" ---------- */
html[data-env] { --env-banner-h: 30px; }
.env-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 2000; height: var(--env-banner-h);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(to right, #b45309, #f59e0b, #b45309); color: #451a03;
  font-size: 12px; font-weight: 600; letter-spacing: 0.025em; box-shadow: 0 1px 12px rgba(245, 158, 11, 0.35);
}
.env-banner strong { letter-spacing: 0.12em; }
.env-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(69, 26, 3, 0.8); }
.env-sep { opacity: 0.55; }
/* Demo-Adresse: Banner in der PACE-Akzentfarbe */
html[data-env="demo"] .env-banner { background: linear-gradient(to right, #3d5d77, #4f7492, #3d5d77); color: #fff; box-shadow: 0 1px 12px rgba(79, 116, 146, 0.35); }
html[data-env="demo"] .env-dot { background: #fff; }
html[data-env] body { box-sizing: border-box; padding-top: var(--env-banner-h); }
html[data-env] .layout { height: calc(100vh - 56px - var(--env-banner-h)); }
html[data-env] .overlay { top: var(--env-banner-h); }

/* ---------- Wizard: Unterschritte des Unternehmensprofils, Merkmale als Checkboxen ---------- */
.wz-subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.wz-subnav button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.wz-subnav button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wz-subnav button.done { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.wz-subnav button:disabled { opacity: 0.45; cursor: not-allowed; }
.wz-cbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
@media (max-width: 900px) { .wz-cbs { grid-template-columns: 1fr; } }
.wz-cb { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2, #eef2f6); border-radius: 9px; font-size: 13.5px; color: var(--ink); background: #fff; cursor: pointer; }
.wz-cb:hover { border-color: var(--brand-100); }
.wz-cb input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.wz-cb.own { cursor: default; }
.wz-cb.own label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.wz-own-tag { font-size: 10.5px; font-weight: 600; color: var(--brand-600); background: var(--brand-50); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.wz-cb .icon-btn svg { width: 14px; height: 14px; }
.wz-cb .icon-btn.danger:hover { color: var(--bad); }
.wz-cb.editing input[name="label"] { flex: 1; min-width: 0; height: 30px; padding: 0 9px; border: 1px solid var(--brand); border-radius: 7px; font: inherit; font-size: 13px; }
.wz-flaggroup .wz-custom { margin-top: 12px; }
.wz-flaggroup .wz-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- Benachrichtigungen (Glocke) und Regelwerk-Änderungen ---------- */
.notif-switch { position: relative; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.notif-panel { width: min(420px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; padding: 0; top: 46px; right: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2, #eef2f6); cursor: pointer; }
.notif-list li:hover { background: var(--bg); }
.notif-list li strong { display: block; font-size: 13px; line-height: 1.35; }
.notif-list li small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.notif-list li p { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.notif-dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notif-list li.unread .notif-dot { background: var(--brand); }
.notif-list li.unread strong { color: var(--ink); }
.notif-empty { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 13px; }
.rc-intro { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.rc-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.rc-card.open { border-left: 4px solid var(--brand); }
.rc-card.highlight { box-shadow: 0 0 0 3px var(--brand-100); }
.rc-card header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.rc-card h4 { margin: 8px 0 6px; font-size: 14.5px; }
.rc-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.rc-practical { background: var(--brand-50); border-radius: 8px; padding: 8px 10px; }
.rc-sources { font-size: 12px !important; }
.rc-sources a { color: var(--brand-600); }
.rc-card footer { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2, #eef2f6); font-size: 12.5px; }
.rc-note { flex: 1; min-width: 180px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 12.5px; }
.rc-decision { font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.rc-decision.applies { background: #ecfdf5; color: #047857; }
.rc-decision.not_applicable { background: #f1f5f9; color: #475569; }
.rc-empty { text-align: center; padding: 30px 10px; }
.notif-panel .notif-head button { width: auto; padding: 0; font-size: 12px; font-weight: 600; background: none; }

/* ---------- Prozesslandkarte, Entscheidungen, Teilprozesse ---------- */
.proc-map-wrap { flex: 1; overflow: auto; padding: 22px 26px 40px; }
.proc-map { display: flex; flex-direction: column; gap: 16px; max-width: 1280px; margin: 0 auto; }
.map-band { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px 16px 16px; }
.map-band header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.map-band h3 { margin: 0; font-size: 14px; letter-spacing: 0.2px; }
.map-band header p { margin: 0; font-size: 12px; color: var(--muted); }
.map-band.management { border-left: 4px solid #4f46e5; }
.map-band.core { border-left: 4px solid #4f7492; background: linear-gradient(90deg, #f4f8fb, var(--panel)); }
.map-band.support { border-left: 4px solid #0891b2; }
.map-band.none { border-style: dashed; }
.map-row { display: flex; flex-wrap: wrap; gap: 12px; }
.map-band.core .map-row .map-proc { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 10px 50%); padding: 10px 26px 10px 22px; }
.map-card { display: flex; flex-direction: column; gap: 6px; min-width: 200px; max-width: 280px; }
.map-proc { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.map-band.core .map-proc { background: #e8f0f6; border-color: transparent; }
.map-proc:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.map-proc strong { font-size: 13px; }
.map-proc small { font-size: 11px; color: var(--muted); }
.map-kids { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 2px solid var(--line); margin-left: 8px; }
.map-kid { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 4px; font-size: 12px; color: var(--ink); cursor: pointer; text-align: left; border-radius: 6px; }
.map-kid:hover { background: var(--brand-100); }
.map-kid svg { width: 12px; height: 12px; flex: none; color: var(--muted); }
.map-empty { font-size: 12px; margin: 0; }
.proc-trail { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.proc-trail .link-btn { font-size: 12px; }
.d-hint { font-size: 11.5px; margin: 0 0 8px; }
.br-item .fields { flex-direction: column; gap: 4px; }
.br-item select { width: 100%; }

/* ---------- Objektbibliothek, Organigramm, RACI ---------- */
#view-library { overflow: auto; }
.lib { padding: 20px 26px 40px; }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.lib-head h2 { margin: 0 0 4px; font-size: 18px; }
.lib-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.seg-n { font-size: 11px; color: var(--muted); margin-left: 2px; }
.lib-table td { vertical-align: top; }
.lib-table th, .lib-table td { padding: 9px 8px; }
.lib-table input, .lib-table select { width: 100%; min-width: 96px; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 13px; color: var(--ink); }
.lib-table input.main { font-weight: 600; min-width: 170px; }
.lib-table input:hover:not(:disabled), .lib-table select:hover:not(:disabled) { border-color: var(--line); background: #fff; }
.lib-table input:focus, .lib-table select:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.lib-link { display: flex; align-items: center; gap: 4px; }
.lib-link a { text-decoration: none; font-weight: 700; }
.lib-used summary { cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.lib-used ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; }
.lib-used li { margin: 2px 0; }
.lib-add { margin-top: 12px; }
.lib-import { margin-bottom: 12px; }
.lib-empty { border: 1px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; background: var(--panel); }
.lib-empty p { margin: 0 auto 14px; max-width: 640px; line-height: 1.55; }
.lib-empty p:last-child { margin-bottom: 0; }
.org { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.org-root { display: flex; flex-direction: column; align-items: center; padding: 12px 22px; border-radius: 12px; background: #4f7492; color: #fff; position: relative; }
.org-root span { font-size: 12px; opacity: 0.85; }
.org-root::after { content: ""; position: absolute; left: 50%; bottom: -12px; height: 12px; border-left: 2px solid var(--line); }
.org-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; width: 100%; border-top: 2px solid var(--line); padding-top: 18px; }
.org-unit { border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 12px; background: var(--panel); padding: 10px 12px; min-width: 0; }
/* Namen, Rollen und Inhaber einzeilig mit „…“ statt über den Kartenrand hinaus */
.org-unit header strong, .org-unit li strong, .org-unit li small, .org-unassigned li strong, .org-unassigned li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-unit li, .org-unassigned li { min-width: 0; }
.org-unassigned li { max-width: 280px; }
.org-unit header { display: flex; flex-direction: column; margin-bottom: 6px; }
.org-unit header span { font-size: 11px; color: var(--muted); }
.org-unit ul, .org-unassigned ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.org-unit li, .org-unassigned li { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
.org-unit li small, .org-unassigned li small { color: var(--muted); font-size: 11.5px; }
.org-unit .muted { font-size: 12px; margin: 0; }
.org-unassigned { width: 100%; }
.org-unassigned h4 { margin: 0 0 8px; font-size: 13px; }
.org-unassigned ul { flex-direction: row; flex-wrap: wrap; }
.raci-grid { display: grid; grid-template-columns: 132px 1fr; gap: 6px 10px; align-items: center; }
.raci-grid > label { font-size: 12px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 28px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-100); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.chip.r { background: #eef2f7; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--bad); }
.chip-add { border: 1px dashed var(--line); border-radius: 999px; padding: 3px 8px; font-size: 12px; background: #fff; color: var(--muted); max-width: 190px; }
.raci-table th.rot { height: 130px; vertical-align: bottom; padding-bottom: 8px; white-space: nowrap; }
.raci-table th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; }
.raci-cell { text-align: center; white-space: nowrap; }
.raci { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 800; color: #fff; margin: 0 1px; }
.raci.r { background: #4f7492; } .raci.a { background: #d97706; } .raci.c { background: #0891b2; } .raci.i { background: #94a3b8; }
.raci-legend { font-size: 12px; margin-top: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sub-input { display: flex; gap: 8px; align-items: center; }
.sub-input select { flex: 1; min-width: 0; }

/* ---------- Risiken & Kontrollen ---------- */
#view-grc { overflow: auto; }
.score { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11.5px; font-weight: 800; color: #fff; }
.score.hoch { background: #e11d48; } .score.mittel { background: #d97706; } .score.niedrig { background: #059669; }
.grc-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.grc-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 10px 14px; cursor: pointer; text-align: left; }
.grc-kpi b { font-size: 22px; }
.grc-kpi span { font-size: 12px; color: var(--muted); }
.grc-kpi.warn { border-color: #fecdd3; background: #fff1f2; }
.grc-kpi.warn b { color: #be123c; }
.grc-heat { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px; max-width: 760px; }
.heatmap { border-collapse: separate; border-spacing: 4px; }
.heatmap td.hm { width: 86px; height: 52px; border-radius: 8px; text-align: center; font-size: 18px; font-weight: 800; color: #fff; }
.hm.hoch { background: #f43f5e; } .hm.mittel { background: #f59e0b; } .hm.niedrig { background: #34d399; }
.heatmap th { font-size: 11px; font-weight: 600; color: var(--muted); }
.heatmap .hm-l { text-align: right; padding-right: 8px; white-space: nowrap; }
.heatmap .hm-i { text-align: center; padding-top: 4px; width: 86px; }
.hm-axis { display: flex; justify-content: space-between; width: 100%; font-size: 11px; color: var(--muted); margin: 0; }
.grc-table tr.done td { opacity: 0.55; }
.grc-table select { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: #fff; }
.test { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.test.effective { background: #dcfce7; color: #15803d; } .test.limited { background: #fef3c7; color: #b45309; } .test.ineffective { background: #ffe4e6; color: #be123c; }
.overdue { color: #be123c; font-weight: 700; }
.rcm .rcm-cell { text-align: center; font-weight: 800; color: #059669; width: 36px; }
.rcm .rcm-cell.edit { cursor: pointer; }
.rcm .rcm-cell.edit:hover { background: var(--brand-100); }
.rcm tr.rcm-gap th, .rcm tr.rcm-gap td { background: #fff7f8; }
.rcm th { text-align: left; }
.grc-testform { display: grid; grid-template-columns: 130px 1fr; gap: 6px; margin-bottom: 10px; }
.grc-testform input, .grc-testform select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; }
.grc-testform [data-grc-test="note"] { grid-column: 1 / -1; }
.grc-testform button { grid-column: 1 / -1; justify-self: start; }
.grc-tests, .grc-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.grc-tests li { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; position: relative; padding-right: 30px; }
.grc-tests .rm { position: absolute; right: 4px; top: 4px; border: 0; background: none; color: var(--faint); cursor: pointer; }
.grc-tests .rm svg { width: 14px; height: 14px; }
.chip-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chip .score { height: 16px; min-width: 20px; font-size: 10px; }

/* ---------- Lebenszyklus, Versionen, Prozessportal ---------- */
.proc-locked [data-proc-edit] { display: none !important; }
.lc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 6px; margin: 8px 0 4px; background: var(--panel); font-size: 12.5px; }
.lc-status { font-weight: 800; font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase; padding: 3px 9px; border-radius: 7px; background: #e2e8f0; color: #334155; }
.lc-review .lc-status, .lc-approval .lc-status { background: #fef3c7; color: #92400e; }
.lc-released .lc-status { background: #dcfce7; color: #166534; }
.lc-info { flex: 1; min-width: 200px; color: var(--muted); }
.lc-info b { color: var(--ink); }
.lc-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #92400e; }
.lc-lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.lc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-view { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; padding: 18px 22px 40px; }
.lc-col h4 { margin: 18px 0 8px; font-size: 13px; }
.lc-col h4:first-child { margin-top: 0; }
.lc-versions, .lc-acks, .lc-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lc-versions li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); flex-wrap: wrap; }
.lc-versions li > div { display: flex; flex-direction: column; gap: 2px; }
.lc-versions small { color: var(--muted); font-size: 12px; }
.lc-versions li > span { display: flex; gap: 6px; }
.lc-acks li { display: flex; justify-content: space-between; font-size: 12.5px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.lc-history li { font-size: 12.5px; border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }
.lc-history small { color: var(--muted); }
.lc-settings { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.lc-settings input[type=number] { width: 60px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.lc-diff { margin-top: 14px; }
.lc-diff tr.mk-added td { background: #ecfdf5; } .lc-diff tr.mk-changed td { background: #fffbeb; } .lc-diff tr.mk-removed td { background: #fff1f2; text-decoration: line-through; }
.lc-dialog select, .lc-dialog textarea, .lc-dialog input { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; width: 100%; }
#view-portal { overflow: hidden; }
.portal { display: grid; grid-template-columns: 290px minmax(0, 1fr); height: 100%; }
.portal-nav { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.portal-search { padding: 12px; border-bottom: 1px solid var(--line); }
.portal-search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; }
#portalList { flex: 1; overflow: auto; padding: 4px 8px 12px; }
#portalList h5 { margin: 12px 6px 6px; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.portal-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.portal-item:hover { background: #f4f7fa; }
.portal-item.active { background: var(--brand-100); border-color: var(--brand); }
.portal-item small { font-size: 11.5px; color: var(--muted); }
.portal-book { margin: 10px 12px 14px; }
.portal-reader { overflow: auto; padding: 22px 28px 50px; }
.portal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.portal-head h2 { margin: 0 0 4px; }
.portal-head p { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.portal-ack { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 12px; padding: 10px 14px; margin: 8px 0 14px; font-size: 13px; }
.portal-ack.done { border-color: #86efac; background: #f0fdf4; justify-content: flex-start; color: #166534; }
.portal-ack.done svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.portal-old { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; background: #f8fafc; }
.portal-diagram { height: min(640px, 70vh); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 6px; position: relative; overflow: hidden; background: #fff; }
/* Wie .canvas > svg: die allgemeine Icon-Regel (svg { stroke: currentColor; stroke-width: 2 }) zog sonst jeder Schrift
   im Diagramm eine 2-px-Kontur nach – die Beschriftungen verschmierten und waren unlesbar */
.portal-diagram svg { width: 100%; height: 100%; display: block; stroke: none; stroke-width: 1; fill: #000; }
.portal-reader h3 { margin: 22px 0 8px; font-size: 14px; }
.portal-table td { vertical-align: top; font-size: 13px; }
.portal-table small { color: var(--muted); }
.lc-versions li > div > .tag { align-self: flex-start; }
/* Viele Reiter: einzeilig bleiben und bei Platzmangel waagerecht scrollen statt die Seite zu verbreitern */
.tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; min-width: 0; }
.tabs button { white-space: nowrap; flex: none; }
.workspace { min-width: 0; }
.form-dialog select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }

/* Bibliothek: gruppierte Navigation, weitere Objektarten, Datenschutz-Übersicht */
.lib-main { min-width: 0; }
.lib-table input.short { min-width: 70px; }
.lib-table textarea { width: 100%; min-width: 160px; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 13px; color: var(--ink); resize: vertical; }
.lib-table textarea:hover:not(:disabled) { border-color: var(--line); background: #fff; }
.lib-table textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.lib-dp { margin-top: 28px; }
.lib-dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.lib-dp-head h3 { margin: 0 0 4px; font-size: 15px; }
.lib-dp-head p { margin: 0; font-size: 12.5px; max-width: 760px; }
abbr.gloss { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.portal-gloss { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; }
.portal-gloss dt { font-weight: 600; } .portal-gloss dd { margin: 0; color: var(--ink-2, var(--ink)); }
.rc-affected { font-size: 13px; background: var(--brand-50); border-radius: 8px; padding: 8px 10px; }
.rc-procs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.rc-procs li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; }
.rc-chain-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rc-chain { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.rc-chain + .rc-chain::before { content: "→"; margin: 0 6px 0 -2px; color: var(--muted); font-weight: 400; }
.rc-chain.done { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }
.rc-chain.wait { border-color: #fde68a; color: #92400e; background: #fffbeb; }
.rc-chain.draft { border-color: var(--brand); color: var(--brand-600); }
.rc-other { margin-top: 8px; }
.rc-other select { font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.opt-reg { margin: 2px 0 4px; }
.lib-table select { min-width: 120px; }
.lib-note { margin: 0 0 12px; font-size: 12.5px; }
.lib-show svg { color: var(--brand); }
.lib-show.empty svg { color: var(--faint, #94a3b8); }
.lib-text-dialog { width: min(640px, 100%); }
.lib-text-dialog h3 { margin: 0; }
.lib-text-sub { margin: -6px 0 0; font-size: 13px; }
.lib-text-dialog textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.55; resize: vertical; }
.lib-text-dialog textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.lib-text-body { margin: 14px 0 18px; white-space: pre-wrap; line-height: 1.6; font-size: 14px; max-height: 60vh; overflow: auto; }
.lib-reg { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }

/* ---------- Wizard in fünf Schritten (29.10.) ---------- */
.wz-steps li.warn b { background: var(--warn, #d97706); }
.wz-steps li.warn span { color: #b45309; }
.wz-section-sep { height: 1px; background: var(--line); margin: 28px 0 22px; }
.wz-flaggroup { margin-top: 20px; }
.wz-flaggroup h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-600); }
.wz-cb .wz-tag { margin-left: auto; white-space: nowrap; }
.wz-custom-sm { margin-top: 8px; }
.wz-custom-sm input { padding: 6px 10px; font-size: 12.5px; }
.wz-custom-top { margin: 0 0 14px; }
.wz-card strong { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.wz-card:not(.on) { background: var(--panel); }
.wz-card.on { box-shadow: 0 0 0 1px var(--brand) inset; }
.wz-card.on strong { color: var(--brand-600); }
.seg .seg-label { align-self: center; padding: 0 6px 0 4px; font-size: 12px; color: var(--muted); }
.reg-actions .reg-choice { display: flex; flex-direction: column; gap: 4px; background: none; border: 0; padding: 0; }
.reg-choice button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-width: 136px; width: 100%; }
.reg-choice button:hover { border-color: var(--brand-100); }
.reg-choice button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.reg-choice button.on.auto { background: var(--brand-50); color: var(--brand-600); border: 1px dashed var(--brand); }
.reg-just.required { border-color: #f59e0b; background: #fffbeb; }
.wz-gapbox small { color: #92400e; opacity: 0.85; }
.wz-gap-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.wz-split { grid-template-columns: 320px 1fr; }
.wz-unitlist { gap: 8px; }
.wz-unitlist-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.wz-unitlist .wz-order { gap: 4px; max-width: none; }
.wz-unitlist .wz-order li { padding: 4px 6px 4px 4px; gap: 4px; border-radius: 10px; }
.wz-unitlist .wz-order li.on { border-color: var(--brand); background: var(--brand-50); }
.wz-unitlist .wz-order-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; border: 0; background: none; padding: 4px; text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.wz-unitlist .wz-order-name span:not(.wz-order-num) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-unitlist .wz-order-name small { font-size: 11px; color: #b45309; white-space: nowrap; }
.wz-unitlist .wz-order-name small.ok { color: var(--ok); }
.wz-order-btns { display: flex; gap: 0; flex: none; }
.wz-order-btns .icon-btn { width: 24px; height: 24px; font-size: 13px; }
.wz-grip { color: var(--faint, #94a3b8); cursor: grab; padding: 0 2px; }
.wz-note-sm { margin: 4px 0 0; font-size: 11.5px; }
.wz-unit-title { flex: 1; min-width: 0; }
.wz-unit-name-wrap { position: relative; display: flex; align-items: center; margin-left: -7px; }
.wz-unit-name-wrap svg { position: absolute; right: 8px; width: 15px; height: 15px; fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* Als Eingabefeld erkennbar: gestrichelter Rahmen und Stift-Symbol, nicht erst beim Überfahren */
.wz-unit-name { width: 100%; font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); border: 1px dashed #cbd5e1; border-radius: 8px; padding: 3px 30px 3px 6px; background: transparent; }
.wz-unit-name:hover { border-style: solid; border-color: var(--line); background: #fff; }
.wz-unit-name:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-100); }
.wz-tasks-count { margin: 12px 0 0; font-size: 12.5px; }
.wz-inline-check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; }
.wz-inline-check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .wz-split { grid-template-columns: 1fr; } }

/* ---------- Seitenleiste: Projektfortschritt und „Wizard fortsetzen“ ---------- */
.wizard-btn.resume { border-color: var(--brand); background: var(--brand-50); }
.wizard-btn.resume small { color: var(--brand-600); font-weight: 600; }
.progress-card { margin: 8px 12px 0; padding: 10px 12px; background: #fff; border: 1px solid var(--brand-100); border-radius: 12px; box-shadow: var(--shadow-sm); }
.progress-card[hidden] { display: none; }
body.readonly .progress-card { display: none; }
.pg-head { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7f90; font-weight: 600; }
.pg-head b { color: var(--brand-600); letter-spacing: 0; }
.pg-dots { display: flex; gap: 4px; list-style: none; margin: 7px 0 8px; padding: 0; }
.pg-dots li { flex: 1; height: 5px; border-radius: 3px; background: #e2e8f0; }
.pg-dots li.done { background: var(--ok); }
.pg-dots li.now { background: var(--brand); }
.pg-next { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; width: 100%; border: 0; background: none; padding: 0; text-align: left; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-600); cursor: pointer; }
.pg-next small { flex-basis: 100%; font-size: 10.5px; font-weight: 500; color: #6b7f90; }
.pg-next svg { width: 13px; height: 13px; }
.pg-next:hover { text-decoration: underline; }
.pg-done { margin: 0; font-size: 12px; color: var(--ok); font-weight: 600; }
/* Startformular: Felder nicht strecken (sonst große Lücken zwischen den Feldern) */
.form > label { flex: none; }
#projectForm .form-actions { margin-top: auto; }
/* Reihenfolge-Knöpfe immer sichtbar (vorher nur bei Hover – nicht auffindbar), gedämpft bis zum Überfahren */
.wz-unitlist .wz-order-btns { display: flex; opacity: 0.55; transition: opacity 0.15s; }
.wz-unitlist .wz-order li:hover .wz-order-btns, .wz-unitlist .wz-order li.on .wz-order-btns, .wz-unitlist .wz-order li:focus-within .wz-order-btns { opacity: 1; }
.wz-unitlist .wz-order-btns .icon-btn { width: 22px; }

/* ---------- Prozesskopf kompakt, Hinweise auf Abruf, Einfügen (29.10.) ---------- */
.proc-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.proc-meta-row .lc-bar { margin: 0; flex: 0 1 auto; }
.proc-meta-row .proc-kpis { margin-top: 0; flex: 1 1 auto; align-items: center; }
.insight-badge { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--brand-100); background: var(--brand-50); color: var(--brand-600); cursor: pointer; }
.insight-badge.warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.insight-badge svg { width: 13px; height: 13px; }
.insight .btn-ghost { white-space: nowrap; }
.dismiss-form { display: flex; gap: 6px; align-items: center; flex: 1 1 320px; }
.dismiss-form input { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12.5px; }
.muted-insight { background: #f8fafc; color: var(--muted); }
.proc-toolbar { gap: 10px; }
.proc-add { display: flex; gap: 6px; margin-right: auto; }
.d-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.d-move { display: flex; gap: 6px; }
.d-order { align-items: end; }
.d-more { margin: 10px 0 4px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.d-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--brand-600); }
.d-more[open] summary { margin-bottom: 6px; }
.ins-col { width: 36px; text-align: center; }
.click-row .ins-col .icon-btn { opacity: 0.35; }
.click-row:hover .ins-col .icon-btn { opacity: 1; }
.lc-warns { font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; }
.lc-warns ul { margin: 4px 0 0; padding-left: 18px; }
.lc-summary { font-size: 12.5px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 220px; overflow-y: auto; }
.lc-summary ol, .lc-summary ul { margin: 6px 0 0; padding-left: 20px; }
.lc-summary ul { list-style: none; padding-left: 0; }
.lc-summary li { margin: 2px 0; }
.lc-summary small { color: var(--muted); }
.lc-dialog .form-actions { flex-wrap: wrap; gap: 8px; }

/* ---------- Optimierung: Reifegrad-Kachel ---------- */
/* .score ist auch das Risiko-Abzeichen (20 px hoch) – für die Kachel ausdrücklich zurücksetzen */
.kpi.score { display: flex; align-items: center; place-items: initial; gap: 14px; height: auto; min-width: 0; padding: 16px; border-radius: var(--radius); font-size: inherit; font-weight: inherit; background: linear-gradient(135deg, var(--brand), var(--brand-600)); border-color: transparent; color: #fff; }
.kpi.score small { color: #dbe6ef; }
.kpi.score .val { color: #fff; }
/* Business-Unit-Filter: eigene schmale Zeile unter den Reitern statt in der Reiterleiste */
.view-filter { display: flex; justify-content: flex-end; padding: 6px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.view-filter[hidden] { display: none; }
.view-filter .unit-focus { margin-left: 0; padding-bottom: 0; }
/* Workflow optimiert: Zusammenfassung mit Rückgängig; IPO-Bereiche ohne passende Unit */
.wf-result { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; max-width: min(920px, calc(100% - 32px)); padding: 8px 10px 8px 14px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 12.5px; box-shadow: var(--shadow-sm); }
.wf-result[hidden] { display: none; }
.wf-result > svg { width: 16px; height: 16px; flex: none; }
.unknown-party { border-color: #f59e0b !important; background: #fffbeb !important; }
/* Prozessportal: Liste im Untermenü der Seitenleiste, Leseteil in voller Breite */
.portal.portal-full { grid-template-columns: minmax(0, 1fr); }
.rail-sub .portal-search input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 12.5px; margin: 2px 0 6px; }
.portal-railnav { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.portal-railnav h5 { margin: 8px 8px 2px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #6b7f90; }
.rail-sub .portal-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; justify-content: flex-start; padding: 6px 9px; }
.rail-sub .portal-item small { font-size: 11px; font-weight: 500; color: var(--muted); }
.rail-sub .portal-item.active { background: var(--brand-50); color: var(--brand-600); box-shadow: inset 0 0 0 1px var(--brand-100); }
.rail-sub .portal-book { margin-top: 8px; width: 100%; justify-content: center; }
.rail-sub .portal-search { padding: 0; border: 0; }
.rail-sub .portal-book { margin: 8px 0 0; }
/* Risiko ohne Kontrolle: Netto-Bewertung gesperrt */
.net-off .d-row { opacity: 0.45; pointer-events: none; }
.net-note { margin: 0 0 6px; font-size: 12px; }
/* Bibliothek: Beispieltexte nur im aktiven Feld, damit leere Zeilen nicht wie Daten aussehen; fehlender Name markiert */
.lib-table input:not([aria-invalid])::placeholder, .lib-table textarea::placeholder { color: transparent; }
.lib-table input:focus::placeholder, .lib-table textarea:focus::placeholder { color: var(--faint, #94a3b8); }
.lib-table input[aria-invalid="true"] { border-color: #f59e0b; background: #fffbeb; }
.lib-table input[aria-invalid="true"]::placeholder { color: #b45309; }
/* Seitenleiste: „Workflow optimieren“ bleibt beim Scrollen unten sichtbar */
.rail-foot { position: sticky; bottom: 0; background: var(--brand-50); z-index: 2; }
.lc-dialog .btn-pair { display: flex; gap: 8px; flex-wrap: nowrap; }

/* Toolbox für die Swimlane-Modellierung (Drag & Drop) */
.p-toolbox {
  position: absolute; top: 12px; left: 12px; z-index: 5; width: 88px; max-height: calc(100% - 24px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; cursor: default;
  background: var(--panel); border: 1px solid var(--line, #e4e8f0); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
.p-toolbox[hidden] { display: none; }
.tb-head { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 4px; }
.tb-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--ink-2, #334155); font-size: 10.5px; font-weight: 600; line-height: 1.15; cursor: grab; touch-action: none; user-select: none;
}
.tb-item svg { width: 28px; height: 28px; }
.tb-item:hover { background: var(--brand-50); border-color: var(--line, #e4e8f0); }
.tb-item:active { cursor: grabbing; }
.tb-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tb-hint { margin: 6px 2px 0; font-size: 9.5px; line-height: 1.3; color: var(--muted); text-align: center; }
.p-editable .p-node { touch-action: none; }
.p-editable > svg { user-select: none; -webkit-user-select: none; }
.p-node.dragging { opacity: 0.35; }
.dnd-active, .dnd-active * { cursor: grabbing !important; }
.p-ghost {
  position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; display: flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px; border-radius: 10px; background: var(--panel); border: 1.5px solid var(--brand); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
  font-size: 12px; font-weight: 600; color: var(--ink); max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.p-ghost svg { width: 24px; height: 24px; flex: none; }
.p-ghost.no-drop { border-color: #cbd5e1; opacity: 0.75; }
.proc-add-hint { margin-right: auto; font-size: 12px; }


/* BPMN-2.0-Import: Vorschau */
.bpmn-summary { margin: 4px 0 12px; padding-left: 18px; line-height: 1.6; font-size: 13.5px; }
.bpmn-warn { display: flex; gap: 10px; align-items: flex-start; background: #fffbeb; color: #92400e; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.bpmn-warn svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.bpmn-warn ul { margin: 0; padding-left: 16px; }

/* Prozesskosten und Was-wäre-wenn */
.cost-page { display: grid; gap: 14px; max-width: 1280px; }
.cost-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.kpi-tile span { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.kpi-tile b { font-size: 20px; color: var(--ink); }
.kpi-tile small { color: var(--muted); }
.kpi-tile input { font: inherit; font-size: 18px; font-weight: 700; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; background: var(--panel); color: var(--ink); }
.cost-hint, .sc-hint { margin: 0; font-size: 12.5px; }
.cost-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.cost-grid h4, .sc-title { margin: 0 0 8px; }
.cost-table input, .sc-steps input { width: 78px; font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.cost-table input:disabled, .sc-steps input:disabled { background: transparent; border-color: transparent; }
.cost-table .num, .sc-compare .num { text-align: right; white-space: nowrap; }
.bar-cell { position: relative; min-width: 140px; }
.bar-cell span:last-child { position: relative; font-weight: 600; }
.cost-bar { position: absolute; left: 6px; top: 50%; height: 16px; transform: translateY(-50%); background: var(--brand-50); border-radius: 4px; max-width: calc(100% - 12px); }
.cost-default { display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; }
.cost-default input { width: 80px; font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.sc-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-tabs button { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sc-tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.sc-tabs .sc-new { border-style: dashed; color: var(--brand-600); }
.sc-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 14px; display: grid; gap: 10px; }
.sc-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.sc-name { font: inherit; font-size: 16px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; background: transparent; color: var(--ink); min-width: 0; flex: 1; }
.sc-name:hover, .sc-name:focus { border-color: var(--line); }
.sc-levers { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-size: 13px; }
.sc-levers input[type=number] { width: 80px; font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 6px; background: var(--panel); color: var(--ink); }
.sc-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.sc-steps td:first-child { min-width: 220px; }
.sc-lane { display: block; font-size: 11.5px; margin-left: 24px; }
.sc-skip td { opacity: 0.55; }
.sc-skip td:first-child label { text-decoration: line-through; }
.sc-apply { margin-top: 10px; }
@media (max-width: 1100px) { .cost-grid, .sc-grid { grid-template-columns: 1fr; } }

/* Fragen an das Prozessportal */
.portal-main { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.portal-main .portal-reader { flex: 1; min-height: 0; }
.portal-ask { display: flex; gap: 8px; align-items: center; margin: 16px 28px 0; padding: 6px 6px 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04); }
.portal-ask:focus-within { border-color: var(--brand); }
.portal-ask-icon svg { width: 18px; height: 18px; stroke: var(--brand); fill: none; stroke-width: 2; display: block; }
.portal-ask input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 14px; background: transparent; color: var(--ink); }
.portal-answer { margin: 10px 28px 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--line); max-height: 40vh; overflow: auto; }
.portal-answer.none { background: #fffbeb; }
.pa-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.pa-text { line-height: 1.55; font-size: 14px; }
.pa-cites { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--muted); }
.pa-cite { border: 1px solid var(--brand); background: var(--panel); color: var(--brand-600); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pa-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
tr.pa-flash td { background: #fef9c3 !important; transition: background 0.4s; }

/* Soll-Ist-Vergleich (Ist-Daten aus ProcureOne) */
.act-page { display: grid; gap: 14px; max-width: 1280px; }
.act-page h4 { margin: 4px 0 0; }
.act-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.act-head h3 { margin: 0 0 2px; }
.act-head p { margin: 0; font-size: 12.5px; }
.act-table select { font: inherit; font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); max-width: 240px; }
.act-table .num { text-align: right; white-space: nowrap; }
.act-unmapped td { color: var(--muted); }
.kpi-tile b.good, .act-table .good { color: #047857; }
.kpi-tile b.warn, .act-table .warn { color: #b45309; }
.kpi-tile b.bad, .act-table .bad { color: #be123c; }
.act-bar-cell { min-width: 160px; }
.act-bar { position: relative; height: 18px; }
.act-bar .soll { position: absolute; left: 0; top: 0; height: 18px; border: 1.5px dashed #94a3b8; border-radius: 4px; box-sizing: border-box; }
.act-bar .ist { position: absolute; left: 0; top: 5px; height: 8px; border-radius: 4px; background: #10b981; }
.act-bar .ist.warn { background: #f59e0b; }
.act-bar .ist.bad { background: #e11d48; }
.act-bar .p80 { position: absolute; top: 1px; width: 2px; height: 16px; background: var(--ink-2); opacity: 0.5; }
.act-foot { margin: 0; font-size: 12.5px; }
.act-dev { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act-dev li { border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: 10px; padding: 8px 12px; background: var(--panel); }
.act-dev li.hoch { border-left-color: #e11d48; }
.act-dev li.mittel { border-left-color: #f59e0b; }
.act-dev li.niedrig { border-left-color: #4f7492; }
.act-dev li.ok { opacity: 0.6; }
.act-dev p { margin: 2px 0 0; font-size: 12.5px; }
.act-count { font-size: 12.5px; color: var(--ink-2); margin-left: 6px; }
.act-nums { font-family: ui-monospace, monospace; font-size: 12px !important; }

/* Wizard: bewusst nicht vorhandene Kontrollfunktionen mit Begründung */
.wz-gapbox .wz-decline-form { flex-direction: row; display: flex; gap: 6px; margin-top: 6px; }
.wz-decline-form input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid #fcd34d; border-radius: 8px; font: inherit; font-size: 12.5px; background: #fff; }
.wz-declined { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.wz-declined .wz-note { margin: 0 0 2px; }
.wz-declined-row { display: grid; grid-template-columns: minmax(160px, 260px) 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.wz-declined-row input { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 12.5px; }
.wz-declined-row.missing input { border-color: #f59e0b; background: #fffbeb; }
.confirm-reason { width: 100%; height: 36px; padding: 0 12px; margin: 4px 0 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; box-sizing: border-box; }
.grc-removed { margin-top: 8px; font-size: 12px; color: var(--muted); }
.grc-removed summary { cursor: pointer; }
.grc-tests li.removed { opacity: 0.7; text-decoration: none; }

/* Prozessportal: Zoom-Knöpfe über dem Diagramm (Lesemaßstab mindestens 80 %, siehe MIN_READABLE) */
.portal-diagram-wrap { position: relative; }
.portal-zoom { position: absolute; top: 10px; right: 10px; z-index: 2; background: #fff; box-shadow: var(--shadow-sm); }
.portal-diagram-hint { margin: 0 0 12px; font-size: 12px; }

/* ---------- Demo-Projekte (Betreiber) ---------- */
.demo-modal { width: min(940px, 100%); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.demo-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.demo-col h4 { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.demo-card, .demo-role { display: flex; text-align: left; width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.demo-card { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; }
.demo-role { align-items: center; gap: 10px; padding: 10px 12px; }
.demo-card:hover, .demo-role:hover { border-color: var(--brand); }
.demo-card.on, .demo-role.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-100); }
.demo-name { font-weight: 600; font-size: 15px; }
.demo-desc { font-size: 13px; color: var(--muted); }
.demo-procs { display: flex; flex-wrap: wrap; gap: 4px; }
.demo-procs span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg, #f3f4f6); border: 1px solid var(--line); }
.demo-role .grow { min-width: 0; }
.demo-role small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--line); }
.demo-foot .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.demo-foot .check input { margin-top: 3px; }
.demo-foot .check small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; max-width: 52ch; }
.demo-foot .btn { flex: none; }
.demo-note { margin: 0; padding: 0 24px 16px; font-size: 12px; }
@media (max-width: 720px) { .demo-grid { grid-template-columns: 1fr; } .demo-foot { flex-direction: column; align-items: stretch; } }
.demo-role .avatar-sm { flex: none; }
