/* Inter Local Font (Cyrillic Subset - Critical for LCP) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter/inter-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* === Critical Landing CSS Bundle === */

/* --- variables.css --- */
/* ═══════════════════════════════════════════════════════════════
   🎨 CSS ПЕРЕМЕННЫЕ - Единая система дизайна
   РЕФАКТОРИНГ 28.12.2025: Создана единая система переменных
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ═══════════════════════════════════════════════════════════
       ЦВЕТА
       ═══════════════════════════════════════════════════════════ */
    
    /* Основные цвета */
    --color-primary: #6366F1;
    --color-primary-dark: #4F46E5;
    --color-primary-light: #818CF8;
    --color-secondary: #8B5CF6;
    --color-success: #22C55E;
    --color-warning: #FBBF24;
    --color-error: #EF4444;
    
    /* Фоны */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-dark: #0A0E27;
    --bg-space: #0A0E27;
    --bg-space-secondary: #151B3D;
    
    /* Текст */
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --text-light: #FFFFFF;
    
    /* ═══════════════════════════════════════════════════════════
       Z-INDEX (Единая система для предотвращения конфликтов)
       ═══════════════════════════════════════════════════════════ */
    
    /* Базовые слои */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    
    /* Компоненты */
    --z-header: 1000;
    --z-footer: 100;
    --z-countdown: 1000;
    --z-cabinet: 1000;
    --z-canvas: 10;
    --z-canvas-overlay: 20;
    
    /* ⚠️ КРИТИЧНО: Максимальный z-index для предотвращения конфликтов */
    --z-max: 2147483647;
    
    /* ═══════════════════════════════════════════════════════════
       РАЗМЕРЫ
       ═══════════════════════════════════════════════════════════ */
    
    /* Контейнеры */
    --container-width: 1200px;
    --container-padding: 20px;
    
    /* Отступы */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
    
    /* Радиусы */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* ═══════════════════════════════════════════════════════════
       ТИПОГРАФИКА
       ═══════════════════════════════════════════════════════════ */
    
    /* Шрифты */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Размеры шрифтов */
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;
    
    /* Высота строк */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* ═══════════════════════════════════════════════════════════
       ТЕНИ И ЭФФЕКТЫ
       ═══════════════════════════════════════════════════════════ */
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Свечение */
    --glow-primary: 0 0 20px rgba(99, 102, 241, 0.5);
    --glow-success: 0 0 20px rgba(34, 197, 94, 0.5);
    
    /* ═══════════════════════════════════════════════════════════
       ГРАДИЕНТЫ (Космический дизайн)
       РЕФАКТОРИНГ 28.12.2025: Вынесены все градиенты для единообразия
       ═══════════════════════════════════════════════════════════ */
    
    /* Основные градиенты */
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-primary-hover: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-primary-vertical: linear-gradient(180deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-primary-horizontal: linear-gradient(90deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-primary-radial: radial-gradient(ellipse at center, #6366F1 0%, #8B5CF6 100%);
    
    /* AI эффекты (фиолетовый неон) */
    --gradient-ai-glow: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #A855F7 100%);
    --gradient-ai-glow-extended: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #ec4899 100%);
    --gradient-ai-mesh: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1), transparent),
                        radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.1), transparent);
    
    /* Сложные градиенты для анимаций */
    --gradient-ai-animated-1: linear-gradient(45deg, #6366F1, #8B5CF6, #ec4899, #818CF8, #6366F1);
    --gradient-ai-animated-2: linear-gradient(135deg, #818CF8, #ec4899, #6366F1, #8B5CF6, #818CF8);
    --gradient-ai-animated-3: linear-gradient(135deg, #6366F1 0%, #8B5CF6 25%, #ec4899 50%, #818CF8 75%, #6366F1 100%);
    --gradient-ai-animated-4: linear-gradient(45deg, #818CF8 0%, #ec4899 50%, #6366F1 100%);
    
    /* Дополнительные градиенты для results-v2.css */
    --gradient-ai-pink-1: linear-gradient(135deg, #6366F1 0%, #ec4899 50%, #818CF8 100%);
    --gradient-ai-pink-2: linear-gradient(135deg, #818CF8 0%, #6366F1 50%, #ec4899 100%);
    --gradient-ai-orange-1: linear-gradient(135deg, #6366F1 0%, #ec4899 50%, #f59e0b 100%);
    --gradient-ai-pink-simple: linear-gradient(135deg, #6366F1 0%, #ec4899 100%);
    --gradient-ai-pink-horizontal: linear-gradient(90deg, #6366F1 0%, #ec4899 100%);
    --gradient-ai-orange-horizontal: linear-gradient(90deg, #6366F1 0%, #ec4899 50%, #f59e0b 100%);
    
    /* Космические градиенты для кабинета */
    --gradient-cosmic: linear-gradient(135deg, #0A0E27 0%, #151B3D 50%, #1E293B 100%);
    --gradient-cosmic-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    
    /* Старые градиенты (для обратной совместимости) */
    --gradient-primary-old: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Семантические градиенты */
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-success-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-warning-hover: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --gradient-warning-light: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    --gradient-error: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    
    /* Прогресс-бары */
    --gradient-progress-blue: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #8b5cf6 100%);
    --gradient-progress-green: linear-gradient(90deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
    
    /* ═══════════════════════════════════════════════════════════
       АНИМАЦИИ
       ═══════════════════════════════════════════════════════════ */
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ═══════════════════════════════════════════════════════════════
   КОММЕНТАРИИ ДЛЯ РАЗРАБОТЧИКОВ
   ═══════════════════════════════════════════════════════════════ */

/*
 * ИСПОЛЬЗОВАНИЕ:
 * 
 * Цвета:
 *   color: var(--color-primary);
 *   background: var(--bg-primary);
 * 
 * Z-index:
 *   z-index: var(--z-header);
 *   z-index: var(--z-modal);
 * 
 * Размеры:
 *   padding: var(--spacing-md);
 *   border-radius: var(--radius-md);
 * 
 * Тени:
 *   box-shadow: var(--shadow-md);
 * 
 * Анимации:
 *   transition: all var(--transition-base);
 * 
 * ⚠️ ВАЖНО: НЕ используйте с переменными.
 * Если нужно переопределить - используйте более специфичный селектор.
 */



/* --- utility-classes.css --- */
/**
 * ═══════════════════════════════════════════════════════════════
 * 🎨 UTILITY CLASSES - Утилитарные классы
 * ═══════════════════════════════════════════════════════════════
 *
 * Утилитарные классы для общих задач.
 * ✅ РАЗРЕШЕНО: Utility классы могут использовать
 *
 * ✅ РЕФАКТОРИНГ 18.01.2026: Создан для централизации utility классов
 *
 * @version 1.0
 * @date 18.01.2026
 */

/* ═══════════════════════════════════════════════════════════════
   DISPLAY UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Скрывает элемент
 * ✅ РАЗРЕШЕНО: Utility класс может использовать
 */
.hidden {
    display: none;
}

/**
 * Показывает элемент как block
 */
.show {
    display: block;
}

/**
 * Показывает элемент как flex
 */
.show-flex {
    display: flex;
}

/**
 * Показывает элемент как inline-block
 */
.show-inline-block {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Screen reader only - видно только для скринридеров
 * ✅ РАЗРЕШЕНО: Utility класс может использовать
 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap;
    border-width: 0;
}

/**
 * Убирает элемент из потока, но оставляет доступным для скринридеров
 */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ═══════════════════════════════════════════════════════════════
   VISIBILITY UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Делает элемент невидимым, но оставляет в потоке
 */
.invisible {
    visibility: hidden;
}

/**
 * Делает элемент видимым
 */
.visible {
    visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════
   OPACITY UTILITIES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Полностью прозрачный
 */
.opacity-0 {
    opacity: 0;
}

/**
 * Полностью непрозрачный
 */
.opacity-100 {
    opacity: 1;
}


/* --- design-system.css --- */
/**
 * ═══════════════════════════════════════════════════════════════
 * 🎨 ДИЗАЙН-СИСТЕМА ПОЧЕРКПРО v2.0
 * ═══════════════════════════════════════════════════════════════
 * 
 * Полная дизайн-система для премиум-курса
 * Обновлено для радикального редизайна 13.12.2025
 * CSS переменные, компоненты, анимации
 * 
 * @version 2.0
 * @date 13.12.2025
 */

/* ═══════════════════════════════════════════════════════════════
   🎨 CSS ПЕРЕМЕННЫЕ (DESIGN TOKENS)
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* ═══════════════════════════════════════════════════════════════
       🎨 ДИЗАЙН-СИСТЕМА 2026 - ПРЕМИУМ EDTECH
       Обновлено для радикального редизайна 13.12.2025
       ═══════════════════════════════════════════════════════════════ */
    
    /* ========================================
       ЦВЕТОВАЯ ПАЛИТРА 2026 - ПРЕМИУМ EDTECH
       ======================================== */
    
    /* Основные цвета (Indigo + Electric Blue) */
    --color-primary: #6366F1;           /* Indigo - основной */
    --color-primary-dark: #4F46E5;       /* Темнее для hover */
    --color-primary-light: #818CF8;      /* Светлее для backgrounds */
    --color-electric-blue: #3B82F6;      /* Акцент, кнопки */
    
    /* AI эффекты (фиолетовый неон) */
    --color-ai-glow: #8B5CF6;            /* Фиолетовый неон */
    --color-ai-gradient: var(--gradient-primary);
    --color-ai-gradient-mesh: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1), transparent),
                               radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.1), transparent);
    
    /* Семантические цвета */
    --color-success: #10B981;            /* Зелёный - правильно! */
    --color-success-dark: #059669;       /* Темнее для hover */
    --color-warning: #F59E0B;            /* Оранжевый - внимание */
    --color-warning-dark: #D97706;       /* Темнее для hover */
    --color-error: #EF4444;              /* Красный - ошибка */
    --color-error-dark: #DC2626;         /* Темнее для hover */
    --color-info: #3B82F6;               /* Синий - информация */
    
    /* Нейтральные (для текста и фонов) */
    --color-background: #FFFFFF;         /* Белый фон */
    --color-surface: #F9FAFB;            /* Серый светлый (карточки) */
    --color-surface-elevated: #FFFFFF;   /* Белый (поднятые карточки) */
    --color-text-primary: #111827;       /* Тёмный текст */
    --color-text-secondary: #6B7280;      /* Серый текст */
    --color-text-muted: #9CA3AF;         /* Приглушённый текст */
    --color-text-tertiary: var(--color-text-muted); /* Совместимость */
    --color-text-inverse: #FFFFFF;       /* Белый текст */
    --color-border: #E5E7EB;             /* Границы */
    --color-background-secondary: var(--color-surface); /* Совместимость */
    
    /* Старые цвета (для обратной совместимости) */
    --color-primary-old: #667eea;        /* Старый цвет для постепенного перехода */
    --color-primary-dark-old: #764ba2;    /* Старый тёмный */
    --color-primary-gradient: var(--gradient-primary);
    --color-primary-gradient-old: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Старый градиент */
    
    --color-accent-orange: #f97316;
    --color-accent-green: #10b981;
    --color-accent-yellow: #fbbf24;
    
    /* Совместимость со старыми переменными */
    --color-bg-primary: var(--color-background);
    --color-bg-secondary: var(--color-background-secondary);
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    /* ========================================
       ТИПОГРАФИКА 2026
       ======================================== */
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 
                   'Helvetica Neue', sans-serif;
    --font-family-sans: var(--font-family);
    --font-family-display: 'Inter', sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    
    /* Размеры (fluid typography для лучшей адаптивности) */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);    /* 12-14px */
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);     /* 14-16px */
    --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);     /* 16-18px */
    --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);    /* 18-20px */
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);      /* 20-24px */
    --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);          /* 24-32px */
    --font-size-3xl: clamp(2rem, 1.7rem + 1.5vw, 3rem);           /* 32-48px */
    --font-size-4xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);          /* 40-64px */
    
    /* Веса */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    /* ========================================
       SPACING (8px grid system)
       ======================================== */
    
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */
    --spacing-4xl: 6rem;     /* 96px */
    
    /* ========================================
       BORDER RADIUS (2026 - более округлые)
       ======================================== */
    
    --radius-xs: 0.25rem;   /* 4px */
    --radius-sm: 0.5rem;    /* 8px */
    --radius-md: 0.75rem;   /* 12px */
    --radius-lg: 1rem;      /* 16px */
    --radius-xl: 1.5rem;    /* 24px */
    --radius-2xl: 2rem;     /* 32px */
    --radius-full: 9999px;  /* Полный круг */
    
    /* Старые значения для совместимости */
    --radius-sm-old: 6px;
    --radius-md-old: 8px;
    --radius-lg-old: 12px;
    --radius-xl-old: 16px;
    --radius-2xl-old: 24px;
    
    /* ========================================
       ТЕНИ (2026 - мягкие, глубокие)
       ======================================== */
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 
                 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 
                 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 
                 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 
                 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* AI Glow тени (неоновый эффект) */
    --shadow-ai-glow: 0 0 20px rgba(139, 92, 246, 0.4),
                      0 0 40px rgba(139, 92, 246, 0.2);
    --shadow-ai-glow-strong: 0 0 30px rgba(139, 92, 246, 0.6),
                             0 0 60px rgba(139, 92, 246, 0.3);
    
    /* Цветные тени (обновлённые для новых цветов) */
    --shadow-primary: 0 4px 16px rgba(99, 102, 241, 0.4);
    --shadow-primary-old: 0 4px 16px rgba(102, 126, 234, 0.4); /* Старая для совместимости */
    --shadow-success: 0 4px 16px rgba(16, 185, 129, 0.4);
    --shadow-error: 0 4px 16px rgba(239, 68, 68, 0.4);
    
    /* ========================================
       TRANSITIONS (плавные анимации)
       ======================================== */
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: var(--transition-normal);
    --transition-slower: var(--transition-slow);
    
    /* Easing functions */
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ========================================
       Z-INDEX (управление слоями)
       ======================================== */
    
    --z-base: 1;
    --z-sidebar: 100;
    --z-header: 200;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    --z-canvas-fullscreen: 9999;
    --z-fullscreen: var(--z-canvas-fullscreen); /* Совместимость */
    
    /* Line heights (совместимость) */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* Дополнительные размеры шрифтов (совместимость) */
    --font-size-5xl: 48px;
    --font-size-6xl: 60px;
    
    /* Дополнительные веса (совместимость) */
    --font-weight-light: 300;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;
    
    /* Font family mono (совместимость) */
    --font-family-mono: 'Fira Code', 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   🎨 КОМПОНЕНТЫ (COMPONENTS)
   ═══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────
   КНОПКИ (BUTTONS)
   ──────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Размеры кнопок */
.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

/* Варианты кнопок */
.btn-primary {
    background: var(--color-ai-gradient);
    color: var(--color-text-inverse);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 0 20px rgba(99, 102, 241, 0.2);
    transition: all var(--transition-fast);
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(99, 102, 241, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        0 0 30px rgba(139, 92, 246, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 0 15px rgba(99, 102, 241, 0.2);
}

.btn-primary:focus-visible {
    /* ✅ УБРАНО: outline для текста (синяя обводка) - убрано для устранения синей обводки вокруг текста */
    outline: none;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 0 1px var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: #ffffff;
    border-color: var(--color-primary-light);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 0 0 1px var(--color-primary-light);
}

.btn-secondary:focus-visible {
    /* ✅ УБРАНО: outline для текста (синяя обводка) - убрано для устранения синей обводки вокруг текста */
    outline: none;
}

.btn-success {
    background: var(--color-success);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-success);
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: var(--color-success-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-error {
    background: var(--color-error);
    color: var(--color-text-inverse);
}

.btn-error:hover:not(:disabled) {
    background: var(--color-error-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-gray-100);
}

/* Кнопка с иконкой */
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ────────────────────────────────────────────────────────────
   КАРТОЧКИ (CARDS)
   ──────────────────────────────────────────────────────────── */

.card {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.card-compact {
    padding: var(--spacing-lg);
}

.card-spacious {
    padding: var(--spacing-2xl);
}

.card-bordered {
    border: 1px solid var(--color-gray-200);
    box-shadow: none;
}

.card-gradient {
    background: var(--color-ai-gradient);
    color: var(--color-text-inverse);
    border: none;
}

.card-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
    color: var(--color-text-inverse);
}

/* ────────────────────────────────────────────────────────────
   ПРОГРЕСС-БАРЫ (PROGRESS BARS)
   ──────────────────────────────────────────────────────────── */

.progress-bar {
    width: 100%;
    height: 12px;  /* Увеличено с 8px для лучшей видимости */
    background: var(--color-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-bar-lg {
    height: 16px;  /* Увеличено с 12px */
}

.progress-bar-sm {
    height: 6px;   /* Увеличено с 4px */
}

.progress-fill {
    height: 100%;
    background: var(--color-ai-gradient);
    border-radius: inherit;
    transition: width 0.6s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

.progress-fill-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning-dark) 100%);
}

.progress-fill-error {
    background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-dark) 100%);
}

/* ────────────────────────────────────────────────────────────
   БЕЙДЖИ (BADGES)
   ──────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.badge-success {
    background: var(--color-success);
    color: var(--color-text-inverse);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--color-text-inverse);
}

.badge-error {
    background: var(--color-error);
    color: var(--color-text-inverse);
}

.badge-gray {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

/* ────────────────────────────────────────────────────────────
   ИНПУТЫ (INPUTS)
   ──────────────────────────────────────────────────────────── */

.input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input:disabled {
    background: var(--color-gray-100);
    color: var(--color-gray-500);
    cursor: not-allowed;
}

.input-error {
    border-color: var(--color-error);
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-success {
    border-color: var(--color-success);
}

.input-success:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ────────────────────────────────────────────────────────────
   ЗВЕЗДОЧКИ (STARS)
   ──────────────────────────────────────────────────────────── */

.stars {
    display: inline-flex;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xl);
    line-height: 1;
}

.star {
    color: var(--color-warning);
}

.star-empty {
    color: var(--color-gray-300);
}

/* ────────────────────────────────────────────────────────────
   EMPTY STATE
   ──────────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--color-text-secondary);
}

.empty-state-icon {
    font-size: var(--font-size-6xl);
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-state-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
}

.empty-state-text {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
}

/* ═══════════════════════════════════════════════════════════════
   🎬 АНИМАЦИИ (ANIMATIONS)
   ═══════════════════════════════════════════════════════════════ */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease-out;
}

/* Slide Down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slideDown {
    animation: slideDown var(--transition-slow) ease-out;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scaleIn {
    animation: scaleIn var(--transition-base) ease-out;
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* ========================================
   НОВЫЕ АНИМАЦИИ 2026
   ======================================== */

/* Fade In Up (для карточек) */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s var(--ease-out);
}

/* Scale In (для модальных окон) */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.3s var(--ease-out);
}

