/* v0.11 (25.04.): Space Grotesk als globale UI-Font (geometrisch, gut bei Mono-Anteilen). */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090b;
  --bg-secondary: #131316;
  --bg-input: #0c0c0f;
  --border: #222228;
  --text: #e4e4e7;
  --text-muted: #6e6e77;
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --error: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --user-bg: #151518;
  --agent-bg: #131316;
  --code-bg: #151518;
  --shadow: none;
  --agent-accent: #3b82f6;
  --agent-accent-dim: rgba(59, 130, 246, 0.15);
}

/* --- Theme: Emerald --- */
[data-theme="emerald"] {
  --accent: #00f0a0; --accent-dim: rgba(0, 240, 160, 0.10);
  --success: #00f0a0; --error: #ff4466; --warning: #ffaa00;
}

/* --- Theme: Neon Purple --- */
[data-theme="neon-purple"] {
  --accent: #b44aff; --accent-dim: rgba(180, 74, 255, 0.10);
  --success: #22c55e; --error: #ff4477; --warning: #ffaa00;
}

/* --- Theme: Neon Orange --- */
[data-theme="warm-sand"] {
  --accent: #ff6a00; --accent-dim: rgba(255, 106, 0, 0.10);
  --success: #22c55e; --error: #ff4444; --warning: #ff6a00;
}

/* --- Theme: Phonk Purple (v0.11, 25.04.) — Boomy/KBK-Akzent: Lila Hauptton + Orange Highlight --- */
[data-theme="phonk-purple"] {
  --accent: #8B5CF6; --accent-dim: rgba(139, 92, 246, 0.12);
  --accent-strong: #A855F7;
  --accent-orange: #F97316; --accent-orange-dim: rgba(249, 115, 22, 0.15);
  --success: #22c55e; --error: #ef4444; --warning: #F97316;
  --agent-accent: #8B5CF6; --agent-accent-dim: rgba(139, 92, 246, 0.15);
}

/* --- Theme: Daylight (Light) --- */
[data-theme="daylight"] {
  --bg: #FFFFFF; --bg-secondary: #F1F3F5; --bg-input: #FFFFFF;
  --border: #D0D0D6; --text: #18181b; --text-muted: #5c5c66;
  --accent: #2563EB; --accent-dim: rgba(37, 99, 235, 0.08);
  --error: #DC2626; --success: #16a34a; --warning: #d97706;
  --user-bg: #ECF0FF; --agent-bg: #F7F7FA;
  --code-bg: #F1F3F5; --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Light-Theme: Borders statt unsichtbare Kanten */
[data-theme="daylight"] .sidebar { border-right: 1px solid var(--border); }
[data-theme="daylight"] .topbar { border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
[data-theme="daylight"] .agent-card:hover { background: var(--bg-secondary); }

html { height: 100%; background: var(--bg); }

body {
  height: 100%; height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 17px; line-height: 1.6;
  overflow: hidden; -webkit-overflow-scrolling: touch;
}

/* --- Auth Screens (gemeinsame Basis) --- */
.auth-screen {
  display: none; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 20px;
  padding: 24px;
}
.auth-screen.visible { display: flex; }
.auth-screen h1 { font-size: 24px; font-weight: 600; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
.auth-screen .subtitle { color: var(--text-muted); font-size: 15px; text-align: center; }
.auth-screen .auth-error { color: var(--error); font-size: 13px; min-height: 20px; text-align: center; }

.auth-input {
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 17px; text-align: center;
  padding: 14px 20px; width: 320px; max-width: 90vw; border-radius: 14px;
  outline: none; -webkit-appearance: none;
}
.auth-input:focus { border-color: var(--accent); }

.auth-btn {
  background: var(--accent); border: none; color: #0d1117; font-family: inherit;
  font-size: 17px; font-weight: 700; padding: 14px 36px; border-radius: 14px;
  cursor: pointer; width: 320px; max-width: 90vw;
  -webkit-tap-highlight-color: transparent;
}
.auth-btn:hover { opacity: 0.9; }
.auth-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.remember-device {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  width: 320px; max-width: 90vw; justify-content: center;
}
.remember-device input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer;
}

.setup-help {
  text-align: left; width: 320px; max-width: 90vw;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 8px;
  font-size: 14px; line-height: 1.6; color: var(--text-muted);
}
.setup-help p { margin: 0 0 8px 0; }
.setup-help ol { margin: 0; padding-left: 20px; }
.setup-help li { margin-bottom: 4px; }
.setup-help strong { color: var(--text); }
.setup-help em { color: var(--accent); font-style: normal; }

#session-warning {
  padding: 10px 16px; background: rgba(248, 176, 53, 0.15);
  color: var(--warning); font-size: 14px; font-weight: 600;
  text-align: center; flex-shrink: 0;
}

/* CLI-Lock Indikator */
.cli-indicator {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  cursor: pointer; margin-right: 6px; transition: all 0.3s ease;
}
.cli-indicator.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.cli-indicator.paused { background: var(--error); box-shadow: 0 0 6px var(--error); animation: cli-pulse 1.5s infinite; }
@keyframes cli-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* CLI-Konflikt-Banner */
#cli-conflict-banner {
  padding: 10px 16px; background: rgba(248, 81, 73, 0.15);
  color: var(--error); font-size: 14px; text-align: center; flex-shrink: 0;
}
#cli-conflict-banner button {
  background: var(--accent); color: #0d1117; border: none; border-radius: 6px;
  padding: 4px 12px; margin-left: 8px; cursor: pointer; font-weight: 600;
}

/* Killswitch Button */
.killswitch-btn {
  background: var(--error) !important; color: #fff !important;
  font-weight: 700;
}

.auth-link {
  color: var(--text-muted); font-size: 16px; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  background: none; border: none; font-family: inherit;
}
.auth-link:hover { color: var(--text); }

/* --- PIN Screen --- */
#pin-screen {
  /* erbt .auth-screen — sichtbar per JS */
}
#pin-input {
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 28px; letter-spacing: 6px; text-align: center;
  padding: 18px 28px; width: 300px; max-width: 85vw; border-radius: 14px;
  outline: none; -webkit-appearance: none;
}
#pin-input:focus { border-color: var(--accent); }
#pin-error { color: var(--error); font-size: 14px; height: 20px; }

/* --- Login Screen --- */
#login-screen .auth-input { letter-spacing: normal; text-align: left; }
#login-screen .auth-input[type="password"] { letter-spacing: 4px; text-align: center; }

/* --- TOTP Screen --- */
#totp-screen .totp-input {
  font-size: 36px; letter-spacing: 10px; text-align: center;
  width: 240px;
}

/* --- TOTP Setup Screen --- */
#totp-setup-screen .qr-wrapper {
  background: #fff; padding: 16px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
#qr-image { width: 180px; height: 180px; display: block; }
#totp-secret-text {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 14px;
  color: var(--text-muted); background: var(--bg-secondary);
  border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px;
  word-break: break-all; text-align: center; max-width: 320px;
  user-select: all;
}

/* --- Chat Screen --- */
#chat-screen {
  display: none; flex-direction: column;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%;
}

/* Header */
#header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary); flex-shrink: 0;
}
#hamburger {
  background: transparent; border: none; color: var(--text);
  font-size: 28px; padding: 8px 12px; cursor: pointer; line-height: 1;
  -webkit-tap-highlight-color: transparent; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.header-icon-img { width: 24px; height: 24px; object-fit: contain; image-rendering: auto; }
#hamburger:hover { background: var(--accent-dim); }
#header .agent-info { flex: 1; margin-left: 12px; }
#header .agent-title {
  font-size: 18px; font-weight: 600; color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
#header .agent-subtitle { font-size: 13px; color: var(--text-muted); }
#header .status { font-size: 14px; display: flex; align-items: center; gap: 8px; padding-right: 4px; }
#header .status .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
#header .status .dot.offline { background: var(--error); }

/* --- Sidebar --- */
/* Sidebar z-index 2026-05-10: ueber alle Vollbild-Panels (2000) und Modale
   (3000-6000) damit der Hamburger-Klick aus jeder Ansicht heraus die Sidebar
   drueber fahren laesst (statt darunter zu verschwinden). Mermaid-Fullscreen
   bleibt mit z-index 9000 ueber der Sidebar. */
#sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  z-index: 7999;
}
#sidebar-overlay.open { opacity: 1; pointer-events: auto; }

#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 310px; max-width: 85vw;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 8000;
  overflow: hidden;            /* 11.04.2026 Redesign: keine Sidebar-Scrollbar mehr */
  display: flex; flex-direction: column;
}
#sidebar.open { transform: translateX(0); }

#sidebar-header {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
#sidebar-header h2 { font-size: 18px; font-weight: 600; color: var(--text); }
#sidebar-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1;
  border-radius: 6px;
}
#sidebar-close:hover { color: var(--text); background: var(--accent-dim); }

/* ---------- Top-Bar: 2 häufigste Actions immer sichtbar ---------- */
.sidebar-topbar {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.topbar-btn:hover { background: rgba(59,130,246,0.25); }
.topbar-btn:active { transform: scale(0.97); }
.topbar-btn-icon {
  width: 18px; height: 18px;
  object-fit: contain; image-rendering: auto;
}

/* ---------- Accordion ---------- */
#sidebar-accordion {
  flex: 1 1 auto;              /* füllt den gesamten restlichen Platz */
  display: flex; flex-direction: column;
  min-height: 0;               /* wichtig für nested Flex + overflow */
}

