/* === АНИМИРОВАННЫЙ ФОН === */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Canvas лежит под всем контентом через position:fixed + z-index:0.
   Дополнительные z-index на контент не нужны и ломают стекинг. */

/* === ГЛОБАЛЬНЫЕ НАСТРОЙКИ === */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #333;
    margin: 0;
    transition: background 0.4s ease, color 0.4s ease;
}

.main-container {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 40px;
}

.brand-logo-custom {
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.brand-logo-custom i { margin-right: 10px; }

.converter-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* === ВКЛАДКИ === */
.tabs { background-color: #f5f5f5 !important; height: 60px !important; transition: background 0.4s ease; }
.tabs .tab a {
    color: #764ba2 !important;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 56px;
    text-transform: none;
    padding: 0 6px !important;
    white-space: nowrap;
}
.tabs .tab a:focus, .tabs .tab a:hover { background-color: rgba(118, 75, 162, 0.1) !important; }
.tabs .tab a.active { color: #5b3c8a !important; background-color: #fff !important; }
.tabs .indicator { background-color: #764ba2 !important; height: 4px; }
.tab-content { padding: 40px; }

/* 5 вкладок — 20% каждая */
.tabs .tab.col.s-20p { width: 20%; }

@media (max-width: 600px) {
    .tabs .tab.col.s-20p { width: 20%; }
    .tabs .tab a { font-size: 0.7rem !important; padding: 0 4px !important; }
    .tabs .tab a i { display: none; }
}

/* === СТИЛИ ВИДЕО-ФОРМАТОВ === */
.video-fmt-btn {
    border: 2px solid rgba(109, 40, 217, 0.22) !important;
    background: rgba(109, 40, 217, 0.04) !important;
    color: #5b21b6 !important;
    transition: all 0.18s ease !important;
}
.video-fmt-btn:hover {
    border-color: rgba(109, 40, 217, 0.5) !important;
    background: rgba(109, 40, 217, 0.10) !important;
    color: #6d28d9 !important;
    transform: translateY(-1px);
}
.video-fmt-btn.active {
    background: linear-gradient(45deg, #6d28d9, #7c3aed) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(109, 40, 217, 0.38) !important;
}
.video-fmt-btn.active .fmt-badge {
    background: rgba(255,255,255,0.22) !important;
    color: #fff !important;
}
.video-fmt-btn .fmt-badge {
    background: rgba(109, 40, 217, 0.10) !important;
    color: #6d28d9 !important;
}

.video-param-btn {
    border: 1.5px solid rgba(109, 40, 217, 0.22) !important;
    background: rgba(109, 40, 217, 0.04) !important;
    color: #5b21b6 !important;
    transition: all 0.15s !important;
}
.video-param-btn:hover {
    border-color: rgba(109, 40, 217, 0.48) !important;
    background: rgba(109, 40, 217, 0.10) !important;
    color: #6d28d9 !important;
}
.video-param-btn.active {
    background: rgba(109, 40, 217, 0.14) !important;
    border-color: #6d28d9 !important;
    color: #6d28d9 !important;
    font-weight: 700 !important;
}

/* Тёмная тема — видео */
[data-theme="dark"] .video-fmt-btn {
    border-color: rgba(167, 139, 250, 0.22) !important;
    background: rgba(109, 40, 217, 0.08) !important;
    color: #c4b5fd !important;
}
[data-theme="dark"] .video-fmt-btn:hover {
    border-color: rgba(167, 139, 250, 0.5) !important;
    background: rgba(109, 40, 217, 0.18) !important;
    color: #ddd6fe !important;
}
[data-theme="dark"] .video-fmt-btn.active {
    background: linear-gradient(45deg, #6d28d9, #7c3aed) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 3px 14px rgba(109, 40, 217, 0.5) !important;
}
[data-theme="dark"] .video-fmt-btn .fmt-badge {
    background: rgba(167, 139, 250, 0.15) !important;
    color: #c4b5fd !important;
}
[data-theme="dark"] .video-fmt-btn.active .fmt-badge {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
}
[data-theme="dark"] .video-param-btn {
    border-color: rgba(167, 139, 250, 0.2) !important;
    background: rgba(109, 40, 217, 0.07) !important;
    color: #a78bfa !important;
}
[data-theme="dark"] .video-param-btn:hover {
    border-color: rgba(167, 139, 250, 0.48) !important;
    background: rgba(109, 40, 217, 0.16) !important;
    color: #c4b5fd !important;
}
[data-theme="dark"] .video-param-btn.active {
    background: rgba(109, 40, 217, 0.22) !important;
    border-color: #a78bfa !important;
    color: #ddd6fe !important;
}

/* === DRAG AND DROP === */
.drop-zone {
    border: 2px dashed #764ba2;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(118, 75, 162, 0.05);
    margin-bottom: 25px;
    position: relative;
}
.drop-zone:hover { background: rgba(118, 75, 162, 0.1); transform: translateY(-2px); }
.drop-zone.dragover { background: rgba(118, 75, 162, 0.2) !important; border-color: #5b3c8a; transform: scale(1.02); }
.drop-zone i { font-size: 3rem; color: #764ba2; margin-bottom: 10px; display: block; }
.drop-zone p { margin: 0; color: #555; font-weight: 500; }
.drop-zone .file-info { margin-top: 10px; font-weight: bold; color: #2e7d32; display: none; }
.hidden-input { display: none; }

/* === КНОПКИ === */
.btn-convert {
    background: linear-gradient(45deg, #667eea, #764ba2);
    width: 100%;
    height: 54px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: none;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    margin-top: 20px;
    border: none;
    color: white;
    cursor: pointer;
}
.btn-convert:hover {
    background: linear-gradient(45deg, #764ba2, #667eea);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6);
}

/* === LOADER & PROGRESS BAR === */
.loader-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.progress-card {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease-out;
}

.progress-icon-wrap {
    margin-bottom: 16px;
}

.progress-icon-wrap i {
    font-size: 2.2rem;
    color: #764ba2;
}

.progress-icon-wrap i.fa-check-circle {
    color: #2e7d32;
    animation: none;
}

/* Шаги прогресса */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 6px;
}

.progress-step {
    flex: 1;
    font-size: 0.72rem;
    color: #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.progress-step i {
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease;
    color: #ccc;
}

.progress-step.active {
    color: #764ba2;
}

.progress-step.active i {
    background: rgba(118, 75, 162, 0.12);
    color: #764ba2;
}

.progress-step.done {
    color: #2e7d32;
}

.progress-step.done i {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#progress-title { margin: 0 0 20px 0; font-weight: 700; color: #333; }

.progress-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #FF6B6B, #556270);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-bar.animated {
    width: 100% !important;
    background: linear-gradient(45deg, 
        #667eea 25%, 
        #764ba2 25%, 
        #764ba2 50%, 
        #667eea 50%, 
        #667eea 75%, 
        #764ba2 75%, 
        #764ba2);
    background-size: 40px 40px;
    animation: stripes 1s linear infinite;
}

@keyframes stripes {
    from { background-position: 40px 0; }
    to { background-position: 0 0; }
}

#progress-text { color: #555; font-size: 0.9rem; font-weight: 600; }

/* === ШАПКА САЙТА === */
.custom-navbar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.custom-navbar .custom-logo {
    font-weight: 700;
    font-size: 1.5rem;
}
.custom-navbar .custom-logo i { margin-right: 8px; }
.custom-nav-links a {
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s;
}
.custom-nav-links a:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 5px;
}
.sidenav { width: 250px; }
.sidenav li>a { font-weight: 500; color: #764ba2; }

/* === КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ === */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50px;
    color: white;
    cursor: pointer;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 13px 0 13px 10px;
    transition: all 0.3s ease;
    font-size: 1rem;
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(20deg) scale(1.1);
}

/* === SEO-КНОПКИ === */
.seo-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.seo-btn {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 8px 22px;
    border-radius: 50px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.seo-btn i {
    margin-right: 8px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

.seo-btn:hover {
    background: white;
    color: #764ba2;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.seo-btn:hover i {
    transform: scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* === ПОДВАЛ === */
.custom-footer {
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 40px;
    color: white;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.custom-footer ul li {
    margin-bottom: 12px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-link:hover {
    color: white;
    transform: translateX(5px);
    text-decoration: none;
}

.footer-copyright {
    margin-top: 30px;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   Все переменные меняются через атрибут data-theme="dark"
   на теге <html>
   ============================================================ */

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e0e0e0;
}

/* Карточка конвертера */
[data-theme="dark"] .converter-card {
    background: rgba(30, 30, 50, 0.97) !important;
    border: 1px solid rgba(118, 75, 162, 0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

/* Вкладки */
[data-theme="dark"] .tabs {
    background-color: #1e1e32 !important;
}
[data-theme="dark"] .tabs .tab a {
    color: #a78bfa !important;
}
[data-theme="dark"] .tabs .tab a.active {
    color: #c4b5fd !important;
    background-color: #16162a !important;
}
[data-theme="dark"] .tabs .tab a:hover {
    background-color: rgba(167, 139, 250, 0.1) !important;
}

/* Зона загрузки файла */
[data-theme="dark"] .drop-zone {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
}
[data-theme="dark"] .drop-zone p {
    color: #a0a0b8;
}
[data-theme="dark"] .drop-zone i {
    color: #a78bfa;
}
[data-theme="dark"] .drop-zone:hover {
    background: rgba(124, 58, 237, 0.15);
}

/* Контент вкладок */
[data-theme="dark"] .tab-content {
    background: #16162a;
}

/* Select и labels Materialize */
[data-theme="dark"] .input-field label {
    color: #a0a0b8 !important;
}
[data-theme="dark"] .select-wrapper input.select-dropdown {
    color: #e0e0e0 !important;
    border-bottom-color: #7c3aed !important;
}
[data-theme="dark"] .select-wrapper .caret {
    fill: #a78bfa !important;
}
[data-theme="dark"] ul.dropdown-content {
    background: #1e1e32 !important;
}
[data-theme="dark"] ul.dropdown-content li > span {
    color: #e0e0e0 !important;
}
[data-theme="dark"] ul.dropdown-content li:hover,
[data-theme="dark"] ul.dropdown-content li.selected {
    background: rgba(124, 58, 237, 0.2) !important;
}

/* Range input */
[data-theme="dark"] .range-field input[type=range] + .thumb {
    background-color: #7c3aed;
}

/* Карточки на других страницах */
[data-theme="dark"] .card {
    background: #1e1e32 !important;
    color: #e0e0e0;
}
[data-theme="dark"] .card p,
[data-theme="dark"] .card li,
[data-theme="dark"] .card h1,
[data-theme="dark"] .card h2,
[data-theme="dark"] .card h3,
[data-theme="dark"] .card h4,
[data-theme="dark"] .card h5 {
    color: #e0e0e0 !important;
}

/* Collapsible (настройки размера) */
[data-theme="dark"] .collapsible-body {
    background: #16162a;
    border-color: #2d2d4e;
}
[data-theme="dark"] .input-field input {
    color: #e0e0e0 !important;
    border-bottom-color: #7c3aed !important;
}

/* Info panel (LibreOffice Engine) */
[data-theme="dark"] .card-panel.teal.lighten-5 {
    background: rgba(0, 128, 128, 0.15) !important;
}
[data-theme="dark"] .card-panel.teal.lighten-5 span {
    color: #4dd0e1 !important;
}

/* Progress card (loader) */
[data-theme="dark"] .progress-card {
    background: #1e1e32;
}
[data-theme="dark"] #progress-title {
    color: #e0e0e0;
}
[data-theme="dark"] .progress-container {
    background-color: #2d2d4e;
}
[data-theme="dark"] #progress-text {
    color: #a0a0b8;
}

/* Sidenav мобильное меню */
[data-theme="dark"] .sidenav {
    background: #1e1e32 !important;
}
[data-theme="dark"] .sidenav li > a {
    color: #a78bfa !important;
}

/* Полоса с SEO кнопками */
[data-theme="dark"] .seo-btn:hover {
    background: rgba(30, 30, 50, 0.95);
    color: #a78bfa;
}

/* ============================================================
   КАСТОМНЫЙ СЕЛЕКТ С ИКОНКАМИ (index.html)
   ============================================================ */
.custom-select-wrap {
    position: relative;
    margin-bottom: 20px;
}
.custom-select-label {
    font-size: 0.85rem;
    color: #764ba2;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    background: white;
    transition: all 0.25s ease;
    user-select: none;
}
.custom-select-trigger:hover {
    border-color: #764ba2;
    box-shadow: 0 2px 8px rgba(118,75,162,0.15);
}
.custom-select-trigger.open {
    border-color: #764ba2;
    box-shadow: 0 2px 12px rgba(118,75,162,0.2);
    border-radius: 12px 12px 0 0;
}
.custom-select-trigger .sel-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.custom-select-trigger .sel-text { flex: 1; }
.custom-select-trigger .sel-name {
    font-weight: 700;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.2;
}
.custom-select-trigger .sel-desc {
    font-size: 0.75rem;
    color: #999;
}
.custom-select-trigger .sel-arrow {
    color: #aaa;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}
.custom-select-trigger.open .sel-arrow { transform: rotate(180deg); }

.custom-select-native { display: none; }

.custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: white;
    border: 2px solid #764ba2;
    border-top: none;
    border-radius: 0 0 12px 12px;
    z-index: 100;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.custom-select-dropdown.open { display: block; }

.sel-group-title {
    padding: 8px 16px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #bbb;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.sel-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f5f5f5;
}
.sel-option:last-child { border-bottom: none; }
.sel-option:hover { background: rgba(118,75,162,0.06); }
.sel-option.selected { background: rgba(118,75,162,0.1); }
.sel-option .opt-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.sel-option .opt-name {
    font-weight: 700;
    color: #333;
    font-size: 0.88rem;
}
.sel-option .opt-desc {
    font-size: 0.75rem;
    color: #999;
    margin-top: 1px;
}
.sel-option .opt-badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Тёмная тема */
[data-theme="dark"] .custom-select-trigger {
    background: #1e1e32;
    border-color: #2d2d4e;
}
[data-theme="dark"] .custom-select-trigger:hover,
[data-theme="dark"] .custom-select-trigger.open { border-color: #7c3aed; }
[data-theme="dark"] .custom-select-trigger .sel-name { color: #e0e0e0; }
[data-theme="dark"] .custom-select-dropdown {
    background: #1e1e32;
    border-color: #7c3aed;
}
[data-theme="dark"] .sel-group-title {
    background: #16162a;
    color: #6060a0;
    border-color: #2d2d4e;
}
[data-theme="dark"] .sel-option { border-color: #2d2d4e; }
[data-theme="dark"] .sel-option:hover { background: rgba(124,58,237,0.12); }
[data-theme="dark"] .sel-option.selected { background: rgba(124,58,237,0.2); }
[data-theme="dark"] .sel-option .opt-name { color: #e0e0e0; }
[data-theme="dark"] .custom-select-label { color: #a78bfa; }

/* ============================================================
   РАСШИРЕННЫЕ НАСТРОЙКИ КОНВЕРТАЦИИ
   ============================================================ */

.settings-section {
    margin-top: 10px;
    margin-bottom: 20px;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(118,75,162,0.06);
    border: 1px dashed rgba(118,75,162,0.3);
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}
.settings-toggle:hover {
    background: rgba(118,75,162,0.1);
    border-color: rgba(118,75,162,0.5);
}
.settings-toggle .toggle-label {
    flex: 1;
    font-weight: 600;
    color: #764ba2;
    font-size: 0.9rem;
}
.settings-toggle .toggle-arrow {
    color: #764ba2;
    font-size: 0.8rem;
    transition: transform 0.25s ease;
}
.settings-toggle.open .toggle-arrow { transform: rotate(180deg); }

.settings-body {
    display: none;
    padding: 20px 4px 4px;
}
.settings-body.open { display: block; }

/* Группы настроек */
.settings-group {
    background: rgba(118,75,162,0.04);
    border: 1px solid rgba(118,75,162,0.12);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.settings-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.settings-group-title i { color: #764ba2; }

/* Слайдер качества */
.quality-wrap { margin-bottom: 4px; }
.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.quality-label { font-size: 0.85rem; color: #555; font-weight: 500; }
.quality-badge {
    font-size: 0.85rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(45deg, #667eea, #764ba2);
    padding: 2px 10px;
    border-radius: 20px;
    min-width: 48px;
    text-align: center;
}
input[type=range].quality-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #667eea var(--val, 75%), #e0e0e0 var(--val, 75%));
    outline: none;
    cursor: pointer;
}
input[type=range].quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(118,75,162,0.4);
    transition: transform 0.15s ease;
}
input[type=range].quality-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Размеры */
.size-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}
.size-link-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(118,75,162,0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #764ba2;
    font-size: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.size-link-btn:hover { background: rgba(118,75,162,0.2); }
.size-link-btn.linked { background: #764ba2; color: white; }
.size-input-wrap { position: relative; }
.size-input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 32px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: white;
}
.size-input-wrap input:focus { border-color: #764ba2; }
.size-input-wrap .size-unit {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
}

/* Кнопки поворота */
.rotate-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.rotate-btn {
    flex: 1;
    min-width: 60px;
    padding: 9px 6px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.rotate-btn i { font-size: 1rem; color: #764ba2; }
.rotate-btn:hover { border-color: #764ba2; background: rgba(118,75,162,0.06); color: #764ba2; }
.rotate-btn.active { border-color: #764ba2; background: rgba(118,75,162,0.12); color: #764ba2; }

/* Кнопки соотношения сторон */
.ratio-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ratio-btn {
    padding: 8px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #666;
    transition: all 0.2s ease;
}
.ratio-btn:hover { border-color: #764ba2; color: #764ba2; }
.ratio-btn.active { border-color: #764ba2; background: rgba(118,75,162,0.1); color: #764ba2; }

/* Кнопки эффектов */
.effect-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.effect-btn {
    flex: 1;
    min-width: 80px;
    padding: 9px 8px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: #666;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.effect-btn i { font-size: 1rem; }
.effect-btn:hover { border-color: #764ba2; background: rgba(118,75,162,0.06); }
.effect-btn.active { border-color: #764ba2; background: rgba(118,75,162,0.12); color: #764ba2; }

/* Выбор цвета фона */
.bg-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bg-presets {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.bg-preset {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.bg-preset:hover { transform: scale(1.15); }
.bg-preset.active { border-color: #764ba2; box-shadow: 0 0 0 2px rgba(118,75,162,0.3); }
.bg-color-input {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    padding: 2px;
    background: white;
}

/* Тёмная тема */
[data-theme="dark"] .settings-toggle {
    background: rgba(124,58,237,0.1);
    border-color: rgba(124,58,237,0.3);
}
[data-theme="dark"] .settings-toggle .toggle-label { color: #a78bfa; }
[data-theme="dark"] .settings-toggle .toggle-arrow { color: #a78bfa; }
[data-theme="dark"] .settings-group {
    background: rgba(124,58,237,0.06);
    border-color: rgba(124,58,237,0.15);
}
[data-theme="dark"] .settings-group-title { color: #6060a0; }
[data-theme="dark"] .quality-label { color: #a0a0b8; }
[data-theme="dark"] .size-input-wrap input {
    background: #16162a;
    border-color: #2d2d4e;
    color: #e0e0e0;
}
[data-theme="dark"] .size-input-wrap input:focus { border-color: #7c3aed; }
[data-theme="dark"] .rotate-btn,
[data-theme="dark"] .ratio-btn,
[data-theme="dark"] .effect-btn {
    background: #16162a;
    border-color: #2d2d4e;
    color: #a0a0b8;
}
[data-theme="dark"] .rotate-btn:hover,
[data-theme="dark"] .ratio-btn:hover,
[data-theme="dark"] .effect-btn:hover {
    border-color: #7c3aed;
    background: rgba(124,58,237,0.12);
}
[data-theme="dark"] .rotate-btn.active,
[data-theme="dark"] .ratio-btn.active,
[data-theme="dark"] .effect-btn.active {
    border-color: #7c3aed;
    background: rgba(124,58,237,0.2);
    color: #a78bfa;
}

/* === КНОПКА НАВЕРХ === */
#scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(118,75,162,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 999;
}
#scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(118,75,162,0.7);
}

[data-theme="dark"] .convert-result {
    background: rgba(46,125,50,0.1) !important;
    border-color: rgba(46,125,50,0.3) !important;
}
[data-theme="dark"] .convert-result div[style*="color:#333"] {
    color: #e0e0e0 !important;
}
[data-theme="dark"] .convert-result div[style*="color:#666"] {
    color: #8080a0 !important;
}

/* ===== ПАНЕЛЬ ИСТОРИИ КОНВЕРТАЦИЙ ===== */

.history-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.history-overlay.active {
    display: block;
    opacity: 1;
}

.history-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 30px rgba(0,0,0,0.15);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(.4,0,.2,1);
    border-radius: 16px 0 0 16px;
}
.history-panel.open { right: 0; }

[data-theme="dark"] .history-panel {
    background: #1a1a2e;
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
[data-theme="dark"] .history-panel-header {
    border-bottom-color: rgba(255,255,255,0.08);
}

.history-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}
[data-theme="dark"] .history-panel-title { color: #e0e0e0; }
.history-panel-title i { color: #7c4dff; }

.history-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-clear-btn {
    background: none;
    border: 1px solid rgba(255,71,87,0.35);
    color: #ff4757;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.history-clear-btn:hover { background: rgba(255,71,87,0.08); }

.history-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
.history-close-btn:hover { background: rgba(0,0,0,0.06); }
[data-theme="dark"] .history-close-btn { color: #a0a0b8; }
[data-theme="dark"] .history-close-btn:hover { background: rgba(255,255,255,0.08); }

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}
.history-list::-webkit-scrollbar { width: 5px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: rgba(124,77,255,0.25); border-radius: 10px; }

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: #aaa;
    text-align: center;
    padding: 40px 20px;
}
.history-empty i { font-size: 3rem; opacity: 0.3; }
.history-empty p { font-size: 0.9rem; line-height: 1.5; }

.history-item {
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    animation: historySlideIn 0.3s ease;
}
[data-theme="dark"] .history-item {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08);
}

@keyframes historySlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.history-item-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #333;
    word-break: break-all;
    line-height: 1.4;
}
[data-theme="dark"] .history-item-name { color: #e0e0e0; }

.history-item-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 6px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.history-item-delete:hover { color: #ff4757; }

.history-item-format {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(124,77,255,0.1);
    color: #7c4dff;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}
[data-theme="dark"] .history-item-format { background: rgba(124,77,255,0.2); }

.history-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.history-item-sizes {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
}
.history-item-sizes .arrow { color: #ccc; }
.history-item-sizes .size-after { color: #555; font-weight: 600; }
[data-theme="dark"] .history-item-sizes .size-after { color: #c0c0d8; }

.history-size-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.history-size-badge.down { background: rgba(46,125,50,0.1);  color: #2e7d32; }
.history-size-badge.up   { background: rgba(198,40,40,0.1);  color: #c62828; }
.history-size-badge.same { background: rgba(0,0,0,0.06);     color: #888; }

.history-item-time {
    font-size: 0.75rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-footer {
    padding: 12px 24px;
    border-top: 1px solid rgba(0,0,0,0.06);
    font-size: 0.78rem;
    color: #aaa;
    text-align: center;
    flex-shrink: 0;
}
[data-theme="dark"] .history-footer { border-top-color: rgba(255,255,255,0.06); }

/* Кнопка истории в навбаре */
.history-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 0.95rem;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    transition: opacity 0.2s;
    position: relative;
}
.history-nav-btn:hover { opacity: 0.75; }

.history-badge {
    position: absolute;
    top: 10px;
    right: 4px;
    background: #7c4dff;
    color: #fff;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    display: none;
}
.history-badge.visible { display: block; }


/* ===== АДАПТИВ ПАНЕЛИ ИСТОРИИ ===== */
@media only screen and (max-width: 600px) {

    /* Панель на всю ширину экрана */
    .history-panel {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    /* Хедер панели — переносим на две строки если не влезает */
    .history-panel-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 16px;
    }

    .history-panel-title {
        font-size: 1rem;
    }

    /* Кнопка «Очистить» — делаем компактнее */
    .history-clear-btn {
        padding: 4px 9px;
        font-size: 0.73rem;
    }

    /* Список с меньшими отступами */
    .history-list {
        padding: 8px 10px;
    }

    /* Карточка записи */
    .history-item {
        padding: 11px 12px;
    }

    /* Мета-строка (размеры + время) — переносим время под размеры */
    .history-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ИСТОЧНИКА (ФАЙЛ / ПО ССЫЛКЕ)
   ============================================================ */
.source-switcher {
    display: inline-flex;
    background: rgba(118, 75, 162, 0.07);
    border: 1.5px solid rgba(118, 75, 162, 0.15);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 2px;
}
.source-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    color: #888;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.source-btn.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 3px 10px rgba(118, 75, 162, 0.35);
}
.source-btn:not(.active):hover {
    background: rgba(118, 75, 162, 0.1);
    color: #764ba2;
}

/* URL input */
.url-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid rgba(118, 75, 162, 0.35);
    border-radius: 14px;
    background: rgba(118, 75, 162, 0.04);
    padding: 0 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.url-input-wrap:focus-within {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.12);
}
.url-input-icon {
    color: #764ba2;
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: 10px;
    opacity: 0.7;
}
.url-input-field {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 0.95rem;
    color: #333;
    padding: 14px 0 !important;
    height: auto !important;
    margin: 0 !important;
    font-family: 'Roboto', monospace;
}
.url-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 0.9rem;
    padding: 4px 0 4px 8px;
    transition: color 0.2s;
}
.url-clear-btn:hover { color: #764ba2; }
.url-hint {
    font-size: 0.8rem;
    color: #888;
    background: rgba(118, 75, 162, 0.05);
    border: 1px solid rgba(118, 75, 162, 0.12);
    border-radius: 10px;
    padding: 9px 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    line-height: 1.4;
}
.url-hint i { flex-shrink: 0; margin-top: 1px; }

/* Тёмная тема — переключатель */
[data-theme="dark"] .source-switcher {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.18);
}
[data-theme="dark"] .source-btn:not(.active) { color: #999; }
[data-theme="dark"] .source-btn:not(.active):hover { background: rgba(167,139,250,0.12); color: #a78bfa; }
[data-theme="dark"] .url-input-wrap { background: rgba(167,139,250,0.06); border-color: rgba(167,139,250,0.25); }
[data-theme="dark"] .url-input-wrap:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.15); }
[data-theme="dark"] .url-input-field { color: #e0e0f0; }
[data-theme="dark"] .url-hint { color: #999; background: rgba(167,139,250,0.06); border-color: rgba(167,139,250,0.15); }

/* ============================================================
   АУДИО-ТАБ
   ============================================================ */
.audio-format-wrap { margin-bottom: 20px; }
.audio-format-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.audio-fmt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 25px;
    border: 1.5px solid rgba(255, 107, 107, 0.25);
    background: rgba(255, 107, 107, 0.06);
    color: #555;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: 'Roboto', sans-serif;
    user-select: none;
}
.audio-fmt-btn:hover {
    background: rgba(255, 107, 107, 0.14);
    border-color: rgba(255, 107, 107, 0.45);
    color: #e74c3c;
    transform: translateY(-1px);
}
.audio-fmt-btn.active {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px rgba(255, 107, 107, 0.4);
}
.fmt-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    padding: 1px 6px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.audio-settings-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.audio-param-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 107, 107, 0.2);
    background: rgba(255, 107, 107, 0.05);
    color: #666;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Roboto', sans-serif;
    user-select: none;
}
.audio-param-btn:hover { background: rgba(255,107,107,0.12); border-color: rgba(255,107,107,0.4); color: #e74c3c; }
.audio-param-btn.active { background: rgba(255,107,107,0.15); border-color: #ff6b6b; color: #e74c3c; }

/* Тёмная тема — аудио */
[data-theme="dark"] .audio-fmt-btn { border-color: rgba(255,107,107,0.2); background: rgba(255,107,107,0.07); color: #bbb; }
[data-theme="dark"] .audio-fmt-btn:hover { background: rgba(255,107,107,0.18); color: #ff8a8a; }
[data-theme="dark"] .audio-fmt-btn.active { color: #fff; }
[data-theme="dark"] .audio-param-btn { border-color: rgba(255,107,107,0.18); background: rgba(255,107,107,0.06); color: #aaa; }
[data-theme="dark"] .audio-param-btn:hover,
[data-theme="dark"] .audio-param-btn.active { color: #ff8a8a; border-color: rgba(255,107,107,0.45); background: rgba(255,107,107,0.14); }
/* ================================================================
   ВКЛАДКА СЖАТИЕ
   ================================================================ */

/* 6 вкладок — 16.66% */
.tabs .tab.col.s-16p { width: 16.6667%; }
@media (max-width: 600px) {
    .tabs .tab.col.s-16p { width: 16.6667%; }
}

/* --- Зона дропа --- */
.compress-dropzone {
    border: 2.5px dashed #a78bfa;
    border-radius: 16px;
    background: rgba(109,40,217,0.04);
    text-align: center;
    transition: all 0.25s ease;
    margin-bottom: 16px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}
.compress-dropzone.compress-has-files {
    min-height: 80px;
    padding: 12px 20px;
    border-style: solid;
    border-color: rgba(109,40,217,0.25);
    background: rgba(109,40,217,0.02);
    cursor: default;
    pointer-events: none;
}
.compress-dropzone.compress-drag-over {
    border-color: #6d28d9;
    background: rgba(109,40,217,0.10);
    transform: scale(1.01);
}
.compress-dropzone-inner { padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.compress-has-files .compress-dropzone-inner { display: none; }

.compress-panda {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, #6d28d9, #7c3aed);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff;
    box-shadow: 0 8px 24px rgba(109,40,217,0.35);
    animation: compress-pulse 2.5s ease-in-out infinite;
    margin-bottom: 4px;
}
@keyframes compress-pulse {
    0%,100% { box-shadow: 0 8px 24px rgba(109,40,217,0.35); transform: scale(1); }
    50%      { box-shadow: 0 12px 32px rgba(109,40,217,0.5); transform: scale(1.05); }
}
.compress-drop-title { font-size: 1.15rem; font-weight: 700; color: #4c1d95; }
.compress-drop-sub   { font-size: 0.85rem; color: #9ca3af; }

.compress-upload-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(45deg, #6d28d9, #7c3aed);
    color: #fff; border: none; border-radius: 24px;
    padding: 10px 24px; font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(109,40,217,0.3);
    pointer-events: all;
}
.compress-upload-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(109,40,217,0.4); }

/* --- Настройки --- */
.compress-settings-bar {
    display: flex; flex-wrap: wrap; gap: 16px;
    background: rgba(109,40,217,0.04);
    border: 1.5px solid rgba(109,40,217,0.12);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.compress-setting-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; }
.compress-setting-label { font-size: 0.78rem; font-weight: 700; color: #6d28d9; text-transform: uppercase; letter-spacing: 0.5px; }
.compress-level-btns    { display: flex; flex-wrap: wrap; gap: 6px; }

.compress-level-btn {
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 8px 14px; border-radius: 10px;
    border: 1.5px solid rgba(109,40,217,0.2);
    background: rgba(109,40,217,0.04);
    cursor: pointer; transition: all 0.18s;
    min-width: 100px;
}
.compress-level-btn:hover { border-color: #6d28d9; background: rgba(109,40,217,0.10); }
.compress-level-btn.active {
    border-color: #6d28d9; background: rgba(109,40,217,0.12);
    box-shadow: inset 0 0 0 1.5px rgba(109,40,217,0.3);
}
.compress-level-name { font-size: 0.88rem; font-weight: 700; color: #4c1d95; }
.compress-level-desc { font-size: 0.72rem; color: #9ca3af; margin-top: 2px; }
.compress-level-btn.active .compress-level-name { color: #4c1d95; }

.compress-out-btn {
    padding: 7px 14px; border-radius: 20px;
    border: 1.5px solid rgba(109,40,217,0.2);
    background: rgba(109,40,217,0.04);
    color: #5b21b6; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 5px;
}
.compress-out-btn:hover  { border-color: #6d28d9; background: rgba(109,40,217,0.10); }
.compress-out-btn.active { background: rgba(109,40,217,0.14); border-color: #6d28d9; font-weight: 700; }
.compress-badge-new {
    font-size: 0.62rem; font-weight: 700; background: #22c55e;
    color: #fff; padding: 1px 5px; border-radius: 8px; text-transform: uppercase;
}

/* --- Список файлов --- */
.compress-file-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.cjob-card {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1.5px solid rgba(109,40,217,0.12);
    border-radius: 12px; padding: 10px 14px;
    transition: all 0.25s ease;
    animation: cjob-in 0.3s ease;
    overflow: hidden;
}
@keyframes cjob-in {
    from { opacity:0; transform: translateY(-8px); }
    to   { opacity:1; transform: translateY(0); }
}
.cjob-card.cjob-removing { opacity:0; transform: translateX(20px); transition: all 0.28s ease; }
.cjob-card.cjob-done     { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.03); }
.cjob-card.cjob-error    { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.03); }

.cjob-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #f3f4f6; }
.cjob-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cjob-info  { flex: 1; min-width: 0; }
.cjob-name  { font-size: 0.88rem; font-weight: 600; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cjob-sizes { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 0.82rem; }
.cjob-before { color: #9ca3af; }
.cjob-arrow  { color: #d1d5db; font-size: 0.72rem; }
.cjob-after  { display: flex; align-items: center; gap: 4px; }
.cjob-after-size { color: #374151; font-weight: 600; }
.cjob-saved-badge {
    background: linear-gradient(45deg, #16a34a, #22c55e);
    color: #fff; font-size: 0.68rem; font-weight: 800;
    padding: 2px 6px; border-radius: 8px;
}

.cjob-bar-wrap {
    height: 3px; background: rgba(109,40,217,0.1);
    border-radius: 4px; overflow: hidden; margin: 4px 0;
}
.cjob-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #6d28d9, #a78bfa);
    border-radius: 4px;
    transition: width 0.4s ease;
}
.cjob-done .cjob-bar { background: linear-gradient(90deg, #16a34a, #22c55e); width: 100% !important; }
.cjob-error .cjob-bar { background: #ef4444; width: 100% !important; }

.cjob-status { font-size: 0.75rem; color: #9ca3af; }
.cjob-status-compressing { color: #6d28d9; }
.cjob-status-done  { color: #16a34a; }
.cjob-status-error { color: #ef4444; }

.cjob-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cjob-dl-btn, .cjob-rm-btn {
    width: 34px; height: 34px; border-radius: 8px; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.15s; font-size: 0.85rem;
}
.cjob-dl-btn { background: rgba(109,40,217,0.1); color: #6d28d9; }
.cjob-dl-btn:hover { background: #6d28d9; color: #fff; }
.cjob-rm-btn { background: rgba(239,68,68,0.08); color: #ef4444; }
.cjob-rm-btn:hover { background: #ef4444; color: #fff; }

/* --- Footer --- */
.compress-footer {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 12px; justify-content: space-between;
    background: rgba(109,40,217,0.05);
    border: 1.5px solid rgba(109,40,217,0.12);
    border-radius: 12px; padding: 12px 16px; margin-top: 4px;
}
.compress-total-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compress-stat        { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.compress-stat-label  { font-size: 0.7rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; }
.compress-stat-val    { font-size: 1.05rem; font-weight: 800; color: #1f2937; }
.compress-saved-pct   { font-size: 1.2rem; color: #16a34a; }
.compress-stat-arrow  { color: #d1d5db; font-size: 0.8rem; }

.compress-footer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.compress-add-more-btn {
    padding: 8px 16px; border-radius: 20px; border: 1.5px solid rgba(109,40,217,0.3);
    background: rgba(109,40,217,0.07); color: #6d28d9;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
}
.compress-add-more-btn:hover { background: rgba(109,40,217,0.15); border-color: #6d28d9; }

.compress-clear-btn {
    padding: 8px 16px; border-radius: 20px; border: 1.5px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.06); color: #ef4444;
    font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
}
.compress-clear-btn:hover { background: rgba(239,68,68,0.14); border-color: #ef4444; }

.compress-start-btn {
    padding: 8px 20px; border-radius: 20px; border: none;
    background: linear-gradient(45deg, #059669, #10b981);
    color: #fff; font-size: 0.88rem; font-weight: 700;
    cursor: pointer; transition: all 0.18s;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 3px 12px rgba(16,185,129,0.3);
}
.compress-start-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(16,185,129,0.45); }
.compress-start-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.compress-download-all-btn {
    padding: 8px 18px; border-radius: 20px; border: none;
    background: linear-gradient(45deg, #6d28d9, #7c3aed);
    color: #fff; font-size: 0.88rem; font-weight: 700;
    cursor: pointer; transition: all 0.18s;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 3px 12px rgba(109,40,217,0.3);
}
.compress-download-all-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(109,40,217,0.4); }
.compress-download-all-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* --- Тёмная тема --- */
[data-theme="dark"] .compress-dropzone {
    border-color: rgba(167,139,250,0.3);
    background: rgba(109,40,217,0.07);
}
[data-theme="dark"] .compress-dropzone.compress-drag-over { background: rgba(109,40,217,0.18); }
[data-theme="dark"] .compress-drop-title  { color: #c4b5fd; }
[data-theme="dark"] .compress-settings-bar { background: rgba(109,40,217,0.08); border-color: rgba(167,139,250,0.15); }
[data-theme="dark"] .compress-level-btn   { border-color: rgba(167,139,250,0.2); background: rgba(109,40,217,0.08); }
[data-theme="dark"] .compress-level-btn:hover { background: rgba(109,40,217,0.18); border-color: #a78bfa; }
[data-theme="dark"] .compress-level-btn.active { background: rgba(109,40,217,0.22); border-color: #a78bfa; }
[data-theme="dark"] .compress-level-name  { color: #c4b5fd; }
[data-theme="dark"] .compress-out-btn     { border-color: rgba(167,139,250,0.2); background: rgba(109,40,217,0.07); color: #a78bfa; }
[data-theme="dark"] .compress-out-btn:hover { border-color: #a78bfa; background: rgba(109,40,217,0.16); }
[data-theme="dark"] .compress-out-btn.active { background: rgba(109,40,217,0.22); border-color: #a78bfa; color: #ddd6fe; }
[data-theme="dark"] .cjob-card            { background: #1e1e3a; border-color: rgba(167,139,250,0.15); }
[data-theme="dark"] .cjob-card.cjob-done  { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.25); }
[data-theme="dark"] .cjob-card.cjob-error { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.25); }
[data-theme="dark"] .cjob-name            { color: #e0e0f0; }
[data-theme="dark"] .cjob-after-size      { color: #c4b5fd; }
[data-theme="dark"] .compress-stat-val    { color: #e0e0f0; }
[data-theme="dark"] .compress-footer      { background: rgba(109,40,217,0.09); border-color: rgba(167,139,250,0.15); }
[data-theme="dark"] .compress-setting-label { color: #a78bfa; }

/* === ИКОНКА СЖАТИЕ — анимированный SVG-ромб === */
.compress-hero-svg { display: block; }

.svg-diamond-outer {
    animation: diamond-rotate 6s linear infinite;
    transform-origin: 20px 20px;
}
.svg-diamond-mid {
    animation: diamond-rotate 6s linear infinite reverse;
    transform-origin: 20px 20px;
    animation-delay: -1s;
}
.svg-diamond-inner {
    animation: diamond-pulse 2s ease-in-out infinite;
    transform-origin: 20px 20px;
}

@keyframes diamond-rotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes diamond-pulse {
    0%,100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.4); opacity: 0.7; }
}

/* =====================================================
   ВКЛАДКА СЖАТИЕ — особое выделение
   ===================================================== */
.tabs .tab:last-child a {
    background: linear-gradient(135deg, rgba(109,40,217,0.11), rgba(168,85,247,0.07)) !important;
    border-left: 1.5px solid rgba(109,40,217,0.18);
    position: relative;
}
.tabs .tab:last-child a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6d28d9, #a855f7, #6d28d9);
    background-size: 200% 100%;
    animation: compress-tab-shimmer 2.5s linear infinite;
    border-radius: 2px 2px 0 0;
}
@keyframes compress-tab-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}
.tabs .tab:last-child a.active::after { opacity: 0; } /* indicator уже есть */
.tabs .tab:last-child a.active {
    background: linear-gradient(135deg, rgba(109,40,217,0.15), rgba(168,85,247,0.10)) !important;
}
.tabs .tab:last-child a:hover {
    background: linear-gradient(135deg, rgba(109,40,217,0.18), rgba(168,85,247,0.13)) !important;
}
.tabs .tab:last-child a {
    color: #6d28d9 !important;
}
.tabs .tab:last-child .compress-tab-icon svg {
    filter: drop-shadow(0 0 3px rgba(109,40,217,0.45));
}
.tabs .tab:last-child .compress-tab-icon .svg-tab-outer { stroke: #6d28d9; }
.tabs .tab:last-child .compress-tab-icon .svg-tab-mid   { stroke: #9333ea; fill: rgba(147,51,234,0.15); }
.tabs .tab:last-child .compress-tab-icon .svg-tab-inner { fill: #a855f7; }
/* Пульсирующий badge-dot на вкладке */
.compress-tab-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: linear-gradient(135deg, #a855f7, #6d28d9);
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
    animation: compress-dot-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(168,85,247,0.6);
}
@keyframes compress-dot-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.6); transform: scale(1); }
    50%      { box-shadow: 0 0 0 4px rgba(168,85,247,0); transform: scale(1.2); }
}

/* Индикатор — плавный */
.tabs .indicator { transition: left 0.3s ease, width 0.3s ease; }


/* =====================================================
   АНИМИРОВАННЫЕ ИКОНКИ В DROP-ЗОНАХ ВКЛАДОК
   ===================================================== */

/* --- Обёртка иконки --- */
/* Центрируем анимированные иконки, сохраняя их круглую форму */
.tab-hero-icon {
    display: flex !important;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px auto !important; /* Выравнивает сам кружок по центру зоны */
    width: 64px !important;              /* Жестко фиксируем ширину */
    height: 64px !important;             /* Жестко фиксируем высоту */
    border-radius: 50% !important;       /* Возвращаем идеальную форму круга */
}
/* === ИЗОБРАЖЕНИЯ — орбитальное вращение пикселей === */
.hero-images {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    box-shadow: 0 8px 24px rgba(245,158,11,0.35);
    animation: hero-float 3s ease-in-out infinite;
    position: relative;
}
.hero-images svg { display: block; }
.svg-img-frame {
    animation: img-frame-spin 8s linear infinite;
    transform-origin: 20px 20px;
}
.svg-img-pixel1 {
    animation: img-pixel-orbit 3s ease-in-out infinite;
    transform-origin: 20px 20px;
}
.svg-img-pixel2 {
    animation: img-pixel-orbit 3s ease-in-out infinite reverse;
    animation-delay: -1.5s;
    transform-origin: 20px 20px;
}
.svg-img-lens {
    animation: img-lens-pulse 2s ease-in-out infinite;
    transform-origin: 20px 20px;
}
@keyframes img-frame-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes img-pixel-orbit {
    0%,100% { transform: rotate(0deg) translateX(0px) scale(1); }
    50%      { transform: rotate(180deg) translateX(2px) scale(1.3); }
}
@keyframes img-lens-pulse {
    0%,100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.3); opacity: 0.75; }
}

/* === ДОКУМЕНТЫ — страницы перелистываются === */
.hero-docs {
    background: linear-gradient(135deg, #4ecdc4, #2563eb);
    box-shadow: 0 8px 24px rgba(78,205,196,0.35);
    animation: hero-float 3.2s ease-in-out infinite;
    animation-delay: -0.6s;
}
.hero-docs svg { display: block; }
.svg-doc-back {
    animation: doc-back-slide 3s ease-in-out infinite;
    transform-origin: 20px 20px;
}
.svg-doc-front {
    animation: doc-front-bounce 3s ease-in-out infinite;
    transform-origin: 20px 20px;
}
.svg-doc-lines {
    animation: doc-lines-fade 3s ease-in-out infinite;
    animation-delay: -0.3s;
}
@keyframes doc-back-slide {
    0%,100% { transform: translateY(0px) rotate(-3deg); opacity: 0.6; }
    50%      { transform: translateY(-3px) rotate(-6deg); opacity: 0.9; }
}
@keyframes doc-front-bounce {
    0%,100% { transform: translateY(0px); }
    50%      { transform: translateY(-4px); }
}
@keyframes doc-lines-fade {
    0%,100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* === АУДИО — звуковые волны === */
.hero-audio {
    background: linear-gradient(135deg, #ff6b6b, #ee0979);
    box-shadow: 0 8px 24px rgba(255,107,107,0.38);
    animation: hero-float 2.8s ease-in-out infinite;
    animation-delay: -1.1s;
}
.hero-audio svg { display: block; }
.svg-audio-bar1 { animation: audio-bar 1.1s ease-in-out infinite;              transform-origin: 8px 20px; }
.svg-audio-bar2 { animation: audio-bar 1.1s ease-in-out infinite; animation-delay: -0.22s; transform-origin: 12px 20px; }
.svg-audio-bar3 { animation: audio-bar 1.1s ease-in-out infinite; animation-delay: -0.44s; transform-origin: 16px 20px; }
.svg-audio-bar4 { animation: audio-bar 1.1s ease-in-out infinite; animation-delay: -0.66s; transform-origin: 20px 20px; }
.svg-audio-bar5 { animation: audio-bar 1.1s ease-in-out infinite; animation-delay: -0.88s; transform-origin: 24px 20px; }
.svg-audio-note { animation: audio-note-fly 2.2s ease-in-out infinite; }
@keyframes audio-bar {
    0%,100% { transform: scaleY(0.35); }
    50%      { transform: scaleY(1); }
}
@keyframes audio-note-fly {
    0%,100% { transform: translate(0,0) rotate(0deg); opacity: 0.6; }
    50%      { transform: translate(3px,-4px) rotate(15deg); opacity: 1; }
}

/* === ВИДЕО — кадры прокручиваются === */
.hero-video {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    box-shadow: 0 8px 24px rgba(124,58,237,0.38);
    animation: hero-float 3.5s ease-in-out infinite;
    animation-delay: -2s;
}
.hero-video svg { display: block; }
.svg-video-reel {
    animation: video-reel-spin 4s linear infinite;
    transform-origin: 20px 20px;
}
.svg-video-play {
    animation: video-play-pulse 2s ease-in-out infinite;
    transform-origin: 20px 20px;
}
.svg-video-hole1 { animation: video-hole-blink 4s linear infinite;              }
.svg-video-hole2 { animation: video-hole-blink 4s linear infinite; animation-delay: -1s; }
.svg-video-hole3 { animation: video-hole-blink 4s linear infinite; animation-delay: -2s; }
.svg-video-hole4 { animation: video-hole-blink 4s linear infinite; animation-delay: -3s; }
@keyframes video-reel-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes video-play-pulse {
    0%,100% { transform: scale(1);   opacity: 0.9; }
    50%      { transform: scale(1.2); opacity: 1; }
}
@keyframes video-hole-blink {
    0%,90%,100% { opacity: 0.4; }
    45%          { opacity: 1; }
}

/* === КНИГИ — страницы листаются === */
.hero-books {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 8px 24px rgba(59,130,246,0.38);
    animation: hero-float 3.8s ease-in-out infinite;
    animation-delay: -1.8s;
}
.hero-books svg { display: block; }
.svg-book-cover {
    animation: book-cover-open 4s ease-in-out infinite;
    transform-origin: 10px 20px;
}
.svg-book-page1 {
    animation: book-page-turn 4s ease-in-out infinite;
    transform-origin: 20px 20px;
    animation-delay: -0.3s;
}
.svg-book-page2 {
    animation: book-page-turn 4s ease-in-out infinite;
    transform-origin: 20px 20px;
    animation-delay: -0.6s;
}
.svg-book-spine { animation: none; }
@keyframes book-cover-open {
    0%,100% { transform: skewX(0deg); }
    40%,60%  { transform: skewX(-4deg); }
}
@keyframes book-page-turn {
    0%,100% { transform: scaleX(1) translateX(0px); opacity: 0.8; }
    50%      { transform: scaleX(0.7) translateX(3px); opacity: 1; }
}

/* --- Общий float --- */
@keyframes hero-float {
    0%,100% { transform: translateY(0px); }
    50%      { transform: translateY(-5px); }
}

/* === ОРГАНИЧНАЯ АНИМАЦИЯ ИКОНКИ СЖАТИЯ === */

/* Вся иконка плавно "дышит" (сжимается) */
.compress-tab-icon svg {
    animation: compress-breathe 3s infinite ease-in-out;
    transform-origin: center;
    overflow: visible; /* Чтобы ядро при пульсации не обрезалось */
}

/* Внутреннее ядро пульсирует и меняет цвет для привлечения внимания */
.svg-tab-inner {
    animation: core-pulse 1.5s infinite alternate ease-in-out;
    transform-origin: center;
}

@keyframes compress-breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.85); } /* Иконка мягко сжимается */
}

@keyframes core-pulse {
    0% { 
        transform: scale(0.8); 
        fill: #a855f7; /* Родной фиолетовый */
    }
    100% { 
        transform: scale(1.6); 
        fill: #ff4757; /* Перетекает в яркий красный (акцент) */
    }
}

/* =====================================================
   АДАПТИВНАЯ ВЁРСТКА — ПЛАНШЕТ И МОБИЛЬНЫЕ
   ===================================================== */

/* --- Планшет (601px - 992px) --- */
@media only screen and (max-width: 992px) {
    .main-container {
        padding: 30px 15px;
    }
    
    .brand-logo-custom {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .tabs .tab a {
        font-size: 0.85rem !important;
        padding: 0 8px !important;
    }

    .tab-content {
        padding: 25px 20px;
    }

    .drop-zone {
        padding: 30px 15px;
    }
}

/* --- Мобильные (до 600px) --- */
@media only screen and (max-width: 600px) {
    
    /* === Глобальные === */
    .main-container {
        padding: 15px 10px;
    }

    .brand-logo-custom {
        font-size: 1.4rem !important;
        margin-bottom: 15px;
    }

    /* === Заголовки === */
    h1 {
        font-size: 1.5rem !important;
    }

    /* === Вкладки — горизонтальный скролл со снапами === */
    .tabs {
        overflow-x: auto !important;
        overflow-y: hidden;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        height: auto !important;
        min-height: 50px !important;
    }

    .tabs .tab {
        scroll-snap-align: start;
        flex-shrink: 0 !important;
    }

    .tabs .tab.col.s-20p,
    .tabs .tab.col.s-16p {
        width: 80px !important;
        min-width: 80px !important;
    }

    .tabs .tab a {
        font-size: 0.65rem !important;
        padding: 0 4px !important;
        white-space: nowrap !important;
    }

    .tabs .tab a i {
        display: none !important;
    }

    /* Текст на вкладках — только название */
    .tabs .tab a .compress-tab-icon {
        display: inline !important;
        margin-right: 0 !important;
    }
    
    .tabs .tab a .compress-tab-icon svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* === Контент вкладок === */
    .tab-content {
        padding: 15px 10px !important;
    }

    /* === Drop zone === */
    .drop-zone {
        padding: 20px 12px !important;
        min-height: 150px !important;
    }

    .drop-zone i {
        font-size: 2.2rem !important;
    }

    .drop-zone p {
        font-size: 0.9rem !important;
    }

    /* === Переключатель источника (файл / URL) === */
    .source-switcher {
        width: 100%;
        justify-content: stretch;
    }

    .source-btn {
        flex: 1;
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
        justify-content: center;
    }

    .source-btn i {
        display: none !important;
    }

    /* === URL input === */
    .url-input-field {
        font-size: 0.85rem !important;
        font-family: 'Roboto', sans-serif !important;
    }

    /* === Custom select === */
    .custom-select-wrap {
        margin-bottom: 15px;
    }

    .custom-select-trigger {
        padding: 10px 12px;
    }

    .custom-select-dropdown {
        max-height: 280px;
    }

    .sel-option {
        padding: 8px 12px;
    }

    .sel-option .opt-desc {
        display: none;
    }

    /* === Кнопка конвертации === */
    .btn-convert {
        height: auto !important;
        min-height: 48px;
        padding: 12px 16px !important;
        font-size: 1rem !important;
        white-space: normal;
        text-align: center;
    }

    /* === Дополнительные настройки === */
    .settings-section {
        margin-top: 8px;
        margin-bottom: 15px;
    }

    .settings-toggle {
        padding: 10px 12px;
    }

    .settings-toggle .toggle-label {
        font-size: 0.85rem;
    }

    .settings-body {
        padding: 12px 4px 4px;
    }

    .settings-group {
        padding: 12px;
        margin-bottom: 10px;
    }

    .settings-group-title {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    /* === Качество === */
    .quality-wrap {
        margin-bottom: 8px;
    }

    .quality-header {
        margin-bottom: 6px;
    }

    .quality-label {
        font-size: 0.8rem;
    }

    /* === Size row (width × height) === */
    .size-row {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 8px !important;
    }

    .size-link-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }

    .size-input-wrap input {
        padding: 8px 10px 8px 28px !important;
        font-size: 0.85rem !important;
    }

    .size-input-wrap .size-unit {
        font-size: 0.65rem !important;
        left: 8px !important;
    }

    /* === Rotate buttons === */
    .rotate-btns {
        gap: 6px;
    }

    .rotate-btn {
        min-width: 70px;
        padding: 8px 4px;
        font-size: 0.72rem;
    }

    .rotate-btn i {
        font-size: 0.9rem;
    }

    /* === Ratio buttons === */
    .ratio-btns {
        gap: 6px;
    }

    .ratio-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    /* === Effect buttons === */
    .effect-btns {
        gap: 6px;
    }

    .effect-btn {
        min-width: 70px;
        padding: 8px 6px;
        font-size: 0.72rem;
    }

    /* === Background color === */
    .bg-color-wrap {
        flex-wrap: wrap;
    }

    .bg-presets {
        gap: 6px;
    }

    .bg-preset {
        width: 24px !important;
        height: 24px !important;
    }

    .bg-color-input {
        width: 32px !important;
        height: 32px !important;
    }

    /* === Audio format grid === */
    .audio-format-grid {
        gap: 6px;
    }

    .audio-fmt-btn {
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
    }

    .audio-fmt-btn i {
        display: none !important;
    }

    .audio-param-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    /* === Video format grid === */
    .video-format-grid {
        gap: 6px;
    }

    .video-fmt-btn {
        padding: 6px 10px !important;
        font-size: 0.78rem !important;
        min-width: 70px;
    }

    .video-fmt-btn i {
        display: none !important;
    }

    .video-param-btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    /* === SEO кнопки === */
    .seo-tags {
        gap: 8px;
    }

    .seo-btn {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    .seo-btn i {
        display: none !important;
    }

    /* === Footer === */
    .custom-footer {
        padding-top: 25px !important;
    }

    .custom-footer .col {
        margin-bottom: 20px;
    }

    .footer-title {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .footer-link {
        font-size: 0.88rem;
    }

    .footer-copyright {
        margin-top: 15px;
        padding: 15px 0;
        font-size: 0.8rem;
    }

    /* === Progress steps === */
    .progress-steps {
        gap: 4px;
    }

    .progress-step {
        font-size: 0.62rem;
    }

    .progress-step i {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.85rem !important;
    }

    /* === Loader overlay === */
    .progress-card {
        padding: 20px 15px !important;
        width: 95% !important;
    }

    /* === Scroll top button === */
    #scroll-top-btn {
        bottom: 20px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* === Info panel === */
    .card-panel.teal.lighten-5 {
        padding: 12px !important;
        font-size: 0.85rem;
    }

    /* === History panel === */
    .history-panel-header {
        padding: 14px 12px !important;
    }

    .history-item {
        padding: 10px !important;
    }

    /* === Navbar === */
    .custom-navbar .custom-logo {
        font-size: 1.2rem !important;
    }

    /* === Compress settings bar === */
    .compress-settings-bar {
        padding: 10px !important;
        gap: 10px !important;
    }

    .compress-setting-group {
        min-width: 100% !important;
    }

    .compress-level-btns {
        gap: 6px;
    }

    .compress-level-btn {
        min-width: 80px;
        padding: 6px 10px;
    }

    /* === Compress footer === */
    .compress-footer {
        padding: 10px !important;
    }

    .compress-total-stats {
        gap: 8px;
    }

    .compress-stat {
        min-width: 44px;
    }

    .compress-footer-actions {
        width: 100%;
        justify-content: center;
    }

    /* === Compress job card === */
    .cjob-card {
        padding: 8px 10px !important;
        gap: 8px !important;
    }

    .cjob-thumb {
        width: 40px !important;
        height: 40px !important;
    }

    .cjob-name {
        font-size: 0.82rem !important;
    }

    .cjob-sizes {
        font-size: 0.75rem !important;
    }

    .cjob-dl-btn, .cjob-rm-btn {
        width: 30px !important;
        height: 30px !important;
    }

    /* === Cards on other pages === */
    .card {
        padding: 15px !important;
    }

    .card .card-content {
        padding: 15px !important;
    }
}

/* --- Очень узкие экраны (до 400px) --- */
@media only screen and (max-width: 400px) {
    
    .brand-logo-custom {
        font-size: 1.2rem !important;
    }

    h1 {
        font-size: 1.3rem !important;
    }

    h2 {
        font-size: 1.2rem !important;
    }

    .tabs .tab.col.s-20p,
    .tabs .tab.col.s-16p {
        width: 65px !important;
        min-width: 65px !important;
    }

    .tabs .tab a {
        font-size: 0.6rem !important;
    }

    .tab-content {
        padding: 12px 8px !important;
    }

    .drop-zone {
        padding: 15px 10px !important;
        min-height: 130px !important;
    }

    .drop-zone i {
        font-size: 2rem !important;
    }

    .btn-convert {
        font-size: 0.9rem !important;
        padding: 10px 12px !important;
    }

    .source-btn {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
    }

    .audio-fmt-btn,
    .video-fmt-btn {
        padding: 5px 8px !important;
        font-size: 0.72rem !important;
    }

    .rotate-btn {
        min-width: 60px;
        padding: 6px 2px;
        font-size: 0.68rem;
    }

    .effect-btn {
        min-width: 60px;
    }

    .ratio-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .seo-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .progress-step {
        font-size: 0.55rem;
    }

    .progress-step i {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.75rem !important;
    }

    .compress-level-btn {
        min-width: 70px;
        padding: 5px 8px;
    }

    .compress-level-name {
        font-size: 0.8rem;
    }

    .compress-level-desc {
        font-size: 0.65rem;
    }
}

/* Touch-улучшения для слайдеров */
@media (hover: none) and (pointer: coarse) {
    input[type=range].quality-slider::-webkit-slider-thumb {
        width: 28px !important;
        height: 28px !important;
    }
    
    input[type=range].quality-slider {
        height: 8px !important;
    }
}

/* Плавные переходы для анимаций на мобильных (уменьшаем для экономии батареи) */
@media only screen and (max-width: 600px) {
    body {
        transition-duration: 0.2s;
    }
    
    .converter-card,
    .drop-zone,
    .btn-convert,
    .tabs,
    .sidenav {
        transition-duration: 0.2s;
    }
    
    @keyframes hero-float {
        0%,100% { transform: translateY(0px); }
        50%      { transform: translateY(-3px); }
    }
}