/* ==========================================================================
   UKE nextKAS KI-Chat Design System
   Modern Clinical Tech Aesthetic - UKE Hamburg-Eppendorf Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Color Palette - UKE Clinical Dark */
  --bg-primary: #0a0f1d;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --bg-input: rgba(15, 23, 42, 0.85);

  /* UKE Brand & Accent Colors */
  --uke-blue: #005f9e;
  --uke-cyan: #00b4d8;
  --uke-cyan-glow: rgba(0, 180, 216, 0.25);
  --uke-accent-gradient: linear-gradient(135deg, #0077b6 0%, #00b4d8 50%, #90e0ef 100%);
  --uke-purple-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);

  /* Status Colors */
  --status-online: #10b981;
  --status-online-glow: rgba(16, 185, 129, 0.3);
  --status-offline: #ef4444;
  --status-busy: #f59e0b;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-highlight: #38bdf8;

  /* Borders & Glassmorphism */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 180, 216, 0.5);
  --border-card: rgba(255, 255, 255, 0.06);
  --glass-blur: blur(16px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 180, 216, 0.2);

  /* Dimensions */
  --header-height: 68px;
  --sidebar-width: 380px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-highlight: #0284c7;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(2, 132, 199, 0.6);
  --border-card: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(0, 180, 216, 0.15);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 10% 10%, rgba(0, 119, 182, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(0, 180, 216, 0.06) 0%, transparent 40%),
              var(--bg-primary);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: relative;
  z-index: 50;
  backdrop-filter: var(--glass-blur);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--uke-accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  background: rgba(0, 180, 216, 0.15);
  color: var(--uke-cyan);
  border-radius: 6px;
  border: 1px solid rgba(0, 180, 216, 0.3);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Header Controls & Model Selector */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Server Status Badge */
.server-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full, 999px);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.server-badge:hover {
  border-color: var(--border-focus);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--status-offline);
  position: relative;
  transition: background-color 0.3s;
}

.status-dot.online {
  background-color: var(--status-online);
  box-shadow: 0 0 8px var(--status-online);
}

.status-dot.online::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--status-online);
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

.status-text {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Model Selector Box */
.model-selector-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 4px 6px 4px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.model-selector-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--uke-cyan-glow);
}

.model-icon {
  color: var(--uke-cyan);
  display: flex;
  align-items: center;
}

.model-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  min-width: 180px;
  max-width: 260px;
}

.model-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.active {
  color: var(--uke-cyan);
  background: rgba(0, 180, 216, 0.15);
}

.btn-reload.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Main Layout: Chat Window & Wiki Drawer
   ========================================================================== */
.main-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  position: relative;
  background: transparent;
}

/* Chat Messages Stream */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
}

/* Welcome Hero Screen */
.welcome-hero {
  max-width: 840px;
  margin: 40px auto 20px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--uke-accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 180, 216, 0.35);
  color: #ffffff;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.6;
}

.quick-prompts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 14px;
}

.prompt-pill-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.prompt-pill-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--uke-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.prompt-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.prompt-card-content h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.prompt-card-content p {
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Message Bubbles & Markdown Formatting
   ========================================================================== */
.message-row {
  display: flex;
  gap: 16px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-out;
}

.message-row.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.88rem;
}

.message-row.assistant .message-avatar {
  background: var(--uke-accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.25);
}

.message-row.user .message-avatar {
  background: #3b82f6;
  color: #ffffff;
}

.message-bubble {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 82%;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.message-row.user .message-meta {
  justify-content: flex-end;
}

.sender-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.message-content {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-size: 0.94rem;
  line-height: 1.65;
  word-break: break-word;
}

.message-row.user .message-content {
  background: var(--uke-blue);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-row.assistant .message-content {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-md);
}

/* Markdown Rendering in Assistant Bubbles */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
  font-family: var(--font-heading);
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
}

.message-content h1 { font-size: 1.3rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; }
.message-content h2 { font-size: 1.15rem; }
.message-content h3 { font-size: 1.02rem; color: var(--text-highlight); }
.message-content h4 { font-size: 0.92rem; }

.message-content p {
  margin-bottom: 10px;
}
.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin: 8px 0 12px 20px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content strong {
  font-weight: 600;
  color: var(--text-highlight);
}

.message-row.user .message-content strong {
  color: #ffffff;
}

.message-content code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-content pre {
  background: #050811;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 12px 0;
}

.message-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: #f1f5f9;
  font-size: 0.85rem;
}

/* Callout Blocks (e.g. > [!NOTE], > [!IMPORTANT], > [!WARNING]) */
.callout-box {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--uke-cyan);
  background: rgba(0, 180, 216, 0.08);
  font-size: 0.9rem;
}

.callout-box.important {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.callout-box.warning {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.callout-title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Markdown Tables */
.table-container {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.markdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.markdown-table th {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-highlight);
}

.markdown-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.markdown-table tr:last-child td {
  border-bottom: none;
}

.markdown-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Sources & Citations Badge Bar */
.sources-card {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.sources-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--uke-cyan);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-tag {
  background: rgba(0, 180, 216, 0.12);
  border: 1px solid rgba(0, 180, 216, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full, 999px);
  color: #e0f2fe;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.source-tag:hover {
  background: rgba(0, 180, 216, 0.25);
  border-color: var(--uke-cyan);
  transform: translateY(-1px);
}

/* Typing / Streaming Cursor */
.streaming-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--uke-cyan);
  margin-left: 3px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   Chat Input Area & Controls
   ========================================================================== */
.chat-input-wrapper {
  padding: 16px 32px 24px 32px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 60%);
  position: relative;
  z-index: 20;
}

.input-container {
  max-width: 920px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s ease;
}

.input-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
}