/* Slide In Right (для уведомлений) */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s var(--ease-out);
}

/* Pulse улучшенный (для важных элементов) */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.animate-pulse-enhanced {
    animation: pulse 2s var(--ease-in-out) infinite;
}

/* Skeleton loading */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface) 0px,
        rgba(229, 231, 235, 0.8) 40px,
        var(--color-surface) 80px
    );
    background-size: 200px 100%;
    animation: skeleton 1.2s ease-in-out infinite;
}

/* AI Glow пульсация */
@keyframes aiGlow {
    0%, 100% { 
        box-shadow: 
            0 4px 6px rgba(0, 0, 0, 0.1),
            0 0 20px rgba(139, 92, 246, 0.4);
    }
    50% { 
        box-shadow: 
            0 4px 6px rgba(0, 0, 0, 0.1),
            0 0 40px rgba(139, 92, 246, 0.6);
    }
}

.animate-ai-glow {
    animation: aiGlow 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════
   📱 АДАПТИВНОСТЬ (RESPONSIVE)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    :root {
        --spacing-xs: 4px;
        --spacing-sm: 6px;
        --spacing-md: 12px;
        --spacing-lg: 16px;
        --spacing-xl: 24px;
        --spacing-2xl: 32px;
        --spacing-3xl: 48px;
        
        --font-size-xs: 11px;
        --font-size-sm: 13px;
        --font-size-base: 15px;
        --font-size-lg: 17px;
        --font-size-xl: 19px;
        --font-size-2xl: 22px;
        --font-size-3xl: 26px;
        --font-size-4xl: 32px;
        --font-size-5xl: 40px;
    }
    
    .btn {
        padding: var(--spacing-md) var(--spacing-lg);
        min-height: 44px; /* Apple HIG для touch */
    }
    
    .card {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card {
        padding: var(--spacing-md);
    }
}

/* ═══════════════════════════════════════════════════════════════
   🎯 УТИЛИТЫ (UTILITIES)
   ═══════════════════════════════════════════════════════════════ */

/* Flexbox утилиты */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Spacing утилиты */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* Text утилиты */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-primary-light { color: var(--color-primary-light); }
.text-ai-glow { color: var(--color-ai-glow); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-secondary { color: var(--color-text-secondary); }

.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }

/* Display утилиты */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }

/* Width утилиты */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Opacity утилиты */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }




/* --- styles.css --- */
/**
 * ═══════════════════════════════════════════════════════════════
 * 🎨 MAIN STYLES v2026 — ПочеркПро (КОСМИЧЕСКИЙ КОРАБЛЬ)
 * ═══════════════════════════════════════════════════════════════
 * Обновление под редизайн 2026: новые градиенты, стекло/голография,
 * усиленные canvas-эффекты, адаптивные фоновые mesh-градиенты.
 * Дата: 14.12.2025
 * Версия: v2026.1
 */

/* ═══════════════════════════════════════════════════════════════
   БАЗОВЫЕ СТИЛИ
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 1: OVERFLOW FIX (ТЗ v8.5)
   ═══════════════════════════════════════════════════════════════ */

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
html:not(.overflow-x-visible),
body:not(.overflow-x-visible) {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, используется специфичность через html */
html *,
html *::before,
html *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background:
        var(--gradient-ai-mesh, radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.15), transparent)),
        var(--gradient-primary);
    background-attachment: fixed; /* Фиксированный фон для лучшего вида */
    min-height: 100vh;
    color: #111827; /* По умолчанию темный текст для белых блоков */
    font-size: var(--font-size-body, 18px); /* ТЗ: 18px для body */
    line-height: var(--line-height-relaxed, 1.7); /* ТЗ: 1.7 для body */
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 2: ТИПОГРАФИКА (ТЗ v8.5) - ВСЕ ЗАГОЛОВКИ
   ═══════════════════════════════════════════════════════════════ */

h1 {
    font-size: var(--font-size-h1, 48px); /* ТЗ: 48px для H1 */
    line-height: var(--line-height-snug, 1.3);
    font-weight: var(--font-weight-extrabold, 800);
    margin-bottom: 1rem;
}

h2 {
    font-size: var(--font-size-h2, 36px); /* ТЗ: 36px для H2 */
    line-height: var(--line-height-snug, 1.3);
    font-weight: var(--font-weight-extrabold, 800);
    margin-bottom: 0.875rem;
}

h3 {
    font-size: var(--font-size-h3, 28px); /* ТЗ: 28px для H3 */
    line-height: var(--line-height-snug, 1.3);
    font-weight: var(--font-weight-bold, 700);
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    body {
        font-size: var(--font-size-body-mobile, 16px);
    }

    h1 {
        font-size: var(--font-size-h1-mobile, 32px);
    }

    h2 {
        font-size: var(--font-size-h2-mobile, 24px);
    }

    h3 {
        font-size: 22px;
    }
}

/* Все белые блоки должны иметь темный текст */
.hero,
.canvas-section,
.pain-section-content,
.results-section:not(.results-objection-emotional),
.results-overall,
.results-analysis-card,
.results-competitor-card {
    color: #111827;
}

/* Все элементы внутри белых блоков - темный текст */
.hero *,
.canvas-section *,
.pain-section-content *,
.results-section:not(.results-objection-emotional) *:not(.results-our-solution):not(.results-our-solution *),
.results-overall *,
.results-analysis-card *,
.results-competitor-card * {
    color: inherit;
}

/* Улучшаем использование пространства на больших экранах */
@media (min-width: 1400px) {
    .main-section {
        padding: 60px 0 80px; /* Больше вертикальных отступов */
    }

    .hero {
        margin-bottom: 60px;
    }
}

/* 🔧 v8.1: Demo mode padding для sticky banner */
body.demo-mode {
    padding-top: 80px;
}

.container {
    max-width: 100%; /* Убираем ограничение - используем всю ширину с padding */
    margin: 0 auto;
    padding: 0 5%; /* Адаптивный padding в процентах */
}

/* На больших экранах используем больше пространства */
@media (min-width: 1400px) {
    .container {
        padding: 0 8%; /* 8% с каждой стороны = больше рабочей зоны */
    }
}

@media (min-width: 1920px) {
    .container {
        padding: 0 10%; /* На очень больших экранах 10% = ~192px с каждой стороны */
        max-width: 1920px; /* Но не больше 1920px */
    }
}

/* На средних экранах стандартный padding */
@media (max-width: 1200px) {
    .container {
        padding: 0 4%;
    }
}

/* На мобильных минимальный padding */
@media (max-width: 768px) {
    .container {
        padding: 0 20px; /* Фиксированный для мобильных */
    }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   РЕФАКТОРИНГ 28.12.2025: Убраны, используется специфичность
   ═══════════════════════════════════════════════════════════════ */
/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.header.header-fixed,
body > .header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header, 1000);
    width: 100%;
    border-bottom: none;
    display: flex;
    visibility: visible;
    opacity: 1;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, используется более специфичный селектор */
.header::after,
.header::before,
.header.header-fixed::after,
.header.header-fixed::before,
body > .header::after,
body > .header::before {
    display: none;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.header .container,
.header.header-fixed .container,
body > .header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
    flex-shrink: 0;
}

.cabinet-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.version {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.3s;
}

