/* ══════════════════════════════════════════════════════════
   VidAI Studio — style.css
   Premium dark theme, fully responsive, mobile-first
══════════════════════════════════════════════════════════ */

/* ── Google Fonts fallback ──────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:wght@300;400;500;700&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:       #090d14;
  --bg2:      #0d1220;
  --bg3:      #111826;
  --srf:      #161e30;
  --srf2:     #1c2640;
  --srf3:     #22304e;
  --rim:      #2a3858;
  --rim2:     #3a4e78;
  --sky:      #3b82f6;
  --sky2:     #6366f1;
  --sky3:     #818cf8;
  --jade:     #10d9a0;
  --jade2:    #06b6d4;
  --rose:     #f43f5e;
  --amber:    #f59e0b;
  --lime:     #84cc16;
  --txt:      #e0e8fc;
  --txt2:     #8fa8cc;
  --txt3:     #4a6080;
  --r:        14px;
  --r2:       10px;
  --r3:       8px;
  --shadow:   0 6px 36px rgba(0,0,0,.55);
  --glow:     0 0 30px rgba(59,130,246,.2);
  --font-hd:  'Clash Display', 'Segoe UI', sans-serif;
  --font-bd:  'Satoshi', 'Segoe UI', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-bd);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-hd); }
button { cursor: pointer; font-family: var(--font-bd); }
input, select, textarea { font-family: var(--font-bd); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--rim2); border-radius: 99px; }

/* ── Utility ────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }

/* ── Splash screen ──────────────────────────────────────── */
#splash {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity .5s;
}
#splash.fade-out { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo {
  font-family: var(--font-hd); font-size: 52px; font-weight: 700;
  background: linear-gradient(135deg, var(--sky), var(--sky2), var(--jade));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}
.splash-tagline { font-size: 15px; color: var(--txt3); letter-spacing: 6px; text-transform: uppercase; margin-bottom: 28px; }
.splash-bar { width: 220px; height: 3px; background: var(--bg3); border-radius: 99px; overflow: hidden; margin: 0 auto 14px; }
.splash-fill { height: 100%; background: linear-gradient(90deg, var(--sky), var(--jade)); border-radius: 99px; width: 0; transition: width .4s ease; }
.splash-msg { font-size: 13px; color: var(--txt3); }

/* ── App shell ──────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  width: 215px; min-width: 215px;
  background: var(--bg2); border-right: 1px solid var(--rim);
  display: flex; flex-direction: column;
  padding: 22px 0; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
}
.brand { padding: 0 20px 20px; border-bottom: 1px solid var(--rim); margin-bottom: 14px; }
.brand-mark {
  font-family: var(--font-hd); font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--sky), var(--sky3), var(--jade));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1px;
}
.brand-sub { font-size: 10px; color: var(--txt3); letter-spacing: 3px; text-transform: uppercase; margin-top: 2px; }
.nav-links { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; background: transparent; border: none;
  color: var(--txt2); font-size: 14px; font-weight: 500;
  text-align: left; transition: all .16s; position: relative; width: 100%;
}
.nav-btn:hover { color: var(--txt); background: rgba(59,130,246,.06); }
.nav-btn.active { color: var(--sky); background: rgba(59,130,246,.1); }
.nav-btn.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--sky), var(--sky2));
  border-radius: 0 3px 3px 0;
}
.nav-ico { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-lbl { flex: 1; }
.nav-badge {
  background: var(--sky2); color: #fff; font-size: 10px;
  font-weight: 700; padding: 2px 6px; border-radius: 99px;
}
.nav-footer { padding: 14px 20px; border-top: 1px solid var(--rim); margin-top: auto; }
.conn-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--txt3); }
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--jade); box-shadow: 0 0 8px var(--jade); flex-shrink: 0;
}
.conn-dot.off { background: var(--rose); box-shadow: 0 0 8px var(--rose); }
.conn-dot.checking { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1s infinite; }

/* ── Mobile header ──────────────────────────────────────── */
#mobileBar {
  display: none;
  position: sticky; top: 0; z-index: 150;
  background: var(--bg2); border-bottom: 1px solid var(--rim);
  padding: 12px 16px; align-items: center; justify-content: space-between;
}
.mobile-brand { font-family: var(--font-hd); font-size: 18px; font-weight: 700; color: var(--txt); }
.mobile-menu-btn { background: transparent; border: 1px solid var(--rim); border-radius: 7px; padding: 6px 10px; color: var(--txt2); font-size: 16px; }
#mobileDrawer {
  position: fixed; top: 50px; left: 0; right: 0; z-index: 140;
  background: var(--bg2); border-bottom: 1px solid var(--rim);
  padding: 8px 0;
}
#mobileDrawer .nav-btn { padding: 12px 20px; font-size: 15px; }

