/* ============================================================
   AI Video — приложение генерации видео. Мобильный-first дизайн.
   Светлая и тёмная темы.
   ============================================================ */

/* ---------- Переменные тем ---------- */
:root {
    --bg: #eef0f2;
    --shell: #f4f5f6;
    --surface: #ffffff;
    --surface-2: #f6f7f8;
    --surface-3: #eceef1;
    --text: #16181d;
    --text-2: #4b515b;
    /* Было #8b919c — давало контраст 2.9 на светлых подложках (ниже WCAG AA) */
    --muted: #5d6673;
    --border: #e8eaee;
    --border-2: #dfe2e7;

    --accent: #ff5a2c;
    --accent-2: #ff7a3d;
    --accent-soft: #ffece5;
    --accent-text: #d9430f;
    /* Тёмный акцент для мелкого текста: на светлом фоне даёт контраст 5:1 */
    --accent-ink: #b0380b;

    --purple: #6c4ce0;
    --purple-2: #8f7bf3;
    --purple-soft: #efeaff;
    --gold: #f6d67e;

    --green: #19a974;
    --green-soft: #e2f7ee;
    --red: #e5484d;
    --red-soft: #fdeaea;
    --blue: #3b82f6;
    --blue-soft: #e8f1ff;

    --hero-1: #0c8079;
    --hero-2: #07343a;

    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(16, 20, 30, .05);
    --shadow-md: 0 6px 20px rgba(16, 20, 30, .08);
    --shadow-lg: 0 18px 46px rgba(16, 20, 30, .16);
    --shell-w: 480px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
    --bg: #0b0c10;
    --shell: #101218;
    --surface: #171922;
    --surface-2: #1d2029;
    --surface-3: #242833;
    --text: #f1f3f7;
    --text-2: #c3c8d2;
    --muted: #8d94a1;
    --border: #252934;
    --border-2: #2e333f;

    --accent: #ff6a3d;
    --accent-2: #ff8a55;
    --accent-soft: #2c1b14;
    --accent-text: #ff8a5f;
    --accent-ink: #ff8a5f;

    --purple: #8f7bf3;
    --purple-2: #a596f7;
    --purple-soft: #221d3a;

    --green-soft: #12271f;
    --red-soft: #2c1618;
    --blue-soft: #16233a;

    --hero-1: #0a6d68;
    --hero-2: #05272c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 22px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* ---------- Базовые стили ---------- */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.45;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
svg { display: block; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }

::selection { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Скроллбар в стиле сайта ---------- */
html, body, .gen-drop, .sheet-body, .textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.gen-drop::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.textarea::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.gen-drop::-webkit-scrollbar-track,
.sheet-body::-webkit-scrollbar-track,
.textarea::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.gen-drop::-webkit-scrollbar-thumb,
.sheet-body::-webkit-scrollbar-thumb,
.textarea::-webkit-scrollbar-thumb {
    background: var(--border-2); border-radius: 999px;
    border: 2px solid transparent; background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.gen-drop::-webkit-scrollbar-thumb:hover,
.sheet-body::-webkit-scrollbar-thumb:hover,
.textarea::-webkit-scrollbar-thumb:hover {
    background: var(--muted); background-clip: padding-box;
}

/* ---------- Каркас приложения ---------- */
.app-shell {
    width: 100%;
    max-width: var(--shell-w);
    margin: 0 auto;
    min-height: 100vh;
    /* мобильные браузеры: высота по видимой области */
    min-height: 100dvh;
    background: var(--shell);
    position: relative;
    display: flex;
    flex-direction: column;
    /* Нижний отступ держит сам подвал — иначе под ним видна полоса фона оболочки */
    padding-bottom: 0;
    box-shadow: 0 0 0 1px var(--border);
}

.app-main {
    flex: 1;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Топбар ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--shell) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 6px; margin: -6px; }

.brand-mark {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; overflow: hidden; }
.brand-text b { font-size: 15px; font-weight: 800; white-space: nowrap; }
/* Подпись оранжевая: одна строка, в тесной шапке аккуратно обрезается, а не наезжает на иконки */
.brand-text small {
    font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 7px; }

.balance-chip {
    font-size: 12.5px; font-weight: 800;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.icon-btn {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    transition: transform .12s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn--accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent; color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.icon-btn--out { color: var(--text-2); }
.icon-btn--out:hover {
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 40%, transparent);
    background: var(--red-soft);
}
.icon-btn.is-active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    background: var(--accent-soft);
}

/* Переключатель темы: показываем нужную иконку */
.theme-ic { display: none; }
html[data-theme="light"] .theme-ic--moon { display: block; }
html[data-theme="dark"]  .theme-ic--sun  { display: block; }

/* ---------- Заголовки секций ---------- */
.section { display: flex; flex-direction: column; gap: 12px; }

.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
}
.section-title { font-size: 21px; display: flex; align-items: center; gap: 7px; }
.section-title .fire { color: var(--accent); }
.section-link {
    font-size: 13px; font-weight: 700; color: var(--accent);
    display: inline-flex; align-items: center; gap: 3px;
}
.section-link .count {
    font-size: 11px; font-weight: 800; color: var(--muted);
    background: var(--surface-3); border-radius: 999px; padding: 2px 7px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    border-radius: var(--radius-xl);
    padding: 20px 18px 18px;
    background:
        radial-gradient(120% 130% at 88% 8%, rgba(255, 255, 255, .16), transparent 45%),
        linear-gradient(148deg, var(--hero-1), var(--hero-2));
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.hero-art {
    position: absolute;
    right: -6px; bottom: 62px;
    font-size: 108px;
    line-height: 1;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35));
    transform: rotate(-6deg);
    pointer-events: none;
    user-select: none;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #f3efff;
    margin-bottom: 12px;
}
.hero-title {
    font-size: 44px; line-height: .96; font-weight: 900; letter-spacing: -.02em;
    text-transform: uppercase;
    margin-bottom: 10px;
    max-width: 74%;
}
.hero-title .accent { color: var(--gold); display: block; }
.hero-text {
    font-size: 14.5px; color: rgba(255, 255, 255, .82);
    max-width: 70%; white-space: pre-line; margin-bottom: 18px;
}
.hero-cta {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%;
    padding: 15px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffe9b0, var(--gold));
    color: #3a2a00; font-weight: 800; font-size: 14.5px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
    transition: transform .12s ease;
}
.hero-cta:active { transform: scale(.985); }

/* ---------- Быстрый старт ---------- */
/* Три формата на всю ширину колонки: одинаковые карточки в один ряд.
   width: 100% обязателен — иначе во flex-колонке сетка сжимается по контенту. */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: none;
    margin: 0;
}
/* Планшет: две колонки, третья карточка — во всю ширину (без «дырки» в ряду) */
@media (max-width: 820px) {
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .quick-card:last-child { grid-column: 1 / -1; }
}
/* Телефон: в столбик */
@media (max-width: 560px) {
    .quick-grid { grid-template-columns: 1fr; }
    .quick-card:last-child { grid-column: auto; }
}
.quick-card {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    padding: 13px 13px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .18s ease;
}
.quick-card:active { transform: scale(.98); }
.quick-ic {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-text);
}
.quick-ic--purple { background: var(--purple-soft); color: var(--purple); }
.quick-ic--blue   { background: var(--blue-soft);   color: var(--blue); }
.quick-ic--green  { background: var(--green-soft);  color: var(--green); }
.quick-card h3 { font-size: 15px; font-weight: 800; }
.quick-card p  { font-size: 12px; color: var(--muted); }
.quick-card .chev {
    position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
    color: var(--muted); opacity: .8;
}

/* ---------- Тренды ---------- */
.trend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.trend-card {
    display: block;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 9 / 16;
    background: var(--surface-3);
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease;
}
.trend-card:active { transform: scale(.98); }
/* Превью карточек: кадр целиком, а поля вокруг заполняет размытая копия
   того же кадра (ambient), без чёрных прямоугольников */
.trend-card img, .trend-card video, .trend-card .poster-fallback {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; object-position: center;
}
.trend-card video { background: transparent; }
.trend-amb {
    position: absolute; inset: -14%; z-index: 0;
    background-size: cover; background-position: center;
    filter: blur(14px) saturate(1.35) brightness(.82);
    transform: scale(1.08);
    pointer-events: none;
}

/* Превью-кадры: анимация из картинок вместо видео (грузится в разы быстрее) */
.media-flip {
    position: absolute; inset: 0; display: block; overflow: hidden;
    background: transparent;
}
.media-flip .media-flip-img,
.media-flip img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; object-position: center; display: block;
}