nav a:hover {
    color: #6366F1;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.cabinet-link,
.header .cabinet-link,
nav .cabinet-link {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.cabinet-link:hover,
.header .cabinet-link:hover,
nav .cabinet-link:hover {
    background: var(--gradient-primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.cabinet-login-link,
.header .cabinet-login-link,
nav .cabinet-login-link {
    color: #6366F1;
    font-weight: 600;
    pointer-events: auto; /* Всегда кликабельна */
    opacity: 1; /* Всегда видима */
    cursor: pointer; /* Всегда показывает курсор указателя */
    text-decoration: none; /* Убираем подчеркивание при hover */
    position: relative; /* Для z-index */
    z-index: 10001; /* ВАЖНО: Выше header, чтобы не перекрывалась баннерами */
    display: inline-block; /* Всегда видима */
}

.cabinet-login-link:hover {
    color: #5568d3;
    text-decoration: underline; /* Подчеркивание при hover */
}

.header-start-cta,
.header nav .header-start-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    min-height: 40px;
    border-radius: 999px;
    background-color: #ea580c;
    background-image: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    -webkit-text-fill-color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    border: 0;
}

.header-buy-cta,
.header nav .header-buy-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-height: 40px;
    border-radius: 999px;
    background: #4f46e5;
    color: #fff;
    -webkit-text-fill-color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
    border: 0;
}

.header-buy-cta:hover,
.header nav .header-buy-cta:hover {
    color: #fff;
    filter: brightness(1.05);
}

.header-start-cta:hover,
.header nav .header-start-cta:hover {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

html[data-route="cabinet"] .header-start-cta,
html[data-route="lesson"] .header-start-cta,
html[data-route="public-test"] .header-start-cta,
html[data-route="cabinet"] .header-buy-cta,
html[data-route="lesson"] .header-buy-cta,
html[data-route="public-test"] .header-buy-cta {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   УПРАВЛЕНИЕ ВИДИМОСТЬЮ ЛЕНДИНГА ЧЕРЕЗ DATA-АТРИБУТЫ
   ═══════════════════════════════════════════════════════════════ */
/* ✅ ПРАВИЛЬНОЕ РЕШЕНИЕ: Управление видимостью через data-route на html */
html[data-route="home"] .main-section,
html:not([data-route]) .main-section {
    display: block;
    visibility: visible;
    opacity: 1;
}

html[data-route="home"] body.payment-form-open .main-section,
html:not([data-route]) body.payment-form-open .main-section,
body.payment-form-open .main-section,
body.payment-form-open .footer,
body.payment-form-open .floating-purchase-btn,
body.payment-form-open .v2-coach-chat {
    display: none;
    visibility: hidden;
    opacity: 0;
}

body.payment-form-open {
    overflow: hidden;
}

body.payment-form-open #payment-container {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: flex;
    visibility: visible;
    opacity: 1;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #f3f4f6;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

/* ✅ КРИТИЧНО: Убеждаемся что canvas контейнер видим на главной */
html[data-route="home"] #main-canvas-container,
html:not([data-route]) #main-canvas-container {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ✅ КРИТИЧНО: Убеждаемся что блоки лендинга видимы на главной */
#landing-scientific-credibility-container,
#landing-value-container,
#landing-competitor-container,
#landing-testimonials-container,
#landing-guarantee-container,
#results-main-offer-container,
#objection-handling-early {
    display: block;
    visibility: visible;
    opacity: 1;
}

html[data-route="cabinet"] .main-section,
html[data-route="lesson"] .main-section,
html[data-route="public-test"] .main-section {
    display: none;
    visibility: hidden;
    opacity: 0;
}

/* Показываем контейнер кабинета при data-route="cabinet" (переопределяет core.css) */
html[data-route="cabinet"] #cabinet-container {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ✅ КРИТИЧНО: Скрываем results-section только на страницах кабинета/уроков, НО НЕ на главной */
html[data-route="cabinet"] .results-section:not(.results-objection-emotional),
html[data-route="lesson"] .results-section:not(.results-objection-emotional),
html[data-route="public-test"] .results-section:not(.results-objection-emotional) {
    display: none;
}

/* ✅ КРИТИЧНО: На главной странице results-section ВСЕГДА видимы */
html[data-route="home"] .results-section,
html:not([data-route]) .results-section {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ✅ КРИТИЧНО: Гарантия и главный оффер всегда видимы на главной */
html[data-route="home"] .guarantee-section-modern,
html:not([data-route]) .guarantee-section-modern,
html[data-route="home"] .results-main-offer,
html:not([data-route]) .results-main-offer {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN SECTION
   ═══════════════════════════════════════════════════════════════ */

.main-section {
    padding: 40px 0 60px;
}

/* ═══════════════════════════════════════════════════════════════
   HERO (УТП + ВИДЕО) - НА ВСЮ ШИРИНУ ЭКРАНА
   ═══════════════════════════════════════════════════════════════ */

/* Hero выходит за пределы контейнера на всю ширину */
.hero {
    background: white;
    border-radius: 24px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
    overflow: hidden;
    position: relative;
    /* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* Контейнер внутри hero */
.hero .container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* На мобильных hero внутри контейнера */
@media (max-width: 768px) {
    .hero {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
    min-height: 450px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Мобильная адаптация hero */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-content {
        padding: 40px 30px;
    }

    .hero h1 {
        font-size: var(--font-size-hero-mobile, 36px); /* ТЗ: 36px для мобильных */
    }

    .hero-usp {
        font-size: 1.125rem;
    }

    .hero-benefits li {
        font-size: 1rem;
    }

    .hero-video-wrapper {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 10;
        border-radius: 20px;
        overflow: hidden;
    }

    .hero__video-container {
        height: 100%;
        border-radius: 20px;
    }

    .hero__video-container video {
        border-radius: 20px;
        object-fit: contain;
    }

    .canvas-examples {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .canvas-example-arrow {
        transform: rotate(90deg);
        font-size: 2rem;
    }

    .canvas-example-item {
        max-width: 100%;
    }
}

.hero-content {
    padding: 40px 40px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 2: ТИПОГРАФИКА (ТЗ v8.5) - УВЕЛИЧЕННЫЕ РАЗМЕРЫ
   ═══════════════════════════════════════════════════════════════ */

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem); /* Адаптивный размер вместо фиксированного 64px */
    font-weight: var(--font-weight-black, 900);
    line-height: var(--line-height-tight, 1.1);
    letter-spacing: -0.02em; /* Tighter для больших букв */
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-usp {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.6;
}

.hero-benefits {
    list-style: none;
    margin: 0 0 28px 0;
    padding: 0;
}

.hero-benefits li {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-weight: 500;
    line-height: 1.6;
}

.hero-benefit-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
}

.hero-benefit-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.hero-benefit-text {
    flex: 1;
    padding-top: 4px;
}

.hero-benefit-text strong {
    color: #111827;
    font-weight: 700;
}

.hero-cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 1: МОБИЛЬНЫЕ КНОПКИ (ТЗ v8.5) - hero-cta
   ═══════════════════════════════════════════════════════════════ */

.hero-cta {
    display: inline-block;
    padding: 20px 48px;
    min-height: 56px; /* Apple: 44pt = ~56px для touch */
    background: var(--gradient-warning);
    color: white;
    text-decoration: none;
    font-size: 1.375rem;
    font-weight: 800;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;

    /* Touch feedback */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.hero-cta:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.hero-cta:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
}

.hero-cta:hover::before {
    width: 400px;
    height: 400px;
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 2: ЦВЕТА (ТЗ v8.5) - УСИЛЕННЫЙ CTA
   ═══════════════════════════════════════════════════════════════ */

.hero-cta-primary {
    font-size: 1.5rem;
    padding: 22px 56px;
    background: var(--cta-primary, linear-gradient(135deg, #fb923c 0%, #f97316 100%));
    box-shadow:
        0 4px 6px rgba(251, 146, 60, 0.3),
        0 10px 20px rgba(251, 146, 60, 0.2);
}

.hero-cta-primary:hover {
    box-shadow:
        0 6px 12px rgba(251, 146, 60, 0.4),
        0 12px 24px rgba(251, 146, 60, 0.3);
}

/* Для срочных действий */
.cta-urgent {
    /* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
    background: var(--cta-urgent, linear-gradient(135deg, #dc2626 0%, #b91c1c 100%));
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(220, 38, 38, 0.6);
    }
}

.hero-cta-note {
    text-align: center;
    font-size: 0.9375rem;
    color: #6b7280;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   HERO VIDEO - ВИДИМОЕ (справа)
   ═══════════════════════════════════════════════════════════════ */

.hero-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 450px;
    max-height: 90vh;
    overflow: hidden; /* hidden для правильного border-radius */
    border-radius: 0 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); /* Красивый градиентный фон */
}

.hero__video-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero__video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* contain - предотвращает обрезку слова «Анализ» и сетки */
    object-position: center center; /* Центрируем видео */
    border-radius: 0 24px 24px 0;
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); /* Красивый градиентный фон вместо черного */
}

.hero__video-container:hover video {
    transform: scale(1.05);
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, используется utility класс .hidden */
.hero-video-overlay.hidden,
.hero-video-overlay:not(.show) {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.hero-video-play-icon.hidden,
.hero-video-play-icon:not(.show) {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.hero-video {
    height: 100%;
    background: #000;
    position: relative;
}

.hero-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════
   🔍 БЛОК "МОТИВАЦИЯ К АНАЛИЗУ" - AI TECH STYLE
   ═══════════════════════════════════════════════════════════════ */

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.motivation-section,
body > .motivation-section,
.main-section .motivation-section {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: #0a0a0f;
    background-image:
        radial-gradient(at 20% 30%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    max-height: none;
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
    display: flex; /* ✅ КРИТИЧНО: Всегда видимо */
    visibility: visible;
    align-items: center;
}

.motivation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.03) 50%, transparent 100%),
        linear-gradient(0deg, transparent 0%, rgba(168, 85, 247, 0.03) 50%, transparent 100%);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

.motivation-section-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: stretch;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    height: auto;
    min-height: calc(100vh - 88px - env(safe-area-inset-top, 0px));
    max-height: none;
    overflow: visible;
}

.motivation-section-image {
    position: relative;
    overflow: hidden;
    display: flex; /* ✅ КРИТИЧНО: Всегда видимо */
    visibility: visible;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100%;
    height: 100%;
    background: #0f0f15;
    /* ✅ ДОБАВЛЕНО: Гарантируем видимость на всех устройствах */
    min-width: 300px;
}

.motivation-section-text {
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    background: rgba(15, 15, 21, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: auto;
    box-sizing: border-box;
    overflow: visible;
}

.motivation-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #a8a8ff 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.3));
    margin: 0;
    line-height: 1.3;
    padding: 0.12em 0.06em 0.18em 0;
    overflow: visible;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.motivation-description {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.motivation-description strong {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.motivation-reasons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.motivation-reason {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.motivation-reason:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(8px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.motivation-reason-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.motivation-reason-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.motivation-reason-content {
    flex: 1;
}

.motivation-reason-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.motivation-reason-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

.motivation-cta {
    margin-top: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.motivation-cta-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 16px 0;
    font-weight: 600;
    text-align: center;
}

.motivation-cta-button {
    display: inline-block;
    width: 100%;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.motivation-cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #7c8ef5 0%, #8a5bb8 100%);
}

.motivation-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex; /* ✅ КРИТИЧНО: Всегда видимо */
    visibility: visible;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0f0f15;
    min-height: 400px; /* ✅ ДОБАВЛЕНО: Минимальная высота для видимости */
}

.motivation-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ✅ ИСПРАВЛЕНО: cover вместо contain для заполнения контейнера */
    display: block; /* ✅ КРИТИЧНО: Всегда видимо */
    visibility: visible;
    opacity: 0.9;
    filter: contrast(1.1) brightness(0.85);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    /* ✅ ДОБАВЛЕНО: Гарантируем видимость */
    position: relative;
    z-index: 1;
}

.motivation-section:hover .motivation-video {
    transform: scale(1.05);
    opacity: 1;
    filter: contrast(1.2) brightness(0.95);
}

.motivation-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        transparent 40%,
        transparent 60%,
        rgba(0, 0, 0, 0.9) 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 40px 40px 60px 40px;
    z-index: 2;
    transition: all 0.3s ease;
}

.motivation-section:hover .motivation-video-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        transparent 40%,
        transparent 60%,
        rgba(0, 0, 0, 0.85) 100%
    );
}

.motivation-video-play-icon {
    display: none; /* Скрываем иконку play, так как видео автоплеится */
}

.motivation-video-text {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 900;
    margin: 0 0 12px 0;
    font-style: italic;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
    color: #fbbf24;
    text-align: center;
    line-height: 1.2;
}

.motivation-video-subtext {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    line-height: 1.4;
}

.motivation-video-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    z-index: 3;
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.motivation-video-badge-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.motivation-video-badge-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.05em;
}

/* Mobile адаптация для видео */
@media (max-width: 1024px) {
    .motivation-section-content {
        grid-template-columns: 1fr;
    }

    .motivation-section-text {
        padding: 60px 40px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .motivation-section-image {
        max-height: 70vh;
        order: -1;
        display: flex; /* ✅ КРИТИЧНО: Всегда видимо */
        visibility: visible;
        min-height: 400px; /* ✅ ДОБАВЛЕНО: Минимальная высота */
    }

    .motivation-video-wrapper {
        max-height: 70vh;
        display: flex; /* ✅ КРИТИЧНО: Всегда видимо */
        visibility: visible;
        min-height: 400px; /* ✅ ДОБАВЛЕНО: Минимальная высота */
    }

    .motivation-video-play-icon {
        font-size: 3rem;
    }

    .motivation-video-badge {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .motivation-section-image {
        max-height: 60vh;
        display: flex; /* ✅ КРИТИЧНО: Всегда видимо на мобильных */
        visibility: visible;
        min-height: 300px; /* ✅ ДОБАВЛЕНО: Минимальная высота */
    }

    .motivation-video-wrapper {
        max-height: 60vh;
        display: flex; /* ✅ КРИТИЧНО: Всегда видимо на мобильных */
        visibility: visible;
        min-height: 300px; /* ✅ ДОБАВЛЕНО: Минимальная высота */
    }

    .motivation-video {
        display: block; /* ✅ КРИТИЧНО: Всегда видимо на мобильных */
        visibility: visible;
        width: 100%;
        height: 100%;
        object-fit: cover; /* ✅ ИСПРАВЛЕНО: cover для мобильных */
    }

    .motivation-video-overlay {
        padding: 30px 20px;
    }

    .motivation-video-play-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .motivation-video-text {
        font-size: 1.5rem;
    }

    .motivation-video-subtext {
        font-size: 1rem;
    }

    .motivation-video-badge {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
    }

    .motivation-video-badge-icon {
        font-size: 1rem;
    }

    .motivation-video-badge-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .motivation-section {
        margin: 60px 0 40px;
        padding-top: 0;
    }

    .motivation-section-text {
        padding: 40px 30px;
    }

    .motivation-title {
        font-size: 2rem;
    }

    .motivation-description {
        font-size: 1.125rem;
    }

    .motivation-reason {
        padding: 20px;
    }

    .motivation-reason-title {
        font-size: 1.25rem;
    }

    .motivation-reason-text {
        font-size: 1rem;
    }

    .motivation-cta-button {
        padding: 18px 30px;
        font-size: 1.125rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 3: ИЗМЕНЕНИЕ ПОРЯДКА БЛОКОВ (ТЗ v8.5) - "Зачем почерк?" на позиции 2
   ═══════════════════════════════════════════════════════════════ */

.objection-handling-early-container {
    width: 100vw;
    max-width: 100vw;
    margin: 60px 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0;
    box-sizing: border-box;
    display: block;
    visibility: visible;
    opacity: 1;
}

.objection-handling-early-container .objection-reasons-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.objection-handling-early-container .results-section {
    margin: 0;
    padding: 40px 20px;
    display: block;
    visibility: visible;
    opacity: 1;
    max-width: 100%;
}

.objection-handling-early-container .results-objection-emotional {
    padding: 40px 20px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: block;
    visibility: visible;
    opacity: 1;
    max-width: 100%;
    width: 100%;
}

/* КРИТИЧНО: Исключаем блок "Зачем почерк?" из глобальных правил цвета */
.results-objection-emotional,
.results-objection-emotional * {
    color: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   ✨ БЛОК "РЕШЕНИЕ" - ЭМОЦИОНАЛЬНОЕ ОБЕЩАНИЕ
   ═══════════════════════════════════════════════════════════════ */

.solution-section {
    width: 95%;
    max-width: 1800px;
    margin: 60px auto 40px;
    padding: 0;
    box-sizing: border-box;
}

.solution-section-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: var(--gradient-primary);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.solution-section-image {
    order: 2;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.solution-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.solution-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(102, 126, 234, 0.9), transparent);
    padding: 30px;
    color: white;
}

.solution-image-text {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    font-style: italic;
}

.solution-section-text {
    order: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: white;
}

.solution-title {
    font-size: var(--font-size-h2, 36px); /* ТЗ: использовать переменную */
    font-weight: var(--font-weight-extrabold, 800);
    color: white;
    margin: 0;
    line-height: var(--line-height-snug, 1.3);
}

.solution-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
}

.solution-benefits {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.solution-benefit {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.solution-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.solution-text {
    font-size: 1.125rem;
    color: white;
    font-weight: 600;
}

.solution-cta {
    display: inline-block;
    padding: 20px 48px;
    background: white;
    color: #6366F1;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: 8px;
}

.solution-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 3: УЛУЧШИТЬ ТЕСТ (ТЗ v8.5) - ПОДСКАЗКИ И ПРИМЕР
   ═══════════════════════════════════════════════════════════════ */

.canvas-hints {
    margin: 20px 0;
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.canvas-hint {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.canvas-examples {
    margin-top: 12px;
}

.canvas-example-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.canvas-example-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.canvas-example-item {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    font-size: 15px;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
}

.canvas-example-item:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.canvas-example {
    font-size: 16px;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   ✅ CANVAS SECTION - стили перенесены в canvas-animations.css
   ═══════════════════════════════════════════════════════════════ */

/* Canvas examples стили удалены - блок больше не используется */

.canvas-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: #111827;
}

/* ═══════════════════════════════════════════════════════════════
   ✅ v8.2: CANVAS CONTAINER - АКТИВНЫЙ!
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   CANVAS CONTAINER - КОСМИЧЕСКИЙ КОРАБЛЬ 2026
   ⚠️ ПРИМЕЧАНИЕ: Эти стили применяются только к урокам/практике
   Для лендинга используются стили из ai-canvas.css
   =══════════════════════════════════════════════════════════════ */

/* ✅ ИСПРАВЛЕНО: Закомментированы стили "космический корабль" для .canvas-container, чтобы не применялись к лендингу */
/* Стили "космический корабль" теперь применяются только к урокам/практике через practice.css */
/* .canvas-container {
    max-width: 900px;
    margin: 0 auto 30px;
    position: relative;
    background:
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.05), transparent),
        radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.05), transparent),
        #ffffff;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: var(--radius-xl, 1.5rem);
    padding: var(--spacing-lg, 1.5rem);
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(139, 92, 246, 0.15),
        inset 0 0 60px rgba(139, 92, 246, 0.05),
        0 20px 25px rgba(0, 0, 0, 0.1),
        0 10px 10px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
} */

/* ✅ ИСПРАВЛЕНО: Закомментированы стили "космический корабль" для .canvas-container, чтобы не применялись к лендингу */
/* Holographic border эффект */
/* .canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.5),
        rgba(139, 92, 246, 0.5),
        rgba(59, 130, 246, 0.5)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.6;
    animation: holographicBorder 3s ease-in-out infinite;
} */

/* @keyframes holographicBorder {
    0%, 100% {
        opacity: 0.5;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 0.8;
        filter: hue-rotate(10deg);
    }
} */

/* .canvas-container:hover {
    box-shadow:
        0 0 30px rgba(139, 92, 246, 0.25),
        inset 0 0 80px rgba(139, 92, 246, 0.08),
        0 25px 50px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
} */

/* .canvas-container:hover::before {
    opacity: 0.9;
    animation-duration: 2s;
} */

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
#handwriting-canvas {
    display: block;
    width: 100%;
    height: 500px;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="%236366F1" d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>') 12 12, crosshair;
    touch-action: none;
    opacity: 1;
    border: none;
    border-radius: var(--radius-md, 0.75rem);
    background: #ffffff;
    position: relative;
    z-index: 1;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 0 10px rgba(139, 92, 246, 0.05);
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    animation: canvasAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes canvasAppear {
    0% {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#handwriting-canvas:hover {
    box-shadow:
        inset 0 0 0 1px rgba(99, 102, 241, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 0 15px rgba(139, 92, 246, 0.1);
}

#handwriting-canvas:active {
    background: #faf9ff;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS & LIVE STATS
   ═══════════════════════════════════════════════════════════════ */

#canvasContainer {
    margin-bottom: 20px;
}

.progress-container {
    margin-bottom: 20px;
}

.live-stats {
    max-width: 800px;
    margin: 0 auto 20px;
    padding: 16px;
    background: #f3f4f6;
    border-radius: 12px;
}

.live-stats__grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.live-stats__item {
    font-size: 14px;
}

.live-stats__indicator {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}

.live-stats__indicator--pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.live-stats__indicator--ready {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* ═══════════════════════════════════════════════════════════════
   CONTROLS (КНОПКИ)
   ═══════════════════════════════════════════════════════════════ */

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   PRIORITY 1: МОБИЛЬНЫЕ КНОПКИ (ТЗ v8.5) - min-height 56px, touch feedback
   ═══════════════════════════════════════════════════════════════ */

.btn {
    padding: 15px 40px;
    min-height: 56px; /* Apple: 44pt = ~56px для touch */
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;

    /* Touch feedback */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-primary,
.btn--primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled),
.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.btn-primary:active,
.btn--primary:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-primary:disabled,
.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary,
.btn--secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover,
.btn--secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-secondary:active,
.btn--secondary:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS SECTION
   ═══════════════════════════════════════════════════════════════ */

.results-section {
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
    /* ✅ КРИТИЧНО: По умолчанию results-section видимы на главной */
    display: block;
    visibility: visible;
    opacity: 1;
}

/* ✅ КРИТИЧНО: Блок "Как мы анализируем" всегда видим в results-container */
#results-container .how-it-works-section,
.results-module--results-how-it-works {
    display: block;
    visibility: visible;
    opacity: 1;
}

#results-container {
    margin-top: 40px;
    width: 100%; /* На всю ширину, внутренние блоки сами ограничиваются через .results-section */
    max-width: 100%;
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 1;
}

/* КРИТИЧНО: Убеждаемся, что все модули результатов видны */
#results-container .results-module,
#results-container .canvas-hero-section,
#results-container .critical-params-section,
#results-container .strong-params-section,
#results-container .overall-score-section,
#results-container .detailed-stats-section {
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
    background: var(--gradient-primary);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    text-align: center;
    margin-top: 0;
    box-shadow: none;
    /* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
    border-top: none;
    border-bottom: none;
    border: none;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.footer::before,
.footer::after,
body > .footer::before,
body > .footer::after {
    display: none;
    content: none;
}

/* Убираем полоску между секциями и footer */
/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
main::after,
.main-section::after,
.guarantee-section-modern::after,
.faq-section-modern::after,
body > main::after,
body > .main-section::after {
    display: none;
    content: none;
    border: none;
}

.footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    margin-bottom: 5px;
}

.footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   🔧 МОБИЛЬНАЯ АДАПТАЦИЯ v8.1
   ═══════════════════════════════════════════════════════════════ */

/* Hero мобильная версия */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 40px 30px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero-video {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    /* Body demo mode */
    body.demo-mode {
        padding-top: 100px;
    }

    /* Hero */
    .hero {
        padding: 40px 25px;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero-benefits li {
        font-size: 1rem;
    }

    .hero-cta {
        width: 100%;
        text-align: center;
    }

    /* Canvas */
    .canvas-section {
        padding: 30px 20px;
    }

    #handwriting-canvas {
        height: 400px;
    }

    /* Navigation */
    /* ✅ ИСПРАВЛЕНО: Не скрываем nav полностью, только обычные ссылки (кнопка "Войти" должна быть видна) */
    nav {
        display: flex; /* ✅ УСИЛЕНО: Навигация всегда видна */
    }

    /* Скрываем обычные ссылки, оставляем кабинет, «Купить» и CTA «Начать» */
    nav a:not(.cabinet-login-link):not(.cabinet-link):not(.header-start-cta):not(.header-buy-cta) {
        display: none;
    }

    /* ✅ КРИТИЧНО: Кнопка "Войти" всегда видна */
    /* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
    nav .cabinet-login-link,
    .header nav .cabinet-login-link,
    body > .header nav .cabinet-login-link {
        display: inline-block;
        visibility: visible;
        opacity: 1;
    }

    /* Controls */
    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* Logo */
    .logo {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.5rem;
    }

    .canvas-section h3 {
        font-size: 1.25rem;
    }

    #handwriting-canvas {
        height: 350px;
    }

    .btn {
        font-size: 1rem;
        padding: 12px 30px;
    }

    .canvas-placeholder__icon {
        font-size: 36px;
    }

    .canvas-placeholder__text {
        font-size: 16px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   END OF MAIN STYLES v8.2 CANVAS FIX
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* Primitive Color Tokens */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-brown-600: rgba(94, 82, 64, 1);
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(38, 40, 40, 1);
  --color-slate-900: rgba(19, 52, 59, 1);
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);

  /* Common style patterns */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' 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");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' 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");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-gray-400-rgb: 119, 124, 124;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

    /* Semantic Color Tokens (Dark Mode) */
    --color-background: var(--color-charcoal-700);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-gray-200);
    --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
    --color-primary: var(--color-teal-300);
    --color-primary-hover: var(--color-teal-400);
    --color-primary-active: var(--color-teal-800);
    --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
    --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
    --color-border: rgba(var(--color-gray-400-rgb), 0.3);
    --color-error: var(--color-red-400);
    --color-success: var(--color-teal-300);
    --color-warning: var(--color-orange-400);
    --color-info: var(--color-gray-300);
    --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-gray-400-rgb), 0.2);
    --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);
    --button-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
    --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

    /* Common style patterns - updated for dark mode */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' 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");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' 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");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-teal-300-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-gray-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (dark mode) */
  --color-gray-400-rgb: 119, 124, 124;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */

  /* Semantic Color Tokens (Dark Mode) */
  --color-background: var(--color-charcoal-700);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-gray-200);
  --color-text-secondary: rgba(var(--color-gray-300-rgb), 0.7);
  --color-primary: var(--color-teal-300);
  --color-primary-hover: var(--color-teal-400);
  --color-primary-active: var(--color-teal-800);
  --color-secondary: rgba(var(--color-gray-400-rgb), 0.15);
  --color-secondary-hover: rgba(var(--color-gray-400-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-gray-400-rgb), 0.3);
  --color-border: rgba(var(--color-gray-400-rgb), 0.3);
  --color-error: var(--color-red-400);
  --color-success: var(--color-teal-300);
  --color-warning: var(--color-orange-400);
  --color-info: var(--color-gray-300);
  --color-focus-ring: rgba(var(--color-teal-300-rgb), 0.4);
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-gray-400-rgb), 0.15);
  --color-card-border-inner: rgba(var(--color-gray-400-rgb), 0.15);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  --color-border-secondary: rgba(var(--color-gray-400-rgb), 0.2);
  --color-select-caret: rgba(var(--color-gray-200-rgb), 0.8);

  /* Common style patterns - updated for dark mode */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' 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");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' 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");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-teal-300-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-gray-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;

  /* Semantic Color Tokens (Light Mode) */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900);
  --color-text-secondary: var(--color-slate-500);
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.12);
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.2);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.25);
  --color-border: rgba(var(--color-brown-600-rgb), 0.2);
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.12);
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.12);
  --color-error: var(--color-red-500);
  --color-success: var(--color-teal-500);
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-500);
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-teal-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-500-rgb);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-hover);
}

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--primary:active {
  background: var(--color-primary-active);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 16px;
  padding-right: var(--space-32);
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: var(--focus-outline);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Container layout */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: var(--space-16);
  padding-left: var(--space-16);
}