/* ── Workspace ──────────────────────────────────────────── */
#workspace {
  margin-left: 215px; flex: 1;
  padding: 30px 28px; min-height: 100vh; max-width: 1140px;
}

/* ── Tab sections ───────────────────────────────────────── */
.tab-section { display: none; animation: floatUp .35s ease; }
.tab-section.active { display: block; }

/* ── Page header ────────────────────────────────────────── */
.page-head { margin-bottom: 26px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -1px; }
.page-sub { font-size: 13.5px; color: var(--txt2); margin-top: 4px; }

/* ── Step indicator ─────────────────────────────────────── */
.steps { display: flex; align-items: center; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.step { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
  background: var(--bg3); border: 2px solid var(--rim); color: var(--txt3);
  flex-shrink: 0; transition: all .3s;
}
.step span { font-size: 12px; color: var(--txt3); font-weight: 600; white-space: nowrap; }
.step.active .step-circle { background: var(--sky); border-color: var(--sky); color: #fff; box-shadow: 0 0 16px rgba(59,130,246,.5); }
.step.active span { color: var(--sky); }
.step.done .step-circle { background: var(--jade); border-color: var(--jade); color: #0a0c14; }
.step.done span { color: var(--jade); }
.step-line { flex: 1; height: 2px; background: var(--rim); min-width: 20px; margin: 0 4px; }

/* ── Loader card ────────────────────────────────────────── */
.loader-card {
  background: var(--srf); border: 1px solid var(--rim);
  border-radius: var(--r); padding: 20px; margin-bottom: 20px;
  animation: floatUp .3s ease;
}
.loader-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.loader-row span { color: var(--txt2); font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15); border-top-color: var(--sky);
  animation: spin .65s linear infinite; flex-shrink: 0;
}
.pbar { height: 5px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.pfill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--sky), var(--sky2), var(--jade));
  background-size: 200%; animation: gradShift 2s linear infinite;
  transition: width .4s ease;
}
.pct { font-size: 12px; color: var(--txt3); text-align: right; margin-top: 6px; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--srf); border: 1px solid var(--rim);
  border-radius: var(--r); padding: 20px;
}
.card2 {
  background: var(--srf2); border: 1px solid var(--rim);
  border-radius: var(--r2); padding: 16px;
}
.card3 {
  background: var(--srf3); border: 1px solid var(--rim);
  border-radius: var(--r3); padding: 12px;
}
.form-card { display: flex; flex-direction: column; gap: 16px; }

/* ── Hero card ──────────────────────────────────────────── */
.hero-card {
  background: linear-gradient(135deg, rgba(59,130,246,.07), rgba(99,102,241,.07), rgba(16,217,160,.04));
  border: 1px solid rgba(59,130,246,.14); border-radius: 17px;
  padding: 24px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero-card::after {
  content: ''; position: absolute; top: -50px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(139,92,246,.2), transparent 70%);
  pointer-events: none;
}
.hero-eyebrow { font-size: 11.5px; color: var(--jade); font-weight: 700; margin-bottom: 7px; letter-spacing: .5px; }
.hero-h { font-size: 20px; font-weight: 700; margin-bottom: 7px; }
.hero-p { font-size: 13.5px; color: var(--txt2); line-height: 1.65; }

