/* ═══════════════════════════════════════════
   VideoForge AI — Deep Space Theme
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:          #080a12;
    --bg-2:        #0d1020;
    --surface:     rgba(255,255,255,0.042);
    --surface-2:   rgba(255,255,255,0.07);
    --surface-3:   rgba(99,102,241,0.06);
    --border:      rgba(99,102,241,0.13);
    --border-2:    rgba(99,102,241,0.24);
    --border-soft: rgba(255,255,255,0.07);
    --text:        #e2e4f2;
    --text-muted:  #7e82a2;
    --text-dim:    #50546e;
    --accent:      #6366f1;
    --accent-2:    #818cf8;
    --accent-dark: #4f46e5;
    --accent-glow: rgba(99,102,241,0.35);
    --purple:      #7c3aed;
    --purple-glow: rgba(124,58,237,0.3);
    --red:         #ef4444;
    --green:       #22c55e;
    --radius:      14px;
    --font:        'Inter', 'Outfit', -apple-system, sans-serif;
    --mono:        'Space Mono', 'Fira Code', monospace;
    --transition:  cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.6); }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ════════════════════════════════════════════
   AMBIENT BACKGROUND
   ════════════════════════════════════════════ */
.bg-grid {
    position: fixed; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
}

/* Center blue glow — like the Vidrush screenshot */
.bg-glow--1 {
    position: fixed;
    width: 1000px; height: 1000px;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(79,70,229,0.22) 0%,
        rgba(99,102,241,0.1) 35%,
        transparent 70%);
    filter: blur(60px);
    pointer-events: none; z-index: 0;
    animation: breatheGlow 8s ease-in-out infinite;
}
/* Left-side purple glow */
.bg-glow--2 {
    position: fixed;
    width: 700px; height: 700px;
    top: -100px; left: -200px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(124,58,237,0.2) 0%,
        rgba(109,40,217,0.08) 50%,
        transparent 70%);
    filter: blur(80px);
    pointer-events: none; z-index: 0;
    animation: breatheGlow 10s ease-in-out infinite reverse;
}
@keyframes breatheGlow {
    0%, 100% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
    50%       { opacity: 0.7; transform: translate(-50%, -55%) scale(1.08); }
}
/* Override transform for glow-2 which has no translate */
.bg-glow--2 { animation-name: breatheGlow2; }
@keyframes breatheGlow2 {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.65; transform: scale(1.1); }
}

#particles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.particle {
    position: absolute; border-radius: 50%;
    background: var(--accent); opacity: 0;
    animation: particleFloat 8s ease-in-out infinite;
}
@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.08; }
    50%      { transform: translateY(-50px) scale(1.3); opacity: 0.22; }
}

/* ════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════ */
.app-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 100px 20px 64px;
    position: relative; z-index: 1;
}

/* ════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════ */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s var(--transition) forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes fadeIn { to { opacity: 1; } }

.slide-up {
    opacity: 0; transform: translateY(20px);
    animation: slideUp 0.7s var(--transition) forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

/* ════════════════════════════════════════════
   HEADER — Full-width fixed nav bar
   ════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 28px;
    text-align: left;
    margin-bottom: 0;
    background: rgba(8, 10, 18, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}
.header-top {
    width: 100%;
    display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
}
.logo-row {
    display: flex; align-items: center;
    justify-content: flex-start; gap: 10px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.logo-row:hover { opacity: 0.82; }
.logo-mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(124,58,237,0.15));
    border: 1px solid rgba(99,102,241,0.4);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(99,102,241,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.logo-mark svg path { stroke: var(--accent-2); }
.logo-mark:hover {
    box-shadow: 0 0 32px rgba(99,102,241,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: rgba(99,102,241,0.6);
}
.logo-text {
    font-size: 20px; font-weight: 700; letter-spacing: -0.04em;
    background: linear-gradient(135deg, #e2e4f2 40%, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-badge {
    font-size: 10px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    padding: 2px 8px; border-radius: 5px; letter-spacing: 0.07em;
    box-shadow: 0 2px 12px rgba(99,102,241,0.4);
}
/* Tagline hidden in nav — keeps the DOM element but invisible */
.tagline { display: none; }

.project-menu-btn {
    width: 42px; height: 42px; border-radius: 12px;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.25s var(--transition);
    backdrop-filter: blur(12px);
}
.project-menu-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,0.5);
    background: rgba(99,102,241,0.1);
    color: var(--accent-2);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}

/* ════════════════════════════════════════════
   STEP BAR
   ════════════════════════════════════════════ */
.step-bar {
    display: flex; align-items: center;
    justify-content: center; gap: 0;
    margin-bottom: 28px;
    padding: 16px 22px;
    background:
        radial-gradient(120% 140% at 50% -40%, rgba(99,102,241,0.10), transparent 60%),
        rgba(10,12,22,0.62);
    backdrop-filter: blur(14px);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 30px rgba(0,0,0,0.28);
}
.step-item { display: flex; align-items: center; gap: 8px; }
.step-dot {
    position: relative;
    width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text-dim);
    transition: all 0.45s var(--transition); flex-shrink: 0;
    background: rgba(255,255,255,0.03);
}
.step-dot.active {
    border-color: rgba(129,140,248,0.7);
    background: rgba(99,102,241,0.16);
    color: #c7ccff;
}
.step-dot.current {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; transform: scale(1.18);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.18), 0 6px 20px rgba(99,102,241,0.55);
}
/* soft pulsing ring on the current step */
.step-dot.current::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 1.5px solid rgba(129,140,248,0.5);
    animation: stepPulse 1.8s ease-out infinite;
}
@keyframes stepPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}
.step-dot.done {
    border-color: transparent;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 0 14px rgba(34,197,94,0.25);
}
.step-label {
    font-size: 11px; font-weight: 600; color: var(--text-dim);
    transition: color 0.35s; letter-spacing: 0.04em; text-transform: uppercase;
}
.step-label.active { color: #e6e8ff; }
.step-line {
    width: 30px; height: 3px; border-radius: 3px;
    background: rgba(255,255,255,0.06); margin: 0 6px;
    overflow: hidden; position: relative;
    transition: background 0.5s ease;
}
.step-line.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px rgba(99,102,241,0.45);
}

/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card {
    background: linear-gradient(160deg,
        rgba(255,255,255,0.055) 0%,
        rgba(99,102,241,0.03) 50%,
        rgba(255,255,255,0.025) 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 26px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 24px 64px rgba(0,0,0,0.4),
        0 0 0 0 transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
    position: relative;
}
.card:hover {
    border-color: rgba(99,102,241,0.22);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.07),
        0 28px 72px rgba(0,0,0,0.45),
        0 0 60px rgba(99,102,241,0.04);
}
.card-title {
    font-size: 17px; font-weight: 600; color: #f0f1ff;
    margin-bottom: 4px; letter-spacing: -0.02em;
}
.card-subtitle {
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 20px; line-height: 1.6;
}

/* ════════════════════════════════════════════
   STEP SECTIONS — PAGE TRANSITIONS
   ════════════════════════════════════════════ */
.step-section { display: none; }
.step-section.active {
    display: block;
    animation: pageEnter 0.55s var(--transition) forwards;
}
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateX(28px) scale(0.985);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* ════════════════════════════════════════════
   LANDING HERO
   ════════════════════════════════════════════ */
