/* ==========================================================================
   Colab-AI Web Studio — Engineering Workstation Design System
   Archetype: Developer Tool / Cloud GPU Workstation (OLED Void + Bento Telemetry)
   Grounded via UI/UX Pro Max Engine (Products Row 81, Typography Pairing #9)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Canvas & Chassis (OLED Deep Slate Void) */
  --bg-canvas: #08090d;
  --bg-surface-1: #0e1118;
  --bg-surface-2: #141824;
  --bg-surface-3: #1c2232;
  --bg-surface-hover: #22293d;
  --bg-surface-elevated: #1a2030;
  --bg-card: #141824;

  /* Hairline Precision Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.25);
  --border-focus: #3b82f6;

  /* High-Contrast Typography */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --font-mono: 'JetBrains Mono', monospace;
  --text-mono-glow: #e2e8f0;

  /* Compiler & Signal Accents (Replacing Generic AI Purple) */
  --accent-compiler: #10b981;
  --accent-compiler-hover: #059669;
  --accent-compiler-bg: rgba(16, 185, 129, 0.12);
  --accent-compiler-border: rgba(16, 185, 129, 0.35);

  --accent-signal: #38bdf8;
  --accent-signal-hover: #0284c7;
  --accent-signal-bg: rgba(56, 189, 248, 0.12);
  --accent-signal-border: rgba(56, 189, 248, 0.35);

  --accent-tensor: #818cf8;
  --accent-tensor-bg: rgba(129, 140, 248, 0.12);
  --accent-tensor-border: rgba(129, 140, 248, 0.35);

  /* Primary Brand Action (Electric Terminal Blue) */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.14);
  --primary-glow: rgba(59, 130, 246, 0.35);

  /* Telemetry Severity Zones */
  --status-normal: #10b981;
  --status-warning: #f59e0b;
  --status-critical: #ef4444;
  --status-critical-bg: rgba(239, 68, 68, 0.14);

  /* Semantic Aliases */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.14);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --info: #38bdf8;

  /* Terminal Surface */
  --terminal-bg: #05070a;
  --terminal-border: #1a2234;
  --terminal-header: #0d121c;
  --terminal-text: #38bdf8;

  /* Engineering Radius & Transitions */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-card: 10px;
  --radius-pill: 9999px;
  --radius-full: 9999px;
  --transition-fast: 120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* ==========================================================================
   Header & Workstation Navigation
   ========================================================================== */
.app-header {
  height: 52px;
  background-color: var(--bg-surface-1);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 50;
}

.nav-toggle { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:where(button, input, textarea, select, a, summary):focus-visible { outline: 2px solid var(--accent-signal); outline-offset: 2px; }

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-compiler);
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.logo-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background-color: var(--accent-compiler-bg);
  color: var(--accent-compiler);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-compiler-border);
  letter-spacing: 0.05em;
}

/* Workstation Tabs */
.tab-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: var(--bg-surface-2);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.tab-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
}

.tab-btn.active {
  background-color: var(--bg-surface-3);
  color: #ffffff;
  border: 1px solid var(--border-medium);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.tab-btn.active svg {
  opacity: 1;
  color: var(--accent-signal);
}

/* Header Right Telemetry Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.status-running {
  background-color: var(--status-normal);
  box-shadow: 0 0 8px var(--status-normal);
}

.status-dot.status-stopped {
  background-color: var(--status-critical);
}

.status-dot.status-warning {
  background-color: var(--status-warning);
}

.vram-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-mono-glow);
}

.vram-pill.active {
  border-color: var(--accent-signal-border);
  background-color: var(--accent-signal-bg);
  color: var(--accent-signal);
}

/* Notification Bell Button */
.btn-notification-bell {
  position: relative;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-notification-bell:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--danger);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  display: none;
}

/* ==========================================================================
   Main Content & Tab Panes
   ========================================================================== */
.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

.tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TAB 1: Interactive Chat Studio (Workstation Canvas)
   ========================================================================== */