/* ── Fields / Inputs ────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12.5px; color: var(--txt2); font-weight: 600; }
.inp, .sel, .ta {
  background: var(--bg3); border: 1px solid var(--rim);
  border-radius: 9px; color: var(--txt);
  font-family: var(--font-bd); font-size: 14px; padding: 10px 13px;
  transition: border .16s, box-shadow .16s; width: 100%;
}
.inp:focus, .sel:focus, .ta:focus {
  outline: none; border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.inp.large-inp { font-size: 15px; padding: 12px 14px; }
.ta { resize: vertical; min-height: 82px; line-height: 1.6; }
.sel { cursor: pointer; }
.field-hint { font-size: 11.5px; color: var(--txt3); margin-top: 4px; }
.api-key-row { display: flex; gap: 8px; }

/* ── Tone chips ─────────────────────────────────────────── */
.tone-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--bg3); border: 1px solid var(--rim); color: var(--txt2);
  transition: all .16s;
}
.chip-btn:hover { border-color: var(--rim2); color: var(--txt); }
.chip-btn.active { background: rgba(59,130,246,.16); border-color: var(--sky); color: var(--sky); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px; font-size: 14px; font-weight: 600;
  border: none; transition: all .16s; white-space: nowrap;
}
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-prime {
  background: linear-gradient(135deg, var(--sky), var(--sky2));
  color: #fff; box-shadow: 0 3px 16px rgba(59,130,246,.3);
}
.btn-prime:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 22px rgba(59,130,246,.4); }
.btn-jade {
  background: linear-gradient(135deg, var(--jade), var(--jade2));
  color: #0a0c14; box-shadow: 0 3px 14px rgba(16,217,160,.28);
}
.btn-jade:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 20px rgba(16,217,160,.38); }
.btn-outline {
  background: var(--bg3); border: 1px solid var(--rim2); color: var(--txt);
}
.btn-outline:hover:not(:disabled) { border-color: var(--sky); color: var(--sky); }
.btn-danger { background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.3); color: var(--rose); }
.btn-ghost { background: transparent; color: var(--txt2); padding: 8px 12px; }
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--txt); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.btn-row.right { justify-content: flex-end; }

/* ── Warning box ────────────────────────────────────────── */
.warn-box {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25);
  border-radius: 9px; padding: 11px 14px; font-size: 13px; color: var(--amber);
}

/* ── Step panels ────────────────────────────────────────── */
.step-panel { animation: floatUp .3s ease; }
.step-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.step-h2 { font-size: 19px; font-weight: 700; }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; }
.tag {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: rgba(59,130,246,.1); color: var(--sky); border: 1px solid rgba(59,130,246,.22);
}

/* ── Hook / CTA cards ───────────────────────────────────── */
.hook-card {
  background: rgba(16,217,160,.05); border: 1px solid rgba(16,217,160,.18);
  border-radius: 12px; padding: 16px; margin-bottom: 14px;
}
.hook-label { font-size: 11px; color: var(--jade); font-weight: 700; letter-spacing: .7px; margin-bottom: 7px; }
.hook-text { font-size: 15px; font-style: italic; line-height: 1.65; }
.cta-card {
  background: rgba(59,130,246,.05); border: 1px solid rgba(59,130,246,.18);
  border-radius: 12px; padding: 16px; margin-top: 14px;
}
.cta-label { font-size: 11px; color: var(--sky); font-weight: 700; letter-spacing: .7px; margin-bottom: 7px; }
.cta-text { font-size: 14.5px; line-height: 1.65; }

