@layer tokens, base, components, overrides;
/**
 * SimulateAI Design Tokens - Comprehensive Educational Design System
 * 
 * Modern token architecture optimized for educational excellence and accessibility.
 * This file establishes the foundational design system tokens that power the entire
 * SimulateAI platform with pedagogical effectiveness and technical precision.
 * 
 * TOKEN ARCHITECTURE:
 * 1. PRIMITIVE TOKENS (foundation colors, scales, measurements)
 * 2. SEMANTIC TOKENS (purpose-driven mappings)  
 * 3. COMPONENT TOKENS (specific UI element tokens)
 * 4. EDUCATIONAL TOKENS (SimulateAI-specific pedagogical patterns)
 * 
 * DESIGN PRINCIPLES:
 * - Educational Excellence: Optimized for learning and comprehension
 * - Accessibility First: WCAG 2.1 AA compliance minimum
 * - Pedagogical Clarity: Clear visual hierarchy for educational content
 * - Multi-theme Support: Light, dark, high-contrast, system preference
 * - Backwards Compatible: All existing tokens preserved
 * 
 * LOAD ORDER CRITICAL:
 * 1. design-tokens.css (this file) - Foundation variables
 * 2. media.css - Responsive breakpoints
 * 3. main.css - Base styles
 * 4. All other component CSS files
 * 
 * @version 1.80.0 - Modernized Token Architecture
 * @author SimulateAI Development Team
 * @educational-context AI Ethics Education Platform
 * @accessibility WCAG 2.1 AA Compliant
 */
