:root {
    --bg: #0e100f;
    --surface: #161816;
    --surface-2: #1c1e1c;
    --surface-3: #232522;
    --border: #33352f;
    --border-hover: #454740;
    --text: #fffce1;
    --text-secondary: #a9a99a;
    --text-tertiary: #7c7c6f;

    /* сигнальна палітра — кожен колір закріплений за конкретним джерелом
       даних у продукті (chat/audio/voice/live/output), не декоративний */
    --accent: #abff84;              /* chat — головний сигнал */
    --accent-2: #dfffd1;
    --accent-soft: rgba(171, 255, 132, 0.12);
    --accent-glow: rgba(171, 255, 132, 0.35);
    --orange: #ff8709;              /* audio */
    --orange-soft: rgba(255, 135, 9, 0.13);
    --lilac: #9d95ff;                /* voice / transcript */
    --lilac-soft: rgba(157, 149, 255, 0.13);
    --twitch: #00bae2;              /* live / twitch platform */
    --twitch-soft: rgba(0, 186, 226, 0.13);
    --pink: #fec5fb;                /* output / clip */
    --pink-soft: rgba(254, 197, 251, 0.1);

    --success: #abff84;
    --success-soft: rgba(171, 255, 132, 0.12);
    --warn: #ff8709;
    --warn-soft: rgba(255, 135, 9, 0.13);
    --info: #00bae2;
    --info-soft: rgba(0, 186, 226, 0.13);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-pill: 100px;

    --font-display: 'Inter Tight', 'Segoe UI', sans-serif;
    --font-body: 'Inter Tight', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

::selection { background: var(--accent); color: #0e100f; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

html {
    scroll-behavior: smooth;
    /* без цього Firefox (і будь-що поза webkit) малює власний світлий
       системний скролбар поверх темної теми — саме той "градієнт справа" */
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) var(--bg);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ---------- Сплеш-екран (лише при першому заході за сесію) ---------- */

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    opacity: 1;
    visibility: visible;
    /* visibility обов'язково в списку transition з ТІЄЮ Ж тривалістю —
       інакше він перемикається в hidden МИТТЄВО (visibility не інтерполюється
       плавно сам по собі), і елемент зникає різким стрибком ще ДО того, як
       встигне візуально згаснути через opacity */
    transition: opacity 0.7s ease, visibility 0.7s ease;
    /* CSS-запобіжник: НЕЗАЛЕЖНО від JS сам ховається через 3.2с. Якщо
       JS-таймер з якоїсь причини не спрацює — екран не застрягне назавжди */
    animation: loader-force-hide 0.01s linear 3.2s forwards;
}
.loader-hide { opacity: 0; visibility: hidden; }
@keyframes loader-force-hide {
    to { opacity: 0; visibility: hidden; pointer-events: none; }
}

.loader-mark {
    width: 72px;
    height: 72px;
    color: var(--accent);
    filter: drop-shadow(0 0 14px var(--accent-glow));
    opacity: 0;
    transform: scale(0.7);
    animation: loader-arrive 0.4s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

/* кожен кутик буквально ДОМАЛЬОВУЄТЬСЯ по черзі (stroke-dasharray/-offset) —
   безпечніше за translate (той варіант "прильоту" зсовував елемент в
   одиницях viewBox, а не CSS-пікселях, і губився за межами обрізки).
   Домальовування лінії ніколи нікуди не виїжджає за межі свого boundingbox,
   тож ризику "зникнути" нема — і це читається саме як "збирання по частинах" */
.loader-bracket {
    stroke-dasharray: 14;
    stroke-dashoffset: 14;
    animation: loader-draw 0.32s ease forwards;
}
.loader-mark .loader-bracket:nth-of-type(1) { animation-delay: 0.2s; }
.loader-mark .loader-bracket:nth-of-type(2) { animation-delay: 0.32s; }
.loader-mark .loader-bracket:nth-of-type(3) { animation-delay: 0.44s; }
.loader-mark .loader-bracket:nth-of-type(4) { animation-delay: 0.56s; }

.loader-spike {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: loader-draw 0.4s ease forwards 0.95s,
               loader-pulse 0.5s ease forwards 1.4s;
}

@keyframes loader-arrive {
    to { opacity: 1; transform: scale(1); }
}
@keyframes loader-draw {
    to { stroke-dashoffset: 0; }
}
@keyframes loader-pulse {
    0% { filter: drop-shadow(0 0 0 transparent); }
    45% { filter: drop-shadow(0 0 10px var(--accent-glow)); }
    100% { filter: drop-shadow(0 0 0 transparent); }
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* центр рівно в кутку (100% -10%) — інакше світіння не дотягується до
       самого краю екрана. РІВНО два стопи (без проміжних) — кілька стопів
       із різним нахилом інтерполяції давали видимі "смуги"/ступінці на
       межах; з двома стопами браузер робить один рівний плавний перехід. */
    background: radial-gradient(1400px circle at 100% -10%, rgba(171, 255, 132, 0.05), transparent);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: inherit; }

/* ---------- Navigation ---------- */

nav {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    /* nav тепер ПОЗА .container — фон суцільний (var(--bg), не прозорий і
       не напівпрозорий rgba) і тягнеться на всю ширину екрана. Раніше nav
       був усередині .container (max-width: 1100px) з прозорим фоном —
       через sticky-позиціювання контент, що скролиться, просвічував і
       накладався на іконки; а до того — з напівпрозорим фоном це було
       видно як окремий прямокутник іншого кольору за межами контейнера. */
    background: var(--bg);
    z-index: 100;
}
.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--text);
}
.logo-mark {
    display: flex;
    flex-shrink: 0;
    color: var(--accent);
    filter: drop-shadow(0 0 5px var(--accent-glow));
}
.logo-mark svg { width: 22px; height: 22px; display: block; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 6px 4px;
    margin-right: 4px;
    text-decoration: none;
    perspective: 300px;
}
.lang-switch-code {
    display: inline-block;
    min-width: 18px;
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    transform-style: preserve-3d;
    transition: color 0.2s;
}
.nav-links a.lang-switch:hover .lang-switch-code { color: var(--accent); }
.lang-switch.flipping .lang-switch-code { animation: lang-flip 0.4s ease; }