.chat-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Chat Sidebar */
.chat-sidebar {
  width: 260px;
  background-color: var(--bg-surface-1);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-new-chat-polished {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px !important;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-new-chat-polished:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 0 10px var(--primary-glow);
}

.sidebar-threads {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 12.5px;
  border: 1px solid transparent;
}

.thread-item:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.thread-item.active {
  background-color: var(--bg-surface-3);
  color: #ffffff;
  font-weight: 500;
  border-color: var(--border-medium);
}
.thread-open { flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font: inherit; }
.btn-delete-conv { border: 0; background: transparent; color: var(--text-secondary); cursor: pointer; min-width: 36px; min-height: 36px; }
.btn-delete-conv:hover { color: var(--danger); }
.chat-onboarding { display: none; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--bg-surface-2); border-bottom: 1px solid var(--border-medium); }
.chat-onboarding.visible { display: flex; }
.chat-onboarding button { min-height: 40px; }
.message-error { color: var(--danger); margin-top: 8px; }

.thread-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.btn-delete-thread {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
}

.thread-item:hover .btn-delete-thread {
  opacity: 1;
}

.btn-delete-thread:hover {
  color: var(--danger);
  background-color: var(--danger-bg);
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background-color: var(--bg-canvas);
  position: relative;
}

/* Chat Topbar */
.chat-topbar {
  height: 44px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background-color: var(--bg-surface-1);
  flex-shrink: 0;
}

.model-picker-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.muted-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.select-model {
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  outline: none;
}

.chat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Chat No Model Warning Banner */
.chat-no-model-banner {
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.no-model-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.no-model-icon {
  color: var(--warning, #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.no-model-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.no-model-text strong {
  font-size: 13px;
  color: var(--warning, #f59e0b);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.no-model-text span {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

/* Chat Messages Stream (Workstation Flow) */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Workstation Message Container */
.message-row {
  display: flex;
  flex-direction: column;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
}

.message-row:last-child {
  border-bottom: none;
}

/* Message Header Info Bar */
.message-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.message-sender-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.message-sender-badge {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sender-user {
  background-color: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.sender-assistant {
  background-color: var(--accent-compiler-bg);
  color: var(--accent-compiler);
  border: 1px solid var(--accent-compiler-border);
}

.message-telemetry-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-signal);
  background-color: var(--accent-signal-bg);
  border: 1px solid var(--accent-signal-border);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
}

/* Message Content Area */
.message-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-main);
  word-break: break-word;
}

.message-content p {
  margin-bottom: 10px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Message Actions Strip */
.message-actions-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.message-row:hover .message-actions-strip {
  opacity: 1;
}

.btn-msg-action {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.btn-msg-action:hover {
  background-color: var(--bg-surface-3);
  color: var(--text-main);
  border-color: var(--border-medium);
}

/* Code Blocks & Window Headers */
.code-block-wrapper {
  margin: 12px 0;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--terminal-bg);
}

.code-block-header {
  background-color: var(--terminal-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-lang-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent-signal);
  text-transform: uppercase;
  font-weight: 600;
}

.code-copy-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.code-copy-btn:hover {
  color: var(--text-main);
}

.code-block-wrapper pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Thinking Trace Accordion */
.thinking-block {
  background-color: #0b0e14;
  border: 1px solid #1e293b;
  border-left: 3px solid var(--status-warning);
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
  overflow: hidden;
}

.thinking-block summary {
  padding: 7px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--status-warning);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-block summary:hover {
  color: #fcd34d;
}

.thinking-content {
  padding: 10px 14px;
  font-size: 12px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(0, 0, 0, 0.3);
  line-height: 1.5;
}

/* Chat Welcome Screen */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  text-align: center;
  max-width: 620px;
  padding: 30px 20px;
}

.welcome-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-compiler);
  margin-bottom: 14px;
}

.chat-welcome h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.welcome-desc {
  color: var(--text-secondary);
  margin: 8px 0 24px 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.starter-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.starter-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.starter-card:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-surface-2);
}

.starter-card strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}

.starter-card span {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Workstation Command & Prompt Dock */
.chat-input-dock {
  padding: 12px 24px 16px 24px;
  background: linear-gradient(180deg, transparent 0%, var(--bg-canvas) 25%);
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  min-height: 48px;
}

.input-container:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus), 0 4px 18px rgba(0, 0, 0, 0.5);
}

.btn-attach {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: var(--transition-fast) !important;
}

.btn-attach:hover {
  background-color: var(--bg-surface-3) !important;
  color: var(--text-main) !important;
  border-color: var(--border-subtle) !important;
}

.btn-attach svg {
  width: 17px !important;
  height: 17px !important;
  stroke: currentColor !important;
  flex-shrink: 0 !important;
  display: block !important;
}