.landing-hero { text-align: center; padding: 20px 0; }
.hero-icon {
    width: 92px; height: 92px; border-radius: 28px;
    background: linear-gradient(135deg,
        rgba(99,102,241,0.18),
        rgba(124,58,237,0.1));
    border: 1px solid rgba(99,102,241,0.28);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 28px;
    box-shadow:
        0 0 0 10px rgba(99,102,241,0.05),
        0 20px 60px rgba(99,102,241,0.15);
}
.hero-icon svg path { stroke: var(--accent-2); }
.pulse-glow { animation: heroGlow 4s ease-in-out infinite; }
@keyframes heroGlow {
    0%, 100% {
        box-shadow: 0 0 0 10px rgba(99,102,241,0.05),
                    0 0 0 0 rgba(99,102,241,0);
    }
    50%  {
        box-shadow: 0 0 0 14px rgba(99,102,241,0.07),
                    0 0 60px 8px rgba(99,102,241,0.12);
    }
}
.hero-title {
    font-size: 28px; font-weight: 700;
    line-height: 1.25; margin-bottom: 18px; min-height: 36px;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #ffffff 30%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-title .cursor {
    display: inline-block; width: 2px; height: 0.85em;
    background: var(--accent-2); margin-left: 2px;
    animation: blink 0.75s step-end infinite;
    vertical-align: text-bottom;
    -webkit-text-fill-color: var(--accent-2);
}
@keyframes blink { 50% { opacity: 0; } }
.hero-desc {
    font-size: 14px; color: var(--text-muted); line-height: 1.75;
    max-width: 460px; margin: 0 auto 34px; font-weight: 400;
}

/* ════════════════════════════════════════════
   CTA BUTTON
   ════════════════════════════════════════════ */
.cta-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff; border: none;
    padding: 13px 30px; border-radius: 12px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: var(--font);
    transition: transform 0.2s, box-shadow 0.25s;
    box-shadow:
        0 4px 24px rgba(99,102,241,0.4),
        inset 0 1px 0 rgba(255,255,255,0.18);
    position: relative; overflow: hidden;
    letter-spacing: -0.01em;
}
.cta-btn::after {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 65%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s ease;
}
.cta-btn:hover::after { left: 150%; }
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 36px rgba(99,102,241,0.5),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.cta-btn:active { transform: translateY(0); }
.cta-btn:disabled {
    opacity: 0.35; cursor: not-allowed;
    transform: none !important; box-shadow: none !important;
}
.cta-btn:disabled::after { display: none; }
.cta-btn--full { width: 100%; justify-content: center; }

/* ════════════════════════════════════════════
   GHOST BUTTON
   ════════════════════════════════════════════ */
.ghost-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-soft);
    border-radius: 10px; padding: 8px 16px;
    color: var(--text-muted); font-size: 12px; font-weight: 500;
    cursor: pointer; font-family: var(--font);
    transition: all 0.22s var(--transition);
    backdrop-filter: blur(8px);
}
.ghost-btn:hover {
    border-color: rgba(99,102,241,0.45);
    color: var(--accent-2);
    background: rgba(99,102,241,0.08);
    box-shadow: 0 2px 16px rgba(99,102,241,0.1);
}

/* ════════════════════════════════════════════
   PROJECT DRAWER
   ════════════════════════════════════════════ */
.project-drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(5,6,14,0.65);
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease; z-index: 8;
}
.project-drawer-overlay.active { opacity: 1; pointer-events: auto; }
.project-drawer {
    position: fixed; top: 0; right: 0;
    width: min(420px, 100vw); height: 100vh;
    padding: 24px 20px 20px;
    background: rgba(9,11,20,0.96);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(100%);
    transition: transform 0.28s var(--transition);
    z-index: 9; overflow-y: auto;
}
.project-drawer.active { transform: translateX(0); }
.project-drawer-head {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 14px; margin-bottom: 20px;
}
.project-drawer-title {
    font-size: 17px; font-weight: 700; color: #f0f1ff;
    letter-spacing: -0.025em;
}
.project-drawer-subtitle {
    font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 5px;
}
.project-drawer-actions { display: flex; gap: 8px; flex-shrink: 0; }
.saved-projects-loading,
.saved-projects-empty {
    font-size: 12px; color: var(--text-dim); padding: 16px 2px;
}
.project-list { display: grid; gap: 10px; }
.project-item {
    width: 100%; text-align: left;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(160deg,
        rgba(99,102,241,0.05),
        rgba(255,255,255,0.02));
    padding: 14px; color: inherit; cursor: pointer;
    transition: all 0.22s var(--transition);
}
.project-item:hover {
    transform: translateY(-1px);
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 8px 28px rgba(99,102,241,0.1);
    background: linear-gradient(160deg,
        rgba(99,102,241,0.09),
        rgba(255,255,255,0.03));
}
.project-item-top {
    display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.project-item-title { font-size: 14px; font-weight: 600; color: #f0f1ff; line-height: 1.35; }
.project-item-meta {
    display: flex; flex-wrap: wrap; gap: 8px 12px;
    margin-top: 10px; font-size: 11px; color: var(--text-muted);
}
.project-item-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.project-delete-btn {
    border: 1px solid rgba(239,68,68,0.28);
    background: rgba(239,68,68,0.06);
    color: #fca5a5; border-radius: 999px;
    padding: 5px 10px; font-size: 10px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer;
    transition: all 0.18s;
}
.project-delete-btn:hover {
    background: rgba(239,68,68,0.14);
    border-color: rgba(248,113,113,0.5);
    color: #fecaca;
}
.project-pill {
    display: inline-flex; align-items: center;
    border-radius: 999px; padding: 4px 9px;
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    background: rgba(255,255,255,0.05); color: #a5a8c4;
}
.project-pill--done {
    background: rgba(34,197,94,0.1); color: #86efac;
}

/* ════════════════════════════════════════════
   UPLOAD GRID
   ════════════════════════════════════════════ */
.upload-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px; margin-bottom: 20px;
}
.drop-zone {
    border: 1.5px dashed rgba(99,102,241,0.22);
    border-radius: 16px; padding: 36px 16px;
    text-align: center; cursor: pointer;
    transition: all 0.35s var(--transition);
    display: flex; flex-direction: column;
    align-items: center; gap: 9px;
    background: rgba(99,102,241,0.025);
}
.drop-zone:hover {
    border-color: rgba(99,102,241,0.55);
    background: rgba(99,102,241,0.06);
    box-shadow: 0 0 40px rgba(99,102,241,0.08);
    transform: translateY(-2px);
}
.drop-zone.loaded {
    border-color: var(--accent); border-style: solid;
    background: rgba(99,102,241,0.07);
    box-shadow: 0 0 30px rgba(99,102,241,0.1);
}
.drop-icon { color: var(--text-dim); transition: color 0.3s, transform 0.3s; }
.drop-zone:hover .drop-icon { color: var(--accent-2); transform: scale(1.12); }
.drop-zone.loaded .drop-icon { color: var(--accent); }
.drop-label {
    font-size: 13px; font-weight: 600; color: var(--text);
    word-break: break-all; max-width: 100%;
}
.drop-hint { font-size: 11px; color: var(--text-dim); }

/* ════════════════════════════════════════════
   ERROR BOX
   ════════════════════════════════════════════ */
.error-box {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5; border-radius: 10px;
    padding: 10px 14px; font-size: 12px; margin-top: 12px;
    animation: shake 0.4s ease;
    line-height: 1.5;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-5px); }
    75%       { transform: translateX(5px); }
}