@keyframes lang-flip {
    0% { transform: rotateX(0deg); opacity: 1; }
    45% { transform: rotateX(90deg); opacity: 0.3; }
    55% { transform: rotateX(-90deg); opacity: 0.3; }
    100% { transform: rotateX(0deg); opacity: 1; }
}
.nav-links a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.nav-links a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.nav-links .btn { margin-left: 6px; }

/* Іконки замість слів у навігації — підпис з'являється тільки при наведенні,
   без JS (чистий CSS ::after), щоб панель лишалась компактною */
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    position: relative;
    color: var(--text);
}
.nav-links a.nav-icon:hover { color: var(--accent); background: transparent; }
.nav-icon svg { width: 42px; height: 42px; display: block; stroke-width: 2; }
.nav-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: var(--surface-3);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 200;
}
.nav-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* ---------- Buttons — outlined-only ghost pills, no filled CTAs ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-display);
    padding: 13px 24px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--text);
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn:active { opacity: 0.85; }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.btn-danger-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-danger-outline:hover { border-color: var(--danger); color: var(--danger); background: transparent; }

.btn-small { padding: 8px 16px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* компактні кнопки-іконки (кліп-картки: завантажити/редагувати/сховати) —
   підказка при наведенні той самий механізм, що й .nav-icon */
.btn-icon {
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 0;
    font-size: 0;
    vertical-align: middle;
    transition: border-color 0.15s ease, color 0.15s ease;
}
/* 16px (не 15) — з border-box 32px кнопки й 1px рамки контентна область
   виходить 30px; 30-16=14 ділиться на 2 рівно, а 30-15=15 давало
   пів-пікселя відступу і браузер округлював іконку в один бік */
.btn-icon svg { width: 16px; height: 16px; flex-shrink: 0; display: block; transition: transform 0.2s ease, filter 0.2s ease; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; display: block; }
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
/* темна іконка на світло-зеленому фоні — та сама пара, що й у ::selection;
   білий на #abff84 (він сам світлий) майже зливається, погано видно */
.btn-icon.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-icon.active:hover { color: var(--bg); }
.btn-icon:hover svg { transform: scale(1.15); filter: drop-shadow(0 0 4px var(--accent-glow)); }
.btn-icon.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon.btn-icon-danger:hover svg { filter: drop-shadow(0 0 4px var(--danger)); }

/* кожна іконка "оживає" по-своєму при наведенні — один прохід, без
   зациклення (animation без infinite саме зупиняється й повертається
   до вихідного стану після одного програвання) */
.icon-download-arrow { transform-box: fill-box; transform-origin: center; }
.btn-icon:hover .icon-download-arrow { animation: icon-download-bounce 0.5s ease-in-out; }
@keyframes icon-download-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* легке "чик-чик" похитування — сама іконка лишається впізнаваними
   ножицями (перевірена форма), рухається ціла, без розбирання на частини */
.icon-scissors-wiggle { transform-box: fill-box; transform-origin: center; }
.btn-icon:hover .icon-scissors-wiggle { animation: icon-scissors-wiggle 0.5s ease-in-out; }
@keyframes icon-scissors-wiggle {
    0%, 100% { transform: rotate(0deg); }
    30% { transform: rotate(-11deg); }
    60% { transform: rotate(9deg); }
    85% { transform: rotate(-4deg); }
}

/* кришка РАЗОМ З РУЧКОЮ (обидві тепер в одній групі) гойдається на лівому
   краю, як на завісі — справжнє відкриття бачка */
.icon-trash-lid { transform-box: fill-box; transform-origin: 3px 6px; }
.btn-icon:hover .icon-trash-lid { animation: icon-lid-open 0.55s ease-in-out; }
@keyframes icon-lid-open {
    0%, 100% { transform: rotate(0deg); }
    45% { transform: rotate(-35deg); }
    75% { transform: rotate(-8deg); }
}
.btn-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: var(--surface-3);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 5;
}
.btn-icon:hover::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Hero ---------- */

.hero {
    padding: 96px 0 64px;
    display: grid;
    grid-template-columns: 1.05fr 0.85fr;
    gap: 48px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.01em;
    margin-bottom: 24px;
}
.eyebrow::before { content: "{"; color: var(--text-tertiary); }
.eyebrow::after { content: "}"; color: var(--text-tertiary); }
.eyebrow .live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: pulse-dot 1.6s infinite; }