#prompt-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
  max-height: 180px;
  min-height: 24px;
  font-family: inherit;
  padding: 4px 6px;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-send {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: var(--transition-fast) !important;
}

.btn-send:hover {
  background-color: var(--primary-hover) !important;
  box-shadow: 0 0 10px var(--primary-glow) !important;
  transform: scale(1.04);
}

.btn-send svg {
  width: 15px !important;
  height: 15px !important;
  stroke: #ffffff !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.btn-stop {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: var(--danger) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-sm) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

.btn-stop svg {
  width: 13px !important;
  height: 13px !important;
  fill: currentColor !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   TAB 2: MODEL HUB (Bento Architecture & VRAM Predictor)
   ========================================================================== */
.pane-content {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pane-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pane-subtitle {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin-top: 3px;
}

/* Active GPU Resident Banner */
.active-gpu-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.02));
  border: 1px solid var(--accent-compiler-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.active-gpu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.active-gpu-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-compiler);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-compiler);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.active-model-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
}

.active-model-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* Multi-Stage Loading Pipeline Visualizer */
.model-loading-drawer {
  background-color: var(--bg-surface-2);
  border: 1px solid var(--accent-tensor-border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-tensor);
  font-family: 'JetBrains Mono', monospace;
}

/* Pipeline Stage Stepper */
.loading-pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 8px 0;
  gap: 4px;
}

.pipeline-step {
  flex: 1;
  background-color: var(--bg-surface-3);
  border: 1px solid var(--border-subtle);
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

.pipeline-step.active {
  background-color: var(--accent-tensor-bg);
  border-color: var(--accent-tensor-border);
  color: var(--accent-tensor);
  font-weight: 600;
}

.pipeline-step.done {
  background-color: var(--accent-compiler-bg);
  border-color: var(--accent-compiler-border);
  color: var(--accent-compiler);
}

/* Models Grid (Bento Architecture) */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.model-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.model-card:hover {
  border-color: var(--border-medium);
  background-color: var(--bg-surface-2);
}

.model-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

/* VRAM Fit Predictor Badge */
.vram-fit-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vram-fit-badge.safe {
  background-color: var(--accent-compiler-bg);
  border: 1px solid var(--accent-compiler-border);
  color: var(--accent-compiler);
}

.vram-fit-badge.warning {
  background-color: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--warning);
}

.vram-fit-badge.danger {
  background-color: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

/* ==========================================================================
   TAB 3: COLAB COCKPIT (Cloud Compute Telemetry HUD)
   ========================================================================== */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.telemetry-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.telemetry-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 4px;
}

.telemetry-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.telemetry-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Segmented Multi-Zone VRAM Gauge */
.segmented-meter-track {
  display: flex;
  height: 8px;
  background-color: var(--bg-surface-3);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin: 6px 0;
}

.meter-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.meter-segment.weights { background-color: var(--accent-tensor); }
.meter-segment.kv-cache { background-color: var(--accent-signal); }
.meter-segment.overhead { background-color: #64748b; }
.meter-segment.free { background-color: rgba(255, 255, 255, 0.05); }

/* Interactive Architecture Topology Diagram */
.topology-container {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.topology-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.topology-pipeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topology-node {
  flex: 1;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  text-align: center;
}

.topology-node-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.topology-node-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
}

.topology-arrow {
  color: var(--accent-signal);
  font-family: monospace;
  font-size: 14px;
  flex-shrink: 0;
}

/* Tabbed Professional Terminal Console */
.terminal-wrapper {
  border: 1px solid var(--terminal-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--terminal-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background-color: var(--terminal-header);
  border-bottom: 1px solid var(--border-subtle);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.term-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.term-tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
}

.term-tab-btn.active {
  background-color: var(--bg-surface-3);
  color: var(--accent-signal);
  border-color: var(--border-medium);
}

.terminal-screen {
  background-color: var(--terminal-bg);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 14px;
  height: 280px;
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ==========================================================================
   Persistent Notification & Error System
   ========================================================================== */
/* Off-Canvas Notification History Drawer */
.notification-drawer {
  position: fixed;
  top: 52px;
  right: -360px;
  width: 350px;
  height: calc(100vh - 52px);
  background-color: var(--bg-surface-elevated);
  border-left: 1px solid var(--border-medium);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.6);
  z-index: 100;
  transition: right 250ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.notification-drawer.open {
  right: 0;
}

.drawer-header-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header-bar h3 {
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.drawer-notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-signal);
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
}

.notif-item.danger { border-left-color: var(--danger); }
.notif-item.warning { border-left-color: var(--warning); }
.notif-item.success { border-left-color: var(--success); }

.notif-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

.notif-item-msg {
  color: var(--text-main);
  line-height: 1.4;
  word-break: break-word;
}

/* Sticky Toast Banners */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-width: 480px;
}

.toast {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  word-break: break-word;
}

.toast-danger, .toast-error {
  border-left: 4px solid var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), var(--bg-surface-elevated));
}