/* ── Scene edit list ────────────────────────────────────── */
.scene-edit-item {
  background: var(--srf2); border: 1px solid var(--rim);
  border-radius: 11px; padding: 14px; margin-bottom: 12px; display: flex; gap: 13px;
}
.scene-num-badge {
  width: 28px; height: 28px; border-radius: 50%; background: var(--sky);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 3px;
}
.scene-edit-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.scene-title-row { display: flex; align-items: center; gap: 8px; }
.scene-dur { font-size: 11.5px; color: var(--txt3); flex-shrink: 0; }
.scene-visual-note { font-size: 11.5px; color: var(--txt3); margin-top: 3px; }

/* ── Canvas preview ─────────────────────────────────────── */
.preview-section { margin-bottom: 22px; }
.preview-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: 12px; color: var(--txt2); font-weight: 700; letter-spacing: .5px;
}
.scene-nav-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.scene-nav-btn {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--bg3); border: 1px solid var(--rim); color: var(--txt2);
  font-size: 11px; font-weight: 700; cursor: pointer; transition: all .15s; padding: 0;
}
.scene-nav-btn:hover { border-color: var(--rim2); color: var(--txt); }
.scene-nav-btn.active { background: var(--sky); border-color: var(--sky); color: #fff; }
#previewCanvas {
  width: 100%; max-width: 640px; border-radius: 13px;
  border: 1px solid var(--rim); display: block;
}

/* ── Scene grid ─────────────────────────────────────────── */
.scene-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.scene-card {
  background: var(--srf); border: 1px solid var(--rim);
  border-radius: 13px; overflow: hidden; transition: all .18s; cursor: pointer;
}
.scene-card:hover { border-color: var(--rim2); box-shadow: var(--glow); }
.scene-card.selected { border-color: var(--sky); box-shadow: 0 0 20px rgba(59,130,246,.25); }
.scene-thumb {
  width: 100%; aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; font-size: 42px;
}
.scene-thumb-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-start; justify-content: space-between; padding: 9px;
}
.scene-chip-num {
  background: rgba(0,0,0,.65); border-radius: 6px;
  padding: 3px 8px; font-size: 11px; color: #fff; font-weight: 700;
}
.scene-chip-dur {
  border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 700;
}
.scene-body { padding: 13px; }
.scene-lbl { font-size: 10.5px; color: var(--txt3); font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 5px; }
.scene-name { font-family: var(--font-hd); font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.scene-narr { font-size: 12.5px; color: var(--txt2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scene-actions { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; }

/* ── Voice grid ─────────────────────────────────────────── */
.voice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.voice-card {
  background: var(--srf2); border: 1px solid var(--rim);
  border-radius: 10px; padding: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; transition: all .16s;
}
.voice-card:hover { border-color: var(--rim2); }
.voice-card.selected { background: rgba(59,130,246,.08); border-color: var(--sky); }
.voice-flag { font-size: 26px; }
.voice-info { flex: 1; }
.voice-name { font-weight: 700; font-size: 14px; }
.voice-meta { font-size: 11.5px; color: var(--txt3); margin-top: 2px; }
.wave-anim { display: flex; align-items: center; gap: 3px; height: 22px; }
.wb { width: 3px; background: var(--jade); border-radius: 2px; animation: waveBar .8s ease-in-out infinite; }
.wb:nth-child(2) { animation-delay: .1s; }
.wb:nth-child(3) { animation-delay: .2s; }
.wb:nth-child(4) { animation-delay: .3s; }
.wb:nth-child(5) { animation-delay: .25s; }

/* ── Voice test row ─────────────────────────────────────── */
.voice-test-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 14px; margin-top: 0;
}
.voice-test-info { flex: 1; }
.vt-name { font-weight: 600; font-size: 14px; }
.vt-desc { font-size: 12px; color: var(--txt3); margin-top: 2px; }

/* ── Section card ───────────────────────────────────────── */
.section-card { margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; }
.section-label { font-size: 12px; color: var(--txt3); font-weight: 700; letter-spacing: .5px; }

/* ── Range input ────────────────────────────────────────── */
.range-input { -webkit-appearance: none; width: 100%; height: 4px; background: var(--bg3); border-radius: 99px; outline: none; }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; background: var(--sky); border-radius: 50%; cursor: pointer; box-shadow: 0 0 8px rgba(59,130,246,.5); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt3); margin-top: 5px; }