@layer tokens {
  :root {
    /* ===== PRIMITIVE TOKENS - FOUNDATION LAYER ===== */

    /* === CORE BRAND PALETTE === */

    /* SimulateAI Brand Colors - Optimized for Educational Context */
    --brand-primary-50: #eff6ff;
    --brand-primary-100: #dbeafe;
    --brand-primary-200: #bfdbfe;
    --brand-primary-300: #93c5fd;
    --brand-primary-400: #60a5fa;
    --brand-primary-500: #3b82f6; /* Primary Brand Blue */
    --brand-primary-600: #2563eb;
    --brand-primary-700: #1d4ed8;
    --brand-primary-800: #1e40af;
    --brand-primary-900: #1e3a8a;
    --brand-primary-950: #172554;

    /* Educational Success Colors - Progress & Achievement */
    --brand-success-50: #ecfdf5;
    --brand-success-100: #d1fae5;
    --brand-success-200: #a7f3d0;
    --brand-success-300: #6ee7b7;
    --brand-success-400: #34d399;
    --brand-success-500: #10b981; /* Success Green */
    --brand-success-600: #059669;
    --brand-success-700: #047857;
    --brand-success-800: #065f46;
    --brand-success-900: #064e3b;
    --brand-success-950: #022c22;

    /* Attention & Warning Colors - Alerts & Guidance */
    --brand-warning-50: #fffbeb;
    --brand-warning-100: #fef3c7;
    --brand-warning-200: #fde68a;
    --brand-warning-300: #fcd34d;
    --brand-warning-400: #fbbf24;
    --brand-warning-500: #f59e0b; /* Warning Amber */
    --brand-warning-600: #d97706;
    --brand-warning-700: #b45309;
    --brand-warning-800: #92400e;
    --brand-warning-900: #78350f;
    --brand-warning-950: #451a03;

    /* Error & Critical Colors - Mistakes & Important Alerts */
    --brand-error-50: #fef2f2;
    --brand-error-100: #fee2e2;
    --brand-error-200: #fecaca;
    --brand-error-300: #fca5a5;
    --brand-error-400: #f87171;
    --brand-error-500: #ef4444; /* Error Red */
    --brand-error-600: #dc2626;
    --brand-error-700: #b91c1c;
    --brand-error-800: #991b1b;
    --brand-error-900: #7f1d1d;
    --brand-error-950: #450a0a;

    /* === EDUCATIONAL PALETTE === */

    /* Ethical Framework Colors - Philosophy Differentiation */
    --ethics-utilitarian-50: #eff6ff;
    --ethics-utilitarian-500: #3b82f6; /* Blue for Utilitarian Ethics */
    --ethics-utilitarian-700: #1d4ed8;
    --ethics-deontological-50: #f0fdf4;
    --ethics-deontological-500: #22c55e; /* Green for Deontological Ethics */
    --ethics-deontological-700: #15803d;
    --ethics-virtue-50: #faf5ff;
    --ethics-virtue-500: #a855f7; /* Purple for Virtue Ethics */
    --ethics-virtue-700: #7c2d12;

    /* Learning State Colors - Progress & Mastery */
    --learning-locked: #6b7280;
    --learning-available: #3b82f6;
    --learning-progress: #f59e0b;
    --learning-completed: #10b981;
    --learning-mastery: #7c2d12;

    /* === NEUTRAL FOUNDATION === */

    /* Pure Foundation */
    --primitive-white: #fff;
    --primitive-black: #000;

    /* Comprehensive Gray Scale - Enhanced for Educational Hierarchy */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* === DATA VISUALIZATION PALETTE === */

    /* Chart Colors - Optimized for Accessibility and Distinction */
    --data-color-1: #3b82f6; /* Primary Blue */
    --data-color-2: #10b981; /* Success Green */
    --data-color-3: #f59e0b; /* Warning Amber */
    --data-color-4: #ef4444; /* Error Red */
    --data-color-5: #8b5cf6; /* Purple */
    --data-color-6: #06b6d4; /* Cyan */
    --data-color-7: #84cc16; /* Lime */
    --data-color-8: #f97316; /* Orange */

    /* Progress Ring Colors - Semantic Progress Visualization */
    --progress-empty: var(--gray-200);
    --progress-low: var(--brand-error-500);
    --progress-medium: var(--brand-warning-500);
    --progress-high: var(--brand-success-500);
    --progress-complete: var(--brand-primary-500);

    /* ===== BACKWARDS COMPATIBILITY LAYER ===== */

    /* Legacy Brand Colors - Preserved for Existing Components */
    --color-brand-primary: #1a73e8; /* Original SimulateAI blue */
    --color-brand-secondary: #667eea; /* More purple lean for AI/tech uniqueness */
    --color-brand-tertiary: #34a853;
    --color-brand-accent: #4facfe; /* Gradient endpoint option */

    /* Primary color system - Maintained */
    --color-primary: #1a73e8;
    --color-primary-dark: #1565c0;
    --color-primary-light: #42a5f5;
    --color-secondary: #6b7280;
    --color-secondary-dark: #4b5563;

    /* Semantic colors - Enhanced but Compatible */
    --color-success: #34a853;
    --color-warning: #fbbc04;
    --color-error: #ea4335;
    --color-info: #4285f4;

    /* Professional accent colors for warmth and approachability */
    --color-warm-accent: #f59e0b; /* Professional amber */
    --color-cool-accent: #06b6d4; /* Tech cyan */

    /* Modal accent colors for gradient system */
    --color-accent-primary: #8b5cf6; /* Purple for creativity/learning */
    --color-accent-secondary: #06b6d4; /* Tech cyan for balance */

    /* AI/Education specific colors */
    --color-creativity: #8b5cf6; /* Purple for creativity/learning */
    --color-data-viz: #6366f1; /* Indigo for data visualization */
    --color-learning-success: #14b8a6; /* Teal for positive learning outcomes */

    /* Legacy Neutral Scale - Mapped to Modern System */
    --color-white: var(--primitive-white);
    --color-black: var(--primitive-black);
    --color-gray-50: var(--gray-50);
    --color-gray-100: var(--gray-100);
    --color-gray-200: var(--gray-200);
    --color-gray-300: var(--gray-300);
    --color-gray-400: var(--gray-400);
    --color-gray-500: var(--gray-500);
    --color-gray-600: var(--gray-600);
    --color-gray-700: var(--gray-700);
    --color-gray-800: var(--gray-800);
    --color-gray-900: var(--gray-900);

    /* ===== MODERN SEMANTIC TOKENS ===== */

    /* === SURFACE SYSTEM === */

    /* Modern semantic surface colors for layered interfaces */
    --surface-background: var(--primitive-white);
    --surface-container: var(--gray-50);
    --surface-card: var(--primitive-white);
    --surface-overlay: var(--gray-100);
    --surface-elevated: var(--primitive-white);
    --surface-interactive: var(--gray-100);
    --surface-disabled: var(--gray-200);

    /* === CONTENT SYSTEM === */

    /* Semantic content colors for text and icons */
    --content-primary: var(--gray-900);
    --content-secondary: var(--gray-700);
    --content-tertiary: var(--gray-500);
    --content-muted: var(--gray-400);
    --content-inverse: var(--primitive-white);
    --content-on-accent: var(--primitive-white);
    --content-disabled: var(--gray-400);

    /* === BORDER SYSTEM === */

    /* Modern semantic border colors for visual hierarchy */
    --border-subtle: var(--gray-200);
    --border-default: var(--gray-300);
    --border-strong: var(--gray-400);
    --border-interactive: var(--gray-500);
    --border-focus: var(--brand-primary-500);
    --border-disabled: var(--gray-200);

    /* === ACCENT SYSTEM === */

    /* Semantic accent colors for actions and states */
    --accent-primary: var(--brand-primary-500);
    --accent-primary-hover: var(--brand-primary-600);
    --accent-primary-active: var(--brand-primary-700);
    --accent-primary-subtle: var(--brand-primary-100);
    --accent-success: var(--brand-success-500);
    --accent-success-hover: var(--brand-success-600);
    --accent-success-active: var(--brand-success-700);
    --accent-success-subtle: var(--brand-success-100);
    --accent-warning: var(--brand-warning-500);
    --accent-warning-hover: var(--brand-warning-600);
    --accent-warning-active: var(--brand-warning-700);
    --accent-warning-subtle: var(--brand-warning-100);
    --accent-error: var(--brand-error-500);
    --accent-error-hover: var(--brand-error-600);
    --accent-error-active: var(--brand-error-700);
    --accent-error-subtle: var(--brand-error-100);

    /* === EDUCATIONAL SEMANTIC TOKENS === */

    /* Scenario State Tokens */
    --scenario-locked: var(--gray-400);
    --scenario-locked-bg: var(--gray-100);
    --scenario-available: var(--brand-primary-500);
    --scenario-available-bg: var(--brand-primary-50);
    --scenario-progress: var(--brand-warning-500);
    --scenario-progress-bg: var(--brand-warning-50);
    --scenario-completed: var(--brand-success-500);
    --scenario-completed-bg: var(--brand-success-50);
    --scenario-mastery: var(--brand-primary-700);
    --scenario-mastery-bg: var(--brand-primary-100);

    /* Badge System Tokens */
    --badge-achievement: var(--brand-warning-500);
    --badge-achievement-bg: var(--brand-warning-100);
    --badge-progress: var(--brand-primary-500);
    --badge-progress-bg: var(--brand-primary-100);
    --badge-mastery: var(--brand-success-600);
    --badge-mastery-bg: var(--brand-success-100);
    --badge-special: #a855f7;
    --badge-special-bg: #faf5ff;

    /* Ethical Framework Visual Tokens */
    --ethical-utilitarian: var(--ethics-utilitarian-500);
    --ethical-utilitarian-bg: var(--ethics-utilitarian-50);
    --ethical-deontological: var(--ethics-deontological-500);
    --ethical-deontological-bg: var(--ethics-deontological-50);
    --ethical-virtue: var(--ethics-virtue-500);
    --ethical-virtue-bg: var(--ethics-virtue-50);

    /* === INTERACTION STATE TOKENS === */

    /* Hover States */
    --hover-surface: var(--gray-50);
    --hover-overlay: rgb(0 0 0 / 4%);
    --hover-brightness: 1.05;

    /* Active States */
    --active-surface: var(--gray-100);
    --active-overlay: rgb(0 0 0 / 8%);
    --active-brightness: 0.95;

    /* Interactive Affordance Tokens (new) */
    /* Color changes for common interactive elements (links, buttons, nav items) */
    --interactive-fg: var(--theme-text-primary);
    --interactive-fg-hover: var(--theme-text-primary);
    --interactive-fg-active: var(--theme-text-primary);
    --interactive-bg-hover: var(--hover-surface);
    --interactive-bg-active: var(--active-surface);
    --interactive-border-hover: var(--theme-border-focus);

    /* Cursor tokens */
    --cursor-interactive: pointer;
    --cursor-disabled: not-allowed;

    /* Outline & focus (complements existing focus ring tokens) */
    --focus-outline-style: solid;
    --focus-outline-width: var(--focus-ring-width, 2px);
    --focus-outline-offset: var(--focus-ring-offset, 2px);

    /* Transform effects */
    --hover-translate-y: -1px; /* subtle lift */
    --active-scale: 0.98; /* subtle press */

    /* Shadow & depth for interactive states */
    --shadow-hover: 0 4px 12px rgb(0 0 0 / 10%);
    --shadow-active: 0 2px 6px rgb(0 0 0 / 12%);

    /* Transitions & animation aliases (built from core duration/ease tokens) */
    --transition-fast: all var(--duration-150) var(--ease-in-out);
    --transition-normal: all var(--duration-200) var(--ease-in-out);
    --transition-slow: all var(--duration-300) var(--ease-in-out);

    /* Underline/border affordances */
    --underline-thickness: 2px;
    --underline-offset: 2px;
    --border-width: 1px;

    /* Loading States */
    --loading-shimmer: linear-gradient(
      90deg,
      transparent,
      var(--gray-100),
      transparent
    );
    --loading-pulse: var(--gray-200);
    --loading-spinner: var(--brand-primary-500);

    /* Disabled States (reference existing tokens) */
    --disabled-surface: var(--gray-100);
    --disabled-content: var(--gray-400);
    --disabled-cursor: not-allowed;

    /* ===== BACKWARDS COMPATIBLE SURFACE TOKENS ===== */

    /* Surface colors (light base) */
    --color-surface: var(--color-white);
    --color-surface-secondary: var(--color-gray-50);
    --color-surface-tertiary: var(--color-gray-100);
    --color-on-surface: var(--color-gray-900);
    --color-on-surface-secondary: var(--color-gray-700);
    --color-on-surface-tertiary: var(--color-gray-500);

    /* Semantic theme tokens */
    --theme-bg-primary: var(--color-surface);
    --theme-bg-secondary: var(--color-surface-secondary);
    --theme-bg-tertiary: var(--color-surface-tertiary);
    --theme-bg-interactive: var(--color-gray-50);
    --theme-bg-overlay: rgb(0 0 0 / 50%);
    --theme-bg-overlay-light: rgb(255 255 255 / 20%);
    --theme-bg-overlay-medium: rgb(255 255 255 / 30%);
    --theme-border-overlay: rgb(255 255 255 / 30%);
    --theme-text-primary: var(--color-on-surface);
    --theme-text-secondary: var(--color-on-surface-secondary);
    --theme-text-tertiary: var(--color-on-surface-tertiary);
    --theme-text-muted: var(--color-gray-400);
    --theme-text-inverse: var(--color-white);
    --theme-text-inverse-secondary: rgb(255 255 255 / 80%);
    --theme-text-on-accent: var(--color-white);
    --theme-border-primary: var(--color-gray-200);
    --theme-border-secondary: var(--color-gray-300);
    --theme-border-interactive: var(--color-gray-400);
    --theme-border-focus: var(--color-primary);
    --theme-border-error: var(--color-error);
    --theme-border-success: var(--color-success);
    --theme-hover-opacity: var(--hover-opacity);
    --theme-disabled-opacity: var(--disabled-opacity);
    --theme-accent-primary: var(--color-primary);
    --theme-accent-secondary: var(--color-secondary);
    --theme-accent-success: var(--color-success);
    --theme-accent-warning: var(--color-warning);
    --theme-accent-error: var(--color-error);
    --theme-accent-info: var(--color-info);

    /* ===== ENHANCED THEME COORDINATION ===== */
    --theme-accent-creativity: var(--color-creativity);
    --theme-accent-data-viz: var(--color-data-viz);
    --theme-accent-learning: var(--color-learning-success);
    --theme-accent-warm: var(--color-warm-accent);
    --theme-accent-cool: var(--color-cool-accent);

    /* ===== HERO GRADIENT SYSTEM ===== */

    /* Professional hero title gradients - theme aware */
    --hero-title-gradient-light: linear-gradient(
      135deg,
      var(--primitive-white) 0%,
      var(--gray-100) 20%,
      var(--brand-primary-200) 60%,
      var(--brand-primary-500) 100%
    );
    --hero-title-gradient-dark: linear-gradient(
      135deg,
      var(--gray-100) 0%,
      var(--gray-300) 40%,
      var(--gray-500) 100%
    );

    /* Enhanced focus management */
    --theme-focus-ring: var(--color-focus-ring);
    --theme-selection-bg: var(--color-selection);
    --theme-highlight-bg: var(--color-highlight);
    --theme-shadow-light: rgb(0 0 0 / 10%);
    --theme-shadow-medium: rgb(0 0 0 / 15%);
    --theme-shadow-heavy: rgb(0 0 0 / 20%);
    --theme-shadow-focus: rgb(59 130 246 / 40%);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 5%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px 0 rgb(0 0 0 / 6%);
    --shadow-base:
      0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
    --shadow-md:
      0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
    --shadow-lg:
      0 20px 25px -5px rgb(0 0 0 / 10%), 0 10px 10px -5px rgb(0 0 0 / 4%);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 25%);
    --shadow-2xl: 0 50px 100px -20px rgb(0 0 0 / 25%);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 6%);

    /* ===== PROFESSIONAL GRADIENTS ===== */
    --gradient-primary: linear-gradient(135deg, #1a73e8 0%, #667eea 100%);
    --gradient-success: linear-gradient(135deg, #34a853 0%, #10b981 100%);
    --gradient-premium: linear-gradient(135deg, #1a73e8 0%, #8b5cf6 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ea4335 100%);
    --gradient-cool: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-data: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-learning: linear-gradient(135deg, #14b8a6 0%, #34a853 100%);
    --gradient-modal-accent: linear-gradient(
      90deg,
      var(--color-brand-primary) 0%,
      var(--color-brand-secondary) 25%,
      var(--color-accent-primary) 50%,
      var(--color-accent-secondary) 75%,
      var(--color-brand-accent) 100%
    );
    /* Active hero gradient (switches based on theme) */
    --hero-title-gradient: var(--hero-title-gradient-light);

    /* ===== TYPOGRAPHY TOKENS ===== */

    /* Font families */
    --font-family-base:
      -apple-system, blinkmacsystemfont, "Segoe UI", roboto, sans-serif;
    --font-family-primary: var(--font-family-base);
    --font-family-mono:
      "SFMono-Regular", consolas, "Liberation Mono", menlo, monospace;

    /* Font sizes */
    --font-size-xs: 0.75rem; /* 12px */
    --font-size-sm: 0.875rem; /* 14px */
    --font-size-base: 1rem; /* 16px */
    --font-size-lg: 1.125rem; /* 18px */
    --font-size-xl: 1.25rem; /* 20px */
    --font-size-2xl: 1.5rem; /* 24px */
    --font-size-3xl: 1.875rem; /* 30px */
    --font-size-4xl: 2.25rem; /* 36px */

    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.6;
    --line-height-normal: var(--line-height-base);
    --line-height-relaxed: 1.75;

    /* Font weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Component-specific typography */
    --btn-font-size: var(--font-size-base);
    --btn-font-weight: var(--font-weight-medium);

    /* ===== LAYOUT DIMENSIONS ===== */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
    --container-max-width: var(--container-xl);

    /* ===== COMPONENT DIMENSIONS ===== */
    --header-height: 5rem; /* 80px - consistent with --header-h */
    --header-h: 80px; /* Alias for compatibility */
    --sidebar-width: 16rem; /* 256px */
    --modal-max-width: 32rem; /* 512px */
    --modal-max-height: 90vh;
    --tooltip-max-width: 20rem; /* 320px */

    /* ===== Z-INDEX SCALE ===== */
    --z-base: 0;
    --z-docked: 10;
    --z-dropdown: 1000;
    --z-sticky: 1010;
    --z-floating-tabs: 1015; /* Floating tabs above sticky but below banners */
    --z-banner: 1020;
    --z-overlay: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-skip-link: 1060;
    --z-toast: 1070;
    --z-tooltip: 1080;

    /* ===== ANIMATION & TRANSITIONS ===== */
    --duration-75: 75ms;
    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;
    --duration-700: 700ms;
    --duration-1000: 1000ms;
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* === MODERN MOTION SYSTEM === */

    /* Semantic Motion Tokens - Educational Interface Optimized */
    --motion-instant: var(--duration-75); /* Immediate feedback */
    --motion-quick: var(--duration-150); /* Hover states, toggles */
    --motion-medium: var(
      --duration-300
    ); /* Modal animations, page transitions */
    --motion-slow: var(--duration-500); /* Complex animations, data loading */
    --motion-deliberate: var(
      --duration-700
    ); /* Educational reveals, progress updates */

    /* Educational Motion Patterns */
    --motion-bounce: cubic-bezier(
      0.68,
      -0.55,
      0.265,
      1.55
    ); /* Achievement celebrations */
    --motion-gentle: cubic-bezier(
      0.25,
      0.46,
      0.45,
      0.94
    ); /* Scenario transitions */
    --motion-sharp: cubic-bezier(0.55, 0.055, 0.675, 0.19); /* Error alerts */
    --motion-smooth: cubic-bezier(0.23, 1, 0.32, 1); /* Progress animations */

    /* Micro-interaction Patterns */
    --motion-press: var(--motion-instant); /* Button press feedback */
    --motion-hover: var(--motion-quick); /* Hover state changes */
    --motion-focus: var(--motion-quick); /* Focus ring appearance */
    --motion-reveal: var(--motion-medium); /* Content reveals */
    --motion-celebration: var(--motion-deliberate); /* Achievement animations */

    /* Educational Content Motion */
    --motion-scenario-entry: var(--motion-medium);
    --motion-progress-update: var(--motion-slow);
    --motion-badge-reveal: var(--motion-deliberate);
    --motion-ethical-transition: var(--motion-medium);

    /* ===== USER PREFERENCE INTEGRATION ===== */

    /* These will be dynamically updated by settings-manager.js */
    --user-font-size: var(--font-size-base);
    --user-font-scale: 1;
    --user-line-height: var(--line-height-normal);
    --user-letter-spacing: normal;

    /* ===== ACCESSIBILITY TOKENS ===== */
    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;
    --focus-ring-color: var(--color-brand-primary);
    --focus-ring-opacity: 0.5;

    /* ===== MICRO-INTERACTION COLORS ===== */
    --color-focus-ring: #3b82f6; /* Slightly brighter for accessibility */
    --color-selection: rgb(26 115 232 / 10%); /* Text selection */
    --color-highlight: rgb(255 235 59 / 30%); /* Search highlights */
    --color-hover-overlay: rgb(0 0 0 / 4%); /* Subtle hover overlay */
    --color-active-overlay: rgb(0 0 0 / 8%); /* Subtle active overlay */

    /* ===== INTERACTION STATES ===== */
    --hover-opacity: 0.85; /* Improved from 0.8 for better feedback */
    --active-opacity: 0.7;
    --disabled-opacity: 0.5;
    --hover-scale: 1.02; /* Subtle scale for premium feel */
    --active-scale: 0.98; /* Slight press effect */

    /* ===== SPACING SCALE ===== */
    --space-px: 1px;
    --space-0: 0;
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem; /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-5: 1.25rem; /* 20px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --space-10: 2.5rem; /* 40px */
    --space-11: 2.75rem; /* 44px */
    --space-12: 3rem; /* 48px */
    --space-15: 3.75rem; /* 60px */
    --space-16: 4rem; /* 64px */
    --space-20: 5rem; /* 80px */

    /* ===== BORDER RADIUS SCALE ===== */
    --radius-none: 0;
    --radius-sm: 0.25rem; /* 4px */
    --radius-md: 0.375rem; /* 6px */
    --radius-lg: 0.5rem; /* 8px */
    --radius-xl: 0.75rem; /* 12px */
    --radius-2xl: 1rem; /* 16px */
    --radius-3xl: 1.5rem; /* 24px */
    --radius-full: 9999px; /* Fully rounded */

    /* ===== CONTENT WIDTHS ===== */
    --content-width-xs: 20rem; /* 320px */
    --content-width-sm: 24rem; /* 384px */
    --content-width-narrow: 45rem; /* ~720px */
    --content-width-normal: 65rem; /* ~1040px */
    --content-width-wide: 85rem; /* ~1360px */
    --content-width-full: 100%;
  }

  /* ===== SYSTEM PREFERENCE DARK MODE (FOLLOW OS SETTING) ===== */

  /* Only applies when user chooses "follow system" (no explicit theme class) */
  @media (prefers-color-scheme: dark) {
    :root:not(.theme-light, .theme-dark) {
      /* Apply dark mode tokens when OS is set to dark and user hasn't made explicit choice */
      --color-surface: #0d1117;
      --color-surface-secondary: #2d2d2d;
      --color-surface-tertiary: #21262d;
      --color-on-surface: #f0f6fc;
      --color-on-surface-secondary: #e6edf3;
      --color-on-surface-tertiary: #7d8590;

      /* Semantic theme tokens for system dark preference */
      --theme-bg-primary: #0d1117;
      --theme-bg-secondary: #2d2d2d;
      --theme-bg-tertiary: #21262d;
      --theme-bg-interactive: #262c36;
      --theme-bg-overlay: rgb(0 0 0 / 90%);
      --theme-bg-overlay-light: rgb(0 0 0 / 20%);
      --theme-bg-overlay-medium: rgb(0 0 0 / 30%);
      --theme-border-overlay: rgb(255 255 255 / 20%);
      --theme-text-primary: #f0f6fc;
      --theme-text-secondary: #e6edf3;
      --theme-text-tertiary: #7d8590;
      --theme-text-muted: #656d76;
      --theme-text-inverse: #0d1117;
      --theme-text-inverse-secondary: rgb(13 17 23 / 80%);
      --theme-text-on-accent: #fff;
      --theme-border-primary: #30363d;
      --theme-border-secondary: #21262d;
      --theme-border-interactive: #656d76;
      --theme-border-focus: #58a6ff;
      --theme-border-error: #f85149;
      --theme-border-success: #56d364;
      --theme-accent-primary: #58a6ff;
      --theme-accent-secondary: #8b949e;
      --theme-accent-success: #56d364;
      --theme-accent-warning: #e3b341;
      --theme-accent-error: #f85149;
      --theme-accent-info: #79c0ff;
      --theme-shadow-light: rgb(0 0 0 / 30%);
      --theme-shadow-medium: rgb(0 0 0 / 40%);
      --theme-shadow-heavy: rgb(0 0 0 / 50%);
      --theme-shadow-focus: rgb(88 166 255 / 40%);

      /* Interaction surfaces (dark) */
      --hover-surface: rgb(0 0 0 / 24%);
      --active-surface: rgb(0 0 0 / 36%);
      --nav-hover-surface: var(--hover-surface);
      --nav-active-surface: var(--active-surface);
      /* Interactive tokens tuning (system dark) */
      --interactive-fg: var(--theme-text-primary);
      --interactive-fg-hover: var(--theme-text-primary);
      --interactive-fg-active: var(--theme-text-primary);
      --interactive-bg-hover: var(--hover-surface);
      --interactive-bg-active: var(--active-surface);
      --shadow-hover: 0 6px 18px var(--theme-shadow-medium);
      --shadow-active: 0 3px 10px var(--theme-shadow-heavy);
      /* Adjust shadows for dark mode */
      --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 30%);
      --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 40%), 0 1px 2px 0 rgb(0 0 0 / 30%);
      --shadow-base:
        0 4px 6px -1px rgb(0 0 0 / 40%), 0 2px 4px -1px rgb(0 0 0 / 30%);
      --shadow-md:
        0 10px 15px -3px rgb(0 0 0 / 40%), 0 4px 6px -2px rgb(0 0 0 / 30%);
      --shadow-lg:
        0 20px 25px -5px rgb(0 0 0 / 40%), 0 10px 10px -5px rgb(0 0 0 / 20%);
    }
  }

  /* Component token aliases (kept in tokens layer for consistency) */
  @layer tokens {
    :root {
      /* Inputs */
      --input-background: var(--theme-bg-primary);
      --input-border: var(--theme-border-primary);
      --input-border-focus: var(--theme-border-focus);
      --input-text: var(--theme-text-primary);
      --input-placeholder: var(--theme-text-muted);
      --input-shadow-focus: var(--theme-shadow-focus);

      /* Cards */
      --card-background: var(--theme-bg-primary);
      --card-border: var(--theme-border-primary);
      --card-shadow: var(--shadow-sm);
      --card-shadow-hover: var(--shadow-md);

      /* Navigation (component-local) */
      --nav-background: var(--theme-bg-primary);
      --nav-border: var(--theme-border-primary);
      --nav-link-color: var(--theme-text-secondary);
      --nav-link-hover: var(--accent-primary);
      --nav-link-active: var(--accent-primary);

      --nav-hover-surface: var(--hover-surface);
      --nav-active-surface: var(--active-surface);
      /* Buttons */
      --btn-primary-bg: var(--accent-primary);
      --btn-primary-hover: var(--accent-primary-hover);
      --btn-secondary-bg: var(--theme-bg-secondary);
      --btn-secondary-hover: var(--hover-surface);
      --btn-success-bg: var(--accent-success);
      --btn-warning-bg: var(--accent-warning);
      --btn-error-bg: var(--accent-error);

      /* Component spacing helpers */
      --component-padding: var(--spacing-4);
      --component-margin: var(--spacing-4);
      --component-gap: var(--spacing-3);
    }
  }

  /* ===== EXPLICIT SYSTEM THEME (USER CHOICE TO FOLLOW OS) ===== */

  /* When user explicitly chooses "System" in settings - follows OS preference */
  body.theme-system {
    /* Light mode by default, overridden by media query below for dark OS preference */
    --color-surface: var(--color-white);
    --color-surface-secondary: var(--color-gray-50);
    --color-surface-tertiary: var(--color-gray-100);
    --color-on-surface: var(--color-gray-900);
    --color-on-surface-secondary: var(--color-gray-700);
    --color-on-surface-tertiary: var(--color-gray-600);

    /* Light theme semantic tokens */
    --theme-bg-primary: #fff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-tertiary: #f3f4f6;
    --theme-bg-interactive: #e5e7eb;
    --theme-bg-overlay: rgb(0 0 0 / 50%);
    --theme-text-primary: #111827;
    --theme-text-secondary: #374151;
    --theme-text-tertiary: #6b7280;
    --theme-text-muted: #9ca3af;
    --theme-text-inverse: #fff;
    --theme-text-on-accent: #fff;
    --theme-border-primary: #e5e7eb;
    --theme-border-secondary: #d1d5db;
    --theme-border-interactive: #9ca3af;
    --theme-border-focus: #3b82f6;
    --theme-border-error: #ef4444;
    --theme-border-success: #10b981;
    --theme-accent-primary: #3b82f6;
    --theme-accent-secondary: #6b7280;
    --theme-accent-success: #10b981;
    --theme-accent-warning: #f59e0b;
    --theme-accent-error: #ef4444;
    --theme-accent-info: #3b82f6;
    --theme-shadow-light: rgb(0 0 0 / 10%);
    --theme-shadow-medium: rgb(0 0 0 / 15%);
    --theme-shadow-heavy: rgb(0 0 0 / 20%);
    --theme-shadow-focus: rgb(59 130 246 / 40%);

    /* Standard light mode shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 5%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px 0 rgb(0 0 0 / 6%);
    --shadow-base:
      0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
    --shadow-md:
      0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
    --shadow-lg:
      0 20px 25px -5px rgb(0 0 0 / 10%), 0 10px 10px -5px rgb(0 0 0 / 4%);
  }

  /* Override for dark OS preference when using system theme */
  @media (prefers-color-scheme: dark) {
    body.theme-system {
      /* Apply dark mode tokens when OS prefers dark and user chose system */
      --color-surface: #0d1117;
      --color-surface-secondary: #2d2d2d;
      --color-surface-tertiary: #21262d;
      --color-on-surface: #f0f6fc;
      --color-on-surface-secondary: #e6edf3;
      --color-on-surface-tertiary: #7d8590;

      /* Dark semantic theme tokens */
      --theme-bg-primary: #0d1117;
      --theme-bg-secondary: #2d2d2d;
      --theme-bg-tertiary: #21262d;
      --theme-bg-interactive: #262c36;
      --theme-bg-overlay: rgb(0 0 0 / 90%);
      --theme-text-primary: #f0f6fc;
      --theme-text-secondary: #e6edf3;
      --theme-text-tertiary: #7d8590;
      --theme-text-muted: #656d76;
      --theme-text-inverse: #0d1117;
      --theme-text-on-accent: #fff;
      --theme-border-primary: #30363d;
      --theme-border-secondary: #21262d;
      --theme-border-interactive: #656d76;
      --theme-border-focus: #58a6ff;
      --theme-border-error: #f85149;
      --theme-border-success: #56d364;
      --theme-accent-primary: #58a6ff;
      --theme-accent-secondary: #8b949e;
      --theme-accent-success: #56d364;
      --theme-accent-warning: #e3b341;
      --theme-accent-error: #f85149;
      --theme-accent-info: #79c0ff;
      --theme-shadow-light: rgb(0 0 0 / 30%);
      --theme-shadow-medium: rgb(0 0 0 / 40%);
      --theme-shadow-heavy: rgb(0 0 0 / 50%);
      --theme-shadow-focus: rgb(88 166 255 / 40%);

      /* Interaction surfaces (dark, system) */
      --hover-surface: rgb(0 0 0 / 24%);
      --active-surface: rgb(0 0 0 / 36%);
      --nav-hover-surface: var(--hover-surface);
      --nav-active-surface: var(--active-surface);
      /* Dark mode shadows */
      --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 30%);
      --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 40%), 0 1px 2px 0 rgb(0 0 0 / 30%);
      --shadow-base:
        0 4px 6px -1px rgb(0 0 0 / 40%), 0 2px 4px -1px rgb(0 0 0 / 30%);
      --shadow-md:
        0 10px 15px -3px rgb(0 0 0 / 40%), 0 4px 6px -2px rgb(0 0 0 / 30%);
      --shadow-lg:
        0 20px 25px -5px rgb(0 0 0 / 40%), 0 10px 10px -5px rgb(0 0 0 / 20%);
      --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 50%);
      --shadow-2xl: 0 50px 100px -20px rgb(0 0 0 / 50%);
    }
  }

  /* ===== EXPLICIT LIGHT MODE THEME (USER CHOICE) ===== */
  html[data-theme="light"],
  body[data-theme="light"],
  body.theme-light {
    /* Force light mode tokens even if system prefers dark */
    --color-surface: var(--color-white);
    --color-surface-secondary: var(--color-gray-50);
    --color-surface-tertiary: var(--color-gray-100);
    --color-on-surface: var(--color-gray-900);
    --color-on-surface-secondary: var(--color-gray-700);
    --color-on-surface-tertiary: var(--color-gray-600);

    /* Light theme semantic tokens */
    --theme-bg-primary: #fff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-tertiary: #f3f4f6;
    --theme-bg-interactive: #e5e7eb;
    --theme-bg-overlay: rgb(0 0 0 / 50%);
    --theme-text-primary: #111827;
    --theme-text-secondary: #374151;
    --theme-text-tertiary: #6b7280;
    --theme-text-muted: #9ca3af;
    --theme-text-inverse: #fff;
    --theme-text-on-accent: #fff;
    --theme-border-primary: #e5e7eb;
    --theme-border-secondary: #d1d5db;
    --theme-border-interactive: #9ca3af;
    --theme-border-focus: #3b82f6;
    --theme-border-error: #ef4444;
    --theme-border-success: #10b981;
    --theme-accent-primary: #3b82f6;
    --theme-accent-secondary: #6b7280;
    --theme-accent-success: #10b981;
    --theme-accent-warning: #f59e0b;
    --theme-accent-error: #ef4444;
    --theme-accent-info: #3b82f6;
    --theme-shadow-light: rgb(0 0 0 / 10%);
    --theme-shadow-medium: rgb(0 0 0 / 15%);
    --theme-shadow-heavy: rgb(0 0 0 / 20%);
    --theme-shadow-focus: rgb(59 130 246 / 40%);

    /* Standard light mode shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 5%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px 0 rgb(0 0 0 / 6%);
    --shadow-base:
      0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
    --shadow-md:
      0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
    --shadow-lg:
      0 20px 25px -5px rgb(0 0 0 / 10%), 0 10px 10px -5px rgb(0 0 0 / 4%);
  }

  /* ===== EXPLICIT DARK MODE THEME (USER CHOICE) ===== */

  /* This applies when user explicitly chooses dark mode */
  html[data-theme="dark"],
  body[data-theme="dark"],
  body.theme-dark,
  body.dark-mode {
    /* ===== CORE COLOR OVERRIDES ===== */
    --color-surface: #0d1117;
    --color-surface-secondary: #2d2d2d;
    --color-surface-tertiary: #21262d;
    --color-on-surface: #f0f6fc;
    --color-on-surface-secondary: #e6edf3;
    --color-on-surface-tertiary: #7d8590;

    /* ===== SEMANTIC THEME OVERRIDES ===== */

    /* Background Colors */
    --theme-bg-primary: #0d1117;
    --theme-bg-secondary: #2d2d2d;
    --theme-bg-tertiary: #21262d;
    --theme-bg-interactive: #262c36;
    --theme-bg-overlay: rgb(0 0 0 / 90%);
    --theme-bg-overlay-light: rgb(255 255 255 / 10%);
    --theme-bg-overlay-medium: rgb(255 255 255 / 15%);
    --theme-border-overlay: rgb(255 255 255 / 20%);

    /* Hero Gradient Override for Dark Theme */
    --hero-title-gradient: var(--hero-title-gradient-dark);

    /* Text Colors */
    --theme-text-primary: #f0f6fc;
    --theme-text-secondary: #e6edf3;
    --theme-text-tertiary: #7d8590;
    --theme-text-muted: #656d76;
    --theme-text-inverse: #0d1117;
    --theme-text-inverse-secondary: rgb(13 17 23 / 80%);
    --theme-text-on-accent: #fff;

    /* Border Colors */
    --theme-border-primary: #30363d;
    --theme-border-secondary: #21262d;
    --theme-border-interactive: #656d76;
    --theme-border-focus: #58a6ff;
    --theme-border-error: #f85149;
    --theme-border-success: #56d364;

    /* Accent Colors */
    --theme-accent-primary: #58a6ff;
    --theme-accent-secondary: #8b949e;
    --theme-accent-success: #56d364;
    --theme-accent-warning: #e3b341;
    --theme-accent-error: #f85149;
    --theme-accent-info: #79c0ff;

    /* Shadow Colors */
    --theme-shadow-light: rgb(0 0 0 / 30%);
    --theme-shadow-medium: rgb(0 0 0 / 40%);
    --theme-shadow-heavy: rgb(0 0 0 / 50%);
    --theme-shadow-focus: rgb(88 166 255 / 40%);

    /* Interaction surfaces (explicit dark) */
    --hover-surface: rgb(0 0 0 / 24%);
    --active-surface: rgb(0 0 0 / 36%);
    --nav-hover-surface: var(--hover-surface);
    --nav-active-surface: var(--active-surface);
    /* Interactive tokens tuning (explicit dark) */
    --interactive-fg: var(--theme-text-primary);
    --interactive-fg-hover: var(--theme-text-primary);
    --interactive-fg-active: var(--theme-text-primary);
    --interactive-bg-hover: var(--hover-surface);
    --interactive-bg-active: var(--active-surface);
    --shadow-hover: 0 6px 18px var(--theme-shadow-medium);
    --shadow-active: 0 3px 10px var(--theme-shadow-heavy);
    /* Adjust shadows for dark mode */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 30%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 40%), 0 1px 2px 0 rgb(0 0 0 / 30%);
    --shadow-base:
      0 4px 6px -1px rgb(0 0 0 / 40%), 0 2px 4px -1px rgb(0 0 0 / 30%);
    --shadow-md:
      0 10px 15px -3px rgb(0 0 0 / 40%), 0 4px 6px -2px rgb(0 0 0 / 30%);
    --shadow-lg:
      0 20px 25px -5px rgb(0 0 0 / 40%), 0 10px 10px -5px rgb(0 0 0 / 20%);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 50%);
    --shadow-2xl: 0 50px 100px -20px rgb(0 0 0 / 50%);
  }

  /* ===== HIGH CONTRAST MODE ===== */
  @media (prefers-contrast: more) {
    :root {
      --focus-ring-width: 3px;
      --border-width-1: 2px;
      --border-width-2: 3px;
    }
  }

  /* High contrast class overrides */
  body.high-contrast,
  body.theme-high-contrast {
    /* ===== ACCESSIBILITY ENHANCEMENTS ===== */
    --focus-ring-width: 3px;
    --border-width-1: 2px;
    --border-width-2: 3px;

    /* ===== HIGH CONTRAST THEME OVERRIDES ===== */

    /* Background Colors */
    --theme-bg-primary: #000;
    --theme-bg-secondary: #111;
    --theme-bg-tertiary: #222;
    --theme-bg-interactive: #333;
    --theme-bg-overlay: rgb(0 0 0 / 95%);
    --theme-bg-overlay-light: rgb(255 255 255 / 15%);
    --theme-bg-overlay-medium: rgb(255 255 255 / 25%);
    --theme-border-overlay: rgb(255 255 255 / 40%);

    /* Text Colors */
    --theme-text-primary: #fff;
    --theme-text-secondary: #fff;
    --theme-text-tertiary: #ccc;
    --theme-text-muted: #aaa;
    --theme-text-inverse: #000;
    --theme-text-inverse-secondary: rgb(0 0 0 / 80%);
    --theme-text-on-accent: #000;

    /* Border Colors */
    --theme-border-primary: #fff;
    --theme-border-secondary: #ccc;
    --theme-border-interactive: #fff;
    --theme-border-focus: #ff0;
    --theme-border-error: #f00;
    --theme-border-success: #0f0;

    /* Accent Colors */
    --theme-accent-primary: #ff0;
    --theme-accent-secondary: #fff;
    --theme-accent-success: #0f0;
    --theme-accent-warning: #fa0;
    --theme-accent-error: #f00;
    --theme-accent-info: #0af;

    /* Shadow Colors */
    --theme-shadow-light: rgb(255 255 255 / 10%);
    --theme-shadow-medium: rgb(255 255 255 / 20%);
    --theme-shadow-heavy: rgb(255 255 255 / 30%);
    --theme-shadow-focus: rgb(255 255 0 / 50%);

    /* Increase contrast ratios */
    --color-gray-400: #6b7280;
    --color-gray-500: #4b5563;
    --color-gray-600: #374151;
  }

  /* ===== REDUCED MOTION ===== */
  @media (prefers-reduced-motion: reduce) {
    :root {
      --duration-75: 0ms;
      --duration-100: 0ms;
      --duration-150: 0ms;
      --duration-200: 0ms;
      --duration-300: 0ms;
      --duration-500: 0ms;
      --duration-700: 0ms;
      --duration-1000: 0ms;
    }
  }

  /* Reduced motion class overrides */
  body.reduced-motion {
    --duration-75: 0ms;
    --duration-100: 0ms;
    --duration-150: 0ms;
    --duration-200: 0ms;
    --duration-300: 0ms;
    --duration-500: 0ms;
    --duration-700: 0ms;
    --duration-1000: 0ms;
  }

  /* ===== FONT SIZE SCALING ===== */

  /* These classes will be applied by settings-manager.js */
  html.font-size-small {
    --user-font-scale: 0.875;
    --user-font-size: calc(var(--font-size-base) * var(--user-font-scale));
  }

  html.font-size-medium {
    --user-font-scale: 1;
    --user-font-size: calc(var(--font-size-base) * var(--user-font-scale));
  }

  html.font-size-large {
    --user-font-scale: 1.125;
    --user-font-size: calc(var(--font-size-base) * var(--user-font-scale));
  }

  html.font-size-extra-large {
    --user-font-scale: 1.25;
    --user-font-size: calc(var(--font-size-base) * var(--user-font-scale));
  }

  /* ===== PRINT TOKENS ===== */
  @media print {
    :root {
      --color-surface: white;
      --color-on-surface: black;
      --shadow-xs: none;
      --shadow-sm: none;
      --shadow-base: none;
      --shadow-md: none;
      --shadow-lg: none;
      --shadow-xl: none;
      --shadow-2xl: none;
    }
  }

  /* ===== UNIVERSAL SELECTORS - CONSOLIDATED ===== */

  /* Single source of truth for universal styling */

  /* Accessibility: Reduced Motion Support */
  @media (prefers-reduced-motion: reduce) {
    /* Scope to body descendants to avoid bleeding into shadow roots and system UI */
    body *,
    body *::before,
    body *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* Print Optimization */
  @media print {
    body *,
    body *::before,
    body *::after {
      background: transparent !important;
      color: black !important;
      box-shadow: none !important;
      text-shadow: none !important;
    }
  }

  /* High Contrast Mode Support */
  @media (prefers-contrast: more) {
    body *,
    body *::before,
    body *::after {
      border-color: currentcolor;
    }
  }

  /* ===== STANDARDIZED COMPONENT PATTERNS ===== */

  /* These patterns ensure consistent theming across all components */

  /* Base Component Pattern */
  .component,
  .panel,
  .card,
  .section {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-primary);
    border-radius: var(--radius-md);
    transition: all var(--duration-200) ease;
  }

  /* Interactive Component Pattern */
  .interactive,
  .button,
  .clickable {
    background: var(--theme-bg-interactive);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-interactive);
    cursor: pointer;
    transition: all var(--duration-200) ease;
  }

  .interactive:hover,
  .button:hover,
  .clickable:hover {
    opacity: var(--theme-hover-opacity);
    border-color: var(--theme-border-focus);
    box-shadow: 0 2px 8px var(--theme-shadow-medium);
  }

  .interactive:focus,
  .button:focus,
  .clickable:focus {
    outline: 2px solid var(--theme-border-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px var(--theme-shadow-focus);
  }

  /* Text Component Pattern */
  .text-primary {
    color: var(--theme-text-primary);
  }

  .text-secondary {
    color: var(--theme-text-secondary);
  }

  .text-muted {
    color: var(--theme-text-muted);
  }

  .text-inverse {
    color: var(--theme-text-inverse);
  }

  /* Background Component Pattern */
  .bg-primary {
    background: var(--theme-bg-primary);
  }

  .bg-secondary {
    background: var(--theme-bg-secondary);
  }

  .bg-tertiary {
    background: var(--theme-bg-tertiary);
  }

  /* Border Component Pattern */
  .border-primary {
    border-color: var(--theme-border-primary);
  }

  .border-secondary {
    border-color: var(--theme-border-secondary);
  }

  .border-focus {
    border-color: var(--theme-border-focus);
  }

  /* Accent Component Pattern */
  .accent-primary {
    color: var(--theme-accent-primary);
  }

  .accent-success {
    color: var(--theme-accent-success);
  }

  .accent-warning {
    color: var(--theme-accent-warning);
  }

  .accent-error {
    color: var(--theme-accent-error);
  }

  /* Shadow Component Pattern */
  .shadow-light {
    box-shadow: 0 1px 3px var(--theme-shadow-light);
  }

  .shadow-medium {
    box-shadow: 0 4px 6px var(--theme-shadow-medium);
  }

  .shadow-heavy {
    box-shadow: 0 10px 15px var(--theme-shadow-heavy);
  }

  /* Modal/Overlay Pattern */
  .modal,
  .overlay,
  .backdrop {
    background: var(--theme-bg-overlay);
    backdrop-filter: blur(4px);
  }

  .modal-content,
  .dialog-content {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px var(--theme-shadow-heavy);
  }

  /* Form Component Pattern */
  .form-input,
  .form-select,
  .form-textarea {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    transition: all var(--duration-200) ease;
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    outline: none;
    border-color: var(--theme-border-focus);
    box-shadow: 0 0 0 3px var(--theme-shadow-focus);
  }

  .form-input:disabled,
  .form-select:disabled,
  .form-textarea:disabled {
    opacity: var(--theme-disabled-opacity);
    cursor: not-allowed;
  }

  /* Navigation Component Pattern */
  .nav-item,
  .menu-item,
  .tab-item {
    background: transparent;
    color: var(--theme-text-secondary);
    border: 1px solid transparent;
    padding: var(--space-2) var(--space-4);
    transition: all var(--duration-200) ease;
  }

  .nav-item:hover,
  .menu-item:hover,
  .tab-item:hover {
    background: transparent;
    color: var(--theme-text-primary);
  }

  .nav-item.active,
  .menu-item.active,
  .tab-item.active {
    background: var(--theme-bg-secondary);
    color: var(--theme-accent-primary);
    border-color: var(--theme-border-focus);
  }

  /* Status Component Pattern */
  .status-success {
    background: var(--theme-accent-success);
    color: var(--theme-text-on-accent);
  }

  .status-warning {
    background: var(--theme-accent-warning);
    color: var(--theme-text-on-accent);
  }

  .status-error {
    background: var(--theme-accent-error);
    color: var(--theme-text-on-accent);
  }

  .status-info {
    background: var(--theme-accent-info);
    color: var(--theme-text-on-accent);
  }
} /* End @layer tokens */