/* ════════════════════════════════════════════
   STEP 2 — CONFIGURE
   ════════════════════════════════════════════ */
.files-ready { display: flex; justify-content: center; margin-bottom: 16px; }
.ready-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(34,197,94,0.07); color: var(--green);
    border: 1px solid rgba(34,197,94,0.18);
    border-radius: 20px; padding: 5px 16px;
    font-size: 12px; font-weight: 600;
    box-shadow: 0 0 16px rgba(34,197,94,0.07);
}
.file-chips {
    display: flex; gap: 8px; justify-content: center;
    flex-wrap: wrap; margin-bottom: 12px;
}
.chip {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface-3); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 14px;
    font-size: 12px; color: var(--text-muted);
    max-width: 240px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.stats-row {
    display: flex; gap: 16px; justify-content: center; margin-bottom: 16px;
}
.stat {
    font-size: 11px; color: var(--text-dim); font-family: var(--mono);
    display: flex; align-items: center; gap: 4px;
}
.stat strong { color: var(--accent-2); font-weight: 700; }
.preview-box {
    background: rgba(0,0,0,0.4); border-radius: 12px;
    padding: 16px; border: 1px solid var(--border);
}
.preview-label {
    font-size: 10px; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px;
}
.preview-text {
    font-size: 11px; color: var(--text-muted); font-family: var(--mono);
    white-space: pre-wrap; line-height: 1.65; margin: 0;
    max-height: 150px; overflow: auto;
}
.api-input-wrap { display: flex; gap: 8px; margin-top: 12px; }
.api-input {
    flex: 1; background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-2); border-radius: 11px;
    padding: 12px 15px; color: var(--text);
    font-size: 13px; font-family: var(--mono); outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.api-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.14);
}
.api-input::placeholder { color: rgba(126,130,162,0.5); }
.eye-btn {
    background: var(--surface); border: 1px solid var(--border-2);
    border-radius: 11px; padding: 0 16px;
    color: var(--text-muted); font-size: 12px;
    cursor: pointer; font-family: var(--font); font-weight: 500;
    transition: all 0.2s;
}
.eye-btn:hover { color: var(--accent-2); border-color: rgba(99,102,241,0.45); }
.api-hint { font-size: 11px; color: var(--text-dim); margin-top: 8px; line-height: 1.55; }
.api-link { color: var(--accent-2); text-decoration: none; }
.api-link:hover { text-decoration: underline; color: var(--accent); }

.generation-card {
    padding-top: 28px;
    padding-bottom: 28px;
}
.generation-main-title {
    font-size: 24px;
    margin-bottom: 6px;
}
.generation-main-subtitle {
    max-width: 620px;
}
.generation-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.generation-choice {
    position: relative;
    width: 100%;
    min-height: 150px;
    border: 1px solid var(--border-2);
    border-radius: 16px;
    background: rgba(15, 17, 35, 0.78);
    color: var(--text);
    padding: 22px 22px 18px;
    text-align: left;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.generation-choice-head { display: flex; align-items: center; gap: 11px; }
.generation-choice-ic {
    width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.gc-ic-auto { background: linear-gradient(135deg, #f97316, #f59e0b);
    box-shadow: 0 4px 14px rgba(249,115,22,0.35); }
.gc-ic-manual { background: rgba(255,255,255,0.06); border: 1px solid var(--border); }
.generation-choice-check {
    position: absolute; top: 14px; right: 14px;
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.18); opacity: 0; transform: scale(.7);
    transition: .18s;
}
.generation-choice.selected .generation-choice-check { opacity: 1; transform: scale(1);
    border-color: transparent; background: linear-gradient(135deg, var(--accent-orange), #f59e0b); }
.generation-choice.selected .generation-choice-check::after {
    content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
    border: solid #1a1505; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.generation-choice:hover {
    border-color: rgba(99,102,241,0.62);
    background: rgba(25, 29, 56, 0.92);
    transform: translateY(-1px);
}
.generation-choice.selected {
    border-color: var(--accent-orange);
    background: rgba(249,115,22,0.12);
    box-shadow: 0 0 0 1px rgba(249,115,22,0.28), 0 12px 34px rgba(249,115,22,0.12);
}
.generation-choice--auto {
    border-color: rgba(249,115,22,0.42);
}
.generation-choice--auto:hover {
    border-color: rgba(249,115,22,0.82);
}
.generation-choice-top {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-right: 28px;   /* keep the cost badge clear of the selected check */
}
.generation-choice-title {
    font-size: 23px;
    font-weight: 800;
    color: #f3f4ff;
    letter-spacing: 0;
}
.generation-choice-note {
    display: block;
    margin-top: auto;
    padding-top: 10px;
    width: 100%;
    border-top: 1px dashed rgba(255,255,255,0.10);
    font-size: 12.5px;
    font-weight: 600;
    color: #fbbf77;
}
.generation-choice:not(.generation-choice--auto) .generation-choice-note { color: #9aa0c0; }
.generation-cost {
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 13px;
    font-weight: 700;
    color: #fed7aa;
    background: rgba(249,115,22,0.12);
}
.generation-choice-desc {
    display: block;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
}
.generation-confirm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0,0,0,0.18);
}
.generation-confirm-text {
    flex: 1;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}
.generation-confirm-btn {
    min-width: 180px;
    justify-content: center;
}
@media (max-width: 620px) {
    .generation-choice-grid {
        grid-template-columns: 1fr;
    }
    .generation-confirm-row {
        align-items: stretch;
        flex-direction: column;
    }
    .generation-confirm-btn {
        width: 100%;
    }
}

/* ════════════════════════════════════════════
   PROCESSING
   ════════════════════════════════════════════ */
.processing-center {
    display: flex; flex-direction: column;
    align-items: center; padding: 32px 0; gap: 20px;
}
.pulse-ring-wrap { position: relative; width: 68px; height: 68px; }
.pulse-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--accent);
    animation: pulseRing 2.2s ease-out infinite;
}
.pulse-ring--2 {
    inset: 7px; animation-delay: 0.55s;
    border-color: var(--accent-2);
}
@keyframes pulseRing {
    0%   { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}
.pulse-core {
    position: absolute; inset: 17px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    animation: breatheCore 2s ease-in-out infinite;
    box-shadow: 0 0 24px rgba(99,102,241,0.5);
}
@keyframes breatheCore {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.14); }
}
.processing-title {
    font-size: 16px; font-weight: 600; color: #f0f1ff;
    text-align: center; letter-spacing: -0.02em;
}
.processing-desc {
    font-size: 13px; color: var(--text-muted); text-align: center;
    max-width: 420px; line-height: 1.6;
}
.progress-track {
    width: 80%; height: 3px; background: rgba(255,255,255,0.07);
    border-radius: 2px; overflow: hidden;
}
.progress-fill {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: progressSlide 2s ease-in-out infinite;
}
@keyframes progressSlide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}
.processing-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.p-step {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-dim); transition: color 0.3s;
}
.p-step.active { color: var(--text); }
.p-step.done   { color: var(--green); }
.p-step-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(255,255,255,0.1); flex-shrink: 0; transition: all 0.4s;
}
.p-step-dot.active {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(99,102,241,0.6);
    animation: dotPulse 1s ease-in-out infinite;
}
.p-step-dot.done { background: var(--green); box-shadow: none; animation: none; }
@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.6); }
}