h1 {
    font-family: var(--font-display);
    font-size: clamp(34px, 5vw, 56px);
    line-height: 0.98;
    letter-spacing: -0.025em;
    font-weight: 600;
    margin: 0 0 22px;
    text-wrap: balance;
}

.gradient-text {
    background: linear-gradient(120deg, var(--text) 30%, var(--accent) 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: -10px 0 14px;
}

.subtitle {
    font-size: 16.5px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 0 32px;
}

.hero-trial-badge {
    display: inline-block;
    margin-bottom: 16px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    box-shadow: 0 0 16px var(--accent-glow);
}
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-cta .micro { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }

.hero-proof-link {
    display: inline-block;
    margin-top: 18px;
    font-family: var(--font-mono);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.hero-proof-link:hover { text-decoration: underline; }

/* --- Hero visual: fake "detector" panel --- */

.hero-visual {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.hero-visual-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.hero-visual-bar span:not(.file-label) { width: 8px; height: 8px; border-radius: 50%; background: var(--border-hover); }
.hero-visual-bar .file-label {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
}

.hero-visual-body { padding: 20px 20px 22px; }

/* ---------- Стрічка "хто зараз в ефірі" на лендінгу ---------- */

.live-ticker {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    margin: 48px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.live-ticker-track {
    display: flex;
    width: max-content;
    gap: 36px;
    animation: ticker-scroll 55s linear infinite;
}
.live-ticker:hover .live-ticker-track { animation-play-state: paused; }
.live-ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.live-ticker-item .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--twitch);
    box-shadow: 0 0 8px var(--twitch-soft);
    animation: pulse-dot 1.6s infinite;
    flex-shrink: 0;
}
.live-ticker-viewers {
    color: var(--text-tertiary);
    font-size: 11.5px;
}
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.mock-log {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.9;
    margin-bottom: 16px;
}
.mock-log .hl { color: var(--text-secondary); }
.mock-log .spike { color: var(--accent); font-weight: 500; }

.mock-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 64px;
    margin-bottom: 16px;
}
.mock-chart i {
    display: block;
    flex: 1;
    border-radius: 1px;
    background: var(--surface-3);
}
.mock-chart i.spike {
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

.mock-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.mock-result .left { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); font-weight: 500; }
.mock-result .left svg { width: 16px; height: 16px; stroke: var(--accent); flex-shrink: 0; }
.mock-result .tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(0,0,0,0.25);
    padding: 3px 8px;
    border-radius: 100px;
}

/* ---------- Інтерактивна таймлінія (лендінг) ---------- */

.timeline-demo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px 22px;
    margin: 8px 0 60px;
}
.timeline-demo-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.timeline-demo-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-tertiary);
}

.timeline-track {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 90px;
}
.timeline-track i {
    display: block;
    flex: 1;
    min-width: 3px;
    border-radius: 1px;
    background: var(--surface-3);
    transform-origin: bottom;
    transition: transform 0.15s, background 0.15s;
}
.timeline-track i:hover { transform: scaleY(1.3); background: var(--border-hover); }
.timeline-track i.peak {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    border-radius: 2px 2px 0 0;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.timeline-track i.peak:hover { transform: scaleY(1.12); background: var(--accent); }
.timeline-track i.peak.active {
    background: var(--accent-2);
    box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-preview {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.timeline-preview-empty {
    margin: 0;
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
}
.timeline-preview-quote {
    margin: 10px 0 0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-secondary);
}
.timeline-preview-video {
    display: block;
    width: 100%;
    max-height: 420px;
    border-radius: var(--radius-sm);
    background: #000;
}

/* ---------- Feature grid ---------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 90px 0;
    border-top: 1px solid var(--border);
}
/* ---------- "Як це працює" — анімована стрічка процесу ---------- */

.flow {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 70px 0;
    padding-top: 4px;
}
.flow-line {
    position: absolute;
    top: 28px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: var(--border);
    overflow: hidden;
}
.flow-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    transform: scaleX(0);
    transform-origin: left;
    animation: flow-draw 1.4s ease forwards 0.2s;
}
.flow-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 0;
    transform: translateY(8px);
    animation: flow-step-in 0.5s ease forwards;
    animation-delay: calc(0.3s + var(--i) * 0.3s);
}
.flow-node {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 19px;
    line-height: 1;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.4, 1);
    animation: flow-node-light 0.01s linear forwards;
    animation-delay: calc(0.3s + var(--i) * 0.3s);
}
.flow-step:hover .flow-node { transform: scale(1.12); }

@keyframes flow-node-light {
    to { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
}
.flow-step h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; font-family: var(--font-display); }
.flow-step p { font-size: 13px; color: var(--text-secondary); margin: 0; max-width: 230px; line-height: 1.5; }

@keyframes flow-draw { to { transform: scaleX(1); } }
@keyframes flow-step-in { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 860px) {
    .flow { flex-direction: column; gap: 28px; }
    .flow-line { top: 0; bottom: 0; left: 27px; right: auto; width: 2px; height: auto; }
    .flow-line::after { transform: scaleY(0); transform-origin: top; }
    @keyframes flow-draw { to { transform: scaleY(1); } }
    .flow-step { flex-direction: row; align-items: center; gap: 16px; }
    .flow-node { margin-bottom: 0; flex-shrink: 0; }
}

.feature {
    background: transparent;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 30px 26px;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease;
}
.feature:last-child { border-right: none; }
.feature:hover { background: var(--surface); }
/* тонке кольорове підсвічування знизу картки при наведенні — той самий
   колір сигналу, що й іконка (зелений/оранжевий/блакитний) */