.input-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rag-status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  width: 32px;
  height: 18px;
  background: var(--bg-tertiary);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch.active {
  background: var(--uke-cyan);
}

.toggle-knob {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-switch.active .toggle-knob {
  transform: translateX(14px);
}

.context-pills-list {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: 500px;
}

.context-pill {
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.context-pill .remove-pill {
  cursor: pointer;
  color: var(--text-muted);
}
.context-pill .remove-pill:hover {
  color: #ef4444;
}

.input-main-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
  resize: none;
  min-height: 24px;
  max-height: 160px;
  padding: 4px 0;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

.send-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--uke-accent-gradient);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
  transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 180, 216, 0.45);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stop-btn {
  background: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.input-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Wiki Explorer Drawer / Sidebar
   ========================================================================== */
.wiki-drawer {
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: absolute;
  right: -380px;
  top: 0;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.wiki-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.drawer-search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.wiki-search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 36px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.wiki-search-input:focus {
  border-color: var(--border-focus);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiki-item-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.wiki-item-card:hover {
  border-color: var(--uke-cyan);
  transform: translateX(-3px);
}

.wiki-item-card.active {
  border-color: var(--uke-cyan);
  background: rgba(0, 180, 216, 0.1);
}

.wiki-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wiki-item-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-item-summary {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Wiki Document Viewer Modal / Fullscreen Panel */
.doc-viewer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.doc-viewer-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.doc-viewer-dialog {
  width: 90%;
  max-width: 960px;
  height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-viewer-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-viewer-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
}

.doc-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Settings Modal */
.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.settings-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-dialog {
  width: 90%;
  max-width: 580px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-dialog h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

.btn-primary {
  background: var(--uke-accent-gradient);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.35);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--uke-cyan);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  color: var(--text-primary);
  animation: slideInRight 0.3s ease-out;
}

.toast.error {
  border-left-color: #ef4444;
}

@keyframes slideInRight {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Header Navigation Tabs & User Profile Badge
   ========================================================================== */
.app-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--uke-accent-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 180, 216, 0.35);
}

.tab-badge-beta {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  letter-spacing: 0.4px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.tab-btn:hover .tab-badge-beta {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.25);
}

.tab-btn.active .tab-badge-beta {
  background: #ffffff;
  color: #0369a1;
  border-color: #ffffff;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all 0.2s;
}

.user-badge:hover {
  border-color: var(--border-focus);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--uke-purple-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.user-role-badge {
  font-size: 0.65rem;
  color: var(--uke-cyan);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.btn-text-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-text-sm:hover {
  color: var(--text-highlight);
  background: rgba(255, 255, 255, 0.06);
}

/* Tab Content Switching */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: flex !important;
}

/* ==========================================================================
   Tab 1: Chat Sidebar & Top Toolbar
   ========================================================================== */
.chat-history-sidebar {
  width: 280px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - var(--header-height));
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 16px 6px 16px;
}

.chat-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.chat-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.chat-item.active {
  background: rgba(0, 180, 216, 0.12);
  color: var(--uke-cyan);
  font-weight: 600;
  border-color: rgba(0, 180, 216, 0.35);
}

.chat-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 6px;
}

.chat-item-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.chat-item:hover .chat-item-actions,
.chat-item.active .chat-item-actions {
  display: flex;
}

.chat-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  gap: 16px;
  z-index: 10;
}

.rag-status-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  position: relative;
  transition: all 0.2s;
  border: 1px solid var(--border-subtle);
}

.toggle-switch.active {
  background: var(--uke-blue);
  border-color: var(--uke-cyan);
}

.toggle-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.toggle-switch.active .toggle-knob {
  transform: translateX(16px);
}

.chat-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn-sm:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.text-danger:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.empty-list-placeholder {
  padding: 18px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Chat Input Bar (Grosses, modernes & ergonomisches Eingabefeld)
   ========================================================================== */
.chat-input-wrapper {
  padding: 14px 32px 22px 32px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 15, 29, 0.8) 30%, var(--bg-primary) 100%);
  position: relative;
  z-index: 20;
  width: 100%;
}

[data-theme="light"] .chat-input-wrapper {
  background: linear-gradient(180deg, transparent 0%, rgba(241, 245, 249, 0.8) 30%, var(--bg-primary) 100%);
}

.input-container {
  max-width: 960px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1.5px solid rgba(0, 180, 216, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.input-container:focus-within {
  border-color: var(--uke-cyan);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(0, 180, 216, 0.28);
  transform: translateY(-1px);
}

.textarea-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  width: 100%;
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.6;
  min-height: 64px;
  max-height: 220px;
  resize: none;
  padding: 4px 2px;
  scroll-behavior: smooth;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.96rem;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 2px;
}

.btn-send {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--uke-accent-gradient);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.btn-send:hover {
  transform: scale(1.06) translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 180, 216, 0.6);
}

.btn-send:active {
  transform: scale(0.96);
}