@media (min-width: 640px) {
  .container {
    max-width: var(--container-sm);
  }
}
@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: var(--container-xl);
  }
}

/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
/* ═══════════════════════════════════════════════════════════════
   🎯 LIVE PROGRESS CARDS v3.0
   ═══════════════════════════════════════════════════════════════ */

.live-progress-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    margin: var(--space-24) 0;
    padding: 0;
}

/* Карточка прогресса */
.progress-card {
    background: var(--color-surface);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-20);
    display: flex;
    align-items: flex-start;
    gap: var(--space-16);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.progress-card:hover {
    box-shadow: var(--shadow-md);
}

/* Иконка */
.progress-card__icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    color: var(--color-primary);
}

.progress-card__icon--orange {
    color: var(--color-orange-400);
}

/* Контент */
.progress-card__content {
    flex: 1;
    min-width: 0;
}

.progress-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-4);
}

.progress-card__value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: var(--space-8);
}

/* Progress bar */
.progress-card__bar {
    height: var(--space-8);
    background: var(--color-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-8);
}

.progress-card__bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--duration-normal) var(--ease-standard);
}

.progress-card__bar-fill--orange {
    background: var(--color-orange-400);
}

/* Подсказка */
.progress-card__hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

/* Статус (снизу) */
.progress-status {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-12) var(--space-16);
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.progress-status--ready {
    background: rgba(var(--color-success-rgb), 0.15);
    border-color: var(--color-success);
    color: var(--color-success);
}