/* ── Toggle ─────────────────────────────────────────────── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.03); }
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.t-name { font-size: 14px; font-weight: 600; }
.t-desc { font-size: 11.5px; color: var(--txt3); margin-top: 2px; }
.toggle { width: 38px; height: 21px; background: var(--bg3); border-radius: 99px; cursor: pointer; position: relative; transition: background .18s; border: 1px solid var(--rim2); flex-shrink: 0; }
.toggle.on { background: var(--sky); border-color: var(--sky); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.toggle.on::after { transform: translateX(17px); }

/* ── Render summary ─────────────────────────────────────── */
.render-summary { background: rgba(59,130,246,.04); border-color: rgba(59,130,246,.15); }
.kv-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.03); }
.kv-row:last-child { border-bottom: none; }
.kv-k { font-size: 12.5px; color: var(--txt3); }
.kv-v { font-size: 13px; font-weight: 600; }

/* ── Render screen ──────────────────────────────────────── */
.render-screen { text-align: center; padding: 48px 20px; animation: floatUp .3s ease; }
.render-ico { font-size: 54px; margin-bottom: 16px; }
.render-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.render-sub { font-size: 14px; color: var(--txt2); margin-bottom: 28px; }
.render-pbar { max-width: 440px; margin: 0 auto 10px; }
.render-pct { font-size: 24px; font-weight: 700; color: var(--sky); margin-bottom: 6px; }
.render-msg { font-size: 14px; color: var(--txt2); margin-bottom: 20px; }
.render-note { font-size: 12.5px; color: var(--txt3); line-height: 1.7; }

/* ── Export / video player ──────────────────────────────── */
.export-hero { text-align: center; margin-bottom: 24px; }
.export-trophy { font-size: 52px; margin-bottom: 10px; }
.export-title { font-size: 23px; font-weight: 700; margin-bottom: 7px; }
.export-sub { font-size: 14px; color: var(--txt2); }
.video-player-wrap { max-width: 680px; margin: 0 auto 22px; }
#videoPlayer { width: 100%; border-radius: 13px; border: 1px solid var(--rim); background: #000; display: block; }
.download-bar {
  background: linear-gradient(135deg, rgba(16,217,160,.05), rgba(6,182,212,.05));
  border: 1px solid rgba(16,217,160,.18); border-radius: 13px;
  padding: 17px 20px; display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; max-width: 680px; margin: 0 auto 16px;
}
.dl-info { flex: 1; }
.dl-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.dl-meta { font-size: 12px; color: var(--txt3); }
.export-actions {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; max-width: 680px; margin: 0 auto;
}

/* ── Templates ──────────────────────────────────────────── */
.tmpl-card {
  background: var(--srf); border: 1px solid var(--rim);
  border-radius: 13px; overflow: hidden; cursor: pointer; transition: all .18s; position: relative;
}
.tmpl-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.4); border-color: var(--rim2); }
.tmpl-thumb { width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; font-size: 38px; }
.tmpl-badge { position: absolute; top: 9px; right: 9px; background: var(--sky2); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.tmpl-info { padding: 13px; }
.tmpl-name { font-family: var(--font-hd); font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.tmpl-desc { font-size: 12px; color: var(--txt3); line-height: 1.5; }

/* ── Media grid ─────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 13px; }
.media-item { background: var(--srf); border: 1px solid var(--rim); border-radius: 11px; overflow: hidden; cursor: pointer; transition: all .16s; }
.media-item:hover { border-color: var(--sky); box-shadow: var(--glow); }
.media-thumb { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.media-meta { padding: 9px; }
.media-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-sz { font-size: 10.5px; color: var(--txt3); margin-top: 2px; }

/* ── Tab bar ────────────────────────────────────────────── */
.tab-bar { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--rim); border-radius: 10px; padding: 4px; margin-bottom: 20px; max-width: 280px; }
.tab-pill { flex: 1; padding: 8px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; text-align: center; color: var(--txt2); border: none; background: transparent; transition: all .15s; }
.tab-pill.active { background: var(--srf); color: var(--txt); box-shadow: var(--shadow); }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--txt3); }
.empty-ico { font-size: 44px; margin-bottom: 14px; }
.empty-t { font-family: var(--font-hd); font-size: 17px; color: var(--txt2); margin-bottom: 5px; }
.empty-d { font-size: 13px; line-height: 1.6; }