.feature::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.feature:nth-child(2)::after { background: var(--orange); }
.feature:nth-child(3)::after { background: var(--twitch); }
.feature:hover::after { transform: scaleX(1); }

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.4, 1), box-shadow 0.3s ease;
}
.feature-icon svg { width: 17px; height: 17px; stroke: var(--accent); transition: transform 0.3s ease; }
.feature:hover .feature-icon {
    transform: scale(1.14) rotate(-6deg);
    box-shadow: 0 0 18px var(--accent-glow);
}
.feature:hover .feature-icon svg { transform: rotate(6deg); }

.feature:nth-child(2) .feature-icon { background: var(--orange-soft); }
.feature:nth-child(2) .feature-icon svg { stroke: var(--orange); }
.feature:nth-child(2):hover .feature-icon { box-shadow: 0 0 18px var(--orange-soft); }
.feature:nth-child(3) .feature-icon { background: var(--twitch-soft); }
.feature:nth-child(3) .feature-icon svg { stroke: var(--twitch); }
.feature:nth-child(3):hover .feature-icon { box-shadow: 0 0 18px var(--twitch-soft); }

.feature h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    transition: transform 0.25s ease;
}
.feature:hover h3 { transform: translateX(3px); }
.feature p {
    color: var(--text-secondary);
    font-size: 13.5px;
    margin: 0;
    line-height: 1.6;
}

/* ---------- Pricing ---------- */

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 40px 0 90px;
}
.plan {
    background: var(--surface);
    padding: 36px 32px;
}
.plan-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 20px;
}
.plan-tag i { width: 7px; height: 7px; border-radius: 50%; }
.plan h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.plan .price { font-family: var(--font-display); font-size: 34px; font-weight: 600; margin: 0 0 6px; }
.plan .price span { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--text-tertiary); }
.plan .desc { color: var(--text-secondary); font-size: 14px; margin: 0 0 26px; line-height: 1.55; }
.plan ul { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plan li { font-size: 13.5px; color: var(--text-secondary); padding-left: 20px; position: relative; }
.plan li::before { content: "→"; position: absolute; left: 0; color: var(--text-tertiary); }
.plan-actions { display: flex; gap: 10px; }
.plan-actions .btn { flex: 1; }
@media (max-width: 480px) { .plan-actions { flex-direction: column; } }

/* ---------- CTA band ---------- */

.cta-band {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 64px 0;
    text-align: left;
    margin-bottom: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -0.015em; margin: 0; max-width: 460px; text-wrap: balance; }
.cta-band p { color: var(--text-secondary); margin: 6px 0 0; font-size: 14.5px; }

/* ---------- Cards / generic ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
}

form label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 18px 0 7px;
}
form label:first-child { margin-top: 0; }

.input-wrap { position: relative; }
.input-wrap > svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    pointer-events: none;
}
.input-wrap input { padding-left: 38px; }
.input-wrap input.pw-input { padding-right: 40px; }

.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color 0.15s;
}
.pw-toggle:hover { color: var(--text-secondary); }
.pw-toggle svg { width: 17px; height: 17px; display: block; }
.pw-toggle .pw-eye-closed { display: none; }
.pw-toggle.pw-toggle-shown .pw-eye-open { display: none; }
.pw-toggle.pw-toggle-shown .pw-eye-closed { display: block; }

input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-tertiary); }

.hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 5px;
}

.pw-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.pw-strength-track {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    overflow: hidden;
}
.pw-strength-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    width: 0;
    transition: width 0.2s ease, background 0.2s ease;
}
.pw-strength-fill.pw-strength-weak { width: 33%; background: var(--danger); }
.pw-strength-fill.pw-strength-medium { width: 66%; background: var(--warn); }
.pw-strength-fill.pw-strength-strong { width: 100%; background: var(--success); }

.pw-strength-label {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.pw-strength-text-weak { color: var(--danger); }
.pw-strength-text-medium { color: var(--warn); }
.pw-strength-text-strong { color: var(--success); }

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin: 20px 0 0;
}

.auth-wrap {
    max-width: 420px;
    margin: 70px auto;
}
.auth-wrap .eyebrow { margin-bottom: 16px; }
.auth-wrap h1 { font-size: 27px; margin-bottom: 8px; }
.auth-wrap .subtitle { font-size: 14px; margin-bottom: 28px; max-width: none; }

/* ---------- Перемикач "Завжди активний" (дашборд каналів) ---------- */
.toggle-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.toggle-switch label { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-switch .track {
    width: 34px; height: 20px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    border: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.toggle-switch .track::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: transform 0.15s, background 0.15s;
}
.toggle-switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.toggle-switch input:checked + .track::after { transform: translateX(14px); background: var(--accent); }

/* ---------- Тарифи (/subscribe) ---------- */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 28px 0 40px;
}
@media (max-width: 860px) { .plans-grid { grid-template-columns: 1fr; } }
.pricing-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}
.pricing-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.pricing-price { font-family: var(--font-display); font-weight: 700; font-size: 34px; }
.pricing-period { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-tertiary); }
.pricing-card form { width: 100%; }
.plan-actions-stack { width: 100%; margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.plan-actions-stack form { margin-top: 0; }
.btn-trial-link {
    width: 100%;
    background: none;
    border: none;
    padding: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
    text-align: center;
}
.btn-trial-link:hover { text-decoration: underline; }
.pricing-card-bundle { border-color: var(--accent); padding-top: 34px; }
/* висота бейджа = line-height(1) 11px + padding 4px*2 = 19px — top:-19px
   ставить його РІВНО НАД карткою (нижній край бейджа = верхній край картки),
   без накладання на рамку, що раніше різало текст навпіл */
.pricing-badge-save {
    position: absolute;
    top: -19px; right: 16px;
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}
.pricing-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.pricing-features li::before {
    content: "→";
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.4;
    color: var(--accent);
}

/* ---------- Stat cards ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 22px 0 40px;
}
.stat {
    background: var(--surface);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease;
    opacity: 0;
    animation: stat-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stat:nth-child(1) { animation-delay: 0s; }
.stat:nth-child(2) { animation-delay: 0.08s; }
.stat:nth-child(3) { animation-delay: 0.16s; }
.stat:nth-child(4) { animation-delay: 0.24s; }
@keyframes stat-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.stat.stat-twitch::after { background: var(--twitch); }
.stat.stat-info::after { background: var(--lilac); }
.stat:hover { background: var(--surface-2); }
.stat:hover::after { transform: scaleX(1); }
.stat-icon {
    width: 28px; height: 28px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    margin-bottom: 14px;
    transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.4, 1), box-shadow 0.3s ease;
}
.stat-icon svg { width: 15px; height: 15px; stroke: var(--accent); }
.stat:hover .stat-icon { transform: scale(1.14) rotate(-6deg); box-shadow: 0 0 18px var(--accent-glow); }
.stat.stat-twitch .stat-icon { background: var(--twitch-soft); }
.stat.stat-twitch .stat-icon svg { stroke: var(--twitch); }
.stat.stat-twitch:hover .stat-icon { box-shadow: 0 0 18px var(--twitch-soft); }
.stat.stat-info .stat-icon { background: var(--lilac-soft); }
.stat.stat-info .stat-icon svg { stroke: var(--lilac); }
.stat.stat-info:hover .stat-icon { box-shadow: 0 0 18px var(--lilac-soft); }
.stat .label { font-size: 12px; color: var(--text-secondary); }
.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-top: 4px; }
.stat-clickable { cursor: pointer; }
.stat-clickable:hover .value { color: var(--accent); }

/* ---------- Метрика власника: модалка з графіком ---------- */

.metric-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.metric-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 680px;
}
.metric-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-modal-head h3 { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.metric-modal-periods { display: flex; gap: 6px; margin-top: 16px; }
.metric-period-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.metric-period-btn:hover { border-color: var(--accent); color: var(--accent); }
.metric-period-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.metric-modal-total { margin-top: 16px; font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.metric-modal-chart { margin-top: 12px; min-height: 240px; }
.metric-modal-chart svg { display: block; }
.metric-modal-chart rect { transition: fill 0.15s ease; }
.metric-modal-chart rect:hover { fill: var(--accent-hover, var(--accent)); opacity: 0.85; }

/* ---------- Sections ---------- */

.section-title {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 48px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ---------- Channel / stream rows ---------- */

.stream-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.stream-row:last-child { border-bottom: none; }

.avatar {
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
}

.row-title { display: flex; align-items: center; gap: 12px; }
.row-title .name { font-weight: 600; font-size: 14.5px; }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px 4px 8px;
    border-radius: 100px;
    font-family: var(--font-mono);
    white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-live { background: var(--accent-soft); color: var(--accent); }
.badge-live .dot { animation: pulse-dot 1.6s infinite; }
.badge-done, .badge-sent { background: var(--success-soft); color: var(--success); }
.badge-processing { background: var(--surface-3); color: var(--text-secondary); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--info-soft); color: var(--info); }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }
.badge-audio { background: var(--orange-soft); color: var(--orange); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.75); }
}