.accordion-section {
  display: flex; flex-direction: column;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;              /* geschlossene Sektionen haben fixe Höhe */
  min-height: 0;
}
.accordion-section.open {
  flex: 1 1 auto;              /* offene Sektion bekommt den ganzen Rest */
  min-height: 0;
}

.accordion-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  text-align: left; width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  flex-shrink: 0;
}
.accordion-header:hover { background: rgba(255,255,255,0.04); }
.accordion-section.open > .accordion-header {
  background: rgba(59,130,246,0.08);
  color: var(--text);
}
.accordion-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.accordion-icon-img {
  width: 18px; height: 18px;
  object-fit: contain; image-rendering: auto;
  filter: brightness(0.85);
}
.accordion-section.open .accordion-icon-img { filter: brightness(1); }
.accordion-title {
  flex: 1;
  letter-spacing: 0.3px;
}
.accordion-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-section.open .accordion-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion-body {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;            /* nur IN einer offenen Sektion gibt es Scroll */
  padding: 8px 12px 16px;
}
.accordion-section.open > .accordion-body {
  display: flex;
  flex-direction: column;
}
/* Scroll nur im Accordion-Body versteckt, nicht der Sidebar selbst */
.accordion-body::-webkit-scrollbar { width: 4px; }
.accordion-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.accordion-subheader {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 10px 8px 6px;
}
.accordion-subheader:first-child { padding-top: 4px; }

/* Agent-Listen im neuen Accordion-Kontext */
#agent-list-teamleiter { padding: 0 4px; }
#agent-list-spezialisten {
  padding: 0 4px 0 16px;
  position: relative;
}
#agent-list-spezialisten::before {
  content: '';
  position: absolute;
  left: 4px; top: 4px; bottom: 12px;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}

.accordion-actions {
  margin-top: auto;             /* schiebt Spawn/Archiv ans untere Ende */
  padding-top: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.accordion-action {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer; font-family: inherit;
  text-align: left; width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.accordion-action:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: var(--border);
}
.accordion-action .action-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.accordion-action .action-icon-img {
  width: 18px; height: 18px;
  object-fit: contain; image-rendering: auto;
  filter: brightness(0.7);
}
.accordion-action:hover .action-icon-img { filter: brightness(1); }

.accordion-action-muted { opacity: 0.75; font-size: 13px; }
#spawn-agent-btn {
  border: 1px dashed var(--accent);
  color: var(--accent);
  background: rgba(59,130,246,0.06);
}
#spawn-agent-btn:hover { background: rgba(59,130,246,0.14); }
.accordion-action-danger { color: var(--error); }
.accordion-action-danger:hover {
  background: rgba(248,81,73,0.08);
  border-color: var(--error);
  color: var(--error);
}

/* --- Theme-Picker --- */
.theme-picker { padding: 10px 14px; }
.theme-picker-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-bottom: 8px;
}
.theme-picker-options { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; transition: transform 0.15s, border-color 0.15s;
  padding: 0; outline: none;
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot-active {
  border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim);
  transform: scale(1.1);
}

/* --- CLI-Config --- */
.cli-config { padding: 10px 14px; }
.cli-config-input {
  width: 100%; padding: 8px 10px; margin-bottom: 6px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 13px;
  outline: none;
}
.cli-config-input:focus { border-color: var(--accent); }
.cli-config-input::placeholder { color: var(--text-muted); }

