/* ============================================================================
   Quantm Video Pro — Studio CSS  (2026 Edition)
   Ultra-modern premium SaaS aesthetic — Vercel / Linear / Runway style.
   Uses global.css design tokens. Zero neon outlines.
   ============================================================================ */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds — exact global.css tokens */
  --bg-base:     #0b0b0c;   /* --panel   — deepest shell */
  --bg-panel:    #0f1112;   /* --bg-00   — sidebars, timeline */
  --bg-surface:  #1e1e1e;   /* --surface — cards, clips */
  --bg-hover:    #242428;   /* hover state */
  --bg-input:    rgba(255,255,255,0.03);

  /* Borders — subtle only, NO accent borders on structural elements */
  --border:      rgba(255,255,255,0.04);  /* --glass-border */
  --border-mid:  rgba(255,255,255,0.07);  /* slightly brighter on hover/focus */
  --divider:     rgba(255,255,255,0.03);

  /* Accents — used ONLY for interactive state, not structure */
  --cyan:        #00d4ff;   /* --accent-2 */
  --cyan-dim:    rgba(0,212,255,0.10);
  --cyan-glow:   rgba(0,212,255,0.15);
  --purple:      #7c68ff;   /* --accent-1 */
  --purple-dim:  rgba(124,104,255,0.10);
  --purple-glow: rgba(124,104,255,0.18);
  --green:       #6bd37a;   /* --accent-3 */
  --red:         #f26b6b;

  /* Text */
  --text-primary:   #e3e3e3;
  --text-secondary: #b8bdc8;  /* --text-muted */
  --text-muted:     #6b7180;

  /* Font */
  --font:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Radii — generous and soft */
  --r-xs:  6px;
  --r-sm:  10px;
  --r-md:  14px;
  --r-lg:  18px;
  --r-xl:  22px;

  /* Shadows — depth without neon */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.32);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.40);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.52);

  /* Transitions */
  --ease:      cubic-bezier(.2,.9,.3,1);
  --ease-snap: cubic-bezier(.15,.9,.25,1);

  /* Layout */
  --header-h:   52px;
  --timeline-h: 216px;
  --left-w:     316px;
  --right-w:    328px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  user-select: none;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ── Studio Shell ───────────────────────────────────────────────────────────── */