.btn-stop {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-stop:hover {
  background: #dc2626;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.6);
}

.hidden {
  display: none !important;
}

.input-hint {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==========================================================================
   Tab 2: Vault Explorer (Obsidian Files & Markdown Viewer)
   ========================================================================== */
.vault-explorer-layout {
  display: flex;
  width: 100%;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.vault-tree-sidebar {
  width: 330px;
  min-width: 290px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vault-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-target-bar {
  margin: 10px 14px 0 14px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.upload-target-bar strong {
  color: var(--uke-cyan);
}

.btn-xs {
  padding: 2px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-xs:hover {
  background: #ef4444;
  color: white;
}

.drag-drop-zone {
  margin: 12px 14px;
  padding: 18px 14px;
  border: 2px dashed rgba(0, 180, 216, 0.35);
  border-radius: var(--radius-md);
  background: rgba(0, 180, 216, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.drag-drop-zone svg {
  color: var(--uke-cyan);
}

.drag-drop-zone small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.drag-drop-zone.dragover {
  border-color: var(--uke-cyan);
  background: rgba(0, 180, 216, 0.15);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.tree-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  user-select: none;
}

.tree-node:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tree-node.active {
  background: rgba(0, 180, 216, 0.15);
  color: var(--uke-cyan);
  font-weight: 600;
}

.tree-node.dragging {
  opacity: 0.4;
  outline: 1px dashed var(--uke-cyan);
}

.tree-node.drop-hover {
  background: rgba(0, 180, 216, 0.22) !important;
  outline: 2px solid var(--uke-cyan) !important;
  box-shadow: 0 0 10px rgba(0, 180, 216, 0.4);
}

.tree-node-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  opacity: 0.7;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.tree-node:hover .tree-node-chevron {
  opacity: 1;
  color: var(--text-primary);
}

.tree-node-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.tree-node-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-node-badge {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 4px;
}

.tree-node-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.tree-node:hover .tree-node-actions {
  opacity: 1;
  pointer-events: auto;
}

.tree-node-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
  line-height: 1;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-node-action-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  transform: scale(1.1);
}

.tree-node-action-btn.btn-move-tree-folder:hover,
.tree-node-action-btn.btn-move-tree-file:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
}

.tree-node-action-btn.btn-upload-tree-folder:hover {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.tree-node-action-btn.btn-share-tree-folder:hover {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.maintenance-status-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 14px;
}

.maintenance-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.status-indicator-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.maintenance-model-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 180, 216, 0.12);
  color: var(--uke-cyan);
  border: 1px solid rgba(0, 180, 216, 0.3);
  font-weight: 500;
}

.maintenance-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.maintenance-stat-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.maintenance-stat-item .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.maintenance-stat-item .stat-value.text-accent {
  color: var(--uke-cyan);
}

.maintenance-stat-item .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.maintenance-details-list {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.maintenance-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.maintenance-detail-row:last-child {
  border-bottom: none;
}

.search-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .search-settings-grid {
    grid-template-columns: 1fr;
  }
}

.tree-children {
  padding-left: 14px;
  border-left: 1px dashed var(--border-subtle);
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-children.collapsed {
  display: none;
}

.vault-viewer-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.viewer-header {
  height: 54px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-secondary);
}

.viewer-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.viewer-file-path {
  color: var(--text-primary);
}

.viewer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 54px;
  line-height: 1.75;
  color: var(--text-primary);
}

.viewer-body h1, .viewer-body h2, .viewer-body h3 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin-top: 1.5em;
  margin-bottom: 0.6em;
}

.viewer-body h1 {
  font-size: 1.85rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.viewer-body h2 {
  font-size: 1.4rem;
}

.viewer-body p {
  margin-bottom: 1em;
}

.viewer-body ul, .viewer-body ol {
  padding-left: 24px;
  margin-bottom: 1em;
}

.viewer-body li {
  margin-bottom: 4px;
}

.viewer-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.viewer-body th, .viewer-body td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.viewer-body th {
  background: var(--bg-tertiary);
  font-weight: 600;
}

.viewer-body tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.viewer-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
  display: block;
}

.viewer-body blockquote {
  border-left: 4px solid var(--uke-cyan);
  background: rgba(0, 180, 216, 0.08);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

.viewer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.viewer-empty-state svg {
  color: var(--text-muted);
  opacity: 0.6;
}

.viewer-empty-state h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
}

.viewer-empty-state p {
  max-width: 440px;
  font-size: 0.9rem;
}

.viewer-editor-wrap {
  flex: 1;
  display: flex;
  padding: 16px 24px;
  height: calc(100% - 54px);
}

.viewer-editor-textarea {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 18px;
  resize: none;
  outline: none;
}

.viewer-editor-textarea:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   Tab 3: Settings & Admin Model Configuration
   ========================================================================== */
.settings-page-layout {
  flex: 1;
  overflow-y: auto;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.settings-card {
  width: 100%;
  max-width: 880px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}

.settings-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.settings-card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-card-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-help {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 8px 0;
}

.admin-only-card {
  border-color: rgba(0, 180, 216, 0.4);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.models-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-table th {
  background: var(--bg-tertiary);
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-status.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-default {
  background: rgba(0, 180, 216, 0.2);
  color: var(--uke-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ==========================================================================
   Modals & Forms
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: zoomIn 0.2s ease-out;
}

.auth-modal-card {
  max-width: 420px;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  color: var(--uke-cyan);
  border-bottom-color: var(--uke-cyan);
}

.auth-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.model-test-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-top: 8px;
}

.model-test-result.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.model-test-result.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-weight: 600;
  transition: all 0.2s;
}

.file-upload-label {
  cursor: pointer;
  user-select: none;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 900px) {
  .chat-history-sidebar {
    width: 220px;
    min-width: 200px;
  }
  .vault-tree-sidebar {
    width: 250px;
    min-width: 220px;
  }
  .viewer-body {
    padding: 24px 20px;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 14px;
  }
  .brand-sub {
    display: none;
  }
  .model-select {
    min-width: 130px;
  }
  .messages-container {
    padding: 16px;
  }
  .chat-input-wrapper {
    padding: 10px 14px 18px 14px;
  }
  .message-bubble {
    max-width: 92%;
  }
  .quick-prompts-grid {
    grid-template-columns: 1fr;
  }
  .chat-history-sidebar, .vault-tree-sidebar {
    position: absolute;
    z-index: 40;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .chat-history-sidebar.open, .vault-tree-sidebar.open {
    transform: translateX(0);
  }
}

/* Danger Button Styles */
.btn-danger {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.9) !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   FEATURE 1: SPLIT VIEW MODE (CHAT LINKS, WIKI RECHTS)
   ========================================================================== */
.btn-split-toggle {
  margin-left: 8px;
  border: 1px dashed var(--border-subtle);
}
.btn-split-toggle.active {
  background: var(--uke-blue-gradient) !important;
  color: #ffffff !important;
  border-color: var(--uke-cyan) !important;
  box-shadow: 0 0 12px rgba(0, 163, 224, 0.35);
}

body.split-view-active .app-container {
  display: flex;
  flex-direction: column;
}
body.split-view-active #tab-content-chat,
body.split-view-active #tab-content-wiki {
  display: flex !important;
  flex: 1 1 50%;
  height: calc(100vh - var(--header-height));
  min-width: 0;
  overflow: hidden;
}
body.split-view-active #tab-content-settings,
body.split-view-active #tab-content-einsatzbericht,
body.split-view-active #tab-content-praxischeck {
  display: none !important;
}
body.split-view-active .main-workspace {
  float: left;
}
body.split-view-active {
  overflow: hidden;
}
body.split-view-active .chat-history-sidebar {
  width: 220px;
  min-width: 180px;
}
body.split-view-active .vault-tree-sidebar {
  width: 230px;
  min-width: 190px;
}
body.split-view-active .app-header {
  border-bottom: 2px solid var(--uke-blue);
}

/* ==========================================================================
   FEATURE 2: FAVORITES / BOOKMARKS (⭐)
   ========================================================================== */
.favorites-list-scroll {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 12px;
}
.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.favorite-item:hover {
  background: var(--bg-hover);
  border-color: var(--uke-cyan);
}
.favorite-item-title {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.btn-star.starred svg,
.btn-star-active svg {
  fill: #f59e0b !important;
  stroke: #f59e0b !important;
}
.empty-list-subtle {
  padding: 8px 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* ==========================================================================
   FEATURE 3: TABLE OF CONTENTS (TOC / OUTLINE)
   ========================================================================== */
.viewer-content-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.viewer-toc-pane {
  width: 270px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.toc-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toc-item {
  display: block;
  padding: 5px 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.toc-item.active {
  color: var(--uke-cyan);
  font-weight: 600;
  background: rgba(0, 163, 224, 0.1);
  border-left-color: var(--uke-cyan);
}
.toc-item.level-1 { font-weight: 600; padding-left: 6px; }
.toc-item.level-2 { padding-left: 14px; }
.toc-item.level-3 { padding-left: 22px; font-size: 0.74rem; color: var(--text-muted); }
.toc-item.level-4 { padding-left: 30px; font-size: 0.72rem; color: var(--text-muted); }

/* ==========================================================================
   FEATURE 4: LIGHTBOX IMAGE VIEWER (ZOOM & PAN)
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(10px);
  z-index: 10050;
  display: flex;
  flex-direction: column;
}
.lightbox-toolbar {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.85);
}
.lightbox-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}
.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lightbox-zoom-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: center;
}
.lightbox-viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  position: relative;
}
.lightbox-viewport:active {
  cursor: grabbing;
}
#lightbox-img {
  max-width: 90%;
  max-height: 84vh;
  object-fit: contain;
  transition: transform 0.08s ease-out;
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   FEATURE 5: FORCE-DIRECTED KNOWLEDGE GRAPH (OBSIDIAN STYLE)
   ========================================================================== */
.graph-modal-card {
  width: 95vw;
  max-width: 1440px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.graph-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.graph-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.graph-modal-body {
  flex: 1;
  padding: 0 !important;
  position: relative;
  overflow: hidden;
}
.graph-canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
}
.graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.graph-canvas:active {
  cursor: grabbing;
}
.graph-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  color: var(--text-secondary);
  pointer-events: none;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.graph-node-details {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 320px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  max-height: 80%;
  overflow-y: auto;
}
.graph-node-details h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--uke-cyan);
}
.graph-node-details p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* ==========================================================================
   FEATURE 6: TEAM PROMPTS POPOVER & BUTTON
   ========================================================================== */
.btn-icon-addon {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-addon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f59e0b;
  transform: scale(1.08);
}
.team-prompts-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 20px;
  width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  z-index: 50;
  overflow: hidden;
}
.popover-header {
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}
.popover-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.team-prompt-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s;
}
.team-prompt-item:hover {
  background: var(--bg-hover);
  border-color: var(--uke-cyan);
}
.team-prompt-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}
.team-prompt-preview {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   FEATURE 7: FEEDBACK BUTTONS & CHIPS
   ========================================================================== */
.message-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.feedback-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.feedback-btn:hover {
  color: var(--text-primary);
  border-color: var(--uke-cyan);
}
.feedback-btn.active-positive {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.feedback-btn.active-negative {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}
.feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.feedback-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.feedback-chip.active {
  background: var(--uke-blue);
  color: #ffffff;
  border-color: var(--uke-cyan);
}

/* ==========================================================================
   FEATURE 8: BREADCRUMB PILLS & COPYABLE CODE BLOCKS
   ========================================================================== */
.breadcrumb-pills-wrap {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 6px 0;
  background: rgba(0, 163, 224, 0.08);
  border: 1px solid rgba(0, 163, 224, 0.2);
  border-radius: 8px;
}
.breadcrumb-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--uke-cyan);
  background: rgba(0, 163, 224, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
}
.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.code-block-container {
  position: relative;
  margin: 12px 0;
}
.copy-code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}
.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==========================================================================
   FEATURE 9: SKELETON LOADING SCREENS & DRAG-ACTIVE ANIMATION
   ========================================================================== */
.skeleton-shimmer {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, rgba(255, 255, 255, 0.08) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line {
  height: 14px;
  margin: 8px 0;
  width: 100%;
}
.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 75%; }
.skeleton-card {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.drag-drop-zone.drag-active {
  border: 2px dashed var(--uke-cyan) !important;
  background: rgba(0, 163, 224, 0.15) !important;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(0, 163, 224, 0.25);
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--uke-blue-gradient);
  transition: width 0.3s ease;
}

/* ==========================================================================
   FEATURE 10: CHAT-WORKSPACES & FOLDER PERMISSION STYLES
   ========================================================================== */

/* Workspace Selector in Chat Toolbar */
.workspace-selector-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.workspace-selector-container:focus-within,
.workspace-selector-container:hover {
  border-color: var(--uke-cyan);
}

.workspace-icon {
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workspace-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 220px;
  text-overflow: ellipsis;
}

.workspace-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 6px;
}

.workspace-rag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 12px;
  background: rgba(0, 163, 224, 0.15);
  border: 1px solid rgba(0, 163, 224, 0.35);
  color: var(--uke-cyan);
  white-space: nowrap;
  animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 163, 224, 0.2); }
  50% { box-shadow: 0 0 8px 1px rgba(0, 163, 224, 0.4); }
}

