:root {
  --bg:#0a1126;
  --bg2:#121a39;
  --indigo:#4f46e5;
  --violet:#7c3aed;
  --text:#0f172a;
  --muted:#64748b;
  --panel:#ffffff;
  --border:#e2e8f0;
  --shadow:0 10px 30px rgba(15,23,42,.12);
  --radius:16px;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(160deg,var(--bg),var(--bg2));color:#e2e8f0;min-height:100vh}
a{color:inherit}
.shell{max-width:1120px;margin:0 auto;padding:0 20px}
.shell-wide{max-width:1320px}
.site-topbar{position:sticky;top:0;z-index:10;background:rgba(8,13,31,.78);backdrop-filter:blur(8px);border-bottom:1px solid rgba(148,163,184,.2)}
.topbar-inner,.footer-inner{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:18px 0}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-weight:700}
.brand-mark{display:inline-flex;width:32px;height:32px;border-radius:10px;background:linear-gradient(135deg,var(--indigo),var(--violet));align-items:center;justify-content:center;color:#fff}
.top-nav,.footer-links{display:flex;gap:12px;align-items:center}
.top-nav a,.side-nav a,.footer-links a{text-decoration:none;padding:8px 12px;border-radius:10px;color:#cbd5e1}
.top-nav a.is-active,.side-nav a.is-active,.top-nav a:hover,.side-nav a:hover{background:rgba(79,70,229,.2);color:#fff}
.page-content{padding:40px 20px 60px}
.hero{display:grid;grid-template-columns:1.2fr .8fr;gap:24px;align-items:center;padding:48px;background:linear-gradient(160deg,rgba(79,70,229,.25),rgba(124,58,237,.18));border:1px solid rgba(148,163,184,.25);border-radius:28px;box-shadow:0 30px 60px rgba(2,6,23,.35)}
.hero h1{font-size:clamp(2rem,4vw,3.2rem);margin:0 0 12px}
.lead{color:#cbd5e1;line-height:1.6}
.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:20px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:11px 18px;border-radius:12px;border:1px solid transparent;text-decoration:none;cursor:pointer;font-weight:600;transition:all .2s ease}
.btn-sm{padding:7px 11px;font-size:.82rem;border-radius:10px}
.btn-primary{background:linear-gradient(135deg,#5b48f0,#8b5cf6);color:#fff;box-shadow:0 10px 24px rgba(91,72,240,.35)}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(91,72,240,.45)}
.btn-primary:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(139,92,246,.35),0 12px 26px rgba(91,72,240,.4)}
.btn-primary:active{transform:translateY(0)}
.btn-secondary{background:#fff;color:#0f172a}
.btn-soft{background:#e0e7ff;border-color:#c7d2fe;color:#3730a3}
.btn-soft:hover{background:#c7d2fe}
.btn-outline{border-color:#7c86a2;color:#334155;background:#fff}
.btn-outline:hover{background:#eef2ff;border-color:#6366f1;color:#312e81}
.btn-danger-outline{border-color:#ef4444;background:#fff;color:#b91c1c}
.btn-danger-outline:hover{background:#fef2f2}
.btn-disabled,.btn:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;transform:none}
.btn-pulse{animation:btnPulse 1.2s ease-in-out infinite alternate}
@keyframes btnPulse{from{box-shadow:0 8px 18px rgba(91,72,240,.25)}to{box-shadow:0 0 0 4px rgba(139,92,246,.2),0 14px 26px rgba(91,72,240,.45)}}
.section{margin-top:26px}
.section h2{margin:0 0 14px}
.grid{display:grid;gap:16px}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.card{background:var(--panel);color:var(--text);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:var(--radius);padding:20px}
.card h3,.card h4{margin-top:0}
.card p{color:var(--muted)}
.metric{font-size:1.85rem;font-weight:700;color:#0f172a;margin:6px 0}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;background:#fff;color:#0f172a;border-radius:14px;overflow:hidden}
th,td{padding:14px;border-bottom:1px solid #eef2ff;text-align:left}
tr:hover td{background:#f8fafc}
.badge{display:inline-flex;padding:5px 10px;border-radius:999px;font-size:.8rem;font-weight:700}
.badge-created{background:#dbeafe;color:#1d4ed8}
.badge-queued{background:#ede9fe;color:#6d28d9}
.badge-rendering{background:#fef3c7;color:#b45309}
.badge-done{background:#dcfce7;color:#15803d}
.badge-failed{background:#fee2e2;color:#b91c1c}
.badge-muted{background:#e2e8f0;color:#334155}
.badge-scheduled-auto{background:#dbeafe;color:#1d4ed8}
.badge-ready-auto{background:#ede9fe;color:#6d28d9}
.badge-uploading{background:#fef3c7;color:#b45309}
.empty-state{text-align:center;padding:44px;background:#fff;color:#475569;border:1px dashed #cbd5e1;border-radius:16px}
.auth-shell{min-height:calc(100vh - 190px);display:grid;place-items:center;padding:20px}
.auth-card{width:min(480px,100%)}
.form-group{margin-bottom:16px}
.form-label{display:block;font-weight:600;color:#0f172a;margin-bottom:7px}
.input,.textarea,select{width:100%;padding:12px 13px;border:1px solid #cbd5e1;border-radius:12px;background:#fff;color:#0f172a}
.textarea{min-height:100px;resize:vertical}
.help{font-size:.86rem;color:#64748b;margin-top:6px}
.alert{border-radius:12px;padding:12px 14px;margin-bottom:14px;border:1px solid transparent}
.alert-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.app-shell{display:grid;grid-template-columns:250px 1fr;min-height:100vh}
.app-sidebar{background:rgba(2,6,23,.58);border-right:1px solid rgba(148,163,184,.2);padding:22px;position:sticky;top:0;height:100vh}
.side-nav{display:flex;flex-direction:column;gap:8px;margin-top:22px}
.app-main-wrap{min-width:0}
.app-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:24px 28px 8px}
.page-title{margin:0;color:#e2e8f0}
.page-subtitle{margin:6px 0 0;color:#94a3b8}
.app-main{padding:14px 28px 60px}
.page-panel{background:#f8fafc;border-radius:20px;padding:18px;border:1px solid #dbe4fb}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.check-row{display:flex;align-items:center;justify-content:space-between;padding:12px;border-bottom:1px solid #eef2ff}
.check-pass{color:#166534}.check-fail{color:#b91c1c}
pre{background:#0f172a;color:#cbd5e1;padding:12px;border-radius:12px;overflow:auto;max-height:280px;font-size:.82rem}
.scene-card{position:relative;padding-top:46px}
.scene-number{position:absolute;top:16px;left:16px;width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:#e0e7ff;color:#3730a3;font-weight:700}
.scene-image-status{position:absolute;top:16px;right:16px}
.scene-status-empty{background:#e2e8f0;color:#334155}
.scene-status-generating{background:#dbeafe;color:#1d4ed8}
.scene-status-ready{background:#dcfce7;color:#166534}
.scene-status-failed{background:#fee2e2;color:#b91c1c}
.scene-missing-image{border-color:#f59e0b;box-shadow:0 0 0 2px rgba(245,158,11,.2),var(--shadow)}
.sticky-actions{position:sticky;bottom:14px;background:#fff;border:1px solid #cbd5e1;border-radius:16px;padding:12px;display:flex;justify-content:flex-end;box-shadow:var(--shadow);margin-top:14px}
.site-footer{border-top:1px solid rgba(148,163,184,.2);margin-top:24px}
@media (max-width:960px){
  .hero,.grid-4,.grid-3{grid-template-columns:1fr}
  .app-shell{grid-template-columns:1fr}
  .app-sidebar{position:relative;height:auto}
  .app-header,.app-main{padding:20px}
}

.alert-success{background:#ecfdf3;border-color:#86efac;color:#166534}
.credit-badge{display:inline-flex;align-items:center;gap:8px;padding:12px 18px;border-radius:999px;font-weight:700}
.credit-badge.premium{background:linear-gradient(135deg,#312e81,#6d28d9);color:#fff;box-shadow:0 12px 28px rgba(79,70,229,.35);border:1px solid rgba(199,210,254,.35)}
.billing-hero{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 24px;background:linear-gradient(135deg,rgba(79,70,229,.25),rgba(139,92,246,.23));border:1px solid rgba(196,181,253,.35);border-radius:20px}
.pricing-card{position:relative;overflow:hidden}
.premium-card{border:1px solid #c4b5fd;background:linear-gradient(180deg,#ffffff,#f5f3ff)}
.plan-code{display:inline-flex;padding:6px 10px;border-radius:999px;background:#ede9fe;color:#5b21b6;font-size:.72rem;font-weight:700;letter-spacing:.06em}
.pricing{font-size:2rem;font-weight:800;color:#0f172a;margin:6px 0 10px}
.scene-preview-frame{border:1px solid #dbe4fb;background:radial-gradient(circle at 50% 20%,#ffffff,#edf2ff 55%,#e2e8f0);border-radius:14px;min-height:220px;display:grid;place-items:center;overflow:hidden;margin-bottom:12px;padding:10px;position:relative}
.scene-preview-frame::after{content:'';position:absolute;inset:10px;border:1px dashed rgba(148,163,184,.35);border-radius:10px;pointer-events:none}
.scene-preview-frame.scene-preview--landscape{aspect-ratio:16/9}
.scene-preview-frame.scene-preview--portrait{aspect-ratio:9/16;max-height:380px}
.scene-preview-frame.scene-preview--square{aspect-ratio:1/1;max-height:320px}
.scene-preview{width:100%;height:100%;object-fit:contain;display:block;border-radius:10px;background:#f8fafc}
.scene-preview-empty{color:#64748b;font-weight:600;z-index:1}
.scene-inline-alert{min-height:20px;margin-bottom:8px}

.ai-btn{box-shadow:0 10px 24px rgba(79,70,229,.28)}
.ai-btn:disabled{opacity:.7;cursor:not-allowed}
.premium-actions{gap:10px}
.status-box{padding:10px 12px;border-radius:12px;margin:0 0 12px;border:1px solid transparent;font-weight:600}
.status-info{background:#eef2ff;border-color:#c7d2fe;color:#3730a3}
.status-success{background:#ecfdf3;border-color:#86efac;color:#166534}
.status-error{background:#fef2f2;border-color:#fecaca;color:#991b1b}
.status-warning{background:#fff7ed;border-color:#fdba74;color:#9a3412}
.btn.is-loading{position:relative;opacity:.85}
.qv-progress{position:relative;height:14px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin-bottom:12px;border:1px solid #cbd5e1}
.qv-progress-bar{height:100%;background:linear-gradient(135deg,var(--indigo),var(--violet));transition:width .25s ease}
.qv-progress-label{display:block;margin-top:6px;font-size:.8rem;color:#334155;font-weight:700}

.qv-stepper{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:8px 0 6px}
.qv-step{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #dbe4fb;border-radius:12px;background:#f8fafc}
.qv-step-dot{width:10px;height:10px;border-radius:999px;background:#94a3b8;display:inline-block}
.qv-step-label{font-size:.85rem;font-weight:700;color:#334155}
.qv-step.is-waiting{opacity:.8}
.qv-step.is-running{border-color:#93c5fd;background:#eff6ff}.qv-step.is-running .qv-step-dot{background:#2563eb;box-shadow:0 0 0 4px rgba(59,130,246,.2)}
.qv-step.is-success{border-color:#86efac;background:#ecfdf3}.qv-step.is-success .qv-step-dot{background:#16a34a}
.qv-step.is-warning{border-color:#fcd34d;background:#fffbeb}.qv-step.is-warning .qv-step-dot{background:#d97706}
.qv-step.is-failed{border-color:#fca5a5;background:#fef2f2}.qv-step.is-failed .qv-step-dot{background:#dc2626}
@media (max-width:960px){.qv-stepper{grid-template-columns:repeat(2,minmax(0,1fr));}}

.qv-output-grid{align-items:stretch}
.qv-output-card{display:flex;flex-direction:column;gap:12px;background:linear-gradient(180deg,#ffffff,#f8fafc);border:1px solid #dbe4fb}
.qv-output-card video{width:100%;border-radius:12px;background:#020617;box-shadow:0 8px 24px rgba(15,23,42,.25)}

.series-summary{display:flex;gap:10px;flex-wrap:wrap}
.series-chip{padding:8px 12px;border:1px solid #c7d2fe;background:#eef2ff;color:#3730a3;border-radius:999px;font-weight:700}
.table-actions{display:flex;gap:8px;flex-wrap:wrap}
.inline-form{display:inline-flex;align-items:center;gap:8px;margin:0}
.autopilot-empty-card{text-align:center;background:linear-gradient(160deg,#ffffff,#eef2ff);padding:36px}
.autopilot-empty-card h2{margin:12px 0 6px}
.autopilot-empty-icon{width:68px;height:68px;border-radius:20px;margin:0 auto;background:linear-gradient(135deg,var(--indigo),var(--violet));display:grid;place-items:center;color:#fff;font-size:1.6rem;box-shadow:0 16px 34px rgba(79,70,229,.25)}
.tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab{padding:10px 14px;border-radius:12px;border:1px solid #cbd5e1;background:#fff;color:#334155;text-decoration:none;font-weight:700}
.tab.is-active{background:linear-gradient(135deg,var(--indigo),var(--violet));color:#fff;border-color:transparent}
.calendar-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px}
.calendar-day{border:1px solid #dbe4fb;background:#fff;border-radius:12px;padding:10px;min-height:120px}
.calendar-item{border:1px solid #e2e8f0;border-radius:10px;padding:8px;margin-top:8px;background:#f8fafc;font-size:.9rem;color:#1e293b;display:flex;flex-direction:column;gap:4px}
.calendar-item small{color:#64748b}
@media (max-width:960px){.calendar-week{grid-template-columns:repeat(2,minmax(0,1fr));}}

.btn-google{display:flex;align-items:center;justify-content:center;gap:10px;background:#fff;border:1px solid #cbd5e1;color:#0f172a;font-weight:600;box-shadow:0 8px 18px rgba(15,23,42,.08)}
.btn-google:hover{background:#f8fafc}
.auth-divider{position:relative;text-align:center;margin:12px 0 14px}
.auth-divider:before{content:"";position:absolute;left:0;right:0;top:50%;border-top:1px solid #e2e8f0}
.auth-divider span{position:relative;background:#fff;padding:0 10px;color:#64748b;font-size:12px}
.oauth-cards .card{min-height:210px}
.oauth-status{font-size:13px;color:#475569;margin:6px 0}
.folder-browser{max-height:220px;overflow:auto;border:1px solid #e2e8f0;border-radius:12px;padding:8px}
.folder-row{display:flex;justify-content:space-between;gap:10px;padding:8px;border-bottom:1px solid #f1f5f9}
.folder-row:last-child{border-bottom:0}
.card .actions label{display:inline-flex;align-items:center;gap:6px}
.schedule-days{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 14px}
.day-pill{border:1px solid #c7d2fe;background:#eef2ff;border-radius:999px;padding:6px 10px;color:#3730a3;font-weight:700}
.day-pill input{margin-right:4px}

.legal-wrap{max-width:920px;margin:0 auto}
.legal-card{background:#fff;color:#0f172a;border:1px solid #dbe4fb;border-radius:20px;box-shadow:var(--shadow);padding:26px}
.legal-card h1{margin:0 0 8px;font-size:clamp(1.7rem,3vw,2.25rem)}
.legal-card h2{margin:22px 0 8px;font-size:1.2rem}
.legal-card p,.legal-card li{color:#334155;line-height:1.7}
.legal-card ul{margin:8px 0 0 18px;padding:0}
.legal-last-updated{display:inline-flex;padding:6px 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:.82rem;font-weight:700;margin-bottom:8px}
.legal-intro{border-top:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;padding:12px 0;margin:12px 0}
.legal-toc{margin-top:12px;padding:14px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.legal-toc ol{margin:8px 0 0 18px}
.legal-toc a{color:#3730a3;text-decoration:none}
.legal-toc a:hover{text-decoration:underline}
.legal-contact{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:14px}
.provider-card{border-width:2px}
.provider-connected{border-color:#86efac}
.provider-disconnected{border-color:#e2e8f0}

.privacy-summary{padding:10px 12px;border-radius:12px;border:1px solid #c7d2fe;background:#eef2ff;color:#312e81;font-weight:600}
.provider-card .alert{margin-top:10px;margin-bottom:0}

.btn-primary,.btn-soft,.btn-outline,.btn-danger-outline{transition:all .18s ease}
.btn-primary,.btn-soft,.btn-outline,.btn-danger-outline,.btn-icon{font-weight:700}
.btn-primary{background:linear-gradient(135deg,#5b3ff2,#8b5cf6 55%,#7c3aed);color:#fff;border-color:transparent;box-shadow:0 14px 28px rgba(92,63,242,.35)}
.btn-soft{background:linear-gradient(180deg,#eef2ff,#e0e7ff);border:1px solid #c7d2fe;color:#3730a3}
.btn-outline{background:#fff;border:1px solid #818cf8;color:#312e81}
.btn-danger-outline{background:#fff;border:1px solid #ef4444;color:#b91c1c}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(99,102,241,.32)}
.btn:active:not(:disabled){transform:translateY(0);filter:brightness(.96)}
.btn-disabled,.btn:disabled{opacity:.45;cursor:not-allowed;box-shadow:none!important;transform:none!important}

.queue-summary{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.queue-summary .series-chip{background:linear-gradient(180deg,#eef2ff,#e0e7ff);border-color:#c7d2fe}
.file-pill{width:36px;height:36px;border-radius:11px;background:#ede9fe;display:grid;place-items:center}
.table-wrap table td .help{font-size:.78rem}
.privacy-note{font-size:.76rem;color:#475569;margin-top:4px}
.queue-progress{height:8px;border-radius:999px;background:#e2e8f0;overflow:hidden;margin:7px 0}
.queue-progress-bar{height:100%;background:linear-gradient(135deg,#6366f1,#8b5cf6)}
.queue-stages{display:flex;flex-wrap:wrap;gap:6px}
.queue-stage{font-size:11px;padding:3px 7px;border-radius:999px;background:#f1f5f9;color:#475569}
.queue-stage.is-done{background:#dcfce7;color:#166534}

.autopilot-modal[aria-hidden="true"]{display:none}
.autopilot-modal{position:fixed;inset:0;z-index:60}
.autopilot-modal-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.55)}
.autopilot-modal-panel{position:absolute;right:0;top:0;bottom:0;width:min(560px,96vw);background:#fff;padding:18px;overflow:auto;box-shadow:-16px 0 36px rgba(15,23,42,.3)}
.qvidai-toast-stack{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:10px;z-index:1200}
.qvidai-toast{min-width:280px;max-width:360px;padding:12px 14px;border-radius:14px;border:1px solid transparent;background:#111827;color:#fff;box-shadow:0 16px 32px rgba(2,6,23,.32);transform:translateY(8px);opacity:0;transition:all .2s ease;display:flex;flex-direction:column;gap:4px}
.qvidai-toast strong{font-size:.84rem;letter-spacing:.02em}
.qvidai-toast span{font-size:.92rem;line-height:1.35}
.qvidai-toast.is-visible{transform:translateY(0);opacity:1}
.qvidai-toast-success{background:linear-gradient(135deg,#4c1d95,#7c3aed)}
.qvidai-toast-error{background:linear-gradient(135deg,#7f1d1d,#dc2626)}
.qvidai-toast-warning{background:linear-gradient(135deg,#7c2d12,#ea580c)}
.qvidai-toast-info{background:linear-gradient(135deg,#1e3a8a,#2563eb)}

.side-nav-group{margin-top:10px;padding:8px 10px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:#94a3b8}

.admin-center{background:#f8fafc;border:1px solid #dbe4fb;border-radius:18px}
.admin-top-actions{display:flex;gap:8px;flex-wrap:wrap}
.admin-top-actions .tab{border-radius:999px;padding:8px 12px}
.admin-center details summary{list-style:none}
.admin-center details summary::-webkit-details-marker{display:none}