.studio {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════════════════════════ */
.studio-header {
  height: var(--header-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #040d10;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

.header-project {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.project-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  padding: 5px 8px;
  border-radius: var(--r-xs);
  width: 220px;
  cursor: text;
  font-family: var(--font);
  transition: background 0.15s;
}
.project-name:hover  { background: var(--bg-surface); }
.project-name:focus  { background: var(--bg-surface); outline: 1px solid var(--border-mid); }

.header-status {
  font-size: 11px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 5px;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.4s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Transport */
.header-transport {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-transport {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s var(--ease);
}
.btn-transport:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-mid);
}
.btn-transport.play {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  border-color: transparent;
  color: #040d10;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.btn-transport.play:hover {
  box-shadow: 0 4px 20px var(--purple-glow);
  transform: translateY(-1px);
}

.timecode {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cyan);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 5px 12px;
  letter-spacing: 0.06em;
  min-width: 90px;
  text-align: center;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.btn-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-mid);
}
.btn-action.primary {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-color: transparent;
  color: #040d10;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.btn-action.primary:hover {
  box-shadow: 0 6px 28px var(--purple-glow);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════════════════════
   WORKSPACE
════════════════════════════════════════════════════════════════════════════ */
.studio-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   LEFT PANEL — Script & Scene Splitter
════════════════════════════════════════════════════════════════════════════ */
.panel-left {
  width: var(--left-w);
  min-width: var(--left-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-title-icon {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

.panel-actions {
  display: flex;
  gap: 4px;
}

.btn-micro {
  width: 24px;
  height: 24px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.btn-micro:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-mid);
}

/* Script input */
.script-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.script-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.script-textarea {
  width: 100%;
  height: 132px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px 13px;
  resize: none;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: text;
}
.script-textarea:focus {
  border-color: var(--border-mid);
  box-shadow: 0 0 0 3px rgba(124,104,255,0.06);
}
.script-textarea::placeholder { color: var(--text-muted); }

.script-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.script-count {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Split button */
.btn-split {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border: none;
  border-radius: var(--r-sm);
  color: #040d10;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.02em;
  transition: all 0.15s var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn-split:hover {
  box-shadow: 0 6px 24px var(--purple-glow);
  transform: translateY(-1px);
}
.btn-split:active { transform: translateY(0); }

/* Scene Cards */
.scenes-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scenes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.scenes-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scenes-count-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
}

/* Scene Card — clean surface card, no neon border */
.scene-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.scene-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--bg-hover);
  border-radius: 3px 0 0 3px;
  transition: all 0.15s;
}
.scene-card:hover {
  border-color: var(--border-mid);
  transform: translateX(1px);
}
.scene-card:hover::before {
  background: var(--purple);
  opacity: 0.6;
}
.scene-card.active {
  border-color: rgba(124,104,255,0.18);
  background: linear-gradient(160deg, rgba(124,104,255,0.05) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(124,104,255,0.10);
}
.scene-card.active::before {
  background: var(--purple);
  opacity: 1;
}

.scene-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.scene-num {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.scene-card.active .scene-num { color: var(--purple); }

.scene-dur {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: 4px;
}

.scene-text {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-tags {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.scene-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scene-tag.interior { background: rgba(124,104,255,0.08); color: var(--purple); }
.scene-tag.exterior { background: rgba(0,212,255,0.08);   color: var(--cyan);   }
.scene-tag.night    { background: rgba(140,140,160,0.08); color: #a0a0c0;        }
.scene-tag.day      { background: rgba(107,211,122,0.08); color: var(--green);   }
.scene-tag.action   { background: rgba(242,107,107,0.08); color: var(--red);     }

/* ════════════════════════════════════════════════════════════════════════════
   CENTER — Preview Monitor
════════════════════════════════════════════════════════════════════════════ */
.panel-center {
  flex: 1;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

.preview-screen {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #0c0c14 0%, #000 100%);
}

/* Very subtle grid — depth hint, not a neon cage */
.preview-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

/* Clean icon — gradient fill, no glow ring */
.preview-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-lg);
  animation: icon-breathe 4s ease-in-out infinite;
}
@keyframes icon-breathe {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.03); }
}

.preview-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.preview-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.65;
}

/* Corner overlays — ultra-subtle, structural markers not neon decoration */
.preview-overlay-tl,
.preview-overlay-tr,
.preview-overlay-bl,
.preview-overlay-br {
  position: absolute;
  width: 16px;
  height: 16px;
  opacity: 0.12;
  pointer-events: none;
}
.preview-overlay-tl { top: 16px; left: 16px; border-top: 1.5px solid var(--text-secondary); border-left: 1.5px solid var(--text-secondary); }
.preview-overlay-tr { top: 16px; right: 16px; border-top: 1.5px solid var(--text-secondary); border-right: 1.5px solid var(--text-secondary); }
.preview-overlay-bl { bottom: 16px; left: 16px; border-bottom: 1.5px solid var(--text-secondary); border-left: 1.5px solid var(--text-secondary); }
.preview-overlay-br { bottom: 16px; right: 16px; border-bottom: 1.5px solid var(--text-secondary); border-right: 1.5px solid var(--text-secondary); }

/* Timecode overlay — glassmorphism chip */
.preview-timecode-overlay {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: rgba(15,17,18,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-sm);
}

/* Scrubber */
.preview-scrubber {
  height: 40px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
}

.scrubber-track {
  flex: 1;
  height: 3px;
  background: var(--bg-hover);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
}

.scrubber-fill {
  width: 32%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 99px;
  position: relative;
}

.scrubber-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--purple), var(--shadow-sm);
}

.scrubber-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   RIGHT PANEL — Subject Lock & Scene Mod
════════════════════════════════════════════════════════════════════════════ */
.panel-right {
  width: var(--right-w);
  min-width: var(--right-w);
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tabs */
.right-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 4px;
}

.right-tab {
  flex: 1;
  padding: 12px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--font);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.right-tab:hover  { color: var(--text-secondary); }
.right-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--purple);
}

.right-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Subject Lock Card — glass card, depth from shadow not glow */
.subject-lock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.subject-lock-card:hover {
  border-color: var(--border-mid);
}
.subject-lock-card.locked {
  background: linear-gradient(160deg, rgba(124,104,255,0.04) 0%, var(--bg-surface) 100%);
  border-color: rgba(124,104,255,0.15);
  box-shadow: var(--shadow-sm);
}

.slc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.slc-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.slc-title-wrap {
  flex: 1;
  min-width: 0;
}

.slc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.slc-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

.slc-lock-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.03em;
  transition: all 0.15s;
  flex-shrink: 0;
  white-space: nowrap;
}
.slc-lock-btn:hover {
  border-color: var(--border-mid);
  color: var(--text-primary);
}
.slc-lock-btn.locked {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-color: transparent;
  color: #040d10;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Fields */
.slc-field {
  margin-bottom: 12px;
}

.slc-field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.slc-input,
.slc-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 12px;
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: text;
}
.slc-textarea { height: 60px; resize: none; line-height: 1.6; }
.slc-input:focus,
.slc-textarea:focus {
  border-color: var(--border-mid);
  box-shadow: 0 0 0 3px rgba(124,104,255,0.06);
}
.slc-input::placeholder,
.slc-textarea::placeholder { color: var(--text-muted); }

/* Consistency Anchors */
.slc-anchors-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.slc-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.anchor-chip {
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--bg-hover);
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}
.anchor-chip:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: rgba(124,104,255,0.3);
}
.anchor-chip.active {
  background: var(--purple-dim);
  border-color: rgba(124,104,255,0.3);
  color: var(--purple);
}