/* Workspace Folder Checklist in Modal */
.workspace-folders-checklist {
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.workspace-folder-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.workspace-folder-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--uke-cyan);
}

.workspace-folder-item .folder-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.workspace-folder-item .folder-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Folder Share & Permission Modal */
.folder-share-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.folder-share-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.folder-share-user-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-share-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.folder-share-user-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.folder-share-user-item input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--uke-cyan);
}

.folder-share-user-item .user-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--uke-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.folder-share-user-item .user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.folder-share-user-item .user-role {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Tree Badges & Actions for Folders */
.tree-node-perm-badge {
  font-size: 0.72rem;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  user-select: none;
}

.tree-node-perm-badge.private {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.tree-node-perm-badge.shared {
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.tree-btn-share {
  opacity: 0;
  margin-left: auto;
  padding: 2px 6px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tree-node:hover .tree-btn-share {
  opacity: 1;
}

.tree-btn-share:hover {
  background: var(--uke-cyan);
  color: #fff;
  border-color: var(--uke-cyan);
}

/* ==============================================================================
   LLM Activity & Status Indicator (Echtzeit-Feedback während Modell generiert)
   ============================================================================== */
.llm-activity-container {
  padding: 6px 2px;
  width: 100%;
  max-width: 490px;
  animation: fadeIn 0.25s ease-out;
}

.llm-activity-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(0, 168, 181, 0.32);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .llm-activity-card {
  background: rgba(240, 249, 255, 0.9);
  border-color: rgba(0, 168, 181, 0.38);
  box-shadow: 0 4px 14px rgba(0, 168, 181, 0.1);
}

/* Pulsierender leuchtender Core/Orb */
.llm-pulse-orb {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 168, 181, 0.35);
  animation: pulseWave 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-core {
  position: relative;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--uke-cyan) 0%, var(--uke-blue-light) 100%);
  box-shadow: 0 0 12px rgba(0, 168, 181, 0.85);
  animation: pulseGlow 1.8s ease-in-out infinite alternate;
}

@keyframes pulseWave {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

@keyframes pulseGlow {
  0% {
    transform: scale(0.9);
    filter: brightness(1);
  }
  100% {
    transform: scale(1.15);
    filter: brightness(1.3);
    box-shadow: 0 0 16px rgba(0, 168, 181, 1);
  }
}

.llm-activity-info {
  flex: 1;
  min-width: 0;
}

.llm-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.llm-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 168, 181, 0.16);
  color: var(--uke-cyan);
  border: 1px solid rgba(0, 168, 181, 0.32);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.llm-timer {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--uke-cyan);
  white-space: nowrap;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

[data-theme="light"] .llm-timer {
  background: rgba(0, 168, 181, 0.1);
}

.llm-activity-text {
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 8px;
  transition: color var(--transition-fast);
}

.llm-activity-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .llm-activity-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

.llm-activity-progress-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--uke-cyan), var(--uke-blue-light), transparent);
  border-radius: 4px;
  animation: indeterminateSlide 1.6s infinite ease-in-out;
}