/* ════════════════════════════════════════════
   RESULTS
   ════════════════════════════════════════════ */
.results-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 20px;
    flex-wrap: wrap; gap: 12px;
}
.results-title {
    font-size: 18px; font-weight: 700; color: #f0f1ff;
    display: flex; align-items: center; gap: 8px;
    letter-spacing: -0.025em;
}
.results-title svg path { stroke: var(--accent-2); }
.results-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.results-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.results-list { display: flex; flex-direction: column; gap: 6px; }

.music-choice-card {
    margin: 0 0 18px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(99,102,241,0.18);
    background:
        linear-gradient(160deg, rgba(255,255,255,0.055), rgba(99,102,241,0.035)),
        rgba(8,10,18,0.84);
}
.music-choice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.music-choice-count {
    font-size: 11px;
    color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.24);
    background: rgba(99,102,241,0.08);
    border-radius: 999px;
    padding: 6px 10px;
}
.music-ai-option,
.music-track {
    width: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.music-ai-option {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    transition: all 0.2s var(--transition);
}
.music-ai-option:hover { border-color: rgba(129,140,248,0.5); background: rgba(99,102,241,0.06); }
.music-ai-option.selected {
    border-color: var(--accent);
    background: linear-gradient(100deg, rgba(99,102,241,0.16), rgba(56,189,248,0.06));
    box-shadow: 0 0 0 1px rgba(99,102,241,0.25);
}
.music-ai-icon {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.music-ai-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.music-ai-title {
    font-size: 14.5px; font-weight: 800; color: #eef0ff;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.music-ai-badge {
    font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    color: #0b1020; background: linear-gradient(90deg, var(--accent-2), var(--accent));
    padding: 3px 8px; border-radius: 999px;
}
.music-ai-note { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.music-ai-radio {
    flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.25); position: relative; transition: .15s;
}
.music-ai-option.selected .music-ai-radio { border-color: var(--accent); }
.music-ai-option.selected .music-ai-radio::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.music-library-title {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.music-library-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

/* ── Clean custom music player (replaces the default browser audio UI) ── */
.mtrack {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 14px;
    border: 1px solid var(--border); background: rgba(255,255,255,0.035);
    transition: border-color .18s, background .18s, box-shadow .18s; min-width: 0;
}
.mtrack:hover { border-color: rgba(129,140,248,0.5); background: rgba(99,102,241,0.07); }
.mtrack.selected { border-color: var(--accent); background: rgba(99,102,241,0.12);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.25); }
.mtrack.playing { border-color: rgba(56,189,248,0.6); }
.mtrack-play {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    border: none; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(99,102,241,0.4); transition: transform .15s;
}
.mtrack-play:hover { transform: scale(1.07); }
.mtrack-play .ic-pause { display: none; }
.mtrack.playing .mtrack-play .ic-play { display: none; }
.mtrack.playing .mtrack-play .ic-pause { display: block; }
.mtrack-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.mtrack-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mtrack-name { font-size: 13px; font-weight: 700; color: #eef0ff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtrack-choose {
    flex-shrink: 0; font-size: 10.5px; font-weight: 800; cursor: pointer;
    color: var(--accent-2); border: 1px solid rgba(99,102,241,0.32);
    border-radius: 999px; padding: 5px 12px; background: transparent; transition: .15s;
}
.mtrack-choose:hover { background: rgba(99,102,241,0.16); }
.mtrack-choose.is-selected { background: var(--accent); color: #fff; border-color: transparent; }
.mtrack-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.10);
    cursor: pointer; overflow: hidden; }
.mtrack-fill { height: 100%; width: 0%; border-radius: 6px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .1s linear; }
.mtrack-meta { display: flex; justify-content: space-between; gap: 8px;
    font-size: 10.5px; color: var(--text-muted); }
.mtrack-time { font-variant-numeric: tabular-nums; color: var(--accent-2); font-weight: 700; }
.mtrack audio { display: none; }
@media (max-width: 720px) { .music-library-list { grid-template-columns: 1fr; } }
.music-track-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.music-track {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    transition: all 0.2s var(--transition);
}
.music-track:hover,
.music-track.selected {
    border-color: rgba(129,140,248,0.62);
    background: rgba(99,102,241,0.11);
}
.music-track-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.music-track-name {
    font-size: 13px;
    font-weight: 700;
    color: #eef0ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.music-track-meta {
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.3;
}
.music-track-check {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 999px;
    padding: 5px 8px;
}
.music-preview {
    width: 100%;
    height: 34px;
    opacity: 0.72;
}
.music-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    padding: 18px;
    text-align: center;
    font-size: 12px;
}
.music-choice-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.result-card {
    background: linear-gradient(160deg,
        rgba(255,255,255,0.04),
        rgba(99,102,241,0.025));
    border: 1px solid var(--border); border-left: 3px solid var(--border);
    border-radius: 12px; padding: 12px 16px;
    transition: all 0.3s var(--transition);
    opacity: 0; transform: translateY(14px);
    animation: cardEnter 0.5s var(--transition) forwards;
}
.result-card:hover {
    border-color: rgba(99,102,241,0.2);
    border-left-color: var(--accent);
    background: linear-gradient(160deg,
        rgba(255,255,255,0.055),
        rgba(99,102,241,0.04));
    box-shadow: 0 4px 24px rgba(99,102,241,0.07);
    transform: translateY(-1px);
}
@keyframes cardEnter { to { opacity: 1; transform: translateY(0); } }
.result-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-num {
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(99,102,241,0.1); color: var(--accent-2);
    font-size: 11px; font-weight: 700; font-family: var(--mono);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; border: 1px solid rgba(99,102,241,0.2);
}
.result-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.result-right {
    display: flex; align-items: center; gap: 6px;
    margin-left: auto; flex-shrink: 0;
}
.result-context {
    font-size: 12.5px; color: var(--text-muted); line-height: 1.45;
    flex: 1; min-width: 120px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.time-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(99,102,241,0.08); color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 7px; padding: 4px 11px;
    font-size: 11px; font-weight: 600; font-family: var(--mono); flex-shrink: 0;
}
.time-chip svg { width: 12px; height: 12px; }
.terms-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.term-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(99,102,241,0.07); border: 1px solid var(--border);
    border-radius: 7px; padding: 5px 11px;
    font-size: 11.5px; color: #b0b3d4; font-weight: 500;
    transition: all 0.2s;
}
.term-badge:hover { border-color: rgba(99,102,241,0.45); color: var(--accent-2); }
.term-badge svg { width: 12px; height: 12px; opacity: 0.5; }
.copy-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: 1px solid var(--border-soft);
    border-radius: 7px; padding: 5px 11px;
    font-size: 11px; color: var(--text-dim);
    cursor: pointer; font-family: var(--font);
    margin-left: auto; transition: all 0.2s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