.anchor-add-btn {
  padding: 4px 12px;
  border-radius: 99px;
  background: transparent;
  border: 1px dashed var(--border-mid);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.12s;
}
.anchor-add-btn:hover {
  border-color: rgba(124,104,255,0.3);
  color: var(--purple);
}

/* ════════════════════════════════════════════════════════════════════════════
   GENERATE BUTTON (header CTA)
════════════════════════════════════════════════════════════════════════════ */
.btn-generate {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border: none;
  border-radius: var(--r-md);
  color: #040d10;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: 0.02em;
  text-align: center;
  transition: all 0.15s var(--ease);
  box-shadow: var(--shadow-md);
  margin-top: 4px;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--purple-glow);
}
.btn-generate:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.btn-generate-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
  display: block;
  margin-top: 3px;
  letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════════════════════════════════
   BOTTOM — ASSEMBLY TIMELINE
════════════════════════════════════════════════════════════════════════════ */
.studio-timeline {
  height: var(--timeline-h);
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.timeline-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.timeline-info {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.timeline-info span { color: var(--text-secondary); }

.timeline-controls {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* Ruler */
.timeline-ruler {
  height: 22px;
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-base);
  overflow: hidden;
  position: relative;
}

.ruler-track-label {
  width: 76px;
  min-width: 76px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 9px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
}

.ruler-marks {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 3px;
  overflow: hidden;
  position: relative;
}

.ruler-mark {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ruler-mark-line {
  width: 1px;
  height: 5px;
  background: rgba(255,255,255,0.12);
}

.ruler-mark-time {
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  opacity: 0.45;
  white-space: nowrap;
  margin-top: 1px;
}

/* Timeline Tracks */
.timeline-tracks {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
}

.timeline-track-row {
  display: flex;
  align-items: center;
  height: 50px;
  border-bottom: 1px solid var(--divider);
  position: relative;
}

.track-label {
  width: 76px;
  min-width: 76px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 2;
}

.track-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.track-content {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 7px 6px;
  overflow: visible;
  position: relative;
  min-width: 900px;
}

/* Clips — soft geometry, depth from shadow */
.clip {
  height: 100%;
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 10px;
  cursor: grab;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  transition: all 0.12s;
  flex-shrink: 0;
  min-width: 92px;
  box-shadow: var(--shadow-sm);
}
.clip:active { cursor: grabbing; transform: scale(0.98); }
.clip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 55%);
  pointer-events: none;
}

/* Clip types — palette stays cyan/purple/green, borders match fill */
.clip.video {
  background: linear-gradient(135deg, rgba(124,104,255,0.16) 0%, rgba(124,104,255,0.07) 100%);
  border-color: rgba(124,104,255,0.20);
}
.clip.audio {
  background: linear-gradient(135deg, rgba(107,211,122,0.12) 0%, rgba(107,211,122,0.05) 100%);
  border-color: rgba(107,211,122,0.20);
}
.clip.fx {
  background: linear-gradient(135deg, rgba(0,212,255,0.10) 0%, rgba(0,212,255,0.04) 100%);
  border-color: rgba(0,212,255,0.20);
}
.clip.empty {
  background: var(--bg-surface);
  border: 1px dashed rgba(255,255,255,0.06);
  box-shadow: none;
}
.clip.active-clip {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), var(--shadow-sm);
}

.clip-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.clip-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 78%;
}

.clip-dur-badge {
  font-size: 8px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(0,0,0,0.28);
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.clip-waveform {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
}

.wave-bar {
  width: 2px;
  background: rgba(107,211,122,0.55);
  border-radius: 1px;
  animation: wave-anim 1.6s ease-in-out infinite;
}
@keyframes wave-anim {
  0%, 100% { transform: scaleY(0.35); }
  50%       { transform: scaleY(1); }
}

.clip-video-line {
  height: 2px;
  border-radius: 1px;
  background: rgba(124,104,255,0.50);
  margin-top: auto;
}

/* Playhead — cyan accent (correct usage) */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--cyan);
  left: calc(76px + 30%);
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px var(--cyan-glow);
}
.playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid var(--cyan);
}

/* ── AI Generation Progress Bar ─────────────────────────────────────────── */
.gen-progress-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--cyan));
  background-size: 200% 100%;
  animation: shimmer-bar 1.8s linear infinite;
  border-radius: 99px;
  display: none;
}
.gen-progress-bar.active { display: block; }
@keyframes shimmer-bar {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tooltip — glassmorphism ────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,17,18,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
[data-tip]:hover::after { opacity: 1; }

/* ── Timeline scrollbar ──────────────────────────────────────────────────── */
.timeline-tracks::-webkit-scrollbar { height: 4px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --right-w: 284px; --left-w: 274px; }
}
@media (max-width: 900px) {
  .panel-right { display: none; }
  :root { --left-w: 244px; }
}