@keyframes indeterminateSlide {
  0% {
    left: -35%;
  }
  100% {
    left: 100%;
  }
}

.llm-activity-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
  animation: fadeIn 0.4s ease-out;
}

.generation-time-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-family: var(--font-mono, monospace);
  opacity: 0.85;
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

/* ==============================================================================
   Thinking / Reasoning Accordion Blocks (Einklappbare Denkprozesse)
   ============================================================================== */
.thinking-accordion {
  margin: 4px 0 12px 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 168, 181, 0.24);
  border-left: 3px solid var(--uke-cyan);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal), background var(--transition-normal);
}

.thinking-accordion:hover {
  border-color: rgba(0, 168, 181, 0.45);
}

.thinking-accordion[open] {
  border-left-color: var(--uke-blue-light);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.thinking-accordion.streaming {
  border-color: rgba(0, 168, 181, 0.5);
  border-left: 3px solid var(--uke-cyan);
  background: rgba(0, 168, 181, 0.05);
}

.thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  list-style: none;
}

.thinking-header::-webkit-details-marker {
  display: none;
}

.thinking-header:hover {
  background: rgba(0, 168, 181, 0.12);
  color: var(--text-primary);
}

.thinking-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-icon {
  font-size: 1rem;
  line-height: 1;
  display: inline-block;
}

.thinking-icon.pulse-thinking {
  animation: thinking-pulse 1.4s infinite ease-in-out;
}

@keyframes thinking-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

.thinking-title {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
}

.thinking-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.thinking-badge.live-pulse {
  background: rgba(0, 168, 181, 0.2);
  color: var(--uke-cyan);
  border-color: rgba(0, 168, 181, 0.35);
  animation: live-glow 1.5s infinite alternate ease-in-out;
}