.toast-warning {
  border-left: 4px solid var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), var(--bg-surface-elevated));
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-info {
  border-left: 4px solid var(--info);
}

/* Utility Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Form Actions Button Alignment & Equal Sizing */
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions .btn {
  height: 38px !important;
  padding: 0 18px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: var(--radius-sm) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.form-actions .btn svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
  display: block !important;
}

#btn-create-session {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

#btn-create-session:hover {
  background-color: var(--primary-hover) !important;
  box-shadow: 0 0 12px var(--primary-glow) !important;
}

#btn-stop-session {
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
}

#btn-stop-session:hover {
  background-color: var(--danger-bg) !important;
  border-color: var(--danger) !important;
  color: #ffffff !important;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface-2);
  border-color: var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger-outline {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger-outline:hover {
  background-color: var(--danger-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.badge-subtle {
  background-color: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-primary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-success {
  background-color: var(--accent-compiler-bg);
  color: var(--accent-compiler);
  border: 1px solid var(--accent-compiler-border);
}

.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Animations */
@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Generic Layout Helpers */
.card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-2);
}

.card-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}

.card-header-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent-signal);
}

.card-body {
  padding: 16px;
}

.split-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.text-input, .select-input {
  width: 100%;
  background-color: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  color: var(--text-main);
  font-size: 12.5px;
  outline: none;
  transition: var(--transition-fast);
}

.text-input:focus, .select-input:focus {
  border-color: var(--border-focus);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 18px; }

/* ==========================================================================
   COLAB CLI & MULTI-ACCOUNT WORKSTATION STYLES
   UI/UX Pro Max Grounded Workstation Archetype
   ========================================================================== */

/* Top Header Active Account Pill */
.account-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 17, 23, 0.85);
  border: 1px solid var(--border-hairline);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.account-pill:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-2);
  color: var(--text-main);
}

.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-compiler);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.account-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CLI Stats Overview Bento Grid */
.cli-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Workstation Split Layout */
.cli-workspace-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1200px) {
  .cli-workspace-layout {
    grid-template-columns: 1fr;
  }
}

/* Accounts Grid & Bento Cards */
.accounts-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-bento-card {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 16px;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.account-bento-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card);
}

.account-bento-card.is-active {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, rgba(14, 17, 23, 0.95) 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.06);
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.account-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  object-fit: cover;
}

.account-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-signal);
}

.account-name-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.account-email {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.account-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.account-status-badge.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-compiler);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.account-status-badge.standby {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.account-telemetry-box {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-item-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.telemetry-item-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.telemetry-item-val.cu-high {
  color: var(--accent-compiler);
}

.telemetry-item-val.cu-low {
  color: #f59e0b;
}

.account-cooldown-alert {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  font-size: 11px;
  color: #fbbf24;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-actions-row .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 11.5px;
}

.account-actions-row .btn svg {
  width: 13px;
  height: 13px;
}

/* Interactive OAuth Handoff Bridge Card */
.cli-handoff-card {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.07);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, var(--bg-card) 100%);
  animation: fadeInDown 0.25s ease-out;
}

.handoff-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.handoff-steps-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.handoff-step {
  display: flex;
  gap: 14px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.input-with-copy {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.auth-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.auth-input-row .text-input {
  flex: 1;
  font-size: 12px;
  background: var(--bg-surface-2);
}

/* CLI Live Stream Terminal Console */
.cli-terminal-card {
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-stream-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--accent-compiler);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.stream-dot.pulsing {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-compiler);
  animation: pulseGlow 1.5s infinite;
}

.cli-terminal-screen {
  background: #050608;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px;
  border-top: 1px solid var(--border-hairline);
  white-space: pre-wrap;
  word-break: break-all;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* ======================================================== */
/* TORRENT STUDIO WORKSTATION MODULE                        */
/* ======================================================== */

.torrent-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  gap: 16px;
  animation: fadeInDown 0.2s ease;
}

@media (max-width: 900px) {
  .torrent-install-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.install-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.install-banner-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent-signal);
  flex-shrink: 0;
  margin-top: 2px;
}