/* expanded section */
.expanded-section {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--border);
    display: none;
}
.result-card.expanded .expanded-section { display: block; animation: fadeIn 0.3s ease; }
.expanded-label {
    font-size: 10px; font-weight: 700; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
}
.expanded-code { font-size: 12px; color: var(--accent-2); font-family: var(--mono); }
.query-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.query-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(99,102,241,0.1); color: var(--accent-2);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.query-text { font-size: 13px; color: #c4c7e0; }

/* ════════════════════════════════════════════
   CHUNK PROGRESS BARS
   ════════════════════════════════════════════ */
.overall-progress {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.overall-label { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.overall-pct {
    font-size: 14px; font-weight: 700;
    color: var(--accent-2); font-family: var(--mono);
}
.chunk-progress-wrap {
    display: flex; gap: 6px; width: 90%; flex-wrap: wrap; justify-content: center;
}
.chunk-bar {
    flex: 1; min-width: 60px; height: 32px;
    background: rgba(255,255,255,0.05); border-radius: 8px;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent; transition: border-color 0.3s;
}
.chunk-bar.processing { border-color: rgba(99,102,241,0.5); }
.chunk-bar.done { border-color: rgba(34,197,94,0.4); }
.chunk-bar.failed { border-color: rgba(239,68,68,0.4); }
.chunk-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0; border-radius: 8px; transition: width 0.5s ease;
}
.chunk-bar-fill.processing {
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
    animation: progressSlide 2s ease-in-out infinite;
}
.chunk-bar-fill.done {
    width: 100%; background: rgba(34,197,94,0.15); animation: none;
}
.chunk-bar-fill.failed {
    width: 100%; background: rgba(239,68,68,0.15); animation: none;
}
.chunk-bar-label {
    position: relative; z-index: 1;
    font-size: 10px; font-weight: 600; color: var(--text-muted);
    font-family: var(--mono);
}
.chunk-bar.done .chunk-bar-label { color: var(--green); }
.chunk-bar.failed .chunk-bar-label { color: #fca5a5; }
.chunk-bar.processing .chunk-bar-label { color: var(--accent-2); }

/* ════════════════════════════════════════════
   MANUAL FALLBACK
   ════════════════════════════════════════════ */
.fallback-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fallback-icon { font-size: 24px; }
.fallback-reason {
    font-size: 12px; color: #fca5a5;
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.16);
    border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}
.fallback-steps { display: flex; flex-direction: column; gap: 18px; }
.fb-step { display: flex; gap: 12px; align-items: flex-start; }
.fb-num {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(99,102,241,0.12); color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.25);
    font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-family: var(--mono);
}
.fb-step strong { color: #f0f1ff; font-size: 13px; }
.fb-desc { font-size: 12px; color: var(--text-muted); margin: 3px 0 8px; line-height: 1.4; }
.manual-textarea {
    width: 100%; min-height: 140px;
    background: rgba(0,0,0,0.4); border: 1px solid var(--border-2);
    border-radius: 11px; padding: 12px 14px;
    color: var(--text); font-size: 12px; font-family: var(--mono);
    line-height: 1.5; resize: vertical; outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.manual-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

/* ════════════════════════════════════════════
   PARTIAL WARNING
   ════════════════════════════════════════════ */
.partial-warning {
    background: rgba(251,191,36,0.06);
    border: 1px solid rgba(251,191,36,0.2);
    color: #fbbf24; border-radius: 10px;
    padding: 12px 16px; font-size: 12px;
    margin-bottom: 14px; line-height: 1.5;
}
.partial-warning strong { color: #fbbf24; }

/* ════════════════════════════════════════════
   STEP 5 — IMAGE DOWNLOAD
   ════════════════════════════════════════════ */
.img-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 14px;
    flex-wrap: wrap; gap: 12px;
}
.img-progress-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 6px;
}
.img-progress-label { font-size: 13px; font-weight: 600; color: var(--text); }
.img-progress-pct {
    font-size: 14px; font-weight: 700;
    color: var(--accent-2); font-family: var(--mono);
}
.img-progress-track {
    width: 100%; height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px; overflow: hidden; margin-bottom: 10px;
}
.img-progress-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-2));
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(99,102,241,0.5);
}
.img-current { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.stock-filter-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(34,197,94,0.05); border: 1px solid rgba(34,197,94,0.15);
    color: var(--green); border-radius: 8px;
    padding: 8px 14px; font-size: 11px; font-weight: 500;
    margin-bottom: 14px;
}
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.img-card {
    background: linear-gradient(160deg,
        rgba(255,255,255,0.045),
        rgba(99,102,241,0.025));
    border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    opacity: 0; transform: translateY(10px);
    animation: cardEnter 0.45s var(--transition) forwards;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.22s;
}
.img-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.35); }
.img-card--downloading { border-color: rgba(99,102,241,0.5); }
.img-card--retrying    { border-color: rgba(234,179,8,0.45); }
.img-card--done        { border-color: rgba(34,197,94,0.3); }
.img-card--failed      { border-color: rgba(239,68,68,0.3); }
.img-card--skipped     { border-color: rgba(96,165,250,0.3); }
.img-thumb {
    width: 100%; aspect-ratio: 16/10;
    background: rgba(0,0,0,0.5); position: relative; overflow: hidden;
}
.img-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    animation: fadeIn 0.4s ease;
}
.img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.img-num {
    font-size: 18px; font-weight: 700; color: #1e2040;
    font-family: var(--mono);
}
.img-spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.07);
    border-top-color: var(--accent);
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.img-info { padding: 8px 10px; }
.img-time {
    font-size: 10px; color: var(--accent-2); font-family: var(--mono);
    font-weight: 600; margin-bottom: 2px;
}
.img-term {
    font-size: 11px; color: var(--text-muted); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-bottom: 3px;
}
.img-status { font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.img-status--downloading { color: var(--accent-2); }
.img-status--retrying    { color: #eab308; }
.img-status--done        { color: var(--green); }
.img-status--failed      { color: #ef4444; }
.img-status--skipped     { color: #60a5fa; }
.img-meta-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.img-meta-pill {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    font-size: 9px; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
}
.img-meta-pill--type {
    color: var(--accent-2); border-color: rgba(99,102,241,0.25);
}
.img-meta-pill--role {
    color: #93c5fd; border-color: rgba(147,197,253,0.22);
}

/* Per-card QWEN test button */
.img-qwen-btn {
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 5px; padding: 3px 8px; font-size: 13px;
    background: rgba(168,85,247,0.1);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 6px; color: #c084fc; cursor: pointer;
    transition: background 0.15s, border-color 0.15s; line-height: 1;
}
.img-qwen-btn:hover  { background: rgba(168,85,247,0.2); border-color: rgba(168,85,247,0.55); }
.img-qwen-btn:active { background: rgba(168,85,247,0.3); }
.img-qwen-btn:disabled { opacity: 0.45; cursor: default; }

/* Image retry controls */
.img-retry-wrap { margin-top: 4px; }
.img-retry-btn {
    background: none; border: 1px solid var(--border);
    border-radius: 5px; padding: 2px 8px;
    font-size: 10px; color: var(--text-muted); cursor: pointer;
    font-family: var(--font); transition: all 0.2s;
}
.img-retry-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.img-retry-form { display: flex; gap: 4px; margin-top: 4px; }
.img-retry-input {
    flex: 1; min-width: 0; background: rgba(0,0,0,0.4);
    border: 1px solid var(--border); border-radius: 5px;
    padding: 3px 6px; color: var(--text);
    font-size: 10px; font-family: var(--mono); outline: none;
    transition: border-color 0.2s;
}
.img-retry-input:focus { border-color: var(--accent); }
.img-retry-go {
    background: var(--accent); border: none; border-radius: 5px;
    padding: 3px 8px; color: #fff; font-size: 10px; cursor: pointer;
    font-family: var(--font); font-weight: 600; flex-shrink: 0;
}

/* Image change panel */
.img-action-row { display: flex; gap: 4px; margin-top: 4px; }
.img-try-btn {
    flex: 1;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.28);
    border-radius: 5px; padding: 3px 6px;
    font-size: 10px; color: var(--accent-2); cursor: pointer;
    font-family: var(--font); transition: all 0.2s;
}
.img-try-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5); color: #fff;
}
.img-change-search-btn,
.img-change-upload-btn {
    flex: 1; background: none;
    border: 1px solid var(--border); border-radius: 5px;
    padding: 3px 6px; font-size: 10px;
    color: var(--text-muted); cursor: pointer;
    font-family: var(--font); transition: all 0.2s;
}
.img-change-search-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.img-change-upload-btn:hover { border-color: var(--green); color: var(--green); }

/* Paste from clipboard button */
.img-paste-btn {
    flex: 1; background: rgba(129,140,248,0.08);
    border: 1px solid rgba(129,140,248,0.28);
    border-radius: 5px; padding: 4px 6px;
    font-size: 10px; color: var(--accent-2); cursor: pointer;
    font-family: var(--font); font-weight: 500;
    transition: all 0.2s; white-space: nowrap; width: 100%;
}
.img-paste-btn:hover {
    background: rgba(129,140,248,0.18);
    border-color: rgba(129,140,248,0.55);
    color: #fff;
}
.img-upload-form { display: flex; margin-top: 4px; }
.img-upload-label {
    flex: 1; border: 1px dashed var(--border); border-radius: 5px;
    padding: 4px 8px; font-size: 10px;
    color: var(--text-muted); cursor: pointer;
    text-align: center; transition: all 0.2s;
}
.img-upload-label:hover { border-color: var(--green); color: var(--green); }
.img-placeholder--chart {
    background:
        linear-gradient(135deg, rgba(99,102,241,0.1), rgba(79,70,229,0.18)),
        #090b14;
}

/* Retry-all-failed bar — appears below progress when one or more scenes failed */
.retry-failed-bar {
    display: flex; align-items: center;
    gap: 12px;
    margin: 14px 0 6px;
    padding: 14px 16px;
    background: linear-gradient(100deg, rgba(234,179,8,0.10), rgba(234,179,8,0.03));
    border: 1px solid rgba(234,179,8,0.30);
    border-radius: 14px;
    font-family: var(--font);
}
.retry-failed-icon {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center; color: #fde68a;
    background: rgba(234,179,8,0.14); border: 1px solid rgba(234,179,8,0.28);
}
.retry-failed-text {
    flex: 1; font-size: 13px; font-weight: 600; color: #fde68a; letter-spacing: 0.2px;
}
.retry-failed-btn {
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b, #eab308);
    border: none; border-radius: 11px;
    padding: 9px 16px;
    font-size: 12.5px; font-weight: 800;
    color: #1a1505; cursor: pointer;
    font-family: var(--font);
    box-shadow: 0 6px 18px rgba(234,179,8,0.28);
    transition: all 0.15s;
}
.retry-failed-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.retry-failed-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Alternatives picker — modal overlay for choosing between Serper candidates */
.alt-picker-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 7, 14, 0.78);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    animation: alt-fade-in 0.18s ease-out;
}
@keyframes alt-fade-in { from { opacity: 0; } to { opacity: 1; } }