@keyframes live-glow {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.thinking-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thinking-toggle-hint {
  font-weight: 500;
  transition: color var(--transition-fast);
}

.thinking-header:hover .thinking-toggle-hint {
  color: var(--uke-cyan);
}

.thinking-chevron {
  font-size: 0.72rem;
  transition: transform var(--transition-normal);
  display: inline-block;
}

.thinking-accordion[open] .thinking-chevron {
  transform: rotate(180deg);
}

.thinking-body {
  padding: 12px 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
  line-height: 1.6;
  color: rgba(203, 213, 225, 0.85);
  max-height: 480px;
  overflow-y: auto;
  font-family: var(--font-body);
}

.thinking-body p {
  margin-bottom: 8px;
}

.thinking-body p:last-child {
  margin-bottom: 0;
}

.thinking-body ul, .thinking-body ol {
  margin: 6px 0 8px 18px;
}

.thinking-body li {
  margin-bottom: 3px;
}

.thinking-body code {
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.35);
}

/* Abgrenzung des eigentlichen Antworttextes */
.message-answer-body {
  margin-top: 2px;
}

.message-answer-body > p:first-child {
  margin-top: 0;
}

/* Light Mode Anpassungen */
[data-theme="light"] .thinking-accordion {
  background: #f8fafc;
  border-color: rgba(0, 120, 140, 0.25);
  border-left-color: var(--uke-cyan);
}

[data-theme="light"] .thinking-accordion[open] {
  background: #f1f5f9;
}

[data-theme="light"] .thinking-header {
  background: rgba(0, 0, 0, 0.04);
  color: #334155;
}

[data-theme="light"] .thinking-body {
  color: #1e293b;
  border-top-color: rgba(0, 0, 0, 0.08);
}

/* ==============================================================================
   Intelligentes KI-Merge Modal & Aktions-Karten
   ============================================================================== */
.merge-info-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-info-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.88rem;
}

.merge-info-label {
  color: var(--text-muted);
  width: 72px;
  flex-shrink: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.merge-info-val {
  color: var(--text-primary);
  word-break: break-all;
}

.merge-target-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  font-weight: 500;
}

.merge-score-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.merge-actions-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.merge-action-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  width: 100%;
}

.merge-action-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.merge-action-primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.12);
}

.merge-action-primary:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(139, 92, 246, 0.22));
  border-color: rgba(129, 140, 248, 0.7);
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.25);
}

.merge-action-icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

.merge-action-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.merge-action-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-recommended {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.merge-action-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Verarbeitungs-Queue & KI-Bildanalyse Monitor Styles
   ========================================================================== */
.queue-indicator-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.queue-indicator-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.queue-indicator-btn.is-active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.queue-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  transition: all 0.3s ease;
}

.queue-indicator-btn.is-active .queue-dot-indicator {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: queuePulse 1.8s infinite;
}

.queue-count-badge {
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

@keyframes queuePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; filter: drop-shadow(0 0 4px #10b981); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.queue-modal-card {
  max-width: 680px;
  width: 92vw;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.queue-header-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 22px;
}

.queue-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.queue-stat-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.queue-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.queue-stat-val {
  font-size: 1.2rem;
  font-weight: 700;
}

.text-primary { color: #818cf8; }
.text-warning { color: #f59e0b; }
.text-success { color: #10b981; }
.text-info { color: #06b6d4; }

.queue-active-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
}

.queue-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.queue-badge-processing {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
}

.queue-active-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.queue-active-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.queue-active-step {
  font-size: 0.82rem;
  color: #93c5fd;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.queue-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #10b981);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.queue-active-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.queue-idle-box {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.queue-idle-icon {
  font-size: 1.6rem;
  color: #10b981;
  margin-bottom: 6px;
}

.queue-idle-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.queue-idle-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.queue-section-subhead {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.queue-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.queue-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  gap: 10px;
}

.queue-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.queue-item-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.queue-item-status-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.pill-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.pill-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.pill-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.pill-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
}

.queue-item-empty {
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ==========================================================================
   FEATURE: CHAT ATTACHMENTS & WIKI SKILL CARD
   ========================================================================== */
.chat-attachments-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  align-items: center;
}

.chat-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-primary);
  user-select: none;
  animation: fadeIn 0.18s ease-out;
}

.chat-att-chip img {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 3px;
}

.chat-att-chip .chip-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-att-chip .chip-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color 0.15s;
}

.chat-att-chip .chip-remove:hover {
  color: #ef4444;
}

.chat-input-wrapper.drag-over,
.input-container.drag-over {
  border-color: var(--uke-cyan) !important;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.35) !important;
}

/* User Message Attachments */
.user-attachments-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.user-att-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.9);
}

.user-att-pill img {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

/* Autonomous Wiki Skill Card */
.wiki-skill-card {
  margin: 14px 0 10px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(0, 212, 255, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-left: 4px solid #10b981;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInDown 0.25s ease-out;
}

.wiki-skill-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-skill-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.wiki-skill-info {
  flex: 1;
}

.wiki-skill-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.wiki-skill-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2px 0;
}

.wiki-skill-path {
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wiki-skill-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.wiki-skill-actions .btn-skill-open {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.18s;
}

.wiki-skill-actions .btn-skill-open:hover {
  background: #059669;
}

.wiki-skill-actions .btn-skill-copy {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
}

.wiki-skill-actions .btn-skill-copy:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Proposal Card (Interactive confirmation when matching document exists) */
.wiki-proposal-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.09) 0%, rgba(147, 51, 234, 0.07) 100%);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-left: 4px solid #3b82f6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.wiki-proposal-badge {
  color: #60a5fa !important;
  background: rgba(59, 130, 246, 0.2) !important;
}

