: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: #4f46e5;
  --brand-600: #4338ca;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --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; }
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, #6366f1, #4f46e5 45%, #0891b2);
  box-shadow: 0 6px 18px -4px rgba(99, 102, 241, 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; }

.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, 70, 229, 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, #6366f1, #4f46e5 50%, #0891b2);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 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(99, 102, 241, 0.16); border-color: rgba(129, 140, 248, 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: linear-gradient(135deg, #6366f1, #0891b2);
}
.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, 70, 229, 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: #c7d2fe; }

/* ---------- 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 #6366f1; }
.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(--navy-900), #1e1b4b); color: #e2e8f0; border: 0; }
.score small { color: #a5b4fc; }
.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: center; 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; }
.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: 440px; 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(99, 102, 241, 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; }
.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(99, 102, 241, 0.18); border: 1px solid rgba(129, 140, 248, 0.35); color: #c7d2fe;
}
.share-btn:hover { background: rgba(99, 102, 241, 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, #6366f1, #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; }

.auth-overlay { background: radial-gradient(1000px 600px at 20% 10%, #1e1b4b, var(--navy-950) 70%); backdrop-filter: none; }
.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; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.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: 0 1 auto; max-height: 34%; }
.proc-num { background: rgba(99, 102, 241, 0.22); color: #c7d2fe; }
.proc-num svg { width: 14px; height: 14px; }

#view-processes { overflow: hidden; }
.proc-main { height: 100%; }
.proc-bar { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.proc-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; }
.proc-tab { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 5px 12px; text-align: left; flex: none; max-width: 240px; }
.proc-tab strong { font-size: 12.5px; }
.proc-tab small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.proc-tab:hover { border-color: var(--brand-100); }
.proc-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px -6px rgba(79, 70, 229, 0.7); }
.proc-tab.active small { color: #c7d2fe; }
.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-new { position: relative; }
.proc-new .menu { left: auto; right: 0; min-width: 260px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); font-size: 14px; }
.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: #3730a3; }
.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: #3730a3; }
.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, 70, 229, 0.18)); }
.click-row { cursor: pointer; }
.click-row:hover td { background: #f8fafc; }
.click-row.sel td { background: var(--brand-50); }
.cmp-cell { text-align: center; }
.cmp { display: inline-flex; min-width: 54px; justify-content: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cmp.yes { background: #ecfdf5; color: #047857; }
.cmp.cond { background: #fffbeb; color: #b45309; cursor: help; }
.cmp.no { color: var(--faint); }
.matrix tr.sum th, .matrix tr.sum td { background: #f8fafc; border-top: 2px solid var(--line); }
.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 { max-width: 760px; 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(2, 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: linear-gradient(135deg, #6366f1, #0891b2); 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; }
.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: #3730a3; 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); }
.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(129, 140, 248, 0.35); background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(8, 145, 178, 0.14)); color: #e0e7ff;
}
.wizard-btn:hover { background: linear-gradient(135deg, rgba(99, 102, 241, 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: #a5b4fc; }
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: linear-gradient(90deg, var(--navy-950), #1e1b4b); color: #e2e8f0; }
.wz-title { display: flex; gap: 12px; align-items: center; }
.wz-title h3 { margin: 0; font-size: 16px; color: #fff; }
.wz-title p { margin: 2px 0 0; font-size: 12px; color: #a5b4fc; }
.wz-head .icon-btn { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); color: #e2e8f0; }
.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-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: absolute; right: 10px; top: 10px; }
.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-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: 14px; border-radius: 12px; background: linear-gradient(135deg, #f5f7ff, #f0fdfa); border: 1px solid var(--brand-100); display: flex; flex-direction: column; gap: 8px; }
.wz-describe label { font-size: 12.5px; font-weight: 600; color: #3730a3; }
.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; }
.wz-card:has(.wz-tag) strong { padding-right: 56px; }

/* ---------- 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 { opacity: 0.75; }
.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); }
.reg-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.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); }