.account-info {
  padding: 10px 14px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  margin-bottom: 10px;
}
.account-info-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 4px;
}
.account-info-name {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

/* Basis-Card */
.agent-card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 6px; border-radius: 12px;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.agent-card:hover { background: rgba(255,255,255,0.04); }
.agent-card.active {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.agent-card .agent-icon { font-size: 32px; flex-shrink: 0; line-height: 1; }
.agent-icon-img {
  width: 32px; height: 32px; border-radius: 6px; object-fit: contain; vertical-align: middle;
  image-rendering: auto;
}
.agent-card .agent-meta { flex: 1; min-width: 0; }
.agent-card .agent-name { font-size: 16px; font-weight: 600; color: var(--text); }
.agent-card .agent-desc { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Teamleiter-Card: größer, Accent-Rand links */
.agent-card-teamleiter {
  padding: 18px 16px;
  border-left: 3px solid var(--accent);
}
.agent-card-teamleiter .agent-icon { font-size: 44px; }
.agent-card-teamleiter .agent-icon .agent-icon-img { width: 44px; height: 44px; border-radius: 8px; }
.agent-card-teamleiter .agent-name { font-size: 18px; font-weight: 700; }
.agent-card-teamleiter .agent-delegates {
  font-size: 11px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Spezialisten-Card: kleiner, mit Verbindungs-Ast */
.agent-card-spezialist {
  position: relative;
  margin-left: 12px;
  padding: 10px 14px;
}
.agent-card-spezialist::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%;
  width: 12px; height: 2px;
  background: var(--border);
}
.agent-card-spezialist .agent-icon { font-size: 28px; }
.agent-card-spezialist .agent-icon .agent-icon-img { width: 28px; height: 28px; }
.agent-card-spezialist .agent-name { font-size: 14px; }
.agent-card-spezialist .agent-desc { font-size: 12px; }

/* Legacy .sidebar-action Block entfernt 11.04.2026 (Sidebar-Redesign).
   Die Actions leben jetzt in .topbar-btn (immer sichtbar) und
   .accordion-action (in den Accordion-Sektionen "Werkzeuge" und "Konto"). */

.action-icon-img { width: 20px; height: 20px; object-fit: contain; image-rendering: auto; filter: brightness(0.7); }

/* --- Sidebar Direct-Action-Button (Sidebar-Reorg 2026-05-10) ---
   Nutzt das Akkordeon-Header-Layout (Icon + Title), aber ohne Chevron
   und ohne expand-collapse — klickt direkt auf eine Vollbild-Aktion. */
.sidebar-action-button {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 16px 18px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border, #27272a);
  color: var(--text, #e5e7eb);
  font-family: inherit; font-size: 15px; font-weight: 600;
  text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s, color 0.15s, box-shadow 0.18s;
  flex-shrink: 0;
}
.sidebar-action-button:hover {
  background: var(--accent-dim, rgba(108,99,255,0.12));
  color: var(--accent, #6C63FF);
}
.sidebar-action-button:active {
  background: var(--accent-dim, rgba(108,99,255,0.2));
  transform: scale(0.99);
}
.sidebar-action-button .accordion-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-action-button .accordion-icon-img {
  width: 20px; height: 20px;
  filter: brightness(0.85);
  transition: filter 0.15s;
}
.sidebar-action-button:hover .accordion-icon-img {
  filter: brightness(1.1);
}

/* --- Voice-Picker-Row im Konto (Sidebar-Reorg 2026-05-10) --- */
.voice-picker-row {
  display: flex; flex-direction: column; gap: 6px;
  margin: 8px 12px 4px;
  padding: 12px;
  background: var(--bg-tertiary, #1f1f23);
  border: 1px solid var(--border, #27272a);
  border-radius: 10px;
}
.voice-picker-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.voice-picker-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg, #0d1117);
  color: var(--text, #e5e7eb);
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  font-family: inherit; font-size: 14px;
  cursor: pointer;
}
.voice-picker-select:focus {
  outline: none; border-color: var(--accent, #6C63FF);
  box-shadow: 0 0 0 3px var(--accent-dim, rgba(108,99,255,0.2));
}

/* --- Wartungsmodus-Toggle (Admin-only, Konto-Sektion) --- */
.wartungsmodus-row {
  margin: 4px 12px 8px;
  padding: 12px 14px;
  background: var(--bg-tertiary, #1f1f23);
  border: 1px solid var(--border, #27272a);
  border-radius: 10px;
}
.wartungsmodus-label {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; user-select: none;
}
.wartungsmodus-text {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.wartungsmodus-title {
  font-size: 14px; font-weight: 600; color: var(--text, #e5e7eb);
}
.wartungsmodus-hint {
  font-size: 11px; color: var(--text-muted, #9ca3af); line-height: 1.3;
}
.wartungsmodus-label input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.wartungsmodus-switch {
  position: relative; width: 44px; height: 24px;
  background: var(--bg, #0f0f12); border: 1px solid var(--border, #3a3a40);
  border-radius: 999px; flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.wartungsmodus-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: var(--text-muted, #71717a);
  border-radius: 50%; transition: transform 0.18s ease, background 0.18s ease;
}
.wartungsmodus-label input[type="checkbox"]:checked ~ .wartungsmodus-switch {
  background: var(--accent-dim, rgba(59,130,246,0.25));
  border-color: var(--accent, #3b82f6);
}
.wartungsmodus-label input[type="checkbox"]:checked ~ .wartungsmodus-switch::after {
  transform: translateX(20px); background: var(--accent, #3b82f6);
  box-shadow: 0 0 8px var(--accent, #3b82f6);
}

#sidebar-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
  flex-shrink: 0;
}

/* Messages */
#messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
}

.msg {
  max-width: 95%; padding: 14px 16px; border-radius: 16px;
  font-size: 17px; word-break: break-word; line-height: 1.6;
}
.msg.user { align-self: flex-end; background: var(--user-bg); border: 1px solid var(--border); white-space: pre-wrap; }
.msg.agent { align-self: flex-start; background: var(--agent-bg); border: 1px solid var(--border); border-left: 3px solid var(--accent); position: relative; }
/* Long-Message-Collapse: max-height ist zur Laufzeit über CSS-Variable
   --msg-collapse-height aus hub.json (reports.max_display_height_px) gesetzt.
   Default 400px (hub.json-Standardwert). Fix 15.04.2026 (UI2). */
.msg.agent .body,
.msg.notification .body { max-height: var(--msg-collapse-height, 400px); overflow-y: hidden; position: relative; }
.msg.agent .body.collapsed::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 60px; background: linear-gradient(transparent, var(--agent-bg));
  pointer-events: none;
}
.msg.notification .body.collapsed::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 60px; background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.msg.agent .body.expanded,
.msg.notification .body.expanded { max-height: none; }
.msg.agent .body.expanded::after,
.msg.notification .body.expanded::after { display: none; }
.msg-expand-btn {
  display: none; width: 100%; padding: 8px; margin-top: 4px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; color: var(--accent); font-size: 13px;
  font-weight: 600; cursor: pointer; text-align: center;
}
.msg-expand-btn:hover { background: var(--accent-dim); }

/* Boomy-Bericht — ausklappbares Bericht-Fenster im Chat (WS-4.1) */
.boomy-bericht { margin-top: 12px; }
.boomy-bericht-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #3b82f6);
  padding: 7px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #222228);
  border-radius: 8px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.boomy-bericht-summary::-webkit-details-marker { display: none; }
.boomy-bericht-summary::before {
  content: "▸";
  display: inline-block;
  font-size: 11px;
  transition: transform 0.18s ease;
}
.boomy-bericht[open] .boomy-bericht-summary::before { transform: rotate(90deg); }
.boomy-bericht-summary:hover { background: rgba(255,255,255,0.07); border-color: var(--accent, #3b82f6); }
.boomy-bericht[open] .boomy-bericht-summary { background: var(--accent-dim, rgba(59,130,246,0.12)); border-color: var(--accent, #3b82f6); }
.boomy-bericht-body {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary, #131316);
  border: 1px solid var(--border, #222228);
  border-radius: 8px;
  font-size: 14px;
}
.msg.system { align-self: center; background: transparent; color: var(--text-muted); font-size: 14px; border: none; padding: 6px; }
.msg.error { align-self: flex-start; background: rgba(248, 81, 73, 0.1); border: 1px solid rgba(248, 81, 73, 0.3); color: var(--error); }
.msg.notification { align-self: flex-start; background: var(--accent-dim); border: 1px solid var(--accent-dim); border-left: 3px solid var(--accent); width: 100%; max-width: 100%; }
.msg.notification .notif-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.msg.notification .notif-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.msg.notification .notif-title { font-size: 16px; font-weight: 700; color: var(--accent); }
.msg.notification .body { white-space: normal; }
.msg.notification .body p { margin-bottom: 10px; }
.msg.notification .body p:last-child { margin-bottom: 0; }
.msg.notification .body strong { color: #fff; }
.msg.notification .body table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 0.9em; }
.msg.notification .body th, .msg.notification .body td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.msg.notification .body th { background: rgba(124, 58, 237, 0.15); font-weight: 600; }
.msg .role { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.msg.agent .role { color: var(--accent); }
.role-icon { display: inline-flex; flex-shrink: 0; }
.role-icon .agent-icon-img { width: 16px; height: 16px; }
.msg .time { font-size: 13px; color: var(--text-muted); margin-top: 8px; text-align: right; }

/* Bilder im Chat */
.chat-image {
  max-width: 256px;
  max-height: 256px;
  border-radius: 12px;
  image-rendering: auto;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border: 1px solid var(--border);
  display: block;
}
.chat-image-wrap { margin: 8px 0; }
.image-msg { border-left: 3px solid var(--accent); }

/* Interaktive Prompts */
.prompt-msg { border-left: 3px solid var(--accent); }
.prompt-question { font-size: 16px; margin-bottom: 10px; color: var(--text); }
.prompt-options { display: flex; flex-wrap: wrap; gap: 8px; }
.prompt-btn {
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); cursor: pointer;
  font-size: 15px; font-family: inherit; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.prompt-btn:hover { background: var(--accent); color: #0d1117; }
.prompt-btn.selected { background: var(--accent); color: #0d1117; }
.prompt-btn:disabled { opacity: 0.4; cursor: default; }
.prompt-btn:disabled:hover { background: transparent; color: var(--accent); }
.prompt-btn.selected:disabled { opacity: 1; background: var(--accent); color: #0d1117; }

/* Tool-Aktivitäts-Anzeige */
#tool-activity {
  display: none;
  padding: 6px 20px;
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}
#tool-activity.visible { display: block; }

/* Markdown in Agent-Nachrichten */
.msg.agent .body { white-space: normal; }
.msg.agent .body p { margin-bottom: 12px; }
.msg.agent .body p:last-child { margin-bottom: 0; }
.msg.agent .body strong { color: #fff; font-weight: 700; }
.msg.agent .body em { font-style: italic; color: var(--text-muted); }
.msg.agent .body code {
  background: var(--code-bg); padding: 2px 7px; border-radius: 5px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.88em;
}
.msg.agent .body pre {
  background: var(--code-bg); padding: 14px; border-radius: 10px;
  overflow-x: auto; margin: 12px 0; border: 1px solid var(--border);
}
.msg.agent .body pre code { background: none; padding: 0; font-size: 0.85em; display: block; white-space: pre; }
.msg.agent .body ul, .msg.agent .body ol { padding-left: 24px; margin: 10px 0; }
.msg.agent .body li { margin-bottom: 6px; }
.msg.agent .body h1, .msg.agent .body h2, .msg.agent .body h3 {
  color: #fff; font-weight: 700; margin: 16px 0 8px 0;
}
.msg.agent .body h1 { font-size: 1.2em; }
.msg.agent .body h2 { font-size: 1.1em; }
.msg.agent .body h3 { font-size: 1.05em; }
.msg.agent .body hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.msg.agent .body a { color: var(--accent); text-decoration: none; }
.msg.agent .body blockquote {
  border-left: 3px solid var(--accent); padding-left: 14px;
  color: var(--text-muted); margin: 10px 0;
}

/* Streaming-Cursor */
.msg.agent.streaming .body::after {
  content: ''; display: inline-block; width: 10px; height: 22px;
  background: var(--accent); margin-left: 4px; vertical-align: text-bottom;
  animation: cursor-blink 0.8s steps(1) infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Typing Indicator */
#typing {
  display: none; padding: 10px 16px; color: var(--text-muted);
  font-size: 15px; flex-shrink: 0;
}
#typing .dots span { animation: blink 1.4s infinite both; }
#typing .dots span:nth-child(2) { animation-delay: 0.2s; }
#typing .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Upload-Vorschau */
#upload-preview {
  display: none; padding: 8px 16px;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  flex-shrink: 0; position: relative;
}
#upload-preview.visible { display: flex; align-items: center; gap: 12px; }
#upload-preview-img {
  max-width: 120px; max-height: 80px; border-radius: 8px;
  border: 1px solid var(--border); object-fit: contain;
  image-rendering: auto;
}
#upload-cancel {
  background: rgba(248, 81, 73, 0.15); border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--error); font-size: 18px; width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
#upload-cancel:hover { background: rgba(248, 81, 73, 0.3); }

/* Input Area */
#input-area {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border); background: var(--bg-secondary); flex-shrink: 0;
}

/* Attach-Button */
#attach-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: 14px; cursor: pointer; flex-shrink: 0;
  align-self: flex-end; min-height: 50px; width: 48px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
#attach-btn:hover { background: var(--accent-dim); border-color: var(--accent); }
#attach-btn.has-file { border-color: var(--accent); background: var(--accent-dim); }
.attach-icon-img {
  width: 22px; height: 22px; object-fit: contain;
  image-rendering: auto; opacity: 0.6;
}
#attach-btn:hover .attach-icon-img,
#attach-btn.has-file .attach-icon-img { opacity: 1; }
#msg-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 17px; padding: 14px 16px; border-radius: 14px;
  outline: none; resize: none; min-height: 50px; max-height: 140px; -webkit-appearance: none;
}
#msg-input:focus { border-color: var(--accent); }
#send-btn {
  background: var(--accent); border: none; color: #0d1117; font-family: inherit;
  font-size: 17px; font-weight: 700; padding: 14px 22px; border-radius: 14px;
  cursor: pointer; flex-shrink: 0; align-self: flex-end; min-height: 50px;
  -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.send-icon-img { width: 24px; height: 24px; object-fit: contain; image-rendering: auto; }
/* Send-Button Mode-Switch (Senden/Mic/Stop — genau EIN Icon sichtbar pro Mode).
   Default verstecken alle drei, dann ueber data-mode-Attribut das passende
   freigeben. Ohne diese Regeln waeren alle drei block-displayed. */
#send-btn .send-icon-img { display: none; }
#send-btn[data-mode="send"] .send-mode-icon { display: block; }
#send-btn[data-mode="mic"] .mic-mode-icon { display: block; }
#send-btn[data-mode="recording"] .recording-mode-icon { display: block; }
#send-btn:hover { opacity: 0.9; }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Reconnect Banner */
#reconnect-banner {
  display: none; padding: 12px 16px; background: rgba(248, 81, 73, 0.25);
  color: var(--error); font-size: 15px; font-weight: 600;
  text-align: center; flex-shrink: 0;
  animation: reconnect-pulse 2s ease-in-out infinite;
}
@keyframes reconnect-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Queue-Status-Banner (v1.0 Queue-First) --- */
.qsb {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; gap: 16px;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.qsb.idle {
  background: rgba(59, 130, 246, 0.08);
  border-bottom-color: var(--accent);
  color: var(--text-muted);
}
.qsb.busy {
  background: rgba(255, 140, 0, 0.12);
  border-bottom-color: var(--warning);
  color: var(--text);
}
.qsb-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.qsb-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.qsb.idle .qsb-dot { background: var(--accent); }
.qsb.busy .qsb-dot {
  background: var(--warning);
  animation: qsb-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.6);
}
@keyframes qsb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 0, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(255, 140, 0, 0); }
}
.qsb-label {
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  font-size: 12px; flex-shrink: 0;
}
.qsb.idle .qsb-label { color: var(--accent); }
.qsb.busy .qsb-label { color: var(--warning); }
.qsb-task {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.qsb-meta {
  font-size: 12px; color: var(--text-muted);
  flex-shrink: 0;
}
.qsb-pending:not(:empty) {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

/* --- Position-Toggle (nur sichtbar bei BUSY) --- */
#queue-position-toggle {
  display: none;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  padding: 3px;
  flex-shrink: 0;
  align-self: flex-end;
  min-height: 50px;
}
#queue-position-toggle.visible { display: flex; }
.qpt-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qpt-btn:hover { color: var(--text); }
.qpt-btn.active {
  background: var(--accent);
  color: #0d1117;
}
/* IDLE-State (Fix 15.04.2026) — Queue ist leer, Task startet sowieso sofort.
   Toggle bleibt sichtbar als Hinweis, Später-Button ist deaktiviert. */
#queue-position-toggle.qpt-idle { opacity: 0.75; }
#queue-position-toggle.qpt-idle .qpt-btn[data-pos="end"] {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* --- Admin Panel — Phase B 2026-05-10: nutzt .fullscreen-panel-Pattern,
       eigene #admin-panel/#admin-header/#admin-back-Regeln entfallen.
       #admin-body bleibt als ID-Selektor erhalten fuer JS-Hooks, Layout
       kommt aus .panel-body. --- */

#admin-create-form {
  display: none; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
  gap: 12px; flex-direction: column;
}
#admin-create-form.visible { display: flex; }
#admin-create-form h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.admin-form-input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 18px; padding: 12px 16px; border-radius: 10px;
  outline: none; -webkit-appearance: none; width: 100%;
}
.admin-form-input:focus { border-color: var(--accent); }
.admin-form-row { display: flex; gap: 10px; }
.admin-form-row .admin-form-input { flex: 1; }
.admin-form-select {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 18px; padding: 12px 16px; border-radius: 10px;
  outline: none; width: 100%; cursor: pointer;
}
.admin-form-select:focus { border-color: var(--accent); }
.admin-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-btn {
  background: var(--accent); border: none; color: #0d1117;
  font-family: inherit; font-size: 16px; font-weight: 700;
  padding: 10px 22px; border-radius: 10px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.admin-btn:hover { opacity: 0.9; }
.admin-btn.secondary {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.admin-btn.secondary:hover { color: var(--text); background: var(--accent-dim); }
.admin-btn.danger {
  background: rgba(248, 81, 73, 0.15); color: var(--error);
  border: 1px solid rgba(248, 81, 73, 0.3);
}
.admin-btn.danger:hover { background: rgba(248, 81, 73, 0.25); }
.admin-error { color: var(--error); font-size: 14px; min-height: 18px; }

#admin-user-list { display: flex; flex-direction: column; gap: 14px; }
.admin-user-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
}
.admin-user-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.admin-user-name { font-size: 20px; font-weight: 600; color: var(--text); flex: 1; }
.admin-user-role {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 6px;
  background: var(--accent-dim); color: var(--accent);
}
.admin-user-role.admin { background: rgba(248, 81, 73, 0.12); color: var(--error); }
.admin-user-status { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.admin-user-agents { font-size: 15px; color: var(--text-muted); margin-bottom: 14px; }
.admin-user-agents strong { color: var(--text); }
.admin-agent-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.admin-agent-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; color: var(--text-muted); cursor: pointer;
  padding: 4px 0;
}
.admin-agent-check input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.admin-user-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Activity-Log Panel — Phase B 2026-05-10: .fullscreen-panel-Pattern. --- */

#activity-summary {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.activity-stat {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; text-align: center; min-width: 65px;
}
.activity-stat-value { font-size: 20px; font-weight: 700; color: var(--accent); }
.activity-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

#activity-filters {
  display: flex; gap: 10px; margin-bottom: 16px;
}
#activity-filters .admin-form-select {
  flex: 1; font-size: 15px; padding: 10px 12px;
}

#activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-entry {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; font-size: 14px;
}
.activity-entry-top {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap;
}
.activity-entry-time { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.activity-entry-source {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
}
.activity-entry-source.scheduler { background: var(--accent-dim); color: var(--accent); }
.activity-entry-source.agent { background: var(--accent-dim); color: var(--text-muted); }
.activity-entry-source.system { background: rgba(248, 176, 53, 0.12); color: #f8b035; }
.activity-entry-category {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.activity-entry-category.guardrail { background: rgba(248, 176, 53, 0.1); color: #f8b035; }
.activity-entry-category.auth { background: rgba(248, 81, 73, 0.1); color: var(--error); }
.activity-entry-category.queue { background: var(--accent-dim); color: var(--accent); }
.activity-entry-category.job { background: var(--accent-dim); color: var(--text-muted); }
.activity-entry-action { font-weight: 600; color: var(--text); flex: 1; }
.activity-entry-details {
  color: var(--text-muted); font-size: 13px; word-break: break-word;
  max-height: 60px; overflow-y: auto;
}
.activity-entry-user { font-size: 12px; color: var(--text-muted); }
.activity-entry-file { font-size: 12px; color: var(--text-muted); font-family: monospace; }

#activity-pagination {
  display: flex; justify-content: center; gap: 10px; margin-top: 16px;
}
#activity-pagination button {
  background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 15px; padding: 10px 20px; border-radius: 8px; cursor: pointer;
}
#activity-pagination button:hover { background: var(--accent-dim); }
#activity-pagination button:disabled { opacity: 0.4; cursor: default; }

/* --- Vollbild-Panel-Pattern (UX-Refactor 2026-05-10) ---
   Wird von #processes-panel verwendet. Header sticky oben, Body
   scrollbar darunter. Hamburger im Header oeffnet die Sidebar
   waehrend Panel sichtbar bleibt — Flow-Anforderung "fester Header
   in jeder Ansicht". */
.fullscreen-panel {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: var(--bg); flex-direction: column;
}
.fullscreen-panel.visible { display: flex; }

.panel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.panel-hamburger {
  background: transparent; border: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px;
  min-width: 48px; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;       /* keine 300ms Touch-Delay auf iOS */
  transition: background 0.15s, box-shadow 0.18s, transform 0.12s;
  position: relative;               /* klar als oberster Layer im Header */
}
.panel-hamburger:active { transform: scale(0.92); background: var(--accent-dim); }
.panel-hamburger:hover { background: var(--accent-dim); box-shadow: 0 0 12px var(--accent-dim, rgba(99,102,241,0.2)); }
.panel-hamburger img { width: 22px; height: 22px; filter: brightness(0.95); }
.panel-title-wrap { flex: 1; min-width: 0; }
.panel-title {
  font-size: 18px; font-weight: 600; color: var(--accent);
  margin: 0; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.panel-subtitle {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0.85;
}
.panel-close {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 28px; cursor: pointer; padding: 4px 12px;
  border-radius: 10px; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.panel-close:hover { background: var(--accent-dim); color: var(--text); }

/* Action-Buttons rechts im Panel-Header (Phase B 2026-05-10):
   Verwaltung hat "+ User", Activity-Log hat Refresh-Icon, Queue hat 4 Buttons.
   Kompakter dimensioniert als Body-admin-btn, damit Header nicht ueberlaeuft. */
.panel-action-group {
  display: flex; gap: 6px; flex-wrap: nowrap; flex-shrink: 0;
}
.panel-action {
  font-size: 14px !important;
  padding: 8px 12px !important;
  min-height: 36px;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .panel-action {
    font-size: 13px !important;
    padding: 7px 10px !important;
  }
  .panel-action-group { gap: 4px; }
  .panel-header { gap: 8px; padding: 12px 12px; }
}

.panel-body {
  flex: 1; overflow-y: auto; padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.panel-search-wrap {
  position: sticky; top: 0; z-index: 5;
  padding-bottom: 12px; margin: -16px -16px 16px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.panel-search-input {
  width: 100%; padding: 12px 16px;
  font-size: 15px; font-family: inherit;
  background: var(--bg-secondary); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.panel-search-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Process-Cards-Grid: Mobile 1-spaltig, Desktop 2-spaltig.
   Erbt .process-item-Styles aus dem alten Sidebar-Layout — die Cards
   sind heute schon Buttons mit Title+Summary+Tags, nur jetzt im Grid. */
.process-cards-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .process-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .process-cards-grid { grid-template-columns: repeat(3, 1fr); }
}
.process-cards-grid .process-group {
  grid-column: 1 / -1;
}
.process-cards-grid .process-group-label {
  font-size: 12px; padding: 4px 0 8px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.process-cards-grid .process-group + .process-group { margin-top: 16px; }

/* Process-Items im Vollbild-Grid bekommen mehr Polish + Glow auf Hover */
.fullscreen-panel .process-item {
  transition: background 0.15s, border-color 0.15s, box-shadow 0.18s, transform 0.12s;
}
.fullscreen-panel .process-item:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 16px var(--accent-dim);
  transform: translateY(-1px);
}

/* --- Queue Panel — Phase B 2026-05-10: .fullscreen-panel-Pattern. --- */

#queue-add-form {
  display: none; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
  gap: 12px; flex-direction: column;
}
#queue-add-form.visible { display: flex; }
#queue-add-form h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.queue-textarea {
  resize: vertical; min-height: 80px; max-height: 200px;
  font-family: inherit; line-height: 1.4;
}
.queue-approval-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; color: var(--text-muted); cursor: pointer;
}
.queue-approval-label input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

#queue-stats {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.queue-stat {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px; flex: 1; min-width: 80px; text-align: center;
}
.queue-stat-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.queue-stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

#queue-approvals { margin-bottom: 16px; }
.queue-approval-card {
  background: rgba(248, 176, 53, 0.08); border: 1px solid rgba(248, 176, 53, 0.3);
  border-radius: 12px; padding: 16px 20px; margin-bottom: 12px;
}
.queue-approval-title {
  font-size: 16px; font-weight: 600; color: #f8b035; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.queue-approval-prompt {
  font-size: 14px; color: var(--text-muted); margin-bottom: 12px;
  white-space: pre-wrap; word-break: break-word;
  max-height: 100px; overflow-y: auto;
}
.queue-approval-meta {
  font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.queue-approval-actions { display: flex; gap: 10px; }

#queue-task-list { display: flex; flex-direction: column; gap: 10px; }
.queue-task-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
}
.queue-task-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.queue-task-title { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.queue-task-priority {
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: var(--accent-dim); color: var(--accent);
}
.queue-task-status {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 8px; border-radius: 6px;
}
.queue-task-status.pending { background: var(--accent-dim); color: var(--accent); }
.queue-task-status.completed { background: rgba(63, 185, 80, 0.12); color: var(--success); }
.queue-task-status.failed { background: rgba(248, 81, 73, 0.12); color: var(--error); }
.queue-task-status.in_progress { background: rgba(248, 176, 53, 0.12); color: #f8b035; }
.queue-task-status.rejected { background: rgba(248, 81, 73, 0.08); color: var(--text-muted); }
.queue-task-meta { font-size: 13px; color: var(--text-muted); }
.queue-task-status.pending_approval { background: rgba(248, 176, 53, 0.12); color: #f8b035; }

/* Ergebnis-Anzeige in Task-Karten */
.queue-task-result {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.queue-result-section { margin-bottom: 8px; }
.queue-result-header {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--accent); margin-bottom: 6px;
}
.queue-result-content {
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
  max-height: 400px; overflow-y: auto;
  background: var(--bg-tertiary); border-radius: 8px; padding: 12px;
}
.queue-result-content pre {
  background: #161b22; border-radius: 6px; padding: 10px;
  overflow-x: auto; margin: 8px 0;
}
.queue-result-content code {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px;
}

.queue-badge {
  background: var(--accent); color: #000; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; margin-left: auto;
}

/* --- Passwort-Modal --- */
#pw-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,0.65); align-items: center; justify-content: center;
}
#pw-modal-overlay.visible { display: flex; }
#pw-modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 360px; max-width: 92vw;
  display: flex; flex-direction: column; gap: 16px;
}
#pw-modal h3 { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.pw-modal-input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 20px; padding: 14px 18px; border-radius: 12px;
  outline: none; -webkit-appearance: none; width: 100%;
  letter-spacing: 3px;
}
.pw-modal-input:focus { border-color: var(--accent); }
#pw-modal-error { color: var(--error); font-size: 14px; min-height: 18px; }
.pw-modal-actions { display: flex; gap: 12px; }
.pw-modal-actions .admin-btn { flex: 1; padding: 14px; font-size: 17px; }

/* --- Confirm-Modal --- */
#confirm-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 4000;
  background: rgba(0,0,0,0.7); align-items: center; justify-content: center;
}
#confirm-modal-overlay.visible { display: flex; }
#confirm-modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 340px; max-width: 92vw;
  display: flex; flex-direction: column; gap: 18px; text-align: center;
}
#confirm-modal h3 { font-size: 20px; font-weight: 600; color: var(--text); }
#confirm-modal p { font-size: 16px; color: var(--text-muted); line-height: 1.6; }
.confirm-modal-actions { display: flex; gap: 12px; }
.confirm-modal-actions .admin-btn { flex: 1; padding: 14px; font-size: 17px; }

/* PixelFlow Galerie — Redesign 11.04.2026: Kategorie-Dropdown statt alle 13 gleichzeitig.
   Icons sind jetzt deutlich größer, das Accordion gibt ihnen den nötigen Platz. */
.gallery-category-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.gallery-category-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  flex-shrink: 0;
}
.gallery-category-select {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.gallery-category-select:focus {
  outline: none;
  border-color: var(--accent);
}
.gallery-grid-large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  padding: 0 4px;
}
.gallery-grid-large .gallery-icon {
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.gallery-grid-large .gallery-icon:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(1.05);
}
.gallery-grid-large .gallery-icon img {
  width: 100%; height: 100%;
  max-width: 72px; max-height: 72px;
  image-rendering: auto;
  -ms-interpolation-mode: nearest-neighbor;
  object-fit: contain;
}
.gallery-empty-hint {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Keine Scrollbars */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* --- Responsive Design --- */

/* Smartphones (bis 768px) — Accordion-Galerie bleibt grösser als früher,
   weil jetzt das ganze Sektions-Höhenfenster für eine Kategorie da ist. */
@media (max-width: 768px) {
  .gallery-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
  }
  .gallery-grid-large .gallery-icon { padding: 6px; }
}

/* Mobile Touch-Targets (WCAG min 44x44px) */
@media (max-width: 600px) {
  .auth-btn { padding: 16px 32px; min-height: 48px; font-size: 17px; }
  #hamburger { padding: 12px; min-width: 48px; min-height: 48px; }
  .topbar-btn { padding: 12px 16px; min-height: 44px; }
  .sidebar-agent { min-height: 48px; }
  .auth-error { font-size: 15px; }
  .subtitle { font-size: 16px; }

  /* Fix 15.04.2026: Auf Smartphone darf Text umbrechen statt abgeschnitten
     werden (Desktop hat Platz → ellipsis OK, Mobile nicht). Regression U3/U4
     (Queue-Header-Button-Abschneiden 13.04.) hat hier Analogie — wenn der
     Platz eng wird, lieber wrappen als abschneiden. */
  .agent-card .agent-desc {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    line-height: 1.35;
  }
  .agent-card .agent-name { word-break: break-word; }
  #header .agent-title, #header .agent-subtitle { word-break: break-word; }
  #header-agent-name, #header-agent-subtitle {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) {
  .msg { max-width: 80%; }
  #messages { padding: 20px 32px; }
  #input-area { padding: 14px 32px; }
  #sidebar { width: 360px; }
}

/* Desktop (> 1024px) */
@media (min-width: 1025px) {
  body { font-size: 18px; line-height: 1.6; }
  .msg { max-width: 65%; font-size: 17px; line-height: 1.65; padding: 16px 18px; }
  .msg .role { font-size: 14px; }
  .msg .time { font-size: 14px; }
  #messages { padding: 24px 48px; }
  #input-area { padding: 16px 48px; max-width: 900px; margin: 0 auto; width: 100%; }
  #upload-preview { padding: 8px 48px; max-width: 900px; margin: 0 auto; width: 100%; }
  #header { padding: 12px 32px; }
  #header .agent-title { font-size: 20px; }
  #header .agent-subtitle { font-size: 14px; }
  #msg-input { font-size: 17px; padding: 14px 16px; min-height: 50px; }
  #send-btn { font-size: 17px; padding: 14px 22px; min-height: 50px; }
  #attach-btn { min-height: 50px; width: 48px; }
  .chat-image { max-width: 400px; max-height: 400px; }
}

/* Landscape-Modus auf Smartphones */
@media (max-height: 500px) and (orientation: landscape) {
  #header { padding: 6px 16px; }
  #header .agent-title { font-size: 20px; }
  #header .agent-subtitle { display: none; }
  #typing { padding: 6px 18px; font-size: 17px; }
  #msg-input { min-height: 48px; max-height: 80px; }
  #send-btn { min-height: 48px; padding: 10px 20px; }
  #attach-btn { min-height: 48px; }
}

/* --- Setup-Wizard (Erstlogin-Onboarding) --- */
#wizard-overlay {
  display: none; position: fixed; inset: 0; z-index: 6000;
  background: rgba(0,0,0,0.75);
  align-items: center; justify-content: center;
  padding: 16px;
}
#wizard-overlay.visible { display: flex; }
@supports (backdrop-filter: blur(6px)) {
  #wizard-overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
}
#wizard-card {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  width: 100%; max-width: 500px; max-height: 92vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
  box-sizing: border-box;
}
#wizard-progress { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#wizard-progress-label {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
#wizard-progress-dots { display: flex; gap: 10px; }
.wizard-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: background 0.2s;
}
.wizard-dot.active { background: var(--accent); }
.wizard-dot.done { background: var(--accent); opacity: 0.5; }
.wizard-step { display: none; flex-direction: column; gap: 14px; }
.wizard-step.active { display: flex; }
.wizard-step h2 {
  font-size: 22px; font-weight: 600; color: var(--text);
  margin: 0; line-height: 1.3;
}
.wizard-intro {
  font-size: 15px; color: var(--text-muted); line-height: 1.5; margin: 0;
}
.wizard-bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.wizard-bullets li {
  font-size: 15px; color: var(--text); line-height: 1.5;
  padding-left: 20px; position: relative;
}
.wizard-bullets li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.wizard-cli-status {
  font-size: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text-muted);
}
.wizard-cli-status.ok {
  color: var(--text);
  border-color: rgba(88, 166, 110, 0.4);
  background: rgba(88, 166, 110, 0.1);
}
.wizard-cli-status.warn {
  color: var(--text);
  border-color: rgba(210, 153, 34, 0.4);
  background: rgba(210, 153, 34, 0.1);
}
.wizard-push-status {
  font-size: 14px; min-height: 20px; color: var(--text-muted);
}
.wizard-push-status.ok { color: var(--accent); }
.wizard-error { color: var(--error); font-size: 14px; min-height: 18px; }
.wizard-actions {
  display: flex; gap: 12px; margin-top: 6px;
}
.wizard-actions .admin-btn { flex: 1; padding: 14px; font-size: 16px; }
@media (max-width: 480px) {
  #wizard-card { padding: 20px; border-radius: 12px; }
  .wizard-step h2 { font-size: 19px; }
}

/* --- Spawn-Modal + Archiv (Phase 2) --- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; width: 92vw;
  max-height: 85vh; overflow-y: auto;
}
.modal-input {
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 15px; padding: 12px 14px; border-radius: 10px;
  outline: none; width: 100%; box-sizing: border-box;
}
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text-muted); }
select.modal-input { cursor: pointer; }
textarea.modal-input { line-height: 1.5; }
.modal-btn {
  border: none; color: var(--text); font-family: inherit; font-size: 15px;
  padding: 10px 20px; border-radius: 10px; cursor: pointer;
}
.modal-btn:active { opacity: 0.8; }

/* Admin: Verzeichnis-Eingabe pro User */
.admin-dirs-input {
  width: 100%; margin: 6px 0; padding: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-family: monospace;
  font-size: 13px; resize: vertical;
}
.admin-dirs-input:focus { border-color: var(--accent); outline: none; }
.admin-user-dirs { margin: 8px 0; font-size: 13px; }
.admin-user-dirs strong { font-size: 12px; color: var(--text-muted); }

/* Edit-Button auf Agent-Cards */
.agent-edit-btn {
  position: absolute; top: 6px; right: 6px;
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
  opacity: 0; transition: opacity 0.15s;
}
.agent-card:hover .agent-edit-btn { opacity: 1; }
.agent-edit-btn:hover { color: var(--accent); background: var(--bg-secondary); }

/* Icon-Auswahl im Edit-Modal */
.edit-icon-option {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; border: 1px solid transparent;
  transition: border-color 0.15s;
}
.edit-icon-option:hover { border-color: var(--accent); background: var(--bg-secondary); }
.edit-icon-option img { border-radius: 4px; image-rendering: auto; }

/* Farb-Picker im Spawn-Modal */
.color-dot {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.color-dot.selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* Archiv-Karte */
.archive-card {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 10px;
}
.archive-card .archive-name { font-weight: 600; color: var(--text); }
.archive-card .archive-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.archive-card .archive-briefing {
  font-size: 13px; color: var(--text-muted); margin-top: 8px;
  white-space: pre-wrap; max-height: 80px; overflow: hidden;
}

/* Despawn-Button auf Projekt-Agent Card */
.agent-despawn-btn {
  position: absolute; top: 6px; right: 8px;
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; opacity: 0.5; padding: 2px 6px;
}
.agent-despawn-btn:hover { opacity: 1; color: var(--error); }
.agent-card-spezialist { position: relative; }

/* Mode-Badge (Tag/Nacht-Pill) — entfernt 25.04. v0.11, ersetzt durch
   Queue-Mode-Switch im Header (#queue-mode-switch). CSS-Block gestrichen. */

/* ============================================================
   Schema v7: Queue-Form Mode-Toggle (Nacht/Sofort)
   ============================================================ */
.queue-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0 6px;
}
.queue-mode-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s;
}
.queue-mode-option:hover {
  border-color: var(--accent);
}
.queue-mode-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.queue-mode-option span {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.queue-mode-option small {
  color: var(--text-muted);
  font-size: 11px;
}
.queue-mode-option.queue-mode-active {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) inset;
}

/* ============================================================
   Schema v7: Memory-Modal — Topic-Liste
   ============================================================ */
.memory-entry-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  background: var(--bg);
}
.memory-entry-row .memory-entry-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.memory-entry-row .memory-entry-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.memory-entry-row .memory-entry-type {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  margin-right: 6px;
}

/* Mode-Badge Mobile-Regel — entfernt 25.04. v0.11 (Mode-Badge weg). */

/* ============================================================
   Mode-Toast (generischer Status-Toast — wird noch verwendet)
   ============================================================ */
.mode-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 7000;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid currentColor;
  background: var(--bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.mode-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Tag/Nacht-spezifische Toast-Klassen (.mode-toast-day/-night) entfernt
   25.04. v0.11. Generischer .mode-toast oben bleibt für andere Notifications. */
.mode-toast-info {
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

/* ============================================================
   Schema v7 Hot-Fix U1: Re-Approval Help-Box (Queue-Modal)
   ============================================================ */
.queue-help-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.30);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.queue-help-box strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.queue-help-box code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

/* ============================================================
 * v0.11 (25.04.) — UI-Politur-Sweep
 * ============================================================ */

/* Boomy-Logo (Pixel-Sprite Subwoofer-Cone, 32x32) — smooth, NICHT pixelated.
   Memory-Erkenntnis 25.04.: image-rendering:pixelated war falsch — Logo ist
   ein eigenständiger Sprite, kein Sprite-Sheet, soll bei Skalierung weich. */
#header-agent-icon img,
.agent-card-icon img,
.agent-icon-img {
  image-rendering: auto !important;
}

/* Subtitle hide wenn leer (agents.json subtitle_pattern: "" -> Platz zurueckgeben) */
#header-agent-subtitle:empty,
.agent-subtitle:empty,
.agent-desc:empty {
  display: none !important;
}

/* Master-Trigger-Btn (legacy floating Btn) — defensiv hide falls Plugin
   in alter Version doch noch was inserted. Master-Panel läuft jetzt
   über window.HubMasterAPI.show() aus der Sidebar. */
.master-trigger {
  display: none !important;
}

/* Queue-Position-Toggle: Element existiert noch im DOM (index.html) als
   defensive Reserve, ist aber dauerhaft hidden. Mode-Switch im Header hat
   die Funktion übernommen. */
#queue-position-toggle {
  display: none !important;
}

/* --- Queue-Mode-Switch (Manuell / Auto) im Header --- */
#queue-mode-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  user-select: none;
}
#queue-mode-switch .qms-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: background 120ms ease, color 120ms ease;
}
#queue-mode-switch .qms-btn:hover {
  color: var(--text);
}
#queue-mode-switch .qms-btn.active {
  color: var(--bg);
  background: var(--accent);
}
#queue-mode-switch.mode-auto .qms-btn[data-mode="auto"].active {
  background: var(--accent-orange, var(--warning));
  color: #0d1117;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}
#queue-mode-switch .qms-counter {
  margin-left: 4px;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: center;
}
#queue-mode-switch.mode-auto .qms-counter {
  background: var(--accent-orange-dim, var(--accent-dim));
  color: var(--accent-orange, var(--accent));
}