/* ── Settings ───────────────────────────────────────────── */
.settings-section { margin-bottom: 24px; }
.settings-title { font-family: var(--font-hd); font-size: 14.5px; font-weight: 700; margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--rim); }
.server-status-card {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 22px;
}
.server-status-card.ok { background: rgba(16,217,160,.07); border: 1px solid rgba(16,217,160,.22); color: var(--jade); }
.server-status-card.err { background: rgba(244,63,94,.07); border: 1px solid rgba(244,63,94,.22); color: var(--rose); }
.server-status-card.checking { background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.2); color: var(--amber); }
.ss-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.compat-note { font-size: 12.5px; color: var(--txt3); margin-top: 10px; line-height: 1.6; }
.compat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.03); }
.compat-row:last-child { border-bottom: none; }
.compat-key { font-size: 13px; color: var(--txt2); }
.compat-ok { font-size: 13px; font-weight: 700; color: var(--jade); }
.compat-no { font-size: 13px; font-weight: 700; color: var(--rose); }

/* ── Toasts ─────────────────────────────────────────────── */
#toastContainer { position: fixed; bottom: 22px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 9px; max-width: 340px; }
.toast {
  padding: 12px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 9px;
  animation: popIn .22s ease; box-shadow: var(--shadow);
}
.toast-info    { background: var(--srf2); border: 1px solid var(--rim2); color: var(--txt); }
.toast-ok      { background: rgba(16,217,160,.1); border: 1px solid rgba(16,217,160,.3); color: var(--jade); }
.toast-err     { background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.3); color: var(--rose); }
.toast-warn    { background: rgba(245,158,11,.09); border: 1px solid rgba(245,158,11,.3); color: var(--amber); }

/* ── Grid helpers ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Animations ─────────────────────────────────────────── */
@keyframes floatUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn      { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes pulse      { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes gradShift  { 0% { background-position: 0%; } 100% { background-position: 200%; } }
@keyframes waveBar    { 0%,100% { height: 5px; } 50% { height: 20px; } }
@keyframes sceneReveal { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

/* ══ RESPONSIVE ══════════════════════════════════════════ */
@media (max-width: 768px) {
  #sidebar      { display: none !important; }
  #mobileBar    { display: flex !important; }
  #workspace    { margin-left: 0; padding: 16px 14px; }
  .grid-2, .scene-grid, .voice-grid { grid-template-columns: 1fr !important; }
  .grid-3       { grid-template-columns: 1fr 1fr !important; }
  .steps        { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .step span    { display: none; }
  .step-line    { min-width: 14px; }
  .btn-row      { flex-wrap: wrap; }
  .step-header  { flex-direction: column; gap: 10px; }
  .download-bar { flex-direction: column; align-items: stretch; }
  .export-actions { flex-direction: column; }
  .tab-bar      { max-width: 100%; }
  .hero-h       { font-size: 17px; }
}

@media (max-width: 480px) {
  .grid-3       { grid-template-columns: 1fr !important; }
  .page-title   { font-size: 22px; }
  .btn-lg       { padding: 11px 20px; font-size: 14px; }
}
