:root {
  /* Layout Dimensions */
  --qss-header-height: 56px;
  --qss-left-sidebar-width: 196px;
  --qss-right-panel-width: clamp(248px, 22vw, 292px);
  --qss-panel-gap: 16px;

  /* Z-Index Hierarchy */
  --qss-z-base: 1;
  --qss-z-header: 100;
  --qss-z-panel: 50;
  --qss-z-modal: 1000;
  --qss-z-tooltip: 2000;

  /* Shell Colors */
  --qss-shell-bg: #070514;
  --qss-shell-surface: rgba(18, 14, 46, 0.65);
  --qss-shell-surface-hover: rgba(99, 102, 241, 0.15);
  --qss-shell-border: rgba(99, 102, 241, 0.25);
  --qss-shell-text: #f3f4f6;
  --qss-shell-muted: #9ca3af;
  --qss-shell-accent: #6366f1;
  --qss-shell-danger: #ef4444;
  --qss-shell-success: #10b981;

  /* Semantic shell surfaces (dark) */
  --qss-shell-header-bg: rgba(10, 8, 28, 0.65);
  --qss-shell-panel-bg: rgba(10, 8, 28, 0.45);
  --qss-shell-workspace-bg: #070514;
  --qss-shell-canvas-bg: #070514;
  --qss-shell-canvas-gradient-1: rgba(99, 102, 241, 0.1);
  --qss-shell-canvas-gradient-2: rgba(6, 182, 212, 0.08);
  --qss-shell-btn-text: #ffffff;
  --qss-shell-btn-text-on-accent: #ffffff;
  --qss-shell-input-bg: rgba(255, 255, 255, 0.08);
  --qss-shell-input-border: var(--qss-shell-border);
  --qss-shell-tab-header-bg: rgba(18, 14, 46, 0.55);
  --qss-shell-tab-hover-text: #ffffff;
  --qss-shell-markdown-bg: #000000;
  --qss-shell-markdown-text: #a5b4fc;
  --qss-shell-card-bg: rgba(18, 14, 46, 0.45);
  --qss-shell-card-border: rgba(99, 102, 241, 0.2);
  --qss-shell-thumb-bg: #111111;
  --qss-shell-shadow: rgba(0, 0, 0, 0.55);
  --qss-shell-divider: rgba(99, 102, 241, 0.18);

  /* Dashboard Fallback Mapping */
  --qss-bg-app: #070514;
  --qss-bg-panel: rgba(18, 14, 46, 0.65);
  --qss-border-light: rgba(99, 102, 241, 0.2);
  --qss-text-primary: #f3f4f6;
  --qss-text-secondary: #9ca3af;
  --qss-primary-hover: #818cf8;

  /* Legacy studio.css aliases (dark) */
  --studio-bg: #0b0f19;
  --studio-surface: #1e293b;
  --studio-surface-2: rgba(30, 41, 59, 0.65);
  --studio-border: rgba(255, 255, 255, 0.1);
  --studio-text: #f8fafc;
  --studio-muted: #94a3b8;
  --studio-text-muted: #94a3b8;

  --studio-primary: #6366f1;
  --studio-primary-hover: #818cf8;
  --studio-accent: #6366f1;
  --studio-accent-hover: #818cf8;

  --studio-warning: #f59e0b;
  --studio-warning-hover: #d97706;
  --studio-danger: #ef4444;
  --studio-danger-hover: #dc2626;

  --studio-radius-sm: 4px;
  --studio-radius-md: 8px;
  --studio-radius-lg: 12px;

  --studio-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --studio-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);

  --studio-workspace-bg: #0c0a1a;
  --studio-grid-line: rgba(99, 102, 241, 0.08);

  /* Typography */
  --qss-font-ui: 'Outfit', 'Inter', sans-serif;
}

html.qss-light-theme {
  --qss-shell-bg: #f1f5f9;
  --qss-shell-surface: rgba(255, 255, 255, 0.92);
  --qss-shell-surface-hover: rgba(99, 102, 241, 0.1);
  --qss-shell-border: rgba(99, 102, 241, 0.22);
  --qss-shell-text: #0f172a;
  --qss-shell-muted: #64748b;
  --qss-shell-accent: #4f46e5;
  --qss-shell-danger: #e11d48;
  --qss-shell-success: #16a34a;

  --qss-shell-header-bg: rgba(255, 255, 255, 0.94);
  --qss-shell-panel-bg: rgba(248, 250, 252, 0.96);
  --qss-shell-workspace-bg: #eef2ff;
  --qss-shell-canvas-bg: #e2e8f0;
  --qss-shell-canvas-gradient-1: rgba(99, 102, 241, 0.08);
  --qss-shell-canvas-gradient-2: rgba(14, 165, 233, 0.06);
  --qss-shell-btn-text: #0f172a;
  --qss-shell-btn-text-on-accent: #ffffff;
  --qss-shell-input-bg: #ffffff;
  --qss-shell-input-border: rgba(148, 163, 184, 0.45);
  --qss-shell-tab-header-bg: rgba(241, 245, 249, 0.98);
  --qss-shell-tab-hover-text: #0f172a;
  --qss-shell-markdown-bg: #f8fafc;
  --qss-shell-markdown-text: #4338ca;
  --qss-shell-card-bg: rgba(255, 255, 255, 0.88);
  --qss-shell-card-border: rgba(99, 102, 241, 0.18);
  --qss-shell-thumb-bg: #cbd5e1;
  --qss-shell-shadow: rgba(15, 23, 42, 0.12);
  --qss-shell-divider: rgba(148, 163, 184, 0.35);

  --qss-bg-app: #f1f5f9;
  --qss-bg-panel: rgba(255, 255, 255, 0.92);
  --qss-border-light: rgba(99, 102, 241, 0.15);
  --qss-text-primary: #0f172a;
  --qss-text-secondary: #64748b;
  --qss-primary-hover: #4338ca;

  --studio-bg: #f8fafc;
  --studio-surface: #ffffff;
  --studio-surface-2: #f1f5f9;
  --studio-surface-hover: #eef2ff;
  --studio-border: rgba(148, 163, 184, 0.35);
  --studio-text: #0f172a;
  --studio-muted: #64748b;
  --studio-text-muted: #64748b;
  --studio-accent: #4f46e5;
  --studio-accent-hover: #4338ca;
  --studio-primary: #4f46e5;
  --studio-primary-hover: #4338ca;
  --studio-warning: #d97706;
  --studio-warning-hover: #b45309;
  --studio-danger: #e11d48;
  --studio-danger-hover: #be123c;
  --studio-workspace-bg: #eef2ff;
  --studio-grid-line: rgba(100, 116, 139, 0.12);
  --studio-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --studio-shadow-md: 0 16px 40px rgba(15, 23, 42, 0.12);
}