@media (max-width: 600px) {
  #queue-mode-switch .qms-btn { padding: 4px 8px; font-size: 11px; }
  #queue-mode-switch .qms-counter { font-size: 10px; padding: 1px 6px; min-width: 18px; }
}

/* --- Agent-Busy-Banner (v0.11) ---
   Erscheint wenn User mid-Task auf Manuell-Modus toggelt: Agent bearbeitet
   den laufenden Task fertig, danach kommt die Welcome-Back-Bubble im Chat. */
.agent-busy-banner {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: 90vw;
  padding: 10px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.30),
              inset 0 0 0 1px rgba(139, 92, 246, 0.10);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 220ms ease, transform 220ms ease;
}
.agent-busy-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#msg-input:disabled {
  opacity: 0.6;
  cursor: wait;
}


/* ===================================================================== 
   Prozess-Bibliothek (Phase 2.9, portiert von Sp2 03.05.2026)
   Sidebar-Sektion + Detail-Modal mit Mermaid + Markdown
   ===================================================================== */
.process-search-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-tertiary, #16181e);
  border: 1px solid var(--border, #27272a);
  border-radius: 6px;
  color: var(--text, #e5e7eb);
  font-size: 13px;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.process-search-input:focus { outline: none; border-color: var(--accent, #3b82f6); }
.process-list-container { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 280px); overflow-y: auto; padding-right: 4px; }
.process-empty { color: var(--text-muted, #71717a); font-size: 13px; padding: 16px 4px; text-align: center; }
.process-group { display: flex; flex-direction: column; gap: 4px; }
.process-group-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted, #71717a); padding: 4px 4px 2px; }
.process-item { width: 100% !important; text-align: left !important; padding: 10px 12px !important; background: var(--bg-secondary, #18181b) !important; border: 1px solid var(--border, #27272a) !important; border-radius: 6px !important; cursor: pointer; transition: background 0.12s, border-color 0.12s; display: flex !important; flex-direction: column !important; gap: 4px !important; font-family: inherit !important; color: var(--text, #e5e7eb) !important; }
.process-item:hover { background: var(--bg-tertiary, #1f1f23); border-color: var(--accent, #3b82f6); }
.process-item-name { font-size: 13px; font-weight: 600; color: var(--text, #e5e7eb); }
.process-item-summary { font-size: 12px; color: var(--text-muted, #9ca3af); line-height: 1.4; }
.process-item-tags { display: flex; gap: 4px; margin-top: 2px; flex-wrap: wrap; }

.process-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4; }
.process-badge.process-status-live { background: rgba(34,197,94,0.18); color: #22c55e; }
.process-badge.process-status-draft { background: rgba(234,179,8,0.18); color: #eab308; }
.process-badge.process-status-planned { background: rgba(59,130,246,0.18); color: #3b82f6; }
.process-badge.process-status-deprecated { background: rgba(239,68,68,0.18); color: #ef4444; }
.process-badge.process-tier-core { background: rgba(168,85,247,0.18); color: #a855f7; }
.process-badge.process-tier-strong-default { background: rgba(99,102,241,0.18); color: #818cf8; }
.process-badge.process-badge-module { background: var(--accent-dim, rgba(59,130,246,0.15)); color: var(--accent, #60a5fa); }

#process-modal .modal-content.process-modal-content { max-width: 920px !important; width: 92vw !important; max-height: 90vh !important; display: flex !important; flex-direction: column !important; padding: 0 !important; overflow: hidden !important; background: var(--bg-secondary, #131316) !important; }
.process-modal-header { padding: 20px 24px 12px; border-bottom: 1px solid var(--border, #27272a); }
.process-modal-titlebar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.process-modal-titlebar h2 { margin: 0; font-size: 20px; line-height: 1.3; color: var(--text, #f4f4f5); flex: 1; }
.modal-close-btn {
  background: transparent; border: none; color: var(--text-muted, #9ca3af);
  font-size: 28px; line-height: 1; cursor: pointer;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, background 0.15s, transform 0.15s;
}
.modal-close-btn:hover { color: var(--text, #f4f4f5); background: var(--accent-dim, rgba(99,102,241,0.15)); }
.modal-close-btn:active { transform: scale(0.94); }
.process-modal-meta { display: flex !important; gap: 6px !important; margin-top: 8px; flex-wrap: wrap; }
.process-item-tags { display: flex !important; gap: 4px !important; margin-top: 2px; flex-wrap: wrap; }
.process-modal-summary {
  color: var(--text, #e5e7eb);
  font-size: 16px;
  line-height: 1.55;
  margin: 14px 0 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-dim, rgba(99,102,241,0.10)) 0%, transparent 70%);
  border-left: 3px solid var(--accent, #6C63FF);
  border-radius: 0 8px 8px 0;
}
.process-modal-body { padding: 16px 24px 24px; overflow-y: auto; flex: 1; }

/* Klick-Anleitung (2026-05-10, Schema user-hilfe-v1): nummerierte
   Schrittliste prominent zwischen Summary und Diagramm. */
.process-klick-anleitung {
  margin: 18px 0 6px;
  padding: 14px 16px 16px;
  background: var(--bg-tertiary, #1f1f23);
  border: 1px solid var(--border, #27272a);
  border-radius: 10px;
}
.process-klick-h {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent, #6C63FF);
}
.process-klick-list {
  margin: 0; padding: 0 0 0 22px;
  font-size: 14px; line-height: 1.55; color: var(--text, #e5e7eb);
  counter-reset: klickstep;
  list-style: none;
}
.process-klick-list li {
  position: relative;
  margin: 6px 0;
  padding-left: 8px;
}
.process-klick-list li::before {
  counter-increment: klickstep;
  content: counter(klickstep);
  position: absolute;
  left: -22px; top: 1px;
  width: 18px; height: 18px;
  background: var(--accent-dim, rgba(99,102,241,0.18));
  color: var(--accent, #6C63FF);
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Body-Collapse (2026-05-10): Technische Details default zugeklappt,
   damit das Modal nicht mit Markdown-Wand erschlägt. */
.process-details-collapse {
  margin-top: 18px;
  border-top: 1px solid var(--border, #27272a);
  padding-top: 12px;
}
.process-details-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #6C63FF);
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.process-details-summary::-webkit-details-marker { display: none; }
.process-details-summary::before {
  content: "▸";
  display: inline-block;
  font-size: 11px;
  transition: transform 0.18s ease;
}
.process-details-collapse[open] .process-details-summary::before {
  transform: rotate(90deg);
}
.process-details-summary:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent, #6C63FF);
  box-shadow: 0 0 12px var(--accent-dim, rgba(99,102,241,0.2));
}
.process-details-collapse[open] .process-details-summary {
  background: var(--accent-dim, rgba(99,102,241,0.15));
  border-color: var(--accent, #6C63FF);
  margin-bottom: 12px;
}
.process-details-body {
  padding: 4px 6px;
  animation: process-details-fadein 0.22s ease;
}
@keyframes process-details-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.process-modal-flow { display: flex; align-items: stretch; gap: 12px; margin-bottom: 20px; padding: 14px; background: var(--bg-tertiary, #1f1f23); border-radius: 8px; }
.process-flow-block { flex: 1; min-width: 0; }
.process-flow-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #71717a); margin-bottom: 4px; }
.process-flow-text { font-size: 13px; color: var(--text, #e5e7eb); line-height: 1.4; }
.process-flow-arrow { display: flex; align-items: center; color: var(--accent, #3b82f6); font-size: 22px; font-weight: 600; }

.process-section-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted, #9ca3af); margin: 16px 0 8px; }
.process-mermaid {
  background: var(--bg-tertiary, #1f1f23);
  border: 1px solid var(--border, #27272a);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
  min-height: 60px;
  position: relative;
}
.process-mermaid svg { max-width: 100% !important; height: auto !important; min-width: 0 !important; display: inline-block; }
#process-modal-mermaid { min-height: 380px; height: 60vh; max-height: 600px; overflow: hidden; cursor: grab; padding: 0; background: var(--bg-card-deep, #0b0b0d); border-radius: 4px; user-select: none; display: flex; align-items: center; justify-content: center; }
#process-modal-mermaid:active { cursor: grabbing; }
#process-modal-mermaid svg { display: block; max-width: none !important; max-height: none !important; min-width: 0 !important; min-height: 0 !important; }
.werkzeuge-nav { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border, #27272a); overflow-x: auto; flex-shrink: 0; }
.werkzeuge-tab { background: transparent; border: 1px solid transparent; color: var(--text-muted, #9ca3af); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.werkzeuge-tab:hover { color: var(--text, #e5e7eb); background: var(--bg-tertiary, #1f1f23); }
.werkzeuge-tab.active { color: #fff; background: var(--accent, #6C63FF); }
.werkzeug-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
#werkzeuge-content { overflow-y: auto; }
#boomy-confirm-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 9500; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-tertiary, #1f1f23); border-bottom: 2px solid var(--accent, #6C63FF); box-shadow: 0 6px 24px rgba(0,0,0,0.45); transform: translateY(-110%); transition: transform 0.34s cubic-bezier(0.22,1,0.36,1); }
#boomy-confirm-banner.visible { transform: translateY(0); }
#boomy-confirm-banner .bcb-icon img { width: 28px; height: 28px; border-radius: 6px; display: block; }
#boomy-confirm-banner .bcb-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
#boomy-confirm-banner .bcb-title { font-weight: 700; color: var(--accent, #6C63FF); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
#boomy-confirm-banner .bcb-summary { color: var(--text, #e5e7eb); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boomy-confirm-banner .bcb-view { color: var(--accent, #6C63FF); cursor: pointer; text-decoration: underline; white-space: nowrap; font-size: 13px; }
#boomy-confirm-banner .bcb-count { color: var(--text-muted, #9ca3af); font-size: 12px; white-space: nowrap; }
#boomy-confirm-banner .bcb-btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; }
#boomy-confirm-banner .bcb-confirm { background: var(--accent, #6C63FF); color: #fff; }
#boomy-confirm-banner .bcb-reject { background: transparent; color: var(--text-muted, #9ca3af); border: 1px solid var(--border, #27272a); }
@media (max-width: 600px) { #boomy-confirm-banner { flex-wrap: wrap; } #boomy-confirm-banner .bcb-summary { white-space: normal; } }
.process-mermaid svg foreignObject div { white-space: nowrap; }
@media (max-width: 720px) {
  .process-mermaid {
    padding: 10px 8px 28px;
    max-height: 240px;            /* Mobile: Diagramm nicht groesser als 240px,
                                     vertikal scrollbar + tap zum Vergroessern */
    overflow-y: auto;
  }
  /* Mobile: SVG nicht mehr auf 100% Container-Breite quetschen — eigene
     Mindestbreite damit es lesbar bleibt; horizontal scrollen + tap zum
     Vergrößern. */
  .process-mermaid svg { min-width: 600px !important; max-width: none !important; font-size: 11px; }
}

/* Mermaid-Fullscreen-Overlay (2026-05-10): tap aufs Diagramm öffnet
   Vollbild-Ansicht mit Zoom-Buttons. Umgeht user-scalable=no per
   transform: scale auf einem inneren Container. */
.process-modal-md { font-size: 13px; line-height: 1.6; color: var(--text, #e5e7eb); }
.process-modal-md .md-h { margin: 18px 0 8px; color: var(--text, #f4f4f5); font-weight: 600; line-height: 1.3; }
.process-modal-md .md-h1 { font-size: 18px; }
.process-modal-md .md-h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent, #60a5fa); }
.process-modal-md .md-h3 { font-size: 14px; }
.process-modal-md .md-h4 { font-size: 13px; color: var(--text-muted, #9ca3af); }
.process-modal-md .md-p { margin: 8px 0; }
.process-modal-md .md-list { margin: 8px 0 8px 20px; padding: 0; }
.process-modal-md .md-list li { margin: 3px 0; }
.process-modal-md .md-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.process-modal-md .md-table th, .process-modal-md .md-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border, #27272a); vertical-align: top; }
.process-modal-md .md-table th { background: var(--bg-tertiary, #1f1f23); font-weight: 600; color: var(--text-muted, #9ca3af); text-transform: uppercase; font-size: 10px; letter-spacing: 0.05em; }
.process-modal-md .md-code { background: var(--bg-tertiary, #1f1f23); border: 1px solid var(--border, #27272a); border-radius: 6px; padding: 10px 12px; overflow-x: auto; font-size: 12px; margin: 8px 0; }
.process-modal-md .md-code code { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #e5e7eb; }
.process-modal-md .md-inline-code { background: var(--bg-tertiary, #1f1f23); padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: var(--accent, #60a5fa); }
.process-modal-md a { color: var(--accent, #60a5fa); text-decoration: underline; }
.process-modal-md a:hover { text-decoration: none; }

@media (max-width: 720px) {
  .process-modal-content { max-width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; width: 100vw !important; }
  .process-modal-flow { flex-direction: column; }
  .process-flow-arrow { transform: rotate(90deg); justify-content: center; }
  .process-modal-header { padding: 16px !important; }
  .process-modal-body { padding: 12px 16px 20px !important; }
  .process-modal-titlebar h2 { font-size: 17px !important; }
  .process-list-container { max-height: calc(100vh - 320px) !important; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  #process-modal .modal-content.process-modal-content { max-width: 86vw !important; }
}

/* === Smoother Animationen + Polish === */
@keyframes processFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes processOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes processItemSlide {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}
#process-modal { animation: processOverlayFade 180ms ease-out; }
#process-modal .process-modal-content { animation: processFadeIn 220ms cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.process-item { animation: processItemSlide 180ms ease-out backwards; }
.process-group:nth-child(1) .process-item { animation-delay: 20ms; }
.process-group:nth-child(2) .process-item { animation-delay: 40ms; }
.process-group:nth-child(3) .process-item { animation-delay: 60ms; }
.process-group:nth-child(4) .process-item { animation-delay: 80ms; }

/* Item-Hover smoother */
.process-item { position: relative; overflow: hidden; }
.process-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.process-item:active { transform: translateX(1px) scale(0.99); }
.process-item-name {
  display: flex; align-items: center; gap: 6px;
}
.process-item-name::before {
  content: ""; display: inline-block; width: 3px; height: 14px; border-radius: 2px;
  background: var(--accent, #3b82f6); opacity: 0.6;
  transition: opacity 0.15s, height 0.15s;
}
.process-item:hover .process-item-name::before { opacity: 1; height: 16px; }

/* Search-Input subtle Focus */
.process-search-input { transition: border-color 0.15s, box-shadow 0.15s; }
.process-search-input:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }

/* Modal Close-Button */
.modal-close-btn { transition: color 0.15s, transform 0.15s; }
.modal-close-btn:hover { transform: rotate(90deg); }

/* Mermaid-Container subtler Hintergrund-Akzent */
.process-mermaid { box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); position: relative; }
.process-mermaid::before {
  content: "Visueller Ablauf"; position: absolute; top: 6px; right: 12px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted, #71717a); opacity: 0.5;
}

/* Section-Header smoother — Hilfe-Akkordeon Header bekommt subtile Hover */
.accordion-section[data-section="processes"] .accordion-header { transition: background 0.15s, border-color 0.15s; }
.accordion-section[data-section="processes"] .accordion-header:hover { background: rgba(59, 130, 246, 0.05); }

/* Process-Group-Spacing */
.process-group + .process-group { margin-top: 4px; }
.process-group-label { transition: color 0.15s; }

/* Tablet-Breakpoint: dichtere Liste */
@media (min-width: 721px) and (max-width: 1023px) {
  .process-item { padding: 9px 11px !important; }
  .process-item-name { font-size: 13px; }
  .process-item-summary { font-size: 11.5px; }
}


/* --- Notification-Bubble: default collapsed, click-to-expand (23.05.2026) --- */
.msg.notification { transition: padding 0.18s; }
.msg.notification .body {
  display: none;
  max-height: none !important;
  margin-top: 8px;
}
.msg.notification.expanded .body { display: block; }
.msg.notification.expanded .body.collapsed::after { display: none; }
.msg.notification .notif-header.notif-clickable {
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}
.msg.notification .notif-header.notif-clickable:hover .notif-title { text-decoration: underline; }
.msg.notification .notif-chevron {
  margin-left: auto;
  color: var(--text-muted, #9ca3af);
  font-size: 14px;
  transition: transform 0.18s ease;
  flex-shrink: 0;
  padding: 0 4px;
}
.msg.notification.expanded .notif-chevron { transform: rotate(90deg); }
.msg.notification .notif-summary {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.45;
  padding: 4px 0 0 0;
  font-style: italic;
}
.msg.notification.expanded .notif-summary {
  font-style: normal;
  opacity: 0.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 6px;
}


/* Sp4-Pattern Mermaid-Zoom-Toolbar (2026-05-25) */
.process-modal-zoom { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bg-tertiary, #1f1f23); border-bottom: 1px solid var(--border, #27272a); }
.process-modal-zoom button { background: var(--bg-secondary, #131316); color: var(--text, #f4f4f5); border: 1px solid var(--border, #27272a); border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 14px; line-height: 1; min-width: 28px; }
.process-modal-zoom button:hover { background: var(--bg-hover, #2a2a30); }
.process-modal-zoom-val { color: var(--text-muted, #a1a1aa); font-size: 12px; min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }

/* --- Postfach-Panel (Controlling-Cockpit) --- */
.pf-statusbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.pf-status{font-size:12px;padding:3px 9px;border-radius:12px;border:1px solid var(--border)}
.pf-status.ok{color:#10b981;border-color:#10b98155}.pf-status.bad{color:var(--error);border-color:#ef444455}
.pf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
.pf-tile{background:var(--bg-secondary);border:1px solid var(--border);border-radius:10px;padding:12px;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.pf-tile:hover{border-color:var(--accent);box-shadow:0 0 10px var(--accent-dim,rgba(99,102,241,.25))}
.pf-tile-err{cursor:default;color:var(--error)}
.pf-tile-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.pf-tile-name{font-weight:600;color:var(--text);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pf-tile-rolle{font-size:12px;color:var(--text-muted);margin:6px 0;min-height:30px}
.pf-tile-prio{display:flex;gap:5px;align-items:center}
.pf-badge{font-size:11px;color:var(--text-muted);border:1px solid var(--border);border-radius:10px;padding:1px 7px;white-space:nowrap}
.pf-badge-on{color:#fff;background:var(--accent);border-color:var(--accent)}
.pf-dot{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;border-radius:8px;color:#fff;font-size:10px;padding:0 4px}
.pf-q{color:var(--error);font-size:11px}.pf-muted{color:var(--text-muted)}.pf-error{color:var(--error)}.pf-ok{color:#10b981}
.pf-bar{display:flex;gap:10px;align-items:center;margin-bottom:12px}.pf-bar-title{font-weight:600;color:var(--text)}
.pf-btn{background:var(--bg-secondary);color:var(--text);border:1px solid var(--border);border-radius:7px;padding:6px 12px;cursor:pointer;font-size:13px}
.pf-btn:hover{border-color:var(--accent)}.pf-btn-accent{background:var(--accent);color:#fff;border-color:var(--accent)}.pf-btn-warn{color:var(--error);border-color:#ef444455}
.pf-msg{background:var(--bg-secondary);border:1px solid var(--border);border-radius:8px;padding:10px;margin-bottom:7px;cursor:pointer}
.pf-msg:hover{border-color:var(--accent)}
.pf-msg-top{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--text-muted);flex-wrap:wrap}
.pf-msg-from{color:var(--text)}.pf-msg-typ{border:1px solid var(--border);border-radius:8px;padding:0 6px}
.pf-msg-gelesen{color:var(--text-muted);font-style:italic}.pf-msg-date{margin-left:auto}
.pf-msg-thema{color:var(--text);font-size:14px;margin-top:4px}
.pf-trust{color:#fff;font-size:10px;padding:1px 5px;border-radius:6px}
.pf-hint{font-size:12px;color:var(--text-muted);margin-bottom:8px}
.pf-meta{width:100%;font-size:12px;border-collapse:collapse;margin-bottom:10px}
.pf-meta td{border-bottom:1px solid var(--border);padding:3px 6px;color:var(--text-muted);vertical-align:top}
.pf-meta .pf-k{color:var(--text);white-space:nowrap;width:1%}
.pf-body{background:var(--bg-secondary);border:1px solid var(--border);border-radius:8px;padding:12px;white-space:pre-wrap;word-break:break-word;color:var(--text);font-size:13px;max-height:50vh;overflow:auto}
.pf-actions{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}
.pf-form{display:flex;flex-direction:column;gap:10px;max-width:560px}
.pf-form label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--text-muted)}
.pf-form input,.pf-form select,.pf-form textarea{background:var(--bg-secondary);border:1px solid var(--border);border-radius:7px;padding:8px;color:var(--text);font-size:13px;font-family:inherit}
.pf-check{flex-direction:row!important;align-items:center;gap:8px!important}