.alt-picker-modal {
    width: min(960px, 92vw);
    max-height: 88vh;
    overflow: auto;
    background: #0c0f1a;
    border: 1px solid rgba(99,102,241,0.32);
    border-radius: 14px;
    padding: 18px 18px 22px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.65);
    color: var(--text);
    font-family: var(--font);
}
.alt-picker-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 4px;
}
.alt-picker-title { font-size: 16px; font-weight: 600; color: #fff; }
.alt-picker-close {
    background: none; border: none;
    color: var(--text-muted); font-size: 22px; line-height: 1;
    cursor: pointer; padding: 4px 8px;
    border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.alt-picker-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.alt-picker-sub {
    font-size: 11px; color: var(--text-muted);
    margin-bottom: 14px;
}
.alt-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.alt-tile {
    background: #0a0d18;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0; overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-family: var(--font);
}
.alt-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 10px 24px rgba(99,102,241,0.18);
}
.alt-tile--active {
    border-color: rgba(34,197,94,0.6);
    box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}
.alt-tile-img {
    width: 100%; aspect-ratio: 16/9;
    background: #04060c; overflow: hidden;
}
.alt-tile-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.alt-tile-meta {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 8px;
    font-size: 10px; color: var(--text-muted);
}
.alt-tile-dim { letter-spacing: 0.3px; }
.alt-tile-badge {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.4);
    padding: 1px 6px; border-radius: 999px;
    font-size: 9px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════
   IMAGE VALIDATION
   ════════════════════════════════════════════ */
.val-config-bar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
    animation: slideUp 0.3s ease both;
    animation-delay: var(--delay, 0s);
}
.val-config-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.val-config-label {
    font-size: 11px; color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.val-url-input {
    background: rgba(0,0,0,0.4); border: 1px solid var(--border-2);
    border-radius: 6px; padding: 4px 10px;
    color: var(--text); font-size: 11px; font-family: var(--mono);
    outline: none; width: 220px; transition: border-color 0.2s;
}
.val-url-input:focus { border-color: var(--accent); }
.val-check-btn {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 4px 10px; font-size: 11px; color: var(--text-muted);
    cursor: pointer; font-family: var(--font); transition: all 0.2s;
}
.val-check-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.val-check-status { font-size: 11px; }
.val-check-status--ok  { color: var(--green); }
.val-check-status--err { color: var(--red); }
.val-summary { display: flex; gap: 6px; align-items: center; }
.val-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.val-pill--ok   { background: rgba(34,197,94,0.1);  color: var(--green); }
.val-pill--bad  { background: rgba(239,68,68,0.1);  color: var(--red); }
.val-pill--warn { background: rgba(234,179,8,0.1);  color: #eab308; }

.img-thumb { position: relative; }
.img-val-badge {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 900; line-height: 1;
    cursor: default; z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.img-val-badge--ok   { background: var(--green); color: #fff; }
.img-val-badge--bad  { background: var(--red); color: #fff; }
.img-val-badge--warn { background: #eab308; color: #fff; }
.img-card--rejected { border-color: rgba(239,68,68,0.55) !important; }
.img-card--validating {
    border-color: #a855f7 !important;
    animation: valPulse 1.1s ease-in-out infinite;
}
@keyframes valPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.4); }
    50%       { box-shadow: 0 0 0 5px rgba(168,85,247,0); }
}
.val-btn { display: inline-flex !important; }

/* ════════════════════════════════════════════
   REMOTION STUDIO
   ════════════════════════════════════════════ */
.studio-launch-center {
    display: flex; flex-direction: column;
    align-items: center; padding: 28px 0; gap: 18px;
}
.studio-running-center {
    display: flex; align-items: center;
    justify-content: center; gap: 10px; margin-bottom: 8px;
}
.studio-live-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(34,197,94,0.6);
    animation: dotPulse 1.5s ease-in-out infinite;
}
.studio-features {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 8px;
}
.studio-feature {
    display: flex; gap: 8px; align-items: flex-start;
    background: var(--surface-3); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px; font-size: 12px;
    color: var(--text-muted); line-height: 1.45;
    transition: border-color 0.2s;
}
.studio-feature:hover { border-color: var(--border-2); }
.studio-feature strong { color: #f0f1ff; font-size: 12px; display: block; margin-bottom: 2px; }
.sf-icon { font-size: 18px; flex-shrink: 0; }
@media (max-width: 520px) { .studio-features { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════
   VIDEO RENDER
   ════════════════════════════════════════════ */
.render-center {
    display: flex; flex-direction: column;
    align-items: center; padding: 28px 0; gap: 18px;
}
.render-progress-wrap {
    display: flex; align-items: center; gap: 12px; width: 85%;
}
.render-bar-track {
    flex: 1; height: 8px; background: rgba(255,255,255,0.07);
    border-radius: 4px; overflow: hidden;
}
.render-bar-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent-2));
    transition: width 1.2s ease; min-width: 0;
    box-shadow: 0 0 12px rgba(99,102,241,0.5);
}
.render-pct {
    font-size: 16px; font-weight: 700; color: var(--accent-2);
    font-family: var(--mono); min-width: 45px; text-align: right;
}
.effects-list {
    display: flex; flex-direction: column; gap: 4px;
    max-height: 250px; overflow-y: auto; margin-top: 8px;
}
.effect-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: 7px;
    background: rgba(99,102,241,0.04);
    opacity: 0; animation: cardEnter 0.3s ease forwards;
    font-size: 11px;
}
.effect-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(99,102,241,0.1); color: var(--accent-2);
    font-size: 9px; font-weight: 700; font-family: var(--mono);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.effect-time {
    font-family: var(--mono); font-size: 10px; color: var(--text-muted); min-width: 70px;
}
.effect-badge {
    background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2);
    color: var(--accent-2); padding: 2px 8px; border-radius: 4px;
    font-size: 10px; font-weight: 500; white-space: nowrap;
}
.effect-trans { color: var(--text-dim); font-size: 10px; margin-left: auto; }
.render-done-center {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px; padding: 18px 0;
}
.render-done-icon {
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.2);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 36px rgba(34,197,94,0.12);
}