/* ---------- Clips ---------- */

.clip-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.clip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 10px 12px;
    font-family: var(--font-mono);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.clip-item .offset { color: var(--text); font-weight: 500; }

.intensity {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: var(--surface-3);
    overflow: hidden;
    flex-shrink: 0;
}
.intensity i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.clip-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}
.clip-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.clip-card-head .meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text);
}
.clip-card-head .meta .muted { color: var(--text-tertiary); }
.clip-title { font-weight: 600; }
.clip-title.collapsed { display: none; }

.clip-title-wrap { display: inline-flex; align-items: center; }

.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}
.btn-icon-inline svg { width: 13px; height: 13px; display: block; }
.btn-icon-inline:hover { color: var(--accent); background: var(--surface-3); }

/* поле перейменування ЗАМІНЮЄ напис прямо на місці — тому виглядає
   максимально близько до звичайного тексту, лише з підкресленням, що
   натякає на редагованість, а не як окрема плашка/форма нижче */
.rename-form-inline { display: inline-flex; }
.rename-form-inline.collapsed { display: none; }
.rename-form-inline input {
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--accent);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    padding: 0 1px;
    width: 16ch;
}
.rename-form-inline input:focus { outline: none; }
.clip-card video {
    width: 100%;
    border-radius: 4px;
    max-height: 320px;
    margin-top: 12px;
    display: block;
    background: #000;
}

.clip-video-wrap { position: relative; container-type: inline-size; }
.clip-card .clip-video-wrap video { margin-top: 12px; }