/* ---------- Карусель трендов (главная) ---------- */
.trend-rail-wrap { position: relative; }
.trend-rail {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.trend-rail::-webkit-scrollbar { display: none; }
.trend-page {
    flex: 0 0 100%;
    min-width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
@media (min-width: 560px) {
    .trend-page { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.trend-controls { margin-top: 12px; }
.trend-controls .pager-label { font-size: 12.5px; color: var(--muted); }
.trend-controls .pager-label b { color: var(--text); font-weight: 700; }

/* ---------- Страница тренда: пример результата ---------- */
.trend-showcase {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-3);
    aspect-ratio: 4 / 5;
    max-height: 62vh;
    box-shadow: var(--shadow-sm);
}
.trend-showcase::before {
    content: '';
    position: absolute; inset: -10%;
    background-image: var(--showcase-bg, none);
    background-size: cover;
    background-position: center;
    filter: blur(24px) saturate(1.15);
    opacity: .5;
    pointer-events: none;
}
.trend-showcase-media {
    position: relative;
    width: 100%; height: 100%; display: block; object-fit: contain;
}
.trend-showcase-tag {
    position: absolute; left: 10px; bottom: 10px; z-index: 2;
    font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: #fff; padding: 5px 9px; border-radius: 8px;
    background: rgba(20, 22, 28, .55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
@media (min-width: 900px) {
    .trend-showcase:not(.trend-showcase--video) { aspect-ratio: 16 / 10; }
}

/* ---------- Пример результата: видео 9:16 слева, описание справа ---------- */
.trend-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.trend-intro-media { min-width: 0; }
.trend-intro-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.trend-showcase--video {
    aspect-ratio: 9 / 16;
    max-height: none;
    width: min(100%, 300px);
    margin-left: auto; margin-right: auto;
    background: #000;
}/* Как у конкурента: ролик вписан в вертикальную рамку 9:16 целиком,
   а поля сверху и снизу заполняет его же размытая копия (ambient) */
.trend-showcase--video::before {
    inset: -14%;
    filter: blur(34px) saturate(1.3) brightness(.62);
    opacity: 1;
    transform: scale(1.1);
}
.trend-showcase--video .trend-showcase-media {
    object-fit: contain;
    object-position: center;
    background: transparent;
}
.trend-showcase--video .trend-showcase-tag { top: 10px; bottom: auto; }
@media (min-width: 720px) {
    .trend-intro { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 22px; align-items: start; }
    .trend-intro--solo { display: block; }
    .trend-intro-media .trend-showcase--video { margin-left: 0; margin-right: 0; }
    .trend-intro-media .trend-showcase:not(.trend-showcase--video) { aspect-ratio: 3 / 4; max-height: none; margin: 0; }
}
@media (min-width: 900px) {
    .trend-intro { grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 26px; }
    .trend-intro-media .trend-showcase:not(.trend-showcase--video) { aspect-ratio: 4 / 5; }
}

/* ---------- Полный экран плеера ---------- */
.trend-showcase:fullscreen,
.trend-showcase:fullscreen .trend-showcase-media {
    width: 100%; height: 100%;
    max-width: none; max-height: none;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    background: #000;
}
.trend-showcase:fullscreen .trend-showcase-tag { display: none; }
.trend-showcase:fullscreen .showcase-bar { padding: 44px 20px 18px; gap: 12px; }
.trend-showcase:fullscreen .showcase-ic { width: 42px; height: 42px; }
.trend-showcase:fullscreen .showcase-vol-wrap { flex-basis: 96px; }
.trend-showcase:fullscreen .showcase-time { font-size: 13px; min-width: 36px; }
.trend-showcase:-webkit-full-screen,
.trend-showcase:-webkit-full-screen .trend-showcase-media {
    width: 100%; height: 100%;
    max-width: none; max-height: none;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    background: #000;
}
.trend-showcase:-webkit-full-screen .trend-showcase-tag { display: none; }
.trend-showcase:-webkit-full-screen .showcase-bar { padding: 44px 20px 18px; gap: 12px; }
.trend-showcase:-webkit-full-screen .showcase-ic { width: 42px; height: 42px; }
.trend-showcase:-webkit-full-screen .showcase-vol-wrap { flex-basis: 96px; }
.trend-showcase:-webkit-full-screen .showcase-time { font-size: 13px; min-width: 36px; }

/* Кнопка play/pause по центру */
.showcase-big {
    position: absolute; inset: 0; z-index: 3;
    display: grid; place-items: center;
    border: 0; padding: 0; background: transparent; color: #fff; cursor: pointer;
    transition: opacity .18s ease;
}
.showcase-big > span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 62px; height: 62px; border-radius: 50%;
    background: rgba(14, 16, 22, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.trend-showcase--video.is-playing .showcase-big { opacity: 0; pointer-events: none; }
@media (hover: hover) {
    .trend-showcase--video.is-playing:hover .showcase-big { opacity: 1; pointer-events: auto; }
}

/* Панель управления */
.showcase-bar {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
    display: flex; align-items: center; gap: 6px;
    padding: 30px 10px 10px;
    background: linear-gradient(180deg, rgba(8, 10, 14, 0) 0%, rgba(8, 10, 14, .72) 55%, rgba(8, 10, 14, .86) 100%);
    color: #fff;
}
.showcase-ic {
    flex: 0 0 auto; width: 30px; height: 30px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: #fff;
    transition: background .15s ease;
}
.showcase-ic:hover { background: rgba(255, 255, 255, .26); }
.showcase-big > span,
.showcase-ic > span { display: inline-flex; align-items: center; justify-content: center; }
.showcase-big .ic-pause,
.showcase-ic .ic-pause { display: none; }
/* Звук: is-off = звук выключен (показываем перечёркнутый динамик) */
.showcase-ic .ic-vol { display: none; }
.showcase-ic:not(.is-off) .ic-mute { display: none; }
.showcase-ic:not(.is-off) .ic-vol { display: inline-flex; }
/* Полный экран */
.showcase-ic .ic-exit { display: none; }
.trend-showcase--video.is-full .showcase-ic .ic-full { display: none; }
.trend-showcase--video.is-full .showcase-ic .ic-exit { display: inline-flex; }
.trend-showcase--video.is-playing .showcase-big .ic-play,
.trend-showcase--video.is-playing .showcase-ic .ic-play { display: none; }
.trend-showcase--video.is-playing .showcase-big .ic-pause,
.trend-showcase--video.is-playing .showcase-ic .ic-pause { display: inline-flex; }

.showcase-time {
    flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .01em;
    color: rgba(255, 255, 255, .88); font-variant-numeric: tabular-nums;
    min-width: 26px; text-align: center;
}
.showcase-bar input[type="range"] {
    -webkit-appearance: none; appearance: none;
    background: transparent; cursor: pointer; margin: 0;
    height: 14px;
}
.showcase-bar input[type="range"]::-webkit-slider-runnable-track {
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3);
}
.showcase-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.showcase-bar input[type="range"]::-moz-range-track {
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3);
}
.showcase-bar input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff;
}
/* Громкость: своя дорожка + белая заливка слева */
.showcase-vol-wrap {
    position: relative; flex: 0 1 40px; min-width: 34px;
    display: flex; align-items: center; height: 18px;
}
.showcase-vol-wrap::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3);
}
.showcase-vol-fill {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 0; height: 4px; border-radius: 999px; background: #fff;
    pointer-events: none;
}
.showcase-bar input.showcase-vol-range {
    position: relative; z-index: 1;
    width: 100%; margin: 0; height: 18px;
    background: transparent; border: 0;
}
.showcase-bar input.showcase-vol-range::-webkit-slider-runnable-track {
    background: transparent; height: 4px; border-radius: 999px;
}
.showcase-bar input.showcase-vol-range::-moz-range-track {
    background: transparent; height: 4px; border-radius: 999px;
}
/* Полоса позиции: своя дорожка + заливка слева, заполняется и при перетаскивании */
.showcase-seek-wrap {
    position: relative; flex: 1 1 60px; min-width: 26px;
    display: flex; align-items: center; height: 18px;
}
.showcase-seek-wrap::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
    height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .3);
}
.showcase-seek-fill {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 0; height: 4px; border-radius: 999px; background: var(--accent);
    pointer-events: none;
}
.showcase-bar input.showcase-seek {
    position: relative; z-index: 1;
    width: 100%; margin: 0; height: 18px;
    background: transparent; border: 0;
}
.showcase-bar input.showcase-seek::-webkit-slider-runnable-track {
    background: transparent; height: 4px; border-radius: 999px;
}
.showcase-bar input.showcase-seek::-moz-range-track {
    background: transparent; height: 4px; border-radius: 999px;
}
@media (max-width: 420px) {
    .showcase-bar { gap: 5px; padding: 26px 8px 10px; }
    .showcase-vol-wrap { flex-basis: 38px; }
}
@media (max-width: 359px) {
    .showcase-time[data-showcase-cur] { display: none; }
}
/* Планшет: плеер уже, панель компактнее, текущее время скрываем */
@media (min-width: 720px) and (max-width: 899.98px) {
    .showcase-bar { gap: 5px; padding: 26px 8px 10px; }
    .showcase-vol-wrap { flex-basis: 38px; }
    .showcase-time[data-showcase-cur] { display: none; }
}
.poster-fallback { display: grid; place-items: center; }
.poster-emoji { font-size: 46px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.28)); }
.trend-media-blur { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.68)); }
.trend-top {
    position: absolute; top: 9px; left: 9px; right: 50px; z-index: 2;
    display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 6px;
}
.trend-badge, .trend-hot, .trend-new { flex: none; }
.trend-badge {
    font-size: 10px; font-weight: 800; letter-spacing: .04em;
    padding: 4px 7px; border-radius: 7px;
    background: rgba(20, 22, 28, .55);
    backdrop-filter: blur(4px);
    color: #fff; text-transform: uppercase;
}
.trend-wrap { position: relative; display: block; width: 100%; }
.trend-fav {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    width: 36px; height: 36px; border-radius: 999px; border: 0;
    display: grid; place-items: center;
    background: rgba(20, 22, 28, .5); color: #fff;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    transition: background .15s ease, transform .12s ease;
}
.trend-fav:active { transform: scale(.92); }
.trend-fav.is-on {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.trend-title {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 10px 11px;
    font-size: 14.5px; font-weight: 800; color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
    line-height: 1.2;
}
.trend-card--featured .trend-badge { background: var(--accent); }
.trend-card--photo .trend-badge { background: var(--purple); }
.trend-card--music .trend-badge { background: var(--blue); }
.trend-hot {
    font-size: 10px; font-weight: 900; letter-spacing: .04em;
    padding: 4px 7px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; text-transform: uppercase;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
/* «Новинка»: тренд добавлен меньше трёх дней назад (считается в trend_card) */
.trend-new {
    flex: none;
    font-size: 10px; font-weight: 900; letter-spacing: .04em;
    padding: 4px 7px; border-radius: 7px;
    background: linear-gradient(135deg, #24b47e, #17905f);
    color: #fff; text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(25, 169, 116, .38);
}
.trend-uses {
    font-size: 10px; font-weight: 700; color: #fff;
    background: rgba(20,22,28,.5); padding: 4px 7px; border-radius: 7px;
    display: inline-flex; align-items: center; gap: 3px;
}
/* Выключенный тренд: карточку и страницу видит только администратор */
.trend-off {
    font-size: 10px; font-weight: 900; letter-spacing: .05em;
    padding: 4px 8px; border-radius: 7px;
    background: rgba(20, 22, 28, .78);
    color: #ffd7a8; text-transform: uppercase;
    border: 1px solid rgba(255, 190, 120, .55);
}
.preview-note {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 0 0 12px;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid rgba(255, 190, 120, .5);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-size: 12.5px; line-height: 1.45; color: var(--text);
}
.preview-note svg { flex: none; margin-top: 1px; color: var(--accent); }
.preview-note b { font-weight: 800; }

/* ---------- Пагинация ---------- */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 2px;
}
.pager-label { font-size: 12.5px; color: var(--muted); }
.pager-label b { color: var(--text); font-weight: 700; }
.pager-actions { display: flex; gap: 8px; }
.pager-btn {
    width: 44px; height: 44px; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border-2);
    color: var(--text);
}
.pager-btn--accent { background: var(--accent); border-color: transparent; color: #fff; }
.pager-btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Мои работы ---------- */
.work-list { display: flex; flex-direction: column; gap: 10px; }
.work-card {
    display: flex; gap: 12px; align-items: center;
    padding: 11px;
    border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.work-thumb {
    width: 62px; height: 62px; flex: none; border-radius: var(--radius-sm);
    overflow: hidden; position: relative; background: var(--surface-3);
    display: grid; place-items: center;
}
.work-thumb img, .work-thumb video { width: 100%; height: 100%; object-fit: cover; }
.work-thumb .poster-emoji { font-size: 26px; }
.work-body { min-width: 0; flex: 1; }
.work-body h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.work-empty {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text-2);
}
.work-empty .quick-ic { flex: none; }

/* ---------- Подвал сайта ---------- */
.app-footer {
    display: flex; flex-direction: column; gap: 12px;
    margin-top: 6px;
    padding: 16px 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.footer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.footer-brand .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
.footer-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; overflow: hidden; }
.footer-brand-text b { font-size: 13.5px; font-weight: 800; }
/* Подпись бренда оранжевая, но тёмным акцентом: светлый #ff5a2c не проходит по контрасту */
    .footer-brand-text small {
        font-size: 11px; color: var(--accent-ink); font-weight: 700; letter-spacing: .02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.footer-links a {
    font-size: 12.5px; color: var(--text-2); font-weight: 600;
    display: inline-flex; align-items: center; gap: 5px;
}
/* Иконка идёт в цвет текста, а при наведении оранжевым становится всё вместе */
.footer-links a svg { color: currentColor; }
.footer-links a:hover,
.footer-links a:hover svg { color: var(--accent); }
.footer-support-n {
    min-width: 18px; padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 800; text-align: center;
}
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding-top: 10px; border-top: 1px solid var(--border);
    font-size: 11.5px; color: var(--muted);
}
.footer-note { text-align: right; }

@media (min-width: 640px) {
    .app-footer { padding: 20px 20px 22px; gap: 14px; }
    .footer-links { gap: 10px 20px; }
    .footer-bottom { font-size: 12px; }
}

/* ---------- Навигация в шапке (иконки) ---------- */
/* Оболочка до 640px узкая (480px), поэтому и шапка тут компактная:
   иначе подпись бренда не влезает рядом с иконками */
@media (max-width: 639px) {
    .topbar { padding: 10px 12px; gap: 8px; }
    .topbar-actions { gap: 4px; }
    .topbar .icon-btn { width: 32px; height: 32px; }
    .balance-chip { padding: 6px 9px; font-size: 12px; }
    .brand { gap: 7px; }
    .brand .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
    .brand-text small { font-size: 9px; letter-spacing: 0; }
}
@media (max-width: 480px) {
    /* На телефоне места на подпись уже нет — остаётся только название */
    .brand-text { display: none; }
}
@media (max-width: 360px) {
    #themeToggle { display: none; }
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    font-weight: 700; font-size: 14px;
    transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent; color: #fff;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-dark { background: var(--text); border-color: transparent; color: var(--shell); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover {
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { padding: 15px 20px; font-size: 15px; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%;
    padding: 12px 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.select { appearance: none; background-image: none; }

/* ---------- Выбор соотношения сторон: рисунки-плитки ---------- */
.asp-ic { display: block; flex: none; }
.aspect-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.aspect-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 62px;
    padding: 8px 9px 7px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.15;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.aspect-tile span { white-space: nowrap; }
.aspect-tile:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.aspect-tile.is-active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.aspect-tile:disabled { cursor: default; opacity: .55; }
.aspect-picker.is-locked .aspect-tile.is-active { opacity: 1; }
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex; flex-direction: column; gap: 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 11.5px; color: var(--muted); }
.hint-disclaimer { margin-top: 6px; text-align: center; font-size: 11px; color: var(--muted); }
.alert {
    padding: 11px 13px;
    border-radius: var(--radius-md);
    font-size: 13.5px; font-weight: 600;
    border: 1px solid transparent;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert-text { flex: 1 1 auto; min-width: 0; line-height: 1.45; white-space: pre-line; }
.alert-close {
    flex: none; appearance: none; -webkit-appearance: none;
    background: transparent; border: 0; cursor: pointer;
    color: inherit; opacity: .55;
    font: inherit; font-size: 19px; line-height: 1;
    padding: 0 2px; margin: -3px -3px 0 0;
    border-radius: 6px;
}
.alert-close:hover, .alert-close:focus-visible { opacity: 1; }

/* Ожидание отправки формы: спиннер в кнопке + плашка внизу экрана */
.form-card.is-busy { pointer-events: none; }
.form-card.is-busy::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    pointer-events: none;
}
.form-busy {
    position: fixed; left: 50%; top: 50%; z-index: 90;
    transform: translate(-50%, -50%);
    display: flex; align-items: center; gap: 14px;
    padding: 16px 20px 16px 18px; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--border-2);
    box-shadow: 0 18px 44px rgba(16, 20, 30, .28);
    max-width: min(440px, calc(100vw - 28px));
    animation: busyIn .18s ease both;
}
@keyframes busyIn {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
.form-busy-box { flex: 1 1 auto; min-width: 0; }
.form-busy-box strong { display: block; font-size: 14px; }
.form-busy-box [data-busy-note] {
    display: block; margin-top: 3px;
    font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.45;
}
/* Анимированное кольцо ожидания: градиент с плавным дыханием свечения */
.busy-spin {
    position: relative; flex: none;
    width: 40px; height: 40px;
    display: grid; place-items: center;
}
.busy-spin::before {
    content: ""; position: absolute; inset: -7px;
    border-radius: 999px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
    opacity: .16;
    animation: busyGlow 1.8s ease-in-out infinite;
}
/* Светлая дорожка, чтобы кольцо читалось и в тёмной теме */
.busy-spin::after {
    content: ""; position: absolute; inset: 3px;
    border-radius: 999px;
    border: 4px solid color-mix(in srgb, var(--accent) 14%, transparent);
}
.busy-spin-ring {
    position: relative; z-index: 1;
    width: 34px; height: 34px; border-radius: 999px;
    background: conic-gradient(from 0turn,
        transparent 0turn,
        color-mix(in srgb, var(--accent) 35%, transparent) .60turn,
        var(--accent) .86turn,
        var(--accent-2) .98turn,
        transparent 1turn);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4.5px), #000 calc(100% - 4px));
    animation: spin .85s linear infinite;
    will-change: transform;
}
@keyframes busyGlow {
    0%, 100% { transform: scale(.82); opacity: .14; }
    50%      { transform: scale(1.06); opacity: .3; }
}
@media (prefers-reduced-motion: reduce) {
    .busy-spin::before, .busy-spin-ring, .form-busy, .btn-spin { animation-duration: 2.6s; }
}
.btn-spin {
    display: inline-block; width: 14px; height: 14px;
    border-radius: 999px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    animation: spin .8s linear infinite;
    vertical-align: -2px; margin-right: 7px;
}
.alert-error   { background: var(--red-soft);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-success { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-warn    { background: var(--accent-soft);color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.alert-info    { background: var(--blue-soft);  color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
/* Баннер «подтвердите e-mail»: иконка + текст + кнопка в одну строку */
.email-verify-note { align-items: center; gap: 8px; }
.email-verify-ic { display: inline-flex; flex: none; opacity: .85; }
.email-verify-text { flex: 1 1 auto; min-width: 0; }
.email-verify-form { margin: 0; flex: none; }
.email-verify-note .btn { flex: none; color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); }
@media (max-width: 560px) {
    .email-verify-note { flex-wrap: wrap; }
    .email-verify-text { flex: 1 1 100%; }
    .email-verify-form { flex: 1 1 100%; margin-left: 24px; }
    .email-verify-form .btn { width: 100%; justify-content: center; }
}

/* Переключатель (чекбокс) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch span { font-size: 13.5px; font-weight: 600; }
/* Запертая галочка (например звук, который всегда берётся из видео-исходника) */
.switch input:disabled { opacity: .55; cursor: not-allowed; }
.switch input:disabled:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3);
    border: 1px solid var(--border-2); position: relative; transition: background .18s ease; flex: none; }
.switch input::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s ease;
}
.switch input:checked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- Бейджи статусов ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700;
    padding: 4px 9px; border-radius: 999px;
}
.badge-pending, .badge-queued { background: var(--surface-3); color: var(--text-2); }
.badge-in_progress, .badge-processing { background: var(--blue-soft); color: var(--blue); }
.badge-completed { background: var(--green-soft); color: var(--green); }
.badge-failed, .badge-cancelled, .badge-expired { background: var(--red-soft); color: var(--red); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
/* Пользователь без подтверждённого e-mail (админка → Пользователи) */
.badge-unverified { background: color-mix(in srgb, #f0a428 20%, transparent); color: #8a5a05; }
/* Плашка-иконка «e-mail не подтверждён» в админке: красный конверт без подложки */
.badge-ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; flex: none;
    margin-left: 6px; vertical-align: -3px;
    background: none; color: var(--red);
}
.badge-ic svg { width: 17px; height: 17px; stroke-width: 2.6; }
/* В строке адреса почты иконка мельче — она стоит рядом с текстом 12 px */
.user-mail .badge-ic { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; }
.user-mail .badge-ic svg { width: 14px; height: 14px; stroke-width: 2.6; }
.badge-ic--warn { color: var(--red); }
.badge-ic--warn:hover { color: color-mix(in srgb, var(--red) 75%, #000); }
/* Сортировка по клику на заголовок таблицы */
.tbl th a.tbl-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.tbl th a.tbl-sort:hover { color: var(--accent-text); text-decoration: underline; }
.tbl th a.tbl-sort.is-active { color: var(--accent-text); }
/* Заблокированные пользователи в админке */
.badge-blocked { background: var(--red-soft); color: var(--red); }
.tbl tr.row-blocked > td { background: color-mix(in srgb, var(--red) 6%, transparent); }
.tbl tr.row-online > td { background: color-mix(in srgb, var(--green) 7%, transparent); }
.tbl tr.row-online.row-blocked > td { background: color-mix(in srgb, var(--red) 6%, transparent); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }

/* ---------- Страница задачи ---------- */
.task-stage {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0c0d11;
    aspect-ratio: 9 / 14;
    display: grid; place-items: center;
    position: relative;
    color: #fff;
}
.task-stage video, .task-stage img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-state { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 26px; }
.stage-note {
    display: flex; align-items: flex-start; gap: 8px; max-width: 340px;
    margin-top: 4px; padding: 10px 12px; border-radius: var(--radius-md);
    background: var(--surface-2); border: 1px solid var(--border-2);
    font-size: 12px; line-height: 1.45; color: var(--text-2); text-align: left;
}
.stage-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.stage-note a { color: var(--accent); text-decoration: none; }
.stage-note a:hover { text-decoration: underline; }
.stage-error-head {
    font-size: 15px; font-weight: 700; color: var(--accent);
}
.stage-error-text {
    font-size: 13.5px; line-height: 1.55; font-weight: 500;
    max-width: 420px; opacity: .92;
}
/* Подсветка сообщения, к которому прокрутили автоматически */
@keyframes msgFlash {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
    40%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 36%, transparent); }
}
.is-flash { animation: msgFlash .9s ease-out 2; border-radius: 14px; }
.spinner {
    width: 42px; height: 42px; border-radius: 999px;
    border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-track { width: 180px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; }
.progress-bar { height: 100%; width: 35%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
    animation: indeterminate 1.4s ease-in-out infinite; }
@keyframes indeterminate { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

.kv { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 700; text-align: right; }

/* ---------- Профиль ---------- */
.profile-head {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; border-radius: var(--radius-lg);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.avatar {
    width: 62px; height: 62px; flex: none; border-radius: 999px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: #fff; font-weight: 800; font-size: 24px;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h2 { font-size: 18px; }
.profile-head p { font-size: 13px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card {
    padding: 14px 12px; border-radius: var(--radius-md);
    background: var(--surface); border: 1px solid var(--border); text-align: center;
}
.stat-card b { display: block; font-size: 19px; font-weight: 800; }
.stat-card span { font-size: 11px; color: var(--muted); }
.list-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.list-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600;
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-ic { color: var(--muted); }
.list-row .lr-value { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }

/* Кнопки-действия в строках списка (профиль): «Открыть», «Переключить», «Выйти» */
.list-row .lr-btn {
    margin-left: auto;
    flex: none;
    color: var(--text);
    border-radius: 999px;
    padding: 8px 13px;
}
.list-row .lr-btn svg { color: var(--accent); opacity: .9; }
.list-row .lr-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    background: var(--accent-soft);
}
.list-row .lr-btn--out:hover {
    border-color: color-mix(in srgb, var(--red) 40%, transparent);
    background: var(--red-soft);
    color: var(--red);
}
.list-row .lr-btn--out:hover svg { color: var(--red); }
@media (max-width: 480px) {
    .list-row { gap: 10px; padding: 13px 14px; }
    .list-row .lr-btn { padding: 7px 11px; font-size: 12px; }
    /* На узких экранах значок роли и длинный e-mail выталкивают карточку вправо —
       разрешаем блоку сжать текст и перенести ролю на вторую строку */
    .profile-head { flex-wrap: wrap; }
    .profile-head > div { flex: 1 1 150px; min-width: 0; }
    .profile-head h2, .profile-head p { overflow-wrap: anywhere; }
    .profile-head .badge { flex: none; }
}

/* ---------- Вкладки профиля ---------- */
/* Панель разделов: у каждого блока своя вкладка, страница не превращается в «простыню» */
.seg--scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.seg--scroll::-webkit-scrollbar { display: none; }
.seg--scroll .seg-tab { flex: 0 0 auto; }
.tab-panels { display: flex; flex-direction: column; gap: 12px; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Прочее ---------- */
.page-title { font-size: 24px; font-weight: 900; }
.page-sub { font-size: 13.5px; color: var(--muted); }
.empty-note {
    text-align: center; padding: 26px 16px; color: var(--muted); font-size: 13.5px;
    background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius-lg);
}
.auth-wrap { max-width: 420px; width: 100%; margin: 8px auto 0; display: flex; flex-direction: column; gap: 16px; }
.auth-head { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.auth-head .brand-mark { width: 52px; height: 52px; border-radius: 16px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }

/* Вход через соцсети */
.social-login { display: flex; flex-direction: column; gap: 10px; }
.social-divider { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.social-divider::before,
.social-divider::after { content: ''; height: 1px; flex: 1; background: var(--border); }
/* Кнопки центрируются: если включён один провайдер, он встаёт по центру, а не слева */
.social-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.social-btn {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    flex: 1 1 104px; max-width: 190px;
    min-height: 40px; padding: 8px 8px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-weight: 700; font-size: 12.5px; line-height: 1; white-space: nowrap;
    transition: border-color .15s, background .15s;
}
.social-btn:hover { border-color: var(--border-2); background: var(--surface-2); }
.social-mark {
    width: 22px; height: 22px; flex: none; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 800; letter-spacing: -.02em; color: #fff;
}
.social-mark--vk { background: #0077ff; }
.social-mark--ya { background: #fc3f1d; font-size: 13px; }
.social-mark--tg { background: #2aabee; }
.social-mark--tg svg { stroke-width: 2; }

/* Строка «провайдер · @ник · дата» в карточке входа: логотип слева от текста, по центру строки */
.social-line { display: flex; align-items: center; gap: 7px; }
.social-line > .social-mark { flex: none; width: 18px; height: 18px; border-radius: 6px; font-size: 8.5px; }
.social-line > .social-mark--ya { font-size: 11px; }
.social-line > span:last-child { flex: 1 1 auto; min-width: 0; }

@media (max-width: 360px) {
    .social-btn { font-size: 11.5px; gap: 6px; padding: 7px 5px; }
    .social-mark { width: 20px; height: 20px; }
}

/* ---------- Сайт на реконструкции ---------- */
.maint-body {
    min-height: 100vh; min-height: 100dvh; margin: 0; padding: 24px;
    display: grid; place-items: center;
    background: var(--bg); color: var(--text);
}
.maint-card {
    width: min(440px, 100%); text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 36px 28px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 22px; box-shadow: var(--shadow-lg);
}
.maint-card .brand-mark {
    width: 54px; height: 54px; border-radius: 17px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.maint-card h1 { margin: 0; font-size: 24px; font-weight: 900; }
.maint-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.maint-card .maint-sub { font-size: 12.5px; color: var(--muted); }
.maint-login { margin-top: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
/* Пояснение под переключателем режимов на странице изображений */
.gen-mode-note { display: block; margin: 8px 2px 0; line-height: 1.4; }
.chip {
    font-size: 12.5px; font-weight: 700; padding: 8px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
    cursor: pointer; transition: all .14s ease;
}
.chip.is-active { background: var(--text); color: var(--shell); border-color: transparent; }
/* Плашки характеристик ролика (длительность, пропорции, качество, звук, время) —
   пилюля с иконкой, как у конкурентов */
.chip-row--specs { gap: 6px; }
.chip.chip--spec {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 700; padding: 4px 9px;
    background: var(--surface-2); border-color: var(--border);
    color: var(--text-2); white-space: nowrap;
}
.chip.chip--spec svg { width: 12px; height: 12px; flex: none; opacity: .75; }
/* Рисунок формата в плашке: рамка кадра в его пропорциях */
.chip.chip--spec .chip-asp { display: inline-flex; align-items: center; }
.chip.chip--spec .chip-asp-ic { width: 14px; height: 14px; opacity: .9; }

/* ---------- Крупные вкладки-сегменты (как в приложении-источнике) ---------- */
.trends-top { display: flex; flex-direction: column; gap: 4px; }
.trends-top .page-sub { font-size: 13px; }
.seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.seg-tab {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.seg-tab svg { flex: none; opacity: .85; }
.seg-tab .seg-lbl { overflow: hidden; text-overflow: ellipsis; }
.seg-tab .seg-n {
    flex: none;
    font-size: 12px; font-weight: 700;
    color: var(--muted);
    background: var(--surface-3);
    border-radius: 8px;
    padding: 2px 7px;
}
.seg-tab:active { transform: scale(.985); }
.seg-tab.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.seg-tab.is-active svg { opacity: 1; }
.seg-tab.is-active .seg-n {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.seg--tabs .seg-tab { height: 42px; font-size: 13px; }

@media (max-width: 480px) {
    .seg { border-radius: 14px; }
    .seg-tab { height: 44px; gap: 5px; padding: 0 6px; font-size: 12.5px; }
    .seg-tab svg { width: 15px; height: 15px; }
    .seg-tab .seg-n { font-size: 11px; padding: 2px 5px; }
}
/* Прокручиваемые вкладки: тонкая полоса подсказывает, что есть продолжение */
@media (max-width: 600px) {
    .seg--scroll { scrollbar-width: thin; }
    .seg--scroll::-webkit-scrollbar { display: block; height: 3px; }
    .seg--scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
    .seg--scroll::-webkit-scrollbar-track { background: transparent; }
}
@media (max-width: 380px) {
    .seg-tab { font-size: 11.5px; padding: 0 4px; gap: 4px; }
    .seg-tab svg { width: 14px; height: 14px; }
}
.upload-zone {
    border: 1.5px dashed var(--border-2); border-radius: var(--radius-md);
    padding: 16px; text-align: center; color: var(--muted); font-size: 13px;
    background: var(--surface-2); cursor: pointer;
}
/* Иконка по центру зоны: глобально svg { display: block }, поэтому центрируем отступами */
.upload-zone > svg { margin: 0 auto 6px; }
.upload-zone.has-file { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); padding: 12px; }
/* Обязательное прикрепление не сделано */
.upload-zone.is-error {
    border-color: color-mix(in srgb, var(--red) 55%, transparent);
    background: var(--red-soft); color: var(--red);
}

/* Прогресс загрузки файла: полоска внутри зоны + процент */
/* Подпись с процентами стоит рядом с полоской: если положить её внутрь
   6-пиксельного трека, overflow:hidden срезает цифры. */
.upload-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 4px;
}
.upload-bar > .upload-track {
    flex: 1 1 auto;
    display: block;
    height: 8px;
    min-width: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
    overflow: hidden;
}
.upload-bar > .upload-track > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .18s ease;
}
.upload-bar > span {
    flex: 0 0 auto;
    min-width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
    white-space: nowrap;
}
/* Пока файл грузится — подсказываем, что идёт работа */
.upload-zone.is-uploading,
.upload-zone.is-uploading:hover {
    border-color: var(--accent);
    color: var(--accent-text);
    cursor: progress;
}
/* Портрет персонажа из видео-шаблона: кто именно заменится фото пользователя */
.upload-face {
    display: block; width: 64px; height: 64px; margin: 0 auto 8px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--border-2));
    background: var(--surface-2);
}
.upload-zone.is-error .upload-face { border-color: color-mix(in srgb, var(--red) 55%, transparent); }
.upload-face-note { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.upload-zone.has-file .upload-face,
.upload-zone.has-file .upload-face-note { display: none; }
.role-face-mini {
    width: 26px; height: 26px; flex: 0 0 auto;
    border-radius: 50%; overflow: hidden;
    border: 1px solid var(--border-2); background: var(--surface-2);
}
.role-face-mini img { display: block; width: 100%; height: 100%; object-fit: cover; }
.upload-zone.is-uploading > svg { opacity: .45; }
/* Тот же прогресс в оверлее отправки формы (админка) */
.form-busy-box .upload-bar { margin: 10px 0 0; }
/* Превью загруженного фото — компактная миниатюра, а не картинка во всю ширину */
.upload-preview {
    display: block;
    width: 132px;
    height: 132px;
    max-width: 100%;
    margin: 10px auto 2px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
}
@media (min-width: 640px) {
    .upload-preview { width: 152px; height: 152px; }
}

.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.hidden { display: none !important; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.center { text-align: center; }

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
    :root { --shell-w: 640px; }
    body { padding: 22px 0; }
    .app-shell {
        border-radius: 28px;
        min-height: calc(100vh - 44px);
        min-height: calc(100dvh - 44px);
        border: 1px solid var(--border);
        box-shadow: 0 30px 70px rgba(16, 20, 30, .22);
        /* clip (не hidden) скругляет углы и не ломает position: sticky */
        overflow: clip;
        /* Подвал сам держит нижний отступ (см. .app-footer) */
        padding-bottom: 0;
    }
    /* Шапка повторяет радиус оболочки, иначе перекрывает углы */
    .topbar { border-radius: 27px 27px 0 0; }
    .app-main { padding: 18px 20px 10px; gap: 24px; }
    .hero { padding: 26px 24px 24px; }
    .hero-title { font-size: 52px; max-width: 62%; }
    .hero-text { max-width: 58%; font-size: 15px; }
    .hero-art { font-size: 132px; bottom: 74px; }
    .quick-grid { max-width: none; }
    .trend-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Ноутбук ---------- */
@media (min-width: 900px) {
    :root { --shell-w: 900px; }
    /* Контент центрируется единой колонкой (width обязателен: auto-margins
       отключают stretch у flex-элемента и он сжимается по контенту) */
    .app-main { width: 100%; max-width: 900px; margin-left: auto; margin-right: auto; padding: 22px 26px 12px; gap: 28px; }
    .hero { padding: 34px 32px 30px; }
    .hero-title { font-size: 62px; max-width: 56%; }
    .hero-text { max-width: 50%; font-size: 16px; }
    .hero-art { font-size: 170px; bottom: 82px; right: 24px; }
    .hero-cta { width: auto; min-width: 340px; padding: 16px 30px; }
    .trend-grid { grid-template-columns: repeat(4, 1fr); }
    .section-title { font-size: 23px; }
    .page-title { font-size: 27px; }
    /* Узкие блоки держим по центру колонки (карточки и списки — во всю ширину колонки) */
    .footer-links { max-width: 760px; }
    /* Форма на странице тренда — во всю ширину, как .trend-intro */
    .form-card--wide { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
    /* Профиль: все блоки одной ширины — не сужаем карточки */
    .section.profile .form-card,
    .section.profile .stat-grid,
    .section.profile .list-card,
    .section.profile .profile-head { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
    .task-stage { max-width: 480px; margin-left: auto; margin-right: auto; aspect-ratio: 9 / 12; }
    /* Страница задачи: карточки держим в ширине плеера */
    .section[data-task-id] .form-card { max-width: 480px; width: 100%; margin-left: auto; margin-right: auto; }
}

/* ---------- Десктоп ---------- */
@media (min-width: 1200px) {
    :root { --shell-w: 1140px; }
    .app-main { width: 100%; max-width: 1040px; padding: 26px 34px 16px; gap: 32px; }
    .hero { padding: 40px 38px 36px; }
    .hero-title { font-size: 72px; }
    .hero-text { max-width: 44%; }
    .hero-art { font-size: 200px; bottom: 96px; right: 40px; }
    .trend-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Страница тренда ---------- */
.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; font-weight: 700; color: var(--muted);
}
.trend-hero { display: flex; flex-direction: column; gap: 6px; }
.eyebrow {
    font-size: 11px; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent-ink);
}
/* Плашка над заголовком тренда — в стиле сайта: градиент акцента и иконка огня */
.eyebrow--badge {
    display: inline-flex; align-items: center; gap: 5px;
    align-self: flex-start;
    padding: 3px 10px; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; letter-spacing: .06em;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.eyebrow--badge svg { width: 12px; height: 12px; flex: none; }
.chip.is-static { cursor: default; background: var(--surface-2); }
.panel-note {
    font-size: 13.5px; line-height: 1.55; color: var(--text-2);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 13px 15px;
}
/* Контакты и условия в плашке поддержки — по строке на пункт */
.sup-contacts { display: grid; gap: 2px; margin-top: 6px; }

.role {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); overflow: hidden;
}
.role.is-open { background: var(--surface); }
.role-head {
    width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 13px; background: transparent; border: 0;
    color: var(--text); text-align: left; font: inherit;
}
.role-num {
    width: 24px; height: 24px; flex: none; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 12px; font-weight: 800;
}
.role-title { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
/* Метка типа поля: фото или видео */
.role-kind {
    flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
    padding: 3px 7px; border-radius: 7px; background: var(--surface-3); color: var(--muted);
}
.role-state { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; flex: none; }
.role-head svg { color: var(--muted); transition: transform .18s ease; flex: none; }
.role.is-open .role-head svg { transform: rotate(90deg); }
.role-body { display: none; flex-direction: column; gap: 10px; padding: 0 13px 13px; }
.role.is-open .role-body { display: flex; }
.role.has-photo .role-state { color: var(--green); }
/* Обязательное поле не заполнено — подсвечиваем рамку и состояние */
.role.is-error { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: var(--red-soft); }
.role.is-error .role-title { color: var(--red); }
.role.is-error .role-state { color: var(--red); }
.role.is-error .role-num { background: var(--red-soft); color: var(--red); }
.role.is-error .upload-zone { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.role-body .upload-preview { border-radius: var(--radius-sm); }

/* ---------- Библиотека референсов ---------- */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ref-card {
    position: relative; border-radius: var(--radius-md); overflow: hidden;
    aspect-ratio: 3 / 4; background: var(--surface-3);
}
button.ref-card { border: 0; padding: 0; cursor: pointer; display: block; width: 100%; }
.ref-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-title {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px;
    font-size: 11px; font-weight: 700; color: #fff;
    background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.65));
}
.ref-del {
    position: absolute; top: 6px; right: 6px; width: 28px; height: 28px;
    border-radius: 999px; border: 0; background: rgba(18,20,26,.62); color: #fff;
    display: grid; place-items: center; backdrop-filter: blur(4px);
}

/* Панель выбора референса: компактная карточка по центру экрана */
.sheet {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(8,10,14,.55);
}
.sheet[hidden] { display: none; }
.sheet-body {
    width: min(520px, 100%); max-height: min(76vh, 560px); overflow: auto;
    background: var(--surface); border-radius: 20px; padding: 16px 14px 18px;
    box-shadow: var(--shadow-lg);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head b { font-size: 16px; }

@media (max-width: 480px) {
    .sheet { padding: 10px; }
    .sheet-body { max-height: 84vh; border-radius: 18px; padding: 14px 12px 16px; }
}

/* На узких карточках бейджи меньше, чтобы «ХИТ» не заезжал под сердечко */
@media (max-width: 480px) {
    .trend-badge, .trend-hot, .trend-new {
        font-size: 8px; padding: 3px 5px; border-radius: 6px; letter-spacing: .03em;
    }
    .trend-top { gap: 3px; right: 46px; }
}

/* ---------- Генератор: вкладки «Фото / Видео» ---------- */
[hidden] { display: none !important; }

/* Пустой контейнер сообщений не добавляет лишний интервал в колонке формы */
/* Контейнер сообщений генератора: несколько алертов подряд не слипаются */
#genAlerts {
    display: flex; flex-direction: column; gap: 8px;
    margin: 0 0 12px;
}
#genAlerts:empty { display: none; margin: 0; }

.gen-tabs {
    display: flex; gap: 6px; padding: 5px; margin-bottom: 12px;
    background: var(--surface-3); border-radius: var(--radius-md);
}
.gen-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 11px; border: 1px solid transparent; border-radius: 11px;
    font-size: 13.5px; font-weight: 700;
    color: var(--text-2); text-decoration: none;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.gen-tab svg { width: 18px; height: 18px; }
/* Наведение — оранжевая окантовка */
.gen-tab:hover { border-color: var(--accent); }
/* Нажатие и активная вкладка — тот же оранжевый оттенок, что у выбранной модели ИИ */
.gen-tab:active,
.gen-tab.is-active {
    border-color: var(--accent); background: var(--accent-soft);
    color: var(--accent-text); box-shadow: none;
}

.gen-trend { display: flex; gap: 12px; align-items: center; }
.gen-trend .work-thumb { width: 52px; height: 52px; flex: none; }

/* Кнопка настроек и сводка выбранных параметров */
.gen-config {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text);
    font-size: 13px; font-weight: 600; text-align: left;
}
.gen-config svg { flex: none; color: var(--muted); }
.gen-config span[data-config-summary] {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gen-config-edit { flex: none; font-size: 12.5px; font-weight: 700; color: var(--accent-text); }

/* Настройки раскрываются прямо внутри карточки формы */
.gen-config-wrap { display: flex; flex-direction: column; gap: 10px; }
.gen-drop {
    display: flex; flex-direction: column; gap: 14px;
    padding: 14px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    max-height: min(66vh, 560px); overflow-y: auto; overscroll-behavior: contain;
    animation: genDropIn .18s ease-out;
}
@keyframes genDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
/* Заголовок блока остаётся видимым при прокрутке настроек */
.gen-drop-head {
    position: sticky; top: -14px; z-index: 1; margin: -14px -14px 0;
    padding: 14px 14px 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.gen-drop-head b { font-size: 14px; }
.gen-drop-done {
    border: 0; background: none; padding: 4px 2px; cursor: pointer;
    font-size: 12.5px; font-weight: 700; color: var(--accent-text);
}
.gen-drop .opt-list .opt { padding: 9px 11px; }
.gen-drop .opt-list .opt:not(.is-active) { background: var(--surface); }

/* Плашка «не хватает на балансе» */
.gen-note {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--red-soft); color: var(--red);
    font-size: 12.5px; font-weight: 600;
}
.gen-note.hidden { display: none; }
.gen-note a { color: var(--red); font-weight: 700; }

.gen-total {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 2px 2px 4px; font-size: 13px; color: var(--text-2);
}
.gen-total b { font-size: 19px; color: var(--text); }

/* ---------- Референсы в форме ---------- */
.ref-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ref-count {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px;
    margin-left: 2px; padding: 0 5px; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
}
.ref-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-strip .ref-item {
    position: relative; width: 66px; height: 66px;
    border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3);
}
.ref-strip .ref-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-strip .ref-del { top: 3px; right: 3px; width: 22px; height: 22px; font-size: 13px; line-height: 1; }
/* Номер фото — по нему пользователь ссылается в промпте («лицо из Фото 1») */
.ref-strip .ref-num {
    position: absolute; left: 3px; bottom: 3px;
    min-width: 20px; height: 20px; padding: 0 5px;
    display: grid; place-items: center; border-radius: 999px;
    background: rgba(0, 0, 0, .62); color: #fff;
    font-size: 11.5px; font-weight: 800;
}
/* Фото с замечаниями по качеству: аккуратный бейдж «!» на миниатюре */
.ref-strip .ref-item.is-warn { box-shadow: inset 0 0 0 2px color-mix(in srgb, #f59e0b 88%, transparent); }
.ref-strip .ref-warn {
    position: absolute; left: 4px; top: 4px;
    width: 15px; height: 15px; display: grid; place-items: center;
    border-radius: 999px; background: #f0a428; color: #2c1c00;
    font-size: 10.5px; font-weight: 900; line-height: 1;
}

/* Предупреждение о качестве фото: мягкая плашка, отправку не блокирует */
.photo-warn {
    position: relative;
    margin-top: 8px; padding: 8px 10px 8px 30px;
    border: 1px solid color-mix(in srgb, #f59e0b 28%, var(--border));
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, #f59e0b 7%, var(--surface));
    color: var(--text-2);
    font-size: 12.5px; line-height: 1.45;
}
.photo-warn::before {
    content: "!";
    position: absolute; left: 9px; top: 9px;
    width: 14px; height: 14px;
    display: grid; place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, #f0a428 80%, #fff);
    color: #35230b;
    font-size: 10.5px; font-weight: 900; line-height: 1;
}
.photo-warn-title { margin: 0 0 2px; font-weight: 600; color: var(--text); }
.photo-warn-list {
    display: flex; flex-wrap: wrap; gap: 1px 12px;
    margin: 0; padding: 0; list-style: none;
}
.photo-warn-list li {
    position: relative; padding-left: 9px;
    color: var(--text-2); font-size: 12px;
}
.photo-warn-list li::before {
    content: "";
    position: absolute; left: 1px; top: .62em;
    width: 3px; height: 3px; border-radius: 50%;
    background: color-mix(in srgb, #f0a428 85%, #8a5a05);
}
.photo-warn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 6px; }
/* Внутри плашки кнопки — текстовые ссылки без рамок и фона */
.photo-warn .btn,
.photo-warn .btn.btn-sm,
.photo-warn .btn.btn-ghost {
    display: inline-flex; align-items: center;
    min-height: 0; height: auto; padding: 0;
    border: 0; border-radius: 0; background: none; box-shadow: none;
    font-size: 12px; font-weight: 700; line-height: 1.3;
}
.photo-warn .btn { color: #8a5a05; }
.photo-warn .btn.btn-ghost { color: var(--muted); font-weight: 600; }
.photo-warn .btn:hover,
.photo-warn .btn.btn-ghost:hover { background: none; text-decoration: underline; }
.photo-warn .btn.btn-ghost:hover { color: var(--text-2); }

/* Прикреплённое видео-исходник */
.ref-video { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-video-chip {
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 100%; padding: 8px 10px;
    border: 1px solid var(--border-2); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text-2); font-size: 13px;
}
.ref-video-chip b { color: var(--text); white-space: nowrap; }
.ref-video-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; opacity: .75; }
.ref-video-del {
    flex: none; width: 24px; height: 24px; display: grid; place-items: center;
    border: 1px solid var(--border-2); border-radius: 999px;
    background: var(--surface-3); color: var(--text-2);
    font-size: 14px; line-height: 1; cursor: pointer;
}
.ref-video-del:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

/* ---------- Список вариантов в листе настроек ---------- */
.opt-list { display: grid; gap: 8px; }
.opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text); font-size: 13.5px; text-align: left;
}
/* Модели, которые не умеют выбранный режим, скрываются через атрибут hidden:
   у .opt задан display:flex, поэтому без этого правила hidden не работает */
.opt[hidden] { display: none !important; }
.opt b { font-size: 13.5px; }
.opt small { font-size: 11.5px; color: var(--muted); }
.opt.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.opt.is-active small { color: var(--accent-text); }
.opt-row { display: flex; flex-wrap: wrap; gap: 7px; }
/* Длительность: вариантов много (4…30 с подряд) — пилюли компактнее, чтобы ряд не раздувался */
[data-opt="duration"] { gap: 5px; }
[data-opt="duration"] .opt {
    padding: 6px 9px; font-size: 12px; font-weight: 700; border-radius: 999px;
}
.opt-mini {
    flex-direction: row; align-items: center;
    padding: 8px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
/* Пропорции на странице генерации: рисунок + подпись */
.opt-mini.opt-aspect { display: inline-flex; gap: 6px; padding: 6px 11px 6px 9px; }
.opt-mini.opt-aspect .asp-ic { flex: none; }
.switch-line { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.switch-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.tips { display: grid; gap: 7px; margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.tips li { line-height: 1.45; }

/* ---------- Блок помощи под формой ---------- */
.help-list { display: grid; gap: 8px; margin-top: 12px; }
.help-acc { display: flex; flex-direction: column; }
.help-row {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text); font-size: 13.5px; text-align: left; text-decoration: none;
}
.help-ic {
    flex: none; width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800;
}
.help-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.help-text b { font-size: 13.5px; }
.help-text small { font-size: 11.5px; color: var(--muted); }
.help-row > svg { flex: none; color: var(--muted); transition: transform .18s ease; }
.help-row[aria-expanded="true"] {
    border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent;
}
.help-row[aria-expanded="true"] > svg { transform: rotate(90deg); }
/* Раскрытое содержимое строки помощи */
.help-body {
    border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--surface); padding: 12px 13px 14px;
    animation: genDropIn .18s ease-out;
}

@media (max-width: 380px) {
    .gen-config-edit { display: none; }
    .ref-strip .ref-item { width: 58px; height: 58px; }
}

/* ============================================================
   Лендинг для гостей (главная без авторизации)
   ============================================================ */
.landing-hero .hero-art { top: 18px; right: 8px; bottom: auto; font-size: 86px; opacity: .95; }
.landing-hero .hero-text { max-width: 76%; }

.hero-actions { display: flex; flex-direction: column; gap: 10px; }
.hero-cta--ghost {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-weight: 700;
    box-shadow: none;
}

/* Цифры */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-cell {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 13px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.stat-cell b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.stat-cell span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

.landing-vendors { justify-content: center; }

/* Что умеет сервис */
.feature-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.feature-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.feature-ic {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-text);
}
.feature-ic--purple { background: var(--purple-soft); color: var(--purple); }
.feature-ic--blue   { background: var(--blue-soft);   color: var(--blue); }
.feature-ic--green  { background: var(--green-soft);  color: var(--green); }
.feature-card h3 { font-size: 15px; font-weight: 800; }
.feature-card p { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Как это работает */
.steps { display: grid; gap: 10px; }
.step {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.step-num {
    flex: none; width: 30px; height: 30px; border-radius: 999px;
    display: grid; place-items: center;
    font-size: 13px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.step-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.step-body b { font-size: 14px; }
.step-body small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* Цены */
.landing-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 15px 16px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.price-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    font-size: 13.5px; color: var(--text-2);
    padding-bottom: 10px; border-bottom: 1px dashed var(--border-2);
}
.price-row:last-of-type { padding-bottom: 0; border-bottom: 0; }
.price-row b { font-size: 14px; color: var(--accent-text); white-space: nowrap; }

/* Частые вопросы */
.faq { display: grid; gap: 8px; }
.faq-item { display: flex; flex-direction: column; }
.faq-q {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 13px 14px; text-align: left;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text);
    font-size: 13.5px; font-weight: 700;
}
.faq-q span { flex: 1; min-width: 0; }
.faq-q > svg { flex: none; color: var(--muted); transition: transform .18s ease; }
.faq-q[aria-expanded="true"] {
    border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent;
}
.faq-q[aria-expanded="true"] > svg { transform: rotate(90deg); }
.faq-a {
    padding: 12px 14px 14px;
    border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--surface);
    font-size: 13px; line-height: 1.5; color: var(--text-2);
    animation: genDropIn .18s ease-out;
}

/* Финальный призыв */
.cta-band {
    display: flex; flex-direction: column; gap: 12px;
    padding: 20px 18px 18px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(120% 130% at 10% 0%, rgba(255, 255, 255, .14), transparent 46%),
        linear-gradient(148deg, var(--hero-1), var(--hero-2));
    color: #fff;
    box-shadow: var(--shadow-md);
}
.cta-band h2 { font-size: 24px; letter-spacing: -.02em; }
.cta-band p { font-size: 13.5px; color: rgba(255, 255, 255, .82); }
.cta-band-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.cta-band .btn-accent { box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.cta-band .btn-ghost {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

@media (min-width: 480px) {
    .stat-cell { padding: 13px 14px; }
    .stat-cell b { font-size: 18px; }
    /* Текст героя длиннее прежнего — держим его компактнее, чтобы блок не разъезжался */
    .landing-hero .hero-title { font-size: 36px; }
}

@media (min-width: 640px) {
    .hero-actions { flex-direction: row; align-items: center; }
    .hero-actions .hero-cta { flex: 1; min-width: 0; }
    .landing-hero .hero-title { font-size: 42px; max-width: 74%; }
    .landing-hero .hero-text { max-width: 64%; }
    .landing-hero .hero-art { font-size: 124px; top: 24px; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cta-band { padding: 26px 24px 22px; }
    .cta-band h2 { font-size: 28px; }
    .cta-band-actions { flex-direction: row; }
    .cta-band-actions .btn { flex: 1; }
}

@media (min-width: 900px) {
    .landing-hero .hero-title { font-size: 50px; max-width: 64%; }
    .landing-hero .hero-text { max-width: 60%; }
    .landing-hero .hero-art { font-size: 150px; top: 30px; right: 26px; }
    .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .step { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
    .cta-band { padding: 34px 32px 30px; }
    .cta-band h2 { font-size: 32px; }
    .cta-band-actions { max-width: 620px; }
}

@media (min-width: 1200px) {
    .landing-hero .hero-title { font-size: 56px; max-width: 60%; }
    .landing-hero .hero-text { max-width: 54%; }
}

/*
 * До планшета арт уходит за текст полупрозрачным знаком — иначе эмодзи
 * в правом верхнем углу наезжает на длинный заголовок.
 */
@media (max-width: 639px) {
    .landing-hero .hero-art {
        font-size: 170px; top: 42%; right: -20px;
        opacity: .13; z-index: 0; transform: rotate(-8deg);
    }
    .landing-hero .hero-badge,
    .landing-hero .hero-title,
    .landing-hero .hero-text,
    .landing-hero .hero-actions { position: relative; z-index: 1; }
    .landing-hero .hero-title { max-width: 100%; }
    .landing-hero .hero-text { max-width: 100%; }
}

@media (max-width: 479px) {
    .landing-hero .hero-title { font-size: 34px; }
}

@media (max-width: 380px) {
    .landing-hero .hero-title { font-size: 30px; }
    .stat-cell { padding: 10px 11px; }
    .stat-cell b { font-size: 15.5px; }
    .stat-cell span { font-size: 11px; }
}

/* ============================================================
   Страницы документов (политика, персональные данные)
   ============================================================ */
.doc-page { gap: 14px; }
.doc-card {
    padding: 18px 16px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.doc-title { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; }
.doc-date { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.doc-body { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.doc-body p { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.doc-body strong { color: var(--text); font-weight: 700; }
.doc-body ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc-body li { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.doc-body li::marker { color: var(--accent); }

@media (min-width: 640px) {
    .doc-card { padding: 24px 24px 26px; }
    .doc-title { font-size: 26px; }
}

/* ============================================================
   Поддержка: переписка пользователя и администратора
   ============================================================ */
.page-head { display: flex; flex-direction: column; gap: 4px; }
.sup-list { display: flex; flex-direction: column; gap: 10px; }
.sup-msg {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.sup-msg--user {
    align-self: flex-end;
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    border-bottom-right-radius: 6px;
}
.sup-msg--admin { align-self: flex-start; border-bottom-left-radius: 6px; }
.sup-text { display: flex; flex-direction: column; gap: 8px; }
.sup-text p { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.sup-text strong { font-weight: 700; }
.sup-text ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.sup-text li { font-size: 13.5px; line-height: 1.5; }
.sup-meta { margin-top: 7px; font-size: 11px; color: var(--muted); }

/* Картинки в сообщении */
.sup-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.sup-file {
    display: block;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
}
.sup-file img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.sup-file img:hover { opacity: .92; }

/* Видео в сообщении: плеер + кнопка скачивания */
.sup-video { margin-top: 8px; max-width: 360px; }
.sup-video video {
    display: block; width: 100%; max-height: 320px;
    border-radius: 12px; background: #000;
    border: 1px solid var(--border-2);
}
.sup-video-bar {
    display: flex; align-items: center; gap: 10px;
    margin-top: 6px; flex-wrap: wrap;
}
.sup-video-name {
    font-size: 11.5px; color: var(--muted);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1 1 auto;
}
.sup-video-dl { text-decoration: none; flex: 0 0 auto; }

/* Форма: прикрепление картинок */
.sup-attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sup-attach .hint { font-size: 11.5px; }
.sup-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sup-strip-item {
    position: relative;
    width: 74px; height: 74px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
}
.sup-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Плитка видео в форме: вместо превью — подпись, чтобы не грузить ролик целиком */
.sup-strip-item.sup-strip-video {
    width: 132px; height: 74px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px; text-align: center;
}
.sup-strip-badge { font-size: 11px; font-weight: 600; color: var(--accent); }
.sup-strip-name {
    font-size: 10.5px; color: var(--muted);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sup-strip-del {
    position: absolute; top: 3px; right: 3px;
    width: 20px; height: 20px;
    display: grid; place-items: center;
    border: 0; border-radius: 999px;
    background: rgba(10, 12, 16, .66);
    color: #fff; font-size: 14px; line-height: 1;
    padding: 0;
}
.sup-strip-del:hover { background: var(--red); }

/* Просмотр картинки во весь экран */
html.sup-lb-open { overflow: hidden; }
.sup-lb {
    position: fixed; inset: 0; z-index: 120;
    display: grid; place-items: center;
    padding: 16px;
    background: rgba(8, 10, 14, .88);
}
.sup-lb img {
    max-width: 100%; max-height: 88vh;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}
.sup-lb-close {
    position: absolute; top: 14px; right: 14px;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 0; border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff; font-size: 22px; line-height: 1;
    padding: 0;
}
.sup-lb-close:hover { background: rgba(255, 255, 255, .28); }

@media (min-width: 640px) {
    .sup-msg { max-width: 76%; }
}

/* ---------- Страница задачи ---------- */
.layout-wide .app-main { max-width: 1180px; }
/* Карточка с параметрами больше не зажата в узкую колонку */
.section[data-task-id] .form-card { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
.section--task .form-card { padding: 18px 20px; }
/* Экран генерации: широкий блок вместо вытянутой вертикальной рамки */
.section--task .task-stage {
    aspect-ratio: auto; min-height: 420px; max-height: 70vh;
    width: 100%; max-width: none; margin-left: 0; margin-right: 0;
}
/* Готовое видео: плеер по размеру ролика в прежней компактной ширине,
   все органы управления внутри кадра и не обрезаются */
.section--task .task-stage--media {
    width: fit-content;
    max-width: 480px;
    min-height: 0;
    max-height: none;
    margin-left: auto;
    margin-right: auto;
}
.task-stage--media video,
.task-stage--media img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    background: #000;
}
@media (max-width: 600px) {
    .section--task .task-stage--media { max-width: 100%; }
}

/* ---------- Аудио: результат генерации ---------- */
/* Панели формы аудио: поля идут столбиком с ровным отступом, иначе
   элементы липнут друг к другу и блоки перекрываются */
#audioForm [data-audio-panel] { display: flex; flex-direction: column; gap: 14px; }
#audioForm [data-audio-panel] .gen-examples { margin-top: 0; }
/* Сцена аудио — обычная карточка, а не чёрный кадр плеера */
.section--task .task-stage--audio {
    background: transparent; color: var(--text);
    aspect-ratio: auto; min-height: 0; max-height: none;
    padding: 0; border: 0; overflow: visible; place-items: stretch;
}
/* Пояснение про два варианта трека */
.audio-multi-note { margin: 10px 2px 0; }
.audio-result { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.audio-track {
    /* --ap-inset — общий внутренний отступ шапки и плеера: обложка трека
       стоит ровно над кнопкой Play, а правые края совпадают */
    --ap-inset: 10px;
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2);
}
.audio-track-head { display: flex; align-items: center; gap: 10px; padding-inline: var(--ap-inset); }
/* Важно: правило .task-stage img растягивает картинки на всю сцену,
   поэтому обложку трека задаём с более сильным селектором */
.task-stage .audio-cover,
.audio-cover {
    flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
    border: 1px solid var(--border-2); background: var(--surface-3);
}
.audio-cover--icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent-text); }
.audio-track-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.audio-track-meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-track audio { width: 100%; height: 40px; display: block; }
.audio-track-audio { display: none; }
.audio-track .btn { margin-left: auto; flex: none; }

/* Категории моделей аудио: каждая занимает всю ширину списка,
   внутри — две колонки карточек (как в общем списке моделей) */.gen-model-pop .opt-list.opt-list--groups { display: flex; flex-direction: column; gap: 14px; }
.opt-group { display: flex; flex-direction: column; gap: 6px; }
.opt-group-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700;
    padding-bottom: 5px; border-bottom: 1px solid var(--border-2);
}
.gen-model-pop .opt-group-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
@media (max-width: 600px) {
    .gen-model-pop .opt-group-grid { grid-template-columns: 1fr; }
}

/* Плеер аудио — в стиле сайта: светлая панель внутри карточки трека.
   Горизонтальный отступ на 1px меньше, чем у шапки — компенсируем рамку,
   чтобы содержимое обоих блоков начиналось на одной вертикали. */
.audio-player {
    display: flex; align-items: center; gap: 10px;
    padding: 8px calc(var(--ap-inset, 10px) - 1px); border-radius: 12px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.audio-player audio { display: none; }
.ap-btn {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer;
    background: var(--accent); color: #fff;
    transition: filter .15s ease, transform .12s ease, background .15s ease;
}
.ap-btn:hover { filter: brightness(1.06); }
.ap-btn:active { transform: scale(.96); }
.ap-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-btn--sm {
    width: 30px; height: 30px; border-radius: 9px;
    background: var(--surface-3); color: var(--muted);
    border: 1px solid var(--border-2); box-shadow: none;
}
.ap-btn--sm:hover { background: var(--surface-2); color: var(--text); filter: none; }
.ap-btn--sm.is-muted { background: var(--surface-2); color: var(--muted); opacity: .7; }
/* Дорожка перемотки: сам блок выше полоски (18px), чтобы по ней было удобно
   попасть пальцем, а видимая линия остаётся тонкой — её рисует ::before */
.ap-bar {
    position: relative; flex: 1; height: 18px; border-radius: 999px;
    background: transparent; border: 0;
    cursor: pointer; min-width: 60px;
    touch-action: none;              /* тянем ползунок, а не скроллим страницу */
    -webkit-user-select: none; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ap-bar::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 6px; transform: translateY(-50%); border-radius: 999px;
    background: var(--surface-3); border: 1px solid var(--border-2);
}
.ap-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ap-fill {
    position: absolute; left: 1px; top: 50%; transform: translateY(-50%);
    height: 6px; width: 0;
    background: var(--accent); border-radius: 999px;
    pointer-events: none;
}
/* Ползунок: видно, что дорожку можно потянуть */
.ap-thumb {
    position: absolute; top: 50%; left: 0;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); border: 2px solid var(--surface);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .28);
    transform: translate(-50%, -50%);
    transition: transform .12s ease;
    pointer-events: none;
}
.ap-bar:hover .ap-thumb { transform: translate(-50%, -50%) scale(1.12); }
.ap-bar.is-dragging .ap-thumb { transform: translate(-50%, -50%) scale(1.25); }
/* Подсказка с временем точки, куда попадёт перемотка */
.ap-tip {
    position: absolute; bottom: 100%; left: 0;
    transform: translate(-50%, -6px);
    padding: 3px 7px; border-radius: 7px;
    background: var(--text); color: var(--surface);
    font-size: 11px; font-weight: 700; line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap; pointer-events: none;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .18);
}
.ap-time {
    font-size: 11.5px; color: var(--muted);
    font-variant-numeric: tabular-nums; min-width: 34px; text-align: right;
}
/* Кнопка «скачать» живёт в плеере: та же квадратная форма, что у mute */
.audio-player .ap-download { text-decoration: none; }
.audio-player .ap-download:hover {
    background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent);
}
@media (max-width: 600px) {
    /* На телефоне время скрыто — освобождаем место под две кнопки */
    .audio-track { --ap-inset: 8px; }
    .audio-player { gap: 8px; padding: 7px calc(var(--ap-inset, 8px) - 1px); }
    .ap-time { display: none; }
}
.stage-state .progress-track { width: min(320px, 82%); }
.task-cancel { display: flex; justify-content: center; }
.task-cancel .btn { width: auto; }
.task-cancel .btn:hover {
    background: color-mix(in srgb, var(--red) 15%, var(--surface-2));
    border-color: color-mix(in srgb, var(--red) 55%, transparent);
    color: var(--red);
}
/* Карточка параметров генерации: плитки вместо сухих строк */
.section--task .kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.section--task .kv-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    font-size: 13.5px;
}
.section--task .kv-row .k {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.section--task .kv-row .v { text-align: left; font-variant-numeric: tabular-nums; }
.section--task .kv-row:last-child:nth-child(odd) { grid-column: 1 / -1; }
.section--task .kv-row--price {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-2));
}
.section--task .kv-row--price .v { color: var(--accent); font-size: 15px; }
@media (max-width: 560px) {
    .section--task .kv { grid-template-columns: 1fr; }
}

/* Исходные файлы задачи («Ваши файлы»): плитки с превью, работают для всех режимов */
.task-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}
.task-file {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    text-decoration: none;
    color: var(--text-2);
}
.task-file-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-3);
}
.task-file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-file-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(16, 18, 24, .34);
}
.task-file-label {
    font-size: 11.5px;
    line-height: 1.25;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-file:hover .task-file-label { color: var(--text); }
.task-file:hover .task-file-thumb { border-color: var(--accent); }
@media (max-width: 600px) {
    .section--task .task-stage { min-height: 320px; }
}
/* Кнопки внутри карточек не растягиваются на всю ширину */
.section--task .field > .btn { align-self: flex-start; width: auto; }
/* Экран генерации — по пропорциям будущего ролика, как готовое видео */
.section--task .task-stage--wait {
    aspect-ratio: var(--stage-w, 9) / var(--stage-h, 16);
    width: min(480px, calc(78vh * var(--stage-w, 9) / var(--stage-h, 16)));
    max-width: 100%;
    min-height: 0;
    max-height: 78vh;
    margin-left: auto;
    margin-right: auto;
}
.stage-state { max-width: 100%; overflow: hidden; }
.stage-state .progress-track { max-width: 100%; }
@media (max-width: 600px) {
    .section--task .task-stage--wait { width: min(100%, calc(70vh * var(--stage-w, 9) / var(--stage-h, 16))); }
}

/* Ожидание аудио: компактная карточка (без пропорций видео) с живым эквалайзером */
.section--task .task-stage--wait.task-stage--audio {
    aspect-ratio: auto;
    width: min(100%, 460px);
    min-height: 0;
    max-height: none;
    margin-left: auto;
    margin-right: auto;
    padding: 24px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.stage-state--audio { gap: 10px; }
.stage-state--audio [data-stage-text] { font-size: 15px; font-weight: 700; }
.stage-eq {
    display: flex; align-items: flex-end; justify-content: center; gap: 5px;
    height: 46px; margin-bottom: 4px;
}
.stage-eq span {
    width: 6px; height: 100%; border-radius: 4px;
    background: var(--accent); transform-origin: bottom;
    animation: eqPulse 1.05s ease-in-out infinite;
}
.stage-eq span:nth-child(1) { animation-delay: -.9s;  opacity: .55; }
.stage-eq span:nth-child(2) { animation-delay: -.6s;  opacity: .75; }
.stage-eq span:nth-child(3) { animation-delay: -.3s;  opacity: .9; }
.stage-eq span:nth-child(4) { animation-delay: 0s;    opacity: 1; }
.stage-eq span:nth-child(5) { animation-delay: -.45s; opacity: .9; }
.stage-eq span:nth-child(6) { animation-delay: -.75s; opacity: .75; }
.stage-eq span:nth-child(7) { animation-delay: -1.05s; opacity: .55; }
@keyframes eqPulse {
    0%, 100% { transform: scaleY(.28); }
    50%      { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
    .stage-eq span { animation: none; transform: scaleY(.6); }
}

/* Оценка результата: сразу под видео, без карточки — только вопрос и цифры */
.rate-box {
    --rate-btn-bg: var(--surface);
    width: min(480px, 100%);
    /* сверху прижимаем к видео (как часть одного блока), снизу — заметный отступ до карточки */
    margin: 2px auto 12px;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    padding: 0;
    border: 0;
    background: none;
    text-align: center;
}
.rate-q { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: -.005em; }
.rate-scale { display: flex; justify-content: center; gap: 8px; }
.rate-btn {
    width: 36px; height: 36px; padding: 0;
    border: 1px solid var(--border-2); border-radius: 50%;
    background: var(--rate-btn-bg); color: var(--text);
    font: inherit; font-size: 13.5px; font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}
.rate-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.rate-btn:active { transform: translateY(0); }
.rate-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rate-btn.is-on {
    background: var(--accent); border-color: var(--accent); color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
.rate-box.is-busy .rate-btn { opacity: .6; pointer-events: none; }
.rate-thanks {
    font-size: 12px; font-weight: 700; color: var(--green);
    animation: rateThanksIn .3s ease both;
}
@keyframes rateThanksIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
html[data-theme="dark"] .rate-box { --rate-btn-bg: var(--surface-3); }
@media (max-width: 380px) {
    .rate-btn { width: 34px; height: 34px; font-size: 13px; }
    .rate-scale { gap: 7px; }
}

/* Ссылка «Рассказать, что не понравилось» появляется только при оценке 1–3 */
.rate-note-link {
    margin: -2px 0 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: pointer;
}
.rate-note-link:hover { text-decoration-style: solid; }
.rate-note-link[hidden] { display: none; }

/* ---- Окно «Что не понравилось?» (оценка 1–3) ---- */
.rn-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 14, .62);
    animation: rnFade .16s ease both;
}
.rn-modal[hidden] { display: none; }
@keyframes rnFade { from { opacity: 0; } to { opacity: 1; } }

.rn-card {
    width: min(460px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(10, 14, 25, .32);
    animation: rnPop .18s ease both;
}
@keyframes rnPop { from { transform: translateY(8px) scale(.99); } to { transform: none; } }

.rn-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rn-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.rn-close {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--border); border-radius: 9px;
    background: var(--surface-2); color: var(--text-2);
    font: inherit; font-size: 14px; line-height: 1;
    cursor: pointer;
}
.rn-close:hover { color: var(--text); border-color: var(--border-2); }

.rn-sub { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }

.rn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rn-chip {
    padding: 6px 10px;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.rn-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }

.rn-input {
    width: 100%;
    min-height: 92px;
    padding: 10px 12px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit; font-size: 13.5px; line-height: 1.5;
    resize: vertical;
}
.rn-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.rn-input::placeholder { color: var(--text-3, var(--text-2)); opacity: .7; }

.rn-error {
    font-size: 12px;
    font-weight: 600;
    color: var(--red, #e5484d);
}
.rn-error[hidden] { display: none; }

.rn-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rn-count { margin-right: auto; font-size: 11.5px; color: var(--text-2); opacity: .75; }
.rn-foot .btn { flex: 0 0 auto; }

html[data-theme="dark"] .rn-card { background: var(--surface-2); }
html[data-theme="dark"] .rn-input { background: var(--surface-3); }

@media (max-width: 480px) {
    .rn-modal { padding: 10px; align-items: flex-end; }
    .rn-card { width: 100%; border-radius: 16px; padding: 14px; }
    .rn-foot .btn { flex: 1 1 auto; justify-content: center; }
    .rn-count { flex: 1 1 100%; margin: 0 0 2px; order: -1; }
}

/* ---- «Как получить хорошее видео» на странице тренда ---- */
.panel-note--tips { display: grid; gap: 10px; }
.panel-note--tips .tips-title { font-size: 14px; color: var(--text); }
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
       border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.tip-pic { width: 64px; flex: none; border-radius: 10px; overflow: hidden; display: block;
           border: 2px solid transparent; background: var(--surface-3, var(--surface-2)); }
.tip-pic img { display: block; width: 100%; height: auto; }
.tip--ok .tip-pic { border-color: rgba(46, 160, 67, .55); }
.tip--bad .tip-pic { border-color: rgba(229, 72, 77, .55); }
.tip-text { display: grid; gap: 3px; font-size: 12.5px; line-height: 1.45; }
.tip-text b { font-size: 13px; color: var(--text); }
.tip-text b.tip-label { display: inline-flex; align-items: center; gap: 5px; }
.tip-text b.tip-label svg { flex: none; }
.tip-text b.tip-label--ok svg { color: #2ea043; }
.tip-text b.tip-label--bad svg { color: #e5484d; }
.tip-text span { color: var(--text-2); }
@media (max-width: 640px) { .tips-grid { grid-template-columns: 1fr; } }

/* ---------- Страница «Тарифы и цены» ---------- */
/* Таблицы цен на узких экранах прокручиваются внутри блока, а не растягивают страницу */
.table-scroll {
    width: 100%; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 10px 0 6px;
}
.table-scroll .price-table { margin: 0; }
.table-hint { display: none; }
@media (max-width: 640px) {
    .table-hint { display: block; }
    .table-scroll { scrollbar-width: thin; }
}
@media (max-width: 480px) {
    .price-table--video th:first-child,
    .price-table--video td:first-child { width: 116px; }
    .price-table--video th:not(:first-child),
    .price-table--video td:not(:first-child) { min-width: 68px; }
    .price-table { font-size: 12.5px; }
}
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 6px;
    font-size: 13.5px;
}
.price-table th,
.price-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.price-table th {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.price-table td b { display: block; font-weight: 700; }
.price-table td small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.price-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Заголовок «Цена» стоит над цифрами, а не отдельно от них */
.price-table th.num { text-align: right; width: 1%; }
/* Строка-подзаголовок внутри таблицы (группы моделей) */
.price-table tr.price-group td {
    padding: 14px 12px 6px;
    border-bottom: 1px solid var(--border);
    background: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-2);
}
.price-table tbody tr.price-group:hover td { background: none; }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.doc-body .hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 14px; }
@media (max-width: 640px) {
    .price-table th, .price-table td { padding: 8px 10px; }
    .table-scroll { overflow-x: auto; }
}

/* Таблица «цена за секунду»: ровные колонки */
.price-table--video { table-layout: fixed; }
.price-table--video th:first-child,
.price-table--video td:first-child { width: 30%; }
.price-table--video th:not(:first-child),
.price-table--video td:not(:first-child) {
    width: auto;
    text-align: right;
    white-space: nowrap;
}
.price-table--video th { vertical-align: bottom; }
.price-table--video td { vertical-align: middle; }
.price-table--video td b { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
    .price-table--video { table-layout: auto; min-width: 520px; }
    .price-table--video th:first-child,
    .price-table--video td:first-child { width: auto; }
}

/* Ссылка-кнопка внутри документов: [**Текст**](адрес) */
.doc-body a > strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.doc-body a:has(> strong) { text-decoration: none; }
.doc-body a > strong:hover { filter: brightness(1.05); }

/* ==========================================================================
   Пополнение баланса (Platega): сумма, быстрые суммы, способы оплаты, история
   ========================================================================== */
.pay-form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.pay-form .field { margin: 0; }

.pay-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pay-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.pay-chip:hover { border-color: var(--accent); color: var(--accent); }
.pay-chip.is-on {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 8px; }
.pay-method { position: relative; display: flex; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method .pay-method-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 68px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.pay-method .pay-method-ico { display: flex; color: var(--muted); transition: color .15s; }
.pay-method .pay-method-ico svg { display: block; }
.pay-method .pay-method-lbl { line-height: 1.2; }
.pay-method:hover .pay-method-box { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-2)); }
.pay-method input:checked + .pay-method-box {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.pay-method input:checked + .pay-method-box .pay-method-ico { color: var(--accent); }
.pay-method input:focus-visible + .pay-method-box { outline: 2px solid var(--accent); outline-offset: 2px; }

.pay-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text-2);
}
.pay-note.is-ok { border-color: color-mix(in srgb, #1a9e6a 45%, var(--border-2)); }
.pay-note.is-warn { border-color: color-mix(in srgb, #d98324 45%, var(--border-2)); }

/* История платежей */
.pay-history {
    margin-top: 16px;
    border-top: 1px solid var(--border-2);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pay-history-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.pay-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 13px;
}
.pay-row .pay-date { color: var(--muted); font-size: 12.5px; }
.pay-row .pay-sum { font-weight: 700; color: var(--text); white-space: nowrap; }
.pay-row .pay-method-name { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.pay-state { font-size: 12px; font-weight: 700; white-space: nowrap; }
.pay-state.is-ok { color: #1a9e6a; }
.pay-state.is-wait { color: var(--accent); }
.pay-state.is-off { color: var(--muted); }
.pay-state.is-warn { color: #d98324; }

@media (max-width: 480px) {
    .pay-row { grid-template-columns: 1fr auto; grid-auto-rows: auto; row-gap: 2px; }
    .pay-row .pay-date { grid-column: 1 / -1; }
    .pay-row .pay-sum { justify-self: start; }
    .pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Сенсорные экраны и безопасные зоны ---------- */
@media (pointer: coarse) {
    .btn-sm { min-height: 40px; }
    .footer-links a { padding: 6px 0; }
    .footer-brand { min-height: 40px; }
    .role-head { padding: 13px 13px; }
}
@supports (padding: max(0px)) {
    .app-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
/* Длинные ссылки и адреса не должны растягивать карточки */
.doc-body, .panel-note, .sup-msg, .pay-note { overflow-wrap: anywhere; }

/* ---------- «Не нашли нужный тренд?» на странице каталога ---------- */
.suggest-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 62%),
        var(--surface);
}
.suggest-cta-ic {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
}
.suggest-cta-txt { display: grid; gap: 3px; min-width: 0; }
.suggest-cta-txt h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.suggest-cta-txt p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.suggest-cta-btn { margin-left: auto; flex: none; }

html[data-theme="dark"] .suggest-cta {
    background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 62%), var(--surface-2);
}

@media (max-width: 720px) {
    .suggest-cta { flex-wrap: wrap; padding: 14px; gap: 12px; }
    .suggest-cta-ic { width: 38px; height: 38px; border-radius: 12px; }
    .suggest-cta-txt { flex: 1 1 100%; order: 2; }
    .suggest-cta-btn { order: 3; width: 100%; margin-left: 0; justify-content: center; }
}

/* ---- Окно «Предложить тренд» ---- */
.suggest-card { width: min(520px, 100%); }
.sg-fields { display: grid; gap: 10px; margin-top: 12px; }
.sg-field { display: grid; gap: 5px; }
.sg-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); }
.sg-req { color: var(--accent); }
.sg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-hint { font-size: 11.5px; line-height: 1.4; color: var(--text-2); opacity: .8; }
.suggest-card .rn-foot { margin-top: 12px; }
.suggest-card .input { width: 100%; }

.sg-done {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 10px 0 0;
    text-align: center;
}
.sg-done[hidden] { display: none; }
.sg-done-ic {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
}
.sg-done h4 { margin: 2px 0 0; font-size: 16px; }
.sg-done p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sg-done .rn-foot { width: 100%; justify-content: center; margin-top: 6px; }

/* ---- Экран «войдите или зарегистрируйтесь» в окне заявки ---- */
.sg-auth {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 10px 0 0;
    text-align: center;
}
.sg-auth[hidden] { display: none; }
.sg-auth-ic {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}
.sg-auth h4 { margin: 2px 0 0; font-size: 16px; }
.sg-auth p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.sg-auth-main {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 2px;
}
.sg-auth-main .btn { flex: 1 1 140px; justify-content: center; }
.sg-auth .social-login { width: 100%; margin-top: 4px; }
.sg-auth .social-btns { justify-content: center; }

@media (max-width: 480px) {
    .sg-row { grid-template-columns: 1fr; }
    .suggest-card .rn-foot .btn { flex: 1 1 auto; }
}

/* ---------- SEO-обвязка каталога трендов ---------- */
.trends-lead { max-width: 68ch; }
.trend-catalog-seo { display: grid; gap: 14px; margin-top: 20px; }
.trend-seo-note {
    margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--text-2);
}
.alt-names {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 8px;
}
.alt-names li {
    font-size: 14px; line-height: 1.5; color: var(--text-2);
    padding-left: 14px; position: relative;
}
.alt-names li::before {
    content: ''; position: absolute; left: 2px; top: .55em;
    width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.alt-names-alt { color: var(--text); font-weight: 700; }
.alt-names a {
    color: var(--accent-ink); font-weight: 700; text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.alt-names a:hover { color: var(--accent); }
@media (min-width: 760px) {
    .alt-names { grid-template-columns: 1fr 1fr; gap: 8px 24px; }
}

/* ---------- SEO-обвязка страницы тренда: текст, FAQ, похожие ---------- */
/* Текст и FAQ — две колонки рядом (как у конкурентов), на узких экранах
   складываются друг под друга. */
.trend-about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.trend-about-grid.is-single { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
    .trend-about-grid:not(.is-single) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 20px;
    }
}
.trend-seo, .trend-faq { display: flex; flex-direction: column; }
.trend-seo-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 18px 16px;
}
.trend-seo-panel h2 { font-size: 19px; margin: 0 0 10px; }
.trend-seo-body { display: flex; flex-direction: column; gap: 10px; }
.trend-seo-body p {
    margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--text-2);
}
.trend-seo-body a {
    color: var(--accent); text-decoration: underline; text-underline-offset: 2px;
}
.trend-seo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }

.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    overflow: hidden;
}
.faq-item[open] { background: var(--surface); }
.faq-q {
    cursor: pointer; padding: 12px 14px; font-size: 14px; font-weight: 700;
    color: var(--text); list-style: none;
    display: flex; align-items: center; gap: 10px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 800; }
.faq-item[open] .faq-q::after { content: "–"; }
.faq-a {
    padding: 0 14px 13px; font-size: 14px; line-height: 1.6; color: var(--text-2);
}
.trend-related .panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.trend-related h2 { font-size: 19px; margin: 0; }

@media (max-width: 640px) {
    .trend-seo-panel { padding: 14px; }
    .trend-seo-panel h2 { font-size: 17px; }
    .trend-seo-body p { font-size: 14px; }
    .trend-related h2 { font-size: 17px; }
}

/* ---------- Клонирование голоса (Gemini): выбор «готовый / мой» ---------- */
.audio-clone, .clone-panel { display: flex; flex-direction: column; gap: 10px; }
.clone-panel { margin-top: 8px; }
.clone-add {
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
}
.clone-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.clone-add-btn { align-self: flex-start; }
[data-clone-field] .seg { align-self: flex-start; }
[data-clone-field] .seg .seg-tab { height: 32px; padding: 0 12px; font-size: 12.5px; }

/* Зона записи: запись с микрофона и загрузка файла стоят рядом */
.clone-src {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
}
.clone-src-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clone-src-actions .btn { justify-content: center; }
.clone-src .hint { margin: 0; line-height: 1.45; }
/* Готово (запись или файл): мягкая зелёная подсветка как у загруженного файла */
.clone-src.has-audio {
    border-color: color-mix(in srgb, var(--green) 45%, var(--border));
    background: color-mix(in srgb, var(--green-soft) 65%, var(--surface));
}
.clone-src.has-audio .hint { color: var(--green); font-weight: 600; }
@media (max-width: 480px) {
    .clone-src-actions { grid-template-columns: 1fr; }
}

/* ---------- Профиль: «Мои голоса» ---------- */
.voices-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    flex-wrap: wrap; margin-bottom: 12px;
}
.voices-title { display: block; font-size: 16px; margin-bottom: 2px; }
.voices-head .hint { display: block; line-height: 1.45; }
.voices-list { display: flex; flex-direction: column; gap: 8px; }
.voice-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
    transition: border-color .16s ease, background .16s ease;
}
.voice-item.is-playing {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-2));
}
.voice-play {
    flex: none; width: 36px; height: 36px; border-radius: 999px;
    display: grid; place-items: center; cursor: pointer;
    color: #fff; border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 28%, transparent);
    transition: transform .14s ease, filter .15s ease;
}
.voice-play:hover { filter: brightness(1.05); }
.voice-play:active { transform: scale(.96); }
.voice-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.voice-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.voice-del { flex: none; }
.voices-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    padding: 22px 16px; border: 1px dashed var(--border-2); border-radius: var(--radius-md);
    background: var(--surface-2);
}
.voices-empty-ic {
    width: 46px; height: 46px; border-radius: 999px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-text);
}
.voices-empty b { font-size: 15px; }
.voices-empty .hint { max-width: 420px; line-height: 1.45; }
.voices-note { margin-top: 10px; line-height: 1.45; }
@media (max-width: 480px) {
    .voice-del span { display: none; }
    .voice-del { padding: 8px 10px; }
}

/* ---------- Запись с микрофона (клонирование голоса Gemini) ---------- */
html.rec-lock { overflow: hidden; }
.rec-sheet {
    position: fixed; inset: 0; z-index: 120;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(8, 10, 14, .55);
}
.rec-card {
    width: min(430px, 100%);
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px 16px 18px;
    background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg);
}
.rec-card:focus { outline: none; }
.rec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rec-head b { font-size: 16px; }
.rec-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.rec-script {
    margin: 0; padding: 10px 12px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 13px; line-height: 1.45;
}
.rec-stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 0; }
.rec-mic {
    width: 88px; height: 88px; border-radius: 999px;
    display: grid; place-items: center; cursor: pointer;
    color: var(--accent-text); background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.rec-mic:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.rec-mic:active { transform: scale(.97); }
.rec-mic.is-rec {
    color: var(--red); background: var(--red-soft);
    border-color: color-mix(in srgb, var(--red) 45%, var(--border));
    animation: rec-pulse 1.6s ease-out infinite;
}
@keyframes rec-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 30%, transparent); }
    70%  { box-shadow: 0 0 0 14px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.rec-wave { display: flex; align-items: center; justify-content: center; gap: 3px; width: 100%; height: 40px; }
.rec-wave i {
    width: 3px; height: 4px; border-radius: 2px;
    background: color-mix(in srgb, var(--accent) 45%, var(--border-2));
    transition: height .08s linear, background .2s ease;
}
.rec-wave.is-live i { background: var(--accent); }
.rec-meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rec-meter i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--accent); transition: width .12s linear; }
.rec-meter.is-warn i { background: var(--red); }
.rec-timer { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-variant-numeric: tabular-nums; }
.rec-timer b { font-size: 24px; font-weight: 900; }
.rec-timer span { font-size: 13px; color: var(--muted); }
.rec-state { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; }
.rec-state.is-error { color: var(--red); }
.rec-state.is-ok { color: var(--green); }
.rec-preview { width: 100%; height: 38px; }
/* Свой плеер записи: круглая кнопка ▶/❚❚ и тонкая полоса прогресса */
.rec-player {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 14px; background: var(--surface-2);
}
.rec-play {
    flex: none; width: 40px; height: 40px; border-radius: 999px;
    display: grid; place-items: center; cursor: pointer;
    color: #fff; border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent);
    transition: transform .14s ease, filter .15s ease;
}
.rec-play:hover { filter: brightness(1.04); }
.rec-play:active { transform: scale(.96); }
.rec-player-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rec-player-bar { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rec-player-bar i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--accent); transition: width .1s linear; }
.rec-player-time {
    display: flex; align-items: baseline; gap: 4px;
    font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.rec-player-time em { font-style: normal; opacity: .6; }
.rec-actions { display: flex; gap: 8px; }
.rec-actions .btn { flex: 1; justify-content: center; }
/* Пока запись не готова, главная кнопка не должна выглядеть активной */
.rec-actions .btn-accent[disabled] {
    background: var(--surface-3); color: var(--muted);
    border-color: var(--border); opacity: 1; box-shadow: none;
}
@media (max-width: 480px) {
    .rec-sheet { padding: 10px; }
    .rec-card { border-radius: 18px; padding: 14px 13px 16px; }
    .rec-mic { width: 76px; height: 76px; }
    .rec-actions { flex-direction: column-reverse; }
}

/* ---------- VIP-статус: плашка о скидке (профиль, тарифы) ---------- */
.vip-note {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 12px 0 0; padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    font-size: 13.5px; line-height: 1.55; color: var(--text-2);
}
.vip-note svg { flex: none; color: var(--accent); margin-top: 1px; }
.vip-note b { color: var(--text); }

/* ---------- SEO-блок страниц генерации (/generate?preset=…) ---------- */
/* Страницы открыты гостям, поэтому под формой идёт текст, шаги и FAQ:
   поисковику нужен содержательный контент, человеку — ответы на вопросы. */
.gen-seo { display: flex; flex-direction: column; gap: 14px; }
.gen-seo-steps-panel { padding: 18px; }
.gen-seo-steps-panel .section-title { margin: 0 0 12px; }
.gen-seo-steps {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.gen-seo-step {
    display: flex; flex-direction: column; gap: 4px;
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2);
}
.gen-seo-step b { font-size: 14px; color: var(--text); }
.gen-seo-step span { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
@media (max-width: 900px) {
    .gen-seo-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .gen-seo-steps { grid-template-columns: minmax(0, 1fr); }
    .gen-seo-steps-panel { padding: 14px; }
}
.gen-seo-cases { margin-top: 14px; }
.gen-seo-cases b { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.gen-seo-cases ul {
    margin: 0; padding-left: 18px;
    display: flex; flex-direction: column; gap: 4px;
    font-size: 14px; line-height: 1.5; color: var(--text-2);
}
.gen-seo-links {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: auto; padding-top: 14px;
}
.gen-seo-links a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: 13.5px; font-weight: 700; color: var(--text);
    text-decoration: none;
}
.gen-seo-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Похожие тренды: компактные вертикальные карточки ---------- */
/* Как у конкурента: 9:16, мелкие подписи, много карточек в ряд */
.trend-related .trend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.trend-related .trend-title { font-size: 12px; padding: 7px 8px; }
.trend-related .trend-badge,
.trend-related .trend-hot,
.trend-related .trend-new { font-size: 9px; padding: 3px 6px; }
.trend-related .trend-fav { width: 28px; height: 28px; top: 6px; right: 6px; }
.trend-related .trend-fav svg { width: 13px; height: 13px; }
.trend-related .trend-top { top: 6px; left: 6px; right: 40px; gap: 3px 5px; }

@media (min-width: 560px) {
    .trend-related .trend-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
    .trend-related .trend-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
    .trend-related .trend-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .trend-related .trend-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ---------- Страница генерации: «сначала описание», 03.12.2026 ---------- */
.gen-page { display: flex; flex-direction: column; gap: 12px; }

.gen-head { padding: 2px 2px 0; }
.gen-head .page-title { font-size: 24px; margin: 0 0 3px; line-height: 1.2; }
.gen-head .page-sub { margin: 0; }

.gen-card { display: flex; flex-direction: column; gap: 14px; }

/* Карточка модели: название видно, список раскрывается */
.gen-model { position: relative; display: flex; flex-direction: column; gap: 6px; }
.gen-model-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.gen-model-btn {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text);
    font-size: 14px; font-weight: 700; text-align: left; cursor: pointer;
}
.gen-model-btn > svg { margin-left: auto; color: var(--muted); flex: none; }
/* Раскрытый список модели подсвечивает кнопку так же, как селекты настроек */
.gen-model-btn:hover { border-color: var(--accent); }
.gen-model-btn[aria-expanded="true"] { border-color: var(--accent); }
.gen-model-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.gen-model-ico { display: inline-flex; color: var(--accent-text); flex: none; }
.gen-model-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-model-pop {
    position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
    padding: 12px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain;
}
.gen-model-pop .opt-list {
    margin: 0;
    /* Список моделей — в две колонки: карточек много, так видно почти все без прокрутки */
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
/* Если снизу экрана мало места, JS раскрывает список вверх */
.gen-model-pop.is-up { top: auto; bottom: calc(100% + 6px); }
/* Скрытые фильтром модели не должны оставлять пустые ячейки в сетке */
.gen-model-pop .opt[hidden] { display: none; }
.gen-model-pop .hint { display: block; margin-top: 8px; }
/* Недоступный вариант в списке настроек (например, режим «Динамичный» у Grok с фото) */
.opt.is-disabled { opacity: .45; pointer-events: none; text-decoration: line-through; }

.gen-hint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Поле описания */
.gen-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.gen-prompt textarea { min-height: 120px; }
.gen-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gen-count.is-near { color: var(--red); }

/* Примеры описаний */
/* Отрицательного отступа здесь быть не должно: в панелях без flex-зазора блок
   наезжал на подсказку под полем. Отступ даёт родитель (gap карточки/панели). */
.gen-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 0; }
.gen-examples-label { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.chip-sm { padding: 6px 10px; font-size: 12px; }

/* Вложения: фото и видео отдельными окнами */
.gen-attach {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
}
.gen-attach-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.gen-attach-title svg { color: var(--muted); }
.gen-attach-hint { margin: 0; }

/* Вкладки входных материалов: блоки «Фото для видео», «Видео-исходник»,
   «Аудио-референс» лежат в одном контейнере — без зазора они слипались
   в одну плиту (рамки касались друг друга). */
.gen-input-panel { display: flex; flex-direction: column; gap: 10px; }
.gen-input-panel[hidden] { display: none; }

/* Ползунки настроек озвучки (выразительность, стабильность, близость) */
.gen-range {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 22px; background: transparent; margin: 2px 0 4px;
}
.gen-range::-webkit-slider-runnable-track {
    height: 4px; border-radius: 999px;
    background: var(--border); border: 1px solid transparent;
}
.gen-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px; margin-top: -8px; border-radius: 50%;
    background: var(--accent); border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18); cursor: pointer;
}
.gen-range::-moz-range-track { height: 4px; border-radius: 999px; background: var(--border); }
.gen-range::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent); border: 2px solid #fff; cursor: pointer;
}
.gen-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Готовый текст песни (Suno Lyrics) на странице задачи */
.lyrics-result { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.lyrics-card {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); padding: 14px;
}
.lyrics-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.lyrics-head b { font-size: 15px; }
.lyrics-actions { display: inline-flex; gap: 8px; }
.lyrics-text {
    margin: 0; white-space: pre-wrap; word-break: break-word;
    font: inherit; font-size: 14px; line-height: 1.55; color: var(--text);
}

/* Клип к треку (Suno Music Video) — видео-результат на странице задачи */
.clip-result { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.clip-result video {
    width: 100%; max-width: 720px; border-radius: var(--radius-md);
    background: #000; display: block;
}

/* Три эффекта ElevenLabs в ряд, на мобильных — в столбик */
.gen-tune-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px; margin-top: 12px;
}
.gen-tune-grid .field { gap: 6px; }
.gen-tune-grid .input { width: 100%; }
@media (max-width: 720px) {
    .gen-tune-grid { grid-template-columns: 1fr; }
}

/* Настройки видны сразу */
.gen-settings {
    display: flex; flex-direction: column; gap: 12px;
    padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius-md); background: var(--surface-2);
}
.gen-settings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.gen-settings-head b { font-size: 13px; white-space: nowrap; }
.gen-settings-head .hint {
    margin: 0; text-align: right; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gen-submit { margin-top: 2px; }

/* Лента трендов под формой */
.gen-trends { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.gen-trends-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gen-trends-head .hint { margin: 2px 0 0; }
.gen-trends-head .section-title { margin: 0; }

@media (max-width: 600px) {
    .gen-head .page-title { font-size: 21px; }
    /* Список раскрывается в потоке (не поверх формы), но со своей прокруткой:
       иначе один столбец растягивал попап на весь экран и «не прокручивался» */
    .gen-model-pop {
        position: static; margin-top: 6px; box-shadow: none;
        max-height: 62vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    /* На телефоне две колонки слишком узкие — возвращаем один столбец */
    .gen-model-pop .opt-list { grid-template-columns: 1fr; }
    .gen-settings { padding: 10px; }
    .gen-attach { padding: 10px; }
}


/* Десктоп: форма генерации — узкой колонкой по центру, как в референсе */
@media (min-width: 980px) {
    .gen-page { align-items: center; }
    .gen-page > .gen-tabs,
    .gen-page > .gen-head,
    .gen-page > .gen-trend,
    .gen-page > .gen-card,
    .gen-page > .help-list,
    .gen-page > #genAlerts { width: 100%; max-width: 760px; }
}
@media (min-width: 980px) {
    /* Лента трендов остаётся во всю ширину контейнера */
    .gen-page > .gen-trends { width: 100%; align-self: stretch; }
}

/* Подсказка @, кнопка «Улучшить описание», счётчики — 03.12.2026 */
.gen-head-tools { display: inline-flex; align-items: center; gap: 8px; }
.gen-improve {
    border: 0; background: none; padding: 3px 6px; cursor: pointer;
    font-family: inherit; font-size: 11.5px; font-weight: 700;
    color: var(--accent-text); border-radius: 6px;
}
.gen-improve:hover { background: var(--accent-soft); }
.gen-improve[data-busy="1"] { opacity: .6; cursor: default; }

.gen-prompt { position: relative; }
.gen-mention {
    position: absolute; left: 13px; right: 13px; top: 100%; z-index: 30;
    margin-top: 4px; max-height: 190px; overflow-y: auto; padding: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}
.gen-mention-item {
    display: block; width: 100%; text-align: left;
    padding: 8px 10px; border: 0; background: none; cursor: pointer;
    font-family: inherit; font-size: 13px; color: var(--text); border-radius: 8px;
}
.gen-mention-item:hover,
.gen-mention-item.is-active { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Карточки моделей: логотип бренда + короткое описание ---------- */
.opt.opt-model {
    flex-direction: row; align-items: center; gap: 11px;
    padding: 11px 12px;
}
.opt-logo {
    flex: none; width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--text);
    border: 1px solid var(--border-2);
}
.opt-logo svg { width: 20px; height: 20px; }
.opt-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.opt-body b { font-size: 13.5px; line-height: 1.25; }
.opt-desc { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.opt-meta { font-size: 11px; color: var(--muted); opacity: .9; }
.opt.is-active .opt-desc,
.opt.is-active .opt-meta { color: var(--accent-text); opacity: .85; }
.opt.is-active .opt-logo { border-color: var(--accent); }

/* ---------- Настройки видео: выпадающие списки ---------- */
.gen-select { position: relative; }
.gen-select-btn {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text); font-family: inherit;
    font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer;
}
.gen-select-btn > svg { margin-left: auto; color: var(--muted); flex: none; transition: transform .15s ease; }
.gen-select-btn[aria-expanded="true"] { border-color: var(--accent); }
.gen-select-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.gen-select-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-select-pop {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
    max-height: 260px; overflow-y: auto; padding: 6px;
    display: grid; gap: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: 0 16px 34px rgba(15, 23, 42, .2);
}
.gen-select-pop .opt.opt-choice {
    flex-direction: row; align-items: center; gap: 8px;
    padding: 9px 11px; border-radius: 9px; border-color: transparent;
    background: transparent; font-size: 13px; font-weight: 600;
}
.gen-select-pop .opt.opt-choice:hover { background: var(--surface-2); }
.gen-select-pop .opt.opt-choice.is-active {
    background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent);
}
.gen-select-pop .opt.opt-choice-aspect { gap: 9px; }
.gen-select-pop .opt.opt-choice-aspect .asp-ic { flex: none; }
.gen-model-ico svg { width: 20px; height: 20px; display: block; }
/* Счётчик символов не должен разрываться на две строки рядом с длинной подписью */
.gen-count { white-space: nowrap; flex: none; }

/* Списки настроек — две колонки: вариантов много, так они видны почти без прокрутки */
.gen-select-pop {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 300px;
}
.gen-select-pop .opt.opt-choice {
    min-width: 0; text-align: left;
    white-space: nowrap; overflow: hidden;
}
.gen-select-pop .opt.opt-choice.opt-choice-aspect { white-space: normal; }
.gen-select-pop .opt.opt-choice.opt-choice-aspect span {
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
/* Мало места снизу — JS раскрывает список вверх */
.gen-select-pop.is-up { top: auto; bottom: calc(100% + 6px); }
/* Выбор голоса: названия бывают длинными — переносим и даём списку прокрутку */
.gen-select-pop--voices { max-height: 300px; }
.gen-select-pop--voices .opt.opt-choice {
    white-space: normal; overflow: visible; line-height: 1.35;
    text-overflow: clip; align-items: center; gap: 9px;
}
/* Кнопка «послушать пример голоса» — слева от названия */
.voice-play {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--accent-text);
    border: 1px solid var(--border-2);
    cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.voice-play svg { width: 11px; height: 11px; display: block; }
.voice-play:hover { background: var(--accent-soft); border-color: var(--accent); }
.voice-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.voice-play.is-playing { background: var(--accent); color: #fff; border-color: var(--accent); }
.voice-play.is-loading { color: transparent; border-color: var(--accent); }
.voice-play.is-loading::after {
    content: ''; width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid var(--border-2); border-top-color: var(--accent);
    animation: voiceSpin .7s linear infinite;
}
@keyframes voiceSpin { to { transform: rotate(360deg); } }
.voice-name { min-width: 0; }

/* ---------- Вкладки входных материалов (Референсы / Кадры) ---------- */
.gen-itabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    padding: 4px; margin-bottom: 8px;
    background: var(--surface-3); border: 1px solid var(--border-2);
    border-radius: 999px;
}
.gen-itab {
    padding: 9px 12px; border: 0; border-radius: 999px;
    background: transparent; color: var(--muted);
    font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.gen-itab:hover { color: var(--text); }
.gen-itab.is-active {
    background: var(--surface); color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.gen-itab-note { display: block; margin: 0 0 10px; line-height: 1.45; }
/* Заголовок поля описания: подпись и кнопки переносятся целиком, без рванья */
.gen-field-head { flex-wrap: wrap; row-gap: 4px; }
.gen-head-tools { margin-left: auto; white-space: nowrap; }
.gen-improve { white-space: nowrap; }


/* ---------- «Дополнительные настройки» (ElevenLabs) ---------- */
.gen-extra { display: flex; flex-direction: column; gap: 0; }
.gen-extra[hidden] { display: none; }
.gen-extra-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; text-align: left;
}
.gen-extra-toggle:hover,
.gen-extra-toggle:active { border-color: var(--accent); }
.gen-extra-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gen-extra-toggle svg { flex: none; color: var(--muted); }
.gen-extra-toggle > span:nth-child(2) { flex: 1 1 auto; }
.gen-extra-chev { display: inline-flex; transition: transform .18s ease; }
.gen-extra.is-open .gen-extra-chev { transform: rotate(180deg); }

/* В раскрытом виде окантовка идёт по кнопке и по телу без разрыва на стыке */
.gen-extra.is-open .gen-extra-toggle,
.gen-extra.is-open .gen-extra-toggle:hover,
.gen-extra.is-open .gen-extra-toggle:active {
    border-color: var(--accent);
    border-bottom-color: transparent;
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.gen-extra-body {
    display: flex; flex-direction: column; gap: 14px;
    padding: 14px 12px; border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md); background: var(--surface);
}
.gen-extra.is-open .gen-extra-body {
    border-color: var(--accent);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.gen-extra-body[hidden] { display: none; }
@media (max-width: 600px) {
    .gen-extra-body { padding: 12px 10px; gap: 12px; }
}

/* ============ Единый отклик на наведение и нажатие (страницы генерации) ============
   Наведение на любой кликабельный блок — оранжевая окантовка.
   Выбор/нажатие — тот же оранжевый оттенок, что у выбранной модели ИИ:
   border --accent, фон --accent-soft, текст --accent-text. */

/* 1. Наведение: окантовка + лёгкий оранжевый фон — как у кнопки .btn-ghost при нажатии */
.gen-page .opt:not(.is-active):hover,
.gen-page .opt-mini:not(.is-active):hover,
.gen-page .gen-config:hover,
.gen-page .gen-select-btn:hover,
.gen-page .gen-model-btn:hover,
.gen-page .gen-extra-toggle:hover,
.gen-page .upload-zone:hover,
.gen-page .aspect-tile:hover:not(:disabled):not(.is-active),
.gen-page .chip-sm:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}
.gen-page .btn:not(.btn-accent):not(.btn-dark):not([disabled]):hover {
    border-color: var(--accent);
}
/* Кнопки без рамки (текстовые) подсвечиваем внутренней линией */
.gen-page .gen-improve:hover {
    box-shadow: inset 0 0 0 1px var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}
/* Сегменты-вкладки: у них нет border, подсветка — внутренней линией и фоном */
.gen-page .seg-tab:not(.is-active):hover {
    box-shadow: inset 0 0 0 1px var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--text);
}

/* 2. Выбранное состояние: оттенок как у модели ИИ */
.gen-page .opt.is-active,
.gen-page .opt-mini.is-active,
.gen-page .aspect-tile.is-active,
.gen-page .chip.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}
.gen-page .seg-tab.is-active {
    background: var(--accent-soft);
    color: var(--accent-text);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.gen-page .seg-tab.is-active svg { opacity: 1; color: var(--accent); }
.gen-page .seg-tab.is-active .seg-n {
    color: var(--accent-text);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}
/* Раскрытая кнопка настроек — тоже оранжевая */
.gen-page .gen-config[aria-expanded="true"],
.gen-page .gen-config.is-open {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}

/* ============ Единая подсветка кликабельных элементов по всему сайту ============
   Наведение на кнопку/карточку/чип: оранжевая окантовка + тот же лёгкий
   оранжевый фон, что у кнопки .btn-ghost («Мои референсы»). */
a.btn:not(.btn-accent):not(.btn-dark):not([disabled]):hover,
.balance-chip:hover,
.icon-btn:not(.icon-btn--accent):not(.icon-btn--out):hover,
.quick-card:hover,
.work-card:hover,
.pager-btn:not(.pager-btn--accent):not([disabled]):hover,
.chip:not(.is-active):not(.is-static):hover,
.pay-chip:hover,
.social-btn:hover,
.rn-close:hover,
.ref-card:hover,
.rate-btn:hover,
.rn-chip:hover,
.gen-seo-links a:hover,
.help-row[aria-expanded="false"]:hover,
.faq-q[aria-expanded="false"]:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}
/* Фон кнопок-ghost уже совпадает с этим оттенком — просто фиксируем окантовку */
.btn:not(.btn-accent):not(.btn-dark):not([disabled]):hover { border-color: var(--accent); }

/* Карточки-превью (тренды) оставляем без обводки — видео само показывает отклик */
.trend-fav:not(.is-on):hover { box-shadow: inset 0 0 0 2px var(--accent); }

/* Кнопки-иконки с оранжевым градиентом сохраняют свой фон */
.icon-btn--accent:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 55%, transparent); }

/* Акцентные кнопки: наведение усиливает тень, фон не перекрашиваем */
.btn-accent:hover {
    box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 50%, transparent);
    filter: brightness(1.04);
}

/* Текстовые ссылки: подсветка цветом без рамки */
.section-link:hover,
.back-link:hover,
.notice-readall:hover,
.notice-clear:hover,
.text-accent:hover { color: var(--accent-text); }

/* ============ Эффект нажатия: кнопка «вжимается» ============ */
.balance-chip:active,
.chip:not(.is-static):active,
.chip-sm:active,
.pay-chip:active,
.pager-btn:not([disabled]):active,
.social-btn:active,
.rn-close:active,
.ref-card:active,
.gen-tab:active,
.opt:active,
.opt-mini:active,
.gen-model-btn:active,
.gen-select-btn:active,
.gen-extra-toggle:active,
.seg-tab:active,
.btn:not([disabled]):active,
.icon-btn:not([disabled]):active {
    transform: scale(.97);
}
/* Основные кнопки при нажатии чуть темнеют */
.btn-accent:not([disabled]):active {
    transform: scale(.97);
    filter: brightness(.96);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-ghost:not([disabled]):active {
    transform: scale(.97);
    background: color-mix(in srgb, var(--accent) 20%, var(--surface-2));
}
.work-card:active { transform: scale(.99); }

/* Сцена аудио не должна наследовать min-height видеосцены: под плеером
   оставалась пустая полоса в сотни пикселей (медиа-правило стояло ниже) */
.section--task .task-stage--audio,
.section--task .task-stage--audio.task-stage--wait {
    min-height: 0;
    max-height: none;
}

/* Узкие экраны: вкладки-сегменты («Баланс / Рефералы / История / Пароль»)
   обрезались на последней — уплотняем, чтобы влезали без прокрутки */
@media (max-width: 480px) {
    .seg--scroll .seg-tab { padding: 0 7px; gap: 4px; font-size: 12px; }
    /* Иконки в узких вкладках не помещаются вместе с текстом — оставляем подписи */
    .seg--scroll .seg-tab svg { display: none; }
    .seg--scroll .seg-tab .seg-lbl { overflow: visible; }
}

/* ============ Страница тренда: плеер-пример и карточки ролей ============ */
.showcase-big > span {
    transition: transform .15s ease, background .15s ease;
}
.showcase-big:hover > span {
    background: color-mix(in srgb, var(--accent) 82%, transparent);
    transform: scale(1.06);
}
.showcase-big:active > span { transform: scale(.94); background: var(--accent); }

.showcase-ic:hover { background: color-mix(in srgb, var(--accent) 78%, transparent); }
.showcase-ic:active { transform: scale(.9); }

/* Разворачивающиеся карточки ролей */
.role:not(.is-error):hover { border-color: var(--accent); }
.role:not(.is-error):hover .role-head { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.role:not(.is-error):hover .role-head:active,
.role-head:active { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.role.is-open .role-head { cursor: default; }

/* Текстовые ссылки страницы тренда */
.back-link:hover,
.footer-support:hover,
.trend-about-grid a:hover,
.trend-seo-panel a:hover { color: var(--accent-text); }
.trend-seo-panel a:hover,
.trend-seo-body a:hover { text-decoration: underline; }
.back-link:active,
.footer-support:active { transform: scale(.98); }