/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */
.footer {
    text-align: center; font-size: 11px; color: var(--text-dim);
    margin-top: 52px; font-family: var(--mono); letter-spacing: 0.04em;
}

/* ════════════════════════════════════════════
   BACK BUTTON
   ════════════════════════════════════════════ */
.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 9px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: all 0.2s var(--transition);
    font-family: var(--font); margin-bottom: 20px;
}
.back-btn:hover {
    color: var(--accent-2);
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.06);
}

/* ════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(5,6,14,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: linear-gradient(160deg, #111320, #0d0f1e);
    border: 1px solid var(--border-2);
    border-radius: 22px;
    padding: 38px 28px 30px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow:
        0 40px 90px rgba(0,0,0,0.7),
        0 0 0 1px rgba(99,102,241,0.08) inset,
        0 0 80px rgba(99,102,241,0.05);
}
.modal-icon { font-size: 40px; margin-bottom: 14px; line-height: 1; }
.modal-title {
    font-size: 19px; font-weight: 700; color: var(--text);
    margin-bottom: 10px; letter-spacing: -0.025em;
}
.modal-body {
    font-size: 14px; color: var(--text-muted);
    line-height: 1.65; margin-bottom: 28px;
}
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.cta-btn--danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    box-shadow: 0 4px 20px rgba(239,68,68,0.38) !important;
}
.cta-btn--danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
}

.render-confirm-box { max-width: 540px; }
.render-confirm-icon {
    display: inline-grid; place-items: center;
    width: 54px; height: 54px; margin: 0 auto 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(6,182,212,0.12));
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--accent-2);
    font-size: 14px; font-weight: 800; letter-spacing: 0.08em;
}
.render-confirm-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px; margin: 18px 0;
}
.render-confirm-stat {
    text-align: left;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(255,255,255,0.09);
}
.render-confirm-stat span {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.render-confirm-stat strong {
    color: var(--text);
    font-size: 19px; font-weight: 800;
    letter-spacing: -0.02em;
}
.render-confirm-note {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 12px; line-height: 1.55;
}
@media (max-width: 520px) {
    .render-confirm-stats { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   FONT / VIDEO STYLE SELECTOR
   ════════════════════════════════════════════ */
.font-style-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-top: 10px;
}
.font-card {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: 14px; padding: 20px 10px 14px;
    cursor: pointer;
    transition: all 0.22s var(--transition);
    text-align: center;
    background: linear-gradient(160deg, var(--surface), var(--surface-3));
    overflow: hidden; user-select: none;
}
.font-card:hover:not(.font-card--disabled) {
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.06);
    transform: translateY(-2px);
}
.font-card.selected {
    border-color: var(--accent);
    background: rgba(99,102,241,0.1);
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.2),
        0 6px 28px rgba(99,102,241,0.15),
        inset 0 0 30px rgba(99,102,241,0.04);
}
.font-card--disabled { cursor: not-allowed; opacity: 0.4; pointer-events: none; }
.font-card-preview {
    font-size: 30px; font-weight: 700; color: var(--text);
    margin-bottom: 10px; line-height: 1; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
}
.font-card-name {
    font-size: 11px; font-weight: 700; color: var(--accent-2);
    text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 3px;
}
.font-card-desc { font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.font-card-badge {
    position: absolute; top: 7px; right: 7px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim); font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.06em;
    border: 1px solid var(--border);
}