.install-banner-text h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.install-banner-text p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Quota Alert Banner */
.torrent-quota-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  gap: 16px;
  animation: fadeInDown 0.2s ease;
}

@media (max-width: 900px) {
  .torrent-quota-alert {
    flex-direction: column;
    align-items: flex-start;
  }
}

.quota-alert-icon svg {
  width: 24px;
  height: 24px;
  color: var(--status-warning);
  flex-shrink: 0;
}

.quota-alert-text {
  flex: 1;
}

.quota-alert-text h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--status-warning);
  margin-bottom: 3px;
}

.quota-alert-text p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.badge-quota-exceeded {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.metric-pill.text-warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-warning);
  border-color: rgba(245, 158, 11, 0.35);
}

.torrent-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .torrent-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .torrent-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.torrent-metric-card {
  background-color: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}

.torrent-metric-card:hover {
  border-color: var(--border-medium);
}

.torrent-metric-card .metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.torrent-metric-card .metric-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.torrent-metric-card .metric-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.torrent-metric-card .metric-pill.live {
  background: var(--accent-compiler-bg);
  color: var(--accent-compiler);
  border-color: var(--accent-compiler-border);
}

.torrent-metric-card .metric-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.torrent-metric-card .metric-sub {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Engine Badge in Pane Header */
.engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.engine-badge.online {
  border-color: var(--accent-compiler-border);
  color: var(--accent-compiler);
  background: var(--accent-compiler-bg);
}

.engine-badge.offline {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--status-critical);
  background: var(--status-critical-bg);
}

.ingestion-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-signal);
  background: var(--accent-signal-bg);
  border: 1px solid var(--accent-signal-border);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Torrent Ingestion Card */
.torrent-ingestion-card {
  margin-bottom: 20px;
}

.torrent-input-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .torrent-input-split {
    grid-template-columns: 1fr;
  }
}

/* Drag and Drop Zone */
.torrent-dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  user-select: none;
}

.torrent-dropzone:hover {
  border-color: var(--accent-signal);
  background: rgba(56, 189, 248, 0.03);
}

.torrent-dropzone.drag-active {
  border-color: var(--accent-compiler);
  background: rgba(16, 185, 129, 0.07);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent-signal);
}

.dropzone-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-text span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.dropzone-browse {
  margin-top: 4px;
}

.dropzone-file-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
}

.selected-file-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-compiler);
  flex-shrink: 0;
}

.selected-file-details {
  flex: 1;
  text-align: left;
  overflow: hidden;
}

.selected-filename {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-signal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-filesize {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Magnet Link Box */
.torrent-magnet-box {
  display: flex;
  flex-direction: column;
}

.input-with-clear {
  position: relative;
  display: flex;
}

.input-with-clear textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  font-size: 12px;
  padding-right: 32px;
}

.clear-magnet-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--text-tertiary);
}

.clear-magnet-btn:hover {
  color: var(--text-main);
}

.magnet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Storage Policy Selector */
.torrent-policy-section {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.policy-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.policy-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .policy-options {
    grid-template-columns: 1fr;
  }
}

.policy-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.policy-card:hover {
  border-color: var(--border-medium);
}

.policy-card.active {
  border-color: var(--accent-compiler);
  background: rgba(16, 185, 129, 0.05);
}

.policy-card input[type="radio"] {
  display: none;
}

