/* Базовые классы и анимации */
.hidden-page { display: none; }
.active-page { display: block; }
body { scroll-behavior: smooth; }

/* Эффект матового стекла (Святой Грааль этого дизайна) */
.glass {
    background: rgba(24, 24, 27, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Верхняя панель — сплошной фон в фирменной тёмной гамме (БЕЗ стекла/backdrop-filter):
   одинаково выглядит во ВСЕХ браузерах (Firefox/Safari не умеют SVG-преломление, поэтому
   от стекла отказались). Бьём ТОЛЬКО по nav (специфичность nav.glass > .glass у карточек),
   карточки .glass не трогаем. Непрозрачный фон → панель никогда не «просвечивает». */
nav.glass {
    background: linear-gradient(180deg, #17171d 0%, #0e0e12 100%);
    -webkit-backdrop-filter: none;   /* перебиваем blur из базового .glass — фон непрозрачный, стекло не нужно */
    backdrop-filter: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.80);
}
/* Тонкая брендовая линия-акцент по нижнему краю (fuchsia → violet, тает к бокам). */
nav.glass::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(217, 70, 239, 0.60), rgba(139, 92, 246, 0.60), transparent);
}

.glass-input { 
    background: rgba(0, 0, 0, 0.3); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: white; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}
.glass-input:focus { 
    border-color: #d946ef; 
    outline: none; 
    background: rgba(0, 0, 0, 0.5); 
    box-shadow: 0 0 15px rgba(217,70,239,0.2);
}