/* Mobile portrait адаптация */
@media (max-width: 480px) {
    .live-progress-cards {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        margin: var(--space-16) 0;
    }

    .progress-card {
        padding: var(--space-12);
        gap: var(--space-12);
    }

    .progress-card__icon {
        font-size: 1.25rem;
    }

    .progress-card__value {
        font-size: var(--font-size-xl);
    }

    .progress-status {
        padding: var(--space-10) var(--space-12);
    }
}

/* Mobile адаптация */
@media (max-width: 640px) {
    .live-progress-cards {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }

    .progress-card {
        padding: var(--space-16);
    }

    .progress-card__icon {
        font-size: 1.5rem;
    }

    .progress-card__value {
        font-size: var(--font-size-2xl);
    }
}

/* ═══════════════════════════════════════════════════════════════
   ✍️ CANVAS PLACEHOLDER OVERLAY v3.0
   ═══════════════════════════════════════════════════════════════ */

.canvas-placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.3;
    transition: opacity var(--duration-normal) var(--ease-standard);
    z-index: 1;
}

.canvas-placeholder-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.canvas-placeholder-overlay__icon {
    font-size: 3rem;
    margin-bottom: var(--space-16);
    color: var(--color-text-secondary);
}

.canvas-placeholder-overlay__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-8);
    text-align: center;
}

.canvas-placeholder-overlay__subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

/* Mobile portrait адаптация */
@media (max-width: 480px) {
    .canvas-placeholder-overlay__icon {
        font-size: 2rem;
        margin-bottom: var(--space-12);
    }

    .canvas-placeholder-overlay__title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--space-6);
    }

    .canvas-placeholder-overlay__subtitle {
        font-size: var(--font-size-xs);
    }
}

/* Убеждаемся, что canvas-container position: relative */
.canvas-container {
    position: relative;
}

/* ========================================================================
   OVERRIDES 2026: BODY + CANVAS "КОСМИЧЕСКИЙ КОРАБЛЬ"
   ======================================================================== */

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
body {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.18), transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.16), transparent 45%),
    var(--gradient-primary);
  background-attachment: fixed;
  color: #111827;
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.canvas-container {
  max-width: 800px;
  margin: 0 auto 30px;
  position: relative;
  background:
    radial-gradient(ellipse at top, rgba(99,102,241,0.06), transparent),
    radial-gradient(ellipse at bottom, rgba(139,92,246,0.06), transparent),
    #ffffff;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-xl, 1.5rem);
  padding: var(--spacing-lg, 1.5rem);
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(139,92,246,0.16),
    inset 0 0 60px rgba(139,92,246,0.06),
    0 20px 25px rgba(0,0,0,0.10),
    0 10px 10px rgba(0,0,0,0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 300ms cubic-bezier(0.4,0,0.2,1);
}

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
.canvas-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg,
    rgba(99,102,241,0.55),
    rgba(139,92,246,0.55),
    rgba(59,130,246,0.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  animation: holographicBorder 3s ease-in-out infinite;
}

@keyframes holographicBorder {
  0%,100% { opacity: 0.5; filter: hue-rotate(0deg); }
  50%     { opacity: 0.85; filter: hue-rotate(12deg); }
}

.canvas-container:hover {
  box-shadow:
    0 0 30px rgba(139,92,246,0.26),
    inset 0 0 80px rgba(139,92,246,0.09),
    0 25px 50px rgba(0,0,0,0.16);
  transform: translateY(-2px);
}
.canvas-container:hover::before { opacity: 0.9; animation-duration: 2s; }

/* ✅ РЕФАКТОРИНГ 18.01.2026: Убран, повышена специфичность */
#handwriting-canvas,
.canvas-container canvas {
  border: none;
  border-radius: var(--radius-md, 0.75rem);
  background: #ffffff;
  cursor: crosshair;
  position: relative;
  z-index: 1;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.05),
    0 2px 4px rgba(0,0,0,0.02),
    0 0 10px rgba(139,92,246,0.06);
  transition: box-shadow 150ms cubic-bezier(0.4,0,0.2,1);
  animation: canvasAppear 0.6s cubic-bezier(0.4,0,0.2,1);
}

#handwriting-canvas:hover,
.canvas-container canvas:hover {
  box-shadow:
    inset 0 0 0 1px rgba(99,102,241,0.12),
    0 4px 8px rgba(0,0,0,0.04),
    0 0 15px rgba(139,92,246,0.12);
}

#handwriting-canvas.is-drawing,
.canvas-container canvas.is-drawing {
  box-shadow:
    inset 0 0 0 2px rgba(99,102,241,0.22),
    0 4px 8px rgba(0,0,0,0.04),
    0 0 20px rgba(139,92,246,0.16);
}

@keyframes canvasAppear {
  0%   { opacity: 0; transform: scale(0.98) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}



/* --- floating-coach-chat.css --- */
/**
 * ═══════════════════════════════════════════════════════════════
 * 🤖 ПРЕМИАЛЬНЫЙ МОБИЛЬНЫЙ ЧАТ PERSONAGE POCHERKPRO (V2)
 * По канонам нативных мессенджеров (Telegram / iOS)
 * ═══════════════════════════════════════════════════════════════
 */

/* ─── Аватары ─── */
.v2-coach-avatar-wrap,
.v2-coach-chat-msg-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(13, 148, 136, 0.1);
}

.v2-coach-avatar,
.v2-coach-avatar-wrap img,
.v2-coach-chat-msg-avatar img,
.v2-coach-chat-toggle-avatar img,
.v2-coach-chat-toggle-avatar-slot img,
.v2-coach-chat-head-avatar img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
    display: block;
    transform: none;
}