/* Макет-редактор вертикальної версії — довільна кількість зон прямо на
   кадрі відео (як у clips.twitch.tv/create), кожна перетягується і
   змінює розмір за кутики. :nth-of-type дає кожній зоні свій колір
   автоматично, без JS-логіки для присвоєння кольору. */
.vertical-crop-overlay {
    position: absolute;
    top: 12px; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}
.vertical-crop-overlay.collapsed { display: none; }
.crop-zone {
    position: absolute;
    border: 2px solid var(--accent);
    background: rgba(139, 92, 246, 0.10);
    border-radius: 4px;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}
.crop-zone:active { cursor: grabbing; }
.crop-zone.collapsed { display: none; }
.crop-zone:nth-of-type(2) { border-color: #ff9c4a; background: rgba(255, 156, 74, 0.10); }
.crop-zone:nth-of-type(3) { border-color: #4ac6ff; background: rgba(74, 198, 255, 0.10); }
.crop-zone:nth-of-type(4) { border-color: #ff4a9c; background: rgba(255, 74, 156, 0.10); }
.zone-label {
    position: absolute;
    top: 4px; left: 4px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
    border-radius: 50%;
    pointer-events: none;
}
.zone-remove {
    position: absolute;
    top: 2px; right: 2px;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 13px; line-height: 1;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}
.zone-remove.collapsed { display: none; }
/* показує, яку частину зони РЕАЛЬНО залишить cover-crop (обрізка без
   спотворення) — щоб форма намальованого прямокутника не вводила в оману.
   Обгортка з overflow:hidden потрібна окремо від .crop-zone (той навмисно
   БЕЗ overflow:hidden — інакше кутики-ручки, що стирчать за межі рамки на
   7px, обрізались би й зникали) */
.zone-hint-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 4px;
    pointer-events: none;
}
.zone-cover-hint {
    position: absolute;
    border: 1px dashed rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.45);
}
.zone-handle {
    position: absolute;
    width: 14px; height: 14px;
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 50%;
    pointer-events: auto;
    touch-action: none;
}
.zone-handle-nw { top: -7px; left: -7px; cursor: nwse-resize; }
.zone-handle-se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.zone-handle-ne { top: -7px; right: -7px; cursor: nesw-resize; }
.zone-handle-sw { bottom: -7px; left: -7px; cursor: nesw-resize; }

/* усі керування макет-редактора — самі лише іконки з тултипом (як і
   решта дій на кліпі), без підписів під ними */
.vertical-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}
[data-add-zone].collapsed,
[data-swap-zones].collapsed { display: none; }

.clip-download-wrap { position: relative; display: inline-flex; }
.clip-format-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    z-index: 6;
    min-width: 200px;
}
.clip-format-menu.collapsed { display: none; }
.clip-format-menu .btn { white-space: nowrap; }

/* "Портретна версія" — жива композиція поточних зон canvas'ами, точно як
   вийде у файлі, плюс повзунок-роздільник між сусідніми зонами в
   "Замостити" для прямого налаштування пропорції висоти (без потреби
   тягнути за кутик на альбомному кадрі) */
.vertical-preview-wrap { position: relative; display: flex; justify-content: center; width: 100%; }
.vertical-preview {
    width: 126px;
    height: 224px;
    display: flex;
    flex-direction: column;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
/* субтитри й тут (портретне прев'ю малюється canvas'ами й перебудовується
   при кожній зміні зони — .clip-caption-overlay всередині нього не
   вижив би, тож окрема рамка ТОЧНО того ж розміру лежить зверху, absolute
   виводить її з flex-розкладки, не заважаючи центруванню .vertical-preview */
.vertical-caption-frame {
    position: absolute;
    left: 50%; top: 0;
    transform: translateX(-50%);
    width: 126px; height: 224px;
    pointer-events: none;
    /* "size" (не "inline-size") — щоб нижче був доступний cqh, ним рахуємо
       розмір шрифту; бекенд рахує кегль як частку ВИСОТИ кадру
       (video_h * size_frac), а рамка тут 9:16 (не 16:9, як головне
       прев'ю) — cqw від вузької 126px-ширини давав зовсім іншу пропорцію
       й тому інші переноси рядків, ніж у реально випаленому відео */
    container-type: size;
    overflow: hidden;
}
/* колір рамки задається інлайново з JS (та сама послідовність, що й у
   .crop-zone на кадрі) — щоб одразу було видно, який прямокутник
   відповідає якому "поверху" в портретному прев'ю, незалежно від того,
   скільки разів зони переставляли кнопкою */
.preview-tile { width: 100%; display: block; }
.preview-divider {
    height: 10px;
    flex-shrink: 0;
    background: var(--surface-2);
    border-top: 1px solid var(--accent);
    border-bottom: 1px solid var(--accent);
    cursor: row-resize;
    touch-action: none;
    position: relative;
}
.preview-divider::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 3px;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 -5px 0 var(--accent), 0 5px 0 var(--accent);
}

