        :root {
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --primary-light: #8b5cf6;
            --primary-bg: #eef2ff;
            --success: #10b981;
            --error: #ef4444;
            --warning: #f59e0b;
            --background: #ffffff;
            --surface: #f8fafc;
            --surface-light: #ffffff;
            --border: #e2e8f0;
            --text: #1e293b;
            --text-secondary: #64748b;
            --text-light: #94a3b8;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
            --radius: 16px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
            background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
            color: var(--text);
            min-height: 100vh;
            line-height: 1.6;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            max-width: 1000px;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .main-card {
            background: var(--surface-light);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            overflow: hidden;
            border: 1px solid var(--border);
        }

        .header {
            padding: 20px 32px 15px;
            text-align: center;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            color: white;
            position: relative;
            overflow: hidden;
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        .logo {
            font-size: 1.75rem;
            margin-bottom: 6px;
            font-weight: 800;
            position: relative;
        }

        h1 {
            font-size: 1.35rem;
            font-weight: 700;
            margin-bottom: 4px;
            position: relative;
        }

        .subtitle {
            font-size: 0.85rem;
            opacity: 0.9;
            position: relative;
        }

        .content {
            padding: 24px 32px 32px;
        }

        /* Прогресс под шапкой */
        .progress-container {
            background: var(--surface);
            border-radius: 0 0 var(--radius) var(--radius);
            padding: 16px 32px;
            margin-bottom: 0;
            border: none;
            border-top: 1px solid var(--border);
            box-shadow: none;
            display: none;
        }

        .progress-container.active {
            display: block;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background: var(--border);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--primary-light));
            width: 0%;
            transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            border-radius: 4px;
            position: relative;
        }

        .progress-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .loader-text {
            color: var(--text-secondary);
            font-weight: 500;
            margin-top: 8px;
            font-size: 0.9rem;
            text-align: center;
        }

        /* Ссылка для скачивания в области прогресса */
        .download-container {
            background: var(--surface);
            border-radius: 0 0 var(--radius) var(--radius);
            padding: 20px 32px;
            margin-bottom: 0;
            border: none;
            border-top: 1px solid var(--border);
            box-shadow: none;
            display: none;
            text-align: center;
            animation: slideUp 0.5s ease;
        }

        .download-container.active {
            display: block;
        }

        .download-success {
            color: var(--success);
            font-weight: 600;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 0.95rem;
        }

        .download-link {
            background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
            color: white;
            text-decoration: none;
            padding: 12px 24px;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 8px;
            box-shadow: var(--shadow);
        }

        .download-link:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
            color: white;
        }

        .file-info {
            margin-top: 12px;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        /* СТАТИСТИКА ОБРАБОТКИ */
        .stats-container {
            background: var(--surface);
            border-radius: var(--radius);
            padding: 20px;
            margin: 20px 0;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            display: none;
        }

        .stats-container.active {
            display: block;
            animation: slideUp 0.5s ease;
        }

        .stats-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .stats-title {
            font-size: 1.05rem;
            font-weight: 700;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .stats-title i {
            color: var(--primary);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
        }

        .stat-card {
            background: var(--surface-light);
            border-radius: 10px;
            padding: 16px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
            text-align: center;
        }

        .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 4px;
            color: var(--primary);
        }

        .stat-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        /* Кнопка обработки */
        .btn-container {
            margin-top: 20px;
            display: none;
        }

        .btn-container.active {
            display: block;
            animation: slideUp 0.5s ease;
        }

        .btn {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
            color: white;
            border: none;
            padding: 14px 28px;
            border-radius: 12px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            width: 100%;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 25px rgba(99, 102, 241, 0.3);
        }

        .btn:hover::before {
            left: 100%;
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .btn:disabled::before {
            display: none;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .settings-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-bottom: 20px;
        }

        .settings-section {
            background: var(--surface-light);
            border-radius: var(--radius);
            padding: 20px;
            border: 1px solid var(--border);
            box-shadow: var(--shadow);
        }

        /* Обновленный блок загрузки файлов */
        .upload-container {
            border: 2px dashed var(--border);
            border-radius: var(--radius);
            padding: 40px 32px;
            text-align: center;
            cursor: pointer;
            transition: var(--transition);
            margin-bottom: 20px;
            background: var(--surface);
            position: relative;
        }

        .upload-container.has-files {
            border-color: var(--success);
            background: rgba(16, 185, 129, 0.05);
        }

        .upload-container:hover {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.02);
            transform: translateY(-2px);
            box-shadow: var(--shadow);
        }

        .upload-container.has-files:hover {
            border-color: var(--success);
            background: rgba(16, 185, 129, 0.08);
        }

        .upload-container.dragover {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.05);
            transform: scale(1.01);
        }

        /* Стили для заблокированной области загрузки */
        .upload-container.disabled {
            opacity: 0.6;
            cursor: not-allowed;
            border-color: var(--text-light);
            background: var(--surface);
        }

        .upload-container.disabled:hover {
            border-color: var(--text-light);
            background: var(--surface);
            transform: none;
            box-shadow: var(--shadow);
        }

        .upload-container.disabled .upload-icon {
            color: var(--text-light);
            opacity: 0.5;
        }

        .upload-container.disabled .upload-text {
            color: var(--text-light);
        }

        .upload-container.disabled .upload-hint {
            color: var(--text-light);
        }

        .upload-container.disabled .upload-additional {
            color: var(--text-light);
        }

        .upload-icon {
            font-size: 56px;
            margin-bottom: 16px;
            opacity: 0.7;
            transition: var(--transition);
            color: var(--primary);
        }

        .upload-container.has-files .upload-icon {
            color: var(--success);
        }

        .upload-container:hover .upload-icon {
            opacity: 1;
            transform: scale(1.1);
        }

        .upload-text {
            font-weight: 600;
            font-size: 1.05rem;
            margin-bottom: 6px;
            color: var(--text);
        }

        .upload-container.has-files .upload-text {
            color: var(--success);
        }

        .upload-hint {
            color: var(--text-secondary);
            font-size: 0.8rem;
            margin-bottom: 12px;
        }

        .upload-additional {
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-style: italic;
            margin-top: 8px;
            display: none;
        }

        .upload-container.has-files .upload-additional {
            display: block;
        }

        .file-count-badge {
            background: var(--success);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            margin-top: 8px;
            display: inline-block;
        }

        input[type="file"] {
            display: none;
        }

        .file-info {
            margin: 16px 0;
            padding: 16px;
            background: var(--surface);
            border-radius: var(--radius);
            border-left: 4px solid var(--primary);
            box-shadow: var(--shadow);
            display: none;
        }

        .file-header {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .file-icon {
            font-size: 1.3rem;
            color: var(--primary);
        }

        .file-details {
            flex: 1;
        }

        .file-name {
            font-weight: 600;
            color: var(--text);
            margin-bottom: 2px;
            font-size: 0.95rem;
        }

        .file-size {
            color: var(--text-secondary);
            font-size: 0.8rem;
        }

        .file-count {
            background: var(--primary-bg);
            color: var(--primary);
            padding: 3px 10px;
            border-radius: 10px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .section-title {
            font-size: 1.05rem;
            font-weight: 700;
            margin-bottom: 14px;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .section-title i {
            color: var(--primary);
        }

        .setting-group {
            margin-bottom: 14px;
            position: relative;
        }

        .setting-group:last-child {
            margin-bottom: 0;
        }

        .setting-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }

        .setting-label {
            font-weight: 600;
            color: var(--text);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 6px;
            position: relative;
        }

        .setting-value {
            color: var(--primary);
            font-weight: 700;
            font-size: 0.85rem;
            background: var(--primary-bg);
            padding: 2px 8px;
            border-radius: 16px;
            min-width: 36px;
            text-align: center;
        }

        .info-btn {
            background: var(--primary-bg);
            border: none;
            color: var(--primary);
            cursor: help;
            font-size: 0.8rem;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            border-radius: 50%;
            margin-right: 6px;
            pointer-events: auto !important;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            border: 1px solid var(--primary);
        }

        .info-btn:hover {
            background: var(--primary);
            color: white;
            transform: scale(1.1);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }

        .info-btn:active {
            transform: scale(0.95);
        }

        /* Кнопки информации остаются одинаковыми при блокировке */
        .settings-section.disabled .info-btn {
            /* Сохраняем оригинальные стили без изменений */
            background: var(--primary-bg);
            color: var(--primary);
            border-color: var(--primary);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .settings-section.disabled .info-btn:hover {
            background: var(--primary);
            color: white;
            transform: scale(1.1);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        }

        /* УЛУЧШЕННЫЕ СТИЛИ ДЛЯ ПОЛЗУНКОВ */
        .slider-container {
            position: relative;
            padding: 12px 0 8px;
            margin: 0 -5px;
        }

        input[type="range"] {
            width: 100%;
            height: 6px;
            border-radius: 4px;
            background: transparent;
            outline: none;
            -webkit-appearance: none;
            position: relative;
            z-index: 10;
            cursor: pointer;
            margin: 0;
        }

        /* Фоновая дорожка с увеличенной областью клика */
        .slider-track {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 24px;
            transform: translateY(-50%);
            border-radius: 12px;
            background: transparent;
            cursor: pointer;
            z-index: 1;
        }

        .slider-track::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 6px;
            transform: translateY(-50%);
            border-radius: 4px;
            background: linear-gradient(90deg, var(--border) 0%, var(--primary) var(--progress, 50%), var(--border) var(--progress, 50%));
            transition: var(--transition);
        }

        .slider-container:hover .slider-track::before {
            height: 7px;
            background: linear-gradient(90deg, var(--border) 0%, var(--primary-dark) var(--progress, 50%), var(--border) var(--progress, 50%));
        }

        /* Улучшенный ползунок для Webkit */
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--primary);
            cursor: grab;
            border: 4px solid white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.2);
            transition: all 0.2s ease;
            position: relative;
            z-index: 20;
        }

        input[type="range"]::-webkit-slider-thumb:hover {
            background: var(--primary-dark);
            transform: scale(1.2);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.3);
        }

        input[type="range"]::-webkit-slider-thumb:active {
            cursor: grabbing;
            transform: scale(1.15);
            box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5), 0 0 0 2px rgba(99, 102, 241, 0.4);
        }

        input[type="range"]::-webkit-slider-runnable-track {
            height: 6px;
            border-radius: 4px;
            background: transparent;
            border: none;
        }

        /* Улучшенный ползунок для Firefox */
        input[type="range"]::-moz-range-thumb {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--primary);
            cursor: grab;
            border: 4px solid white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.2);
            transition: all 0.2s ease;
            position: relative;
            z-index: 20;
        }

        input[type="range"]::-moz-range-thumb:hover {
            background: var(--primary-dark);
            transform: scale(1.2);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.3);
        }

        input[type="range"]::-moz-range-thumb:active {
            cursor: grabbing;
            transform: scale(1.15);
            box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5), 0 0 0 2px rgba(99, 102, 241, 0.4);
        }

        input[type="range"]::-moz-range-track {
            height: 6px;
            border-radius: 4px;
            background: linear-gradient(90deg, var(--border) 0%, var(--primary) var(--progress, 50%), var(--border) var(--progress, 50%));
            border: none;
        }

        /* Улучшенный ползунок для заблокированного состояния */
        input[type="range"]:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        input[type="range"]:disabled::-webkit-slider-thumb {
            background: var(--text-light);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            border: 3px solid white;
        }

        input[type="range"]:disabled::-moz-range-thumb {
            background: var(--text-light);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            border: 3px solid white;
        }

        .slider-track:has(+ input[type="range"]:disabled) {
            cursor: not-allowed;
        }

        .slider-track:has(+ input[type="range"]:disabled)::before {
            background: linear-gradient(90deg, var(--border) 0%, var(--text-light) var(--progress, 50%), var(--border) var(--progress, 50%));
        }

        /* Анимация для плавного перемещения */
        .slider-container.sliding input[type="range"]::-webkit-slider-thumb {
            transition: none;
        }

        .slider-container.sliding input[type="range"]::-moz-range-thumb {
            transition: none;
        }

        /* Стили для заблокированных элементов */
        .settings-section.disabled {
            opacity: 0.6;
            position: relative;
        }

        .settings-section.disabled::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.5);
            cursor: not-allowed;
            border-radius: var(--radius);
            pointer-events: none;
        }

        /* Исключение для кнопок информации */
        .settings-section.disabled .info-btn {
            pointer-events: auto !important;
            z-index: 10;
            position: relative;
        }

        .settings-section.disabled .tooltip {
            pointer-events: auto !important;
            z-index: 20;
        }

        /* Стили для подсказок */
        .tooltip {
            position: absolute;
            top: -10px;
            left: 0;
            background: var(--text);
            color: white;
            padding: 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: var(--transition);
            box-shadow: var(--shadow-lg);
            width: 240px;
            line-height: 1.4;
            transform: translateY(-100%);
            pointer-events: auto !important;
        }

        .tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 20px;
            border: 6px solid transparent;
            border-top-color: var(--text);
        }

        .tooltip.active {
            opacity: 1;
            visibility: visible;
        }

        .failed {
            color: var(--error);
            margin-top: 15px;
            padding: 12px;
            background: rgba(239, 68, 68, 0.1);
            border-radius: 8px;
            max-height: 250px;
            overflow-y: auto;
            display: none;
            font-size: 0.85rem;
        }

        @media (max-width: 768px) {
            .settings-container {
                grid-template-columns: 1fr;
            }
            
            .header {
                padding: 16px 20px 12px;
            }
            
            .logo {
                font-size: 1.5rem;
            }
            
            h1 {
                font-size: 1.15rem;
            }
            
            .content {
                padding: 16px 20px 24px;
            }

            .slider-container {
                padding: 12px 0;
            }
            
            .settings-section {
                padding: 16px;
            }
            
            .tooltip {
                width: 200px;
                left: -80px;
            }
            
            .progress-container, .download-container {
                padding: 12px 20px;
            }
            
            .stats-grid {
                grid-template-columns: 1fr;
            }

            /* Уменьшаем ползунки для мобильных */
            input[type="range"]::-webkit-slider-thumb {
                width: 20px;
                height: 20px;
                border: 3px solid white;
            }

            input[type="range"]::-moz-range-thumb {
                width: 20px;
                height: 20px;
                border: 3px solid white;
            }
        }


                /* Стили для примера файла - ПЕРЕМЕЩЕН ВНИЗ */
        .file-example {
            margin-top: 20px;
            padding: 16px 20px;
            background: rgba(99, 102, 241, 0.05);
            border-radius: 12px;
            border: 1px solid rgba(99, 102, 241, 0.2);
            text-align: center;
            animation: fadeIn 0.5s ease;
        }

        .file-example-title {
            font-size: 0.9rem;
            color: var(--text);
            margin-bottom: 8px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .file-example-title i {
            color: var(--primary);
        }

        .file-example-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--primary);
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            padding: 8px 16px;
            background: white;
            border-radius: 8px;
            border: 1px solid var(--border);
            transition: var(--transition);
            margin: 6px 0;
        }

        .file-example-link:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-1px);
            box-shadow: var(--shadow);
        }

        .file-example-note {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: 6px;
            font-style: italic;
            line-height: 1.4;
        }

        .file-example-note strong {
            color: var(--primary);
            font-weight: 700;
        }