.wiki-proposal-question {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.wiki-proposal-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.wiki-proposal-summary-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.wiki-proposal-summary-text {
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.wiki-proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-proposal-action {
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
  border: none;
}

.btn-proposal-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-proposal-update {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.btn-proposal-update:not(:disabled):hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-proposal-new {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-proposal-new:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Multi-Dokument-Karte */
.wiki-multi-docs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wiki-multi-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.wiki-multi-doc-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
}

.wiki-multi-doc-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wiki-multi-doc-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.wiki-multi-doc-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-multi-doc-path {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-multi-doc-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-skill-open-multi,
.btn-skill-copy-multi {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-skill-open-multi:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.btn-skill-copy-multi:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Input Action Button: Wiki-Dokument erstellen */
.btn-wiki-skill {
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  border: none;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
  flex-shrink: 0;
}

.btn-wiki-skill:hover {
  transform: scale(1.04) translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  filter: brightness(1.08);
}

.btn-wiki-skill:active {
  transform: scale(0.98);
}

.btn-wiki-skill svg {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .btn-wiki-skill-text {
    display: none;
  }
  .btn-wiki-skill {
    width: 48px;
    padding: 0;
    justify-content: center;
  }
}

/* Chat Area Drag & Drop Zone */
.chat-area {
  position: relative;
}

.chat-drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 25, 47, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--uke-cyan);
  border-radius: 16px;
  margin: 12px;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}

.chat-drop-overlay-content {
  text-align: center;
  color: #ffffff;
  padding: 30px;
}

.chat-drop-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: bounce 1.2s infinite;
}

.chat-drop-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--uke-cyan);
  margin-bottom: 6px;
}

.chat-drop-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.input-container.drag-over {
  border-color: var(--uke-cyan) !important;
  box-shadow: 0 0 24px rgba(0, 180, 216, 0.5) !important;
  background: rgba(0, 180, 216, 0.08) !important;
}

/* ==========================================================================
   SPLIT-TOOL WORKSPACE: EINSATZBERICHT & PRAXISCHECK
   ========================================================================== */