.policy-radio-custom {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.policy-card.active .policy-radio-custom {
  border-color: var(--accent-compiler);
}

.policy-card.active .policy-radio-custom::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-compiler);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@media (max-width: 1100px) {
  .app-header { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .header-left { flex: 1 1 auto; justify-content: space-between; min-width: 0; }
  .nav-toggle { display: inline-flex; min-height: 40px; align-items: center; }
  .tab-nav { display: none; order: 3; width: 100%; flex: 1 1 100%; overflow-x: auto; }
  .tab-nav.open { display: flex; }
  .tab-btn { flex: 0 0 auto; min-height: 44px; }
  .header-right { flex: 1 1 100%; overflow-x: auto; padding-bottom: 2px; }
  .header-right > * { flex: 0 0 auto; }
}

@media (max-width: 700px) {
  .app-container { height: 100dvh; }
  .logo-badge { display: none; }
  .header-right { flex-wrap: wrap; overflow: visible; gap: 6px; }
  .header-right > * { min-width: 0; }
  .chat-no-model-banner { flex-wrap: wrap; }
  .no-model-content { flex: 1 1 100%; }
  .chat-no-model-banner > button { width: 100%; justify-content: center; }
  .tab-nav.open { flex-wrap: wrap; }
  .tab-btn { flex: 1 1 42%; justify-content: center; }
  .chat-layout { flex-direction: column; }
  .chat-sidebar { width: 100%; max-height: 118px; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .sidebar-header { padding: 6px 10px; }
  .sidebar-threads { flex-direction: row; overflow-x: auto; min-height: 48px; }
  .thread-item { flex: 0 0 160px; }
  .chat-topbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 8px; }
  .chat-topbar-actions { flex-wrap: wrap; }
  .chat-viewport { min-height: 0; }
  .starter-cards { grid-template-columns: 1fr; }
  .input-footer { display: none; }
}

@media (pointer: coarse) {
  :where(button, select, .starter-card) { min-height: 44px; }
}

.policy-card-body {
  flex: 1;
}

.policy-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-main);
}

.policy-card-body p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

/* Ingestion Action Bar */
.ingestion-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  gap: 16px;
}

.action-bar-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 11.5px;
}

.action-bar-note svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--accent-signal);
}

/* Active Torrent Fleet Card */
.torrent-fleet-card {
  margin-bottom: 20px;
}

.fleet-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fleet-filter-pills {
  display: flex;
  gap: 4px;
  background: var(--bg-surface-3);
  padding: 2px;
  border-radius: var(--radius-pill);
}

.filter-pill {
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--bg-surface-1);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fleet-global-actions {
  display: flex;
  gap: 6px;
}

.counter-badge {
  font-size: 10.5px;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-3);
  color: var(--accent-signal);
  border: 1px solid var(--border-subtle);
}

/* Empty State */
.torrent-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.torrent-empty-state .empty-icon svg {
  width: 44px;
  height: 44px;
  color: var(--border-strong);
  margin-bottom: 12px;
}

.torrent-empty-state h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.torrent-empty-state p {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 420px;
}

/* Torrent Item Row */
.torrent-item-row {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.15s ease;
}

.torrent-item-row:hover {
  background: var(--bg-surface-hover);
}

.torrent-item-row:last-child {
  border-bottom: none;
}

.torrent-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.torrent-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.torrent-item-info .item-icon svg {
  width: 18px;
  height: 18px;
  color: var(--accent-signal);
  flex-shrink: 0;
}

.torrent-title-block {
  overflow: hidden;
}

.torrent-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.torrent-gid {
  font-size: 10.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* Badges */
.torrent-badge {
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-downloading {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-compiler);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-paused {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-syncing {
  background: rgba(129, 140, 248, 0.15);
  color: var(--accent-tensor);
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.badge-synced {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-complete {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-signal);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-waiting {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-error {
  background: var(--status-critical-bg);
  color: var(--status-critical);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Progress Bars */
.torrent-progress-container {
  width: 100%;
  background: var(--bg-surface-3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.torrent-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.torrent-progress-bar.active-striped {
  background-size: 20px 20px;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  animation: progressStripe 1.2s linear infinite;
}

@keyframes progressStripe {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

/* Telemetry Metadata Row */
.torrent-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 10px;
}

.torrent-meta-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.meta-stat {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-stat-label {
  color: var(--text-tertiary);
}

.meta-stat-val {
  font-weight: 600;
  color: var(--text-main);
}

.meta-stat-speed {
  color: var(--accent-signal);
}

.meta-stat-eta {
  color: var(--accent-compiler);
}

.torrent-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Drive Sync Banner Row */
.torrent-drive-sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(129, 140, 248, 0.06);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--accent-tensor);
  gap: 12px;
}

.torrent-drive-sync-row.synced {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--accent-compiler);
}

.drive-sync-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.drive-sync-info svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.drive-sync-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Torrent Terminal Card */
.torrent-terminal-card {
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
}