/* Бейджики */
/* Обновленный Бейджик */
.badge-new { 
    background: linear-gradient(90deg, #8b5cf6, #d946ef); 
    color: white; 
    font-size: 9px; 
    font-weight: 800; 
    padding: 2px 6px; 
    border-radius: 4px; 
    box-shadow: 0 0 10px rgba(217,70,239,0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Неоновый градиентный ползунок (Для тарифа Ultra) */
.custom-slider-neon { 
    -webkit-appearance: none; 
    background: linear-gradient(90deg, rgba(139,92,246,0.3) 0%, rgba(217,70,239,0.3) 100%); 
    height: 6px; 
    border-radius: 3px;
    outline: none; 
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}
.custom-slider-neon::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    height: 20px; 
    width: 20px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, #8b5cf6, #d946ef); 
    margin-top: -7px; 
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(217,70,239,0.8), inset 0 0 5px rgba(0,0,0,0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
}
.custom-slider-neon::-webkit-slider-thumb:hover { 
    transform: scale(1.25); 
    box-shadow: 0 0 25px rgba(217,70,239,1); 
}
.custom-slider-neon::-webkit-slider-runnable-track { 
    width: 100%; 
    height: 6px; 
    background: transparent; 
    border-radius: 3px; 
}

/* Неоновый тумблер Monthly/Annual */
.neon-toggle:checked + div {
    background: linear-gradient(90deg, #7c3aed, #d946ef) !important;
    border-color: rgba(217,70,239,0.5) !important;
    box-shadow: 0 0 15px rgba(217,70,239,0.5);
}
/* Эффекты при наведении */
.block-hover { transition: transform 0.3s ease, border-color 0.3s ease; }
.block-hover:hover { transform: translateY(-2px); border-color: rgba(217,70,239,0.3); }

/* Кастомный скроллбар */
/* Полное скрытие скроллбара для левой панели */
.hidden-scrollbar::-webkit-scrollbar { display: none; }
.hidden-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Radio Cards (Стеклянные карточки для форматов) */
.radio-card {
    background: rgba(24, 24, 27, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.radio-card:hover { border-color: rgba(217,70,239,0.4); transform: translateY(-2px); }
.radio-card.active {
    border-color: #d946ef;
    background: rgba(217,70,239,0.1);
    box-shadow: 0 0 20px rgba(217,70,239,0.2);
}

/* Кнопки выбора мощности (Tier) */
.tier-btn { border: 1px solid transparent; }
.tier-btn.active {
    background: linear-gradient(180deg, rgba(139,92,246,0.3) 0%, rgba(217,70,239,0.1) 100%);
    border: 1px solid rgba(217,70,239,0.5);
    box-shadow: 0 0 15px rgba(217,70,239,0.2);
}

/* Ползунки (Topaz AI Sliders) */
/* ── Ползунки: видны в Chrome И Firefox, с залитой «пройденной» частью ── */
.custom-slider { -webkit-appearance: none; appearance: none; background: transparent; height: 16px; outline: none; cursor: pointer; }
/* WebKit: трек-градиент, разрез по --p (обновляется JS), большой видимый бегунок */
.custom-slider::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px;
    background: linear-gradient(to right, #d946ef 0%, #a855f7 var(--p, 50%), #3f3f46 var(--p, 50%), #3f3f46 100%);
}
.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none; height: 15px; width: 15px; border-radius: 50%;
    background: #fff; border: 2px solid #d946ef; margin-top: -4.5px; cursor: pointer;
    box-shadow: 0 0 8px rgba(217,70,239,0.55); transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.custom-slider:hover::-webkit-slider-thumb { transform: scale(1.22); box-shadow: 0 0 16px rgba(217,70,239,0.95); }
.custom-slider:active::-webkit-slider-thumb { transform: scale(1.32); box-shadow: 0 0 20px rgba(217,70,239,1); }
/* Firefox: трек + залитый прогресс (показывает позицию без JS) */
.custom-slider::-moz-range-track { height: 6px; border-radius: 999px; background: #3f3f46; }
.custom-slider::-moz-range-progress { height: 6px; border-radius: 999px; background: linear-gradient(to right, #d946ef, #a855f7); }
.custom-slider::-moz-range-thumb {
    height: 15px; width: 15px; border-radius: 50%; background: #fff; border: 2px solid #d946ef;
    cursor: pointer; box-shadow: 0 0 8px rgba(217,70,239,0.55); transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.custom-slider:hover::-moz-range-thumb { transform: scale(1.22); box-shadow: 0 0 16px rgba(217,70,239,0.95); }
.custom-slider:active::-moz-range-thumb { transform: scale(1.32); box-shadow: 0 0 20px rgba(217,70,239,1); }

/* Цветные ползунки для тарифов (Pink и Blue) */
.custom-slider-pink::-webkit-slider-thumb { border-color: #f43f5e; box-shadow: 0 0 10px rgba(244,63,94,0.5); }
.custom-slider-pink::-moz-range-thumb { border-color: #f43f5e; box-shadow: 0 0 10px rgba(244,63,94,0.5); }
.custom-slider-pink::-webkit-slider-runnable-track { background: linear-gradient(to right, #f43f5e 0%, #fb7185 var(--p,50%), #3f3f46 var(--p,50%), #3f3f46 100%); }
.custom-slider-pink::-moz-range-progress { background: linear-gradient(to right, #f43f5e, #fb7185); }
.custom-slider-blue::-webkit-slider-thumb { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.5); }
.custom-slider-blue::-moz-range-thumb { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.5); }
.custom-slider-blue::-webkit-slider-runnable-track { background: linear-gradient(to right, #3b82f6 0%, #60a5fa var(--p,50%), #3f3f46 var(--p,50%), #3f3f46 100%); }
.custom-slider-blue::-moz-range-progress { background: linear-gradient(to right, #3b82f6, #60a5fa); }

/* ── Неоновая ручка изменения высоты таймлайна (свечение по центру, затухание к краям) ── */
.ed-resize-grip {
    background: linear-gradient(to right, rgba(217,70,239,0) 0%, rgba(217,70,239,0.45) 28%, rgba(217,70,239,0.6) 50%, rgba(217,70,239,0.45) 72%, rgba(217,70,239,0) 100%);
    transition: height 0.55s cubic-bezier(0.22,1,0.36,1), filter 0.55s cubic-bezier(0.22,1,0.36,1), background 0.55s cubic-bezier(0.22,1,0.36,1);
}
#edit-tl-resize:hover .ed-resize-grip, #edit-tl-resize:active .ed-resize-grip {
    height: 5px;
    background: linear-gradient(to right, rgba(245,168,255,0) 0%, rgba(245,168,255,0.12) 28%, #f5a8ff 50%, rgba(245,168,255,0.12) 72%, rgba(245,168,255,0) 100%);
    /* drop-shadow повторяет прозрачность фигуры → свечение только по центру, по краям полное затухание */
    filter: drop-shadow(0 0 7px rgba(217,70,239,0.95)) drop-shadow(0 0 16px rgba(217,70,239,0.6));
}
/* ── Анимированный переключатель видимости (глаз) / звука (динамик) ── */
.ed-vis { color: #e879f9; transition: color 0.4s ease; line-height: 0; }
.ed-vis:hover { color: #f0abfc; }
.ed-vis.off { color: #71717a; }            /* выключено → серый */
.ed-vis.off:hover { color: #a1a1aa; }
.ed-vis svg { overflow: visible; }
/* глаз: при выключении плавно «закрывается» (схлопывается по вертикали) + гаснет зрачок */
.ed-vis .vis-eye { transition: transform 0.42s cubic-bezier(0.4,0,0.2,1), opacity 0.4s ease; transform-box: fill-box; transform-origin: center; }
.ed-vis.off .vis-eye { transform: scaleY(0.12); opacity: 0.9; }
.ed-vis .vis-pupil { transition: opacity 0.3s ease; opacity: 1; }
.ed-vis.off .vis-pupil { opacity: 0; }
/* динамик: при выключении плавно гаснут звуковые волны */
.ed-vis .vis-wave { transition: opacity 0.38s ease; opacity: 1; }
.ed-vis.off .vis-wave { opacity: 0; }
.ed-vis .vis-spk { transition: opacity 0.4s ease; }
/* зачёркивающая линия: плавно «прорисовывается» при выключении */
.ed-vis .vis-slash { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset 0.45s cubic-bezier(0.4,0,0.2,1); }
.ed-vis.off .vis-slash { stroke-dashoffset: 0; }

/* Три точки на клипе — появляются при наведении на полоску/сегмент */
.ed-dots { align-items: center; justify-content: center; }
.ed-bar:hover .ed-dots, .ed-seg:hover .ed-dots { display: flex !important; }
/* Неоновая линия (дроп новой дорожки / магнит) — то же свечение по центру */
.ed-neon-line {
    background: linear-gradient(to right, rgba(245,168,255,0) 0%, rgba(245,168,255,0.18) 25%, #f5a8ff 50%, rgba(245,168,255,0.18) 75%, rgba(245,168,255,0) 100%);
    filter: drop-shadow(0 0 7px rgba(217,70,239,0.95)) drop-shadow(0 0 16px rgba(217,70,239,0.55));
}

/* ГЛАВНАЯ КНОПКА ГЕНЕРАЦИИ */
.forge-btn {
    background: linear-gradient(90deg, #7c3aed, #d946ef);
    box-shadow: 0 0 30px rgba(217,70,239,0.3);
}
.forge-btn:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(217,70,239,0.6); }
.forge-btn:active { transform: translateY(0); }

/* АНИМАЦИИ ПОЯВЛЕНИЯ (Staggered Fade-in) */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }

.animate-stagger-1 { animation: fadeInUp 0.5s ease forwards 0.1s; }
.animate-stagger-2 { animation: fadeInUp 0.5s ease forwards 0.2s; }
.animate-stagger-3 { animation: fadeInUp 0.5s ease forwards 0.3s; }
.animate-nav { animation: fadeInDown 0.5s ease-out forwards; animation-fill-mode: both !important; }

/* Анимация смены цены (Price Fade) */
.price-anim {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.price-fade-out {
    opacity: 0;
    transform: translateY(-5px);
}

@font-face {
    font-family: 'Bingdam';
    src: url('fonts/Bingbam.otf') format('opentype'); /* Исправлено тут */
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================
   ФИКС МЕРЦАНИЯ И РЫВКОВ ПРИ ЗАГРУЗКЕ
   ========================================== */

/* 1. Скрываем "голый" HTML на долю секунды, пока Tailwind CDN генерирует стили */
body {
    animation: smoothLoad 0.25s ease-out forwards;
}

@keyframes smoothLoad {
    0% { opacity: 0; }
    70% { opacity: 0; }
    100% { opacity: 1; }
}

/* 2. Заставляем элементы быть невидимыми ВО ВРЕМЯ задержки (delay), 
   чтобы они не появлялись до старта анимации */
[class*="animate-stagger"] {
    animation-fill-mode: both !important;
}

/* Кастомный скроллбар для списка моделей */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(217, 70, 239, 0.4);
}

/* Эффект тяжелого стекла для панелей настроек */
.glass-heavy {
    background: rgba(15, 15, 18, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

/* ==========================================
   КАСТОМНАЯ ИКОНКА ТОКЕНА (Замена эмодзи)
   ========================================== */
.icon-token {
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2048 2048'%3E%3Cpath d='M 1494.35 201.814 C 1495.16 205.542 1473.77 250.106 1470.22 257.826 L 1422.77 361.371 L 1265.86 700.565 L 1222.38 793.233 C 1211.81 815.739 1198.97 839.01 1193.1 862.788 C 1182.92 904.048 1205.6 943.111 1245.08 957.203 C 1257.86 962.083 1271.3 963.948 1284.68 966.457 C 1372.03 982.844 1460.3 996.939 1547.46 1014.14 C 1484.71 1022.49 1417.81 1033.7 1355.09 1043.31 L 1272.55 1056.03 C 1229 1062.78 1202.16 1065.15 1160.89 1082.79 C 1124.57 1098.41 1091.71 1121.08 1064.21 1149.5 C 1048.52 1165.74 1030.74 1192.28 1016.86 1211.52 L 953.235 1298.89 L 709.879 1635.16 L 632.515 1742.22 C 621.094 1757.99 601.436 1786.55 589.058 1800.84 C 588.604 1799.28 590.162 1796.98 591.052 1795.02 C 613.785 1739.67 640.462 1681.57 664.839 1626.65 L 796.911 1330.52 L 842.138 1229.68 C 852.099 1207.36 864.681 1183.49 869.728 1160.12 C 879.124 1118.25 853.432 1076.27 812.202 1064.81 C 783.507 1056.84 748.894 1053.13 718.994 1048.3 L 504.694 1014.11 C 529.889 1008.46 562.646 1003.47 588.349 998.937 L 759.459 969.224 C 803.597 961.443 850.6 955.78 891.946 939.068 C 930.733 923.391 972.803 897.888 1001.59 867.413 C 1017.68 850.371 1037.95 820.695 1052.55 800.766 L 1137.4 685.202 L 1358.52 384.99 C 1401.43 326.56 1449.62 257.995 1494.35 201.814 z' /%3E%3Cpath d='M 867.018 487.873 C 870.875 492.652 895.16 540.34 899.529 548.54 C 931.8 608.253 963.378 668.338 994.257 728.782 C 983.029 748.949 971.929 769.188 960.96 789.497 L 942.658 823.96 C 937.776 807.246 932.155 777.485 928.156 759.685 L 900.671 639.405 L 878.561 543.652 C 874.885 527.52 868.937 503.711 867.018 487.873 z' /%3E%3Cpath d='M 1117.52 1198.77 C 1120.42 1203.25 1185.52 1515.25 1189.51 1535.53 C 1183.96 1523.43 1176.42 1509.58 1170.27 1497.6 C 1135.2 1429.95 1097.58 1360.94 1063.61 1293.17 L 1117.52 1198.77 z' /%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

@keyframes token-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.05); }
}

.icon-token-anim {
    animation: token-float 3s ease-in-out infinite;
}

.icon-token-silver {
    background-color: transparent !important;
    background-image: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%) !important;
}

/* ==========================================
   АНИМАЦИЯ ГАЛОЧКИ ДЛЯ ПАРОЛЯ
   ========================================== */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes popOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}
/* ==========================================
   ПОСТОЯННЫЙ ФОН ПОД ПРЕВЬЮ СУБТИТРОВ
   Первый кадр роликов = этот фон, поэтому при смене src (hover в студии) или
   перемотке (синхронизация в /info) не возникает чёрной вспышки — под видео
   всегда виден тот же брендовый фон.
   ========================================== */
#sub-preview,
#subtitles .grid video {
    background-color: #0b0b0f;
    background-image: url('/examples/subtitles/_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ==========================================================================
   Оптимизация под телефон/планшет
   ========================================================================== */

/* Нижняя панель редактора (Edit Video) — свайпается влево/вправо, как в Canva.
   Инструменты не сжимаются; распорка .flex-1 растёт только когда всё влезает
   (на десктопе), а на узком экране схлопывается и панель начинает скроллиться. */
.ed-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}
.ed-toolbar::-webkit-scrollbar { display: none; }
.ed-toolbar > * { flex: 0 0 auto; }            /* инструменты держат размер */
.ed-toolbar > .flex-1 { flex: 1 1 0%; min-width: 6px; }  /* распорка между группами */

/* Таймлайн уже overflow-x-auto — добавляем инерционный тач-скролл и плавность */
#edit-track-scroll { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scroll-behavior: smooth; }

/* Инерционный скролл для всех «скрытых» контейнеров + убираем синюю вспышку тапа */
* { -webkit-tap-highlight-color: transparent; }
.hidden-scrollbar, .custom-scrollbar { -webkit-overflow-scrolling: touch; }

/* Тонкая полоска-подсказка, что нижнюю панель можно листать (только на тач) */
@media (hover: none) and (pointer: coarse) {
    .ed-toolbar { scroll-snap-type: x proximity; }
    .ed-toolbar > button { scroll-snap-align: start; }
}

@media (max-width: 767px) {
    /* Никакого случайного горизонтального скролла всей страницы */
    html, body { overflow-x: hidden; max-width: 100%; }
    /* Изображения/видео никогда не шире экрана */
    img, video, canvas, svg { max-width: 100%; }
    /* Комфортная минимальная высота кликабельных строк меню на телефоне */
    .menu-item { min-height: 44px; }
    /* Не даём фиксированному нижнему меню перекрывать контент под него */
    body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    /* Рейл инструментов Edit Video на телефоне — горизонтальная свайп-полоса */
    .ed-rail { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; padding-bottom: 2px; }
    .ed-rail > button { flex: 0 0 auto; min-width: 62px; }
}

/* ==========================================================================
   Главная (explore) — карточки, свайп-ряды, чипы
   ========================================================================== */
.cf-scroller { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 2px 6px; }
.cf-scroller::-webkit-scrollbar { display: none; }
.cf-scroller > * { scroll-snap-align: start; flex: 0 0 auto; }

.cf-chip { flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: #a1a1aa; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: .15s; white-space: nowrap; }
.cf-chip:hover { color: #fff; background: rgba(255,255,255,.08); }
.cf-chip.active { color: #fff; background: linear-gradient(135deg, rgba(217,70,239,.25), rgba(124,58,237,.25)); border-color: rgba(217,70,239,.5); box-shadow: 0 0 18px rgba(217,70,239,.25); }

.cf-card-hover { transition: transform .25s, border-color .25s, box-shadow .25s; }
.cf-card-hover:hover { transform: translateY(-4px); border-color: rgba(217,70,239,.4); box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(217,70,239,.15); }

.cf-arrow { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #d4d4d8; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; flex-shrink: 0; }
.cf-arrow:hover { background: rgba(255,255,255,.13); color: #fff; }

/* Карточки стилей субтитров на главной (CSS-копия из subtitle_cards.js, чтобы
   cardHtml работал без вызова build()) */
.cf-style-card { position: relative; width: 150px; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden; border: 1px solid rgba(0,0,0,.07); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: center; }
.cf-style-card.is-dark { border-color: rgba(255,255,255,.1); }
.cf-style-card:hover { border-color: rgba(217,70,239,.7); box-shadow: 0 0 0 2px rgba(217,70,239,.3); }
.cf-style-cap { font-size: 10.5px; line-height: 1.15; font-family: Inter, Arial, sans-serif; font-weight: 500; letter-spacing: .2px; max-width: 96%; }
.cf-style-name { position: absolute; left: 0; right: 0; bottom: 5px; font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(10,10,14,.55); padding: 2px 0; opacity: 0; transition: opacity .15s; font-family: Inter, Arial, sans-serif; }
.cf-style-card:hover .cf-style-name { opacity: 1; }

/* ==========================================================================
   Уведомление о низком балансе токенов (<20%)
   ========================================================================== */
#cf-credits-toast { position: fixed; right: 18px; bottom: 96px; z-index: 300; max-width: min(92vw, 430px); display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-radius: 18px; background: rgba(15,14,20,.93); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.6); transform: translateY(160%); opacity: 0; transition: transform .42s cubic-bezier(.2,.9,.3,1), opacity .3s; }
#cf-credits-toast.show { transform: none; opacity: 1; }
#cf-credits-toast .cf-ct-dot { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f43f5e, #c026d3); box-shadow: 0 0 18px rgba(244,63,94,.4); }
#cf-credits-toast .cf-ct-txt { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.32; color: #e4e4e7; }
#cf-credits-toast .cf-ct-txt b { color: #fff; font-weight: 700; }
#cf-credits-toast .cf-ct-up { flex-shrink: 0; background: linear-gradient(135deg, #c026d3, #7c3aed); color: #fff; font-weight: 700; font-size: 12.5px; padding: 8px 14px; border-radius: 10px; white-space: nowrap; transition: .15s; text-decoration: none; }
#cf-credits-toast .cf-ct-up:hover { filter: brightness(1.12); }
#cf-credits-toast .cf-ct-x { flex-shrink: 0; color: #71717a; cursor: pointer; padding: 2px; transition: .15s; display: flex; }
#cf-credits-toast .cf-ct-x:hover { color: #fff; }
@media (max-width: 767px) { #cf-credits-toast { right: 12px; left: 12px; bottom: calc(150px + env(safe-area-inset-bottom)); max-width: none; } }

/* ==========================================================================
   Cookie-consent баннер (низ-слева, чтобы не конфликтовать с тостом/FAB справа)
   ========================================================================== */
#cf-consent { position: fixed; left: 18px; bottom: 18px; z-index: 9998; max-width: min(94vw, 420px); display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px; background: rgba(15,14,20,.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 24px 60px rgba(0,0,0,.6); transform: translateY(180%); opacity: 0; transition: transform .42s cubic-bezier(.2,.9,.3,1), opacity .3s; }
#cf-consent.show { transform: none; opacity: 1; }
#cf-consent .cf-cc-top { display: flex; gap: 13px; align-items: flex-start; }
#cf-consent .cf-cc-ic { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#c026d3,#7c3aed); box-shadow: 0 0 18px rgba(217,70,239,.35); }
#cf-consent .cf-cc-title { color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 3px; }
#cf-consent .cf-cc-txt { color: #a1a1aa; font-size: 12.5px; line-height: 1.42; }
#cf-consent .cf-cc-link { color: #e879f9; text-decoration: underline; }
#cf-consent .cf-cc-link:hover { color: #f0abfc; }
#cf-consent .cf-cc-actions { display: flex; gap: 8px; }
#cf-consent .cf-cc-actions button { flex: 1; padding: 9px 14px; border-radius: 11px; font-weight: 700; font-size: 12.5px; cursor: pointer; transition: .15s; }
#cf-consent .cf-cc-reject { background: rgba(255,255,255,.06); color: #d4d4d8; border: 1px solid rgba(255,255,255,.12); }
#cf-consent .cf-cc-reject:hover { background: rgba(255,255,255,.12); color: #fff; }
#cf-consent .cf-cc-accept { background: linear-gradient(135deg,#c026d3,#7c3aed); color: #fff; border: 1px solid transparent; }
#cf-consent .cf-cc-accept:hover { filter: brightness(1.12); }
@media (max-width: 767px) { #cf-consent { left: 12px; right: 12px; bottom: calc(150px + env(safe-area-inset-bottom)); max-width: none; } }
#cf-consent .cf-cc-custom { margin-top: 2px; align-self: center; background: none; border: none; color: #a1a1aa; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px; }
#cf-consent .cf-cc-custom:hover { color: #fff; }

/* ==========================================================================
   Cookie Settings — полное окно с категориями, переключателями и Details
   ========================================================================== */
#cf-cs-bd { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .25s; }
#cf-cs-bd.show { opacity: 1; }
#cf-cs { width: 100%; max-width: 760px; max-height: 88vh; display: flex; flex-direction: column; background: #0e0e12; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.7); transform: translateY(14px) scale(.98); transition: transform .28s cubic-bezier(.3,1.1,.4,1); overflow: hidden; }
#cf-cs-bd.show #cf-cs { transform: none; }
.cf-cs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.cf-cs-title { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.1; }
.cf-cs-x { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.06); color: #a1a1aa; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid rgba(255,255,255,.08); flex-shrink: 0; transition: .15s; }
.cf-cs-x:hover { color: #fff; background: rgba(255,255,255,.12); }
.cf-cs-intro { padding: 10px 24px 0; color: #a1a1aa; font-size: 13.5px; line-height: 1.5; }
.cf-cs-tabs { display: flex; gap: 8px; padding: 16px 24px 0; }
.cf-cs-tab { flex: 1; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.04); color: #a1a1aa; font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: .15s; }
.cf-cs-tab.active { background: rgba(255,255,255,.08); color: #fff; }
.cf-cs-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 24px 16px; margin-top: 12px; }
.cf-cs-cat { border-top: 1px solid rgba(255,255,255,.07); padding: 18px 0; }
.cf-cs-cat:first-child { border-top: none; }
.cf-cs-cathead { display: flex; align-items: flex-start; gap: 16px; }
.cf-cs-catinfo { flex: 1; min-width: 0; }
.cf-cs-cattitle { color: #fff; font-weight: 700; font-size: 16px; }
.cf-cs-catdesc { color: #9a9aa3; font-size: 13px; margin-top: 4px; line-height: 1.45; }
.cf-cs-sw { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; padding: 0; margin-top: 2px; }
.cf-cs-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cf-cs-sw.on { background: linear-gradient(135deg,#c026d3,#7c3aed); border-color: transparent; }
.cf-cs-sw.on::after { transform: translateX(18px); }
.cf-cs-sw.locked { opacity: .7; cursor: not-allowed; }
.cf-cs-detbtn { margin-top: 10px; color: #e879f9; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; padding: 0; }
.cf-cs-detchev { display: inline-flex; transition: transform .2s; }
.cf-cs-detbtn.open .cf-cs-detchev { transform: rotate(180deg); }
.cf-cs-det { display: none; margin-top: 12px; }
.cf-cs-det.open { display: block; }
.cf-cs-tablewrap { overflow-x: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.cf-cs-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 560px; }
.cf-cs-table th { text-align: left; color: #71717a; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 10px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.02); }
.cf-cs-table td { color: #d4d4d8; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; line-height: 1.45; }
.cf-cs-table tr:last-child td { border-bottom: none; }
.cf-cs-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #fff; white-space: nowrap; }
.cf-cs-dom { color: #71717a; font-size: 11px; margin-top: 2px; }
.cf-cs-empty { color: #71717a; font-size: 13px; padding: 10px 2px; }
.cf-cs-about { color: #a1a1aa; font-size: 14px; line-height: 1.6; }
.cf-cs-about p { margin-top: 12px; }
.cf-cs-about p:first-child { margin-top: 0; }
.cf-cs-cid { color: #71717a; font-size: 11px; font-family: ui-monospace, Menlo, monospace; }

/* Компактное окно cookie (скрин 3) — по центру, фон тускнеет */
#cf-cc-bd { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 18px; opacity: 0; transition: opacity .25s; }
#cf-cc-bd.show { opacity: 1; }
#cf-cc { width: 100%; max-width: 440px; background: #0e0e12; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.7); padding: 26px 24px 24px; position: relative; transform: translateY(14px) scale(.98); transition: transform .28s cubic-bezier(.3,1.1,.4,1); }
#cf-cc-bd.show #cf-cc { transform: none; }
#cf-cc .cf-cc-x { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.06); color: #a1a1aa; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid rgba(255,255,255,.08); transition: .15s; }
#cf-cc .cf-cc-x:hover { color: #fff; background: rgba(255,255,255,.12); }
#cf-cc .cf-cc-title { font-size: 23px; font-weight: 800; color: #fff; padding-right: 38px; margin-bottom: 12px; line-height: 1.15; }
#cf-cc .cf-cc-txt { color: #a1a1aa; font-size: 14px; line-height: 1.55; margin-bottom: 18px; }
#cf-cc .cf-cc-link { color: #e879f9; text-decoration: underline; }
#cf-cc .cf-cc-actions { display: flex; gap: 12px; }
#cf-cc .cf-cc-actions button { flex: 1; padding: 13px; border-radius: 14px; font-weight: 700; font-size: 15px; cursor: pointer; transition: .15s; }
#cf-cc .cf-cc-accept { background: linear-gradient(135deg,#c026d3,#7c3aed); color: #fff; border: none; }
#cf-cc .cf-cc-accept:hover { filter: brightness(1.1); }
#cf-cc .cf-cc-reject { background: rgba(255,255,255,.08); color: #e4e4e7; border: 1px solid rgba(255,255,255,.12); }
#cf-cc .cf-cc-reject:hover { background: rgba(255,255,255,.14); }
#cf-cc .cf-cc-custom { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; background: none; border: none; color: #a1a1aa; font-weight: 600; font-size: 13.5px; cursor: pointer; }
#cf-cc .cf-cc-custom:hover { color: #fff; }
.cf-cs-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.08); }
.cf-cs-foot button { padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; transition: .15s; }
.cf-cs-save, .cf-cs-reject { background: rgba(255,255,255,.06); color: #e4e4e7; border: 1px solid rgba(255,255,255,.12); }
.cf-cs-save:hover, .cf-cs-reject:hover { background: rgba(255,255,255,.12); }
.cf-cs-accept { margin-left: auto; background: linear-gradient(135deg,#c026d3,#7c3aed); color: #fff; border: 1px solid transparent; }
.cf-cs-accept:hover { filter: brightness(1.1); }
@media (max-width: 600px) {
    #cf-cs-bd { align-items: flex-end; padding: 0; }
    #cf-cs { max-width: none; max-height: 92vh; border-radius: 22px 22px 0 0; transform: translateY(100%); padding-bottom: env(safe-area-inset-bottom); }
    #cf-cs-bd.show #cf-cs { transform: none; }
    .cf-cs-head { padding-top: 20px; }
    .cf-cs-title { font-size: 19px; }
    .cf-cs-intro, .cf-cs-tabs, .cf-cs-body, .cf-cs-foot { padding-left: 18px; padding-right: 18px; }
    .cf-cs-accept { margin-left: 0; }
    .cf-cs-foot { gap: 8px; }
    .cf-cs-foot button { flex: 1 1 30%; padding: 13px 10px; }
    .cf-cs-cattitle { font-size: 15px; }
    .cf-cs-sw { width: 46px; height: 26px; }
    .cf-cs-sw::after { width: 20px; height: 20px; }
    .cf-cs-sw.on::after { transform: translateX(20px); }
}

/* ==========================================================================
   Футер главной
   ========================================================================== */
.cf-foot-link { color: #18181b; opacity: .82; transition: opacity .15s; }
.cf-foot-link:hover { opacity: 1; }
.cf-legal-link { color: #a1a1aa; transition: color .15s; }
.cf-legal-link:hover { color: #fff; }

/* ==========================================================================
   Мобильная нижняя панель (5 пунктов + центральная кнопка ✦) — как на скринах
   ========================================================================== */
.cf-tabbar { background: rgba(9,9,11,.94); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid rgba(255,255,255,.08); padding-bottom: env(safe-area-inset-bottom); }
.cf-tabbar-inner { display: flex; align-items: flex-end; justify-content: space-around; height: 60px; }
.cf-tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #71717a; font-size: 10px; font-weight: 600; padding: 7px 0; transition: color .15s; text-decoration: none; }
.cf-tab svg { width: 23px; height: 23px; }
.cf-tab.active { color: #fff; }
.cf-tab.active svg { color: #d946ef; filter: drop-shadow(0 0 6px rgba(217,70,239,.6)); }
.cf-tab:active { color: #fff; }
.cf-tab-fab { flex: 0 0 auto; width: 58px; height: 58px; margin: 0 4px; transform: translateY(-16px); border-radius: 20px; background: linear-gradient(135deg,#c026d3,#7c3aed); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(217,70,239,.5); border: 4px solid #09090b; cursor: pointer; transition: transform .15s; }
.cf-tab-fab:active { transform: translateY(-16px) scale(.93); }
.cf-tab-fab svg { width: 26px; height: 26px; color: #fff; }

/* ==========================================================================
   Мобильный «Create» лист (Image / Video)
   ========================================================================== */
#cf-gen-bd { position: fixed; inset: 0; z-index: 100001; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
#cf-gen-bd.show { opacity: 1; }
#cf-gen { width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: #0e0e12; border: 1px solid rgba(255,255,255,.1); border-radius: 24px 24px 0 0; box-shadow: 0 -20px 60px rgba(0,0,0,.7); transform: translateY(100%); transition: transform .3s cubic-bezier(.3,1,.4,1); padding-bottom: env(safe-area-inset-bottom); }
#cf-gen-bd.show #cf-gen { transform: none; }
@media (min-width: 640px) { #cf-gen-bd { align-items: center; } #cf-gen { border-radius: 24px; transform: translateY(20px) scale(.97); } #cf-gen-bd.show #cf-gen { transform: none; } }
.cf-gen-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 4px; }
.cf-gen-seg-wrap { flex: 1; display: flex; gap: 6px; background: rgba(255,255,255,.05); border-radius: 14px; padding: 4px; }
.cf-gen-seg { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px; border-radius: 10px; color: #a1a1aa; font-weight: 700; font-size: 14px; cursor: pointer; border: none; background: none; transition: .15s; }
.cf-gen-seg.active { background: linear-gradient(135deg,#c026d3,#7c3aed); color: #fff; box-shadow: 0 4px 14px rgba(217,70,239,.4); }
.cf-gen-x { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.06); color: #a1a1aa; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid rgba(255,255,255,.08); flex-shrink: 0; }
.cf-gen-x:hover { color: #fff; background: rgba(255,255,255,.12); }
.cf-gen-body { padding: 12px 16px 4px; overflow-y: auto; }
.cf-gen-field { background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 14px 16px; }
.cf-gen-field textarea { width: 100%; background: transparent; border: none; outline: none; color: #fff; font-size: 15px; line-height: 1.5; resize: none; font-family: inherit; }
.cf-gen-field textarea::placeholder { color: #6b6b76; }
.cf-gen-modelrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.cf-gen-modellbl { color: #8a8a94; font-size: 13px; }
.cf-gen-modelval { color: #fff; font-weight: 700; font-size: 14px; }
.cf-gen-enh { display: inline-flex; align-items: center; gap: 8px; color: #d4d4d8; font-size: 13px; font-weight: 600; cursor: pointer; }
.cf-gen-sw { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.12); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.cf-gen-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.cf-gen-sw:checked { background: linear-gradient(135deg,#c026d3,#7c3aed); border-color: transparent; }
.cf-gen-sw:checked::after { transform: translateX(16px); }
.cf-gen-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cf-gen-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); color: #d4d4d8; font-size: 12.5px; font-weight: 600; }
.cf-gen-go { margin: 14px 16px; padding: 15px; border-radius: 16px; background: linear-gradient(135deg,#c026d3,#7c3aed); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: none; box-shadow: 0 0 24px rgba(217,70,239,.4); transition: filter .15s, transform .1s; }
.cf-gen-go:active { transform: scale(.98); }
.cf-gen-go:hover { filter: brightness(1.1); }
.cf-gen-cost { font-weight: 800; }