.split-tool-layout {
  display: none !important;
  flex-direction: row !important;
  height: calc(100vh - 64px) !important;
  overflow: hidden !important;
  background: var(--bg-main, #0b0f19);
  padding: 0 !important;
}

.split-tool-layout.active {
  display: flex !important;
}

.split-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.split-form-pane {
  border-right: 1px solid var(--border-color, #27314a);
  background: var(--bg-surface, #121827);
}

.split-output-pane {
  background: var(--bg-main, #0b0f19);
}

.split-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-card, #161e31);
  border-bottom: 1px solid var(--border-color, #27314a);
  flex-shrink: 0;
}

.split-pane-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary, #f1f5f9);
}

.split-pane-title svg {
  color: var(--uke-cyan, #00b4d8);
}

.split-pane-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #f1f5f9);
}

.split-pane-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-form-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 40px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tool-card {
  background: var(--bg-card, #161e31);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin: 0;
}

.tool-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 14px;
  line-height: 1.4;
}

.badge-soft {
  background: rgba(0, 180, 216, 0.12);
  color: var(--uke-cyan, #00b4d8);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input, #0f1422) !important;
  border: 1px solid var(--border-color, #27314a) !important;
  color: var(--text-primary, #f1f5f9) !important;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--uke-cyan, #00b4d8) !important;
  box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2) !important;
}

.form-textarea {
  resize: vertical;
}

.radio-pill-group {
  display: flex;
  gap: 12px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-primary, #f1f5f9);
  cursor: pointer;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}

@media (max-width: 768px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-primary, #f1f5f9);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--uke-cyan, #00b4d8);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.highlight-checkbox {
  background: rgba(0, 180, 216, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 180, 216, 0.2);
}

.callout-subtle-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  color: #fbbf24;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Dynamic Items (Server / Client) */
.dynamic-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pill-neu { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-pill-austausch { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-pill-neuinst { background: rgba(0, 180, 216, 0.2); color: #38bdf8; }
.status-pill-service { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Status Options (PraxisCheck Radio) */
.radio-status-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.status-option.status-danger { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border-color: rgba(239, 68, 68, 0.2); }
.status-option.status-warning { background: rgba(245, 158, 11, 0.1); color: #fde047; border-color: rgba(245, 158, 11, 0.2); }
.status-option.status-success { background: rgba(16, 185, 129, 0.1); color: #86efac; border-color: rgba(16, 185, 129, 0.2); }

/* PraxisCheck Geräte-Ablage (Ordner-Tree) */
.devices-tree-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.device-folder-card {
  background: var(--bg-surface, #121827);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 10px;
  overflow: hidden;
}

.device-folder-header {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.device-folder-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.device-folder-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-dropzone {
  border: 2px dashed var(--border-color, #27314a);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.device-dropzone:hover, .device-dropzone.drag-active {
  border-color: var(--uke-cyan, #00b4d8);
  background: rgba(0, 180, 216, 0.05);
}

.device-dropzone-text {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
}

.device-files-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary, #f1f5f9);
}

.file-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-chip-remove {
  cursor: pointer;
  color: #ef4444;
  font-weight: bold;
  padding: 0 2px;
}
.file-chip-remove:hover {
  color: #f87171;
}

.data-privacy-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #a7f3d0;
  line-height: 1.4;
  margin-top: 4px;
}

/* Output Right Pane Styles */
.split-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-card, #161e31);
  border-bottom: 1px solid var(--border-color, #27314a);
  flex-shrink: 0;
}

.split-subtabs {
  display: flex;
  gap: 4px;
}

.split-subtab {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.split-subtab:hover {
  color: var(--text-primary, #f1f5f9);
  background: rgba(255, 255, 255, 0.05);
}

.split-subtab.active {
  color: var(--uke-cyan, #00b4d8);
  background: rgba(0, 180, 216, 0.12);
}

.split-subtab-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.split-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.generator-toolbar {
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color, #27314a);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.generator-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gen-control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gen-control-item label {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}

.form-select-sm {
  background: var(--bg-input, #0f1422);
  border: 1px solid var(--border-color, #27314a);
  color: var(--text-primary, #f1f5f9);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);
}

.report-output-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.generator-status-bar {
  background: rgba(0, 180, 216, 0.12);
  border: 1px solid rgba(0, 180, 216, 0.3);
  color: var(--uke-cyan, #00b4d8);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Live-Generierungs- & Thinking-Anzeige */
.generator-live-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-card, #161e31);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.3s ease;
}

.generator-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color, #27314a);
}

.generator-live-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.generator-live-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--uke-cyan, #00b4d8);
}

.generator-metric-badge {
  background: rgba(0, 180, 216, 0.15);
  border: 1px solid rgba(0, 180, 216, 0.3);
  color: var(--uke-cyan, #00b4d8);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.generator-live-preview {
  background: rgba(10, 15, 26, 0.8);
  border: 1px solid rgba(39, 49, 74, 0.6);
  border-radius: 8px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.live-preview-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 6px;
  font-weight: 600;
}

.live-stream-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #a5b4fc;
}

.empty-state-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  padding: 40px 20px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-card h3 {
  font-size: 1.15rem;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 8px;
}

.empty-state-card p {
  max-width: 420px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.markdown-preview-card {
  background: var(--bg-card, #161e31);
  border: 1px solid var(--border-color, #27314a);
  border-radius: 12px;
  padding: 24px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-primary, #f1f5f9);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.markdown-preview-card h1, .markdown-preview-card h2, .markdown-preview-card h3 {
  color: var(--uke-cyan, #00b4d8);
  margin-top: 18px;
  margin-bottom: 10px;
}

.markdown-preview-card ul, .markdown-preview-card ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.report-frame-wrapper {
  flex: 1;
  height: 100%;
  min-height: 600px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color, #27314a);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.report-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

/* Password Table View */
.passwords-doc-header {
  margin-bottom: 20px;
}

.doc-badge-secure {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.passwords-doc-header h2 {
  font-size: 1.3rem;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 4px;
}

.passwords-doc-header p {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
}

.doc-notice-banner {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  color: #fbbf24;
  font-size: 0.8rem;
}

.passwords-doc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color, #27314a);
  border-radius: 10px;
}

.passwords-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.passwords-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f1f5f9);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color, #27314a);
}

.passwords-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f1f5f9);
}

.passwords-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.pw-mask {
  font-family: monospace;
  letter-spacing: 2px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-danger-subtle {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger-subtle:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fee2e2;
}

/* ==========================================================================
   PRAXISCHECK EVOLUTION: HYBRID STUDIO (VARIANTE E) STYLES
   ========================================================================== */
#tab-content-praxischeck {
  display: none !important;
  flex: 1 1 100%;
  width: 100%;
  height: calc(100vh - var(--header-height, 56px)) !important;
  max-height: calc(100vh - var(--header-height, 56px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  position: relative;
}

#tab-content-praxischeck.active {
  display: block !important;
  overflow-y: auto !important;
}

#pc-view-intake,
#pc-view-thinking,
#pc-view-studio {
  width: 100%;
  box-sizing: border-box;
}

.pc-hybrid-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}

@media (max-width: 1100px) {
  .pc-hybrid-layout {
    grid-template-columns: 1fr;
  }
}

.pc-tabbed-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 2px solid var(--border-color, #27314a);
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.pc-tabbed-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1.1rem;
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px 6px 0 0;
}

.pc-tabbed-tab:hover {
  color: var(--text-primary, #f1f5f9);
  background: rgba(255, 255, 255, 0.04);
}

.pc-tabbed-tab.active {
  color: var(--uke-cyan, #38bdf8);
  border-bottom-color: var(--uke-cyan, #38bdf8);
  background: rgba(56, 189, 248, 0.08);
}

.pc-studio-panel {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.pc-hybrid-cockpit {
  position: sticky;
  top: calc(var(--header-height, 60px) + 1rem);
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.preset-pill-btn {
  background: var(--surface-light, #334155);
  border: 1px solid var(--border-color, #475569);
  color: var(--text-primary, #f8fafc);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-pill-btn:hover {
  background: var(--uke-blue, #004b87);
  border-color: var(--uke-cyan, #38bdf8);
  transform: translateY(-1px);
}

.badge-ai-autofill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid #6366f1;
  color: #a5b4fc;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.catalog-chip-btn {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-color, #334155);
  color: var(--text-primary, #f8fafc);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.catalog-chip-btn:hover {
  border-color: var(--uke-cyan, #38bdf8);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  transform: translateY(-1px);
}

.offer-catalog-accordion {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color, #334155);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.catalog-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 6px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.offer-qty-input {
  width: 55px;
  padding: 0.25rem 0.4rem;
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 4px;
  color: var(--text-primary, #f8fafc);
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.offer-price-input {
  width: 90px;
  padding: 0.25rem 0.4rem;
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-color, #334155);
  border-radius: 4px;
  color: var(--text-primary, #f8fafc);
  text-align: right;
  font-weight: 600;
  font-size: 0.85rem;
}

.offer-del-btn {
  background: transparent;
  border: none;
  color: var(--danger, #ef4444);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.15s;
}

.offer-del-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  transform: scale(1.1);
}

.progress-bar-bg {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color, #334155);
  border-radius: 20px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin: 0.3rem 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.table-custom {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table-custom th {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color, #334155);
  color: var(--text-secondary, #94a3b8);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.table-custom td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  vertical-align: middle;
}

.table-custom tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}



