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

/* Global focus-visible styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:root {
  /* CoWork OS - Modern Dark Theme (Default) */
  --color-bg: transparent;
  --color-bg-primary: rgba(26, 26, 28, 0.97);
  --color-bg-darker: rgba(15, 15, 15, 0.8);
  --color-bg-sidebar: transparent;
  --color-bg-elevated: rgba(45, 45, 48, 0.9);
  --color-bg-secondary: rgba(60, 60, 65, 0.6);
  --color-bg-tertiary: rgba(70, 70, 75, 0.5);
  --color-bg-hover: rgba(255, 255, 255, 0.08);
  --color-bg-input: rgba(0, 0, 0, 0.25);
  --color-bg-glass: rgba(255, 255, 255, 0.05);
  --color-bg-glass-hover: rgba(255, 255, 255, 0.1);
  --color-border: rgba(255, 255, 255, 0.12);
  --color-border-subtle: rgba(255, 255, 255, 0.06);
  --color-border-light: rgba(255, 255, 255, 0.18);
  --color-text: #ffffff;
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.45);
  /* Modern cyan/blue accent (default) */
  --color-accent: #22d3ee;
  --color-accent-hover: #67e8f9;
  --color-accent-subtle: rgba(34, 211, 238, 0.2);
  --color-accent-dark: #0891b2;
  --color-success: #34d399;
  --color-success-subtle: rgba(52, 211, 153, 0.2);
  --color-error: #f87171;
  --color-error-subtle: rgba(248, 113, 113, 0.2);
  --color-warning: #fbbf24;
  --color-info: #60a5fa;
  --color-purple: #a78bfa;
  --sidebar-width: 16vw;
  --sidebar-width-min: 200px;
  --sidebar-width-max: 260px;
  --right-panel-width: 280px;
  --title-bar-height: 38px;
  --header-height: 56px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --app-shell-panel-radius: 16px;

  /* Glossy effects */
  --glass-blur: 20px;
  --glass-saturate: 180%;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.15);
  --gradient-glossy: linear-gradient(180deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0) 100%);
  --gradient-shine: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0) 50%);
  --density-chat-message-intrinsic-size: 80px;
  --density-timeline-event-intrinsic-size: 40px;

  /* Typography - consistent font stacks */
  --font-google-sans:
    "Google Sans Flex", "Google Sans", "Helvetica Neue", Arial, sans-serif;
  --font-ui:
    "Source Sans 3", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-content:
    "Source Sans 3", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --font-sans: var(--font-ui);

  --session-mode-autonomous: 245, 158, 11;
  --session-mode-collab: 139, 92, 246;
  --session-mode-multi-llm: 236, 72, 153;
  --session-mode-scheduled: 14, 165, 233;
  --session-mode-think: 168, 85, 247;
  --session-mode-comparison: 20, 184, 166;

  /* Opaque dropdown background (Devices panel) */
  --dp-dropdown-bg: #1a1d23;
}

/* ============================================
   Light Theme
   ============================================ */
.theme-light {
  --dp-dropdown-bg: #ffffff;
  --color-bg: transparent;
  --color-bg-primary: rgba(255, 255, 255, 0.97);
  --color-bg-darker: rgba(245, 245, 247, 0.9);
  --color-bg-sidebar: #f7f8ff;
  --color-bg-elevated: rgba(255, 255, 255, 0.95);
  --color-bg-secondary: rgba(240, 240, 242, 0.8);
  --color-bg-tertiary: rgba(235, 235, 238, 0.7);
  --color-bg-hover: rgba(0, 0, 0, 0.04);
  --color-bg-input: rgba(0, 0, 0, 0.04);
  --color-bg-glass: rgba(0, 0, 0, 0.03);
  --color-bg-glass-hover: rgba(0, 0, 0, 0.06);
  --color-border: rgba(0, 0, 0, 0.1);
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-light: rgba(0, 0, 0, 0.12);
  --color-text: #1a1a1a;
  --color-text-primary: #1a1a1a;
  --color-text-secondary: rgba(0, 0, 0, 0.65);
  --color-text-muted: rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --gradient-glossy: linear-gradient(180deg,
      rgba(255, 255, 255, 0.5) 0%,
      rgba(255, 255, 255, 0) 100%);
  --gradient-shine: linear-gradient(135deg,
      rgba(255, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0) 50%);
}

/* ============================================
   Visual Themes
   ============================================ */

/* Terminal Visual Theme */
.visual-terminal {
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --font-content: "JetBrains Mono", "Fira Code", "Menlo", monospace;
  --font-ui: "Source Sans 3", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Modern Visual Theme (default visual style, same base colors) */
.visual-oblivion {
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --font-content:
    "Source Sans 3", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-ui:
    "Source Sans 3", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Hide CLI-specific decorations in modern style */
.visual-oblivion .cli-section-prompt,
.visual-oblivion .cli-btn-bracket {
  display: none !important;
}

.visual-oblivion .cli-task-item {
  border-left: none;
  padding-left: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}

.visual-oblivion .cli-header-actions button {
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.visual-oblivion .cli-btn-text {
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: none;
}

/* Rounded avatars/icons in modern style */
.visual-warm .avatar,
.visual-warm .model-icon,
.visual-oblivion .avatar,
.visual-oblivion .model-icon {
  border-radius: 50%;
}

/* -----------------------------
   Modern Theme Visibility Logic
   ----------------------------- */

/* Default: Show Terminal, Hide Modern */
.terminal-only {
  display: block;
}

.cli-section-title .terminal-only,
.cli-section-title .modern-only,
.cli-btn-text .terminal-only,
.cli-btn-text .modern-only,
.cli-hint .terminal-only,
.cli-hint .modern-only,
.cli-footer-text .terminal-only,
.cli-footer-text .modern-only {
  display: inline-flex;
  align-items: center;
}

.modern-only {
  display: none !important;
}

/* In Modern Mode (warm/oblivion aliases): Show Modern, Hide Terminal */
.visual-warm .terminal-only,
.visual-oblivion .terminal-only {
  display: none !important;
}

.visual-warm .modern-only,
.visual-oblivion .modern-only {
  display: flex !important;
}

/* Specific display types for modern elements */
.visual-warm div.modern-only,
.visual-oblivion div.modern-only {
  display: flex !important;
  flex-direction: column;
}

.visual-warm span.modern-only,
.visual-oblivion span.modern-only {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Hide other CLI artifacts in Modern Mode */
.visual-warm .cli-prompt,
.visual-warm .cli-commands-header .cli-prompt,
.visual-warm .cli-input-prompt,
.visual-oblivion .cli-prompt,
.visual-oblivion .cli-commands-header .cli-prompt,
.visual-oblivion .cli-input-prompt {
  display: none !important;
}

/* Adjust input container for Modern Mode */
.visual-warm .cli-input-wrapper,
.visual-oblivion .cli-input-wrapper {
  padding-left: 0;
  display: flex;
  align-items: center;
}

/* Keep base input colors; only adjust typography elsewhere */

/* Modern Welcome Header Styles */
.welcome-header-modern {
  margin-bottom: 40px;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.modern-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.modern-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.modern-logo-text {
  height: 90px;
  width: auto;
  max-width: min(94vw, 780px);
  object-fit: contain;
}

/* Theme-aware logo: dark variant shown by default, light variant in .theme-light */
.logo-for-light {
  display: none !important;
}

.theme-light .logo-for-dark {
  display: none !important;
}

.theme-light .logo-for-light {
  display: inline !important;
}

.modern-title-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.visual-oblivion .modern-title-container {
  padding-top: 4px;
}

.modern-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.modern-version {
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-content);
  margin-top: 2px;
}

.modern-subtitle {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--color-text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Quick Start Grid - Modern Style Adjustments */
.visual-warm .cli-commands-header,
.visual-oblivion .cli-commands-header {
  border-bottom: none;
  margin-bottom: 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 0;
}

.visual-warm .quick-start-card,
.visual-oblivion .quick-start-card {
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.visual-warm .quick-start-card:hover,
.visual-oblivion .quick-start-card:hover {
  transform: translateY(-2px);
}

.visual-warm .quick-start-icon,
.visual-oblivion .quick-start-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 1;
  color: var(--color-accent);
}

.visual-warm .quick-start-title,
.visual-oblivion .quick-start-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.visual-warm .quick-start-desc,
.visual-oblivion .quick-start-desc {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Rounded avatars/icons in modern style */
.visual-oblivion .avatar,
.visual-oblivion .model-icon {
  border-radius: 50%;
}

/* ============================================
   Accent Color Themes
   ============================================ */

/* Cyan (Default) */
.accent-cyan {
  --color-accent: #22d3ee;
  --color-accent-hover: #67e8f9;
  --color-accent-subtle: rgba(34, 211, 238, 0.2);
  --color-accent-dark: #0891b2;
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.15);
}

/* Blue */
.accent-blue {
  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-accent-subtle: rgba(59, 130, 246, 0.2);
  --color-accent-dark: #2563eb;
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

/* Purple */
.accent-purple {
  --color-accent: #a78bfa;
  --color-accent-hover: #c4b5fd;
  --color-accent-subtle: rgba(167, 139, 250, 0.2);
  --color-accent-dark: #7c3aed;
  --shadow-glow: 0 0 20px rgba(167, 139, 250, 0.15);
}

/* Pink */
.accent-pink {
  --color-accent: #f472b6;
  --color-accent-hover: #f9a8d4;
  --color-accent-subtle: rgba(244, 114, 182, 0.2);
  --color-accent-dark: #db2777;
  --shadow-glow: 0 0 20px rgba(244, 114, 182, 0.15);
}

/* Rose */
.accent-rose {
  --color-accent: #fb7185;
  --color-accent-hover: #fda4af;
  --color-accent-subtle: rgba(251, 113, 133, 0.2);
  --color-accent-dark: #e11d48;
  --shadow-glow: 0 0 20px rgba(251, 113, 133, 0.15);
}

/* Orange */
.accent-orange {
  --color-accent: #fb923c;
  --color-accent-hover: #fdba74;
  --color-accent-subtle: rgba(251, 146, 60, 0.2);
  --color-accent-dark: #ea580c;
  --shadow-glow: 0 0 20px rgba(251, 146, 60, 0.15);
}

/* Green */
.accent-green {
  --color-accent: #34d399;
  --color-accent-hover: #6ee7b7;
  --color-accent-subtle: rgba(52, 211, 153, 0.2);
  --color-accent-dark: #059669;
  --shadow-glow: 0 0 20px rgba(52, 211, 153, 0.15);
}

/* Teal */
.accent-teal {
  --color-accent: #2dd4bf;
  --color-accent-hover: #5eead4;
  --color-accent-subtle: rgba(45, 212, 191, 0.2);
  --color-accent-dark: #0d9488;
  --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.15);
}

/* Coral - warm accent */
.accent-coral {
  --color-accent: #ff6b6b;
  --color-accent-hover: #ff8787;
  --color-accent-subtle: rgba(255, 107, 107, 0.2);
  --color-accent-dark: #e85555;
  --shadow-glow: 0 0 20px rgba(255, 107, 107, 0.15);
}

/* Light theme adjustments for accent colors */
.theme-light.accent-cyan {
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.25);
}

.theme-light.accent-blue {
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
}

.theme-light.accent-purple {
  --shadow-glow: 0 0 20px rgba(167, 139, 250, 0.25);
}

.theme-light.accent-pink {
  --shadow-glow: 0 0 20px rgba(244, 114, 182, 0.25);
}

.theme-light.accent-rose {
  --shadow-glow: 0 0 20px rgba(251, 113, 133, 0.25);
}

.theme-light.accent-orange {
  --shadow-glow: 0 0 20px rgba(251, 146, 60, 0.25);
}

.theme-light.accent-green {
  --shadow-glow: 0 0 20px rgba(52, 211, 153, 0.25);
}

.theme-light.accent-teal {
  --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.25);
}

.theme-light.accent-coral {
  --shadow-glow: 0 0 20px rgba(255, 107, 107, 0.25);
}

/* ============================================
   Light Theme Component Overrides
   ============================================ */

/* Headers with dark overlays */
.theme-light .main-header {
  background: transparent;
}

/* Event items and overlays */
.theme-light .event-content-overlay,
.theme-light .tool-result-overlay {
  background: rgba(255, 255, 255, 0.85);
}

/* Code blocks and pre elements */
.theme-light pre,
.theme-light code,
.theme-light .code-block,
.theme-light .command-preview,
.theme-light .tool-code {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text);
}

/* Terminal-like elements */
.theme-light .terminal-output,
.theme-light .step-output,
.theme-light .output-text {
  background: rgba(0, 0, 0, 0.03);
  color: var(--color-text);
}

/* Tool result containers */
.theme-light .tool-result-content,
.theme-light .tool-output {
  background: rgba(0, 0, 0, 0.02);
}

/* Buttons with dark backgrounds */
.theme-light .icon-btn,
.theme-light .action-btn {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .icon-btn:hover,
.theme-light .action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Modals and dialogs */
.theme-light .modal-backdrop {
  background: rgba(255, 255, 255, 0.7);
}

.theme-light .modal-content,
.theme-light .dialog-content {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Input fields */
.theme-light input,
.theme-light textarea,
.theme-light select {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--color-text);
}

.theme-light input::placeholder,
.theme-light textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* Task items */
.theme-light .task-item {
  background: rgba(255, 255, 255, 0.6);
}

.theme-light .task-item:hover {
  background: rgba(255, 255, 255, 0.8);
}

.theme-light .task-item.active {
  background: rgba(255, 255, 255, 0.9);
}

/* Scrollbars for light theme */
.theme-light ::-webkit-scrollbar-track {
  background: transparent;
}

.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
}

.theme-light *:hover> ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.theme-light ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Dropdown menus */
.theme-light .dropdown-menu,
.theme-light .context-menu,
.theme-light .popover {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* File Viewer modal for light theme */
.theme-light .file-viewer-overlay {
  background: rgba(20, 20, 28, 0.55);
}

.theme-light .file-viewer-tabular-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.025);
}

.theme-light .file-viewer-tabular-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .file-viewer-code-block .hljs {
  color: #383a42;
}

.theme-light .file-viewer-code-block .hljs-keyword,
.theme-light .file-viewer-code-block .hljs-selector-tag,
.theme-light .file-viewer-code-block .hljs-built_in,
.theme-light .file-viewer-code-block .hljs-name {
  color: #a626a4;
}

.theme-light .file-viewer-code-block .hljs-string,
.theme-light .file-viewer-code-block .hljs-addition {
  color: #50a14f;
}

.theme-light .file-viewer-code-block .hljs-number,
.theme-light .file-viewer-code-block .hljs-literal {
  color: #986801;
}

.theme-light .file-viewer-code-block .hljs-comment,
.theme-light .file-viewer-code-block .hljs-quote {
  color: #a0a1a7;
}

.theme-light .file-viewer-code-block .hljs-attr,
.theme-light .file-viewer-code-block .hljs-title,
.theme-light .file-viewer-code-block .hljs-section {
  color: #4078f2;
}

.theme-light .json-node-string {
  color: #50a14f;
}

.theme-light .json-node-number {
  color: #986801;
}

.theme-light .json-node-boolean {
  color: #a626a4;
}

/* Tags and badges */
.theme-light .tag,
.theme-light .badge,
.theme-light .status-badge {
  background: rgba(0, 0, 0, 0.06);
}

/* Event timeline */
.theme-light .event-item {
  background: rgba(255, 255, 255, 0.6);
}

.theme-light .event-item:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Approval request blocks */
.theme-light .approval-request,
.theme-light .approval-block {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Chat input area */
.theme-light .chat-input-container,
.theme-light .message-input-wrapper {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

/* Empty states */
.theme-light .empty-state,
.theme-light .no-tasks,
.theme-light .placeholder {
  color: rgba(0, 0, 0, 0.4);
}

/* Progress bars */
.theme-light .progress-bar-bg {
  background: rgba(0, 0, 0, 0.08);
}

/* Tooltips */
.theme-light .tooltip {
  background: rgba(0, 0, 0, 0.8);
  color: white;
}

/* Step cards */
.theme-light .step-card,
.theme-light .plan-step {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Settings panels */
.theme-light .settings-panel {
  background: rgba(255, 255, 255, 0.6);
}

/* Quick task FAB */
.theme-light .quick-task-fab {
  background: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Light Mode - Main Layout */
.theme-light .sidebar {
  background: var(--color-bg-sidebar) !important;
}

.theme-light .sidebar-header {
  background: transparent !important;
}

.theme-light .sidebar-tabs {
  background: transparent !important;
}

.theme-light .new-task-btn,
.theme-light .cli-sessions-header {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.theme-light .new-task-btn:hover,
.theme-light .cli-sessions-header:hover {
  background: rgba(255, 255, 255, 1) !important;
  border-color: var(--color-accent) !important;
}

.theme-light .right-panel {
  background: var(--color-bg-sidebar) !important;
}

.theme-light .main-content {
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.theme-light .main-footer {
  background: #ffffff !important;
}

.theme-light .main-footer::before {
  background: linear-gradient(to bottom, transparent, #ffffff) !important;
}

.theme-light .main-header {
  background: transparent !important;
}

.theme-light .main-body {
  background: transparent !important;
}

.theme-light .welcome-view {
  background: transparent;
}

.theme-light .welcome-content {
  background: transparent !important;
}

.theme-light .welcome-content.cli-style {
  background: transparent !important;
}

.theme-light .cli-info {
  background: transparent;
}

.theme-light .cli-line-disclosure {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .cli-command {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .cli-command:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--color-accent);
}

.theme-light .quick-start-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .quick-start-card:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}

.theme-light .cli-input-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.theme-light .goal-mode-section {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .welcome-input-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.theme-light .input-container {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 8px;
}

.theme-light .cli-header {
  background: transparent !important;
}

.theme-light .ascii-art {
  text-shadow: none;
  color: var(--color-accent-dark);
  background: transparent !important;
}

.theme-light .welcome-logo-img {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.15));
}

.theme-light .cli-commands-header {
  border-color: rgba(0, 0, 0, 0.1);
}

/* Light mode for panel headers and footers */
.theme-light .cli-panel-header {
  background: rgba(255, 255, 255, 0.6) !important;
}

.theme-light .cli-panel-footer {
  background: rgba(255, 255, 255, 0.6) !important;
}

.theme-light .cli-sidebar-footer {
  background: transparent !important;
}

.theme-light .cli-sidebar-header {
  background: rgba(255, 255, 255, 0.6) !important;
}

.theme-light .cli-action-btn {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.theme-light .cli-action-btn:hover {
  background: rgba(255, 255, 255, 1) !important;
  border-color: var(--color-accent) !important;
}

.theme-light .cli-progress-item {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .cli-step-feedback-panel {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .cli-step-feedback-btn {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .cli-step-feedback-input {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .cli-file-item {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .cli-context-item {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .cli-active-context-icon {
  background: rgba(0, 0, 0, 0.06);
}

.theme-light .cli-active-context-badge {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary);
}

.theme-light .cli-active-context-scroll {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.theme-light .cli-active-context-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.theme-light .cli-active-context-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.theme-light .cli-task-menu,
.theme-light .task-item-menu {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-light .cli-task-menu::before,
.theme-light .task-item-menu::before {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .cli-menu-option:hover,
.theme-light .task-item-menu-option:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  background-color: rgba(0, 0, 0, 0.08) !important;
}

.theme-light .task-item-menu-option-danger:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  background-color: rgba(239, 68, 68, 0.12) !important;
}

.theme-light .cli-task-item.task-item-selected {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* Override native vibrancy with solid background in light mode */
.theme-light {
  background: #f0f0f2 !important;
}

.theme-light #root {
  background: transparent !important;
}

.theme-light .app-container {
  background: transparent !important;
}

.theme-light .app-layout {
  background: var(--color-bg-sidebar) !important;
}

/* Light mode for workspace selector */
.theme-light .cli-workspace-selector {
  background: #f0f0f2 !important;
}

.theme-light .cli-workspace-content {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.theme-light .cli-terminal-header {
  background: rgba(255, 255, 255, 0.6) !important;
}

.theme-light .cli-init-info {
  background: rgba(0, 0, 0, 0.03) !important;
}

.theme-light .cli-action-btn {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

.theme-light .cli-action-btn:hover {
  background: rgba(255, 255, 255, 1) !important;
  border-color: var(--color-accent) !important;
}

.theme-light .cli-init-footer {
  background: rgba(255, 255, 255, 0.6) !important;
}

.theme-light .cli-workspace-item:hover {
  background: rgba(0, 0, 0, 0.03) !important;
}

.theme-light .cli-logo-section .cli-ascii-logo {
  text-shadow: none;
  color: var(--color-accent-dark);
}

/* Light theme button overrides */
.theme-light .button-secondary {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--color-text);
}

.theme-light .button-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

.theme-light .button-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.theme-light .button-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.theme-light .channel-actions button {
  padding: 8px 14px;
}

.theme-light .settings-select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.theme-light .settings-input {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.theme-light .pairing-code-display {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .settings-info-box {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .user-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

.theme-light .voice-input-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgba(0, 0, 0, 0.7);
}

.theme-light .voice-input-btn:hover:not(:disabled) {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.theme-light .voice-input-btn.recording {
  background: rgba(248, 113, 113, 0.15);
  border-color: #ef4444;
  color: #dc2626;
}

.theme-light .voice-input-btn.processing {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: visible;
}

#root {
  height: 100%;
}

/* App Layout */
.app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent;
  position: relative;
}

/* Draggable title bar for window movement */
.title-bar {
  height: var(--title-bar-height);
  min-height: var(--title-bar-height);
  width: 100%;
  -webkit-app-region: drag;
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 80px;
  padding-right: 12px;
  overflow: visible;
}

/* Left side of title bar (sidebar toggle) */
.title-bar-left {
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  gap: 4px;
}

html.platform-darwin .title-bar-left {
  transform: translateY(5px);
}

/* Actions in the title bar (notifications, etc.) */
.title-bar-actions {
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
  padding-top: 10px;
  margin-left: auto;
}

/* Title bar icon buttons */
.title-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  -webkit-app-region: no-drag;
  transition: background-color 0.15s ease;
  color: #6b7280;
}

.title-bar-btn:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.title-bar-btn:active {
  background-color: var(--color-bg-secondary);
}

.title-bar-terminal-toggle.active {
  background-color: var(--color-bg-secondary);
}

.title-bar-terminal-toggle.active svg {
  stroke: var(--color-text-primary);
}

.title-bar-sidebar-toggle svg {
  width: 16px;
  height: 16px;
  transform: translateY(1px);
}

.title-bar-icon {
  display: block;
  flex-shrink: 0;
}

.title-bar-actions .title-bar-btn>svg {
  width: 16px;
  height: 16px;
}

.title-bar-output-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-success);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

/* ============================================
   Update Notification Pill
   ============================================ */

.sidebar-update-slot {
  position: absolute;
  top: 8px;
  left: 118px;
  right: 12px;
  z-index: 1002;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 26px;
  pointer-events: none;
  -webkit-app-region: no-drag;
}

.update-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  min-width: 0;
  width: auto;
  height: 26px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--color-bg-glass) 62%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  border-radius: 8px;
  color: var(--color-accent);
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
  -webkit-app-region: no-drag;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.update-banner:hover {
  background: color-mix(in srgb, var(--color-accent-subtle) 74%, transparent);
  border-color: color-mix(in srgb, var(--color-accent) 42%, var(--color-border));
}

.update-banner-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 2px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  pointer-events: auto;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.update-banner-dismiss:hover {
  color: var(--color-text-primary);
  background: color-mix(in srgb, var(--color-text-muted) 15%, transparent);
}

/* Make sure interactive elements are not draggable */
button,
input,
select,
textarea,
a,
.task-item,
.new-task-btn,
.settings-btn,
.task-item-more,
.task-item-menu,
.task-item-actions,
.modal-overlay,
.welcome-input-wrapper {
  -webkit-app-region: no-drag;
}

.app-layout {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Collapsed sidebar states */
.app-layout.left-collapsed .main-content {
  margin-left: 0;
}

.app-layout.left-collapsed .main-header {
  padding-left: 116px;
  /* Space for macOS window controls (80px) + sidebar toggle (32px) + gap (4px) */
}

.app-layout.right-collapsed .main-content {
  margin-right: 0;
}

.app-layout:not(.left-collapsed) > .sidebar {
  border-right: 0;
}

.app-layout:not(.left-collapsed) > .main-content {
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  border-left: 1px solid var(--color-border-subtle);
  border-top-left-radius: var(--app-shell-panel-radius);
  border-bottom-left-radius: var(--app-shell-panel-radius);
  overflow: hidden;
}

.app-layout:not(.left-collapsed) > .selected-workspace-view > .selected-workspace-main-row > .main-content {
  border-top: 1px solid var(--color-border-subtle);
  border-left: 1px solid var(--color-border-subtle);
  border-top-left-radius: var(--app-shell-panel-radius);
  overflow: hidden;
}

.selected-workspace-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.selected-workspace-main-row {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.selected-workspace-view.is-resizing,
.selected-workspace-view.is-resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.selected-workspace-view.is-resizing iframe,
.selected-workspace-view.is-resizing webview {
  pointer-events: none !important;
}

.app-resizable-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  outline: 0;
}

.app-resizable-divider::before,
.app-resizable-divider::after {
  content: "";
  position: absolute;
}

.app-resizable-divider::before {
  background: var(--color-border-subtle);
  transition: background 0.15s ease;
}

.app-resizable-divider--vertical {
  width: 1px;
  min-height: 0;
  cursor: col-resize;
}

.app-resizable-divider--vertical::after {
  inset-block: 0;
  left: 50%;
  width: 16px;
  transform: translateX(-50%);
}

.app-resizable-divider--vertical::before {
  inset-block: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}

.app-resizable-divider--horizontal {
  width: 100%;
  height: 1px;
  cursor: ns-resize;
}

.app-resizable-divider--horizontal::after {
  inset-inline: 0;
  top: 50%;
  height: 12px;
  transform: translateY(-50%);
}

.app-resizable-divider--horizontal::before {
  inset-inline: 0;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
}

.app-resizable-divider:focus-visible::before,
.app-resizable-divider:hover::before,
.selected-workspace-view.is-resizing .spreadsheet-sidebar-resize-handle::before,
.canvas-preview-container.resizing .canvas-resize-handle::before {
  background: var(--color-accent);
}

.app-resizable-divider-grip {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  color: var(--color-text-muted);
  background: var(--color-border-subtle);
  border: 0;
  border-radius: 999px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    outline-color 0.15s ease;
}

.app-resizable-divider--horizontal .app-resizable-divider-grip {
  transform: rotate(90deg);
}

.app-resizable-divider-icon {
  width: 12px;
  height: 12px;
}

.app-resizable-divider:hover .app-resizable-divider-grip,
.app-resizable-divider:focus-visible .app-resizable-divider-grip,
.selected-workspace-view.is-resizing .spreadsheet-sidebar-resize-handle .app-resizable-divider-grip,
.canvas-preview-container.resizing .canvas-resize-handle .app-resizable-divider-grip {
  color: var(--color-text);
  background: var(--color-accent);
}

.app-resizable-divider:focus-visible .app-resizable-divider-grip {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.spreadsheet-sidebar-resize-handle {
  z-index: 8;
  flex-basis: 8px !important;
  width: 8px;
}

.spreadsheet-resizable-sidebar {
  display: flex;
  flex: 0 0 auto;
  min-width: 420px;
  max-width: calc(100% - 390px);
  min-height: 0;
  height: 100%;
}

.spreadsheet-resizable-sidebar > .spreadsheet-viewer-sidebar,
.spreadsheet-resizable-sidebar > .document-viewer-sidebar,
.spreadsheet-resizable-sidebar > .presentation-artifact-viewer-sidebar,
.spreadsheet-resizable-sidebar > .web-artifact-viewer-sidebar,
.spreadsheet-resizable-sidebar > .browser-workbench-sidebar,
.spreadsheet-resizable-sidebar > .spawned-agent-sidebar {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.spawned-agent-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-primary);
  border-left: 1px solid var(--color-border-subtle);
}

.spawned-agent-sidebar-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(var(--title-bar-height) + 14px) 18px 14px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-sidebar);
}

.spawned-agent-sidebar-heading {
  min-width: 0;
}

.spawned-agent-sidebar-kicker {
  margin-bottom: 5px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.25;
}

.spawned-agent-sidebar h2 {
  margin: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spawned-agent-sidebar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--color-text-muted);
  font-size: 11px;
}

.spawned-agent-sidebar-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
}

.spawned-agent-sidebar-status.is-working {
  color: var(--color-accent);
}

.spawned-agent-sidebar-status.is-failed {
  color: var(--color-error);
}

.spawned-agent-sidebar-status-icon,
.spawned-agent-sidebar-tab-icon {
  flex: 0 0 auto;
}

.spawned-agent-sidebar .spinning {
  animation: spin 1s linear infinite;
}

.spawned-agent-sidebar-close {
  flex: 0 0 auto;
  min-width: 54px;
  height: 28px;
  padding: 0 10px;
  color: var(--color-text-secondary);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: 7px;
  cursor: pointer;
}

.spawned-agent-sidebar-close:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.spawned-agent-sidebar-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 10px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-primary);
}

.spawned-agent-sidebar-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  height: 30px;
  padding: 0 10px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  border-radius: 7px;
  cursor: pointer;
  box-sizing: border-box;
}

.spawned-agent-sidebar-tab.active {
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border-color: color-mix(in srgb, var(--color-accent) 54%, var(--color-border-subtle));
}

.spawned-agent-sidebar-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spawned-agent-sidebar-error {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 12px 0;
  padding: 9px 10px;
  color: var(--color-error);
  font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--color-error) 35%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-error) 8%, transparent);
}

.spawned-agent-sidebar-transcript {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.spawned-agent-sidebar-transcript > .main-content {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
}

.spawned-agent-sidebar-empty {
  padding: 18px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ==================== LEFT SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width-min);
  max-width: var(--sidebar-width-max);
  height: 100%;
  min-height: 0;
  background: var(--color-bg-sidebar);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-right: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  container-type: inline-size;
  padding-top: var(--title-bar-height);
  transition:
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

/* Removed: double-border effect - using single border only */

.sidebar-tabs {
  display: flex;
  padding: 0 12px;
  gap: 4px;
  -webkit-app-region: drag;
  height: var(--header-height);
  align-items: center;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-app-region: no-drag;
}

.sidebar-tab:hover {
  color: var(--color-text-secondary);
  background: var(--color-bg-hover);
}

.sidebar-tab.active {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.sidebar-header {
  padding: 12px 12px 6px 12px;
}

.sidebar-header-top {
  padding-top: 44px;
  /* Space for macOS traffic lights */
}

.new-task-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.new-task-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--gradient-glossy);
  pointer-events: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.new-task-btn:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.new-task-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.task-list {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px;
}

.task-list-header {
  padding: 12px 8px 8px;
  font-weight: 500;
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Ideas tab — above Sessions in sidebar */
.sidebar-ideas-tab {
  flex-shrink: 0;
}

.sidebar-ideas-btn {
  width: 100%;
}

/* ── Ideas panel — extends dp-* Devices theme ────────────────────── */

/* Filter row spacing tweak */
.dp-ideas-filter-row {
  margin-bottom: 4px;
  flex-wrap: wrap;
}

/* Grid — 3-col matches Devices tasks-grid feel */
.dp-ideas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

@media (max-width: 1000px) {
  .dp-ideas-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 600px) {
  .dp-ideas-grid {
    grid-template-columns: 1fr;
  }
}

/* Card overrides — reduces gap so emoji + desc fit neatly */
.dp-idea-card {
  gap: 10px;
  min-height: 150px;
}

/* Icon + title row */
.dp-idea-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.dp-idea-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  margin-top: 1px;
}

/* Title inherits dp-task-title; allow 2 lines */
.dp-idea-title {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Description */
.dp-idea-desc {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Meta row */
.dp-idea-meta {
  margin-top: auto;
  flex-wrap: wrap;
}

/* Integration icons */
.dp-idea-icons {
  display: flex;
  gap: 4px;
}

.dp-idea-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  border-radius: 4px;
}

.task-item {
  padding: 7px 12px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.task-item:hover {
  background: var(--color-bg-glass-hover);
}

.task-item-selected {
  background: var(--color-bg-secondary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px var(--color-accent-subtle);
}

.task-item-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
}

.task-item-selected .task-item-icon {
  border-color: var(--color-accent-subtle);
  color: var(--color-accent);
}

.task-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.task-item-content {
  flex: 1;
  min-width: 0;
}

.task-item-title {
  font-size: 13px;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.task-item-status {
  font-size: 11px;
  color: var(--color-text-muted);
}

.task-item-status.active {
  color: var(--color-accent);
}

.task-item-status.completed {
  color: var(--color-success);
}

.task-item-status.failed {
  color: var(--color-error);
}

.task-item-more {
  opacity: 0;
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition:
    opacity 0.15s ease,
    background 0.15s ease;
}

.task-item:hover .task-item-more,
.task-item-more[aria-expanded="true"] {
  opacity: 1;
}

.task-item-more:hover {
  background: var(--color-bg-secondary);
}

/* Task Item Actions */
.task-item-actions {
  position: relative;
}

.task-item-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  min-width: 140px;
  background: #2d2d30;
  background-color: #2d2d30 !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  margin-top: 2px;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.task-item-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.task-item-menu-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  background-color: transparent !important;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.task-item-menu-option:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.task-item-menu-option svg {
  flex-shrink: 0;
}

.task-item-menu-option-danger {
  color: var(--color-error);
}

.task-item-menu-option-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
}

/* Task Item Rename Input */
.task-item-rename-input {
  width: 100%;
  padding: 4px 8px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
}

.task-item-rename-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

/* Sidebar Footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  flex-shrink: 0;
  min-height: 48px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  flex: 1;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-bg);
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-bg-elevated);
  box-shadow:
    var(--shadow-lg),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--gradient-glossy);
  pointer-events: none;
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.1);
}

.modal-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-subtle);
}

.modal-header h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  padding: 4px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-glass);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close:hover {
  border-color: var(--color-border);
  background: var(--color-bg-glass-hover);
  color: var(--color-text);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.modal-footer {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--color-border-subtle);
}

.modal-footer-right {
  display: flex;
  gap: 12px;
}

.main-content {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  position: relative;
  padding-top: var(--title-bar-height);
  background: var(--color-bg-primary);
  container-type: inline-size;
  transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.task-view-skeleton {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding-top: var(--title-bar-height);
  background: var(--color-bg-primary);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.task-view-loading-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(48px, 4.8vw, 68px);
  aspect-ratio: 1;
  opacity: 0;
  animation: task-view-logo-fade 1.8s ease-in-out infinite both;
}

.task-view-loading-logo::before {
  content: "";
  position: absolute;
  inset: -18%;
  border-radius: 32%;
  background: rgba(116, 138, 202, 0.14);
  filter: blur(18px);
  opacity: 0.32;
}

.task-view-loading-logo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(20, 31, 52, 0.14));
}

@keyframes task-view-logo-fade {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  50% {
    opacity: 0.5;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .task-view-loading-logo {
    animation: none;
    opacity: 0.5;
  }
}

.user-plan {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* Task surface styles load with MainContent. */

/* Right panel styles load with RightPanel. */

/* Settings modal styles load with Settings. */

/* Settings button in sidebar footer */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.settings-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* Settings tab styles load with Settings. */

/* CLI Panel Footer */
.cli-panel-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-subtle);
  background: rgba(0, 0, 0, 0.3);
}

.right-panel .cli-panel-footer {
  border-top: 0;
  background: transparent;
  margin-top: auto;
}

.cli-footer-prompt {
  color: var(--color-accent);
  font-weight: 600;
}

.cli-footer-text {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ==========================================
   CLI Sidebar Styles (Left Sidebar)
   ========================================== */

.cli-sidebar {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4) !important;
}

.theme-light .cli-sidebar {
  background: var(--color-bg-sidebar) !important;
}

.cli-sidebar-header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border-subtle);
  -webkit-app-region: drag;
}

.cli-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 1px;
}

/* CLI Action Buttons */
.cli-header-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cli-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent !important;
  border: 1px solid var(--color-border-subtle) !important;
  border-radius: var(--radius-md);
  font-family: var(--font-mono) !important;
  padding: 8px 12px !important;
  color: var(--color-text-muted) !important;
  font-size: 11px !important;
  letter-spacing: 0.2px;
  transition: all 0.15s ease;
}

.cli-action-btn:hover {
  border-color: var(--color-accent) !important;
  color: var(--color-text) !important;
  background: rgba(0, 0, 0, 0.12) !important;
}

.cli-new-task-btn {
  justify-content: flex-start;
  padding: 8px 12px !important;
  height: 34px;
  min-height: 34px;
  box-sizing: border-box;
  background: var(--color-bg-glass) !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text-secondary) !important;
  font-size: 13px !important;
  font-family: var(--font-ui) !important;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  position: relative;
  overflow: hidden;
}

.cli-new-task-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--gradient-glossy);
  pointer-events: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cli-new-task-btn:hover {
  background: var(--color-bg-glass-hover) !important;
  border-color: var(--color-border-light) !important;
  box-shadow: var(--shadow-sm);
  color: var(--color-text) !important;
  transform: none;
}

.cli-mission-control-btn {
  justify-content: flex-start;
}

.cli-btn-bracket {
  color: var(--color-text-muted);
}

.cli-btn-plus {
  color: var(--color-accent);
  font-weight: 600;
}

.cli-btn-accent {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.6px;
}

.cli-btn-text {
  color: var(--color-text);
}

.cli-new-task-modern-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.cli-new-task-modern-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}

.cli-new-task-btn svg {
  display: none;
}

.cli-new-task-btn .sidebar-home-btn-icon svg {
  display: block;
}

.sidebar-home-btn {
  width: 100%;
  margin-top: 0;
  justify-content: flex-start;
}

.sidebar-home-btn:hover {
  transform: none;
}

.sidebar-home-btn.active {
  border-color: color-mix(in srgb, var(--color-accent) 36%, var(--color-border-light)) !important;
  background: var(--color-bg-glass) !important;
  color: var(--color-text-secondary) !important;
}

.sidebar-home-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 18px;
  height: 18px;
}

.sidebar-home-btn-icon-image {
  width: 18px;
  height: 18px;
  display: block;
}

/* CLI Task List */
.cli-task-list {
  padding: 0;
  overflow-x: hidden;
}

.task-list-virtualized {
  overflow-y: hidden;
}

.sidebar-virtual-list {
  height: 100%;
}

.cli-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
}

.cli-sessions-header {
  margin: 0;
  padding: 8px 12px;
  height: 34px;
  min-height: 34px;
  box-sizing: border-box;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.cli-sessions-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--gradient-glossy);
  pointer-events: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.cli-sessions-header:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.cli-list-header .cli-section-prompt {
  color: var(--color-accent);
}

.cli-list-header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  text-align: left;
  position: relative;
  z-index: 1;
}

.cli-sessions-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.cli-sessions-title {
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.cli-sessions-collapse-indicator {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted) !important;
  flex-shrink: 0;
}

.cli-list-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.cli-sessions-header .cli-list-header-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.cli-sessions-header .session-filter-toggle,
.cli-sessions-header .show-failed-toggle {
  margin-left: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  border-radius: 0;
}

.cli-sessions-header .session-filter-toggle:hover,
.cli-sessions-header .show-failed-toggle:hover {
  background: transparent;
  color: var(--color-text-secondary);
}

.cli-sessions-header .session-filter-toggle.active {
  color: var(--color-text-secondary);
}

.cli-sessions-header .sidebar-home-btn-icon.cli-sessions-icon {
  min-width: 18px;
  width: auto;
}

.cli-sessions-header .session-filter-toggle svg {
  width: 16px;
  height: 16px;
}

.cli-sessions-header .session-filter-toggle .filter-count {
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 10px;
  border-radius: 999px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.sidebar-sessions-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.sidebar-sessions-search:focus-within {
  border-color: color-mix(in srgb, var(--color-accent) 60%, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent);
}

.sidebar-sessions-search input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  padding: 0;
  box-shadow: none;
}

.sidebar-sessions-search input:focus {
  outline: none;
}

.sidebar-sessions-search input::placeholder {
  color: var(--color-text-muted);
}

/* Minimal sidebar navigation: plain rows, no framed button chrome. */
.sidebar .cli-new-task-btn::before,
.sidebar .cli-sessions-header::before {
  display: none;
}

.sidebar-header {
  padding: 12px 18px 0;
}

.sidebar .cli-header-actions.sidebar-nav {
  gap: 5px;
}

.sidebar-new-session-btn {
  height: 34px;
  min-height: 34px;
  margin-bottom: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  box-shadow: none;
  color: var(--color-text-secondary) !important;
}

.sidebar-new-session-btn .cli-new-task-modern-label {
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
}

.sidebar-new-session-btn .sidebar-new-session-icon {
  width: 20px;
  height: 20px;
  color: currentColor;
  opacity: 0.9;
}

.sidebar-new-session-btn .sidebar-new-session-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-new-session-btn:hover {
  transform: none;
  background: transparent !important;
  color: var(--color-text) !important;
}

.sidebar-nav-item {
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--color-text-secondary) !important;
}

.sidebar-nav-item .cli-new-task-modern-label {
  width: 100%;
  min-width: 0;
  gap: 14px;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
}

.sidebar-nav-item .cli-new-task-modern-label>span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav-item .sidebar-home-btn-icon {
  color: inherit;
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.sidebar-nav-item .sidebar-home-btn-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-nav-item:hover {
  transform: none;
  border: 0 !important;
  background: transparent !important;
  color: var(--color-text) !important;
}

.sidebar-nav-item.active,
.sidebar-home-btn.active.sidebar-nav-item {
  border: 0 !important;
  background: transparent !important;
  color: var(--color-text) !important;
  font-weight: 600;
}

.sidebar-nav-item.active .sidebar-home-btn-icon {
  opacity: 1;
  color: var(--color-accent);
}

.sidebar-more-toggle {
  justify-content: flex-start !important;
}

.sidebar-more-toggle:hover {
  color: var(--color-text);
}

.sidebar-more-dots {
  align-items: center;
  justify-content: flex-start;
}

.sidebar-more-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-ideas-tab {
  flex-shrink: 0;
  padding: 0 18px 10px;
}

.sidebar-header-sessions {
  flex-shrink: 0;
  padding: 8px 18px;
}

.cli-sessions-header {
  justify-content: flex-start;
  height: 28px;
  min-height: 28px;
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-muted);
}

.cli-sessions-header:hover {
  transform: none;
  box-shadow: none;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
}

.cli-sessions-header .cli-new-task-modern-label {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  display: inline-flex;
  justify-content: flex-start !important;
  gap: 10px;
}

.sidebar .cli-sessions-header .cli-list-header-toggle {
  justify-content: flex-start;
}

.visual-warm .sidebar .cli-sessions-header span.modern-only,
.visual-oblivion .sidebar .cli-sessions-header span.modern-only {
  justify-content: flex-start !important;
}

.sidebar .cli-sessions-header .sidebar-home-btn-icon.cli-sessions-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
}

.cli-sessions-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  line-height: 1;
}

.sidebar-sessions-search {
  height: 32px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
}

.cli-sessions-header .show-failed-toggle {
  max-width: 78px;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.62;
}

.sidebar-session-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.cli-sessions-header .sidebar-session-action svg {
  display: block;
  width: 16px;
  height: 16px;
}

.sidebar-session-action:hover,
.sidebar-session-action.active {
  color: var(--color-text-secondary);
  background: transparent;
}

.sidebar-session-filter-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.sidebar-session-filter-option {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.sidebar-session-filter-option:hover,
.sidebar-session-filter-option.active {
  color: var(--color-text-secondary);
  background: var(--color-bg-hover);
}

.sidebar-session-filter-option:disabled {
  opacity: 0.42;
  cursor: default;
}

.sidebar-sessions-search:focus-within {
  border-color: transparent;
  box-shadow: none;
  color: var(--color-text-secondary);
}

.theme-light .sidebar .sidebar-new-session-btn,
.theme-light .sidebar .sidebar-nav-item,
.theme-light .sidebar .cli-sessions-header {
  background: transparent !important;
  border: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.theme-light .sidebar .sidebar-new-session-btn:hover,
.theme-light .sidebar .sidebar-nav-item:hover,
.theme-light .sidebar .cli-sessions-header:hover {
  background: transparent !important;
  border: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.devices-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
  padding: 0 12px 12px;
  overflow-x: hidden;
  overflow-y: auto;
}

.devices-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.devices-sidebar-home {
  display: flex;
}

.devices-sidebar-home-btn,
.devices-sidebar-link,
.devices-sidebar-item,
.devices-sidebar-sort {
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.devices-sidebar-home-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
}

.devices-sidebar-home-btn.active {
  border-color: color-mix(in srgb, var(--color-accent) 50%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent-subtle) 75%, transparent), var(--color-bg-glass));
  color: var(--color-text);
}

.devices-sidebar-home-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent-subtle) 80%, transparent);
  color: var(--color-accent);
  flex-shrink: 0;
}

.devices-sidebar-home-count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.devices-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.devices-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
}

.devices-sidebar-link strong {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text);
}

.devices-sidebar-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.devices-sidebar-sort {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text-muted);
}

.devices-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.devices-sidebar-item {
  padding: 12px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.devices-sidebar-item.featured {
  border-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-accent-subtle) 55%, transparent), var(--color-bg-glass));
}

.devices-sidebar-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.devices-sidebar-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.devices-sidebar-item-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent-subtle) 70%, transparent);
}

.devices-sidebar-item strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.devices-sidebar-item span:last-child {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.devices-sidebar-home-btn:hover,
.devices-sidebar-link:hover,
.devices-sidebar-item:hover {
  border-color: var(--color-border-light);
  background: var(--color-bg-glass-hover);
  transform: translateY(-1px);
}

/* CLI Task Item */
.cli-task-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  margin-bottom: 0;
  padding: 0 6px 0 16px !important;
  padding-left: var(--cli-task-padding-left, 16px) !important;
  border-radius: 0 !important;
  background: transparent !important;
  border-left: none;
  transition: all 0.15s ease;
  position: relative;
}

.cli-task-item:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

.cli-task-item.task-item-selected {
  background: rgba(0, 0, 0, 0.3) !important;
}

.cli-task-num {
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0.6;
  flex-shrink: 0;
}

.cli-task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.cli-task-status.completed {
  color: var(--color-info, #60a5fa);
}

.cli-task-status.active {
  color: var(--color-accent);
}

.cli-task-status.awaiting {
  color: var(--color-text-muted);
}

.cli-task-status.failed {
  color: var(--color-error);
}

.cli-session-indicator {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid currentColor;
  box-sizing: border-box;
  display: inline-block;
}

.cli-session-indicator-active {
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

.cli-session-indicator-awaiting {
  opacity: 0.7;
}

.cli-session-indicator-invisible {
  opacity: 0;
}

.cli-session-indicator-completed {
  width: 10px;
  height: 10px;
  border: none;
  background: currentColor;
}

.cli-task-pinned {
  font-size: 11px;
  color: var(--color-accent);
  margin-left: 2px;
  margin-right: 2px;
  line-height: 1;
  flex-shrink: 0;
}

.task-status.status-paused {
  color: var(--color-warning);
}

.task-status.status-blocked {
  color: var(--color-warning);
}

.task-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  margin: 4px 0 12px;
  background: var(--color-warning-subtle, rgba(250, 204, 21, 0.1));
  border: 1px solid var(--color-warning, #facc15);
}

.task-status-banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--color-text);
}

.task-status-banner-detail {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.task-status-banner-summary {
  line-height: 1.5;
}

.task-status-banner-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-status-banner-secondary-btn {
  border: 1px solid color-mix(in srgb, var(--color-warning, #facc15) 38%, transparent);
  background: color-mix(in srgb, var(--color-warning-subtle, rgba(250, 204, 21, 0.1)) 72%, white 28%);
  color: var(--color-text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-status-banner-primary-btn {
  border: 1px solid color-mix(in srgb, var(--color-accent, #7c3aed) 46%, transparent);
  background: color-mix(in srgb, var(--color-accent, #7c3aed) 18%, white 82%);
  color: var(--color-text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-status-banner-primary-btn:hover {
  background: color-mix(in srgb, var(--color-accent, #7c3aed) 24%, white 76%);
  border-color: color-mix(in srgb, var(--color-accent, #7c3aed) 62%, transparent);
}

.task-status-banner-primary-btn:disabled,
.task-status-banner-secondary-btn:disabled,
.task-status-banner-stop-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.task-status-banner-secondary-btn:hover {
  background: color-mix(in srgb, var(--color-warning-subtle, rgba(250, 204, 21, 0.18)) 82%, white 18%);
  border-color: color-mix(in srgb, var(--color-warning, #facc15) 54%, transparent);
}

.task-feedback-banner-dismiss {
  opacity: 0.55;
}

.task-feedback-banner-dismiss:hover {
  opacity: 1;
}

.task-status-banner-stop-btn {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-status-banner-stop-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.task-status-banner-stop-btn:active {
  transform: translateY(1px);
}

.task-status-banner-blocked {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}

.task-status-banner-remote {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-accent-subtle) 72%, transparent),
    color-mix(in srgb, var(--color-bg-glass) 86%, white 14%)
  );
  border-color: color-mix(in srgb, var(--color-accent) 38%, transparent);
}

.task-pause-details-modal {
  max-width: 720px;
}

.task-pause-details-text {
  color: var(--color-text-secondary);
  word-break: break-word;
  line-height: 1.65;
}

.task-pause-details-text > :first-child {
  margin-top: 0;
}

.task-pause-details-text > :last-child {
  margin-bottom: 0;
}

/* ── Replay Controls ──────────────────────────────────────────────────────── */
.replay-controls-bar {
  margin: 4px 0 12px;
  border-radius: 10px;
  background: var(--color-bg-glass);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  overflow: hidden;
}

.replay-controls-progress-track {
  height: 3px;
  background: var(--color-bg-glass-hover);
}

.replay-controls-progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.15s ease;
}

.replay-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.replay-controls-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.replay-controls-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.replay-controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--color-bg-glass-hover);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.replay-btn:hover {
  background: var(--color-bg-glass-hover);
  color: var(--color-text);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.replay-btn-play {
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  color: var(--color-accent);
}

.replay-btn-play:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent-hover);
}

.replay-btn-hide {
  width: 26px;
  height: 24px;
  justify-content: center;
  padding: 0;
  margin-left: 4px;
}

.replay-step-counter {
  font-size: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.replay-speed-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-right: 2px;
}

.replay-speed-btn {
  padding: 2px 6px;
  background: transparent;
  border: 1px solid var(--color-bg-glass-hover);
  border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.replay-speed-btn:hover {
  background: var(--color-bg-glass-hover);
  color: var(--color-text);
}

.replay-speed-btn.active {
  background: var(--color-accent-subtle);
  border-color: color-mix(in srgb, var(--color-accent) 50%, transparent);
  color: var(--color-accent);
}

/* Replay entry button in the timeline controls */
.replay-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 0;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.replay-entry-btn:hover {
  color: var(--color-accent);
}

.replay-entry-btn svg {
  width: 13px;
  height: 13px;
}

.input-request-composer-shell {
  width: 100%;
  margin-bottom: 10px;
}

.composer-quoted-assistant {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 44px 10px 12px;
  border-radius: 12px;
  border: none;
  border-left: 3px solid color-mix(in srgb, var(--color-accent) 66%, var(--color-border));
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--color-accent) 15%, transparent), transparent 48%),
    color-mix(in srgb, var(--color-bg-secondary) 90%, black 10%);
}

.composer-quoted-assistant-copy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.composer-quoted-assistant-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: 18px;
  line-height: 1;
}

.composer-quoted-assistant-text {
  min-width: 0;
  max-height: 96px;
  overflow: auto;
  color: var(--color-text-secondary);
  font-size: 12.5px;
  line-height: 1.35;
}

.composer-quoted-assistant-text.markdown-content > :first-child {
  margin-top: 0;
}

.composer-quoted-assistant-text.markdown-content > :last-child {
  margin-bottom: 0;
}

.composer-quoted-assistant-text.markdown-content :where(p, ul, ol, blockquote, pre) {
  margin-top: 2px;
  margin-bottom: 2px;
}

.composer-quoted-assistant-text.markdown-content .markdown-table-wrapper {
  margin: 4px 0;
}

.composer-quoted-assistant-text.markdown-content table {
  margin: 0;
  font-size: 11.5px;
}

.composer-quoted-assistant-text.markdown-content th,
.composer-quoted-assistant-text.markdown-content td {
  padding: 3px 6px;
}

.composer-quoted-assistant-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 16%, white 84%);
  color: color-mix(in srgb, var(--color-accent) 78%, black 22%);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.composer-quoted-assistant-clear-glyph {
  display: block;
  color: currentColor;
  font-size: 17px;
  font-weight: 700;
  line-height: 20px;
  transform: translateY(-1px);
}

.composer-quoted-assistant-clear:hover {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-accent) 24%, white 76%);
}

.composer-quoted-assistant-clear:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-accent) 72%, transparent);
  outline-offset: 2px;
}

.input-request-card {
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, var(--color-border));
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 6%, rgba(56, 189, 248, 0.15), transparent 40%),
    linear-gradient(165deg, rgba(20, 25, 35, 0.97), rgba(12, 16, 24, 0.97));
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(126, 34, 206, 0.25);
}

.input-request-card-inline {
  width: 100%;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding: 12px;
}

.input-request-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.input-request-progress-index {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.input-request-header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.input-request-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  text-align: left;
}

.input-request-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.input-request-option {
  width: 100%;
  text-align: left;
  border: 1px solid var(--color-border-subtle);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-primary);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
}

.input-request-option:hover {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.04);
}

.input-request-option.selected {
  border-color: color-mix(in srgb, var(--color-accent) 85%, white 15%);
  background: rgba(56, 189, 248, 0.2);
}

.input-request-option-index {
  width: 20px;
  text-align: left;
  margin-top: 1px;
  color: var(--color-text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.input-request-option-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  align-items: flex-start;
}

.input-request-option-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-primary);
  text-align: left;
}

.input-request-option-description {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: left;
}

.input-request-other {
  margin-top: 8px;
  width: 100%;
  min-height: 72px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  padding: 8px;
  font-size: 12px;
}

.input-request-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.input-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
}

.input-request-dismiss,
.input-request-submit {
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.input-request-dismiss {
  background: transparent;
  color: var(--color-text-secondary);
}

.input-request-submit {
  background: var(--color-accent);
  color: #09121f;
}

.input-request-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.theme-light .input-request-card {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background:
    radial-gradient(circle at 8% 8%, rgba(59, 130, 246, 0.08), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.theme-light .composer-quoted-assistant {
  border-color: rgba(59, 130, 246, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.1), transparent 44%),
    rgba(255, 255, 255, 0.96);
}

.theme-light .input-request-option {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.92);
}

.theme-light .input-request-option:hover {
  border-color: rgba(15, 23, 42, 0.22);
  background: rgba(248, 250, 252, 0.98);
}

.theme-light .input-request-option.selected {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(59, 130, 246, 0.1);
}

.theme-light .input-request-other {
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 768px) {
  .input-request-card-inline {
    max-height: min(62vh, 500px);
    padding: 12px;
  }

  .input-request-option-label {
    font-size: 13px;
  }
}

/* Task header duration badge */
.task-duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.7;
  flex-shrink: 0;
}

.task-duration svg {
  opacity: 0.6;
}

/* Timeline "Worked for" duration divider */
.timeline-duration-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  opacity: 0.5;
}

.timeline-duration-line {
  flex: 1;
  height: 1px;
  background: var(--color-text-muted);
  opacity: 0.3;
}

.timeline-duration-label {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Light theme adjustments */
.theme-light .timeline-duration-line {
  opacity: 0.2;
}

.cli-task-content {
  flex: 1;
  min-width: 0;
}

.cli-task-title {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.cli-task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cli-task-title-row-awaiting {
  gap: 8px;
}

.cli-task-title-row .cli-task-title {
  flex: 1;
  min-width: 0;
}

.cli-task-time-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  min-height: 18px;
}

.cli-task-action-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: auto;
  min-height: 18px;
}

.cli-task-title-with-agent {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.cli-task-title-subagent-role {
  justify-content: flex-start;
}

.cli-task-title-truncated {
  display: block;
  flex: 1;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  min-width: 0;
}

.cli-task-agent-name {
  font-weight: 600;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.cli-task-time {
  flex-shrink: 0;
  min-width: 28px;
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: right;
}

.cli-task-automation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  opacity: 0.78;
}

.cli-task-automation-icon svg {
  display: block;
}

.cli-task-item.task-item-selected .cli-task-automation-icon {
  color: var(--color-text-secondary);
  opacity: 0.9;
}

.cli-task-awaiting-badge {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: color-mix(in srgb, var(--color-success, #34d399) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-success, #34d399) 45%, transparent);
}

.cli-task-item.task-item-selected .cli-task-title {
  color: var(--color-text);
}

.cli-task-item.task-item-selected .cli-task-awaiting-badge {
  color: var(--color-text);
}

.cli-task-item .task-item-icon {
  display: none;
}

.cli-task-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  flex-shrink: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    width 0.15s ease,
    opacity 0.15s ease;
}

.cli-task-item:hover .cli-task-actions,
.cli-task-item:focus-within .cli-task-actions,
.cli-task-actions:has(.task-item-menu) {
  width: 22px;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}

.task-completion-unread-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-info, #0a84ff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-info, #0a84ff) 14%, transparent);
  pointer-events: none;
}

.cli-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  background: color-mix(in srgb, var(--color-accent) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 42%, transparent);
  padding: 0;
  cursor: pointer;
  border-radius: 7px;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.cli-more-btn:hover,
.cli-more-btn:focus-visible,
.cli-more-btn[aria-expanded="true"] {
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-color: var(--color-accent);
  outline: none;
}

.cli-more-btn svg {
  flex-shrink: 0;
}

/* CLI Task Menu */
.cli-task-menu {
  font-family: var(--font-mono);
  background: #2d2d30 !important;
  border: 1px solid var(--color-border) !important;
}

.cli-menu-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
}

.cli-menu-option svg {
  display: none;
}

.cli-menu-prefix {
  color: var(--color-accent);
}

.cli-menu-option:hover .cli-menu-prefix {
  color: var(--color-text);
}

/* Task Tree Hierarchy */
.task-tree-node {
  display: flex;
  flex-direction: column;
}

/* When menu is open, raise this node above siblings so menu overlays correctly */
.task-tree-node.task-item-menu-open {
  position: relative;
  z-index: 200;
}

.task-tree-children {
  display: flex;
  flex-direction: column;
}

.cli-tree-prefix {
  display: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  margin-right: 4px;
  opacity: 0.5;
}

.cli-collapse-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  padding: 0 4px;
  cursor: pointer;
  width: 20px;
  flex-shrink: 0;
}

.cli-collapse-btn:hover {
  color: var(--color-accent);
}

.cli-collapse-btn-inline {
  margin-left: 4px;
  margin-right: 2px;
}

/* Sub-agent task item styling */
.task-item-subagent {
  opacity: 0.85;
  font-size: 11px;
}

.task-item-subagent .cli-task-title {
  font-size: 11px;
}

.task-item-subagent .cli-task-status {
  font-size: 10px;
}

/* Subagent Lucide icons */
.cli-subagent-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
  opacity: 0.85;
}

.cli-subagent-icon-parallel {
  color: var(--color-success);
  opacity: 0.9;
}

/* ---- Session mode: colored left border on task items ---- */
.cli-task-item.session-mode-autonomous {
  border-left-color: rgb(var(--session-mode-autonomous));
}

.cli-task-item.session-mode-collab {
  border-left-color: rgb(var(--session-mode-collab));
}

.cli-task-item.session-mode-multi-llm {
  border-left-color: rgb(var(--session-mode-multi-llm));
}

.cli-task-item.session-mode-scheduled {
  border-left-color: rgb(var(--session-mode-scheduled));
}

.cli-task-item.session-mode-think {
  border-left-color: rgb(var(--session-mode-think));
}

.cli-task-item.session-mode-comparison {
  border-left-color: rgb(var(--session-mode-comparison));
}

/* Keep mode color visible even when selected */
.cli-task-item.task-item-selected.session-mode-autonomous {
  border-left-color: rgb(var(--session-mode-autonomous));
}

.cli-task-item.task-item-selected.session-mode-collab {
  border-left-color: rgb(var(--session-mode-collab));
}

.cli-task-item.task-item-selected.session-mode-multi-llm {
  border-left-color: rgb(var(--session-mode-multi-llm));
}

.cli-task-item.task-item-selected.session-mode-scheduled {
  border-left-color: rgb(var(--session-mode-scheduled));
}

.cli-task-item.task-item-selected.session-mode-think {
  border-left-color: rgb(var(--session-mode-think));
}

.cli-task-item.task-item-selected.session-mode-comparison {
  border-left-color: rgb(var(--session-mode-comparison));
}

/* ---- Session filter toggle button ---- */
.session-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  padding: 2px 5px;
  margin-left: auto;
  border-radius: 3px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.session-filter-toggle:hover {
  color: var(--color-accent, #22d3ee);
  background: rgba(255, 255, 255, 0.04);
}

.session-filter-toggle.active {
  color: var(--color-accent, #22d3ee);
}

.session-filter-toggle .filter-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  background: var(--color-accent, #22d3ee);
  color: var(--color-bg, #0a0a0a);
}

/* ---- Session filter bar ---- */
.session-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 12px 8px;
  align-items: center;
}

.session-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px 2px 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}

.session-filter-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-secondary);
}

/* Colored dot indicator inside filter chip */
.session-filter-chip .filter-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.session-filter-chip.standard .filter-chip-dot {
  background: var(--color-text-muted, #6b7280);
}

.session-filter-chip.autonomous .filter-chip-dot {
  background: rgb(var(--session-mode-autonomous));
}

.session-filter-chip.collab .filter-chip-dot {
  background: rgb(var(--session-mode-collab));
}

.session-filter-chip.multi-llm .filter-chip-dot {
  background: rgb(var(--session-mode-multi-llm));
}

.session-filter-chip.scheduled .filter-chip-dot {
  background: rgb(var(--session-mode-scheduled));
}

.session-filter-chip.think .filter-chip-dot {
  background: rgb(var(--session-mode-think));
}

.session-filter-chip.comparison .filter-chip-dot {
  background: rgb(var(--session-mode-comparison));
}

.session-filter-chip .filter-chip-count {
  font-size: 9px;
  opacity: 0.5;
  font-weight: 600;
}

/* Active filter chip states */
.session-filter-chip.active {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-primary);
}

.session-filter-chip.active.autonomous {
  border-color: rgba(var(--session-mode-autonomous), 0.4);
  background: rgba(var(--session-mode-autonomous), 0.1);
}

.session-filter-chip.active.collab {
  border-color: rgba(var(--session-mode-collab), 0.4);
  background: rgba(var(--session-mode-collab), 0.1);
}

.session-filter-chip.active.multi-llm {
  border-color: rgba(var(--session-mode-multi-llm), 0.4);
  background: rgba(var(--session-mode-multi-llm), 0.1);
}

.session-filter-chip.active.scheduled {
  border-color: rgba(var(--session-mode-scheduled), 0.4);
  background: rgba(var(--session-mode-scheduled), 0.1);
}

.session-filter-chip.active.think {
  border-color: rgba(var(--session-mode-think), 0.4);
  background: rgba(var(--session-mode-think), 0.1);
}

.session-filter-chip.active.comparison {
  border-color: rgba(var(--session-mode-comparison), 0.4);
  background: rgba(var(--session-mode-comparison), 0.1);
}

/* Light theme adjustments for filter chips */
.theme-light .session-filter-chip {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .session-filter-chip:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .session-filter-chip.active.autonomous {
  background: rgba(var(--session-mode-autonomous), 0.08);
  border-color: rgba(var(--session-mode-autonomous), 0.25);
}

.theme-light .session-filter-chip.active.collab {
  background: rgba(var(--session-mode-collab), 0.08);
  border-color: rgba(var(--session-mode-collab), 0.25);
}

.theme-light .session-filter-chip.active.multi-llm {
  background: rgba(var(--session-mode-multi-llm), 0.08);
  border-color: rgba(var(--session-mode-multi-llm), 0.25);
}

.theme-light .session-filter-chip.active.scheduled {
  background: rgba(var(--session-mode-scheduled), 0.08);
  border-color: rgba(var(--session-mode-scheduled), 0.25);
}

.theme-light .session-filter-chip.active.think {
  background: rgba(var(--session-mode-think), 0.08);
  border-color: rgba(var(--session-mode-think), 0.25);
}

.theme-light .session-filter-chip.active.comparison {
  background: rgba(var(--session-mode-comparison), 0.08);
  border-color: rgba(var(--session-mode-comparison), 0.25);
}

/* Clear filter button */
.session-filter-clear {
  font-size: 10px;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.session-filter-clear:hover {
  color: var(--color-accent, #22d3ee);
}

/* Empty state for filtered results */
.sidebar-empty-filtered {
  padding: 20px 16px;
  text-align: center;
}

.sidebar-empty-filtered .cli-hint {
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
}

.cli-menu-danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.cli-menu-danger .cli-menu-prefix {
  color: var(--color-error);
}

/* CLI Rename Input */
.cli-rename-input {
  font-family: var(--font-mono) !important;
  background: rgba(0, 0, 0, 0.3) !important;
  border: 1px solid var(--color-accent) !important;
}

/* CLI Empty State */
.cli-empty {
  padding: 16px;
}

.cli-empty .cli-tree {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.cli-empty .cli-hint {
  font-size: 11px;
  color: var(--color-text-muted);
  opacity: 0.6;
  margin: 0;
}

/* CLI Sidebar Footer */
.cli-sidebar-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: transparent !important;
  border-top: none !important;
  padding: 8px 12px !important;
  flex-shrink: 0 !important;
  min-height: 40px !important;
}

.cli-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cli-footer-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.cli-footer-label {
  color: var(--color-accent);
  font-weight: 600;
}

.cli-footer-value {
  color: var(--color-text-secondary);
}

.cli-settings-btn {
  justify-content: flex-start;
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--color-text-secondary) !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 7px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cli-settings-btn .modern-only {
  display: inline-flex !important;
  align-items: center;
  gap: 14px;
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 500;
  color: inherit;
}

.cli-settings-btn .modern-only svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  stroke-width: 2px;
}

.cli-settings-btn:hover {
  color: var(--color-text) !important;
  background: transparent !important;
}

.cli-settings-btn:active,
.cli-settings-btn:focus,
.cli-settings-btn:focus-visible {
  background: transparent !important;
}

/* Task CLI shell styles load with MainContent. */

/* ==================== UPDATE SETTINGS ==================== */
.update-settings {
  padding: 16px 0;
}

.version-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.version-number {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
}

.version-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.version-badge.dev {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-warning);
}

.version-badge.npm {
  background: rgba(203, 56, 55, 0.15);
  color: #cb3837;
}

.git-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  font-family: var(--font-mono);
}

.git-branch {
  background: var(--color-bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

.git-commit {
  color: var(--color-text-muted);
}

.update-actions {
  margin-top: 16px;
}

.update-status {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.update-status.available {
  border-color: var(--color-accent);
  background: rgba(99, 102, 241, 0.05);
}

.update-status.up-to-date {
  border-color: var(--color-success);
  background: rgba(34, 197, 94, 0.05);
}

.update-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.update-header.up-to-date {
  color: var(--color-success);
  margin-bottom: 0;
}

.update-header svg {
  flex-shrink: 0;
}

.update-versions {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  margin-bottom: 8px;
}

.update-versions .current {
  color: var(--color-text-muted);
}

.update-versions .arrow {
  color: var(--color-text-muted);
}

.update-versions .latest {
  color: var(--color-accent);
  font-weight: 500;
}

.update-date {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.release-notes {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.release-notes h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.release-notes-content {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}

.release-notes-content.markdown-content {
  overflow-wrap: anywhere;
}

.release-notes-content.markdown-content > :first-child {
  margin-top: 0;
}

.release-notes-content.markdown-content > :last-child {
  margin-bottom: 0;
}

.release-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
}

.release-link:hover {
  text-decoration: underline;
}

.update-mode {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.update-mode strong {
  color: var(--color-text-secondary);
}

.update-progress {
  margin-top: 16px;
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.progress-message {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.update-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-error);
}

.update-error svg {
  flex-shrink: 0;
}

.update-button {
  margin-top: 16px;
  width: 100%;
}

.update-button.restart {
  background: var(--color-success);
}

.update-button.restart:hover {
  background: #16a34a;
}

.manual-update-commands {
  margin-top: 12px;
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.manual-update-commands code {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: pre;
  line-height: 1.6;
}

/* ============================================
   Full-Page Settings View
   ============================================ */

.settings-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-bg-primary);
  padding-top: var(--title-bar-height);
  /* Space for title bar buttons */
}

/* Back button styled like a nav item */
.settings-back-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-back-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.settings-back-btn svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.settings-back-btn:hover svg {
  opacity: 1;
}

.settings-nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: 8px 0;
}

.theme-light .settings-nav-divider {
  background: rgba(0, 0, 0, 0.15);
}

.theme-light .settings-sidebar {
  background: var(--color-bg-sidebar);
  border-color: rgba(0, 0, 0, 0.12);
}

.settings-page-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.settings-sidebar {
  width: 220px;
  padding: 16px;
  margin: 16px 0 16px 16px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-content-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 16px 16px 16px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 4px;
  -webkit-app-region: drag;
}

.settings-sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.settings-sidebar-search svg {
  flex-shrink: 0;
  color: var(--color-text-tertiary);
}

.settings-sidebar-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text-primary);
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.settings-sidebar-search input::placeholder {
  color: var(--color-text-tertiary);
}

.settings-sidebar-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: var(--color-bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-sidebar-search-clear:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.settings-nav-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  margin-right: -8px;
  padding-right: 8px;
}

.settings-nav-items::-webkit-scrollbar {
  width: 6px;
}

.settings-nav-items::-webkit-scrollbar-track {
  background: transparent;
}

.settings-nav-items::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.settings-nav-items::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

.settings-nav-group-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 12px 12px 4px;
  user-select: none;
}

.settings-nav-group-header:first-child {
  padding-top: 4px;
}

.settings-nav-no-results {
  padding: 12px;
  text-align: center;
  color: var(--color-text-tertiary);
  font-size: 13px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.settings-nav-item:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.settings-nav-item.active {
  background: var(--color-bg-tertiary);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.settings-nav-item:focus-visible {
  outline: none;
}

.settings-nav-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.settings-nav-item:hover svg {
  opacity: 1;
}

.settings-nav-item.active svg {
  opacity: 1;
  color: var(--color-accent);
}

.settings-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
  position: relative;
  width: 100%;
  max-width: none;
}

/* Mission Control needs full width - override constraints */
.settings-content:has(.mission-control),
.settings-content:has(.mc-v2) {
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.mc-v2 {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--color-text-primary);
}

.mc-v2-detail-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.mc-v2-task-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mc-v2-task-detail-title h3 {
  margin: 0;
  font-size: 18px;
}

.mc-v2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mc-v2-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mc-v2-section-header h4 {
  margin: 0;
}

.mc-v2-section-hint {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.4;
  max-width: 320px;
  text-align: right;
}

.mc-v2-empty,
.mc-v2-error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
  font-size: 13px;
}

.mc-v2-empty-compact {
  padding: 12px 0;
}

.mc-v2-ops-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mc-v2-ops-heading {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.mc-v2-error {
  border-style: solid;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: var(--color-error);
}

.mc-v2-learning-list,
.mc-v2-recall-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-v2-learning-card,
.mc-v2-recall-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.mc-v2-learning-card-header,
.mc-v2-recall-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mc-v2-learning-outcome,
.mc-v2-recall-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-v2-learning-time,
.mc-v2-recall-result-meta {
  color: var(--color-text-muted);
  font-size: 12px;
}

.mc-v2-learning-next {
  min-width: 160px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.16);
}

.mc-v2-learning-next span {
  display: block;
  color: var(--color-text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.mc-v2-learning-next strong {
  font-size: 12px;
}

.mc-v2-learning-steps {
  display: grid;
  gap: 10px;
}

.mc-v2-learning-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-subtle);
}

.mc-v2-learning-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mc-v2-learning-step p,
.mc-v2-recall-result p {
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.mc-v2-learning-related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.mc-v2-learning-evidence {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mc-v2-learning-evidence li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.mc-v2-learning-evidence-source {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  color: var(--color-info);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  flex-shrink: 0;
}

.mc-v2-recall-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
}

.mc-v2-recall-result-foot {
  color: var(--color-text-muted);
  font-size: 11px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.settings-actions .button-primary,
.settings-actions .button-secondary {
  padding: 10px 20px;
  font-size: 14px;
}

/* Normalize controls in Settings to match LLM Provider styling */
.settings-page :where(input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"]) {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.settings-page :where(input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"]):hover {
  border-color: var(--color-border-light);
  background: rgba(0, 0, 0, 0.3);
}

.settings-page :where(input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"]):focus {
  border-color: var(--color-accent);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.1),
    0 0 0 3px var(--color-accent-subtle);
}

.settings-page :where(input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="tel"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"])::placeholder {
  color: var(--color-text-muted);
}

/* Preserve compact sidebar search styling */
.settings-sidebar-search input {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  font-size: 13px;
}

.theme-light .settings-sidebar-search input {
  color: rgba(0, 0, 0, 0.84);
}

.theme-light .settings-sidebar-search input::placeholder {
  color: rgba(0, 0, 0, 0.72);
}

.settings-sidebar-search input:focus::placeholder {
  color: transparent;
}

.settings-sidebar-search input:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.settings-sidebar-search input:hover {
  background: transparent;
  border-color: transparent;
}

.settings-page :where(select) {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.settings-page :where(select):hover {
  border-color: var(--color-border-light);
  background: rgba(0, 0, 0, 0.3);
}

.settings-page :where(select):focus {
  border-color: var(--color-accent);
}

.settings-page :where(textarea) {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
}

.settings-page :where(textarea):focus {
  border-color: var(--color-accent);
}

/* Daily Briefing: theme-aware select and controls */
.briefing-workspace-select {
  border: 1px solid var(--color-border);
  background: var(--color-bg-input);
  color: var(--color-text);
}
.theme-light .briefing-workspace-select {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--color-text);
}

/* Event Triggers form: ensure inputs/selects/textarea have visible text and placeholders */
.event-triggers-form input,
.event-triggers-form textarea,
.event-triggers-form select,
.event-triggers-form .event-triggers-select {
  color: var(--color-text) !important;
  background: var(--color-bg-input) !important;
}
.event-triggers-form input::placeholder,
.event-triggers-form textarea::placeholder {
  color: var(--color-text-muted) !important;
}

.settings-page .btn-primary {
  background: linear-gradient(180deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  color: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.settings-page .btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-page .btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  transform: translateY(-1px);
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.settings-page .btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.settings-page .btn-secondary {
  background: rgba(70, 70, 75, 0.8);
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.settings-page .btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--gradient-glossy);
  pointer-events: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-page .btn-secondary:hover:not(:disabled) {
  background: rgba(85, 85, 90, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.settings-page .btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

.settings-page .btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-error);
}

.settings-page .btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

.settings-page .btn-sm,
.settings-page .btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.settings-page .btn-primary,
.settings-page .btn-secondary,
.settings-page .btn-danger {
  position: relative;
  overflow: hidden;
}

/* Light theme button overrides */
.theme-light .settings-page .btn-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: none;
}

.theme-light .settings-page .btn-secondary::before {
  display: none;
}

.theme-light .settings-page .btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.theme-light .settings-page .btn-primary {
  background: linear-gradient(180deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-light .settings-page .btn-primary::before {
  display: none;
}

.theme-light .settings-page .btn-primary:hover:not(:disabled) {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.theme-light .settings-page .btn-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
}

.theme-light .settings-page .btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.settings-section h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.settings-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.button-with-icon {
  gap: 8px;
}

.settings-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  padding: 16px;
}

.provider-config-panel {
  padding: 0;
  margin-top: 12px;
}

.settings-card.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.settings-badge--success {
  background: var(--color-success-subtle);
  border-color: var(--color-success);
  color: var(--color-success);
}

.settings-badge--warning {
  background: var(--color-warning-subtle);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.settings-badge--error {
  background: var(--color-error-subtle);
  border-color: var(--color-error);
  color: var(--color-error);
}

.settings-badge--neutral {
  background: var(--color-bg-secondary);
  border-color: var(--color-border-subtle);
  color: var(--color-text-muted);
}

.settings-save-indicator {
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-success, #22c55e);
}

.settings-save-indicator.error {
  color: var(--color-error, #ef4444);
}

.settings-badge--outline {
  background: transparent;
  border-color: var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.settings-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
}

.settings-alert-error {
  border-color: var(--color-error);
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.settings-empty {
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}

/* ============================================
   Memory Settings
   ============================================ */

.memory-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.memory-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.memory-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.memory-list {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
}

.memory-list-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.memory-list-item:last-child {
  border-bottom: none;
}

.memory-preview-card {
  padding: 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}

.awareness-grid {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.awareness-grid-header {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) repeat(4, auto) minmax(110px, 0.8fr);
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-bg-tertiary);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-subtle);
  align-items: center;
}

.awareness-grid-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.2fr) repeat(4, auto) minmax(110px, 0.8fr);
  gap: 10px;
  padding: 12px;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

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

.memory-fact-form {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .memory-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .memory-fact-form {
    grid-template-columns: 1fr;
  }

  .awareness-grid {
    overflow-x: auto;
  }

  .awareness-grid-header,
  .awareness-grid-row {
    min-width: 560px;
  }
}

.memory-inline-btn {
  border: 1px solid var(--color-border-subtle);
  background: transparent;
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 8px;
  transition: background 0.15s;
}

.memory-inline-btn:hover {
  background: var(--color-bg-tertiary);
}

.memory-inline-btn.active {
  background: var(--color-bg-tertiary);
}

.memory-inline-btn.danger {
  color: var(--color-error);
}

.memory-inline-btn.danger:hover {
  background: var(--color-error-subtle, rgba(239, 68, 68, 0.1));
}

.scheduled-tasks-add {
  margin-bottom: 24px;
}

.stat-value--success {
  color: var(--color-success);
}

.stat-value--warning {
  color: var(--color-warning);
}

.stat-value--error {
  color: var(--color-error);
}

/* SkillHub Settings */
.skillhub-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skillhub-tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.skillhub-tab {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skillhub-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skillhub-card {
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.skillhub-card.is-selected {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.skillhub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.skillhub-card-header > button {
  flex-shrink: 0;
}

.skillhub-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.skillhub-card-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.skillhub-card-info > div {
  min-width: 0;
  flex: 1;
}

.skillhub-icon {
  font-size: 20px;
  line-height: 1;
}

.skillhub-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.skillhub-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.skillhub-description {
  margin-top: 4px;
}

.skillhub-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.skillhub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.skillhub-warnings {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-warning);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skillhub-group {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
}

.skillhub-group summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.skillhub-group-title {
  text-transform: capitalize;
}

.skillhub-group summary::-webkit-details-marker {
  display: none;
}

.skillhub-group[open] summary {
  border-bottom: 1px solid var(--color-border-subtle);
}

.skillhub-group-content {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skillhub-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.skillhub-group-item:last-child {
  border-bottom: none;
}

.skillhub-group-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Nodes Settings */
/* ══════════════════════════════════════════════════════════════
   Devices Panel – dp-* namespace
   ═══════════════════════════════════════════════════════════ */

.devices-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  gap: 0;
  animation: dp-fade-in 0.6s ease-out;
}

@keyframes dp-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.devices-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.devices-loading {
  padding: 64px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ── Header ── */

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
}

.dp-title {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.dp-add-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: color 0.15s;
}

.dp-add-link:hover {
  color: var(--color-text);
}

/* ── 1. Task Input Box ── */

.dp-input-box {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, color-mix(in srgb, var(--color-bg-elevated) 80%, var(--color-accent-subtle)) 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  padding: 24px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.dp-input-box:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg), 0 0 30px color-mix(in srgb, var(--color-accent) 25%, transparent);
  transform: translateY(-2px);
}

.dp-input-box.disabled {
  opacity: 0.72;
}

/* When dropdown is open: remove glassy effect and stack above Running Tasks */
.dp-input-box.dropdown-open {
  position: relative;
  z-index: 1000;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: #1a1d23 !important;
}

.theme-light .dp-input-box.dropdown-open {
  background: #ffffff !important;
}

.dp-attachments-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
}

.dp-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-subtle);
}

.dp-attachment-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

.dp-attachment-remove:hover {
  color: var(--color-error);
}

.dp-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 9px;
  background: transparent !important;
}

.dp-input-icon {
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.dp-input {
  flex: 1;
  background: transparent !important;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 16px;
  font-family: var(--font-ui);
}

.dp-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.dp-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 3px;
}

.dp-input-spacer {
  flex: 1;
}

.dp-input-action-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.dp-input-action-btn:hover {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  transform: scale(1.1);
}

.dp-input-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.devices-panel .dp-overflow-menu .overflow-menu-dropdown,
.dp-overflow-menu .overflow-menu-dropdown,
.dp-input-box .dp-overflow-menu .overflow-menu-dropdown {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  background: #1a1d23 !important;
  background-color: #1a1d23 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1000;
  isolation: isolate;
  opacity: 1;
}

.devices-panel .dp-overflow-menu .overflow-submenu-panel,
.dp-overflow-menu .overflow-submenu-panel {
  background: #1a1d23 !important;
  background-color: #1a1d23 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
  isolation: isolate;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-light .devices-panel .dp-overflow-menu .overflow-submenu-panel,
.theme-light .dp-overflow-menu .overflow-submenu-panel {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.theme-light .devices-panel .dp-overflow-menu .overflow-menu-dropdown,
.theme-light .devices-panel .dp-overflow-menu .overflow-submenu-panel,
.theme-light .dp-overflow-menu .overflow-menu-dropdown,
.theme-light .dp-overflow-menu .overflow-submenu-panel,
.theme-light .dp-input-box .dp-overflow-menu .overflow-menu-dropdown {
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.12);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
}

/* Devices panel dropdown - fully opaque, no glassy effect */
.dp-overflow-dropdown-solid {
  background: #1a1d23 !important;
  background-color: #1a1d23 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 9999 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-light .dp-overflow-dropdown-solid {
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Devices panel dropdown - base styles */
.devices-panel .dp-overflow-dropdown.overflow-menu-dropdown,
.dp-overflow-dropdown.overflow-menu-dropdown {
  background: #1a1d23 !important;
  background-color: #1a1d23 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
  isolation: isolate;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-light .devices-panel .dp-overflow-dropdown.overflow-menu-dropdown,
.theme-light .dp-overflow-dropdown.overflow-menu-dropdown {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dp-overflow-zap {
  margin-left: auto;
  color: var(--color-text-muted);
}

.dp-overflow-submenu {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border-subtle);
}

/* ── Section wrapper ── */

.dp-section {
  margin-top: 32px;
}

.dp-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.dp-section-label {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.dp-section-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: color 0.15s;
}

.dp-section-link:hover {
  color: var(--color-text);
}

/* ── 2. Task Cards ── */

.dp-tasks-container {
  overflow: hidden;
}

.dp-tasks-container.expanded {
  max-height: 352px;
  overflow-y: auto;
  padding-right: 6px;
}

.dp-tasks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 460px));
  justify-content: space-between;
  gap: 14px;
}

.dp-task-card {
  background: linear-gradient(135deg, var(--color-bg-glass) 0%, var(--color-accent-subtle) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 140px;
  position: relative;
  overflow: hidden;
}

.dp-task-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.dp-task-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg), 0 10px 20px -10px color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-color: var(--color-accent-subtle);
  background: linear-gradient(135deg, var(--color-bg-glass-hover) 0%, color-mix(in srgb, var(--color-accent-subtle) 80%, white 20%) 100%);
}

.dp-task-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dp-task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}

.dp-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
}

.dp-task-badge.running {
  color: var(--color-accent);
  font-weight: 600;
}

.dp-task-badge.pending {
  color: var(--color-text-muted);
}

.dp-task-badge.paused,
.dp-task-badge.attention {
  color: var(--color-warning);
}

.dp-task-badge.failed {
  color: var(--color-error);
}

.dp-task-badge.done {
  color: var(--color-success);
}

.dp-task-badge svg {
  flex-shrink: 0;
}

.dp-task-time {
  color: var(--color-text-secondary);
  font-style: italic;
  margin-left: auto;
  white-space: nowrap;
}

.dp-pulse {
  animation: dp-pulse-anim 2s ease-in-out infinite;
}

@keyframes dp-pulse-anim {

  0%,
  100% {
    opacity: .5;
  }

  50% {
    opacity: 1;
  }
}

/* ── Placeholder / Empty ── */

.dp-placeholder {
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--font-ui);
}

/* ── Empty State (no devices) ── */

.dp-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 48px;
  text-align: center;
}

.dp-empty-btn {
  width: 84px;
  height: 84px;
  border-radius: var(--radius-xl);
  border: 2px dashed var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.dp-empty-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.dp-empty-state h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
}

.dp-empty-state p {
  color: var(--color-text-muted);
  font-size: 14px;
  margin: 0;
}

/* ── 3. Device Cards ── */

.dp-devices-list {
  display: grid;
  grid-template-columns: minmax(720px, 1fr);
  gap: 12px;
}

.dp-device-wrap {
  position: relative;
}

.dp-device-details {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
}

.dp-device-details div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.dp-device-details span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.dp-device-details strong {
  font-size: 13px;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.dp-device-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  width: 100%;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-glass) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  color: var(--color-text);
  position: relative;
  overflow: hidden;
}

.dp-device-card:hover {
  border-color: var(--color-accent-subtle);
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-hover) 100%);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.dp-device-card.active {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-accent-subtle) 100%);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(var(--color-accent), 0.1);
}

.dp-device-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-accent);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
}

.dp-device-card:hover .dp-device-icon {
  transform: scale(1.05) rotate(-2deg);
  background: var(--color-accent-subtle);
}

.dp-device-svg {
  width: 28px;
  height: 28px;
}

.dp-device-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dp-device-name {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--color-text);
  margin-bottom: 2px;
}

.dp-device-status-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-glass);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
}

.dp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

.dp-status-dot.online {
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent);
  animation: dp-pulse-glow 2s infinite;
}

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

@keyframes dp-pulse-glow {
  0% { box-shadow: 0 0 5px var(--color-accent); }
  50% { box-shadow: 0 0 15px var(--color-accent); }
  100% { box-shadow: 0 0 5px var(--color-accent); }
}

.dp-device-status {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dp-device-status.online {
  color: var(--color-accent);
}

.dp-device-status.off {
  color: var(--color-text-muted);
}

.dp-device-more {
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.dp-device-more:hover {
  color: var(--color-text);
}

/* ── Device context menu ── */

.dp-device-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 8px;
  z-index: 20;
  min-width: 200px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.dp-device-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-ui);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s;
}

.dp-device-menu-item:hover {
  background: var(--color-bg-hover);
}

.dp-device-menu-item.danger {
  color: var(--color-error);
}

.dp-device-menu-item.danger:hover {
  background: var(--color-error-subtle);
}

/* ── Add device modal ── */

.remote-device-visual {
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: 0 16px 48px rgb(15 23 42 / 10%);
}

.remote-device-visual-hero {
  position: relative;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 28px 26px 22px;
  background:
    radial-gradient(circle at 22% 22%, rgb(255 255 255 / 50%), transparent 24%),
    linear-gradient(135deg, #87c6ff 0%, #7b9cff 42%, #9be7ff 100%);
}

.remote-device-visual-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 24%), transparent 34%),
    radial-gradient(circle at 78% 28%, rgb(255 255 255 / 35%), transparent 18%);
  pointer-events: none;
}

.remote-device-laptop,
.remote-device-node,
.remote-device-connection-dots {
  position: relative;
  z-index: 1;
}

.remote-device-laptop {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 14px 18px rgb(15 23 42 / 22%));
}

.remote-device-laptop-screen {
  width: 138px;
  height: 86px;
  border: 3px solid rgb(17 24 39 / 82%);
  border-radius: 8px 8px 3px 3px;
  background:
    linear-gradient(90deg, rgb(241 245 249 / 88%) 0 28%, rgb(255 255 255 / 96%) 28%),
    linear-gradient(180deg, rgb(255 255 255), rgb(226 232 240));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 0 54px;
}

.remote-device-laptop-screen span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgb(100 116 139 / 42%);
}

.remote-device-laptop-screen span:nth-child(1) {
  width: 58px;
}

.remote-device-laptop-screen span:nth-child(2) {
  width: 42px;
}

.remote-device-laptop-screen span:nth-child(3) {
  width: 68px;
}

.remote-device-laptop-base {
  width: 154px;
  height: 10px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #dbe3ee, #aab7c7);
}

.remote-device-connection-dots {
  display: flex;
  gap: 7px;
  color: white;
}

.remote-device-connection-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgb(255 255 255 / 84%);
  box-shadow: 0 0 18px rgb(255 255 255 / 50%);
}

.remote-device-node {
  width: 74px;
  height: 66px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(17 24 39 / 78%);
  background: linear-gradient(145deg, rgb(255 255 255 / 78%), rgb(226 232 240 / 78%));
  box-shadow: 0 14px 28px rgb(15 23 42 / 18%);
}

.remote-device-visual-body {
  padding: 24px 28px 26px;
  text-align: center;
}

.remote-device-visual-body h3 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 650;
}

.remote-device-visual-body > p {
  max-width: 390px;
  margin: 8px auto 22px;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.45;
}

.remote-device-visual-points {
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.remote-device-visual-point {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
}

.remote-device-visual-point svg {
  margin-top: 2px;
  color: var(--color-text-muted);
}

.remote-device-visual-point strong {
  display: block;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 650;
}

.remote-device-visual-point span {
  display: block;
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.settings-subsection > .remote-device-visual {
  max-width: 520px;
}

@media (max-width: 640px) {
  .remote-device-visual-hero {
    min-height: 124px;
    gap: 16px;
    padding: 22px 18px 18px;
  }

  .remote-device-laptop {
    width: 118px;
  }

  .remote-device-laptop-screen {
    width: 110px;
    height: 68px;
    padding: 17px 16px 0 42px;
  }

  .remote-device-laptop-base {
    width: 122px;
  }

  .remote-device-node {
    width: 60px;
    height: 54px;
  }

  .remote-device-visual-body {
    padding: 20px;
  }
}

.devices-onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgb(17 24 39 / 18%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.devices-remote-modal {
  width: min(560px, 100%);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-lg) + 4px);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.devices-remote-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.devices-remote-header h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
}

.devices-remote-header p {
  margin: 6px 0 0;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-text-muted);
}

.devices-remote-saved,
.devices-remote-form-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.devices-remote-form-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
}

.devices-remote-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.devices-remote-saved-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.devices-remote-link-btn {
  border: none;
  background: transparent;
  color: var(--color-accent);
  font-size: 13px;
  font-family: var(--font-ui);
  cursor: pointer;
}

.devices-remote-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.devices-remote-card {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.devices-remote-card.active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent-subtle);
}

.devices-remote-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.devices-remote-card strong {
  font-size: 14px;
  color: var(--color-text);
}

.devices-remote-card span {
  font-size: 12px;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.devices-remote-card-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.devices-remote-card-badge.connected {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.devices-remote-card-badge.saved {
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
}

.devices-remote-close {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.devices-remote-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.devices-remote-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 120px;
  color: var(--color-text-muted);
  font-family: var(--font-ui);
  font-size: 14px;
}

.devices-remote-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.devices-remote-field label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.devices-remote-field input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 12px 14px;
}

.devices-remote-field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 12px 14px;
  resize: vertical;
  min-height: 88px;
}

.devices-remote-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.devices-remote-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.devices-remote-token-row {
  display: flex;
  gap: 10px;
}

.devices-remote-inline-btn {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.devices-remote-inline-btn:hover {
  background: var(--color-bg-hover);
}

.devices-remote-feedback {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
}

.devices-remote-feedback.success {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.devices-remote-feedback.error {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.devices-remote-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-text);
}

.devices-remote-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.devices-remote-status-dot.connected {
  background: var(--color-success);
}

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

.devices-remote-status-dot.disconnected {
  background: var(--color-text-muted);
}

.devices-remote-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.devices-remote-meta div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.devices-remote-meta span {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
}

.devices-remote-meta strong,
.devices-remote-meta code {
  color: var(--color-text);
  font-size: 13px;
}

.devices-remote-meta code {
  overflow-wrap: anywhere;
}

.devices-remote-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dp-secondary-btn,
.dp-primary-btn {
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.dp-secondary-btn {
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text);
}

.dp-secondary-btn:hover:not(:disabled) {
  background: var(--color-bg-hover);
}

.dp-primary-btn {
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
}

.dp-primary-btn:hover:not(:disabled) {
  filter: brightness(0.96);
}

.dp-secondary-btn:disabled,
.dp-primary-btn:disabled,
.devices-remote-inline-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

@keyframes dp-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.dp-input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.dp-toolbar-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dp-device-pill,
.dp-run-chip,
.dp-purpose-chip,
.dp-device-chip,
.dp-filter-chip,
.dp-task-device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: var(--font-ui);
  line-height: 1;
}

.dp-device-pill {
  background: var(--color-bg-glass);
  color: var(--color-text);
  border: 1px solid var(--color-border-subtle);
  font-weight: 500;
  padding: 6px 12px;
}

.dp-purpose-chip {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dp-purpose-chip.subtle {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.dp-run-chip,
.dp-device-chip {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.dp-device-switcher,
.devices-remote-field select,
.dp-inline-form select,
.dp-inline-form input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 10px 12px;
}

.dp-device-switcher {
  min-width: 220px;
}

.dp-device-switcher:focus,
.devices-remote-field select:focus,
.dp-inline-form select:focus,
.dp-inline-form input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.dp-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dp-filter-chip {
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px 16px;
  font-weight: 500;
}

.dp-filter-chip:hover {
  background: var(--color-bg-glass-hover);
  color: var(--color-text);
  transform: translateY(-1px);
}

.dp-filter-chip.active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.dp-task-feed-meta {
  margin: 0 0 16px;
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dp-task-feed-meta::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent);
}

.dp-task-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dp-task-device-badge {
  background: rgb(255 255 255 / 45%);
  color: var(--color-text);
}

.dp-task-inline-alert {
  font-size: 12px;
  color: var(--color-warning, #b7791f);
}

.dp-device-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  min-height: 0;
  padding: 20px 22px;
  border-radius: calc(var(--radius-md) + 6px);
}

.dp-device-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dp-device-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.dp-device-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dp-device-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dp-device-chip.attention-warning,
.dp-device-chip.attention-critical {
  background: var(--color-warning-subtle, rgb(251 191 36 / 18%));
  color: var(--color-warning, #b7791f);
}

.dp-device-chip.attention-critical {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.dp-device-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dp-device-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-bg-glass) 90%, white 10%);
  border: 1px solid var(--color-border-subtle);
  transition: all 0.3s ease;
}

.dp-device-card:hover .dp-device-stat {
  background: color-mix(in srgb, var(--color-bg-glass) 80%, white 20%);
  transform: translateY(-2px);
}

.dp-device-stat strong {
  font-size: 16px;
  line-height: 1.1;
  color: var(--color-text);
  font-weight: 600;
}

.dp-device-stat span {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.dp-device-alert-strip {
  flex: 1;
  min-width: 220px;
  border-radius: 16px;
  background: var(--color-warning-subtle, rgb(251 191 36 / 18%));
  color: var(--color-warning, #b7791f);
  padding: 12px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.dp-device-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dp-device-hint {
  flex: 1;
  min-width: 220px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dp-device-actions,
.dp-channel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: auto;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.dp-ghost-btn {
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-ui);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dp-ghost-btn:hover:not(:disabled),
.dp-secondary-btn:hover:not(:disabled) {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-color: var(--color-accent-subtle);
}

.dp-ghost-btn.danger,
.dp-secondary-btn.danger {
  color: var(--color-error);
}

.dp-ghost-btn:disabled,
.dp-secondary-btn:disabled,
.dp-primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dp-channel-builder {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-bg-glass) 82%, white 8%);
}

.dp-channel-builder-top {
  grid-template-columns: minmax(150px, 0.9fr) minmax(220px, 1.3fr) minmax(150px, 0.9fr);
}

.dp-channel-builder-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dp-channel-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dp-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 2px;
  color: var(--color-text);
  font-size: 13px;
}

.dp-checkbox-row input {
  width: 16px;
  height: 16px;
}

.dp-support-grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dp-support-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-glass) 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.dp-support-card:hover {
  border-color: var(--color-accent-subtle);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.dp-support-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at top right, var(--color-accent-subtle), transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.dp-support-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dp-support-header h3,
.dp-drawer-header h2 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.dp-support-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.dp-support-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dp-support-stats div {
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-bg-glass) 80%, white 5%);
  border: 1px solid var(--color-border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease;
}

.dp-support-card:hover .dp-support-stats div {
  transform: translateY(-2px);
}

.dp-support-stats strong {
  font-size: 18px;
  color: var(--color-text);
}

.dp-support-stats span,
.dp-support-row span,
.dp-channel-row span,
.dp-observer-row span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.dp-support-list,
.dp-observer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dp-support-row,
.dp-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  transition: background 0.2s ease;
}

.dp-support-row:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border-light);
}

.dp-support-row strong,
.dp-channel-row strong,
.dp-observer-row strong {
  color: var(--color-text);
  font-size: 13px;
}

.dp-inline-status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-bg-hover);
  color: var(--color-text-muted);
}

.dp-inline-status.ok {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.dp-inline-status.level-warning {
  background: var(--color-warning-subtle, rgb(251 191 36 / 18%));
  color: var(--color-warning, #b7791f);
}

.dp-inline-status.level-critical {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.dp-placeholder.compact {
  padding: 18px;
  font-size: 13px;
}

.devices-remote-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  overflow-y: auto;
}

.devices-remote-field input,
.devices-remote-field select {
  width: 100%;
}

.dp-modal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-inline-form {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
}

.dp-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgb(15 23 42 / 18%);
}

.dp-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 100%);
  height: 100%;
  background: var(--color-bg-elevated);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.dp-drawer-header,
.dp-drawer-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dp-detail-block {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dp-detail-block strong {
  color: var(--color-text);
}

.dp-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dp-drawer-section h3,
.dp-modal-section h3 {
  margin: 0;
  font-size: 15px;
  color: var(--color-text);
}

.dp-code-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dp-code-list code {
  display: block;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dp-observer-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
}

.dp-observer-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.dp-observer-dot.level-info {
  background: var(--color-accent);
}

.dp-observer-dot.level-warning {
  background: var(--color-warning, #b7791f);
}

.dp-observer-dot.level-critical {
  background: var(--color-error);
}

.dp-section-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 980px) {
  .dp-support-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .devices-panel {
    padding: 28px 18px 40px;
  }

  .dp-tasks-grid,
  .dp-devices-list,
  .dp-detail-grid,
  .dp-support-stats {
    grid-template-columns: 1fr;
  }

  .dp-device-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dp-device-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dp-inline-form,
  .dp-device-topline {
    align-items: stretch;
  }

  .dp-inline-form {
    grid-template-columns: 1fr;
  }

  .dp-device-topline {
    flex-direction: column;
  }

  .dp-device-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dp-device-actions {
    align-items: flex-start;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dp-device-switcher {
    width: 100%;
    min-width: 0;
  }
}


/* ── Sidebar devices button ── */

.cli-devices-btn {
  font-size: 12px;
}

.cli-devices-btn.active {
  color: var(--color-accent, #0d9488);
  background: var(--color-bg-elevated);
}

.nodes-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nodes-empty-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  padding: 16px;
}

.nodes-empty-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nodes-empty-card ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nodes-connection-note {
  margin-top: 12px;
  padding: 10px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nodes-connection-note code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.nodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nodes-card {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

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

.nodes-card.is-active {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent-subtle);
}

.nodes-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nodes-card-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nodes-platform-icon {
  font-size: 20px;
}

.nodes-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nodes-card-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.nodes-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.nodes-status.foreground {
  background: var(--color-success-subtle);
  border-color: var(--color-success);
  color: var(--color-success);
}

.nodes-status.background {
  background: var(--color-warning-subtle);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.nodes-capabilities {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nodes-capability {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.nodes-capability.denied {
  opacity: 0.6;
}

.nodes-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nodes-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  font-size: 12px;
}

.nodes-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nodes-detail-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

.nodes-detail-value {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.nodes-detail-mono {
  font-family: var(--font-mono);
}

.nodes-test h5 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.nodes-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nodes-command-btn {
  padding: 6px 8px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.nodes-command-btn:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.nodes-command-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nodes-result {
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  font-size: 12px;
}

.nodes-result.success {
  background: var(--color-success-subtle);
  border-color: var(--color-success);
  color: var(--color-success);
}

.nodes-result.error {
  background: var(--color-error-subtle);
  border-color: var(--color-error);
  color: var(--color-error);
}

.nodes-result-title {
  margin: 0;
  font-weight: 600;
}

.nodes-result-error {
  margin-top: 6px;
  color: var(--color-error);
}

.nodes-result-pre {
  margin-top: 8px;
  padding: 8px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  max-height: 160px;
  overflow: auto;
  color: var(--color-text-secondary);
}

.nodes-summary {
  padding: 10px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-muted);
}

.nodes-summary-count,
.nodes-summary-highlight {
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Ensure settings sections look good in full-page view */
.settings-page .settings-section {
  margin-bottom: 24px;
  padding-bottom: 0;
}

.settings-page .settings-section:last-of-type {
  margin-bottom: 0;
}

.settings-page .provider-options {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.settings-page .provider-option {
  flex: 0 1 auto;
  min-width: 0;
  padding: 10px 16px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.settings-page .provider-option .provider-option-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
}

.settings-page .provider-option .provider-name {
  font-size: 13px;
  white-space: nowrap;
}

.settings-page .provider-option .provider-types,
.settings-page .provider-option .provider-description {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .settings-page-layout {
    flex-direction: column;
  }

  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 12px;
  }

  .settings-nav-item {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    padding: 8px 12px;
    font-size: 13px;
  }

  .settings-content {
    padding: 20px;
  }
}

/* ==================== GUARDRAIL SETTINGS ==================== */
.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-section-header h3 {
  margin: 0;
}

.settings-title-with-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
}

.x-status-badge.connected {
  color: var(--color-success, #22c55e);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.x-status-badge.installed {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.x-status-badge.missing {
  color: var(--color-error, #ef4444);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.notion-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
}

.notion-status-badge.connected {
  color: var(--color-success, #22c55e);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.notion-status-badge.configured {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.notion-status-badge.missing {
  color: var(--color-error, #ef4444);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.box-status-badge,
.onedrive-status-badge,
.google-workspace-status-badge,
.dropbox-status-badge,
.sharepoint-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-bg-glass);
  color: var(--color-text-secondary);
}

.box-status-badge.connected,
.onedrive-status-badge.connected,
.google-workspace-status-badge.connected,
.dropbox-status-badge.connected,
.sharepoint-status-badge.connected {
  color: var(--color-success, #22c55e);
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.box-status-badge.configured,
.onedrive-status-badge.configured,
.google-workspace-status-badge.configured,
.dropbox-status-badge.configured,
.sharepoint-status-badge.configured {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
}

.box-status-badge.missing,
.onedrive-status-badge.missing,
.google-workspace-status-badge.missing,
.dropbox-status-badge.missing,
.sharepoint-status-badge.missing {
  color: var(--color-error, #ef4444);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.settings-setup-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-setup-steps li {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.settings-setup-steps--nested {
  margin-top: 6px;
  padding-left: 16px;
  list-style-type: lower-alpha;
}

.settings-setup-steps li strong {
  color: var(--color-text);
}

.settings-setup-steps li code {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  padding: 1px 4px;
}

.google-workspace-account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.google-workspace-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-secondary);
}

.google-workspace-account-row strong {
  display: block;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.google-workspace-account-row .settings-hint {
  margin: 2px 0 0;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  opacity: 0.8;
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  transition: 0.2s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--color-text-muted);
  border-radius: 50%;
  transition: 0.2s;
}

.settings-toggle input:checked+.toggle-slider {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.settings-toggle input:checked+.toggle-slider::before {
  transform: translateX(20px);
  background-color: white;
}

.settings-inline-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.settings-inline-input label {
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
}

.settings-input-number {
  width: 140px;
  text-align: right;
}

.pattern-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pattern-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
}

.pattern-tag.builtin {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.pattern-tag.custom,
.pattern-tag.domain {
  background-color: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-accent);
  border: 1px solid rgba(var(--color-accent-rgb), 0.3);
}

.pattern-tag.trusted {
  background-color: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pattern-tag.builtin.trusted {
  background-color: rgba(34, 197, 94, 0.05);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.pattern-remove {
  background: none;
  border: none;
  padding: 0;
  width: 16px;
  height: 16px;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.12s;
}

.pattern-remove:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
}

.settings-hint.warning {
  color: var(--color-warning);
}

/* ==================== GOAL MODE ==================== */
.goal-mode-section {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.goal-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
}

.goal-mode-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.goal-mode-label {
  font-weight: 500;
  color: var(--color-text);
}

.goal-mode-hint {
  color: var(--color-text-muted);
  font-size: 12px;
}

.goal-mode-toggle.goal-mode-toggle-switch-row {
  align-items: stretch;
  gap: 0;
}

.goal-mode-toggle-switch-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goal-mode-toggle-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.goal-mode-toggle-switch-row .goal-mode-hint {
  line-height: 1.25;
}

.goal-mode-switch-track {
  flex: 0 0 auto;
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.12));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.2));
  transition: background 0.18s ease, border-color 0.18s ease;
}

.goal-mode-switch-track.on {
  background: var(--color-accent, #22d3ee);
  border-color: var(--color-accent, #22d3ee);
}

.goal-mode-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-text-primary, #e5e7eb);
  transition: left 0.18s ease;
}

.goal-mode-switch-track.on .goal-mode-switch-thumb {
  left: 14px;
}

.goal-mode-options {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goal-mode-command {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.goal-mode-prompt {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-weight: 500;
}

.goal-mode-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.goal-mode-input::placeholder {
  color: var(--color-text-muted);
}

.goal-mode-attempts {
  display: flex;
  align-items: center;
}

.goal-mode-attempts label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.goal-mode-attempts input[type="number"] {
  width: 50px;
  padding: 4px 8px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 13px;
  text-align: center;
}

.goal-mode-attempts input[type="number"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* ==================== MULTI-LLM SELECTION PANEL ==================== */
.multi-llm-selection-panel {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.multi-llm-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}

.multi-llm-providers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.multi-llm-provider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.multi-llm-provider-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  min-width: 150px;
}

.multi-llm-provider-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.multi-llm-model-select {
  flex: 1;
  max-width: 260px;
  padding: 4px 8px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 12px;
}

.multi-llm-model-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.multi-llm-judge {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.multi-llm-judge label {
  font-weight: 500;
  white-space: nowrap;
}

.multi-llm-judge-select {
  flex: 1;
  max-width: 300px;
  padding: 4px 8px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 12px;
}

.multi-llm-judge-select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.multi-llm-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ==================== APPEARANCE SETTINGS ==================== */
.appearance-section {
  margin-bottom: 24px;
}

.appearance-section h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 12px 0;
}

.theme-switcher {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-option {
  flex: 1;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.theme-option:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-option.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.theme-option:active {
  transform: translateY(0);
}

.theme-option-preview {
  width: 88px;
  height: 60px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-option-preview.dark {
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d30 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 8px 8px 16px;
  gap: 4px;
}

.theme-option-preview.dark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-option-preview.light {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f7 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 8px 8px 8px 16px;
  gap: 4px;
}

.theme-option-preview.light::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.theme-option-preview.terminal {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 8px 8px 10px;
  gap: 4px;
}

.theme-option-preview.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(255, 255, 255, 0.015) 4px);
  pointer-events: none;
  z-index: 1;
}

.theme-option-preview.terminal .code-line {
  background: #33ff00;
  height: 2px;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(51, 255, 0, 0.4);
}

.theme-option-preview.terminal .code-line:nth-child(1) {
  width: 55%;
}

.theme-option-preview.terminal .code-line:nth-child(2) {
  width: 80%;
}

.theme-option-preview.terminal .code-line:nth-child(3) {
  width: 40%;
}

.theme-option-preview.system {
  background: linear-gradient(135deg, #1e1e1e 0%, #1e1e1e 50%, #ffffff 50%, #f5f5f7 100%);
  border: 1px solid rgba(128, 128, 128, 0.2);
  padding: 8px;
}

.theme-option-preview.warm {
  background: linear-gradient(135deg, #fff1e6 0%, #f4d9c8 100%);
  border: 1px solid rgba(120, 90, 70, 0.18);
  padding: 8px 8px 8px 16px;
  gap: 4px;
}

.theme-option-preview.warm::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: rgba(120, 90, 70, 0.12);
  border-right: 1px solid rgba(120, 90, 70, 0.1);
}

.theme-option-preview.warm .ui-line {
  background: rgba(120, 90, 70, 0.25);
  height: 3px;
  border-radius: 3px;
}

.theme-option-preview.warm .ui-line:nth-child(1) {
  width: 60%;
}

.theme-option-preview.warm .ui-line:nth-child(2) {
  width: 85%;
}

.theme-option-preview.warm .ui-line:nth-child(3) {
  width: 45%;
}

.theme-option-preview-line {
  height: 3px;
  border-radius: 3px;
}

.theme-option-preview.dark .theme-option-preview-line {
  background: rgba(255, 255, 255, 0.25);
}

.theme-option-preview.light .theme-option-preview-line {
  background: rgba(0, 0, 0, 0.12);
}

.theme-option-preview-line:nth-child(1) {
  width: 55%;
}

.theme-option-preview-line:nth-child(2) {
  width: 80%;
}

.theme-option-preview-line:nth-child(3) {
  width: 40%;
}

.theme-option-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.theme-option.selected .theme-option-label {
  color: var(--color-accent);
}

/* Color Swatch Strip */
.color-swatch-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch-btn {
  padding: 4px;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}

.color-swatch-btn:hover {
  transform: scale(1.12);
}

.color-swatch-btn.selected {
  border-color: var(--color-accent);
}

.color-swatch-btn.selected .color-swatch {
  transform: scale(1.05);
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.color-check {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.color-swatch-selected-label {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent);
}

.color-swatch.cyan {
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
}

.color-swatch.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.color-swatch.purple {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.color-swatch.pink {
  background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
}

.color-swatch.rose {
  background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
}

.color-swatch.orange {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
}

.color-swatch.green {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.color-swatch.teal {
  background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
}

.color-swatch.coral {
  background: linear-gradient(135deg, #ff6b6b 0%, #e85555 100%);
}

/* Theme Option Icon */
.theme-option-icon {
  color: var(--color-text-secondary);
  transition: color 0.15s ease;
}

.theme-option.selected .theme-option-icon {
  color: var(--color-accent);
}

/* Theme Option Sublabel */
.theme-option-sublabel {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 11px;
}

/* ===== Task Queue Panel ===== */
.task-queue-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 320px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
}

.queue-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
}

.queue-panel-header:hover {
  background: var(--color-bg-hover);
}

.queue-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.queue-icon {
  font-size: 12px;
  opacity: 0.6;
}

.queue-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border-radius: 10px;
}

.queue-chevron {
  font-size: 12px;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.queue-chevron.expanded {
  transform: rotate(180deg);
}

.queue-panel-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.queue-section {
  margin-bottom: 12px;
}

.queue-section:last-child {
  margin-bottom: 0;
}

.queue-section-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.queue-item {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.queue-item:last-child {
  margin-bottom: 0;
}

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

.queue-item-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.queue-item-status.running {
  color: var(--color-accent);
}

.queue-item-status.queued {
  color: var(--color-text-muted);
}

.queue-position {
  font-size: 11px;
  font-weight: 600;
}

.queue-item-time {
  font-size: 10px;
  color: var(--color-text-muted);
}

.queue-item-title {
  font-size: 13px;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item-title:hover {
  color: var(--color-accent);
}

.queue-item-actions {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
}

.queue-item-view,
.queue-item-cancel {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.queue-item-view {
  background: var(--color-accent);
  color: var(--color-bg-primary);
}

.queue-item-view:hover {
  filter: brightness(1.1);
}

.queue-item-cancel {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

.queue-item-cancel:hover {
  background: var(--color-error);
  color: white;
}

.queue-empty {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Spinner animation */
.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}

/* Regular notifications: top-right, below window controls — constrained to right sidebar width */
.toast-container-top-right {
  top: 48px;
  right: 16px;
  align-items: flex-end;
  max-width: calc(var(--right-panel-width) - 16px);
}

.toast-container-top-right .toast {
  min-width: 180px;
  max-width: 100%;
}

/* Approval / shell-authorization notifications: centered */
.toast-container-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.toast-error {
  border-left: 3px solid var(--color-error);
}

.toast-info {
  border-left: 3px solid var(--color-accent);
}

.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-icon-success {
  background: var(--color-success);
  color: white;
}

.toast-icon-error {
  background: var(--color-error);
  color: white;
}

.toast-icon-info {
  background: var(--color-accent);
  color: var(--color-bg-primary);
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toast-dismiss {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.toast-dismiss:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.toast-with-action {
  flex-wrap: wrap;
}

/* Completion-with-outputs: clearer hierarchy, primary CTA stands out */
.toast-success.toast-with-action .toast-message {
  font-weight: 500;
  color: var(--color-text-primary);
  -webkit-line-clamp: 2;
}

.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.toast-action-btn {
  padding: 6px 12px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.toast-action-btn:active {
  transform: scale(0.98);
}

.toast-action-btn:hover {
  background: var(--color-accent-hover);
}

.toast-action-btn-secondary {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.toast-action-btn-secondary:hover {
  background: var(--color-bg-tertiary);
}

.toast-action-btn-danger {
  background: var(--color-error);
}

.toast-action-btn-danger:hover {
  background: #dc2626;
}

/* ===== Quick Task FAB ===== */
.quick-task-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.quick-task-input-popup {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quick-task-input {
  width: 250px;
  padding: 8px 12px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  font-size: 13px;
  color: var(--color-text-primary);
  outline: none;
}

.quick-task-input:focus {
  border-color: var(--color-accent);
}

.quick-task-input::placeholder {
  color: var(--color-text-muted);
}

.quick-task-submit {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-task-submit:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.quick-task-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-task-fab {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.quick-task-fab:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.quick-task-fab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-task-fab.open {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.fab-icon {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.2s ease;
}

.quick-task-fab.open .fab-icon {
  transform: rotate(45deg);
}

/* Queued status indicator in task list */
.cli-task-status.queued {
  color: var(--color-text-muted);
}

.cli-task-status.queued::before {
  content: "...";
  font-weight: bold;
}

/* ===== Queue Settings ===== */
.settings-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.settings-slider-group label {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.slider-with-value {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--color-bg-tertiary);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.settings-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.settings-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.slider-value {
  min-width: 32px;
  padding: 6px 12px;
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.settings-info-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-info-list li {
  padding: 12px 14px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.settings-info-list li strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ===== Custom Skills Settings ===== */
.skills-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-section-header h3 {
  margin: 0;
}

.settings-section-actions {
  display: flex;
  gap: 8px;
}

.skills-empty {
  padding: 32px;
  text-align: center;
  background: var(--color-bg-secondary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
}

.skills-empty p {
  margin: 8px 0;
}

.skills-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.skills-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skills-category-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.skill-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skill-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.skill-card-header .settings-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

.skill-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.skill-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.skill-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
}

.skill-description {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* Guideline Skill Card */
.skill-card-guideline {
  border-color: var(--color-primary);
  border-style: dashed;
  background: linear-gradient(135deg,
      var(--color-bg-secondary) 0%,
      rgba(var(--color-primary-rgb), 0.05) 100%);
}

.skill-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(var(--color-primary-rgb), 0.15);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.skill-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-left: auto;
}

.skill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.skill-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 11px;
  transition: all 0.2s ease;
}

.skill-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--color-text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.skill-toggle input:checked+.skill-toggle-slider {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.skill-toggle input:checked+.skill-toggle-slider:before {
  transform: translateX(18px);
  background: white;
}

.skill-toggle input:focus+.skill-toggle-slider {
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.3);
}

/* Skill Editor */
.skill-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-editor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

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

.form-group-flex {
  flex: 1;
}

.form-group-icon {
  width: 60px;
}

.form-group-icon input {
  text-align: center;
  font-size: 20px;
}

.form-group-sm {
  width: 120px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.form-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

.council-settings {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.council-settings-sidebar,
.council-settings-main {
  min-width: 0;
}

.council-settings-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.council-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.council-list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.council-list-item:hover,
.council-list-item.active {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.council-list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.council-list-item-meta,
.council-run-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.council-status-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border-subtle);
}

.council-status-pill.enabled {
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 45%, var(--color-border-subtle));
}

.council-status-pill.disabled {
  color: var(--color-text-secondary);
}

.council-error {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-error);
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.council-seat-grid,
.council-source-grid,
.council-history-grid {
  display: grid;
  gap: 16px;
}

.council-seat-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.council-source-grid,
.council-history-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.council-seat-card,
.council-source-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
}

.council-seat-card-header,
.council-chip-row,
.council-run-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.council-chip-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

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

.council-run-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.council-run-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.council-run-item:last-child {
  border-bottom: none;
}

.council-memo-preview {
  margin: 14px 0 0;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}

@media (max-width: 1100px) {
  .council-settings {
    grid-template-columns: 1fr;
  }
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

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

.form-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.parameters-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parameter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
}

.parameter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.skill-editor-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-subtle);
}

/* Button variants */
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-error);
  color: white;
}

.settings-error {
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-error);
  border-radius: var(--radius-md);
  color: var(--color-error);
  font-size: 13px;
}

/* MCP Settings Styles */
.mcp-settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mcp-settings-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.mcp-nav-button {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.mcp-nav-button:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.mcp-nav-button.active {
  background: var(--color-bg-tertiary);
  color: var(--color-accent);
}

.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.settings-section-header h3 {
  margin: 0;
}

.mcp-add-form {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.mcp-add-form h4 {
  margin: 0 0 16px 0;
  font-size: 15px;
  font-weight: 600;
}

.mcp-form-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

.mcp-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.mcp-empty-state p:first-child {
  font-size: 15px;
  margin-bottom: 8px;
}

.mcp-server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.mcp-server-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.mcp-server-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mcp-server-info {
  flex: 1;
}

.mcp-server-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mcp-server-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.mcp-server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.mcp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mcp-server-command {
  display: block;
  font-size: 12px;
  color: var(--color-text-tertiary);
  font-family: var(--font-mono);
  margin-top: 4px;
  word-break: break-all;
}

.mcp-server-toggle {
  margin-left: 16px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  transition: 0.2s;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--color-text-secondary);
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.toggle-switch input:checked+.toggle-slider:before {
  background-color: white;
  transform: translateX(18px);
}

.mcp-server-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-error);
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  word-break: break-word;
}

.mcp-error-icon {
  flex-shrink: 0;
  font-size: 14px;
}

.mcp-error-dismiss {
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.mcp-error-dismiss:hover {
  opacity: 1;
}

.mcp-server-tools-count {
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.mcp-server-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mcp-test-result {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
}

.mcp-test-result.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
}

.mcp-test-result.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

/* MCP Header Actions */
.mcp-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* MCP Update Badge */
.mcp-update-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--color-accent);
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Success Button */
.button-success {
  background: var(--color-success);
  color: white;
  border: none;
}

.button-success:hover {
  background: #16a34a;
}

.button-success:disabled {
  background: var(--color-text-tertiary);
  cursor: not-allowed;
}

/* MCP Modal */
.mcp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.mcp-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.theme-light .mcp-modal {
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.mcp-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.mcp-modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.mcp-modal-close {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.mcp-modal-close:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.mcp-modal-content {
  padding: 20px;
  overflow-y: auto;
}

.connector-setup-modal .settings-field label {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.connector-mode-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.connector-setup-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ──────────────────────────────────────
   Connector Marketplace
   ────────────────────────────────────── */

.connector-marketplace {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cm-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.cm-filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.cm-filter-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.cm-filter-tab--active {
  background: var(--color-bg-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.cm-filter-count {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 600;
}

.cm-filter-tab--active .cm-filter-count {
  background: var(--color-accent-subtle, rgba(99, 102, 241, 0.12));
  color: var(--color-accent, #6366f1);
}

.cm-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: nowrap;
}

.cm-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  width: 240px;
  flex: 0 0 240px;
  padding: 0 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted, var(--color-text-secondary));
  box-shadow: none;
}

.cm-search:focus-within {
  border-color: var(--color-accent, #6366f1);
  background: var(--color-bg-elevated);
}

.connector-marketplace .cm-search input[type="search"] {
  width: auto;
  height: 100%;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text);
  font: inherit;
  font-size: 12px;
  line-height: 1;
}

.connector-marketplace .cm-search input[type="search"]:hover,
.connector-marketplace .cm-search input[type="search"]:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.connector-marketplace .cm-search input[type="search"]::placeholder {
  color: var(--color-text-muted, var(--color-text-secondary));
}

.connector-marketplace .cm-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.cm-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted, var(--color-text-secondary));
  cursor: pointer;
  flex-shrink: 0;
}

.cm-search-clear:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.cm-category-select {
  width: auto;
  height: 30px;
  flex: 0 0 180px;
  padding: 0 28px 0 10px;
  font-size: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  box-shadow: none;
}

.cm-category-select:focus {
  border-color: var(--color-accent, #6366f1);
}

.connector-marketplace .cm-toolbar-right .button-small {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cm-toolbar-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .cm-search {
    width: auto;
    flex: 1 1 220px;
  }

  .cm-category-select {
    flex: 1 1 180px;
  }
}

/* 3-column auto-fill grid */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* Individual connector card — <button> for accessibility */
.cm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
  color: inherit;
  width: 100%;
}

.cm-card:hover {
  background: var(--color-bg-elevated);
  border-color: var(--color-border-light, var(--color-border));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.cm-card--connected {
  border-color: rgba(52, 211, 153, 0.4);
}

/* Connected checkmark badge — absolute top-right */
.cm-card-connected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-success, #34d399);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Brand icon with letter fallback */
.cm-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cm-brand-icon {
  overflow: hidden;
  background: var(--connector-color);
}

.cm-brand-icon--fallback {
  background: var(--connector-color);
}

.cm-brand-icon--image {
  background: color-mix(in srgb, var(--color-bg-elevated) 86%, white 14%);
  border: 1px solid var(--color-border-subtle, var(--color-border));
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.cm-brand-icon img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.cm-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.cm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.cm-card-desc {
  font-size: 11px;
  color: var(--color-text-muted, var(--color-text-secondary));
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Installed-but-not-connected status dot */
.cm-card-status-dot {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Empty state */
.cm-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted, var(--color-text-secondary));
  font-size: 13px;
}

/* Detail modal */
.cm-detail-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.cm-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cm-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cm-detail-title {
  flex: 1;
  min-width: 0;
}

.cm-detail-title h2 {
  margin: 0 0 3px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.cm-detail-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.cm-detail-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cm-connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.cm-connection-badge--connected {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}

.cm-connection-badge--error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

.cm-detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cm-detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cm-detail-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted, var(--color-text-secondary));
}

.cm-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cm-detail-overview {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.cm-detail-overview-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cm-detail-overview-bullets li {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.cm-tools-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cm-tools-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
}

.cm-tools-item:hover {
  background: var(--color-bg-hover);
}

.cm-tools-check {
  color: var(--color-success, #34d399);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.cm-tools-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text);
}

/* Section divider between connector groups */
.cm-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 14px;
}

.cm-section-divider::before,
.cm-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.cm-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted, var(--color-text-secondary));
  white-space: nowrap;
}

/* Space between stacked connector grids (Storage & Productivity vs MCP list) */
.connector-marketplace .cm-grid + .cm-section-divider {
  margin-top: 28px;
}

/* Integration settings modal — wider to fit the settings forms */
.cm-integration-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

/* Connector Profile View (Claude-style detail) */
.cm-profile-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.cm-profile-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cm-profile-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
}

.cm-profile-back:hover {
  color: var(--color-text);
}

.cm-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cm-profile-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cm-profile-header-content {
  flex: 1;
  min-width: 0;
}

.cm-profile-title {
  margin: 0 0 4px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.cm-profile-tagline {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.cm-profile-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}

.cm-profile-connect-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  background: #1a1a1a;
  color: #fff;
  min-width: 120px;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}

.cm-profile-connect-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.cm-profile-connect-btn.connected {
  background: var(--color-success);
  color: white;
}

.cm-profile-connect-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cm-profile-error {
  margin: 0 20px 16px;
}

.cm-profile-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.cm-profile-examples,
.cm-profile-description,
.cm-profile-features {
  padding: 20px 20px 0;
}

.cm-profile-features {
  padding-bottom: 28px;
}

.cm-profile-section-label {
  margin: 0 0 16px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--color-text-muted, var(--color-text-secondary));
}

.cm-profile-examples-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.cm-example-card {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.cm-example-prompt {
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.45;
  border: 1px solid var(--color-border);
}

.cm-example-result {
  min-height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
}

.cm-example-result img {
  width: 100%;
  height: auto;
  display: block;
}

.cm-example-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 20px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.5;
  background: var(--color-bg-tertiary);
}

.cm-profile-description p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.cm-profile-features-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-profile-features-list li {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.cm-profile-features-list strong {
  color: var(--color-text);
}

.cm-profile-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.cm-profile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cm-profile-tools-count {
  color: var(--color-text-muted, var(--color-text-secondary));
}

/* Connector Profile: Update button */
.cm-profile-update-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.cm-profile-update-btn:hover:not(:disabled) {
  background: var(--color-accent-subtle);
}

.cm-profile-update-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Connector Profile: Developed by & Trust warning */
.cm-profile-developed-by {
  padding: 20px 20px 0;
}

.cm-profile-developed-by-text {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.cm-profile-developed-by-label {
  color: var(--color-text-muted, var(--color-text-secondary));
}

.cm-profile-author-link {
  color: var(--color-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cm-profile-author-link:hover {
  text-decoration: underline;
}

.cm-profile-trust-warning {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted, var(--color-text-secondary));
  line-height: 1.5;
}

/* Connector Profile: Tools pills */
.cm-profile-tools {
  padding: 20px 20px 0;
}

.cm-profile-tools-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  color: var(--color-text-muted, var(--color-text-secondary));
}

.cm-profile-tools-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cm-profile-tool-pill {
  display: inline-block;
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

/* Connector Profile: Details grid */
.cm-profile-details {
  padding: 20px 20px 0;
}

.cm-profile-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.cm-profile-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cm-profile-detail-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--color-text-muted, var(--color-text-secondary));
}

.cm-profile-detail-value {
  font-size: 13px;
  color: var(--color-text);
}

.cm-profile-detail-value code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.cm-profile-detail-url {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-profile-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.cm-profile-copy-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.cm-profile-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cm-profile-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
}

.cm-profile-detail-link:hover {
  text-decoration: underline;
}

.cm-profile-update-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-radius: var(--radius-sm);
}

.cm-integration-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 0 4px 4px;
}

/* Custom connector form modal */
.cm-custom-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.cm-custom-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.cm-custom-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.cm-custom-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cm-custom-modal-footer {
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--color-border);
}

.mcp-modal-wide {
  max-width: 500px;
}

.mcp-modal-content .settings-field {
  margin-bottom: 16px;
}

.mcp-modal-content .settings-field:last-of-type {
  margin-bottom: 0;
}

.mcp-modal-content input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
}

.mcp-modal-content input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
}

.theme-light .mcp-modal-content input[type="text"] {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.15);
}

.mcp-env-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  min-height: 100px;
}

.theme-light .mcp-env-textarea {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.15);
}

.mcp-env-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.mcp-env-textarea::placeholder {
  color: var(--color-text-muted);
}

.mcp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.mcp-no-tools {
  color: var(--color-text-secondary);
  text-align: center;
  padding: 20px;
}

.mcp-tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mcp-tool-item {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.theme-light .mcp-tool-item {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.1);
}

.mcp-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
}

.mcp-tool-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.mcp-tool-params {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.mcp-tool-params-label {
  font-weight: 500;
}

/* MCP Filesystem Paths UI */
.mcp-paths-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.mcp-paths-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.theme-light .mcp-paths-empty {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.15);
}

.mcp-path-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.theme-light .mcp-path-item {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.1);
}

.mcp-path-icon {
  color: var(--color-accent);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.mcp-path-value {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  word-break: break-all;
}

.mcp-path-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.mcp-path-remove:hover {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.mcp-add-path-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
  font-family: var(--font-mono);
  resize: vertical;
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.button-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.button-danger:hover:not(:disabled) {
  background: var(--color-error);
  color: white;
}

/* Built-in Tools Settings Styles */
.builtin-tools-settings {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.builtin-tools-categories {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.builtin-tool-category {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.builtin-tool-category.disabled {
  opacity: 0.6;
}

.builtin-tool-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 16px;
}

.builtin-tool-category-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.builtin-tool-category-icon {
  flex-shrink: 0;
  color: var(--color-accent);
  margin-top: 2px;
}

.builtin-tool-category-text {
  flex: 1;
  min-width: 0;
}

.builtin-tool-category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.builtin-tool-category-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.builtin-tool-category-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.builtin-tool-priority-select {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}

.builtin-tool-priority-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.builtin-tool-toggle {
  display: inline-block;
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.builtin-tool-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.builtin-tool-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: background-color 0.2s, border-color 0.2s;
}

.builtin-tool-toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  top: 2px;
  background-color: var(--color-text-secondary);
  border-radius: 50%;
  transition: transform 0.2s;
}

.builtin-tool-toggle input:checked + .builtin-tool-toggle-slider {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.builtin-tool-toggle input:checked + .builtin-tool-toggle-slider:before {
  transform: translateX(16px);
  background-color: white;
}

.builtin-tool-expand-btn {
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.builtin-tool-expand-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.builtin-tool-advanced {
  border-top: 1px solid var(--color-border);
  padding: 12px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.builtin-tool-advanced-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.builtin-tool-advanced-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.builtin-tool-advanced-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.builtin-tool-advanced-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.builtin-tool-timeout-input {
  width: 110px;
  padding: 4px 6px;
  font-size: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.builtin-tool-mode-select {
  min-width: 190px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
}

.builtin-tool-timeout-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.builtin-tool-mode-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.builtin-tool-list {
  padding: 0 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  margin-top: 0;
}

.builtin-tool-item {
  padding: 4px 10px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.builtin-tool-item code {
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

.builtin-tools-saving {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 16px;
  background: var(--color-accent);
  color: white;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.settings-list {
  list-style: disc;
  padding-left: 20px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
}

.settings-list li {
  margin-bottom: 4px;
}

.settings-list strong {
  color: var(--color-text);
}

/* MCP Registry Browser Styles */
.mcp-registry-browser {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.registry-loading {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 40px 20px;
}

.registry-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.registry-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.registry-search svg {
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.registry-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.registry-search input::placeholder {
  color: var(--color-text-tertiary);
}

.registry-filter-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.registry-category-select {
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
}

.registry-verified-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.registry-verified-checkbox input {
  cursor: pointer;
}

.registry-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.registry-empty p {
  margin-bottom: 16px;
}

.registry-server-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.registry-server-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.15s ease;
}

.registry-server-card:hover {
  border-color: var(--color-border-hover);
}

.registry-server-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.registry-server-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.registry-server-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.registry-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-success);
  font-size: 12px;
}

.registry-featured-badge {
  background: var(--color-accent);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.registry-server-version {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.registry-server-description {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 8px 0;
}

.registry-server-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-bottom: 12px;
}

.registry-server-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.registry-tag {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.registry-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.registry-server-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.registry-installed-badge {
  background: var(--color-success);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
}

.registry-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.registry-link:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

/* Registry Details Modal */
.registry-details-modal {
  max-width: 700px;
}

.registry-details-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.registry-details-title h3 {
  margin: 0;
}

.registry-details-section {
  margin-bottom: 24px;
}

.registry-details-section:last-child {
  margin-bottom: 0;
}

.registry-details-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.registry-details-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.registry-details-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.registry-detail-row {
  display: flex;
  gap: 12px;
}

.registry-detail-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  min-width: 120px;
}

.registry-detail-value {
  font-size: 13px;
  color: var(--color-text);
}

.registry-details-command {
  margin-top: 16px;
}

.registry-details-command code {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text);
  word-break: break-all;
}

.registry-details-env {
  margin-top: 16px;
}

.registry-details-env ul {
  margin: 8px 0 0 0;
  padding: 0;
  list-style: none;
}

.registry-details-env li {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.registry-details-env li:last-child {
  border-bottom: none;
}

.registry-details-env code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.registry-tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.registry-tool-item {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.registry-tool-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.registry-tool-desc {
  display: block;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.registry-details-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Skill Parameter Modal */
.skill-param-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 12px;
  overflow-y: auto;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.skill-param-modal {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.2s ease;
}

.skill-param-modal form {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skill-param-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.skill-param-modal-icon {
  font-size: 28px;
  line-height: 1;
}

.skill-param-modal-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.skill-param-modal-title p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.skill-param-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-param-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-param-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.skill-param-field label .required {
  color: var(--color-danger);
}

.skill-param-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.skill-param-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.skill-param-input::placeholder {
  color: var(--color-text-muted);
}

.skill-param-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.skill-param-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.skill-param-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
}

.skill-param-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-accent);
}

.skill-param-hint {
  font-size: 12px;
  color: var(--color-text-muted);
}

.skill-param-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.skill-param-modal-footer .button-secondary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.skill-param-modal-footer .button-secondary:hover {
  background: var(--color-bg-hover);
}

.skill-param-modal-footer .button-primary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.skill-param-modal-footer .button-primary:hover {
  opacity: 0.9;
}

.skill-param-modal-footer .button-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .skill-param-modal-overlay {
    padding: 8px;
  }

  .skill-param-modal {
    width: 100%;
    max-height: calc(100vh - 16px);
  }

  .skill-param-modal-header,
  .skill-param-modal-body,
  .skill-param-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* =====================================================
   FILE VIEWER MODAL
   ===================================================== */

.file-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
}

.file-viewer-modal {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  width: min(90vw, 820px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Format-aware sizing */
.file-viewer-modal[data-format="html"],
.file-viewer-modal[data-format="pdf"] {
  width: min(94vw, 1180px);
  max-height: 90vh;
}

.file-viewer-modal[data-format="image"] {
  width: min(94vw, 1280px);
  max-height: 90vh;
}

.file-viewer-modal[data-format="video"] {
  width: min(94vw, 1280px);
  max-height: 90vh;
}

.file-viewer-modal[data-format="audio"] {
  width: min(90vw, 560px);
  max-height: none;
}

.file-viewer-modal[data-format="xlsx"],
.file-viewer-modal[data-format="csv"],
.file-viewer-modal[data-format="docx"] {
  width: min(94vw, 1100px);
  max-height: 88vh;
}

.file-viewer-modal[data-format="pptx"] {
  width: min(96vw, 1320px);
  max-height: none;
  height: min(88vh, 920px);
}

.file-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
  gap: 12px;
}

.file-viewer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.file-viewer-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-viewer-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.file-viewer-filename {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-viewer-subtitle {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.file-viewer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.file-viewer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.file-viewer-action-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
  border-color: var(--color-border-strong, var(--color-border));
}

.file-viewer-action-btn.is-active {
  background: var(--color-accent-soft, var(--color-bg-hover));
  color: var(--color-accent, var(--color-text));
  border-color: var(--color-accent, var(--color-border));
}

.file-viewer-action-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-viewer-close-btn:hover {
  background: var(--color-error);
  border-color: var(--color-error);
  color: white;
}

.file-viewer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  min-height: 200px;
}

/* Per-format content padding */
.file-viewer-modal[data-format="html"] .file-viewer-content,
.file-viewer-modal[data-format="video"] .file-viewer-content,
.file-viewer-modal[data-format="pptx"] .file-viewer-content {
  padding: 0;
  overflow: hidden;
}

.file-viewer-modal[data-format="image"] .file-viewer-content {
  padding: 12px;
}

.file-viewer-modal[data-format="audio"] .file-viewer-content {
  padding: 24px;
}

.file-viewer-modal[data-format="csv"] .file-viewer-content,
.file-viewer-modal[data-format="xlsx"] .file-viewer-content {
  padding: 12px;
}

/* Loading state */
.file-viewer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
  color: var(--color-text-secondary);
}

.file-viewer-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: file-viewer-spin 0.8s linear infinite;
}

@keyframes file-viewer-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.file-viewer-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 12px;
  text-align: center;
}

.file-viewer-error-icon {
  font-size: 32px;
}

.file-viewer-error p {
  color: var(--color-error);
  font-size: 14px;
  margin: 0;
}

/* Code and text content */
.file-viewer-code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text);
  background: var(--color-bg-input);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0;
}

/* Markdown content */
.file-viewer-markdown {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}

/* DOCX content */
.file-viewer-docx {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}

.file-viewer-docx p {
  margin: 0 0 1em 0;
}

.file-viewer-docx h1,
.file-viewer-docx h2,
.file-viewer-docx h3,
.file-viewer-docx h4 {
  margin: 1.5em 0 0.5em 0;
  color: var(--color-text);
}

.file-viewer-docx ul,
.file-viewer-docx ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.file-viewer-docx table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.file-viewer-docx th,
.file-viewer-docx td {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  text-align: left;
}

.file-viewer-docx th {
  background: var(--color-bg-tertiary);
  font-weight: 600;
}

/* HTML content */
.file-viewer-html {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: none;
  background: #fff;
  display: block;
}

.file-viewer-modal[data-format="html"] .file-viewer-html {
  height: calc(90vh - 64px);
}

/* PDF content */
.file-viewer-pdf {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.file-viewer-pdf-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  margin: 16px 16px 0 16px;
}

.file-viewer-pdf-summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.file-viewer-pdf-summary-row span {
  color: var(--color-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.file-viewer-pdf-summary-row strong {
  font-size: 16px;
  color: var(--color-text);
}

.file-viewer-pdf-summary-note,
.document-editor-pdf-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--color-text-muted);
}

.file-viewer-pdf-thumbnail img {
  display: block;
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

/* Image content */
.file-viewer-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
  border-radius: var(--radius-md);
  background: transparent;
}

.file-viewer-image-container[data-alpha="true"] {
  background-color: var(--color-bg-tertiary);
  background-image:
    linear-gradient(45deg, var(--color-bg-primary) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-bg-primary) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-bg-primary) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-bg-primary) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.file-viewer-image-container[data-mode="actual"] {
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.file-viewer-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.file-viewer-image-container[data-mode="actual"] .file-viewer-image {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  object-fit: none;
}

.file-viewer-image-download-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.74);
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  text-decoration: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.file-viewer-image-download-button:hover,
.file-viewer-image-download-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(17, 24, 39, 0.88);
  transform: translateY(-1px);
}

.file-viewer-image-download-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.file-viewer-video-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}

.file-viewer-video {
  width: 100%;
  max-height: 72vh;
  background: #000;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Presentation viewer */
/* Artifact viewer styles load with artifact surfaces. */

/* Audio player */
.file-viewer-audio-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.file-viewer-audio-icon {
  font-size: 36px;
  color: var(--color-text-muted);
}

.file-viewer-audio-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  word-break: break-all;
  text-align: center;
  max-width: 100%;
}

.file-viewer-audio {
  width: 100%;
}

/* JSON tree */
.file-viewer-json-tree {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg-input);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.json-node {
  position: relative;
}

.json-node-leaf,
.json-node-header,
.json-node-bracket-close {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-right: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-node-header {
  cursor: pointer;
  user-select: none;
  border-radius: 3px;
}

.json-node-header:hover {
  background: var(--color-bg-hover);
}

.json-node-toggle {
  display: inline-block;
  width: 12px;
  color: var(--color-text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.json-node-key {
  color: var(--color-text);
  font-weight: 500;
}

.json-node-bracket {
  color: var(--color-text-muted);
}

.json-node-summary {
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0 4px;
}

.json-node-value {
  color: var(--color-text-secondary);
}

.json-node-string {
  color: #a6e3a1;
}

.json-node-number {
  color: #fab387;
}

.json-node-boolean {
  color: #cba6f7;
}

.json-node-null {
  color: var(--color-text-muted);
  font-style: italic;
}

.file-viewer-json-warning {
  font-size: 12px;
  color: var(--color-warning, #fab387);
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-tertiary);
}

/* Code block (for code/latex/json-raw) */
.file-viewer-code-block {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.file-viewer-code-block .file-viewer-code {
  margin: 0;
  background: transparent;
  border-radius: 0;
}

.file-viewer-code-block .hljs {
  background: transparent;
  color: var(--color-text);
  padding: 0;
}

.file-viewer-code-block .hljs-keyword,
.file-viewer-code-block .hljs-selector-tag,
.file-viewer-code-block .hljs-built_in,
.file-viewer-code-block .hljs-name {
  color: #cba6f7;
}

.file-viewer-code-block .hljs-string,
.file-viewer-code-block .hljs-addition {
  color: #a6e3a1;
}

.file-viewer-code-block .hljs-number,
.file-viewer-code-block .hljs-literal,
.file-viewer-code-block .hljs-type {
  color: #fab387;
}

.file-viewer-code-block .hljs-comment,
.file-viewer-code-block .hljs-quote {
  color: #6c7086;
  font-style: italic;
}

.file-viewer-code-block .hljs-attr,
.file-viewer-code-block .hljs-attribute {
  color: #89b4fa;
}

.file-viewer-code-block .hljs-title,
.file-viewer-code-block .hljs-section {
  color: #89b4fa;
}

.file-viewer-code-block .hljs-variable,
.file-viewer-code-block .hljs-template-variable {
  color: #f38ba8;
}

.file-viewer-code-block .hljs-meta {
  color: #fab387;
}

.file-viewer-code-block .hljs-symbol,
.file-viewer-code-block .hljs-bullet,
.file-viewer-code-block .hljs-link,
.file-viewer-code-block .hljs-punctuation,
.file-viewer-code-block .hljs-tag {
  color: #94e2d5;
}

/* Error state actions */
.file-viewer-error-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.file-viewer-open-btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* ============================================
   Disclaimer Modal - Terminal Style (First Launch)
   ============================================ */

/* ============================================
   Disclaimer / Security Notice – Modern Theme
   ============================================ */

.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-primary, rgba(30, 30, 30, 0.95));
  backdrop-filter: blur(var(--glass-blur, 20px)) saturate(var(--glass-saturate, 180%));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px)) saturate(var(--glass-saturate, 180%));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  padding-top: 48px;
  overflow-y: auto;
}

.disclaimer-container {
  font-family: var(--font-ui);
  color: var(--color-text, #ffffff);
  max-width: 560px;
  width: 100%;
  font-size: 14px;
  line-height: 1.6;
}

/* Logo */
.disclaimer-logo {
  text-align: center;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.disclaimer-logo-text {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text, #fff);
  letter-spacing: -0.5px;
}

.disclaimer-logo-os {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent, #22d3ee);
  letter-spacing: -0.5px;
}

.disclaimer-subtitle {
  text-align: center;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.45));
  font-size: 12px;
  margin-bottom: 32px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Card container */
.disclaimer-card {
  background: var(--color-bg-elevated, rgba(45, 45, 48, 0.9));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 20px);
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.25));
  position: relative;
}

.disclaimer-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-glossy,
      linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%));
  border-radius: var(--radius-lg, 20px) var(--radius-lg, 20px) 0 0;
}

.disclaimer-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.06));
}

.disclaimer-card-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 12px);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  flex-shrink: 0;
}

.disclaimer-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #fff);
}

.disclaimer-card-body {
  padding: 20px;
}

.disclaimer-intro {
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  margin: 0 0 20px 0;
  font-size: 13px;
}

.disclaimer-section {
  margin-bottom: 20px;
}

.disclaimer-section:last-child {
  margin-bottom: 0;
}

.disclaimer-section h4 {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.disclaimer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.disclaimer-section li {
  position: relative;
  padding: 4px 0 4px 22px;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.55));
  font-size: 13px;
}

.disclaimer-section li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent, #22d3ee);
  opacity: 0.6;
}

/* Question section */
.disclaimer-question-section {
  margin-bottom: 24px;
}

.disclaimer-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text, #fff);
  margin-bottom: 14px;
}

.disclaimer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disclaimer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.06));
  background: var(--color-bg-glass, rgba(255, 255, 255, 0.05));
  transition: all 0.2s ease;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  font-size: 13px;
  position: relative;
  overflow: hidden;
}

.disclaimer-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: var(--gradient-glossy,
      linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%));
  pointer-events: none;
}

.disclaimer-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border, rgba(255, 255, 255, 0.12));
  color: var(--color-text, #fff);
}

.disclaimer-option.selected {
  background: var(--color-accent-subtle, rgba(34, 211, 238, 0.08));
  border-color: var(--color-accent, #22d3ee);
  color: var(--color-accent, #22d3ee);
  box-shadow:
    0 0 0 1px var(--color-accent, #22d3ee) inset,
    var(--shadow-glow, 0 0 20px rgba(34, 211, 238, 0.1));
}

/* Modern radio button */
.disclaimer-radio-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border, rgba(255, 255, 255, 0.2));
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.disclaimer-option.selected .disclaimer-radio-modern {
  border-color: var(--color-accent, #22d3ee);
}

.disclaimer-radio-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent, #22d3ee);
}

/* Continue button */
.disclaimer-continue {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.disclaimer-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  user-select: none;
  transition: color 0.15s ease;
}

.disclaimer-checkbox-label:hover {
  color: var(--color-text, #fff);
}

/* Modern checkbox */
.disclaimer-checkbox-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--color-border, rgba(255, 255, 255, 0.2));
  transition: all 0.2s ease;
  color: #fff;
  flex-shrink: 0;
}

.disclaimer-checkbox-modern.checked {
  background: var(--color-accent, #22d3ee);
  border-color: var(--color-accent, #22d3ee);
}

.disclaimer-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg,
      var(--color-accent-hover, #3ee0f5) 0%,
      var(--color-accent, #22d3ee) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #1a1a1a;
  padding: 12px 32px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-md, 16px);
  box-shadow:
    var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.15)),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.disclaimer-continue-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.disclaimer-continue-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.2)),
    var(--shadow-glow, 0 0 20px rgba(34, 211, 238, 0.15));
}

.disclaimer-continue-btn:active {
  transform: translateY(0);
}

/* Exit message */
.disclaimer-exit-message {
  text-align: center;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.45));
  font-size: 13px;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: var(--radius-sm, 12px);
}

/* Light theme */
.theme-light .disclaimer-overlay {
  background: rgba(245, 245, 245, 0.97);
}

.theme-light .disclaimer-logo-text {
  color: #1a1a1a;
}

.theme-light .disclaimer-subtitle {
  color: #999;
}

.theme-light .disclaimer-card {
  background: #fff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.theme-light .disclaimer-card::before {
  display: none;
}

.theme-light .disclaimer-card-header {
  background: #fafafa;
  border-color: #e8e8e8;
}

.theme-light .disclaimer-card-icon-wrap {
  background: rgba(251, 191, 36, 0.1);
}

.theme-light .disclaimer-card-title {
  color: #1a1a1a;
}

.theme-light .disclaimer-intro {
  color: #666;
}

.theme-light .disclaimer-section h4 {
  color: #555;
}

.theme-light .disclaimer-section li {
  color: #666;
}

.theme-light .disclaimer-question {
  color: #1a1a1a;
}

.theme-light .disclaimer-option {
  color: #555;
  background: rgba(0, 0, 0, 0.02);
  border-color: #e0e0e0;
}

.theme-light .disclaimer-option::before {
  display: none;
}

.theme-light .disclaimer-option:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: #ccc;
  color: #1a1a1a;
}

.theme-light .disclaimer-option.selected {
  background: rgba(8, 145, 178, 0.06);
  border-color: var(--color-accent);
}

.theme-light .disclaimer-radio-modern {
  border-color: #ccc;
}

.theme-light .disclaimer-checkbox-modern {
  border-color: #ccc;
}

.theme-light .disclaimer-continue-btn {
  color: #fff;
}

.theme-light .disclaimer-exit-message {
  color: #888;
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.12);
}

/* ============================================
   Command Output Component
   ============================================ */

.command-output-container {
  --terminal-bg: #1f2026;
  --terminal-surface: #252731;
  --terminal-header-top: #3d3f4a;
  --terminal-header-bottom: #30323c;
  --terminal-border: #4d505e;
  --terminal-text: #f2f4fb;
  --terminal-muted: #c4c9d8;
  --terminal-chip: rgba(255, 255, 255, 0.1);
  --terminal-success: #34c759;
  --terminal-success-chip-bg: rgba(52, 199, 89, 0.16);
  --terminal-success-chip-border: rgba(52, 199, 89, 0.35);
  --terminal-warning: #ffd60a;
  --terminal-error: #ff453a;
  --terminal-running: #64d2ff;
  background: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 14px;
  margin: 10px 0;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4);
}

.command-output-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--terminal-header-top), var(--terminal-header-bottom));
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  gap: 10px 14px;
}

.command-output-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--terminal-muted);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

.command-window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 2px;
}

.command-window-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.command-window-dot.close {
  background: #ff5f57;
}

.command-window-dot.minimize {
  background: #febc2e;
}

.command-window-dot.zoom {
  background: #28c840;
}

.command-prompt-glyph {
  color: #ad93ff;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.command-output-title .command-text {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 12px;
  color: var(--terminal-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-output-title .command-cwd {
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  color: var(--terminal-muted);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 180px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  flex: 0 1 180px;
}

.command-status {
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--terminal-chip);
  color: var(--terminal-muted);
  flex-shrink: 0;
}

.command-status.running {
  color: var(--terminal-running);
  background: rgba(100, 210, 255, 0.14);
  border-color: rgba(100, 210, 255, 0.34);
  animation: command-status-pulse 1.5s ease-in-out infinite;
}

.command-status.success {
  color: var(--terminal-success);
  background: var(--terminal-success-chip-bg);
  border-color: var(--terminal-success-chip-border);
}

.command-status.error {
  color: var(--terminal-error);
  background: rgba(255, 69, 58, 0.16);
  border-color: rgba(255, 69, 58, 0.35);
}

.command-shell-session {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--terminal-chip);
  color: var(--terminal-muted);
  flex-shrink: 0;
}

.command-shell-session-active {
  color: var(--terminal-success);
  background: var(--terminal-success-chip-bg);
  border-color: var(--terminal-success-chip-border);
}

.command-shell-session-resetting {
  color: var(--terminal-warning);
  background: rgba(255, 214, 10, 0.12);
  border-color: rgba(255, 214, 10, 0.28);
}

.command-shell-session-ended,
.command-shell-session-fallback {
  color: var(--terminal-muted);
  background: rgba(255, 255, 255, 0.06);
}

.command-session-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--terminal-chip);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--terminal-text);
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.command-session-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

@keyframes command-status-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.command-output-content {
  height: 220px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
  padding: 14px;
  background: var(--terminal-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.command-output-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.command-output-content::-webkit-scrollbar-track {
  background: transparent;
}

.command-output-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.command-output-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.command-output-content pre {
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--terminal-text);
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.command-scroll-to-bottom {
  display: block;
  width: 100%;
  padding: 8px;
  background: var(--terminal-header-bottom);
  border: none;
  border-top: 1px solid var(--terminal-border);
  color: var(--terminal-running);
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s;
}

.command-scroll-to-bottom:hover {
  filter: brightness(1.08);
}

/* Command stdin input */
.command-stdin-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--terminal-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.command-stdin-prompt {
  color: var(--terminal-running);
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.command-stdin-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--terminal-text);
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 12px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.command-stdin-input:focus {
  border-color: var(--terminal-running);
  box-shadow: 0 0 0 2px rgba(100, 210, 255, 0.22);
}

.command-stdin-input::placeholder {
  color: var(--terminal-muted);
  opacity: 0.7;
}

.command-stdin-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(100, 210, 255, 0.2);
  border: 1px solid rgba(100, 210, 255, 0.35);
  border-radius: 8px;
  color: var(--terminal-running);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s,
    opacity 0.2s;
}

.command-stdin-send:hover:not(:disabled) {
  background: rgba(100, 210, 255, 0.3);
  color: #dff6ff;
}

.command-stdin-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Command output actions (stop button + status) */
.command-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  justify-self: end;
}

.command-output-actions > * {
  flex-shrink: 0;
}

@media (max-width: 1180px) {
  .command-output-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .command-output-actions {
    justify-self: stretch;
    justify-content: flex-start;
  }
}

.command-stop-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: rgba(255, 69, 58, 0.14);
  border: 1px solid rgba(255, 69, 58, 0.42);
  border-radius: 8px;
  color: #ff8f86;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.12s;
}

.command-stop-btn:hover {
  background: rgba(255, 69, 58, 0.28);
  color: #ffd6d3;
}

.command-stop-btn:active {
  transform: scale(0.95);
}

.command-stop-btn svg {
  flex-shrink: 0;
}

.command-stopping {
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  color: var(--terminal-warning);
  font-weight: 600;
  animation: command-stopping-pulse 1s infinite;
}

@keyframes command-stopping-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.command-force-kill-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: #b4241e;
  border: 1px solid #d7312a;
  border-radius: 8px;
  color: #fff;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.command-force-kill-btn:hover {
  background: #d7312a;
  border-color: #e13d35;
}

.command-force-kill-btn:active {
  transform: scale(0.95);
}

.command-force-kill-btn svg {
  flex-shrink: 0;
}

.command-close-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  background: var(--terminal-chip);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--terminal-muted);
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.command-close-btn:hover {
  background: rgba(255, 69, 58, 0.17);
  color: var(--terminal-error);
  border-color: rgba(255, 69, 58, 0.5);
}

/* Light theme macOS Terminal-like palette */
.theme-light .command-output-container {
  --terminal-bg: #eceef2;
  --terminal-surface: #eceef2;
  --terminal-header-top: #e3e5eb;
  --terminal-header-bottom: #d5d8e1;
  --terminal-border: #c2c7d2;
  --terminal-text: #1f2532;
  --terminal-muted: #535c6f;
  --terminal-chip: rgba(31, 37, 50, 0.08);
  --terminal-success: #208b45;
  --terminal-success-chip-bg: rgba(32, 139, 69, 0.14);
  --terminal-success-chip-border: rgba(32, 139, 69, 0.3);
  --terminal-warning: #9a7700;
  --terminal-error: #b93b34;
  --terminal-running: #0f6fae;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.theme-light .command-output-header {
  border-bottom-color: rgba(0, 0, 0, 0.14);
}

.theme-light .command-window-dot {
  border-color: rgba(0, 0, 0, 0.22);
}

.theme-light .command-prompt-glyph {
  color: #7455d9;
}

.theme-light .command-status {
  border-color: rgba(31, 37, 50, 0.14);
}

.theme-light .command-output-content {
  border-top-color: rgba(0, 0, 0, 0.06);
}

.theme-light .command-output-content::-webkit-scrollbar-thumb {
  background: rgba(31, 37, 50, 0.16);
}

.theme-light .command-output-content::-webkit-scrollbar-thumb:hover {
  background: rgba(31, 37, 50, 0.28);
}

.theme-light .command-stdin-container {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.theme-light .command-stdin-input {
  background: #fcfdff;
  border-color: #cdd3df;
}

.theme-light .command-stdin-input:focus {
  box-shadow: 0 0 0 2px rgba(15, 111, 174, 0.18);
}

.theme-light .command-close-btn {
  border-color: rgba(31, 37, 50, 0.16);
}

/* ============================================
   Canvas Preview Styles
   ============================================ */
.canvas-previews-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  /* Ensure preview stays in normal document flow */
  position: relative;
  z-index: 1;
  /* Prevent any overflow that could cause visual overlap */
  isolation: isolate;
}

.canvas-preview-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
  /* Ensure container stays in document flow */
  position: relative;
  z-index: 0;
}

.canvas-preview-container.minimized {
  max-height: 40px;
}

.canvas-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border-subtle);
  gap: 8px;
}

.canvas-browser-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--color-border-subtle);
}

.canvas-browser-input {
  flex: 1;
  min-width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 12px;
}

.canvas-browser-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-hover);
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-browser-btn:hover {
  border-color: var(--color-border);
}

.canvas-browser-btn.ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.canvas-preview-container.minimized .canvas-preview-header {
  border-bottom: none;
}

.canvas-preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
  min-width: 0;
  flex: 1;
}

.canvas-preview-title svg {
  flex-shrink: 0;
  color: var(--color-purple);
}

.canvas-title-text {
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.canvas-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.canvas-status.active {
  color: var(--color-success);
  background: var(--color-success-subtle);
  animation: pulse 1.5s ease-in-out infinite;
}

.canvas-status.paused {
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.2);
}

.canvas-status.closed {
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
}

.canvas-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-action-btn svg {
  display: block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.theme-light .canvas-action-btn svg {
  stroke: rgba(0, 0, 0, 0.6);
}

.canvas-action-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
  border-color: var(--color-border);
}

.canvas-action-btn.disabled,
.canvas-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
  border-color: transparent;
}

.canvas-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-close-btn svg {
  display: block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.theme-light .canvas-close-btn svg {
  stroke: rgba(0, 0, 0, 0.4);
}

.canvas-close-btn:hover {
  background: var(--color-error-subtle);
  color: var(--color-error);
  border-color: var(--color-error);
}

.canvas-preview-content {
  max-height: 2500px;
  background: rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.canvas-preview-loading,
.canvas-preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.canvas-preview-loading svg.spinner {
  animation: spin 1s linear infinite;
}

.canvas-preview-error svg {
  color: var(--color-error);
}

.canvas-preview-error span {
  color: var(--color-error);
}

.canvas-preview-image-wrapper {
  position: relative;
  width: 100%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  box-sizing: border-box;
}

.canvas-preview-image-wrapper:hover .canvas-preview-image {
  opacity: 0.9;
}

.canvas-preview-image {
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s ease;
}

.canvas-preview-dimensions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  font-size: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

.canvas-preview-updating {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
}

.canvas-preview-updating svg.spinner {
  animation: spin 1s linear infinite;
  color: var(--color-accent);
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Light theme canvas preview adjustments */
.theme-light .canvas-preview-container {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .canvas-preview-header {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .canvas-preview-content {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .canvas-preview-dimensions {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text-secondary);
}

.theme-light .canvas-preview-updating {
  background: rgba(255, 255, 255, 0.9);
}

.browser-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
}

.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-top: calc(var(--title-bar-height) + 10px);
  padding-left: 80px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: rgba(0, 0, 0, 0.2);
  -webkit-app-region: drag;
}

.browser-toolbar-btn,
.browser-url {
  -webkit-app-region: no-drag;
}

.browser-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.browser-toolbar-btn.primary {
  background: var(--color-accent);
  border-color: transparent;
  color: #0b0b0b;
}

.browser-toolbar-btn:hover {
  border-color: var(--color-border);
}

.browser-url {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.browser-url input {
  flex: 1;
  min-width: 200px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 12px;
}

.browser-surface {
  flex: 1;
  background: #111;
}

.browser-webview {
  width: 100%;
  height: 100%;
  border: 0;
}

.browser-empty {
  padding: 20px;
  color: var(--color-text-muted);
}

.browser-workbench {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
}

.browser-workbench-fullscreen {
  position: relative;
  width: 100%;
  height: 100vh;
  padding-top: var(--title-bar-height);
  overflow: hidden;
}

.browser-workbench-sidebar {
  padding-top: var(--title-bar-height);
  border-left: 1px solid var(--color-border-subtle);
}

.browser-workbench-header,
.browser-workbench-toolbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
}

.browser-workbench-header {
  justify-content: space-between;
  min-height: 44px;
  padding: 6px 14px;
}

.browser-workbench-fullscreen .browser-workbench-header {
  padding-left: max(14px, env(safe-area-inset-left));
}

.browser-workbench-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.browser-workbench-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.browser-workbench-tab-shell {
  max-width: min(360px, 42vw);
  min-width: 0;
  height: 26px;
  padding: 0 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: color-mix(in srgb, var(--color-accent) 72%, var(--color-text));
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
}

.browser-workbench-tab-shell.is-active {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: color-mix(in srgb, var(--color-accent) 82%, var(--color-text));
}

.browser-workbench-tab {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.browser-workbench-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-workbench-tab-close {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.browser-workbench-tab-close:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.browser-workbench-tab-close svg {
  display: block;
  width: 12px;
  height: 12px;
  color: currentColor;
  stroke: currentColor;
  flex: 0 0 12px;
  opacity: 1;
  pointer-events: none;
}

.browser-workbench-tab-add {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.browser-workbench-tab-add svg {
  display: block;
  width: 14px;
  height: 14px;
  color: currentColor;
  stroke: currentColor;
  flex: 0 0 14px;
  opacity: 1;
  pointer-events: none;
}

.browser-workbench-tab-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 9px solid currentColor;
  transform: rotate(-12deg);
  flex: 0 0 auto;
}

.browser-workbench-header-actions,
.browser-workbench-toolbar {
  display: flex;
  align-items: center;
}

.browser-workbench-toolbar {
  position: relative;
  min-height: 40px;
  padding: 4px 12px;
  justify-content: space-between;
}

.browser-workbench-nav-controls,
.browser-workbench-right-actions {
  width: 180px;
  flex: 0 0 180px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.browser-workbench-right-actions {
  width: 252px;
  flex-basis: 252px;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
}

.browser-workbench-toolbar-notice {
  max-width: 82px;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-workbench-youtube-ask {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-subtle);
  display: grid;
  gap: 8px;
  background: var(--color-bg);
}

.browser-workbench-youtube-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.browser-workbench-youtube-form input {
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-bg-input);
  color: var(--color-text);
  font-size: 12px;
  outline: none;
}

.browser-workbench-youtube-form input:focus {
  border-color: var(--color-accent);
}

.browser-workbench-youtube-submit,
.browser-workbench-youtube-secondary,
.browser-workbench-youtube-followups button {
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  cursor: pointer;
}

.browser-workbench-youtube-submit {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.browser-workbench-youtube-submit:disabled {
  cursor: default;
  opacity: 0.5;
}

.browser-workbench-youtube-status,
.browser-workbench-youtube-error {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.browser-workbench-youtube-error {
  color: var(--color-danger, #dc2626);
}

.browser-workbench-youtube-answer {
  display: grid;
  gap: 8px;
}

.browser-workbench-youtube-answer p {
  margin: 0;
  max-height: 132px;
  overflow: auto;
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.browser-workbench-youtube-secondary {
  justify-self: start;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.browser-workbench-youtube-sources {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.browser-workbench-youtube-source {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.browser-workbench-youtube-source:hover {
  border-color: var(--color-border);
}

.browser-workbench-youtube-source-time {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.browser-workbench-youtube-source-text {
  min-width: 0;
  color: var(--color-text-secondary);
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.browser-workbench-youtube-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.browser-workbench-youtube-followups button {
  max-width: 100%;
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.browser-workbench-profile {
  max-width: 72px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-workbench-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  position: relative;
}

.browser-workbench-icon-btn:hover {
  color: var(--color-text);
  border-color: var(--color-border);
}

.browser-workbench-icon-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  color: currentColor;
  stroke: currentColor;
  flex: 0 0 16px;
  pointer-events: none;
}

.browser-workbench-nav-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  position: relative;
}

.browser-workbench-nav-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-subtle);
}

.browser-workbench-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Symbol", "Apple Symbols", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  opacity: 1 !important;
  visibility: visible !important;
}

.browser-workbench-glyph-close {
  font-size: 22px;
  font-weight: 400;
}

.browser-workbench-nav-btn[data-symbol] .browser-workbench-glyph,
.browser-workbench-icon-btn[data-symbol] .browser-workbench-glyph {
  opacity: 0 !important;
}

.browser-workbench-nav-btn[data-symbol]::before,
.browser-workbench-icon-btn[data-symbol]::before {
  content: attr(data-symbol);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor !important;
  -webkit-text-fill-color: currentColor;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Symbol", "Apple Symbols", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
  z-index: 1;
}

.browser-workbench-icon-btn[data-symbol="×"]::before {
  font-size: 23px;
  font-weight: 400;
}

.browser-workbench-action-btn[data-symbol]::before {
  font-size: 17px;
}

.browser-workbench-action-btn {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.browser-workbench-action-btn:hover {
  border-color: var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
}

.browser-workbench-action-btn.is-active {
  background: color-mix(in srgb, var(--color-accent) 14%, var(--color-bg));
  color: color-mix(in srgb, var(--color-accent) 72%, var(--color-text));
}

.browser-workbench-action-btn svg {
  display: block;
  width: 17px;
  height: 17px;
  color: currentColor !important;
  stroke: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.browser-workbench-action-btn .browser-workbench-lucide-icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: currentColor !important;
  stroke: currentColor !important;
  fill: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none;
}

.browser-workbench-action-btn.is-active .browser-workbench-lucide-icon {
  color: currentColor !important;
}

.browser-workbench-url-form {
  flex: 1 1 420px;
  min-width: 0;
}

.browser-workbench-url-form input {
  width: 100%;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  text-align: center;
}

.browser-workbench-url-form input:focus {
  text-align: left;
  outline: 0;
  border-color: var(--color-border-subtle);
  background: var(--color-bg);
}

.browser-workbench-device-toolbar {
  min-width: 0;
  flex: 0 0 auto;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  background: var(--color-bg);
}

.browser-workbench-device-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.browser-workbench-device-btn:hover,
.browser-workbench-device-btn.is-active {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}

.browser-workbench-device-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  color: currentColor;
  stroke: currentColor;
}

.browser-workbench-device-size {
  max-width: 86px;
  padding: 0 3px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.browser-workbench-surface {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-start;
  overflow: auto;
  background: #fff;
}

.browser-workbench-webview {
  display: inline-flex;
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
}

.browser-workbench-webview-frame {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.browser-live-annotation-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  cursor: crosshair;
  touch-action: none;
}

.browser-live-annotation-box {
  position: absolute;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.18);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.86),
    0 8px 22px rgba(14, 116, 144, 0.18);
  pointer-events: none;
}

.browser-live-annotation-box.is-selected {
  border-color: #0284c7;
  background: rgba(14, 165, 233, 0.26);
}

.browser-live-annotation-pin {
  position: absolute;
  z-index: 14;
  width: 24px;
  height: 24px;
  border: 2px solid #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0284c7;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.32);
  cursor: default;
}

.browser-live-annotation-pin.status-addressing {
  background: #7c3aed;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.28);
}

.browser-live-annotation-inspector {
  position: absolute;
  z-index: 16;
  max-width: 170px;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid rgba(14, 165, 233, 0.45);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 11px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
  pointer-events: none;
}

.browser-live-annotation-inspector span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-live-annotation-composer {
  position: absolute;
  z-index: 17;
  width: 328px;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  cursor: default;
}

.browser-live-annotation-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.browser-live-annotation-meta code {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-live-annotation-composer textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.browser-live-annotation-composer textarea:focus {
  border-color: #38bdf8;
  outline: 2px solid rgba(14, 165, 233, 0.16);
}

.browser-live-annotation-error {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.35;
}

.browser-live-annotation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.browser-live-annotation-send {
  width: 36px;
  min-width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.browser-workbench-surface.has-controlled-viewport {
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.14) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.14) 75%),
    #f8fafc;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.browser-workbench-viewport-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 8;
  height: 24px;
  max-width: 122px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 920px) {
  .browser-workbench-device-toolbar {
    display: none;
  }

  .browser-workbench-profile {
    display: none;
  }

  .browser-workbench-nav-controls,
  .browser-workbench-right-actions {
    width: 170px;
    flex-basis: 170px;
  }
}

@media (max-width: 720px) {
  .browser-workbench-nav-controls,
  .browser-workbench-right-actions {
    width: auto;
    flex-basis: auto;
  }
}


.browser-workbench-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--color-text-muted);
  text-align: center;
}

.browser-workbench-newtab {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  overflow: auto;
  background: transparent;
}

.browser-workbench-newtab-mode {
  background:
    radial-gradient(circle at 18% 12%, rgba(99, 102, 241, 0.08), transparent 55%),
    radial-gradient(circle at 82% 88%, rgba(34, 211, 238, 0.07), transparent 60%),
    var(--color-bg-primary, #fff);
}

.browser-workbench-newtab-mode .browser-workbench-header,
.browser-workbench-newtab-mode .browser-workbench-toolbar {
  background: transparent;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border-subtle) 55%, transparent);
}

.browser-workbench-newtab-mode .browser-workbench-surface {
  background: transparent;
}

.browser-workbench-newtab-inner {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.browser-workbench-newtab-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
}

.browser-workbench-newtab-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.browser-workbench-newtab-title {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text, inherit);
}

.browser-workbench-newtab-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 540px;
}

.browser-workbench-newtab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.browser-workbench-newtab-footnote {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.browser-workbench-newtab-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass, rgba(255, 255, 255, 0.04));
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.browser-workbench-newtab-tile:hover {
  background: var(--color-bg-glass-hover, rgba(255, 255, 255, 0.08));
  border-color: var(--color-accent-subtle, rgba(34, 211, 238, 0.35));
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.browser-workbench-newtab-tile:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.browser-workbench-newtab-tile:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.browser-workbench-newtab-tile:disabled:hover {
  background: var(--color-bg-glass, rgba(255, 255, 255, 0.04));
  border-color: var(--color-border-subtle);
  transform: none;
  box-shadow: none;
}

.browser-workbench-newtab-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.browser-workbench-newtab-tile-icon svg {
  stroke: currentColor;
}

.browser-workbench-newtab-tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.browser-workbench-newtab-tile-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text, inherit);
}

.browser-workbench-newtab-tile-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-workbench-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 1;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease;
  will-change: transform;
}

.browser-workbench-cursor-pointer {
  display: block;
  width: 18px;
  height: 23px;
  transform: translate(-1px, -1px);
  background: #172033;
  clip-path: polygon(0 0, 0 20px, 6px 15px, 10px 23px, 14px 21px, 10px 13px, 18px 13px);
  filter:
    drop-shadow(0 1px 0 #fff)
    drop-shadow(0 2px 5px rgba(15, 23, 42, 0.24));
}

.browser-workbench-cursor-label {
  position: absolute;
  left: 17px;
  top: 18px;
  min-width: max-content;
  padding: 4px 7px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.2);
}

.browser-workbench-cursor.is-pulsing::after {
  content: "";
  position: absolute;
  left: -8px;
  top: -8px;
  width: 30px;
  height: 30px;
  border: 1.5px solid #2563eb;
  border-radius: 999px;
  animation: browser-workbench-cursor-pulse 620ms ease-out;
}

.browser-workbench-snapshot-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.browser-workbench-snapshot-box {
  position: absolute;
  border: 2px solid #2563eb;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.08);
}

.browser-workbench-snapshot-box span {
  position: absolute;
  left: -2px;
  top: -22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.browser-workbench-snapshot-box.box-primary {
  left: 9%;
  top: 16%;
  width: 28%;
  height: 12%;
}

.browser-workbench-snapshot-box.box-secondary {
  right: 12%;
  bottom: 22%;
  width: 24%;
  height: 10%;
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.08);
}

.browser-workbench-snapshot-box.box-secondary span {
  background: #0f766e;
}

.browser-workbench-diagnostics {
  flex: 0 0 148px;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  overflow: hidden;
}

.browser-workbench-diagnostics-tabs {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.browser-workbench-diagnostics-tabs button {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.browser-workbench-diagnostics-tabs button.is-active {
  background: var(--color-bg);
  color: var(--color-text);
}

.browser-workbench-diagnostics-body {
  min-width: 0;
  height: 114px;
  padding: 10px 12px;
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--color-text-muted);
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 12px;
}

.browser-workbench-diagnostics-body span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes browser-workbench-cursor-pulse {
  from {
    opacity: 0.78;
    transform: scale(0.42);
  }
  to {
    opacity: 0;
    transform: scale(1.28);
  }
}

.browser-workbench .is-spinning {
  animation: spin 1s linear infinite;
}

.browser-workbench-fullscreen .spreadsheet-viewer-fullscreen-controls {
  z-index: 5;
}

.browser-annotation-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.browser-annotation-panel {
  width: min(1120px, 100%);
  max-height: min(860px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  background: var(--color-bg);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.browser-annotation-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
}

.browser-annotation-title {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
}

.browser-annotation-subtitle {
  margin-top: 3px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.browser-annotation-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  background: var(--color-bg);
  color: #111827;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.browser-annotation-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  background: #f3f4f6;
}

.browser-annotation-canvas-wrap {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.18);
}

.browser-annotation-canvas-wrap img {
  display: block;
  max-width: min(100%, 1040px);
  max-height: 560px;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.browser-annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.browser-annotation-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--color-border-subtle);
  background: var(--color-bg-elevated);
}

.browser-annotation-footer textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
}

.browser-annotation-error {
  color: var(--color-error);
  font-size: 12px;
}

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

.browser-annotation-secondary,
.browser-annotation-primary {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.browser-annotation-secondary {
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  color: var(--color-text);
}

.browser-annotation-primary {
  border: 1px solid color-mix(in srgb, var(--color-accent) 60%, transparent);
  background: var(--color-accent);
  color: #fff;
}

.browser-annotation-secondary:disabled,
.browser-annotation-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Canvas preview quick wins - additional styles */
.canvas-preview-container:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.canvas-copy-feedback {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-success);
  padding: 2px 6px;
  background: var(--color-success-subtle);
  border-radius: 3px;
  animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }

  15% {
    opacity: 1;
    transform: translateY(0);
  }

  85% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.canvas-action-btn.paused {
  color: var(--color-warning);
  background: var(--color-warning-subtle);
}

.canvas-action-btn.paused:hover {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.2);
}

.canvas-error-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-error);
}

.canvas-error-details {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  max-width: 280px;
}

.canvas-retry-btn {
  margin-top: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-retry-btn:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-light);
}

.canvas-paused-indicator {
  color: var(--color-warning);
  font-weight: 500;
}

/* Light theme adjustments for new styles */
.theme-light .canvas-copy-feedback {
  background: var(--color-success-subtle);
}

.theme-light .canvas-retry-btn {
  background: var(--color-bg-secondary);
}

.theme-light .canvas-retry-btn:hover {
  background: var(--color-bg-tertiary);
}

.theme-light .canvas-action-btn {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--color-text-secondary);
}

.theme-light .canvas-action-btn:hover {
  background: rgba(255, 255, 255, 1);
  color: var(--color-text);
}

/* Canvas Preview - New Features */

/* Resizable preview with CSS variable */
.canvas-preview-container:not(.minimized) .canvas-preview-content {
  max-height: var(--preview-height, 500px);
}

.canvas-preview-container.resizing {
  user-select: none;
}

.canvas-resize-handle {
  height: 12px;
}

.canvas-resize-handle .app-resizable-divider-grip {
  padding: 6px 0;
}

/* Loading skeleton */
.canvas-preview-skeleton {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.skeleton-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--color-border-subtle);
}

.skeleton-title {
  width: 120px;
  height: 16px;
  background: linear-gradient(90deg,
      var(--color-bg-secondary) 25%,
      var(--color-bg-tertiary) 50%,
      var(--color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

.skeleton-btn {
  width: 24px;
  height: 24px;
  background: linear-gradient(90deg,
      var(--color-bg-secondary) 25%,
      var(--color-bg-tertiary) 50%,
      var(--color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-content {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.skeleton-image {
  width: 80%;
  height: 200px;
  background: linear-gradient(90deg,
      var(--color-bg-secondary) 25%,
      var(--color-bg-tertiary) 50%,
      var(--color-bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Refresh rate selector */
.canvas-refresh-rate-container {
  position: relative;
}

.canvas-action-btn .refresh-rate-label {
  font-size: 8px;
  font-weight: 600;
  margin-left: 2px;
}

.canvas-refresh-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}

.refresh-menu-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.refresh-menu-item:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.refresh-menu-item.active {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* Export menu */
.canvas-export-menu-container {
  position: relative;
}

.canvas-export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 100;
  overflow: hidden;
  min-width: 160px;
}

.export-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.export-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.theme-light .export-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.export-menu-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.export-menu-item:hover svg {
  opacity: 1;
}

/* Interactive mode webview wrapper */
.canvas-interactive-wrapper {
  position: relative;
  width: 100%;
  min-height: 400px;
  height: calc(var(--preview-height, 500px) - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-interactive-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  background: #ffffff;
  border-radius: var(--radius-sm);
  /* Ensure webview can scroll its content */
  overflow: auto;
}

.canvas-interactive-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  align-self: flex-end;
  max-width: calc(100% - 16px);
  margin: 8px 8px 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: #22c55e;
  text-align: right;
}

.canvas-interactive-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  line-height: 1.3;
}

/* Active state for toggle buttons */
.canvas-action-btn.active {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.canvas-action-btn.active:hover {
  background: rgba(var(--accent-rgb), 0.2);
}

/* Go live button */
.canvas-action-btn.go-live {
  width: auto;
  padding: 0 8px;
  gap: 4px;
  background: var(--color-error-subtle);
  color: var(--color-error);
  border-color: var(--color-error);
}

.canvas-action-btn.go-live span {
  font-size: 10px;
  font-weight: 600;
}

.canvas-action-btn.go-live:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* History status */
.canvas-status.history {
  color: var(--color-purple);
  background: var(--color-purple-subtle);
}

.canvas-history-time {
  color: var(--color-purple);
}

/* History panel */
.canvas-history-panel {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--color-border-subtle);
}

.canvas-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.canvas-history-live-btn {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-history-live-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.canvas-history-live-btn.active {
  background: var(--color-success-subtle);
  color: var(--color-success);
  border-color: var(--color-success);
}

.canvas-history-slider {
  margin-bottom: 8px;
}

.history-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-bg-secondary);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.history-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.history-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.history-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.canvas-history-thumbnails {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.history-thumbnail {
  flex-shrink: 0;
  width: 48px;
  height: 36px;
  padding: 0;
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.15s ease;
}

.history-thumbnail:hover {
  border-color: var(--color-border);
}

.history-thumbnail.active {
  border-color: var(--color-accent);
}

.history-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Console panel */
.canvas-console-panel {
  max-height: 150px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
}

.canvas-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--color-border-subtle);
}

.canvas-console-clear {
  padding: 2px 6px;
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.canvas-console-clear:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-secondary);
}

.canvas-console-logs {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.canvas-console-empty {
  padding: 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 11px;
}

.console-log {
  display: flex;
  gap: 8px;
  padding: 2px 12px;
  border-left: 2px solid transparent;
}

.console-log.console-log {
  border-color: var(--color-text-muted);
}

.console-log.console-info {
  border-color: var(--color-info);
  background: rgba(59, 130, 246, 0.05);
}

.console-log.console-warn {
  border-color: var(--color-warning);
  background: rgba(245, 158, 11, 0.05);
}

.console-log.console-error {
  border-color: var(--color-error);
  background: rgba(239, 68, 68, 0.05);
}

.console-time {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.console-message {
  color: var(--color-text-secondary);
  word-break: break-all;
}

.console-log.console-error .console-message {
  color: var(--color-error);
}

.console-log.console-warn .console-message {
  color: var(--color-warning);
}

/* Light theme adjustments for new features */
.theme-light .canvas-preview-skeleton {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .skeleton-header {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .canvas-history-panel {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .canvas-console-panel {
  background: rgba(0, 0, 0, 0.02);
}

.theme-light .canvas-console-header {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .canvas-refresh-menu {
  background: var(--color-bg);
}

.theme-light .canvas-export-menu {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Personality Settings
   ============================================ */

.personality-settings {
  max-width: 800px;
}

.personality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.personality-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.personality-card:hover {
  border-color: var(--color-border-active);
  background: var(--color-bg-hover);
}

.personality-card.selected {
  border-color: var(--color-accent);
  background: rgba(var(--color-accent-rgb), 0.1);
}

.personality-card-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.personality-card-content {
  flex: 1;
  min-width: 0;
}

.personality-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.personality-card-description {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.personality-card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.personality-trait {
  padding: 2px 8px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.personality-card.selected .personality-trait {
  background: rgba(var(--color-accent-rgb), 0.2);
  color: var(--color-accent);
}

.personality-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--color-accent);
}

.personality-preview {
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.personality-preview pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.settings-tip {
  background: rgba(var(--color-accent-rgb), 0.1);
  border: 1px solid rgba(var(--color-accent-rgb), 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
}

.settings-tip h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.command-examples {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
}

.command-examples li {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.command-examples code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-accent);
}

.settings-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text);
  resize: vertical;
}

.settings-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.settings-textarea::placeholder {
  color: var(--color-text-muted);
}

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

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

.agent-name-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.agent-name-input-row .settings-input {
  flex: 1;
  max-width: 300px;
}

.agent-name-input-row .button-primary {
  flex-shrink: 0;
}

/* Personality Navigation */
.personality-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.personality-nav-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.personality-nav-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.personality-nav-btn.active {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.profile-memory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-memory-header h3 {
  margin-bottom: 6px;
}

.profile-memory-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.profile-memory-empty {
  margin-bottom: 16px;
}

.profile-memory-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 18px;
}

.profile-memory-section h4 {
  margin: 0 0 10px;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 650;
}

.profile-memory-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-memory-fact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-memory-fact-body {
  min-width: 0;
}

.profile-memory-fact-body p {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.profile-memory-fact-body span {
  display: block;
  margin-top: 4px;
  color: var(--color-text-tertiary);
  font-size: 11px;
}

.profile-memory-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-memory-actions button,
.profile-memory-editing button {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 12px;
  padding: 5px 9px;
}

.profile-memory-actions button:hover,
.profile-memory-editing button:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.profile-memory-actions button.danger {
  color: var(--color-error, #ef4444);
}

.profile-memory-composer {
  position: sticky;
  bottom: 0;
  padding: 12px 0 2px;
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border);
}

.profile-memory-status {
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}

.profile-memory-status.success {
  background: var(--color-success-subtle, rgba(34, 197, 94, 0.12));
  color: var(--color-success, #16a34a);
}

.profile-memory-status.error {
  background: var(--color-error-subtle, rgba(239, 68, 68, 0.12));
  color: var(--color-error, #ef4444);
}

.profile-memory-editing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

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

.profile-memory-input-row .settings-input {
  min-height: 42px;
}

.profile-memory-input-row .button-primary {
  min-height: 42px;
  flex-shrink: 0;
}

.profile-memory-char-count {
  margin-top: 6px;
  text-align: right;
  color: var(--color-text-tertiary);
  font-size: 11px;
}

.profile-memory-char-count.at-limit {
  color: var(--color-warning, #f59e0b);
}

@media (max-width: 700px) {
  .profile-memory-header,
  .profile-memory-fact,
  .profile-memory-input-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .profile-memory-meta,
  .profile-memory-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }
}

/* Persona Grid */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.persona-card {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.persona-card:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.persona-card.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.persona-card-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.persona-card-content {
  flex: 1;
}

.persona-card-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--color-text);
}

.persona-card-description {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.persona-card-sample {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
}

.persona-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--color-accent);
}

/* Personality V2 - Preset quick start */
.preset-quick-start h4,
.trait-sliders h4,
.behavioral-rules h4,
.expertise-tags h4 {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.preset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.trait-sliders {
  margin-bottom: 20px;
}

.trait-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.trait-row label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.trait-row input[type="range"] {
  width: 100%;
  max-width: 300px;
}

.persona-overlay-collapse,
.quirks-collapse,
.persona-collapse {
  margin-top: 20px;
}

.persona-overlay-collapse summary,
.quirks-collapse summary,
.persona-collapse summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Behavioral rules */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.rule-type {
  font-weight: 600;
  color: var(--color-accent);
  min-width: 60px;
}

.rule-text {
  flex: 1;
  color: var(--color-text-secondary);
}

.rule-remove {
  margin-left: auto;
}

.add-rule-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.add-rule-row select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-input);
  color: var(--color-text);
  font-size: 12px;
}

.add-rule-row input {
  flex: 1;
  min-width: 180px;
}

/* Expertise tags */
.expertise-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.expertise-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-accent-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--color-accent);
}

.tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.add-expertise-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.add-expertise-row input {
  flex: 1;
  min-width: 120px;
}

/* SOUL editor & Advanced */
.soul-textarea {
  font-family: var(--font-mono);
  font-size: 12px;
}

.soul-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.soul-preview-block {
  padding: 12px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.soul-preview {
  margin: 0;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.preview-output {
  padding: 12px;
  background: var(--color-bg-darker);
  border-radius: var(--radius-md);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.import-export-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.personality-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: var(--color-accent);
  color: var(--color-bg-darker);
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.persona-preview {
  padding: 16px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.persona-preview h4 {
  margin-bottom: 8px;
  color: var(--color-accent);
}

.persona-suggestion {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.button-small {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-small:hover {
  background: var(--color-accent-subtle);
}

/* Style Controls */
.style-controls {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.style-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.style-control label {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text);
}

.style-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

.style-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.style-option {
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.style-option:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.style-option.selected {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Quirks Controls */
.quirks-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Analogy Grid */
.analogy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.analogy-option {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analogy-option:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.analogy-option.selected {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
}

.analogy-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text);
}

.analogy-example {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Relationship Stats */
.relationship-stats {
  margin-top: 24px;
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.relationship-stats h4 {
  margin-bottom: 16px;
  color: var(--color-accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.milestone-progress {
  margin-top: 16px;
}

.progress-bar {
  height: 8px;
  background: var(--color-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 8px;
  text-align: center;
}

/* Custom Personality Editor */
.custom-personality-editor {
  margin-top: 20px;
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.custom-personality-editor h4 {
  margin-bottom: 8px;
  color: var(--color-accent);
}

/* Light mode adjustments */
.theme-light .personality-card {
  background: rgba(255, 255, 255, 0.8);
}

.theme-light .personality-card:hover {
  background: rgba(255, 255, 255, 0.95);
}

.theme-light .personality-preview {
  background: rgba(255, 255, 255, 0.8);
}

.theme-light .settings-tip {
  background: rgba(var(--color-accent-rgb), 0.08);
}

/* ============================================
   Onboarding Modal
   ============================================ */

.onboarding-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-primary);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
}

.onboarding-container {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* Progress indicator */
.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.onboarding-progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
  transition: color 0.2s ease;
}

.onboarding-progress-step.active {
  color: var(--color-accent);
}

.onboarding-progress-step.completed {
  color: var(--color-success);
}

.onboarding-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-bg-tertiary);
  transition: background 0.2s ease;
}

.onboarding-progress-step.active .onboarding-progress-dot {
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

.onboarding-progress-step.completed .onboarding-progress-dot {
  background: var(--color-success);
}

.onboarding-progress-line {
  width: 60px;
  height: 2px;
  background: var(--color-border);
  border-radius: 1px;
}

/* Step content */
.onboarding-step {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-header {
  text-align: center;
  margin-bottom: 32px;
}

.onboarding-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.onboarding-header p {
  font-size: 15px;
  color: var(--color-text-secondary);
}

.onboarding-section {
  margin-bottom: 28px;
}

.onboarding-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Theme options */
.onboarding-theme-options {
  display: flex;
  gap: 12px;
}

.onboarding-theme-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-theme-option:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.onboarding-theme-option.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.onboarding-theme-preview {
  width: 80px;
  height: 56px;
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.onboarding-theme-preview.light {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.onboarding-theme-preview.dark {
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-theme-preview.system {
  background: linear-gradient(135deg, #f5f5f7 50%, #1e1e1e 50%);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.onboarding-theme-preview .preview-line {
  height: 6px;
  border-radius: 3px;
}

.onboarding-theme-preview.light .preview-line {
  background: rgba(0, 0, 0, 0.1);
}

.onboarding-theme-preview.light .preview-line:first-child {
  width: 60%;
}

.onboarding-theme-preview.light .preview-line:nth-child(2) {
  width: 80%;
}

.onboarding-theme-preview.light .preview-line:last-child {
  width: 40%;
}

.onboarding-theme-preview.dark .preview-line {
  background: rgba(255, 255, 255, 0.15);
}

.onboarding-theme-preview.dark .preview-line:first-child {
  width: 60%;
}

.onboarding-theme-preview.dark .preview-line:nth-child(2) {
  width: 80%;
}

.onboarding-theme-preview.dark .preview-line:last-child {
  width: 40%;
}

.onboarding-theme-option span {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.onboarding-theme-option.selected span {
  color: var(--color-accent);
  font-weight: 500;
}

/* Color grid */
.onboarding-color-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.onboarding-color-option {
  width: 44px;
  height: 44px;
  padding: 4px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-color-option:hover {
  border-color: var(--color-border);
  transform: scale(1.05);
}

.onboarding-color-option.selected {
  border-color: var(--color-text);
}

.onboarding-color-swatch {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
}

.onboarding-color-swatch.cyan {
  background: #22d3ee;
}

.onboarding-color-swatch.blue {
  background: #3b82f6;
}

.onboarding-color-swatch.purple {
  background: #a78bfa;
}

.onboarding-color-swatch.pink {
  background: #f472b6;
}

.onboarding-color-swatch.rose {
  background: #fb7185;
}

.onboarding-color-swatch.orange {
  background: #fb923c;
}

.onboarding-color-swatch.green {
  background: #34d399;
}

.onboarding-color-swatch.teal {
  background: #2dd4bf;
}

/* Provider grid */
.onboarding-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.onboarding-provider-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.onboarding-provider-card:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.onboarding-provider-card.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.onboarding-provider-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.onboarding-provider-card.selected .onboarding-provider-icon {
  background: var(--color-accent);
  color: white;
}

.onboarding-provider-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.onboarding-provider-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-free-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-success);
  background: var(--color-success-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.onboarding-provider-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.onboarding-check {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--color-accent);
}

/* API Key section */
.onboarding-apikey-section {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.onboarding-apikey-section label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.onboarding-link {
  font-size: 12px;
  color: var(--color-accent);
  text-decoration: none;
}

.onboarding-link:hover {
  text-decoration: underline;
}

.onboarding-apikey-row {
  display: flex;
  gap: 10px;
}

.onboarding-input {
  flex: 1;
  padding: 12px 14px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.onboarding-input:focus {
  border-color: var(--color-accent);
}

.onboarding-input::placeholder {
  color: var(--color-text-muted);
}

.onboarding-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 12px;
}

.onboarding-hint a {
  color: var(--color-accent);
  text-decoration: none;
}

.onboarding-hint a:hover {
  text-decoration: underline;
}

.onboarding-test-result {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.onboarding-test-result.success {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.onboarding-test-result.error {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

/* Actions */
.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.onboarding-btn-primary,
.onboarding-btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.onboarding-btn-primary {
  background: var(--color-accent);
  color: white;
}

.onboarding-btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.onboarding-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.onboarding-btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.onboarding-btn-secondary:hover:not(:disabled) {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.onboarding-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.onboarding-skip-hint {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 12px;
}

/* Channel grid */
.onboarding-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.onboarding-channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
}

.onboarding-channel-card:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.onboarding-channel-card.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.onboarding-channel-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.onboarding-channel-card.selected .onboarding-channel-icon {
  background: var(--color-accent);
  color: white;
}

.onboarding-channel-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.onboarding-channel-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.onboarding-channel-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.onboarding-setup-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: capitalize;
}

.onboarding-setup-badge.setup-easy {
  color: var(--color-success);
  background: var(--color-success-subtle);
}

.onboarding-setup-badge.setup-moderate {
  color: var(--color-warning);
  background: rgba(251, 191, 36, 0.2);
}

.onboarding-setup-badge.setup-advanced {
  color: var(--color-purple);
  background: rgba(167, 139, 250, 0.2);
}

.onboarding-channel-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.onboarding-channel-note svg {
  flex-shrink: 0;
  color: var(--color-info);
  margin-top: 1px;
}

.onboarding-channel-note strong {
  color: var(--color-text);
}

/* Don't show again checkbox */
.onboarding-dont-show-again {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.onboarding-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text);
}

.onboarding-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.onboarding-checkbox-hint {
  margin-top: 8px;
  margin-left: 28px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Light theme adjustments */
.theme-light .onboarding-modal {
  background: var(--color-bg-primary);
}

.theme-light .onboarding-container {
  background: rgba(255, 255, 255, 0.95);
}

.theme-light .onboarding-provider-card {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .onboarding-provider-card:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .onboarding-provider-card.selected {
  background: var(--color-accent-subtle);
}

.theme-light .onboarding-apikey-section {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .onboarding-theme-option {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .onboarding-theme-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .onboarding-theme-option.selected {
  background: var(--color-accent-subtle);
}

.theme-light .onboarding-channel-card {
  background: rgba(0, 0, 0, 0.03);
}

.theme-light .onboarding-channel-card:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .onboarding-channel-card.selected {
  background: var(--color-accent-subtle);
}

.theme-light .onboarding-channel-note {
  background: rgba(0, 0, 0, 0.03);
}

/* ============ Voice Settings Styles ============ */

.voice-settings {
  max-width: none;
  width: 100%;
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 12px;
  font-size: 13px;
}

.voice-status.active {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.voice-status.inactive {
  background: var(--color-muted);
  color: var(--color-text-secondary);
}

.voice-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s infinite;
}

.voice-status.inactive .status-dot {
  animation: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Provider Options */
.provider-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.provider-option {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.provider-option:hover {
  background: var(--color-bg-tertiary);
}

.provider-option.selected {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
}

.provider-option.configured {
  border-color: var(--color-border-light);
}

.provider-option.configured.selected {
  border-color: var(--color-accent);
}

.provider-option-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.provider-configured-icon {
  color: var(--color-success);
  flex-shrink: 0;
}

.provider-option.selected .provider-configured-icon {
  color: var(--color-accent);
}

.provider-option .provider-name {
  font-weight: 500;
  color: var(--color-text-primary);
}

.provider-option .provider-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-accent);
  color: white;
  text-transform: uppercase;
}

/* Voice Grid */
.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.voice-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.voice-option:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-border);
}

.voice-option.selected {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
}

.voice-option .voice-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text-primary);
}

.voice-option .voice-description {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Voice Indicator */
.voice-indicator {
  position: fixed;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.2s ease;
}

.voice-indicator.bottom-right {
  bottom: 20px;
  right: 20px;
}

.voice-indicator.bottom-left {
  bottom: 20px;
  left: 20px;
}

.voice-indicator.top-right {
  top: 20px;
  right: 20px;
}

.voice-indicator.top-left {
  top: 20px;
  left: 20px;
}

.voice-indicator:hover {
  transform: scale(1.05);
}

.voice-indicator.speaking {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.voice-indicator.listening {
  border-color: var(--color-success);
  background: var(--color-success-subtle);
}

.voice-indicator.processing {
  border-color: var(--color-warning);
}

.voice-indicator-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
}

.voice-indicator.speaking .voice-indicator-icon,
.voice-indicator.listening .voice-indicator-icon {
  color: var(--color-accent);
}

.voice-indicator-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  border: 2px solid var(--color-accent);
  animation: voice-pulse 1.5s infinite;
  pointer-events: none;
}

@keyframes voice-pulse {

  0%,
  100% {
    opacity: 0;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.1);
  }
}

.voice-indicator-transcript {
  max-width: 200px;
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini Voice Indicator */
.voice-indicator-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

.voice-indicator-mini:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.voice-indicator-mini.speaking,
.voice-indicator-mini.listening {
  color: var(--color-accent);
}

.voice-indicator-mini.processing {
  color: var(--color-warning);
}

/* Processing spin animation */
.processing-spin {
  animation: spin 1s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

/* Input with button */
.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button .settings-input {
  flex: 1;
}

/* Settings slider */
.settings-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--color-bg-tertiary);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.settings-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

/* Toggle switch (if not already defined) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg-tertiary);
  transition: 0.2s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--color-accent);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(20px);
}

/* Settings header row */
.settings-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.settings-header-row>div {
  flex: 1;
}

/* Button group */
.button-group {
  display: flex;
  gap: 8px;
}

/* Theme-light overrides for voice */
.theme-light .voice-status.active {
  background: var(--color-success-subtle);
}

.theme-light .voice-status.inactive {
  background: rgba(0, 0, 0, 0.05);
}

.theme-light .provider-option {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

.theme-light .provider-option:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.18);
}

.theme-light .provider-option.configured {
  border-color: rgba(0, 0, 0, 0.2);
}

.theme-light .provider-configured-icon {
  color: #22c55e;
}

.theme-light .voice-option {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

.theme-light .voice-option:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.18);
}

.theme-light .voice-indicator {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==================== MORE CHANNELS / INTEGRATIONS PANEL ==================== */
.more-channels-panel,
.integrations-panel,
.llm-provider-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.more-channels-header h2,
.integrations-header h2,
.llm-provider-header h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.more-channels-header .settings-description,
.integrations-header .settings-description,
.llm-provider-header .settings-description {
  margin: 0;
}

.more-channels-tabs,
.integrations-tabs,
.llm-provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.more-channels-tab,
.integrations-tab,
.llm-provider-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.more-channels-tab:hover,
.integrations-tab:hover,
.llm-provider-tab:hover {
  background: var(--color-bg-glass-hover);
  color: var(--color-text);
}

.more-channels-tab.active,
.integrations-tab.active,
.llm-provider-tab.active {
  background: var(--color-accent-subtle);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.more-channels-tab svg,
.integrations-tab svg,
.llm-provider-tab svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.more-channels-tab.active svg,
.integrations-tab.active svg,
.llm-provider-tab.active svg {
  opacity: 1;
  color: var(--color-accent);
}

.more-channels-tab span,
.integrations-tab span,
.llm-provider-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.llm-provider-tab-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  margin-left: 4px;
}

.more-channels-content,
.integrations-content,
.llm-provider-content {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-tertiary);
  padding: 20px;
}

/* Light theme overrides */
.theme-light .more-channels-tabs,
.theme-light .integrations-tabs,
.theme-light .llm-provider-tabs {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

.theme-light .more-channels-tab:hover,
.theme-light .integrations-tab:hover,
.theme-light .llm-provider-tab:hover {
  background: rgba(0, 0, 0, 0.06);
}

.theme-light .more-channels-tab.active,
.theme-light .integrations-tab.active,
.theme-light .llm-provider-tab.active {
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.theme-light .more-channels-content,
.theme-light .integrations-content,
.theme-light .llm-provider-content {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.12);
}

/* ==================== DISPATCH PANEL (devices-panel theme) ==================== */
.dispatch-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  gap: 0;
  animation: dp-fade-in 0.6s ease-out;
}

.dispatch-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.dispatch-loading {
  padding: 64px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--font-ui);
}

.dispatch-onboarding {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.dispatch-illustration {
  color: var(--color-text-muted);
  opacity: 0.9;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.dispatch-onboarding-title {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 10px;
}

.dispatch-onboarding-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0 0 28px;
}

.dispatch-feature-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.dispatch-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-bg-glass) 0%, var(--color-accent-subtle) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.dispatch-feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.dispatch-feature-icon {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.dispatch-feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
}

.dispatch-section-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

.dispatch-setup-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.dispatch-setup-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-bg-glass) 0%, var(--color-accent-subtle) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.dispatch-setup-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.dispatch-setup-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 10px 20px -10px color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-color: var(--color-accent-subtle);
  background: linear-gradient(135deg, var(--color-bg-glass-hover) 0%, color-mix(in srgb, var(--color-accent-subtle) 80%, white 20%) 100%);
}

.dispatch-setup-icon {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.dispatch-setup-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dispatch-setup-card-content strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-ui);
}

.dispatch-setup-card-content span {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
}

.dispatch-setup-badge {
  font-size: 18px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.dispatch-setup-badge.connected {
  color: var(--color-success);
  font-size: 12px;
}

.dispatch-get-started-btn {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
}

.dispatch-get-started-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), 0 4px 12px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.dispatch-disclaimer {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 24px 0 0;
  font-family: var(--font-ui);
}

.dispatch-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.dispatch-link:hover {
  color: var(--color-accent-hover);
}

.dispatch-connected {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.dispatch-info-card {
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, color-mix(in srgb, var(--color-bg-elevated) 80%, var(--color-accent-subtle)) 100%);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.dispatch-info-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
}

.dispatch-settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.dispatch-settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--color-bg-glass) 0%, var(--color-accent-subtle) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.dispatch-settings-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.dispatch-settings-item > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dispatch-settings-item strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-ui);
}

.dispatch-settings-item span {
  font-size: 13px;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
}

.dispatch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.dispatch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dispatch-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-input);
  border-radius: 999px;
  transition: background 0.2s;
}

.dispatch-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--color-text-primary);
  border-radius: 50%;
  transition: transform 0.2s;
}

.dispatch-toggle input:checked + .dispatch-toggle-slider {
  background: var(--color-accent);
}

.dispatch-toggle input:checked + .dispatch-toggle-slider::before {
  transform: translateX(20px);
}


/* ==================== HEALTH DASHBOARD (devices-panel theme) ==================== */
.health-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  gap: 0;
  animation: dp-fade-in 0.6s ease-out;
}

.health-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.health-panel.compact {
  padding: 24px 32px;
}

/* Hero box (dp-input-box style) */
.health-hero-box {
  margin-bottom: 0;
}

.health-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.health-hero-title {
  margin: 0 0 10px;
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.health-hero-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.health-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.health-hero-actions .dp-primary-btn,
.health-hero-actions .dp-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.health-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.health-stat-cell {
  padding: 14px 16px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.health-stat-label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-stat-cell strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.health-summary-note {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* Banners */
.health-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-family: var(--font-ui);
}

.health-banner span {
  color: var(--color-text-secondary);
}

.health-banner-info {
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-border);
}

.health-banner-error {
  background: var(--color-error-subtle);
  border: 1px solid var(--color-error);
}

.health-banner-error span {
  color: var(--color-error);
}

/* Section desc (muted text in dp-section-header) */
.health-section-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* Metric / source / workflow cards (extend dp-task-card) */
.health-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.health-metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: auto;
}

.health-metric-label {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-metric-card strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
}

.health-metric-card small {
  font-size: 11px;
  color: var(--color-text-muted);
}

.health-trend {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.health-trend.up,
.health-pill.success {
  background: var(--color-success-subtle);
  color: var(--color-success);
}

.health-trend.down,
.health-pill.error {
  background: var(--color-error-subtle);
  color: var(--color-error);
}

.health-trend.stable,
.health-pill.connected,
.health-pill.info {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.health-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: capitalize;
}

.health-pill.accent {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.health-pill.syncing,
.health-pill.needs-auth,
.health-pill.disabled {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-warning);
}

.health-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.health-source-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: auto;
  text-align: left;
}

.health-source-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.health-source-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.health-source-status-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.health-source-status-label.online {
  color: var(--color-accent);
}

.health-source-status-label.off {
  color: var(--color-text-muted);
}

.health-source-status-label.syncing {
  color: var(--color-warning);
}

.health-source-top h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.health-source-top p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.health-source-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.health-workflow-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  min-height: auto;
  cursor: pointer;
}

.health-workflow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  flex-shrink: 0;
}

.health-workflow-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-workflow-copy strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.health-workflow-copy span {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.health-workflow-go {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
}

.health-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
}

.health-columns .dp-section {
  margin-top: 32px;
}

.health-columns .dp-section:first-child {
  padding-right: 16px;
}

.health-columns .dp-section:last-child {
  padding-left: 16px;
  border-left: 1px solid var(--color-border-subtle);
}

.health-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-list-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: auto;
  text-align: left;
}

.health-list-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.health-list-item p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.health-list-item small {
  white-space: nowrap;
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-empty-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.health-workflow-preview {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: auto;
  text-align: left;
}

.health-workflow-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.health-workflow-preview h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.health-workflow-preview p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.health-workflow-time {
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-workflow-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.health-workflow-section {
  padding: 14px 16px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.health-workflow-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.health-workflow-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.health-workflow-section li {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.health-workflow-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.health-workflow-footer span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-source-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.health-source-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.health-source-details span,
.health-source-history,
.health-source-note {
  font-size: 12px;
  color: var(--color-text-muted);
}

.health-source-history,
.health-source-note {
  margin: 10px 0 0;
}

.health-writeback-preview {
  display: grid;
  gap: 14px;
}

.health-writeback-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-writeback-summary p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.health-writeback-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.health-writeback-items li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.health-writeback-items strong {
  font-size: 13px;
  color: var(--color-text);
}

.health-writeback-items span {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.health-writeback-warnings {
  display: grid;
  gap: 8px;
}

.health-footer-note {
  text-align: center;
}

.health-footer-note p {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Modal */
.health-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.health-modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
}

.health-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}

.health-modal-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.health-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.health-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.health-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.health-form-grid .span-2 {
  grid-column: span 2;
}

.health-form-grid input,
.health-form-grid textarea,
.health-form-grid select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-input);
  color: var(--color-text);
  font: inherit;
  font-family: var(--font-ui);
}

.health-form-grid input:focus,
.health-form-grid textarea:focus,
.health-form-grid select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.health-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.health-form-grid input:focus,
.health-form-grid textarea:focus,
.health-form-grid select:focus {
  outline: 2px solid rgba(96, 165, 250, 0.42);
  border-color: rgba(96, 165, 250, 0.4);
}

.health-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

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

@keyframes health-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   Cinematic Onboarding
   ============================================ */

/* Warm color palette variables */
.cinematic-onboarding {
  --onboarding-coral: #ff6b6b;
  --onboarding-coral-light: #ff8787;
  --onboarding-coral-dark: #e85555;
  --onboarding-peach: #ffb088;
  --onboarding-warm-white: #fff8f5;
  --onboarding-warm-gray: #2d2a28;
  --onboarding-warm-dark: #1a1817;
  --onboarding-glow: rgba(255, 107, 107, 0.3);
  --onboarding-glow-strong: rgba(255, 107, 107, 0.5);
}

/* Main container */
.cinematic-onboarding {
  position: fixed;
  inset: 0;
  background: var(--onboarding-warm-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 10001;
  transition: opacity 0.8s ease-out;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 16px 36px;
}

.cinematic-onboarding.transitioning {
  opacity: 0;
  pointer-events: none;
}

.onboarding-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vh, 40px);
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  padding: calc(env(safe-area-inset-top, 0px) + 86px) 0 28px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.onboarding-content.onboarding-content-compact {
  gap: 18px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 38px);
  max-width: 880px;
}

.cinematic-onboarding.onboarding-state-final_try .onboarding-orb-container {
  width: 96px;
  height: 96px;
}

.cinematic-onboarding.onboarding-state-final_try .onboarding-orb {
  width: 72px;
  height: 72px;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-orb-container {
  display: none;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-content {
  min-height: 100dvh;
  max-width: 860px;
  justify-content: center;
  gap: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  padding-bottom: 40px;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-typewriter,
.cinematic-onboarding.onboarding-state-final_try .onboarding-typewriter {
  font-size: 1.2rem;
  min-height: 0;
}

.onboarding-back-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 248, 245, 0.34);
  background: rgba(255, 248, 245, 0.08);
  color: rgba(255, 248, 245, 0.92);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.onboarding-back-btn:hover {
  border-color: rgba(255, 248, 245, 0.48);
  color: var(--onboarding-warm-white);
  background: rgba(255, 248, 245, 0.09);
}

.onboarding-top-right-controls {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
}

.onboarding-control-btn-wrap {
  position: relative;
}

.onboarding-control-once-hint {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: rgba(255, 248, 245, 0.72);
  white-space: nowrap;
  animation: onboarding-fade-in 0.35s ease;
}

.onboarding-theme-btn,
.onboarding-music-btn,
.onboarding-skip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 248, 245, 0.34);
  background: rgba(255, 248, 245, 0.08);
  color: rgba(255, 248, 245, 0.92);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
}

.onboarding-theme-btn,
.onboarding-music-btn {
  width: 44px;
  height: 44px;
  padding: 0;
}

.onboarding-skip-btn {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.onboarding-theme-btn:hover,
.onboarding-music-btn:hover,
.onboarding-skip-btn:hover {
  border-color: rgba(255, 248, 245, 0.48);
  color: var(--onboarding-warm-white);
  background: rgba(255, 248, 245, 0.09);
}

.onboarding-music-btn.active {
  border-color: rgba(255, 107, 107, 0.5);
  color: var(--onboarding-warm-white);
}

@media (max-width: 760px) {
  .onboarding-back-btn {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: 12px;
  }

  .onboarding-top-right-controls {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    right: 12px;
    gap: 6px;
  }

  .onboarding-skip-btn {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

  .onboarding-control-once-hint {
    top: 48px;
    font-size: 0.64rem;
  }

  .onboarding-memory-trust,
  .onboarding-recap,
  .onboarding-final-try {
    padding: 14px;
    border-radius: 14px;
  }

  .onboarding-final-try-input-row {
    gap: 8px;
  }

  .onboarding-final-try-voice-btn {
    width: 40px;
    height: 40px;
  }
}

/* Awakening orb animations */
@keyframes onboarding-awakening {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes onboarding-orb-breathe {
  0%,
  100% {
    transform: scale(0.96);
    filter: brightness(0.98);
  }

  50% {
    transform: scale(1.04);
    filter: brightness(1.06);
  }
}

@keyframes onboarding-orb-listening {
  0%,
  100% {
    filter: brightness(0.98);
  }

  50% {
    filter: brightness(1.08);
  }
}

@keyframes onboarding-fadeout {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Orb container */
.onboarding-orb-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}

/* The orb itself */
.onboarding-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--onboarding-peach), var(--onboarding-coral));
  animation: none;
  position: relative;
  z-index: 2;
  box-shadow: none;
}

.onboarding-orb.awakening {
  animation: onboarding-awakening 1s ease-out forwards;
}

.onboarding-orb.breathing {
  animation: onboarding-orb-breathe 3.2s ease-in-out infinite;
}

.onboarding-orb.listening {
  animation: onboarding-orb-listening 1.8s ease-in-out infinite;
}

.onboarding-orb.transitioning {
  animation: onboarding-fadeout 0.8s ease-out forwards;
}

/* Voice waveform ripples */
@keyframes onboarding-ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

.onboarding-waveform {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.onboarding-waveform-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--onboarding-coral);
  opacity: 0;
}

.onboarding-waveform.active .onboarding-waveform-ring {
  animation: onboarding-ripple 2s ease-out infinite;
}

.onboarding-waveform.active .onboarding-waveform-ring:nth-child(2) {
  animation-delay: 0.5s;
}

.onboarding-waveform.active .onboarding-waveform-ring:nth-child(3) {
  animation-delay: 1s;
}

/* Typewriter text */
@keyframes onboarding-cursor-blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.onboarding-typewriter {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--onboarding-warm-white);
  text-align: center;
  min-height: 2.4em;
}

.onboarding-typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--onboarding-coral);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: onboarding-cursor-blink 1s step-end infinite;
}

.onboarding-typewriter-cursor.hidden {
  opacity: 0;
}

/* Capability positioning strip */
.onboarding-capability-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin-top: -14px;
  animation: onboarding-fade-in 0.45s ease;
}

.onboarding-capability-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 245, 0.45);
}

.onboarding-capability-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.onboarding-capability-pill {
  font-size: 0.78rem;
  line-height: 1;
  color: rgba(255, 248, 245, 0.82);
  border: 1px solid rgba(255, 248, 245, 0.2);
  background: rgba(255, 248, 245, 0.04);
  border-radius: 999px;
  padding: 8px 12px;
}

.onboarding-intro-continue {
  margin-top: 14px;
}

/* Input area */
.onboarding-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.onboarding-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 107, 107, 0.4);
  color: var(--onboarding-warm-white);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 300;
  text-align: center;
  padding: 12px 16px;
  width: 100%;
  outline: none;
  transition: border-color 0.3s ease;
}

.onboarding-input::placeholder {
  color: rgba(255, 248, 245, 0.4);
}

.onboarding-input:focus {
  border-bottom-color: var(--onboarding-coral);
}

/* Voice input button */
.onboarding-voice-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.15);
  border: 2px solid var(--onboarding-coral);
  color: var(--onboarding-coral);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.onboarding-voice-btn:hover {
  background: rgba(255, 107, 107, 0.25);
  transform: scale(1.05);
}

.onboarding-voice-btn.recording {
  background: var(--onboarding-coral);
  color: var(--onboarding-warm-dark);
}

.onboarding-voice-btn.processing {
  opacity: 0.6;
  cursor: wait;
}

.onboarding-voice-btn svg {
  width: 28px;
  height: 28px;
}

/* Mode toggle */
.onboarding-mode-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 248, 245, 0.5);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.3s ease;
}

.onboarding-mode-toggle:hover {
  color: var(--onboarding-warm-white);
}

.onboarding-voice-error {
  margin-top: 12px;
  max-width: 420px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.35;
  color: rgba(255, 107, 107, 0.9);
}

.onboarding-voice-help {
  margin-top: 8px;
  max-width: 460px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255, 248, 245, 0.66);
}

.onboarding-voice-help p+p {
  margin-top: 4px;
}

.onboarding-voice-fix-btn {
  margin-top: 10px;
}

/* Provider selection (conversational setup) */
.onboarding-setup-section {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  width: 100%;
}

.onboarding-setup-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-provider-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-top: 24px;
}

.onboarding-ai-primary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 720px;
  margin-top: 24px;
}

.onboarding-ai-primary-card {
  min-height: 118px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 248, 245, 0.18);
  background: rgba(255, 248, 245, 0.08);
  color: var(--onboarding-warm-white);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.onboarding-ai-primary-card:hover:not(:disabled) {
  border-color: var(--onboarding-coral);
  background: rgba(255, 107, 107, 0.16);
  transform: translateY(-1px);
}

.onboarding-ai-primary-card:disabled {
  opacity: 0.72;
  cursor: wait;
}

.onboarding-ai-primary-card.muted {
  background: rgba(255, 248, 245, 0.04);
}

.onboarding-ai-primary-card.muted:disabled {
  cursor: default;
}

.onboarding-ai-primary-title {
  font-size: 1rem;
  font-weight: 700;
}

.onboarding-ai-primary-copy {
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(255, 248, 245, 0.68);
}

.onboarding-provider-heading {
  width: 100%;
  max-width: 720px;
  margin-top: 22px;
  color: rgba(255, 248, 245, 0.66);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-provider-pill {
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: var(--onboarding-warm-white);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: inline-flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.onboarding-provider-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onboarding-provider-pill:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: var(--onboarding-coral);
}

.onboarding-provider-pill.selected {
  background: var(--onboarding-coral);
  border-color: var(--onboarding-coral);
  color: var(--onboarding-warm-dark);
}

.onboarding-provider-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(72, 199, 142, 0.2);
  color: #48c78e;
  vertical-align: middle;
}

.onboarding-provider-pill.selected .onboarding-provider-badge {
  background: rgba(255, 255, 255, 0.25);
  color: var(--onboarding-warm-dark);
}

/* API Key input in conversational style */
.onboarding-api-input-section {
  margin-top: 24px;
  width: 100%;
  max-width: 400px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.onboarding-api-input-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-api-hint {
  font-size: 0.85rem;
  color: rgba(255, 248, 245, 0.5);
  text-align: center;
  margin-bottom: 12px;
}

.onboarding-api-hint a {
  color: var(--onboarding-coral-light);
  text-decoration: none;
}

.onboarding-api-hint a:hover {
  text-decoration: underline;
}

/* Continue/Skip buttons */
.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.onboarding-btn {
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
}

.onboarding-btn-primary {
  background: var(--onboarding-coral);
  border: none;
  color: var(--onboarding-warm-dark);
}

.onboarding-btn-primary:hover {
  background: var(--onboarding-coral-light);
  transform: translateY(-2px);
}

.onboarding-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.onboarding-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 248, 245, 0.3);
  color: rgba(255, 248, 245, 0.7);
}

.onboarding-btn-secondary:hover {
  border-color: rgba(255, 248, 245, 0.5);
  color: var(--onboarding-warm-white);
}

.onboarding-btn-sm {
  padding: 8px 20px;
  font-size: 0.875rem;
}

.onboarding-step-panel {
  width: 100%;
  max-width: 720px;
  border: 1px solid rgba(255, 248, 245, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 248, 245, 0.06), rgba(255, 248, 245, 0.03)),
    rgba(255, 248, 245, 0.04);
  border-radius: 22px;
  padding: 20px;
  animation: onboarding-fade-in 0.45s ease;
  box-shadow: 0 20px 48px rgba(10, 8, 8, 0.16);
}

.onboarding-form-panel {
  max-width: 640px;
}

.onboarding-form-group+.onboarding-form-group {
  margin-top: 18px;
}

.onboarding-form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 245, 0.56);
}

.onboarding-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(255, 248, 245, 0.18);
  background: rgba(22, 17, 17, 0.36);
  color: var(--onboarding-warm-white);
  padding: 14px 16px;
  font-size: 0.98rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.onboarding-textarea::placeholder {
  color: rgba(255, 248, 245, 0.36);
}

.onboarding-textarea:focus {
  outline: none;
  border-color: rgba(255, 107, 107, 0.56);
  background: rgba(22, 17, 17, 0.48);
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.22);
}

.onboarding-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.onboarding-selection-card {
  width: 100%;
  min-height: 138px;
  border-radius: 18px;
  border: 1px solid rgba(255, 248, 245, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 248, 245, 0.07), rgba(255, 248, 245, 0.02)),
    rgba(255, 248, 245, 0.03);
  padding: 16px 17px;
  color: var(--onboarding-warm-white);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.onboarding-selection-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 107, 0.36);
  background:
    linear-gradient(145deg, rgba(255, 248, 245, 0.09), rgba(255, 248, 245, 0.03)),
    rgba(255, 248, 245, 0.05);
}

.onboarding-selection-card.selected {
  border-color: rgba(255, 107, 107, 0.58);
  background:
    linear-gradient(145deg, rgba(255, 107, 107, 0.18), rgba(255, 248, 245, 0.04)),
    rgba(255, 248, 245, 0.05);
  box-shadow: 0 18px 36px rgba(255, 107, 107, 0.14);
}

.onboarding-selection-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.onboarding-selection-card-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
}

.onboarding-selection-card-check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 245, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--onboarding-coral-light);
  font-size: 0.86rem;
  flex-shrink: 0;
}

.onboarding-selection-card.selected .onboarding-selection-card-check {
  border-color: rgba(255, 107, 107, 0.56);
  background: rgba(255, 107, 107, 0.14);
  color: #fff6f2;
}

.onboarding-selection-card-desc {
  display: block;
  margin-top: 12px;
  color: rgba(255, 248, 245, 0.64);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.onboarding-memory-trust {
  width: 100%;
  max-width: 560px;
  border: 1px solid rgba(255, 248, 245, 0.16);
  background: rgba(255, 248, 245, 0.04);
  border-radius: 18px;
  padding: 18px 20px;
  animation: onboarding-fade-in 0.45s ease;
}

.onboarding-memory-trust-copy {
  font-size: 0.98rem;
  color: var(--onboarding-warm-white);
  text-align: left;
}

.onboarding-memory-trust-list {
  margin: 10px 0 14px;
  padding-left: 18px;
  color: rgba(255, 248, 245, 0.75);
  font-size: 0.88rem;
  line-height: 1.45;
}

.onboarding-memory-trust-list li+li {
  margin-top: 6px;
}

.onboarding-memory-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 248, 245, 0.24);
  background: rgba(255, 248, 245, 0.05);
  color: rgba(255, 248, 245, 0.82);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-memory-toggle:hover {
  border-color: rgba(255, 248, 245, 0.34);
}

.onboarding-memory-toggle.enabled {
  border-color: rgba(255, 107, 107, 0.5);
}

.onboarding-memory-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 248, 245, 0.22);
  position: relative;
  transition: background 0.2s ease;
}

.onboarding-memory-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 248, 245, 0.9);
  transition: transform 0.2s ease;
}

.onboarding-memory-toggle.enabled .onboarding-memory-toggle-track {
  background: rgba(255, 107, 107, 0.72);
}

.onboarding-memory-toggle.enabled .onboarding-memory-toggle-knob {
  transform: translateX(16px);
}

.onboarding-memory-toggle-label {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

/* Ollama auto-detection card */
.onboarding-ollama-detection {
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(255, 248, 245, 0.16);
  background: rgba(255, 248, 245, 0.04);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  animation: onboarding-fade-in 0.45s ease;
}

.onboarding-ollama-detection-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--onboarding-coral);
}

.onboarding-ollama-detection-model {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--onboarding-warm-white);
  margin: 0 0 4px;
}

.onboarding-ollama-detection-note {
  font-size: 0.88rem;
  color: rgba(255, 248, 245, 0.6);
  margin: 0;
}

.onboarding-recap {
  width: 100%;
  max-width: 760px;
  border: 1px solid rgba(255, 248, 245, 0.14);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 176, 136, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 248, 245, 0.07), rgba(255, 248, 245, 0.035)),
    rgba(255, 248, 245, 0.035);
  border-radius: 24px;
  padding: clamp(20px, 3.4vw, 34px);
  animation: onboarding-fade-in 0.45s ease;
  box-shadow:
    0 26px 70px rgba(10, 8, 8, 0.22),
    inset 0 1px 0 rgba(255, 248, 245, 0.08);
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap {
  max-width: 780px;
  height: min(760px, calc(100dvh - 132px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cinematic-onboarding.onboarding-state-recap {
  overflow: hidden;
}

.onboarding-recap-hero {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 248, 245, 0.11);
}

.onboarding-recap-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -8px;
  padding: 0 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 107, 107, 0.48) transparent;
}

.onboarding-recap-scroll:focus {
  outline: none;
}

.onboarding-recap-scroll::-webkit-scrollbar {
  width: 8px;
}

.onboarding-recap-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.onboarding-recap-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.34);
}

.onboarding-recap-header {
  text-align: left;
  margin: 0;
}

.onboarding-recap-eyebrow,
.onboarding-recap-row-label {
  display: block;
  color: rgba(255, 248, 245, 0.48);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-recap-header h2 {
  margin: 8px 0 6px;
  color: var(--onboarding-warm-white);
  font-size: clamp(1.35rem, 2.2vw, 1.82rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.08;
}

.onboarding-recap-header p,
.onboarding-recap-optional p {
  margin: 0;
  color: rgba(255, 248, 245, 0.62);
  font-size: 0.88rem;
  line-height: 1.45;
}

.onboarding-recap-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 248, 245, 0.16);
  border-radius: 999px;
  background: rgba(255, 248, 245, 0.055);
  color: rgba(255, 248, 245, 0.84);
  font-size: 0.82rem;
  white-space: nowrap;
}

.onboarding-recap-provider-badge span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--onboarding-coral);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.14);
}

.onboarding-recap-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.onboarding-recap-status-item {
  min-width: 0;
  border: 1px solid rgba(255, 248, 245, 0.11);
  border-radius: 16px;
  padding: 12px 13px;
  background:
    linear-gradient(145deg, rgba(255, 248, 245, 0.08), rgba(255, 248, 245, 0.025)),
    rgba(255, 248, 245, 0.035);
}

.onboarding-recap-status-item span {
  display: block;
  color: rgba(255, 248, 245, 0.48);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-recap-status-item strong {
  display: block;
  margin-top: 4px;
  color: rgba(255, 248, 245, 0.9);
  font-size: 0.96rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-recap-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.onboarding-recap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.onboarding-recap-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 16px;
}

.onboarding-recap-card {
  min-width: 0;
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(255, 248, 245, 0.12);
  border-radius: 18px;
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(255, 248, 245, 0.07), rgba(255, 248, 245, 0.025)),
    rgba(255, 248, 245, 0.035);
}

.onboarding-recap-card-featured {
  border-color: rgba(255, 107, 107, 0.24);
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 107, 107, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(255, 248, 245, 0.08), rgba(255, 248, 245, 0.025)),
    rgba(255, 248, 245, 0.04);
}

.onboarding-recap-card-copy {
  min-width: 0;
  text-align: left;
}

.onboarding-recap-card-copy strong {
  display: block;
  margin-top: 6px;
  color: rgba(255, 248, 245, 0.94);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-recap-card-copy p {
  margin: 8px 0 0;
  color: rgba(255, 248, 245, 0.64);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.onboarding-recap-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 248, 245, 0.12);
  background: rgba(255, 248, 245, 0.04);
  border-radius: 12px;
  padding: 10px 12px;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-item {
  gap: 8px;
  padding: 8px 10px;
}

.onboarding-recap-item-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.onboarding-recap-table {
  border-top: 1px solid rgba(255, 248, 245, 0.12);
}

.onboarding-recap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 248, 245, 0.12);
}

.onboarding-recap-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(112px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  text-align: left;
}

.onboarding-recap-row-main strong {
  min-width: 0;
  color: rgba(255, 248, 245, 0.92);
  font-size: 0.95rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-recap-row-main > span:last-child {
  min-width: 0;
  color: rgba(255, 248, 245, 0.62);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.onboarding-recap-optional {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed rgba(255, 248, 245, 0.16);
  border-radius: 18px;
  background: rgba(255, 248, 245, 0.025);
}

.onboarding-recap-item-label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 248, 245, 0.5);
}

.onboarding-recap-item-value {
  display: block;
  margin-top: 1px;
  color: rgba(255, 248, 245, 0.88);
  font-size: 0.9rem;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-item-value {
  font-size: 0.84rem;
}

.onboarding-recap-item-note {
  display: block;
  margin-top: 3px;
  color: rgba(255, 248, 245, 0.58);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-item-note {
  font-size: 0.72rem;
  line-height: 1.35;
}

.onboarding-recap-edit-btn {
  border: 1px solid rgba(255, 248, 245, 0.2);
  background: rgba(255, 248, 245, 0.035);
  color: rgba(255, 248, 245, 0.84);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-edit-btn {
  padding: 7px 11px;
  font-size: 0.78rem;
}

.onboarding-recap-edit-btn:hover {
  border-color: rgba(255, 107, 107, 0.44);
  background: rgba(255, 107, 107, 0.08);
  color: rgba(255, 248, 245, 0.96);
}

.onboarding-recap-edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.onboarding-recap-optional .onboarding-recap-edit-actions {
  max-width: 310px;
}

.onboarding-recap-inline-edit {
  margin-top: 8px;
}

.onboarding-recap-inline-input {
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.onboarding-recap-inline-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.onboarding-recap-inline-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 245, 0.26);
  background: transparent;
  color: rgba(255, 248, 245, 0.82);
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-recap-inline-btn.primary {
  border-color: rgba(255, 107, 107, 0.56);
  color: var(--onboarding-coral-light);
}

.onboarding-recap-inline-btn:hover {
  border-color: rgba(255, 248, 245, 0.44);
  color: rgba(255, 248, 245, 0.96);
}

.onboarding-recap-choice-group {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-recap-choice-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 248, 245, 0.24);
  background: transparent;
  color: rgba(255, 248, 245, 0.8);
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-recap-choice-btn:hover {
  border-color: rgba(255, 248, 245, 0.42);
  color: rgba(255, 248, 245, 0.96);
}

.onboarding-recap-choice-btn.active {
  border-color: rgba(255, 107, 107, 0.56);
  color: var(--onboarding-coral-light);
  background: rgba(255, 107, 107, 0.1);
}

.onboarding-recap-actions {
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 248, 245, 0.11);
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-actions {
  margin-top: 16px;
}

.cinematic-onboarding.onboarding-state-recap .onboarding-recap-actions .onboarding-btn {
  min-width: 168px;
  padding: 12px 30px;
  font-size: 0.98rem;
}

.onboarding-final-try {
  width: 100%;
  max-width: 620px;
  border: 1px solid rgba(255, 248, 245, 0.16);
  background: rgba(255, 248, 245, 0.04);
  border-radius: 18px;
  padding: 18px 20px;
  animation: onboarding-fade-in 0.45s ease;
}

.onboarding-final-try-copy {
  font-size: 0.96rem;
  color: rgba(255, 248, 245, 0.84);
  text-align: left;
}

.onboarding-final-try-suggestions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onboarding-final-try-suggestion {
  border: 1px solid rgba(255, 248, 245, 0.24);
  background: rgba(255, 248, 245, 0.04);
  color: rgba(255, 248, 245, 0.8);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-final-try-suggestion:hover {
  border-color: rgba(255, 248, 245, 0.38);
  color: rgba(255, 248, 245, 0.95);
}

.onboarding-final-try-input-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.onboarding-final-try-input {
  flex: 1;
  text-align: left;
  font-size: 1rem;
}

.onboarding-final-try-voice-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 107, 0.56);
  background: rgba(255, 107, 107, 0.12);
  color: var(--onboarding-coral);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-final-try-voice-btn:hover {
  background: rgba(255, 107, 107, 0.2);
}

.onboarding-final-try-voice-btn.recording {
  background: var(--onboarding-coral);
  color: var(--onboarding-warm-dark);
}

.onboarding-final-try-actions {
  margin-top: 16px;
}

.onboarding-final-try-voice-error {
  margin-top: 10px;
  text-align: left;
}

.onboarding-final-try-response {
  margin-top: 14px;
  border: 1px solid rgba(255, 248, 245, 0.2);
  background: rgba(255, 248, 245, 0.05);
  border-radius: 14px;
  padding: 12px 14px;
}

.onboarding-final-try-response-title {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 248, 245, 0.5);
}

.onboarding-final-try-response p {
  margin-top: 7px;
  font-size: 0.93rem;
  line-height: 1.5;
  color: rgba(255, 248, 245, 0.9);
}

.onboarding-final-try-prompt {
  margin-top: 8px;
  color: rgba(255, 248, 245, 0.6);
  font-size: 0.82rem;
}

.onboarding-final-try-prompt span {
  color: rgba(255, 248, 245, 0.84);
}

.onboarding-final-try-enter-btn {
  margin-top: 14px;
}

/* Style implications shown after work style selection */
.onboarding-style-implications {
  margin-top: 32px;
  animation: onboarding-fade-in 0.5s ease;
}

@keyframes onboarding-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-implications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.onboarding-implication-item {
  font-size: 0.95rem;
  color: rgba(255, 248, 245, 0.8);
  padding-left: 12px;
  border-left: 2px solid var(--onboarding-coral-light);
  line-height: 1.4;
  text-align: left;
}

.onboarding-implications-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.onboarding-countdown {
  font-size: 0.85rem;
  color: rgba(255, 248, 245, 0.5);
}

/* Test result feedback */
.onboarding-test-result {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
  justify-content: center;
}

.onboarding-test-result.success {
  color: #4ade80;
}

.onboarding-test-result.error {
  color: #f87171;
}

/* Subtle background ambient effect */
.onboarding-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.onboarding-ambient::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
  animation: none;
}

@keyframes onboarding-ambient-drift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(5%, 5%);
  }
}

/* Loading spinner for processing */
@keyframes onboarding-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.onboarding-spinner {
  animation: onboarding-spin 1s linear infinite;
}

/* Fade transitions for conversation flow */
.onboarding-fade-enter {
  opacity: 0;
  transform: translateY(10px);
}

.onboarding-fade-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
}

.onboarding-fade-exit {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-fade-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

/* Light theme compatibility for cinematic onboarding */
.theme-light .cinematic-onboarding {
  --onboarding-warm-dark: #faf8f6;
  --onboarding-warm-white: #1a1817;
  --onboarding-warm-gray: #e5e2df;
}

.theme-light .onboarding-input {
  color: #1a1817;
  border-bottom-color: rgba(255, 107, 107, 0.5);
}

.theme-light .onboarding-input::placeholder {
  color: rgba(26, 24, 23, 0.4);
}

.theme-light .onboarding-mode-toggle {
  color: rgba(26, 24, 23, 0.5);
}

.theme-light .onboarding-mode-toggle:hover {
  color: #1a1817;
}

.theme-light .onboarding-voice-error {
  color: rgba(194, 53, 53, 0.9);
}

.theme-light .onboarding-voice-help {
  color: rgba(26, 24, 23, 0.62);
}

.theme-light .onboarding-btn-secondary {
  border-color: rgba(26, 24, 23, 0.3);
  color: rgba(26, 24, 23, 0.7);
}

.theme-light .onboarding-btn-secondary:hover {
  border-color: rgba(26, 24, 23, 0.5);
  color: #1a1817;
}

.theme-light .onboarding-implication-item {
  color: rgba(26, 24, 23, 0.8);
}

.theme-light .onboarding-countdown {
  color: rgba(26, 24, 23, 0.5);
}

.theme-light .onboarding-api-hint {
  color: rgba(26, 24, 23, 0.5);
}

.theme-light .onboarding-provider-pill {
  color: #1a1817;
  border-color: rgba(255, 107, 107, 0.5);
}

.theme-light .onboarding-ai-primary-card {
  color: #1a1817;
  border-color: rgba(26, 24, 23, 0.18);
  background: rgba(26, 24, 23, 0.04);
}

.theme-light .onboarding-ai-primary-copy,
.theme-light .onboarding-provider-heading {
  color: rgba(26, 24, 23, 0.62);
}

.theme-light .onboarding-back-btn {
  border-color: rgba(26, 24, 23, 0.32);
  background: rgba(26, 24, 23, 0.07);
  color: rgba(26, 24, 23, 0.9);
}

.theme-light .onboarding-back-btn:hover {
  border-color: rgba(26, 24, 23, 0.4);
  color: #1a1817;
  background: rgba(26, 24, 23, 0.07);
}

.theme-light .onboarding-theme-btn,
.theme-light .onboarding-music-btn,
.theme-light .onboarding-skip-btn {
  border-color: rgba(26, 24, 23, 0.32);
  background: rgba(26, 24, 23, 0.07);
  color: rgba(26, 24, 23, 0.9);
}

.theme-light .onboarding-theme-btn:hover,
.theme-light .onboarding-music-btn:hover,
.theme-light .onboarding-skip-btn:hover {
  border-color: rgba(26, 24, 23, 0.4);
  color: #1a1817;
  background: rgba(26, 24, 23, 0.07);
}

.theme-light .onboarding-music-btn.active {
  border-color: rgba(255, 107, 107, 0.5);
}

.theme-light .onboarding-control-once-hint {
  color: rgba(26, 24, 23, 0.62);
}

.theme-light .onboarding-capability-label {
  color: rgba(26, 24, 23, 0.45);
}

.theme-light .onboarding-capability-pill {
  color: rgba(26, 24, 23, 0.82);
  border-color: rgba(26, 24, 23, 0.2);
  background: rgba(26, 24, 23, 0.04);
}

.theme-light .onboarding-step-panel,
.theme-light .onboarding-memory-trust,
.theme-light .onboarding-ollama-detection,
.theme-light .onboarding-recap,
.theme-light .onboarding-final-try {
  border-color: rgba(26, 24, 23, 0.14);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 107, 107, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 246, 241, 0.9)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 42px rgba(68, 51, 39, 0.08);
}

.theme-light .onboarding-form-label,
.theme-light .onboarding-ollama-detection-model {
  color: #1a1817;
}

.theme-light .onboarding-textarea {
  border-color: rgba(26, 24, 23, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: #1a1817;
}

.theme-light .onboarding-textarea::placeholder {
  color: rgba(26, 24, 23, 0.38);
}

.theme-light .onboarding-textarea:focus {
  border-color: rgba(255, 107, 107, 0.52);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.18);
}

.theme-light .onboarding-selection-card,
.theme-light .onboarding-recap-item,
.theme-light .onboarding-recap-card,
.theme-light .onboarding-recap-status-item,
.theme-light .onboarding-final-try-response {
  border-color: rgba(26, 24, 23, 0.1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 239, 0.86)),
    rgba(255, 255, 255, 0.84);
}

.theme-light .onboarding-recap-card-featured {
  border-color: rgba(255, 107, 107, 0.24);
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 107, 107, 0.1), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 244, 239, 0.86)),
    rgba(255, 255, 255, 0.86);
}

.theme-light .onboarding-selection-card:hover {
  border-color: rgba(255, 107, 107, 0.28);
}

.theme-light .onboarding-selection-card.selected {
  border-color: rgba(255, 107, 107, 0.5);
  background:
    linear-gradient(145deg, rgba(255, 107, 107, 0.14), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.92);
}

.theme-light .onboarding-selection-card-check,
.theme-light .onboarding-recap-edit-btn,
.theme-light .onboarding-memory-toggle {
  border-color: rgba(26, 24, 23, 0.18);
}

.theme-light .onboarding-ollama-detection-note {
  color: rgba(26, 24, 23, 0.55);
}

.theme-light .onboarding-selection-card-title,
.theme-light .onboarding-selection-card-desc,
.theme-light .onboarding-memory-trust-copy,
.theme-light .onboarding-memory-trust-list,
.theme-light .onboarding-recap-summary,
.theme-light .onboarding-recap-item-value,
.theme-light .onboarding-recap-card-copy strong,
.theme-light .onboarding-recap-status-item strong,
.theme-light .onboarding-final-try-copy,
.theme-light .onboarding-final-try-response p {
  color: rgba(26, 24, 23, 0.82);
}

.theme-light .onboarding-recap-item-label,
.theme-light .onboarding-final-try-response-title,
.theme-light .onboarding-recap-eyebrow,
.theme-light .onboarding-recap-status-item span,
.theme-light .onboarding-recap-row-label {
  color: rgba(26, 24, 23, 0.5);
}

.theme-light .onboarding-selection-card-desc,
.theme-light .onboarding-recap-item-note,
.theme-light .onboarding-recap-card-copy p,
.theme-light .onboarding-final-try-prompt,
.theme-light .onboarding-ollama-detection-note {
  color: rgba(26, 24, 23, 0.56);
}

.theme-light .onboarding-recap-header h2,
.theme-light .onboarding-recap-row-main strong {
  color: rgba(26, 24, 23, 0.86);
}

.theme-light .onboarding-recap-header p,
.theme-light .onboarding-recap-row-main > span:last-child,
.theme-light .onboarding-recap-optional p {
  color: rgba(26, 24, 23, 0.6);
}

.theme-light .onboarding-recap-table,
.theme-light .onboarding-recap-row,
.theme-light .onboarding-recap-hero {
  border-color: rgba(26, 24, 23, 0.1);
}

.theme-light .onboarding-recap-edit-btn,
.theme-light .onboarding-recap-provider-badge,
.theme-light .onboarding-final-try-suggestion,
.theme-light .onboarding-memory-toggle {
  border-color: rgba(26, 24, 23, 0.24);
  color: rgba(26, 24, 23, 0.78);
}

.theme-light .onboarding-recap-provider-badge,
.theme-light .onboarding-recap-optional {
  background: rgba(255, 255, 255, 0.56);
}

.theme-light .onboarding-recap-optional {
  border-color: rgba(26, 24, 23, 0.14);
}

.theme-light .onboarding-recap-inline-btn,
.theme-light .onboarding-recap-choice-btn {
  border-color: rgba(26, 24, 23, 0.24);
  color: rgba(26, 24, 23, 0.78);
}

.theme-light .onboarding-recap-inline-btn.primary,
.theme-light .onboarding-recap-choice-btn.active {
  border-color: rgba(255, 107, 107, 0.56);
  color: #d75050;
}

.theme-light .onboarding-final-try-suggestion:hover,
.theme-light .onboarding-recap-edit-btn:hover {
  border-color: rgba(26, 24, 23, 0.34);
  color: #1a1817;
}

.theme-light .onboarding-final-try-voice-btn {
  border-color: rgba(255, 107, 107, 0.52);
}

.theme-light .onboarding-final-try-prompt span {
  color: rgba(26, 24, 23, 0.8);
}

@media (max-width: 720px) {
  .cinematic-onboarding {
    padding-left: 12px;
    padding-right: 12px;
  }

  .onboarding-content {
    padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  }

  .onboarding-selection-grid,
  .onboarding-recap-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-step-panel,
  .onboarding-memory-trust,
  .onboarding-ollama-detection,
  .onboarding-recap,
  .onboarding-final-try {
    padding: 18px 16px;
  }

  .onboarding-recap-item {
    flex-direction: column;
  }

  .onboarding-recap-row,
  .onboarding-recap-optional {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .onboarding-recap-row-main {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .onboarding-recap-edit-actions {
    justify-content: flex-start;
  }

  .onboarding-final-try-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .onboarding-final-try-voice-btn {
    width: 100%;
    border-radius: 14px;
  }
}

@media (max-width: 980px), (max-height: 920px) {
  .onboarding-content {
    gap: 24px;
  }

  .onboarding-back-btn,
  .onboarding-top-right-controls {
    top: calc(env(safe-area-inset-top, 0px) + 20px);
  }

  .onboarding-provider-pills {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .onboarding-step-panel,
  .onboarding-memory-trust,
  .onboarding-ollama-detection,
  .onboarding-recap,
  .onboarding-final-try {
    padding: 16px;
  }

  .onboarding-selection-card {
    min-height: 118px;
  }

  .onboarding-recap-summary {
    font-size: 0.95rem;
  }

  .onboarding-recap-item {
    padding: 10px;
  }

  .cinematic-onboarding.onboarding-state-final_try .onboarding-content {
    gap: 14px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-content {
    gap: 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
    padding-bottom: 28px;
  }

  .cinematic-onboarding.onboarding-state-final_try .onboarding-orb-container {
    width: 76px;
    height: 76px;
  }

  .cinematic-onboarding.onboarding-state-final_try .onboarding-orb {
    width: 58px;
    height: 58px;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-typewriter,
  .cinematic-onboarding.onboarding-state-final_try .onboarding-typewriter {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .onboarding-recap-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-recap-provider-badge {
    justify-self: start;
  }

  .onboarding-recap-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .onboarding-recap-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap {
    padding: 18px 20px;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-summary {
    font-size: 0.9rem;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-item {
    padding: 8px 9px;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-item-label {
    font-size: 0.72rem;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-item-note {
    font-size: 0.7rem;
  }

  .cinematic-onboarding.onboarding-state-recap .onboarding-recap-edit-actions {
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .onboarding-recap-status-grid,
  .onboarding-recap-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-recap-card {
    min-height: 0;
  }

  .onboarding-recap-optional {
    grid-template-columns: minmax(0, 1fr);
  }

  .onboarding-recap-optional .onboarding-recap-edit-actions {
    max-width: none;
    justify-content: flex-start;
  }
}

/* ============================================
   Modern Visual Theme Overrides (shape + typography only)
   ============================================ */

.visual-oblivion body {
  font-family: var(--font-ui);
  letter-spacing: 0.1px;
}

.visual-oblivion .cli-panel,
.visual-oblivion .cli-sidebar,
.visual-oblivion .cli-workspace-selector,
.visual-oblivion .cli-workspace-content {
  font-family: var(--font-ui);
}

.visual-oblivion .cli-input-wrapper {
  padding: 12px 14px;
}

.visual-oblivion .cli-input {
  font-family: var(--font-ui);
  font-size: 14px;
}

.visual-oblivion .cli-panel-title,
.visual-oblivion .cli-sidebar-title,
.visual-oblivion .cli-section-title,
.visual-oblivion .cli-list-header {
  font-family: var(--font-ui);
  letter-spacing: 0.2px;
  text-transform: none;
}

.visual-oblivion .cli-section-toggle .modern-only {
  font-size: 12px;
  line-height: 1;
}

.visual-oblivion .cli-section-header {
  border-radius: var(--radius-md);
  margin: 10px 10px 0;
  padding: 10px 12px;
}

.visual-oblivion .cli-section-content {
  padding: 12px 14px 16px;
}

.visual-oblivion .cli-progress-item,
.visual-oblivion .cli-file-item,
.visual-oblivion .cli-context-item,
.visual-oblivion .cli-queue-item,
.visual-oblivion .cli-task-item,
.visual-oblivion .cli-workspace-item {
  border-radius: var(--radius-md);
}

.visual-oblivion .cli-progress-item,
.visual-oblivion .cli-file-item,
.visual-oblivion .cli-context-item,
.visual-oblivion .cli-queue-item {
  padding: 8px 10px;
  font-size: 12px;
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
}

.visual-oblivion .cli-context-empty {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
}

.visual-oblivion .cli-active-context-icon {
  background: rgba(255, 255, 255, 0.04);
}

.visual-oblivion .cli-active-context-badge {
  background: rgba(255, 255, 255, 0.06);
}

.visual-oblivion .cli-task-item {
  border-left: none;
  margin: 2px 8px;
  padding: 6px 10px !important;
}

.visual-oblivion .cli-task-title,
.visual-oblivion .cli-queue-title,
.visual-oblivion .cli-progress-text,
.visual-oblivion .cli-file-name,
.visual-oblivion .cli-context-file {
  font-family: var(--font-ui);
  font-size: 13px;
}

.visual-oblivion .cli-task-num,
.visual-oblivion .cli-progress-num,
.visual-oblivion .cli-item-num {
  font-variant-numeric: tabular-nums;
}

.visual-oblivion .cli-task-num,
.visual-oblivion .cli-progress-num,
.visual-oblivion .cli-item-num {
  display: none;
}

.visual-oblivion .cli-queue-status,
.visual-oblivion .cli-progress-status,
.visual-oblivion .cli-file-action {
  font-family: var(--font-ui);
}

.visual-oblivion .cli-queue-status,
.visual-oblivion .cli-progress-status,
.visual-oblivion .cli-task-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.visual-oblivion .cli-file-action {
  width: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.visual-oblivion .cli-queue-status {
  font-size: 11px;
}

.visual-oblivion .queue-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: currentColor;
}

.visual-oblivion .queue-status-pill {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border: 1px solid currentColor;
  color: inherit;
}

.visual-oblivion .file-action-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: currentColor;
}

.visual-oblivion .cli-action-btn {
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 12px;
  text-transform: none;
}

.visual-oblivion .cli-sessions-header {
  border-radius: var(--radius-sm);
}

.visual-oblivion .cli-more-btn,
.visual-oblivion .cli-task-menu,
.visual-oblivion .cli-menu-option {
  font-family: var(--font-ui);
}

.visual-oblivion .cli-menu-prefix {
  display: none;
}

.visual-oblivion .cli-footer-label,
.visual-oblivion .cli-footer-text {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0;
}

.visual-oblivion .main-footer,
.visual-oblivion .input-container,
.visual-oblivion .welcome-input-container,
.visual-oblivion .welcome-input,
.visual-oblivion .input-field,
.visual-oblivion .input-textarea,
.visual-oblivion .input-actions,
.visual-oblivion .attachment-btn,
.visual-oblivion .folder-selector,
.visual-oblivion .shell-toggle,
.visual-oblivion .model-selector,
.visual-oblivion .skills-menu-btn,
.visual-oblivion .voice-input-btn,
.visual-oblivion .lets-go-btn,
.visual-oblivion .goal-mode-section,
.visual-oblivion .goal-mode-toggle,
.visual-oblivion .goal-mode-label,
.visual-oblivion .goal-mode-hint,
.visual-oblivion .goal-mode-input,
.visual-oblivion .goal-mode-attempts,
.visual-oblivion .goal-mode-attempts label,
.visual-oblivion .goal-mode-attempts input[type="number"],
.visual-oblivion .workspace-dropdown,
.visual-oblivion .workspace-dropdown-header,
.visual-oblivion .workspace-dropdown-item,
.visual-oblivion .workspace-item-name,
.visual-oblivion .workspace-item-path,
.visual-oblivion .skills-dropdown,
.visual-oblivion .skills-dropdown-header,
.visual-oblivion .skills-dropdown-search input,
.visual-oblivion .skills-dropdown-item,
.visual-oblivion .skills-dropdown-name,
.visual-oblivion .skills-dropdown-desc,
.visual-oblivion .skills-dropdown-footer,
.visual-oblivion .skills-dropdown-create {
  font-family: var(--font-ui);
}

.visual-oblivion .input-container,
.visual-oblivion .welcome-input-container {
  border-radius: var(--radius-xl);
  overflow: visible;
}

.model-dropdown.align-right {
  left: auto;
  right: 0;
}

.visual-oblivion .welcome-input-footer {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.visual-oblivion .cli-input-container .welcome-input-footer,
.visual-oblivion .welcome-input-footer {
  background: var(--color-bg-primary);
  border-top: none;
}

.visual-oblivion .attachment-btn,
.visual-oblivion .folder-selector,
.visual-oblivion .shell-toggle,
.visual-oblivion .model-selector,
.visual-oblivion .skills-menu-btn,
.visual-oblivion .voice-input-btn,
.visual-oblivion .lets-go-btn {
  border-radius: var(--radius-md);
}

.visual-oblivion .skills-menu-btn {
  font-weight: 600;
}

.visual-oblivion .goal-mode-prompt {
  display: none;
}

.visual-oblivion .goal-mode-command {
  padding-left: 12px;
}

.visual-oblivion .goal-mode-section {
  background: var(--color-bg-glass);
  border-color: var(--color-border-subtle);
}

.visual-oblivion .goal-mode-command {
  background: transparent;
  border-color: var(--color-border);
}

.visual-oblivion .goal-mode-attempts input[type="number"] {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

.visual-oblivion .goal-mode-input {
  font-family: var(--font-ui);
}

.visual-oblivion .workspace-dropdown-header,
.visual-oblivion .skills-dropdown-header {
  text-transform: none;
  letter-spacing: 0;
}

.visual-oblivion .timeline-controls,
.visual-oblivion .timeline-events,
.visual-oblivion .event-title,
.visual-oblivion .event-time,
.visual-oblivion .event-details,
.visual-oblivion .event-details pre,
.visual-oblivion .event-details ul,
.visual-oblivion .event-details li,
.visual-oblivion .event-details.assistant-message,
.visual-oblivion .markdown-content,
.visual-oblivion .user-message-bubble,
.visual-oblivion .user-message-content,
.visual-oblivion .user-message-time {
  font-family: var(--font-ui);
}

.visual-oblivion .event-details {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
}

.visual-oblivion .event-details.assistant-message {
  background: transparent;
  border-color: transparent;
  color: var(--color-text);
}

.visual-oblivion .markdown-content ul {
  list-style: none;
  padding-left: 20px;
}

.visual-oblivion .markdown-content ul li {
  position: relative;
  padding-left: 12px;
}

.visual-oblivion .markdown-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}

.visual-oblivion .verbose-toggle-btn {
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: 0;
  border-radius: var(--radius-md);
}

.visual-oblivion .verbose-switch-label {
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: 0;
}

.visual-oblivion .goal-mode-switch-track {
  border-radius: 999px;
}

.visual-oblivion .event-title,
.visual-oblivion .event-time {
  letter-spacing: 0;
}

.visual-oblivion .user-message-bubble {
  border-radius: var(--radius-lg);
}

.visual-oblivion .cli-tree,
.visual-oblivion .cli-ascii-box,
.visual-oblivion .cli-ascii-logo,
.visual-oblivion .cli-cursor-block {
  display: none;
}

.visual-oblivion .cli-workspace-item {
  padding: 10px 12px;
  gap: 10px;
}

.visual-oblivion .task-tree-children {
  margin-left: 6px;
  padding-left: 12px;
}

.visual-oblivion .task-tree-node-child {
  margin-left: 6px;
  padding-left: 12px;
}

.visual-oblivion .cli-tree-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  font-size: 0;
  color: transparent;
}

.visual-oblivion .cli-tree-prefix::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--color-text-muted);
  background: var(--color-bg-primary);
  opacity: 0.8;
}

.visual-oblivion .cli-item-icon {
  font-size: 16px;
}

.visual-oblivion .cli-item-name {
  font-family: var(--font-ui);
  font-size: 13px;
}

.visual-oblivion .cli-item-path {
  font-family: var(--font-ui);
  font-size: 11px;
}

.visual-oblivion .workspace-modern-title {
  font-size: 16px;
  font-weight: 600;
  margin-top: 6px;
}

.visual-oblivion .workspace-modern-subtitle {
  font-size: 12px;
  margin-top: 2px;
}

/* ── ChatGPT Import Wizard ──────────────────────────────────── */

.chatgpt-import-step {
  margin-top: 16px;
}

.chatgpt-import-tutorial h4 {
  font-size: 15px;
}

.chatgpt-import-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.chatgpt-import-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chatgpt-import-step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.chatgpt-import-step-item strong {
  display: block;
  color: var(--color-text-primary);
  font-size: 14px;
  margin-bottom: 2px;
}

.chatgpt-import-step-item p {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.chatgpt-import-security-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.chatgpt-import-security-note strong {
  color: var(--color-text-primary);
}

.chatgpt-import-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.chatgpt-import-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.chatgpt-import-btn:hover {
  opacity: 0.85;
}

.chatgpt-import-btn-primary {
  background: var(--color-accent);
  color: white;
}

.chatgpt-import-btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.chatgpt-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.chatgpt-import-dropzone:hover {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 5%, transparent);
}

.chatgpt-import-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-tertiary);
  border-radius: 8px;
}

.chatgpt-import-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--color-error, #ef4444) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-error, #ef4444) 25%, transparent);
  border-radius: 6px;
  color: var(--color-error, #ef4444);
  font-size: 13px;
}

.chatgpt-import-progress {
  padding: 20px;
  background: var(--color-bg-tertiary);
  border-radius: 10px;
}

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

.chatgpt-import-progress-bar-container {
  height: 6px;
  background: var(--color-bg-secondary, var(--color-bg-primary));
  border-radius: 3px;
  overflow: hidden;
}

.chatgpt-import-progress-bar {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.chatgpt-import-progress-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.chatgpt-import-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
}

.chatgpt-import-result-stats {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.chatgpt-import-result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chatgpt-import-result-stat strong {
  font-size: 22px;
  color: var(--color-text-primary);
}

.chatgpt-import-result-stat span {
  font-size: 12px;
  color: var(--color-text-tertiary);
}

/* ==================== UI DENSITY: FOCUSED MODE ==================== */

/* Title bar density toggle button */
.density-toggle {
  position: relative;
}

.density-toggle.focused svg {
  opacity: 0.5;
}

.density-toggle.full svg {
  opacity: 1;
}

.density-toggle:hover svg {
  opacity: 1;
  stroke: var(--color-accent);
}

.density-focused {
  --density-chat-message-intrinsic-size: 110px;
  --density-timeline-event-intrinsic-size: 48px;
}

/* Overflow menu for focused mode controls */
.overflow-menu-container {
  position: relative;
  display: inline-flex;
}

.overflow-menu-btn {
  background: transparent;
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-secondary, #9ca3af);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.overflow-menu-btn:hover,
.overflow-menu-btn.active {
  border-color: var(--color-accent, #22d3ee);
  color: var(--color-accent, #22d3ee);
}

.overflow-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: var(--color-bg-elevated, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  padding: 4px;
  min-width: 220px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.overflow-menu-item {
  padding: 2px 4px;
}

.overflow-menu-item .folder-selector,
.overflow-menu-item .shell-toggle,
.overflow-menu-item .skills-menu-btn,
.overflow-menu-item .goal-mode-toggle {
  width: 100%;
  justify-content: flex-start;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 6px);
  padding: 6px 8px;
  color: var(--color-text-secondary, #9ca3af);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.overflow-menu-item .folder-selector:hover,
.overflow-menu-item .shell-toggle:hover,
.overflow-menu-item .skills-menu-btn:hover,
.overflow-menu-item .goal-mode-toggle:hover {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--color-text-primary, #e5e7eb);
}

.overflow-menu-item .goal-mode-toggle {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.overflow-menu-item .goal-mode-label,
.overflow-menu-item .goal-mode-hint {
  display: block;
  width: 100%;
  text-align: left;
}

.overflow-menu-item .goal-mode-toggle.goal-mode-toggle-switch-row {
  align-items: stretch;
  gap: 0;
}

.overflow-menu-item .goal-mode-toggle-switch-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.overflow-menu-item .goal-mode-toggle-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.overflow-menu-item .goal-mode-toggle-switch-row .goal-mode-hint {
  line-height: 1.25;
}

.overflow-menu-item .shell-toggle .goal-mode-switch-track {
  margin-left: auto;
}

.overflow-menu-item .goal-mode-switch-track {
  flex: 0 0 auto;
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.12));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.2));
  transition: background 0.18s ease, border-color 0.18s ease;
}

.overflow-menu-item .goal-mode-switch-track.on {
  background: var(--color-accent, #22d3ee);
  border-color: var(--color-accent, #22d3ee);
}

.overflow-menu-item .goal-mode-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-text-primary, #e5e7eb);
  transition: left 0.18s ease;
}

.overflow-menu-item .goal-mode-switch-track.on .goal-mode-switch-thumb {
  left: 14px;
}

.overflow-menu-item .overflow-submenu-trigger .goal-mode-hint {
  line-height: 1.25;
}

.overflow-menu-item .overflow-submenu-trigger-content {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.overflow-menu-item .overflow-submenu-chevron {
  flex: 0 0 auto;
  color: var(--color-text-muted, #6b7280);
  margin-top: 2px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.overflow-menu-item .overflow-submenu-trigger.active .overflow-submenu-chevron {
  color: var(--color-accent, #22d3ee);
  transform: translateX(1px);
}

.overflow-submenu-panel {
  position: absolute;
  bottom: calc(100% + 4px);
  left: calc(100% + 8px);
  min-width: 190px;
  background: var(--color-bg-elevated, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  padding: 6px;
  z-index: 101;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.overflow-submenu-header {
  padding: 4px 8px 6px;
}

.overflow-submenu-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
}

.overflow-submenu-option {
  width: 100%;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm, 6px);
  padding: 7px 9px;
  color: var(--color-text-secondary, #9ca3af);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.overflow-submenu-option:hover,
.overflow-submenu-option:focus-visible {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--color-text-primary, #e5e7eb);
  outline: none;
}

.overflow-submenu-option.active {
  color: var(--color-accent, #22d3ee);
}

.overflow-submenu-option .overflow-submenu-check {
  color: inherit;
}

.menu-tooltip-target {
  position: relative;
}

.menu-tooltip-target::before,
.menu-tooltip-target::after {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.menu-tooltip-target::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 8px;
  bottom: calc(100% + 8px);
  max-width: 220px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 7px;
  padding: 6px 8px;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  z-index: 120;
  transform: translateY(2px);
}

.menu-tooltip-target::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: calc(100% + 3px);
  width: 8px;
  height: 8px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid rgba(148, 163, 184, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
  transform: rotate(45deg) translateY(2px);
  z-index: 119;
}

.menu-tooltip-target:hover::before,
.menu-tooltip-target:focus-visible::before {
  opacity: 1;
  transform: rotate(45deg) translateY(0);
}

.menu-tooltip-target:hover::after,
.menu-tooltip-target:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.input-status-mode.menu-tooltip-target::after {
  left: 0;
  max-width: 260px;
  white-space: normal;
}

.input-status-mode.menu-tooltip-target::before {
  left: 10px;
}

/* Subtle model label for focused mode */
.model-label-container {
  position: relative;
  display: inline-flex;
}

.model-label-subtle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  border: none;
  background: transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.model-label-subtle .chevron-up {
  transform: rotate(180deg);
}

.model-label-icon {
  display: none;
  flex-shrink: 0;
}

.model-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-label-subtle:hover {
  color: var(--color-accent, #22d3ee);
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
}

.model-label-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  background: var(--color-bg-elevated, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-md, 8px);
  padding: 4px;
  min-width: 180px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.model-label-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  padding: 6px 10px;
  color: var(--color-text-secondary, #9ca3af);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.model-label-dropdown-item:hover {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--color-text-primary, #e5e7eb);
}

.model-label-dropdown-item.active {
  color: var(--color-accent, #22d3ee);
}

/* Welcome hint text */
.welcome-hint {
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 12px;
  margin: 16px auto 0;
  line-height: 1.5;
  max-width: 480px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.welcome-hint:hover {
  opacity: 1;
}

.welcome-next-actions {
  width: min(100%, 980px);
  margin: 18px auto 0;
  color: var(--color-text-secondary, #9ca3af);
}

.welcome-next-actions-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}

.welcome-next-actions-title {
  color: var(--color-text-secondary, #9ca3af);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.welcome-next-actions-subtitle {
  color: var(--color-text-muted, #6b7280);
  font-size: 11px;
  line-height: 1.2;
}

.welcome-next-actions-list {
  border-top: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
}

.welcome-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: stretch;
  min-height: 58px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  transition: background 0.15s ease;
}

.welcome-next-action:last-child {
  border-bottom: 0;
}

.welcome-next-action:hover,
.welcome-next-action:focus-within {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.04));
}

.welcome-next-action-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.welcome-next-action-main:focus-visible,
.welcome-next-action-snooze:focus-visible,
.welcome-next-action-dismiss:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-accent, #22d3ee) 55%, transparent);
  outline-offset: -2px;
}

.welcome-next-action-icon {
  color: var(--color-text-muted, #6b7280);
  transition: color 0.15s ease;
}

.welcome-next-action.suggestion-heartbeat:hover .welcome-next-action-icon,
.welcome-next-action.suggestion-heartbeat:focus-within .welcome-next-action-icon {
  color: var(--color-accent, #22d3ee);
}

.welcome-next-action.suggestion-memory:hover .welcome-next-action-icon,
.welcome-next-action.suggestion-memory:focus-within .welcome-next-action-icon {
  color: var(--color-success, #34d399);
}

.welcome-next-action.suggestion-insight:hover .welcome-next-action-icon,
.welcome-next-action.suggestion-insight:focus-within .welcome-next-action-icon {
  color: var(--color-info, #60a5fa);
}

.welcome-next-action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.welcome-next-action-title {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-secondary, #9ca3af);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.25;
}

.welcome-next-action-why {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted, #6b7280);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.welcome-next-action:hover .welcome-next-action-title,
.welcome-next-action:focus-within .welcome-next-action-title {
  color: var(--color-text-primary, #e5e7eb);
}

.welcome-next-action-modules {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.welcome-next-action-module {
  max-width: 90px;
  padding: 2px 7px;
  border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  color: var(--color-text-muted, #6b7280);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.welcome-next-action-snooze,
.welcome-next-action-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid transparent;
  border-radius: 0;
  background: color-mix(in srgb, var(--color-text-primary, #111827) 4%, transparent);
  color: var(--color-text-secondary, #4b5563);
  cursor: pointer;
  opacity: 1;
  overflow: visible;
  transition:
    color 0.15s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}

.welcome-next-action-snooze svg,
.welcome-next-action-dismiss svg {
  display: block;
  stroke-width: 2.25;
}

.welcome-next-action-snooze {
  border-left-color: var(--color-border-subtle, rgba(255, 255, 255, 0.08));
}

.welcome-next-action-snooze:hover {
  background: var(--color-bg-active, rgba(255, 255, 255, 0.08));
  color: var(--color-accent, #22d3ee);
}

.welcome-next-action:hover .welcome-next-action-snooze,
.welcome-next-action:focus-within .welcome-next-action-snooze,
.welcome-next-action:hover .welcome-next-action-dismiss,
.welcome-next-action:focus-within .welcome-next-action-dismiss {
  opacity: 1;
}

.welcome-next-action-dismiss:hover {
  background: var(--color-bg-active, rgba(255, 255, 255, 0.08));
  color: var(--color-text-primary, #e5e7eb);
}

@media (max-width: 760px) {
  .welcome-next-actions {
    margin-top: 14px;
  }

  .welcome-next-actions-header {
    padding: 0 2px 7px;
  }

  .welcome-next-actions-subtitle,
  .welcome-next-action-modules {
    display: none;
  }

  .welcome-next-action {
    grid-template-columns: minmax(0, 1fr) 32px 32px;
    min-height: 54px;
  }

  .welcome-next-action-main {
    grid-template-columns: 20px minmax(0, 1fr);
    padding: 8px 8px 8px 12px;
    gap: 9px;
  }

  .welcome-next-action-snooze,
  .welcome-next-action-dismiss {
    width: 32px;
    opacity: 1;
  }
}

/* Sidebar date group headers */
.sidebar-date-group {
  padding: 6px 12px 2px 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Focused mode sidebar empty state */
.sidebar-empty-focused {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.sidebar-empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar-empty-message p {
  font-size: 13px;
  color: var(--color-text-secondary, #9ca3af);
  margin: 0;
  font-family: var(--font-ui);
}

.sidebar-empty-message span {
  font-size: 12px;
  color: var(--color-text-muted, #6b7280);
  font-family: var(--font-ui);
}

/* Show/hide failed sessions toggle */
.show-failed-toggle {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: auto;
  transition: color 0.15s ease;
}

.show-failed-toggle:hover {
  color: var(--color-accent, #22d3ee);
}

/* ── Automated sessions folder ─────────────────────────────────────────────
   Groups auto-created sessions (improvement, heartbeat, cron, etc.) into a
   collapsible folder at the bottom of the sidebar so they don't crowd out
   user-created sessions.
───────────────────────────────────────────────────────────────────────────── */
.automated-sessions-folder {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.06));
}

.automated-folder-header {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 7px 10px 7px 20px;
  color: var(--color-text-muted, #6b7280);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: left;
  transition: color 0.15s ease, background 0.15s ease;
  font-family: var(--font-ui);
}

.automated-folder-header:hover {
  color: var(--color-text-secondary, #9ca3af);
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.04));
}

.automated-folder-chevron {
  font-size: 10px;
  flex-shrink: 0;
  width: 12px;
  margin-left: 6px;
  text-align: center;
  opacity: 0.7;
}

.automated-folder-label {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.automated-folder-count {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--color-bg-elevated, rgba(255, 255, 255, 0.07));
  color: var(--color-text-muted, #6b7280);
  letter-spacing: 0;
  text-transform: none;
}

.automated-folder-active {
  flex-shrink: 0;
  margin-left: 2px;
}

.automated-folder-body {
  padding-bottom: 4px;
}

/* In focused density mode, tighten up the folder header a bit */
.density-focused .automated-folder-header {
  padding: 6px 10px 6px 20px;
  font-size: 10px;
}

/* Pagination load-more hint shown at the bottom of the task list */
.task-list-load-more {
  display: block;
  width: 100%;
  padding: 8px 12px 10px;
  border: 0;
  background: transparent;
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  text-align: center;
  font-family: var(--font-ui);
  user-select: none;
}

.task-list-load-more.loading,
.task-list-load-more:disabled {
  opacity: 0.6;
  cursor: default;
}

.task-list-load-more.idle {
  opacity: 0.75;
  cursor: pointer;
}

.task-list-load-more.idle:hover {
  color: var(--color-text-secondary, #4b5563);
  opacity: 1;
}

.cli-sidebar-error {
  margin: 6px 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--color-error, #ef4444);
  background: color-mix(in srgb, var(--color-error, #ef4444) 10%, transparent);
  color: var(--color-error, #ef4444);
  font-size: 11px;
  font-family: var(--font-mono);
}

/* Focused welcome header */
/* Replace broad .cli-style defaults to avoid terminal-style typography drift. */
.welcome-content-focused,
.welcome-content-focused * {
  font-family: var(--font-ui);
  letter-spacing: normal;
}

.welcome-header-focused {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 32px 0 20px;
}

.welcome-header-focused .modern-logo {
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 8px var(--color-accent-subtle));
}

.welcome-header-focused .modern-logo-text {
  height: 128px;
  max-width: min(96vw, 840px);
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 8px var(--color-accent-subtle));
}

.focused-app-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.focused-greeting {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-primary, #e5e7eb);
  margin: 0;
  text-align: center;
  letter-spacing: -0.01em;
}

.focused-subtitle {
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
  margin: 0;
  line-height: 1.5;
}

/* Softer section header in focused mode */
.focused-cards-header {
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: none;
  padding-bottom: 4px;
}

/* Enhanced quick start cards in focused mode */
.focused-cards {
  gap: 10px;
}

.focused-cards .quick-start-card {
  padding: 16px 18px;
  gap: 6px;
  border-color: var(--color-border-subtle, rgba(255, 255, 255, 0.06));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.focused-cards .quick-start-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--color-accent-subtle) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.focused-cards .quick-start-card:hover {
  border-color: var(--color-accent, #22d3ee);
  box-shadow:
    0 0 0 1px var(--color-accent, #22d3ee),
    0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.focused-cards .quick-start-card:hover::before {
  opacity: 1;
}

.focused-cards .quick-start-card:hover .quick-start-icon {
  color: var(--color-accent);
  transform: scale(1.1);
}

.focused-cards .quick-start-icon {
  font-size: 22px;
  margin-bottom: 4px;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.focused-cards .quick-start-title {
  font-size: 14px;
  font-weight: 600;
  position: relative;
}

.focused-cards .quick-start-desc {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-text-muted, #6b7280);
  position: relative;
}

/* Light theme focused cards */
.theme-light .focused-cards .quick-start-card {
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .focused-cards .quick-start-card:hover {
  border-color: var(--color-accent, #22d3ee);
  box-shadow:
    0 0 0 1px var(--color-accent, #22d3ee),
    0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Setup & discover card category badges */
.focused-cards .card-setup .quick-start-title::after,
.focused-cards .card-discover .quick-start-title::after {
  content: attr(data-badge);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.focused-cards .card-setup .quick-start-icon {
  color: var(--color-success, #34d399);
}

.focused-cards .card-discover .quick-start-icon {
  color: var(--color-info, #60a5fa);
}

.focused-cards .card-setup:hover .quick-start-icon {
  color: var(--color-success, #34d399);
}

.focused-cards .card-discover:hover .quick-start-icon {
  color: var(--color-info, #60a5fa);
}

.focused-cards .card-setup:hover {
  border-color: var(--color-success, #34d399);
  box-shadow:
    0 0 0 1px var(--color-success, #34d399),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.focused-cards .card-setup::before {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, transparent 60%);
}

.focused-cards .card-discover:hover {
  border-color: var(--color-info, #60a5fa);
  box-shadow:
    0 0 0 1px var(--color-info, #60a5fa),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.focused-cards .card-discover::before {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, transparent 60%);
}

/* "More ideas" shuffle card */
.focused-cards .card-shuffle {
  border-style: dashed;
  border-color: var(--color-border-subtle, rgba(255, 255, 255, 0.08));
  background: transparent;
  opacity: 0.7;
  transition: all 0.25s ease;
}

.focused-cards .card-shuffle:hover {
  opacity: 1;
  border-color: var(--color-text-muted, #6b7280);
  box-shadow: none;
  transform: translateY(-1px);
}

.focused-cards .card-shuffle:hover::before {
  opacity: 0;
}

.focused-cards .card-shuffle .shuffle-icon {
  color: var(--color-text-muted, #6b7280);
  transition: transform 0.3s ease;
}

.focused-cards .card-shuffle:hover .shuffle-icon {
  color: var(--color-accent);
  transform: rotate(180deg);
}

.theme-light .focused-cards .card-shuffle {
  border-color: rgba(0, 0, 0, 0.1);
}

.theme-light .focused-cards .card-shuffle:hover {
  border-color: rgba(0, 0, 0, 0.25);
}

/* ---- Focused mode entrance animations ---- */
@keyframes focusedFadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-header-focused {
  animation: focusedFadeInUp 0.5s ease both;
}

.focused-cards-header {
  animation: focusedFadeInUp 0.5s ease 0.15s both;
}

.focused-cards .quick-start-card {
  animation: focusedFadeInUp 0.4s ease both;
}

.focused-cards .quick-start-card:nth-child(1) {
  animation-delay: 0.05s;
}

.focused-cards .quick-start-card:nth-child(2) {
  animation-delay: 0.1s;
}

.focused-cards .quick-start-card:nth-child(3) {
  animation-delay: 0.15s;
}

.focused-cards .quick-start-card:nth-child(4) {
  animation-delay: 0.2s;
}

.focused-cards .quick-start-card:nth-child(5) {
  animation-delay: 0.25s;
}

.focused-cards .quick-start-card:nth-child(6) {
  animation-delay: 0.3s;
}

.focused-cards .quick-start-card:nth-child(7) {
  animation-delay: 0.35s;
}

.welcome-hint {
  animation: focusedFadeInUp 0.5s ease 0.4s both;
}

/* Ensure sidebar date header + task list header align */
.task-list-header.cli-list-header {
  display: flex;
  align-items: center;
}

/* ==================== FOCUSED MODE: ACTIVE TASK VIEW ==================== */

/* ---- HIDE: elements that add clutter ---- */

/* Hide duplicate header status bar (status already shown in chat bubble) */
.density-focused .main-header-status {
  display: none;
}

.density-focused .step-feedback-bar {
  display: none;
}

.density-focused .bubble-feedback-panel {
  display: none;
}

.density-focused .bubble-feedback-toggle {
  display: none;
}

/* Hide code toggle button in focused mode — keep verbose switch visible */
.density-focused .verbose-toggle-btn {
  display: none;
}

.density-focused .verbose-switch {
  display: flex;
}

.density-focused .verbose-switch-label {
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
}

.density-focused .timeline-controls .verbose-switch-label {
  font-size: 12px;
}

/* Hide talk mode button — advanced feature */
.density-focused .talk-mode-btn {
  display: none;
}

/* Hide the entire below-actions row in focused mode (model is shown inline instead) */
.density-focused .input-below-actions {
  display: none;
}

/* Always show footer disclaimer even in focused mode */
.density-focused .footer-disclaimer {
  display: block;
}

/* Hide right panel Context section entirely — noise for most users */
.density-focused .right-panel .cli-section:last-of-type {
  display: none;
}

.density-focused .right-panel .cli-section {
  border-bottom: 0;
}

/* Hide right panel footer */
.density-focused .cli-panel-footer {
  display: none;
}

/* Hide terminal-style prompt characters in right panel */
.density-focused .cli-section-prompt {
  display: none;
}

/* Hide step numbering in progress list — cleaner */
.density-focused .cli-progress-num {
  display: none;
}

/* Hide terminal-style section toggles, use cleaner chevron via CSS */
.density-focused .cli-section-toggle .terminal-only {
  display: none;
}

/* ---- CHAT MESSAGES: clean & readable ---- */
.density-focused .chat-message {
  margin-bottom: 4px;
}

.density-focused .chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  font-family: var(--font-ui);
}

.density-focused .cli-new-task-btn,
.density-focused .cli-sessions-header {
  padding: 8px 12px !important;
  height: 34px;
  min-height: 34px;
}

.density-focused .chat-bubble.assistant-bubble {
  max-width: 100%;
  align-self: stretch;
  border-radius: 16px 16px 16px 4px;
  border-color: var(--color-border-subtle);
}

.density-focused .chat-bubble.user-bubble {
  border-radius: 16px 16px 4px 16px;
  padding: 8px 14px;
}

.density-focused .chat-bubble-content {
  font-size: 13.5px;
  line-height: 1.55;
  font-family: var(--font-ui);
}

.density-focused .chat-bubble-content p {
  margin-bottom: 8px;
}

.density-focused .chat-bubble-content p:last-child {
  margin-bottom: 0;
}

.density-focused .chat-bubble-content code {
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 5px;
}

.density-focused .chat-bubble-content pre {
  border-radius: 8px;
  padding: 10px;
  margin: 8px 0;
}

.density-focused .chat-bubble-content ul,
.density-focused .chat-bubble-content ol {
  margin: 4px 0;
  padding-left: 20px;
}

.density-focused .chat-bubble-content li {
  margin: 2px 0;
}

/* Status label in last assistant bubble */
.density-focused .chat-bubble-header {
  margin-bottom: 8px;
}

.density-focused .chat-status {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
}

/* Message actions: collapse to zero height when hidden, show on hover */
.density-focused .message-actions {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  transition:
    opacity 0.15s ease,
    height 0.15s ease;
}

.density-focused .chat-message:hover .message-actions {
  opacity: 1;
  height: auto;
  overflow: visible;
}

/* Copy button below user messages: also collapse */
.density-focused .chat-message.user-message>.message-copy-btn {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  transition:
    opacity 0.15s ease,
    height 0.15s ease;
}

.density-focused .chat-message.user-message:hover>.message-copy-btn {
  opacity: 1;
  height: auto;
  overflow: visible;
  padding: 4px 8px;
  margin-top: 4px;
}

.density-focused .message-copy-btn {
  font-family: var(--font-ui);
  font-size: 11px;
}

/* ---- MAIN HEADER: minimal ---- */
.density-focused .main-header {
  height: 32px;
  padding: 0 24px;
}

.density-focused .main-header-title {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
}

/* ---- MAIN BODY ---- */
.density-focused .main-body {
  padding: 20px 32px;
}

.density-focused .task-content {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

.density-focused .conversation-flow {
  gap: 16px;
}

/* ---- TIMELINE: compact ---- */
.density-focused .timeline-controls {
  margin-top: 4px;
  margin-bottom: 4px;
}

.density-focused .timeline-event {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 4px 0;
}

.density-focused .parallel-group-feed-single-lane {
  padding-left: 0;
}

.density-focused .event-indicator {
  --timeline-indicator-size: 14px;
  min-height: 18px;
}

.density-focused .event-indicator-icon>svg {
  width: 10px;
  height: 10px;
}

.density-focused .event-branch-stub {
  width: 6px;
}

.density-focused .event-dot {
  width: 7px;
  height: 7px;
}

.density-focused .event-dot.active {
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.density-focused .event-title {
  font-family: var(--font-ui);
  font-size: 12px;
}

.density-focused .event-time {
  font-family: var(--font-ui);
  font-size: 10px;
}

.density-focused .event-details {
  padding: 14px;
  font-size: 12px;
}

.density-focused .event-details-code-preview,
.density-focused .event-details-file-preview {
  padding: 0;
}

.density-focused .event-header.expandable {
  border-radius: 6px;
}

/* ---- RIGHT PANEL: stripped down ---- */
.density-focused .right-panel {
  border-left-color: var(--color-border-subtle);
  padding-bottom: max(44px, env(safe-area-inset-bottom, 0px));
  scroll-padding-bottom: max(44px, env(safe-area-inset-bottom, 0px));
}

.density-focused .cli-section-header {
  padding: 10px 16px;
}

.density-focused .cli-section-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-secondary);
}

.density-focused .cli-section-toggle {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-text-muted);
}

.density-focused .cli-progress-item {
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.12);
  gap: 8px;
}

.density-focused .cli-progress-item.in_progress {
  background: var(--color-accent-subtle);
}

.density-focused .cli-progress-text {
  font-family: var(--font-ui);
  font-size: 12px;
}

.density-focused .cli-empty-state {
  padding: 12px 0;
}

.density-focused .cli-status-badge,
.density-focused .cli-hint {
  font-family: var(--font-ui);
}

.density-focused .cli-file-item {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
}

.density-focused .cli-queue-item {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
}

.density-focused .cli-context-item {
  font-family: var(--font-ui);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
}

.density-focused .cli-file-item:hover {
  background: var(--color-bg-hover);
}

.density-focused .cli-queue-item:hover {
  background: var(--color-bg-hover);
}

.density-focused .clickable-file-path {
  font-family: var(--font-ui);
}

.right-panel .cli-progress-item,
.right-panel .cli-file-item,
.right-panel .cli-queue-item,
.right-panel .cli-context-item,
.right-panel .cli-context-empty {
  border: 1px solid color-mix(in srgb, var(--color-border-subtle) 58%, transparent) !important;
  border-radius: 6px !important;
  background: color-mix(in srgb, var(--color-bg-primary) 42%, transparent) !important;
  box-shadow: none !important;
}

.right-panel .cli-progress-item,
.right-panel .cli-file-item,
.right-panel .cli-queue-item,
.right-panel .cli-context-item {
  padding: 5px 8px !important;
}

.right-panel .cli-queue-item.running,
.right-panel .cli-queue-item.queued {
  border-left-width: 1px !important;
}

.right-panel .cli-context-empty {
  padding: 7px 8px !important;
}

.right-panel .cli-progress-item.in_progress {
  background: color-mix(in srgb, var(--color-accent-subtle) 48%, transparent) !important;
  border-color: color-mix(in srgb, var(--color-accent) 18%, transparent) !important;
}

.right-panel {
  --right-panel-text-primary: var(--color-text);
  --right-panel-text-secondary: rgba(255, 255, 255, 0.78);
  --right-panel-text-muted: rgba(255, 255, 255, 0.62);
  --right-panel-accent-text: color-mix(in srgb, var(--color-accent) 82%, #ffffff);
  --right-panel-row-bg: color-mix(in srgb, var(--color-bg-primary) 42%, transparent);
  --right-panel-row-border: color-mix(in srgb, var(--color-border-subtle) 58%, transparent);
}

.theme-light .right-panel {
  --right-panel-text-primary: #2f3137;
  --right-panel-text-secondary: #555a64;
  --right-panel-text-muted: #6d737e;
  --right-panel-accent-text: color-mix(in srgb, var(--color-accent) 46%, #202124);
  --right-panel-row-bg: rgba(255, 255, 255, 0.5);
  --right-panel-row-border: rgba(56, 63, 75, 0.12);
}

.right-panel .cli-section-title,
.right-panel .right-panel-feedback-copy strong {
  color: var(--right-panel-text-primary);
}

.right-panel .cli-section-toggle,
.right-panel .cli-progress-num,
.right-panel .cli-progress-status,
.right-panel .cli-context-label,
.right-panel .cli-context-sep,
.right-panel .cli-context-overflow,
.right-panel .cli-footer-text,
.right-panel .right-panel-feedback-detail,
.right-panel .right-panel-preserved-line {
  color: var(--right-panel-text-muted);
}

.right-panel .cli-progress-text,
.right-panel .cli-progress-item.completed .cli-progress-text,
.right-panel .cli-file-name,
.right-panel .cli-path,
.right-panel .cli-context-val,
.right-panel .cli-context-file,
.right-panel .cli-context-empty,
.right-panel .cli-queue-title,
.right-panel .right-panel-feedback-btn,
.right-panel .right-panel-preserved-line:hover {
  color: var(--right-panel-text-secondary);
}

.right-panel .cli-progress-item.in_progress .cli-progress-text {
  color: var(--right-panel-text-primary);
}

.right-panel .cli-progress-item.compact-overflow .cli-progress-num,
.right-panel .cli-progress-item.compact-overflow .cli-progress-status,
.right-panel .cli-progress-item.compact-overflow .cli-progress-text,
.right-panel .cli-progress-status.skipped,
.right-panel .cli-progress-item.skipped .cli-progress-text {
  color: var(--right-panel-text-muted);
}

.right-panel .cli-section-prompt,
.right-panel .cli-label,
.right-panel .cli-context-key,
.right-panel .cli-footer-prompt,
.right-panel .cli-queue-title:hover {
  color: var(--right-panel-accent-text);
}

.right-panel .cli-context-key {
  font-weight: 400;
}

.right-panel .cli-progress-item,
.right-panel .cli-file-item,
.right-panel .cli-queue-item,
.right-panel .cli-context-item,
.right-panel .cli-context-empty {
  border-color: var(--right-panel-row-border) !important;
  background: var(--right-panel-row-bg) !important;
}

.right-panel .right-panel-feedback-btn,
.right-panel .right-panel-feedback-dismiss {
  opacity: 1;
}

/* Right panel: refined app-sidebar layout */
.right-panel .cli-section {
  padding: 22px 22px 0;
  border-bottom: 0;
}

.right-panel .cli-section-header {
  min-height: 30px;
  padding: 0 0 14px;
  border-radius: 8px;
}

.right-panel .cli-section-header:hover {
  background: transparent;
}

.right-panel .cli-section-header:active .cli-section-title {
  transform: translateY(1px);
}

.right-panel .cli-section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.right-panel .cli-section-toggle {
  width: 26px;
  display: inline-flex;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.right-panel .cli-section-content {
  max-height: none;
  padding: 0;
  overflow: visible;
}

.right-panel .cli-progress-list,
.right-panel .cli-file-list {
  gap: 6px;
}

.right-panel .cli-context-list {
  gap: 12px;
}

.right-panel .cli-context-group {
  gap: 6px;
}

.right-panel .cli-context-tool-usage-list {
  --right-panel-context-row-height: 34px;
  --right-panel-context-row-gap: 6px;
  gap: var(--right-panel-context-row-gap);
  max-height: calc((var(--right-panel-context-row-height) * 4) + (var(--right-panel-context-row-gap) * 3));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.right-panel .cli-context-tool-usage-list::-webkit-scrollbar {
  width: 6px;
}

.right-panel .cli-context-tool-usage-list::-webkit-scrollbar-track {
  background: transparent;
}

.right-panel .cli-context-tool-usage-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--right-panel-row-border);
}

.right-panel .cli-context-label {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
}

.right-panel .cli-progress-item,
.right-panel .cli-file-item,
.right-panel .cli-queue-item,
.right-panel .cli-context-item,
.right-panel .cli-context-empty {
  min-height: 34px;
  border-radius: 8px !important;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.right-panel .cli-progress-item,
.right-panel .cli-queue-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px !important;
}

.right-panel .cli-progress-num {
  display: none;
}

.right-panel .cli-progress-status,
.right-panel .cli-queue-status {
  display: inline-flex;
  width: 16px;
  align-items: center;
  justify-content: center;
}

.right-panel .cli-progress-status svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.right-panel .cli-progress-text,
.right-panel .cli-queue-title,
.right-panel .cli-file-name,
.right-panel .cli-context-key,
.right-panel .cli-context-file {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-panel .cli-progress-text,
.right-panel .cli-file-name,
.right-panel .cli-queue-title,
.right-panel .cli-context-item {
  font-size: 12px;
  line-height: 1.25;
}

.right-panel .cli-progress-item.in_progress {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.right-panel .cli-progress-item .cli-context-key {
  max-width: 78px;
  justify-self: end;
  color: var(--right-panel-accent-text);
  font-size: 11px;
}

.right-panel .cli-progress-item.completed .cli-progress-text {
  color: var(--right-panel-text-secondary);
}

.right-panel .cli-progress-item.compact-overflow {
  border-style: dashed !important;
  background: transparent !important;
}

.right-panel .cli-file-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  padding: 0 10px !important;
}

.right-panel .cli-file-action {
  width: 18px;
  flex-basis: 18px;
}

.right-panel .cli-file-type-icon svg {
  width: 15px;
  height: 15px;
}

.right-panel .cli-file-item.primary-output {
  border-color: color-mix(in srgb, var(--color-accent) 24%, transparent) !important;
  background: color-mix(in srgb, var(--color-accent-subtle) 46%, transparent) !important;
}

.right-panel .cli-file-item:hover,
.right-panel .cli-context-item:hover,
.right-panel .cli-queue-item:hover {
  background: color-mix(in srgb, var(--right-panel-row-bg) 70%, var(--color-bg-hover)) !important;
  transform: translateY(-1px);
}

.right-panel .cli-context-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px !important;
}

.right-panel .cli-active-context-scroll .cli-context-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.right-panel .cli-context-val {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.right-panel .cli-workspace-path,
.right-panel .cli-output-location-line {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.right-panel .cli-workspace-path {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
}

.right-panel .cli-label {
  color: var(--right-panel-accent-text);
}

.right-panel .cli-path {
  min-width: 0;
}

.right-panel .right-panel-feedback-section {
  padding-top: 26px;
  padding-bottom: 18px;
}

.right-panel .right-panel-feedback-section .cli-section-content {
  padding: 0;
}

.right-panel .right-panel-feedback-card {
  gap: 12px;
  padding: 14px 16px;
  border-color: var(--right-panel-row-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--right-panel-row-bg) 74%, var(--color-bg-elevated));
}

.right-panel .right-panel-feedback-copy strong {
  font-size: 14px;
}

.right-panel .right-panel-feedback-detail {
  font-size: 12px;
}

.right-panel .right-panel-feedback-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.right-panel .right-panel-feedback-btn:active {
  transform: translateY(1px);
}

/* Hide the ascii-tree empty states in right panel */
.density-focused .cli-tree {
  display: none;
}

/* ---- INPUT AREA: minimal ---- */
.density-focused .main-footer {
  padding: 10px 24px 12px;
}

.density-focused .input-container {
  border-radius: 14px;
  max-width: 780px;
}


.density-focused .input-row {
  padding: 8px 14px;
  gap: 10px;
}

.density-focused .input-row > .attachment-btn-left {
  margin-right: -2px;
}

.density-focused .input-actions {
  gap: 6px;
}

.density-focused .input-status-text {
  max-width: 780px;
  margin-top: 6px;
}

.density-focused .input-textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
}

/* ---- STATUS BANNERS ---- */
.density-focused .task-status-banner {
  border-radius: 10px;
  font-family: var(--font-ui);
  margin-bottom: 8px;
}

.density-focused .task-status-banner-detail {
  font-size: 13px;
}

/* ---- Entrance animation ---- */
@keyframes focusedMessageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.density-focused .conversation-flow>*:last-child {
  animation: focusedMessageFadeIn 0.3s ease both;
}

/* ---- Light theme ---- */
.theme-light.density-focused .cli-progress-item {
  background: rgba(0, 0, 0, 0.04);
}

.theme-light.density-focused .cli-progress-item.in_progress {
  background: var(--color-accent-subtle);
}

/* ==================== FOCUSED MODE: TITLE BAR ==================== */

/* Hide density toggle — focused mode is always on */
.density-focused .density-toggle {
  display: none;
}

/* ==================== FOCUSED MODE: SIDEBAR ==================== */

/* Hide Mission Control button — advanced feature */
.density-focused .cli-mission-control-btn {
  display: none;
}

/* Hide terminal prompt chars everywhere in sidebar */
.density-focused .task-list-header .cli-section-prompt,
.density-focused .sidebar-header .cli-section-prompt,
.density-focused .new-session-btn .terminal-only {
  display: none;
}

/* Sidebar header: cleaner */
.density-focused .cli-header-actions {
  gap: 6px;
}

.density-focused .sidebar .cli-header-actions.sidebar-nav {
  gap: 5px;
}

.density-focused .sidebar-new-session-btn {
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
}

.density-focused .sidebar-nav-item {
  height: 34px;
  min-height: 34px;
  padding: 0 !important;
}

.density-focused .cli-sessions-header {
  height: 28px;
  min-height: 28px;
  padding: 0 !important;
}

.density-focused .task-list-header {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 12px 4px;
}

/* Hide status icons (identical checkmarks add no info) */
.density-focused .cli-task-status {
  display: none;
}

.density-focused .cli-task-status.active,
.density-focused .cli-task-status.awaiting {
  display: inline-flex;
}

/* Hide task numbering */
.density-focused .cli-task-num {
  display: none;
}

/* Hide tree connector prefixes */
.density-focused .cli-tree-prefix {
  display: none;
}

/* Task items: tight, clean, text-only feel */
.density-focused .cli-task-item {
  padding: 0 6px !important;
  padding-left: var(--cli-task-padding-left, 12px) !important;
  gap: 6px;
  font-family: var(--font-ui);
  min-height: 28px;
}

.density-focused .task-item-content {
  min-width: 0;
}

.density-focused .cli-task-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.density-focused .cli-task-awaiting-badge {
  font-size: 9px;
  padding: 1px 5px;
}

.density-focused .task-item-icon {
  display: none;
}

.density-focused .task-item-meta {
  display: none;
}

.density-focused .task-item-status {
  display: none;
}

/* Show ··· menu only on hover */
.density-focused .task-item-actions {
  opacity: 0;
  transition: opacity 0.12s ease;
}

.density-focused .task-item:hover .task-item-actions,
.density-focused .task-item-actions:has(.task-item-menu) {
  opacity: 1;
}

/* Cleaner selected state */
.density-focused .task-item-selected {
  background: var(--color-accent-subtle);
  box-shadow: none;
  border-radius: 8px;
}

.density-focused .task-item-selected .cli-task-title {
  font-weight: 500;
  color: var(--color-accent);
}

.density-focused .task-item-selected .cli-task-awaiting-badge {
  color: var(--color-accent);
}

.density-focused .task-item-selected::before {
  width: 3px;
  height: 50%;
  border-radius: 0 3px 3px 0;
}

/* Sub-agent items: slightly indented, no extra chrome */
.density-focused .task-item-subagent {
  padding-left: 24px;
  opacity: 0.7;
  font-size: 12px;
  min-height: 27px;
}

.density-focused .task-item-subagent:hover {
  opacity: 1;
}

/* Collapse toggle: minimal */
.density-focused .cli-collapse-btn {
  font-size: 10px;
  width: 16px;
  height: 16px;
  opacity: 0.4;
}

.density-focused .task-item:hover .cli-collapse-btn {
  opacity: 0.8;
}

.density-focused .task-item-group-root {
  position: relative;
}

.density-focused .task-item-group-root .cli-collapse-btn {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

/* Show failed toggle: subtler */
.density-focused .show-failed-toggle {
  font-family: var(--font-ui);
  font-size: 10px;
  opacity: 0.5;
}

.density-focused .show-failed-toggle:hover {
  opacity: 1;
}

/* Date group headers */
.density-focused .sidebar-date-group {
  font-family: var(--font-ui);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 10px;
  line-height: 1.2;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  box-sizing: border-box;
  min-height: 26px;
  padding: 8px 12px 3px 32px;
  opacity: 0.6;
}

@container (max-width: 280px) {
  .sidebar-header,
  .sidebar-ideas-tab,
  .sidebar-header-sessions {
    padding-left: 12px;
    padding-right: 12px;
  }

  .sidebar .cli-header-actions.sidebar-nav {
    gap: 3px;
  }

  .sidebar-new-session-btn .cli-new-task-modern-label,
  .sidebar-nav-item .cli-new-task-modern-label {
    gap: 9px;
  }

  .sidebar-home-btn-icon,
  .sidebar-nav-item .sidebar-home-btn-icon,
  .sidebar-new-session-btn .sidebar-new-session-icon {
    width: 18px;
    height: 18px;
  }

  .cli-sessions-header {
    padding-inline: 0 !important;
  }

  .cli-list-header .cli-section-title,
  .cli-sessions-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-date-group,
  .density-focused .sidebar-date-group {
    padding-left: 12px;
    padding-right: 8px;
    letter-spacing: 0.03em;
  }

  .cli-task-item {
    gap: 4px;
    padding-right: 6px !important;
    padding-left: max(10px, calc(var(--cli-task-padding-left, 12px) - 4px)) !important;
  }

  .cli-task-title-row {
    gap: 6px;
  }

  .cli-task-pinned {
    margin-left: 0;
    margin-right: 1px;
    font-size: 10px;
  }

  .cli-task-time-wrap {
    gap: 4px;
    min-width: 0;
    min-height: 20px;
  }

  .cli-task-time {
    display: none;
  }

  .cli-task-automation-icon {
    display: none;
  }

  .cli-task-actions {
    width: 0;
  }

  .cli-task-item:hover .cli-task-actions,
  .cli-task-item:focus-within .cli-task-actions,
  .cli-task-actions:has(.task-item-menu) {
    width: 22px;
  }

  .cli-more-btn {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .cli-collapse-btn-inline {
    width: 14px;
    height: 14px;
    margin-left: 0;
  }
}

/* First date group needs less top padding */
.density-focused .sidebar-date-group:first-child {
  padding-top: 6px;
}

/* Sidebar footer: compact */
.density-focused .sidebar-footer {
  font-family: var(--font-ui);
  padding: 8px;
}

.density-focused .sidebar-footer button {
  font-family: var(--font-ui);
  font-size: 12px;
}

/* Hide wallet badge in focused mode — keep footer minimal */
.density-focused .infra-wallet-badge {
  display: none;
}

/* ==================== FOCUSED MODE: COMMAND OUTPUT ==================== */

/* Softer container */
.density-focused .command-output-container {
  border-radius: 14px;
  border-color: var(--terminal-border);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.density-focused .command-output-header {
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--terminal-header-top), var(--terminal-header-bottom));
}

.density-focused .command-output-title .command-text {
  font-size: 12px;
}

/* Hide stdin (terminal prompt) in focused mode */
.density-focused .command-stdin-container {
  display: none;
}

/* Hide force kill button */
.density-focused .command-force-kill-btn {
  display: none;
}

/* Softer status badges */
.density-focused .command-status {
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
  border-radius: 10px;
  padding: 4px 10px;
}

/* Softer output area */
.density-focused .command-output-content {
  height: 190px;
  padding: 14px;
  background: var(--terminal-surface);
}

.density-focused .command-output-content pre {
  font-size: 12px;
}

/* Softer stop button */
.density-focused .command-stop-btn {
  border-radius: 8px;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
  font-size: 11px;
}

/* Softer close button */
.density-focused .command-close-btn {
  border-radius: 8px;
  font-family: "SF Mono", "Menlo", "Monaco", var(--font-mono);
}

/* ==================== FOCUSED MODE: SETTINGS ==================== */

/* Settings nav: use UI font */
.density-focused .settings-nav-item {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
}

/* Settings content: softer */
.density-focused .settings-content {
  font-family: var(--font-ui);
}

.density-focused .settings-content h2,
.density-focused .settings-content h3,
.density-focused .settings-content h4 {
  font-family: var(--font-ui);
}

.density-focused .settings-content p,
.density-focused .settings-content label,
.density-focused .settings-content span,
.density-focused .settings-content input,
.density-focused .settings-content select,
.density-focused .settings-content textarea,
.density-focused .settings-content button {
  font-family: var(--font-ui);
}

/* ==================== FOCUSED MODE: QUICK TASK FAB ==================== */

/* Hide floating action button in focused mode — input is always visible */
.density-focused .quick-task-fab-container {
  display: none;
}

/* ==================== FOCUSED MODE: TOASTS ==================== */

.density-focused .toast-container {
  font-family: var(--font-ui);
}

.density-focused .toast {
  font-family: var(--font-ui);
  border-radius: 10px;
}

/* ==================== FOCUSED MODE: UPDATE PILL ==================== */

.density-focused .update-banner {
  font-family: var(--font-ui);
  height: 26px;
  border-radius: 8px;
  font-size: 12px;
}

/* ============ Infrastructure Settings ============ */

.infra-settings-panel {
  padding: 0;
}

.infra-header {
  margin-bottom: 20px;
}

.infra-header h2 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 600;
}

.infra-setup-section {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.infra-setup-info h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
}

.infra-setup-info p {
  margin: 0 0 8px 0;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.infra-feature-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.infra-feature-list strong {
  color: var(--color-text-primary);
}

.infra-setup-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
}

.infra-setup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-tertiary);
}

.infra-setup-step.active {
  color: var(--color-text-primary);
  font-weight: 500;
}

.infra-setup-step.completed {
  color: var(--color-success, #22c55e);
}

.step-indicator {
  width: 16px;
  text-align: center;
  font-size: 12px;
}

.infra-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  color: var(--color-error, #ef4444);
  font-size: 13px;
}

.infra-status-section {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 16px;
}

.infra-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.infra-provider-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.infra-provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.infra-provider-label {
  flex: 1;
  font-size: 13px;
}

.infra-provider-status {
  font-size: 12px;
  color: var(--color-text-secondary, #888);
}

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

.infra-status-dot.connected {
  background: var(--color-success, #22c55e);
}

.infra-status-dot.connecting {
  background: var(--color-warning, #f59e0b);
  animation: pulse 1.5s infinite;
}

.infra-status-dot.error {
  background: var(--color-error, #ef4444);
}

.infra-status-dot.disconnected {
  background: var(--color-text-tertiary);
}

.infra-status-label {
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}

.infra-tool-count {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin-left: 4px;
}

.infra-status-actions {
  margin-left: auto;
}

.infra-wallet-card {
  background: var(--color-surface-secondary, var(--color-bg-secondary));
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.infra-wallet-card h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.infra-wallet-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.infra-wallet-address {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-secondary);
  user-select: all;
}

.infra-copy-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--color-text-tertiary);
}

.infra-copy-btn:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-secondary);
}

.infra-network-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--color-text-tertiary);
  color: var(--color-bg-primary, #fff);
  text-transform: uppercase;
  font-weight: 500;
}

.infra-balance-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.infra-balance-display {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1;
}

.infra-balance-currency {
  font-size: 14px;
  color: var(--color-text-tertiary);
}

.infra-wallet-hint {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 0;
}

.infra-wallet-warning {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-warning-text, #92400e);
  background: var(--color-warning-bg, #fef3c7);
  border: 1px solid var(--color-warning-border, #f59e0b);
  border-radius: 6px;
}

.infra-wallet-safety {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-secondary, #f9fafb);
}

.infra-wallet-safety strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--color-text-primary);
}

.infra-wallet-safety p {
  margin: 0;
  color: var(--color-text-secondary);
}

.infra-wallet-safety code {
  font-size: 11px;
  padding: 1px 4px;
  background: var(--color-bg-tertiary, #e5e7eb);
  border-radius: 3px;
}

.infra-history-section {
  margin-bottom: 16px;
}

.infra-history-section h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.infra-credit-history {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.infra-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.infra-history-table th {
  text-align: left;
  padding: 6px 10px;
  font-weight: 500;
  color: var(--color-text-tertiary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg-primary);
}

.infra-history-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.infra-tx-type.credit {
  color: var(--color-success, #22c55e);
}

.infra-tx-type.debit {
  color: var(--color-error, #ef4444);
}

.infra-tx-amount.credit {
  color: var(--color-success, #22c55e);
}

.infra-tx-amount.debit {
  color: var(--color-error, #ef4444);
}

.infra-tx-desc {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.infra-config-section {
  margin-bottom: 16px;
}

.infra-config-section h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.infra-config-section h4 {
  margin: 12px 0 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.infra-setting-row {
  margin-bottom: 8px;
}

.infra-setting-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.infra-tool-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.infra-danger-section {
  padding: 16px;
  border: 1px solid var(--color-error, #ef4444);
  border-radius: 8px;
  opacity: 0.8;
}

.infra-danger-section h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-error, #ef4444);
}

/* Infrastructure How It Works */
.infra-how-it-works {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.infra-how-it-works h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
}

.infra-info-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.infra-info-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-text-primary);
}

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

/* Infrastructure Tool Category Rows */
.infra-category-row label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.infra-category-row input[type="checkbox"] {
  margin-top: 2px;
}

.infra-category-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.infra-category-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.infra-category-desc {
  font-size: 11px;
  color: var(--color-text-tertiary);
  line-height: 1.4;
}

/* Infrastructure Wallet Badge (Sidebar Footer) */
.infra-wallet-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--color-text-tertiary);
  border-top: 1px solid var(--color-border);
  cursor: pointer;
  transition: color 0.15s;
  text-align: left;
}

.infra-wallet-badge:hover {
  color: var(--color-text-primary);
}

.infra-wallet-badge svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.infra-wallet-badge .infra-wallet-balance {
  font-family: var(--font-mono);
  font-size: 11px;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ============================================
   Windows Platform Overrides
   On Windows, vibrancy/transparency is not available.
   Use fully opaque backgrounds — no alpha channels.
   ============================================ */
html.platform-win32 {
  --color-bg: #1a1a1c;
  --color-bg-primary: #1e1e1e;
  --color-bg-darker: #0f0f0f;
  --color-bg-sidebar: #141416;
  --color-bg-elevated: #2d2d30;
  --color-bg-secondary: #3c3c41;
  --color-bg-tertiary: #46464b;
  --color-bg-hover: rgba(255, 255, 255, 0.08);
  --color-bg-input: #0a0a0a;
  --color-bg-glass: #1f1f1f;
  --color-bg-glass-hover: #2a2a2a;
}

html.platform-win32.theme-light {
  --color-bg: #f0f0f2;
  --color-bg-primary: #ffffff;
  --color-bg-darker: #f5f5f7;
  --color-bg-sidebar: #f7f8ff;
  --color-bg-elevated: #ffffff;
  --color-bg-secondary: #ebebed;
  --color-bg-tertiary: #e0e0e2;
  --color-bg-input: #e8e8ea;
  --color-bg-glass: #f5f5f5;
  --color-bg-glass-hover: #eeeeee;
}

/* Windows: body and app container must be opaque (no vibrancy) */
html.platform-win32 body {
  background-color: var(--color-bg);
}

html.platform-win32 .app {
  background: var(--color-bg);
}

/* Windows: disable backdrop-filter (nothing to blur without vibrancy) */
html.platform-win32 .sidebar,
html.platform-win32 .main-content,
html.platform-win32 .right-panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Windows: reduce left padding (no macOS traffic lights) */
html.platform-win32 .title-bar {
  padding-left: 12px;
}

/* ============================================
   macOS Reduced Transparency Fallback
   Keep the visual structure, but use opaque surfaces when vibrancy is unavailable.
   ============================================ */
html.platform-darwin.opaque-vibrancy {
  --color-bg: #16161a;
  --color-bg-primary: #1e1e23;
  --color-bg-darker: #121217;
  --color-bg-sidebar: #18181d;
  --color-bg-elevated: #2a2a31;
  --color-bg-secondary: #34343c;
  --color-bg-tertiary: #3f3f48;
  --color-bg-input: #101014;
  --color-bg-glass: #24242a;
  --color-bg-glass-hover: #2f2f36;
}

html.platform-darwin.opaque-vibrancy.theme-light {
  --color-bg: #f0f0f2;
  --color-bg-primary: #fafafc;
  --color-bg-darker: #f5f5f7;
  --color-bg-sidebar: #f7f8ff;
  --color-bg-elevated: #ffffff;
  --color-bg-secondary: #ebebee;
  --color-bg-tertiary: #e1e1e5;
  --color-bg-input: #ececef;
  --color-bg-glass: #f4f4f6;
  --color-bg-glass-hover: #ededf0;
}

html.platform-darwin.opaque-vibrancy body,
html.platform-darwin.opaque-vibrancy #root,
html.platform-darwin.opaque-vibrancy .app,
html.platform-darwin.opaque-vibrancy .app-layout {
  background: var(--color-bg) !important;
}

html.platform-darwin.opaque-vibrancy .sidebar,
html.platform-darwin.opaque-vibrancy .main-content,
html.platform-darwin.opaque-vibrancy .right-panel,
html.platform-darwin.opaque-vibrancy .task-item-menu,
html.platform-darwin.opaque-vibrancy .remote-file-picker {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* macOS sidebar surface: keep existing controls, only soften the background. */
html.platform-darwin .app-layout {
  background: rgba(28, 28, 32, 0.42) !important;
}

html.platform-darwin .sidebar.cli-sidebar {
  background: rgba(28, 28, 32, 0.42) !important;
}

html.platform-darwin.theme-light .app-layout {
  background: var(--color-bg-sidebar) !important;
}

html.platform-darwin.theme-light .sidebar.cli-sidebar {
  background: var(--color-bg-sidebar) !important;
}

/* Windows title bar control buttons (minimize, maximize, close) */
.win-controls {
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  margin-left: 8px;
}

.win-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background-color 0.1s ease;
  -webkit-app-region: no-drag;
}

.win-control-btn:hover {
  background-color: var(--color-bg-hover);
}

.win-control-btn.win-close:hover {
  background-color: #e81123;
  color: #ffffff;
}

.win-control-btn svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

/* ==================== COMPANIES PANEL ==================== */
.companies-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Page header ─────────────────────────────────────────── */
.co-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.co-page-header h2 {
  margin: 0;
}

/* ── Two-column layout ───────────────────────────────────── */
.co-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.co-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 8px;
}

.co-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.co-sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.co-company-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.co-company-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.co-company-item:hover {
  background: var(--color-bg-hover);
}

.co-company-item.is-selected {
  background: var(--color-accent-subtle);
  border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.co-company-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.co-company-item-row strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.co-company-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Create toggle + form ────────────────────────────────── */
.co-create-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.co-create-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.co-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-glass);
  animation: co-slide-down 0.15s ease;
}

@keyframes co-slide-down {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.co-create-btn {
  width: 100%;
}

/* ── Main content ────────────────────────────────────────── */
.co-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Stat bar ────────────────────────────────────────────── */
.co-stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.co-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.co-stat strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.co-stat svg {
  color: var(--color-accent);
  flex-shrink: 0;
}

.co-stat--wide {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.co-stat-run {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ── Detail card ─────────────────────────────────────────── */
.co-detail-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.co-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.co-detail-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.co-detail-title h3 {
  margin: 0;
  font-size: 16px;
}

.co-detail-actions {
  display: flex;
  gap: 8px;
}

.co-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.co-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border-subtle);
}

.co-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Shared form primitives ──────────────────────────────── */
.co-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.co-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.co-field span {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.co-field input,
.co-field select,
.co-field textarea {
  width: 100%;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  transition: border-color 0.12s ease;
}

.co-field input:focus,
.co-field select:focus,
.co-field textarea:focus {
  border-color: var(--color-accent);
  outline: none;
}

.co-field textarea {
  resize: vertical;
  min-height: 56px;
}

.co-field--full {
  grid-column: 1 / -1;
}

.co-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
  min-height: 32px;
}

.co-checkbox input {
  margin: 0;
}

/* ── Operators card ──────────────────────────────────────── */
.co-operators-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.co-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.co-section-header h3 {
  margin: 0;
  font-size: 14px;
}

.co-operator-assign {
  display: flex;
  gap: 8px;
}

.co-operator-assign select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
}

.co-operator-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.co-operator-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.co-operator-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.co-operator-info strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.co-operator-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.co-text-button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}

.co-text-button:hover {
  color: var(--color-error);
  background: var(--color-error-subtle);
}

.co-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.12s ease, background 0.12s ease;
}

.co-icon-button:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

/* ── Entity tabs ─────────────────────────────────────────── */
.co-entities-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.co-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  margin: -16px -16px 0;
  padding: 0 8px;
}

.co-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.co-tab:hover {
  color: var(--color-text-secondary);
}

.co-tab.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.co-tab svg {
  flex-shrink: 0;
}

.co-tab-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
}

.co-tab.is-active .co-tab-count {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* ── Entity pane (master-detail) ─────────────────────────── */
.co-entity-pane {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  padding-top: 14px;
}

.co-entity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.co-entity-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.co-entity-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
}

.co-entity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-primary);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.co-entity-item:hover {
  background: var(--color-bg-hover);
}

.co-entity-item.is-selected {
  background: var(--color-accent-subtle);
  border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.co-entity-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.co-entity-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
}

.co-entity-form h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .co-layout {
    grid-template-columns: 1fr;
  }

  .co-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .co-sidebar-section {
    flex: 1 1 100%;
  }

  .co-company-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .co-company-item {
    width: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 800px) {
  .co-entity-pane {
    grid-template-columns: 1fr;
  }

  .co-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .co-stat-bar {
    gap: 0;
  }

  .co-stat {
    padding: 6px 10px;
  }
}

@media (max-width: 580px) {

  .co-form-grid,
  .co-detail-grid {
    grid-template-columns: 1fr;
  }

  .co-detail-header {
    flex-direction: column;
  }

  .co-detail-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .co-operator-assign {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------------------
 * SemanticTimeline — base layout
 * ------------------------------------------------------------------------- */

.semantic-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.semantic-timeline-empty {
  min-height: 0;
}

.semantic-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 6px 0;
  flex-wrap: wrap;
}

.semantic-timeline-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.semantic-timeline-phases {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.phase-chip {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 10px;
  opacity: 0.4;
}

.phase-chip.active {
  opacity: 1;
}

.semantic-timeline-verbosity-toggle {
  display: flex;
  gap: 2px;
}

.verbosity-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.verbosity-btn:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
  color: var(--text-primary, #fff);
}

.verbosity-btn.active {
  background: var(--bg-selected, rgba(255,255,255,0.10));
  color: var(--text-primary, #fff);
  border-color: var(--border-subtle, rgba(255,255,255,0.12));
}

/* Show-all toggle */
.semantic-timeline-show-all-btn {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--text-muted, #888);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.semantic-timeline-show-all-btn:hover {
  background: var(--bg-hover, rgba(255,255,255,0.06));
  color: var(--text-primary, #fff);
}

/* ---------------------------------------------------------------------------
 * Windowed scroll container
 * ------------------------------------------------------------------------- */

.semantic-timeline-window {
  position: relative;
}

/* Windowed mode: fixed height, hides overflow, auto-scrolls to latest */
.semantic-timeline-window.windowed {
  height: 240px;
  overflow-y: auto;
  scroll-behavior: smooth;
  /* Subtle fade at top to hint more content above */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 18%);
}

/* Expanded (show all): no height cap */
.semantic-timeline-window.expanded {
  overflow-y: visible;
}

.semantic-timeline-feed {
  display: flex;
  flex-direction: column;
}

.semantic-timeline-feed-virtual {
  height: 100%;
}

.document-editor-modal {
  width: min(1400px, 94vw);
  height: min(920px, 92vh);
  background: var(--bg-secondary, #111315);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.document-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
}

.document-editor-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #f3f4f6);
}

.document-editor-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary, #9ca3af);
}

.document-editor-header-actions {
  display: flex;
  gap: 6px;
}

.document-editor-header-actions .file-viewer-action-btn {
  width: auto;
  height: auto;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.01em;
}

.document-editor-header-actions .file-viewer-close-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

.document-editor-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
}

.document-editor-main {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.document-editor-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 16px;
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  background: rgba(0, 0, 0, 0.12);
}

.document-editor-panel {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.document-editor-panel-title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #9ca3af);
}

.document-editor-empty,
.document-editor-error {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #cbd5e1);
}

.document-editor-error {
  color: #fca5a5;
}

.document-editor-install {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-editor-install-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
}

.document-editor-install-copy {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #cbd5e1);
}

.document-editor-install-copy code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.document-editor-install-command {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  font-size: 12px;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
  overflow-x: auto;
}

.document-editor-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-editor-install-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.document-editor-install-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.document-editor-install-notes {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary, #cbd5e1);
  font-size: 12px;
  line-height: 1.55;
}

.document-editor-versions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.document-editor-version-btn {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary, #d1d5db);
  text-align: left;
  cursor: pointer;
}

.document-editor-version-btn.active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: var(--text-primary, #f8fafc);
}

.document-editor-selection-copy {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #cbd5e1);
  max-height: 160px;
  overflow: auto;
}

.document-editor-pdf-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.document-editor-pdf-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.document-editor-pdf-stats span,
.document-editor-pdf-page-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
}

.document-editor-pdf-stats strong {
  font-size: 16px;
  color: var(--text-primary, #f8fafc);
}

.document-editor-pdf-pages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.document-editor-pdf-page {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(15, 23, 42, 0.28);
}

.document-editor-pdf-page-text {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary, #cbd5e1);
}

.document-editor-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-primary, #f8fafc);
}

.document-editor-submit {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  color: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.document-editor-submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.document-editor-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.document-editor-task-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #f3f4f6);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-editor-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.document-editor-task-badge--pending {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbbf24;
}

.document-editor-task-badge--running {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.document-editor-task-badge--completed {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34d399;
}

.document-editor-task-badge--failed {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #f87171;
}

.document-editor-task-badge--cancelled {
  background: rgba(156, 163, 175, 0.14);
  border-color: rgba(156, 163, 175, 0.25);
  color: #9ca3af;
}

.document-editor-spinner {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: doc-spin 0.7s linear infinite;
}

@keyframes doc-spin {
  to { transform: rotate(360deg); }
}

.document-editor-task-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
}

.document-editor-task-empty {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  font-style: italic;
}

.document-editor-task-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-secondary, #cbd5e1);
  font-size: 12px;
  line-height: 1.45;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
}

.document-editor-task-item-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.2);
}

.document-editor-task-item--log {
  border-left-color: rgba(148, 163, 184, 0.3);
}

.document-editor-task-item--log .document-editor-task-item-dot {
  background: #94a3b8;
}

.document-editor-task-item--tool {
  border-left-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.07);
  color: #c4b5fd;
}

.document-editor-task-item--tool .document-editor-task-item-dot {
  background: #8b5cf6;
}

.document-editor-task-item--output {
  border-left-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.07);
  color: #6ee7b7;
}

.document-editor-task-item--output .document-editor-task-item-dot {
  background: #34d399;
}

.document-editor-task-item--status {
  border-left-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.07);
  color: #7dd3fc;
  font-style: italic;
}

.document-editor-task-item--status .document-editor-task-item-dot {
  background: #38bdf8;
}

.pdf-document-surface {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.pdf-page-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pdf-page-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdf-page-layer {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

.pdf-page-canvas {
  display: block;
  background: white;
}

.pdf-selection-box {
  position: absolute;
  border: 2px solid #22d3ee;
  background: rgba(34, 211, 238, 0.16);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.docx-document-surface {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docx-block-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.docx-block-card.selected {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
}

.docx-block-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #94a3b8);
}

.docx-block-heading {
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
}

.docx-block-heading-1 {
  font-size: 24px;
}

.docx-block-heading-2 {
  font-size: 20px;
}

.docx-block-heading-3,
.docx-block-heading-4,
.docx-block-heading-5,
.docx-block-heading-6 {
  font-size: 16px;
}

.docx-block-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary, #e5e7eb);
}

.docx-block-table-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docx-block-table-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.docx-block-table-row span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  font-size: 12px;
  color: var(--text-secondary, #e2e8f0);
}

/* Document editor: light mode (full) */
.theme-light .document-editor-modal {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

.theme-light .document-editor-header {
  background: linear-gradient(180deg, #fafafa, #f5f5f5);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.theme-light .document-editor-title {
  color: #111827;
}

.theme-light .document-editor-subtitle {
  color: #6b7280;
}

.theme-light .document-editor-header-actions .file-viewer-action-btn {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #374151;
}

.theme-light .document-editor-header-actions .file-viewer-action-btn:hover {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.2);
}

.theme-light .document-editor-header-actions .file-viewer-close-btn:hover {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.4);
  color: #dc2626;
}

.theme-light .document-editor-main {
  background: #fafafa;
}

.theme-light .document-editor-sidebar {
  background: #f8fafc;
  border-left-color: rgba(0, 0, 0, 0.08);
}

.theme-light .document-editor-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-light .document-editor-panel-title {
  color: #6b7280;
}

.theme-light .document-editor-textarea {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

.theme-light .document-editor-textarea::placeholder {
  color: #9ca3af;
}

.theme-light .document-editor-submit {
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  color: #ffffff;
}

.theme-light .document-editor-selection-copy {
  color: #4b5563;
}

.theme-light .document-editor-version-btn {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.1);
  color: #374151;
}

.theme-light .document-editor-version-btn.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
  color: #0369a1;
}

.theme-light .document-editor-empty {
  background: #f3f4f6;
  color: #6b7280;
}

.theme-light .document-editor-error {
  background: #fef2f2;
  color: #dc2626;
}

.theme-light .document-editor-install-title {
  color: #111827;
}

.theme-light .document-editor-install-copy {
  color: #374151;
}

.theme-light .document-editor-install-copy code {
  background: #e5e7eb;
  color: #111827;
}

.theme-light .document-editor-install-command {
  background: #f8fafc;
  border-color: rgba(56, 189, 248, 0.18);
  color: #0f766e;
}

.theme-light .document-editor-install-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #374151;
}

.theme-light .document-editor-install-btn:hover {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.3);
}

.theme-light .document-editor-task-name {
  color: #111827;
}

.theme-light .pdf-page-label {
  color: #6b7280;
}

.theme-light .pdf-page-layer {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.theme-light .document-editor-task-feed,
.theme-light .document-editor-task-empty {
  color: #6b7280;
}

.theme-light .document-editor-task-item {
  background: rgba(0, 0, 0, 0.03);
  color: #4b5563;
  border-left-color: rgba(0, 0, 0, 0.12);
}

.theme-light .document-editor-task-item-dot {
  background: rgba(0, 0, 0, 0.25);
}

/* DOCX surface in light mode */
.theme-light .docx-block-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #111827;
}

.theme-light .docx-block-card.selected {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(14, 165, 233, 0.08);
}

.theme-light .docx-block-meta,
.theme-light .docx-block-type,
.theme-light .docx-block-id {
  color: #6b7280;
}

.theme-light .docx-block-heading {
  color: #111827;
}

.theme-light .docx-block-text {
  color: #4b5563;
}

.theme-light .docx-block-table-row span {
  background: #f3f4f6;
  color: #374151;
}

@media (max-width: 980px) {
  .document-editor-body {
    grid-template-columns: 1fr;
  }

  .document-editor-sidebar {
    border-left: 0;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  }

  .theme-light .document-editor-sidebar {
    border-top-color: rgba(0, 0, 0, 0.08);
  }

  .document-editor-modal {
    width: 96vw;
    height: 94vh;
  }
}

/* ===================== EMAIL PROVIDER GRID ===================== */

.email-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.email-provider-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.email-provider-card:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border);
}

.email-provider-card-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.email-provider-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.email-provider-card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-provider-card-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===================== EMAIL PROVIDER MODAL ===================== */

.email-provider-modal {
  max-width: 520px;
  width: 90%;
}

.email-modal-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-modal-header-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.email-modal-host-grid {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.email-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   Workflow Intelligence Panel — Devices-style theme
   ═══════════════════════════════════════════════════ */

.sc-panel {
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  gap: 24px;
  animation: sc-fade-in 0.6s ease-out;
}

@keyframes sc-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.sc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.sc-title {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.sc-subtitle {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

.sc-message {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  color: var(--color-text);
  font-size: 13px;
  font-family: var(--font-ui);
}

/* ── Status cards row ── */

.sc-status-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.sc-status-card {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-glass) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sc-status-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-subtle);
}

.sc-status-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.sc-status-value {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 8px;
}

.sc-status-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

/* ── Policy controls card ── */

.sc-card {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-glass) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: var(--shadow-sm);
}

.sc-card-title {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.sc-controls-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.sc-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  transition: all 0.15s;
}

.sc-checkbox:hover {
  background: var(--color-bg-glass-hover);
  border-color: var(--color-accent-subtle);
}

.sc-checkbox input[type="checkbox"] {
  accent-color: var(--color-accent);
}

.sc-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  transition: all 0.15s;
}

.sc-input-group:hover,
.sc-input-group:focus-within {
  border-color: var(--color-accent-subtle);
  background: var(--color-bg-glass-hover);
}

.sc-input-group:focus-within {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 15%, transparent);
}

.sc-input-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.sc-input-group input[type="number"] {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 600;
  width: 100%;
}

.sc-target-kinds {
  margin-top: 16px;
}

.sc-target-kinds-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 10px;
}

.sc-target-kinds-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-kind-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.sc-kind-chip:hover {
  border-color: var(--color-accent-subtle);
  background: var(--color-bg-glass-hover);
}

.sc-kind-chip.active {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  font-weight: 600;
}

.sc-kind-chip input[type="checkbox"] {
  display: none;
}

/* ── Action buttons ── */

.sc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sc-btn {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-glass) 100%);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.sc-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-subtle);
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-accent-subtle) 100%);
  color: var(--color-accent);
}

.sc-btn:active {
  transform: translateY(0);
}

.sc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sc-btn.primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, color-mix(in srgb, var(--color-accent) 80%, black 20%) 100%);
  border-color: var(--color-accent);
  color: white;
}

.sc-btn.primary:hover {
  box-shadow: var(--shadow-md), 0 0 20px color-mix(in srgb, var(--color-accent) 30%, transparent);
  color: white;
}

.sc-btn.danger {
  border-color: color-mix(in srgb, var(--color-error) 40%, transparent);
}

.sc-btn.danger:hover {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-error-subtle) 100%);
  border-color: var(--color-error);
  color: var(--color-error);
}

/* ── Targets layout ── */

.sc-body {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.sc-targets-list {
  display: grid;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sc-target-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-bg-glass);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--color-text);
  font-family: var(--font-ui);
}

.sc-target-btn:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-accent-subtle);
  background: var(--color-bg-glass-hover);
}

.sc-target-btn.selected {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-accent-subtle) 100%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--color-accent) 12%, transparent);
}

.sc-target-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sc-target-name {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-target-health {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  white-space: nowrap;
}

.sc-target-health.watch {
  color: var(--color-accent);
  border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.sc-target-health.healthy {
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 30%, transparent);
}

.sc-target-health.blocked {
  color: var(--color-error);
  border-color: color-mix(in srgb, var(--color-error) 30%, transparent);
}

.sc-health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sc-target-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.sc-target-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-family: var(--font-ui);
}

/* ── Detail pane ── */

.sc-detail-stack {
  display: grid;
  gap: 16px;
}

.sc-detail-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-detail-name {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.sc-detail-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-muted);
}

.sc-detail-section-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.sc-detail-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-detail-list li {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-subtle);
  transition: background 0.12s;
}

.sc-detail-list li:hover {
  background: var(--color-bg-glass-hover);
}

.sc-detail-list li strong {
  color: var(--color-text);
  font-weight: 600;
}

.sc-detail-list li code {
  background: var(--color-bg-tertiary);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.sc-detail-list li a {
  color: var(--color-accent);
  text-decoration: none;
}

.sc-detail-list li a:hover {
  text-decoration: underline;
}

.sc-detail-winner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-accent-subtle);
  border: 1px solid color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.sc-detail-winner-text {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.sc-detail-winner-rec {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

.sc-detail-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-family: var(--font-ui);
}

/* ── Bottom grid (backlog + dispatch + active runs) ── */

.sc-bottom-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.sc-link-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-ui);
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s;
}

.sc-link-btn:hover {
  color: var(--color-text);
}

.sc-loading {
  padding: 64px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-family: var(--font-ui);
  animation: sc-fade-in 0.6s ease-out;
}

/* ==================== CRITICAL TASK COMPOSER STARTUP STYLES ==================== */
/* Typewriter placeholder inside the CLI input */
.cli-rotating-placeholder {
  position: absolute;
  left: 0;
  top: 50%;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 8px);
  padding-right: 4px;
  border-right: 1px solid currentColor;
  transform: translateY(-50%);
  animation: placeholder-caret-blink 1s step-end infinite;
}

/* CLI Input Styles */
.cli-input-container {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.cli-input-wrapper {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  gap: 10px;
  position: relative;
}

.mention-autocomplete-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.mention-autocomplete-wrapper:focus-within~.cli-cursor {
  opacity: 1;
}

.cli-input-prompt {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.cli-input {
  flex: 1;
  padding: 0 !important;
  font-family: var(--font-mono) !important;
}

.cli-input-container .welcome-input {
  min-height: 38px;
}

/* ── Active Mode Badge (footer indicator) ── */
.active-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--color-accent, #6366f1);
  background: color-mix(in srgb, var(--color-accent, #6366f1) 15%, transparent);
  color: var(--color-accent, #6366f1);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.12s ease;
  white-space: nowrap;
  animation: dropdownFadeIn 0.15s ease;
}

.active-mode-badge:hover {
  background: color-mix(in srgb, var(--color-accent, #6366f1) 25%, transparent);
}

/* ── Mode Suggestion Bar ── */
.mode-suggestion-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 4px;
  animation: dropdownFadeIn 0.15s ease;
}

.mode-suggestion-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.mode-suggestion-pill:hover {
  background: var(--color-accent, #6366f1);
  color: #fff;
  border-color: var(--color-accent, #6366f1);
}

.mode-suggestion-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px;
  margin-left: auto;
  border-radius: 4px;
  transition: color 0.12s ease;
}

.mode-suggestion-dismiss:hover {
  color: var(--color-text);
}

.mention-autocomplete-dropdown {
  --mention-option-row-height: 58px;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  width: min(720px, calc(100vw - 64px));
  max-width: min(720px, calc(100vw - 64px));
  max-height: min(
    calc((var(--mention-option-row-height) * 8) + 76px),
    calc(100vh - 180px)
  );
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  overflow-y: hidden;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  z-index: 1000;
  animation: dropdownFadeIn 0.15s ease;
}

.mention-autocomplete-section+.mention-autocomplete-section {
  margin-top: 8px;
}

.mention-autocomplete-section-label {
  padding: 5px 8px 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.mention-autocomplete-section-list {
  max-height: calc(var(--mention-option-row-height) * 4);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.mention-autocomplete-section-list::-webkit-scrollbar {
  width: 6px;
}

.mention-autocomplete-section-list::-webkit-scrollbar-track {
  background: transparent;
}

.mention-autocomplete-section-list::-webkit-scrollbar-thumb {
  background: var(--color-border-subtle);
  border-radius: 999px;
}

.mention-autocomplete-item {
  min-height: var(--mention-option-row-height);
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
  font-size: 12px;
  transition: background 0.12s ease;
}

.mention-autocomplete-item:hover,
.mention-autocomplete-item.selected {
  background: var(--color-bg-hover);
}

.mention-autocomplete-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}

.mention-autocomplete-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.mention-autocomplete-name {
  font-weight: 600;
  display: block;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mention-autocomplete-desc {
  font-size: 10px;
  color: var(--color-text-secondary);
  display: block;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Slash command autocomplete (reuses mention styles) */
.slash-autocomplete-dropdown {
  max-height: 300px;
  overflow-y: auto;
}

.slash-command-icon {
  background-color: var(--color-bg-hover) !important;
  font-size: 14px;
  color: var(--color-text) !important;
}

.cli-cursor {
  width: 8px;
  height: 18px;
  background: var(--color-accent);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}

.cli-cursor.active {
  animation: blink 1s step-end infinite;
}

.visual-warm .cli-cursor,
.visual-oblivion .cli-cursor {
  width: 1px;
  height: 1.55em;
  background: var(--color-text);
}

/* Hidden span used to measure placeholder text width */
.cli-placeholder-measure {
  position: absolute;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  white-space: pre;
  font-family: var(--font-mono) !important;
  font-size: 14px;
}

.cli-input:focus~.cli-cursor {
  opacity: 1;
}

.cli-input.input-textarea-empty-placeholder {
  caret-color: transparent;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

@keyframes placeholder-caret-blink {
  0%,
  50% {
    border-color: currentColor;
  }

  51%,
  100% {
    border-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cli-rotating-placeholder {
    animation: none;
    border-right-color: transparent;
  }
}

/* CLI Input Footer */
.cli-input-container .welcome-input-footer {
  background: transparent;
  border-top: none;
}

.cli-input-container .folder-selector {
  font-family: var(--font-mono);
  background: transparent;
  border-color: var(--color-border-subtle);
}

.cli-input-container .folder-selector:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cli-input-container .model-selector {
  font-family: var(--font-mono);
  background: transparent;
  border-color: var(--color-border-subtle);
}

.cli-input-container .model-selector:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.cli-input-container .lets-go-btn {
  font-family: var(--font-mono);
  background: var(--color-accent);
  border: none;
  box-shadow: 0 0 10px var(--color-accent-subtle);
}

.cli-input-container .lets-go-btn::before {
  display: none;
}

.cli-input-container .lets-go-btn:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--color-accent-subtle);
}

/* Welcome Input */
.welcome-input-container {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border-subtle);
  border-radius: 20px;
  padding: 5px 6px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.welcome-input-container:focus-within {
  border-color: var(--color-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.welcome-input-container.drag-over {
  outline: 1px dashed var(--color-border);
  background: var(--color-bg-hover);
}

.welcome-input {
  width: 100%;
  padding: 18px 20px 12px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 14px;
  outline: none;
  min-height: 56px;
}

.welcome-input::placeholder {
  color: var(--color-text-muted);
}

.welcome-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  border-top: none;
}

.input-left-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.permission-dropdown-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.permission-access-btn {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.permission-access-btn:hover,
.permission-access-btn[aria-expanded="true"] {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.permission-access-btn.full {
  color: #e64a00;
}

.permission-access-btn.full:hover,
.permission-access-btn.full[aria-expanded="true"] {
  color: #e64a00;
  background: rgba(230, 74, 0, 0.08);
}

.permission-access-btn svg {
  flex-shrink: 0;
}

.cli-input-container .attachment-btn,
.cli-input-container .permission-access-btn,
.cli-input-container .model-selector,
.cli-input-container .voice-input-btn,
.cli-input-container .model-label-subtle {
  border: none;
  background: transparent;
  box-shadow: none;
}

.cli-input-container .attachment-btn,
.cli-input-container .voice-input-btn {
  width: 36px;
  height: 36px;
  border-radius: 0;
  color: var(--color-text-muted);
}

.cli-input-container .attachment-btn svg {
  width: 18px;
  height: 18px;
}

.cli-input-container .attachment-btn:hover,
.cli-input-container .voice-input-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--color-text);
}

.input-container .attachment-btn,
.input-container .voice-input-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--color-text-muted);
}

.input-container .attachment-btn svg {
  width: 18px;
  height: 18px;
}

.input-container .attachment-btn:hover,
.input-container .voice-input-btn:hover:not(:disabled) {
  background: transparent;
  color: var(--color-text);
}

.input-container .lets-go-btn {
  font-family: var(--font-mono);
  background: var(--color-accent);
  border: none;
  box-shadow: 0 0 10px var(--color-accent-subtle);
}

.input-container .lets-go-btn::before {
  display: none;
}

.input-container .lets-go-btn:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--color-accent-subtle);
}

.cli-input-container .permission-access-btn:hover,
.cli-input-container .permission-access-btn[aria-expanded="true"],
.cli-input-container .model-selector:hover,
.cli-input-container .model-label-subtle:hover {
  background: transparent;
  color: var(--color-text);
}

.cli-input-container .permission-access-btn.full:hover,
.cli-input-container .permission-access-btn.full[aria-expanded="true"] {
  background: transparent;
  color: #e64a00;
}

.permission-access-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 120;
  min-width: 210px;
  padding: 5px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-lg);
}

.permission-access-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.permission-access-option span {
  flex: 0 1 auto;
  text-align: left;
}

.permission-access-option:hover,
.permission-access-option.active {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.permission-access-option.danger {
  color: #e64a00;
}

.permission-access-option.danger:hover,
.permission-access-option.danger.active {
  background: rgba(230, 74, 0, 0.08);
  color: #e64a00;
}

.permission-access-option svg {
  flex-shrink: 0;
}

.input-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-selector:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.folder-selector .chevron-up {
  transform: rotate(180deg);
}

.workspace-dropdown-container {
  position: relative;
}

.input-row > .workspace-dropdown-container:empty {
  display: none;
}

html
  :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    textarea,
    select,
    .prompt-composer-input,
    .input-field,
    .input-textarea,
    .welcome-input,
    .cli-input,
    .settings-input,
    .settings-textarea,
    .skill-param-input,
    .onboarding-input,
    .onboarding-textarea,
    .command-stdin-input,
    [role="textbox"]
  ) {
  font-family: var(--font-google-sans);
  font-variant-ligatures: none;
  font-variation-settings: "ROND" 0, "slnt" 0, "wdth" 92;
  letter-spacing: 0;
}
/* ==================== END CRITICAL TASK COMPOSER STARTUP STYLES ==================== */