.vertical-picker {
    margin-top: 10px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.vertical-picker.collapsed { display: none; }

/* ---------- Редагування субтитрів — вкладено в кладку "Вертикальний" ---------- */
.captions-embed {
    /* більше не всередині "Вертикальний" — самостійна картка (той самий
       вигляд, що й .vertical-picker), щоб редагування відкривалось
       незалежно і з меню "Оригінал" */
    margin-top: 10px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.captions-embed.collapsed { display: none; }
.captions-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}
.captions-line {
    display: flex;
    align-items: center;
    gap: 8px;
}
.captions-line-time {
    flex-shrink: 0;
    width: 38px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}
.captions-line input[type="text"] {
    flex: 1;
    padding: 7px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
}
.captions-line input[type="text"]:focus { border-color: var(--accent); outline: none; }
.captions-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.captions-preset-swatch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.captions-preset-swatch input { display: none; }
.captions-preset-swatch:has(input:checked) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.captions-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Живий оверлей субтитрів на прев'ю-відео ---------- */
/* той самий файл, що й ffmpeg/libass випалює у відео (fonts/Montserrat-
   Bold.ttf) — щоб живе прев'ю виглядало ІДЕНТИЧНО фінальному результату */
@font-face {
    font-family: "Montserrat Caption";
    src: url("/static/fonts/Montserrat-Bold.ttf") format("truetype");
    font-weight: 700;
}
.clip-caption-overlay {
    position: absolute;
    left: 6%; right: 6%;
    bottom: var(--caption-bottom, 14%);
    text-align: center;
    pointer-events: none;
    font-family: "Montserrat Caption", Arial, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    word-wrap: break-word;
    /* клієнт сам крутить розмір повзунком (captions-size-row) — одна
       трансформація на весь блок замість множення на кожен fs у кожному
       пресеті окремо, ефект той самий, що й \fs-масштаб на бекенді */
    transform: scale(var(--caption-scale, 1));
    transform-origin: center bottom;
}
.clip-caption-overlay:empty { display: none; }
.clip-caption-overlay mark { background: none; font-weight: 900; }

/* Повзунок положення субтитрів — вузька смуга праворуч від кадру, як
   вертикальний слайдер; переміщення ручки вгору/вниз напряму керує
   --caption-bottom оверлею (той самий елемент, що й у live-прев'ю) */
.caption-position-slider {
    position: absolute;
    right: 6px; top: 8%; bottom: 8%;
    width: 18px;
    z-index: 3;
}
.caption-position-track {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    pointer-events: none;
}
.caption-position-handle {
    position: absolute;
    left: 50%;
    width: 16px; height: 16px;
    transform: translate(-50%, 50%);
    background: var(--accent);
    border: 2px solid var(--bg);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.caption-position-handle:active { cursor: grabbing; }

.captions-size-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.captions-size-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.captions-size-readout {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    width: 40px;
    text-align: right;
}

/* Energy — біла "пігулка", чорний текст, **слово** жирніше (не кольором) */
.caption-preset-energy {
    font-size: clamp(12px, 3.8cqw, 19px);
    color: #101010;
}
.caption-preset-energy span {
    background: #fff;
    padding: 5px 16px;
    border-radius: 999px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Nova — перше слово велике біле капсом з товстою обводкою, решта менша */
.caption-preset-nova { color: #fff; }
.caption-preset-nova .nova-big {
    display: inline-block;
    font-size: clamp(18px, 6cqw, 30px);
    text-transform: uppercase;
    text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000;
}
.caption-preset-nova .nova-rest {
    font-size: clamp(12px, 3.6cqw, 18px);
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* Magazine — чорна плашка, білий текст, **слово** жовтим */
.caption-preset-magazine {
    font-size: clamp(12px, 3.8cqw, 19px);
    color: #fff;
}
.caption-preset-magazine span {
    background: #101010;
    padding: 5px 14px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.caption-preset-magazine mark { color: #f7c204; }

/* Focus — маленький контекст зверху + суцільний банер знизу з акцентним словом */
.caption-preset-focus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.caption-preset-focus .focus-context {
    background: #fff;
    color: #101010;
    font-size: clamp(11px, 3.2cqw, 15px);
    padding: 3px 10px;
    border-radius: 3px;
}
.caption-preset-focus .focus-banner {
    display: block;
    width: 100%;
    background: #e86a2a;
    color: #fff;
    font-size: clamp(16px, 5.2cqw, 26px);
    text-transform: uppercase;
    padding: 6px 10px;
}

/* Impact — слово за словом "виринає" синхронно з голосом (караоке-
   нарощення), білий текст з м'якою тінню, без плашки; кожне нове слово
   росте від меншого розміру (.pop, 140мс — той самий pop_ms, що й у
   captions_lib.py::_impact_events), **позначене** слово виринає одразу
   більшим (.big) */
.caption-preset-impact {
    color: #fff;
    /* --caption-font-px рахується в JS напряму від video.clientHeight
       (0.051 = size_frac Impact) — той самий підхід, що й у cqh для
       міні-прев'ю нижче, лише тут контейнер не має фіксованої висоти,
       тож container query недоступний; clamp — запасний варіант, поки
       відео ще не виміряне */
    font-size: var(--caption-font-px, clamp(19.5px, 6cqw, 30px));
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}
/* у мінікадрі (кладка "Вертикальний") — точно size_frac з captions_lib.py
   (0.051 = 5.1cqh, база вже підняте на 150%) від ВИСОТИ рамки, без клемпу
   під мінімальну читабельність: мета тут — 1:1 відповідність реальному
   відео, а не зручність читання мініатюри */
.vertical-caption-frame .caption-preset-impact { font-size: 5.1cqh; }
.caption-preset-impact .impact-word {
    display: inline-block;
    transform-origin: center bottom;
}
.caption-preset-impact .impact-word.big { font-size: 1.5em; }
.caption-preset-impact .impact-word.pop {
    animation: impact-pop 140ms cubic-bezier(0.25, 1, 0.4, 1.3) both;
}
@keyframes impact-pop {
    from { transform: scale(0.55); opacity: 0.7; }
    to { transform: scale(1); opacity: 1; }
}

.clip-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.stream-clips {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.stream-clips.collapsed { display: none; }

.clips-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}
.clips-toggle-btn:hover { background: var(--surface-2); color: var(--text); }
.clips-toggle-btn .chevron { width: 16px; height: 16px; transition: transform 0.25s ease; }
.clips-toggle-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ---------- Ручне підрізання меж кліпу ---------- */

.clip-trim {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.clip-trim.collapsed { display: none; }
.clip-trim-actions { display: flex; }

.clip-trim-labels {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text);
    font-weight: 600;
}
.clip-trim-dash { color: var(--text-tertiary); font-weight: 400; }

/* доріжка з двома "штучками" (handle) по краях виділеного проміжку —
   тягнеш будь-яку, щоб змінити початок/кінець кліпу */
.clip-trim-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    margin: 18px 9px;
}
.clip-trim-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--accent);
    border-radius: 3px;
}
.clip-trim-handle {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 1px var(--accent);
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.clip-trim-handle:hover,
.clip-trim-handle:focus-visible {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 0 1px var(--accent), 0 0 12px var(--accent-glow);
    outline: none;
}
.clip-trim-handle:active { cursor: grabbing; }

.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.clips-grid .clip-card video { max-height: 200px; }

.transcript-quote {
    margin-top: 10px;
    padding: 8px 12px;
    border-left: 2px solid var(--lilac);
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
}

/* ---------- Progress bar (YouTube export) ---------- */

.progress-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.progress-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}
.progress-label .pct { color: var(--text); font-weight: 600; }
.progress-track {
    height: 5px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* ---------- Empty state ---------- */

.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-secondary);
}
.empty-state .icon-ring {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.empty-state .icon-ring svg { width: 20px; height: 20px; stroke: var(--accent); }
.empty-state p { margin-top: 4px; font-size: 14px; }

/* ---------- Footer ---------- */

footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 12px;
    margin-top: 40px;
}
footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer .foot-logo { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-family: var(--font-display); font-weight: 600; font-size: 13px; }
footer .foot-logo .dot-mark { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.foot-social { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.foot-social-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.foot-social-link svg { width: 16px; height: 16px; display: block; }
.foot-social-link:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.foot-social-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, 4px);
    background: var(--surface-3);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.foot-social-link:hover::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.foot-signature-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    margin-right: 4px;
}
.foot-signature {
    height: 32px;
    width: auto;
    /* чорне чорнило (PNG на прозорому фоні) -> біле, щоб читалось на темному тлі сайту */
    filter: brightness(0) invert(1);
    opacity: 0.9;
}
.foot-signature-title {
    margin-top: -4px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.foot-legal { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-legal a { color: var(--text-tertiary); text-decoration: none; }
.foot-legal a:hover { color: var(--text-secondary); text-decoration: underline; }

/* ---------- Юридичні сторінки (умови, приватність, повернення) ---------- */

.legal-page {
    max-width: 720px;
    margin: 56px auto 80px;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.7;
}
.legal-page .eyebrow { margin-bottom: 16px; }
.legal-page h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.legal-page .legal-updated { color: var(--text-tertiary); font-family: var(--font-mono); font-size: 12.5px; margin-bottom: 40px; }
.legal-page h2 { color: var(--text); font-size: 19px; font-weight: 600; margin: 36px 0 12px; }
.legal-page p { margin: 0 0 14px; }
.legal-page ul { margin: 0 0 14px; padding-left: 20px; }
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--accent); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; padding: 56px 0 48px; }
    .hero-visual { margin-top: 40px; }
    .pricing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .feature-grid { grid-template-columns: 1fr; margin: 60px 0; }
    .feature { border-right: none; }
    .stats-grid { grid-template-columns: 1fr; }
    .cta-band { padding: 40px 0; flex-direction: column; align-items: flex-start; }

    nav .container { padding-left: 20px; }
    .nav-links { gap: 0; }

    /* ті самі іконки, що на десктопі, просто менші під вузький екран, і в
       тому ж компактному форматі, що й перемикач мови (auto-розмір під
       вміст, а не фіксований квадрат) — підказка при наведенні на дотику
       все одно не спрацює, тож ховаємо ::after замість "розгортання" в
       підпис */
    .nav-icon { width: auto; height: auto; padding: 8px 6px; }
    .nav-icon svg { width: 20px; height: 20px; }
    .nav-icon::after { display: none; }

    footer .container { flex-direction: column; align-items: flex-start; }

    /* рядки каналів/стримів (дашборд, адмінка) — на вузькому екрані бейдж і
       кнопка не влазять поруч із назвою в один рядок, тож переносимо їх під
       низ замість горизонтального скролу всієї сторінки */
    .stream-row { flex-wrap: wrap; row-gap: 10px; }
    .stream-row form { flex-wrap: wrap; row-gap: 8px; }
    .clip-card-head { flex-wrap: wrap; row-gap: 8px; }
    .clip-card-actions { flex-wrap: wrap; }
}