.media-tone-section { margin-top: 18px; }
.media-tone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}
.media-tone-header label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.media-tone-header span {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
    max-width: 540px;
    text-align: right;
}
.media-tone-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.tone-card {
    align-items: center;
    background: linear-gradient(160deg, var(--surface), var(--surface-3));
    border: 1.5px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    min-height: 74px;
    padding: 12px;
    transition: all 0.22s var(--transition);
    user-select: none;
}
.tone-card:hover {
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.06);
    transform: translateY(-2px);
}
.tone-card.selected {
    border-color: var(--accent);
    background: rgba(99,102,241,0.1);
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.2),
        0 6px 28px rgba(99,102,241,0.15),
        inset 0 0 30px rgba(99,102,241,0.04);
}
.tone-preview {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 11px;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.28);
    flex: 0 0 76px;
    height: 46px;
    overflow: hidden;
}
.tone-preview--color {
    background:
        radial-gradient(circle at 22% 28%, #f97316 0 13%, transparent 14%),
        radial-gradient(circle at 78% 66%, #38bdf8 0 16%, transparent 17%),
        linear-gradient(135deg, #111827 0%, #4338ca 48%, #16a34a 100%);
}
.tone-preview--bw {
    background:
        radial-gradient(circle at 22% 28%, #f5f5f5 0 13%, transparent 14%),
        radial-gradient(circle at 78% 66%, #9ca3af 0 16%, transparent 17%),
        linear-gradient(135deg, #080808 0%, #5b5b5b 48%, #d4d4d4 100%);
}
.tone-name {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.tone-desc {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 3px;
}
@media (max-width: 620px) {
    .media-tone-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .media-tone-header span { text-align: left; }
    .media-tone-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   MEDIA MODE SELECTION
   ════════════════════════════════════════════ */
.mode-picker { margin-top: 30px; text-align: center; }
.media-mode-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px; margin-bottom: 20px;
    max-width: 620px; margin-left: auto; margin-right: auto;
}
.mode-card {
    position: relative;
    border: 1.5px solid var(--border); border-radius: 16px;
    padding: 24px 12px 20px;
    cursor: pointer;
    transition: all 0.22s var(--transition);
    background: linear-gradient(160deg, var(--surface), var(--surface-3));
    text-align: center; user-select: none;
}
.mode-card:hover {
    border-color: rgba(99,102,241,0.45);
    background: rgba(99,102,241,0.06);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99,102,241,0.1);
}
.mode-card.selected {
    border-color: var(--accent);
    background: rgba(99,102,241,0.1);
    box-shadow:
        0 0 0 1px rgba(99,102,241,0.2),
        0 8px 32px rgba(99,102,241,0.16),
        inset 0 0 30px rgba(99,102,241,0.04);
}
.mode-card-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.mode-card-name { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; }
.mode-card-tag { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.08em; }
.mode-card-desc { margin-top: 6px; font-size: 12.5px; color: #9da1c0; line-height: 1.5; font-weight: 400; }
.mode-card--disabled { cursor: not-allowed; opacity: 0.42; pointer-events: none; }
.mode-card-badge {
    position: absolute; top: 8px; right: 8px;
    background: rgba(255,255,255,0.04);
    color: var(--text-dim); font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: 0.06em;
}

.video-tools-error {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.2);
    color: #ef4444; border-radius: 8px;
    padding: 8px 14px; font-size: 12px;
    margin-bottom: 14px; max-width: 480px;
    margin-left: auto; margin-right: auto; text-align: left;
}

/* ── Copyright Caution Box ── */
.copyright-caution {
    max-width: 560px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg,
        rgba(234,179,8,0.06),
        rgba(251,191,36,0.03));
    border: 1px solid rgba(234,179,8,0.22);
    border-radius: 14px;
    padding: 16px 20px;
    text-align: left;
    animation: slideUp 0.4s var(--transition) both;
}
.caution-header {
    display: flex; align-items: center; gap: 8px;
    color: #fbbf24; font-size: 13px; font-weight: 700;
    margin-bottom: 10px; letter-spacing: 0.01em;
}
.caution-header svg { flex-shrink: 0; stroke: #fbbf24; }
.caution-body {
    font-size: 12px; color: #a8a28a; line-height: 1.65;
    margin-bottom: 14px;
}
.caution-checkbox-wrap {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; user-select: none;
}
.caution-checkbox-wrap input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.caution-checkbox-box {
    width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
    border: 1.5px solid rgba(234,179,8,0.4);
    background: rgba(234,179,8,0.05);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--transition);
    position: relative;
}
.caution-checkbox-wrap input:checked ~ .caution-checkbox-box {
    background: #fbbf24;
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251,191,36,0.35);
}
.caution-checkbox-wrap input:checked ~ .caution-checkbox-box::after {
    content: '';
    position: absolute;
    width: 5px; height: 9px;
    border: 2px solid #0a0c14;
    border-top: none; border-left: none;
    transform: rotate(42deg) translate(-1px, -1px);
}
.caution-checkbox-label {
    font-size: 12.5px; font-weight: 600;
    color: #c9b96e;
    transition: color 0.2s;
}
.caution-checkbox-wrap:hover .caution-checkbox-label { color: #fbbf24; }

/* ════════════════════════════════════════════
   VIDEO / FALLBACK BADGES
   ════════════════════════════════════════════ */
.video-badge {
    position: absolute; top: 6px; left: 6px;
    background: rgba(99,102,241,0.9);
    color: #fff; font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.5px;
    pointer-events: none; z-index: 3;
}
.fallback-badge {
    display: inline-block;
    background: rgba(99,102,241,0.85);
    color: #fff; font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.4px; margin-top: 4px;
}

/* ════════════════════════════════════════════
   HYBRID DECISION PILL
   ════════════════════════════════════════════ */
.hybrid-decision {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 10px; font-weight: 600;
    background: rgba(99,102,241,0.1); color: var(--accent-2);
    border: 1px solid rgba(99,102,241,0.22);
    margin-top: 5px; cursor: default;
}

/* ════════════════════════════════════════════
   BACKGROUND PICKER (Step 6)
   ════════════════════════════════════════════ */
.bg-loading {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px 0;
}

/* Layout toggle */
.layout-toggle-group {
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.layout-toggle-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.layout-toggle {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.layout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

.layout-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}

.layout-btn.active {
    background: rgba(249, 115, 22, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

.layout-toggle-desc {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Background card grid */
.bg-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

/* Background chooser: grid on the left, live preview sticky on the right. */
.bg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}
.bg-preview-col { position: sticky; top: 12px; }
.bg-preview-eyebrow {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); margin-bottom: 8px;
}
.bg-preview-frame {
    position: relative; width: 100%; aspect-ratio: 16 / 9;
    border-radius: 14px; overflow: hidden; background: #000;
    border: 1px solid var(--border);
    box-shadow: 0 14px 40px rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
}
.bgp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bgp-scene { position: relative; z-index: 2; object-fit: cover; display: block;
    box-shadow: 0 6px 22px rgba(0,0,0,0.5); }
.bgp-scene.full { width: 100%; height: 100%; border-radius: 0; }
.bgp-scene.framed { width: 75%; height: 75%; border-radius: 8px;
    outline: 2px solid rgba(255,255,255,0.12); }
.bg-preview-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 10px; }
@media (max-width: 880px) {
    .bg-layout { grid-template-columns: 1fr; }
    .bg-preview-col { position: static; order: -1; max-width: 360px; }
}

.bg-card {
    border-radius: 12px;
    border: 2px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s, transform 0.15s, box-shadow 0.18s;
    background: var(--surface);
}

.bg-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.15);
}

.bg-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.bg-card-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0c;
    position: relative;
    overflow: hidden;
}

.bg-card-video-wrap {
    position: relative;
}

.bg-card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bg-card-video.is-preview-ready + .bg-card-play-icon {
    background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.24));
}

.bg-card-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    transition: opacity 0.15s;
    pointer-events: none;
}

.bg-card:hover .bg-card-play-icon {
    opacity: 0;
}

.bg-card-label {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 520px) {
    .upload-grid { grid-template-columns: 1fr; }
    .hero-title  { font-size: 22px; }
    .step-label  { display: none; }
    .step-line   { width: 16px; }
    .results-header { flex-direction: column; }
    .media-mode-grid { grid-template-columns: 1fr; }
    .music-library-list { grid-template-columns: 1fr; }
    .music-choice-actions .cta-btn { width: 100%; justify-content: center; }
    .app-container { padding: 88px 14px 52px; }
    .header { padding: 0 16px; }
    .bg-picker-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .bg-step-actions { flex-direction: column; }
}