.v2-coach-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ─── Корневой контейнер чата ─── */
.v2-coach-chat {
    position: fixed;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 100010;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

body.canvas-writing-mode-open .v2-coach-chat,
body.has-viral-modal-open .v2-coach-chat,
body.has-active-viral-card .v2-coach-chat,
body:has(.viral-share-modal) .v2-coach-chat,
body:has(#viral-coach-overlay.active) .v2-coach-chat,
body:has(.viral-coach-overlay.active) .v2-coach-chat,
body.is-landing-top .v2-coach-chat:not(.is-open) {
    display: none;
}

body:has(.pwa-install-banner) .v2-coach-chat,
body.has-pwa-install-banner .v2-coach-chat {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.25s ease;
}

/* 🚀 Подъем чат-бота над липучкой тарифа, чтобы они никогда не накладывались */
body.has-floating-purchase-visible .v2-coach-chat,
body:has(.floating-purchase-bar.is-visible) .v2-coach-chat {
    bottom: calc(114px + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.v2-coach-chat.is-open {
    pointer-events: auto;
}

/* ─── Плавающая кнопка вызова (FAB) ─── */
.v2-coach-chat-toggle,
.v2-coach-chat-toggle--consultant {
    position: relative;
    z-index: 4;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 5px;
    border-radius: 999px;
    border: 1.5px solid rgba(45, 212, 191, 0.4);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 12px rgba(45, 212, 191, 0.2);
    cursor: pointer;
    max-width: 220px;
    max-height: 48px;
    height: 48px;
    overflow: hidden;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.v2-coach-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(45, 212, 191, 0.35);
    border-color: #2dd4bf;
}

.v2-coach-chat-toggle-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    pointer-events: none;
}

.v2-coach-chat-toggle-avatar,
.v2-coach-chat-toggle-avatar-slot,
span.v2-coach-chat-toggle-avatar,
div.v2-coach-chat-toggle-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.3);
}

.v2-coach-chat-toggle-avatar img,
.v2-coach-chat-toggle-avatar-slot img,
span.v2-coach-chat-toggle-avatar img,
div.v2-coach-chat-toggle-avatar img,
.v2-coach-chat-toggle img,
img.v2-coach-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    transform: none;
}

.v2-coach-chat-toggle .v2-coach-avatar-wrap {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
}

.v2-coach-chat-toggle-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.v2-coach-chat-toggle-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.15;
    white-space: nowrap;
}

.v2-coach-chat-toggle-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
}

.v2-coach-chat-toggle-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
}

/* ─── Панель чата (Desktop) ─── */
.v2-coach-chat-panel {
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    animation: v2ChatScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes v2ChatScaleUp {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.v2-coach-chat:not(.is-open) .v2-coach-chat-panel {
    display: none;
    pointer-events: none;
}

.v2-coach-chat.is-open .v2-coach-chat-panel {
    display: flex;
    visibility: visible;
    opacity: 1;
}

/* ─── Шапка чата ─── */
.v2-coach-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #0f172a;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.v2-coach-chat-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(45, 212, 191, 0.4);
    background: rgba(45, 212, 191, 0.15);
    color: #2dd4bf;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.v2-coach-chat-back-btn:hover {
    background: rgba(45, 212, 191, 0.25);
    color: #ffffff;
    border-color: #2dd4bf;
}

.v2-coach-chat-return-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px 2px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.v2-coach-chat-return-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 320px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.v2-coach-chat-return-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.v2-coach-chat-return-btn:active {
    transform: scale(0.98);
}

.v2-coach-chat-head-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid rgba(45, 212, 191, 0.5);
    background: rgba(45, 212, 191, 0.15);
}

.v2-coach-chat-head-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.v2-coach-chat-head-copy strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v2-coach-chat-head-copy span {
    font-size: 0.75rem;
    color: #2dd4bf;
    display: flex;
    align-items: center;
    gap: 4px;
}

.v2-coach-chat-head-copy span::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.v2-coach-chat-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.v2-coach-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ─── Список сообщений ─── */
.v2-coach-chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    -webkit-overflow-scrolling: touch;
}

.v2-coach-chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 100%;
}

.v2-coach-chat-msg--assistant {
    justify-content: flex-start;
}

.v2-coach-chat-msg--user {
    justify-content: flex-end;
}

.v2-coach-chat-msg-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    max-width: 30px;
    max-height: 30px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.v2-coach-chat-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    word-break: break-word;
}

.v2-coach-chat-msg--user .v2-coach-chat-bubble {
    background: #0d9488;
    color: #ffffff;
    border: 1px solid #0d9488;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.25);
}

.v2-coach-chat-bubble--typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 12px 16px;
    min-height: 20px;
}

.v2-coach-chat-bubble--typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0d9488;
    animation: v2CoachTyping 1.2s ease-in-out infinite;
}

.v2-coach-chat-bubble--typing span:nth-child(2) { animation-delay: 0.2s; }
.v2-coach-chat-bubble--typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes v2CoachTyping {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-4px); }
}

/* ─── Быстрые вопросы (Chips) ─── */
.v2-coach-chat-chips-bar {
    flex-shrink: 0;
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.v2-coach-chat-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}

.v2-coach-chat-chips::-webkit-scrollbar {
    display: none;
}

.v2-coach-chat-chip {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.4);
    background: rgba(13, 148, 136, 0.08);
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}

.v2-coach-chat-chip:hover {
    background: rgba(13, 148, 136, 0.18);
    color: #0d9488;
}

/* ─── Поле ввода (Compose) ─── */
.v2-coach-chat-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.v2-coach-chat-input {
    flex: 1 1 auto;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font: inherit;
    font-size: 0.92rem;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.v2-coach-chat-input:focus {
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

html.v2-coach-chat-open,
body.v2-coach-chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    inset: 0;
    touch-action: none;
}

.v2-coach-chat-send {
    flex-shrink: 0;
    padding: 9px 16px;
    border: none;
    border-radius: 12px;
    background: #0d9488;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.v2-coach-chat-send:hover {
    background: #0f766e;
}

.v2-coach-chat-send:active {
    transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════
   📱 МОБИЛЬНЫЙ РЕЖИМ (iOS / Android Messenger Standard)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .v2-coach-chat {
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .v2-coach-chat.is-open {
        position: fixed;
        inset: 0;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        margin: 0;
        padding: 0;
        transform: none;
        z-index: 100030;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background: #ffffff;
    }

    .v2-coach-chat.is-open .v2-coach-chat-toggle {
        display: none;
    }

    .v2-coach-chat-panel,
    .v2-coach-chat.is-open .v2-coach-chat-panel {
        position: relative;
        inset: auto;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        box-sizing: border-box;
        z-index: 1;
    }

    .v2-coach-chat-head {
        padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
        min-height: 54px;
    }

    .v2-coach-chat-messages {
        padding: 14px 10px;
        flex: 1 1 auto;
        min-height: 0;
    }

    .v2-coach-chat-bubble {
        max-width: 86%;
        font-size: 0.92rem;
    }

    .v2-coach-chat-return-bar {
        padding: 6px 10px 2px;
    }

    .v2-coach-chat-compose {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        background: #ffffff;
        border-top: 1px solid #e2e8f0;
    }

    .v2-coach-chat-input {
        min-height: 40px;
        height: 40px;
        font-size: 0.92rem;
    }

    .v2-coach-chat-send {
        padding: 8px 14px;
        height: 40px;
    }
}

/* ─── Адаптация для страниц статей (/articles/) ─── */
body.article-page .v2-coach-chat {
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 20px;
}

@media (max-width: 480px) {
    body.article-page .v2-coach-chat {
        right: 12px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
    body.article-page .v2-coach-chat-toggle {
        max-width: 200px;
        height: 44px;
        padding: 4px 12px 4px 4px;
    }
}



/* --- pwa-install-banner.css --- */
/**
 * PWA Install Banner — Organic Neuro Design
 */

.pwa-install-banner {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 440px;
    margin: 0 auto;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-radius: 14px;
    border: 1px solid rgba(26, 122, 114, 0.25);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(26, 122, 114, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-sizing: border-box;
}

/* ✅ На мобильном: поднимаем баннер строго над нижним навигационным меню (64px таббар + 14px отступ) */
@media (max-width: 768px) {
    .pwa-install-banner {
        bottom: calc(68px + 14px + env(safe-area-inset-bottom, 0px));
    }
}

body.canvas-writing-mode-open .pwa-install-banner {
    display: none;
}

@keyframes pwaSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pwa-install-banner__icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.pwa-install-banner__content {
    flex: 1 1 auto;
    min-width: 0;
}

.pwa-install-banner__title {
    margin: 0 0 2px 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.pwa-install-banner__desc {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
}

.pwa-install-banner__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-install-banner__install-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: #0d9488;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.pwa-install-banner__install-btn:hover,
.pwa-install-banner__install-btn:active {
    background: #0f766e;
    transform: translateY(-1px);
}

.pwa-install-banner__close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    font-size: 0.9375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s ease;
}

.pwa-install-banner__close-btn:hover {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

/* Modal instruction for iOS / Yandex Browser manual step */
.pwa-install-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pwa-install-modal {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    color: #0f172a;
}

.pwa-install-modal__title {
    margin: 0 0 10px;
    font-size: 1.0625rem;
    font-weight: 700;
}

.pwa-install-modal__steps {
    margin: 0 0 16px;
    padding-left: 20px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
}

.pwa-install-modal__steps li {
    margin-bottom: 8px;
}

.pwa-install-modal__btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #0d9488;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}


/* --- mobile-responsive.css --- */
/**
 * Mobile-first fixes: landing header clearance + cabinet app shell
 * Load last on landing and cabinet pages.
 */

/* ── Landing: fixed header must not cover hero ── */
@media (max-width: 768px) {
    body > .header {
        padding: 10px 0;
    }

    body > .header .container {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        padding: 0 12px;
    }

    body > .header .logo {
        font-size: 1.125rem;
        min-width: 0;
        flex: 0 1 auto;
    }

    body > .header .logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 38vw;
    }

    body > .header .logo-icon {
        width: 28px;
        height: 28px;
    }

    body > .header nav {
        flex-shrink: 0;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    body > .header .cabinet-link {
        padding: 0.45rem 0.55rem;
        font-size: 0;
        line-height: 0;
        gap: 0;
        min-width: 44px;
        width: 44px;
        justify-content: center;
    }

    body > .header .cabinet-link .nav-icon {
        width: 22px;
        height: 22px;
    }

    body > .header nav .header-buy-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        min-height: 40px;
        border-radius: 999px;
        background: #4f46e5;
        color: #ffffff;
        -webkit-text-fill-color: #ffffff;
        font-weight: 700;
        font-size: 0.8125rem;
        line-height: 1.2;
        white-space: nowrap;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
        border: 0;
    }

    body > .header nav .header-start-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
        min-height: 40px;
        border-radius: 999px;
        background: #ea580c;
        background-image: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
        color: #ffffff;
        -webkit-text-fill-color: #ffffff;
        font-weight: 700;
        font-size: 0.8125rem;
        line-height: 1.2;
        white-space: nowrap;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
        border: 0;
    }

    body > .header nav .header-start-cta__extra {
        display: none;
    }

    body > .header nav .cabinet-login-link {
        display: none;
    }

    body {
        padding-top: 0;
    }

    html[data-route="home"] .main-section,
    html:not([data-route]) .main-section,
    main.main-section,
    .main-section {
        padding-top: calc(64px + env(safe-area-inset-top, 0px));
        margin-top: 0;
        scroll-margin-top: calc(70px + env(safe-area-inset-top, 0px));
    }

    html {
        scroll-padding-top: calc(88px + env(safe-area-inset-top, 0px));
    }

    .hero {
        margin-top: 0;
        padding-top: 8px;
        overflow: visible;
        height: auto;
        max-height: none;
    }

    .hero-grid {
        height: auto;
        max-height: none;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 16px 20px 24px;
        justify-content: flex-start;
        height: auto;
        max-height: none;
    }

    .hero-badge {
        display: inline-block;
        margin-top: 0;
        margin-bottom: 12px;
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .hero h1 {
        font-size: clamp(1.375rem, 5.5vw, 1.75rem);
        line-height: 1.25;
        margin-top: 0;
        margin-bottom: 12px;
    }

    .hero-video-wrapper {
        min-height: 0;
        height: auto;
        max-height: none;
        aspect-ratio: 16 / 10;
        border-radius: 20px;
        margin: 0 16px 24px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .hero__video-container {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 20px;
    }

    .hero__video-container video,
    #hero-video {
        width: 100%;
        height: 100%;
        border-radius: 20px;
        object-fit: contain;
        object-position: center center;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .motivation-section,
    .motivation-section-content {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
        align-items: stretch;
    }

    .motivation-section-text {
        height: auto;
        overflow: visible;
        overflow-y: visible;
        order: 1;
    }

    .motivation-section-image {
        height: auto;
        min-height: 0;
        min-width: 0;
        order: 2;
        flex-direction: column;
        overflow: visible;
    }

    .motivation-video-caption {
        flex: 0 0 auto;
    }

    .motivation-video-wrapper {
        position: relative;
        height: auto;
        max-height: none;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .motivation-video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Блок «Зачем почерк?» — без чёрных дыр под фото */
    .objection-reason-content {
        min-height: 0;
    }

    .objection-reason-left .objection-reason-image-wrapper,
    .objection-reason-right .objection-reason-image-wrapper,
    .objection-reason-image-wrapper {
        position: relative;
        min-height: 0;
        height: auto;
        aspect-ratio: 4 / 3;
        background: transparent;
    }

    .results-section .objection-reason-image,
    .objection-reason-image {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        object-fit: cover;
        object-position: center top;
        border-radius: 0;
        display: block;
    }

    /* Стек справа: консультант выше, «Получить доступ» под ним */
    .v2-coach-chat--landing {
        right: 8px;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }

    .floating-purchase-btn {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: auto;
        z-index: 100010;
        justify-content: center;
        padding: 12px 16px;
        min-height: 52px;
    }

    .floating-purchase-btn.is-visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .main-section {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    html:not([data-route="cabinet"]):not([data-route="lesson"]) #cabinet-container {
        display: none;
        height: 0;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    .footer {
        margin-top: 0;
        padding-top: 24px;
    }

    .canvas-btn--upload {
        display: none;
    }

    #main-canvas-container,
    #objection-handling-early,
    .hero,
    .results-objection-emotional {
        scroll-margin-top: calc(76px + env(safe-area-inset-top, 0px));
    }

    .canvas-hero-section {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
        padding-left: 12px;
        padding-right: 12px;
    }

    .ai-canvas-container,
    .ai-canvas-wrapper,
    .ai-live-panel {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        left: auto;
        right: auto;
    }

    #handwriting-canvas,
    #ai-handwriting-canvas {
        width: 100%;
        height: min(52dvh, 420px);
    }

    .ai-canvas-wrapper.is-writing-fs {
        z-index: 100220;
        padding: 0;
    }

    .ai-canvas-wrapper.is-writing-fs #handwriting-canvas,
    .ai-canvas-wrapper.is-writing-fs #ai-handwriting-canvas,
    .ai-canvas-wrapper.is-writing-fs canvas {
        width: 100%;
        height: 100%;
        min-height: 100dvh;
        max-width: none;
        max-height: none;
    }

    body.canvas-writing-mode-open #main-canvas-container {
        z-index: 100210;
    }

    body.canvas-writing-mode-open > .header,
    body.canvas-writing-mode-open .offer-analysis-note-section {
        visibility: hidden;
        pointer-events: none;
    }

    .offer-timer {
        margin-bottom: 16px;
        font-size: 0.9375rem;
        line-height: 1.4;
        padding: 0 8px;
    }

    .offer-timer-value {
        display: inline-block;
        font-size: 1.125rem;
        color: #fbbf24;
        -webkit-text-fill-color: #fbbf24;
        background: none;
        letter-spacing: 0.02em;
    }

    .offer-pricing-highlight {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .offer-pricing-new {
        font-size: 2rem;
        color: #c4b5fd;
        -webkit-text-fill-color: #c4b5fd;
        background: none;
        filter: none;
    }

    #results-dynamic:empty {
        display: none;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .interpretation-overlay:not(.interpretation-overlay--pending) {
        pointer-events: auto;
    }

    .ai-metric {
        overflow: hidden;
        min-width: 0;
    }

    .ai-metric-icon {
        width: 22px;
        height: 22px;
    }

    .ai-metric-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .hero-content {
        padding: 28px 20px;
    }
}

/* ── Cabinet: full-width app shell on phones ── */
@media (max-width: 768px) {
    html,
    body.organic-theme {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
    }

    body.organic-theme #cabinet-new-wrap,
    body.organic-theme .cabinet-v2-wrap,
    body.organic-theme #v2-root,
    body.organic-theme .v2-shell,
    body.organic-theme .v2-view {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.organic-theme .v2-skeleton {
        padding: 0;
    }

    body.organic-theme .v2-shell-header {
        padding: 0;
        position: sticky;
        top: 0;
        z-index: 110;
    }

    body.organic-theme .v2-shell-header-inner {
        max-width: none;
        width: 100%;
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        align-items: center;
        gap: 8px;
        box-sizing: border-box;
    }

    body.organic-theme .v2-shell-header-left {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    body.organic-theme .v2-shell-header-info {
        min-width: 0;
        flex: 1;
    }

    body.organic-theme .v2-shell-header-title {
        font-size: 1rem;
        text-transform: none;
        letter-spacing: -0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.organic-theme .v2-shell-header-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid rgba(15, 118, 110, 0.2);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.95);
        flex-shrink: 0;
        cursor: pointer;
        color: #0f766e;
        font-weight: 700;
        font-size: 0.8125rem;
        box-shadow: 0 1px 4px rgba(15, 118, 110, 0.08);
        line-height: 1;
    }

    body.organic-theme .v2-shell-header-menu-btn em {
        font-style: normal;
        font-weight: 700;
        letter-spacing: 0.01em;
        line-height: 1;
        color: #0f766e;
    }

    body.organic-theme .v2-shell-header-menu-btn .v2-shell-menu-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        width: auto;
        height: auto;
    }

    body.organic-theme .v2-shell-header-menu-btn .v2-shell-menu-icon svg {
        display: block;
        width: 16px;
        height: 16px;
    }

    body.organic-theme #shell-nav.v2-shell-nav {
        display: none;
    }

    body.organic-theme .v2-view {
        padding-left: 8px;
        padding-right: 8px;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    body.organic-theme .organic-bento-grid,
    body.organic-theme .v2-view-home .organic-bento-grid,
    body.organic-theme .v2-view-lessons .v2-lessons-page,
    body.organic-theme .v2-view-progress .v2-progress-page,
    body.organic-theme .v2-view-baseline.baseline-v2,
    body.organic-theme .baseline-v2 {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
    }

    body.organic-theme .organic-bento-grid {
        padding: 12px 0 16px;
        gap: 12px;
    }

    body.organic-theme .organic-card {
        padding: 16px 14px;
        border-radius: 20px;
    }

    body.organic-theme .neuro-greeting {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    body.organic-theme .v2-view-login {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        min-height: calc(100dvh - 56px);
        padding: 16px 12px calc(24px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
    }

    body.organic-theme .v2-view-login .v2-login-form {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 1.75rem 1.25rem;
        box-sizing: border-box;
        border-radius: 24px;
    }

    body.organic-theme .v2-view-login .v2-login-input,
    body.organic-theme .v2-view-login .v2-login-select {
        font-size: 16px;
    }

    body.organic-theme .lesson-theory-panel,
    body.organic-theme .lesson-practice-panel {
        min-width: 0;
    }

    body.organic-theme .v2-coach-chat {
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 24px);
        z-index: 100010;
        transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    body.organic-theme.has-floating-purchase-visible .v2-coach-chat,
    body.organic-theme:has(.floating-purchase-bar.is-visible) .v2-coach-chat {
        bottom: calc(114px + env(safe-area-inset-bottom, 0px));
    }

    body.organic-theme .v2-coach-chat-toggle,
    body.organic-theme .v2-coach-chat-toggle--consultant {
        width: auto;
        height: auto;
        min-height: 44px;
        padding: 4px 12px 4px 5px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    body.organic-theme .v2-coach-chat-toggle--consultant .v2-coach-chat-toggle-copy {
        display: flex;
        flex-direction: column;
    }

    .baseline-v2-test-canvas-wrap,
    .baseline-v2-test-canvas-wrap canvas {
        width: 100%;
        max-width: 100%;
    }

    .baseline-v2-intro {
        padding: 1.25rem 1rem;
    }

    .baseline-v2-actions {
        flex-direction: column;
    }

    .baseline-v2-actions .btn-primary,
    .baseline-v2-actions .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body.organic-theme .v2-view-login .v2-shell-nav,
    body.organic-theme .v2-view-error .v2-shell-nav {
        display: none;
    }

    body.organic-theme .v2-view-login .v2-view,
    body.organic-theme .v2-view-error .v2-view {
        padding-bottom: 1.5rem;
    }
}

