:root {
  --bg: #070b12;
  --bg-elevated: #0c111b;
  --surface: #111827;
  --surface-hover: #151f30;
  --card: #131b2b;
  --card-inner: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --accent: #34f5a4;
  --accent-dim: #1a9d66;
  --accent-glow: rgba(52, 245, 164, 0.35);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --header-h: 4rem;
  --sidebar-w: 15.5rem;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.dashboard {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.dashboard::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(52, 245, 164, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(59, 130, 246, 0.05), transparent),
    linear-gradient(180deg, var(--bg) 0%, #0a0f18 100%);
  pointer-events: none;
  z-index: 0;
}

.sidebar-toggle-input {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* ── Fixed glass header ── */
.app-header.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: rgba(7, 11, 18, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #22d3ee 100%);
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
}

.brand-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand small,
.brand-text small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.user-chip,
#user-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(280px, 42vw);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}

.user-bar img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(52, 245, 164, 0.35);
  flex-shrink: 0;
}

.btn.sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(52, 245, 164, 0.1);
  border-color: rgba(52, 245, 164, 0.35);
  box-shadow: 0 0 16px rgba(52, 245, 164, 0.12);
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

.btn-logout:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.45);
}

/* Hamburger — mobile only */
.sidebar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-hamburger span {
  display: block;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ── App shell: sidebar + workspace ── */
.app-shell {
  position: relative;
  z-index: 1;
  display: none;
  min-height: 100vh;
  padding-top: var(--header-h);
  width: 100%;
}

.app-shell.is-visible {
  display: flex;
}

/* ── Marketing landing (guests) ── */
body.guest-landing .sidebar-hamburger {
  display: none;
}

.landing-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 2.5rem) 1.25rem 3rem;
  box-sizing: border-box;
  overflow: hidden;
}

.landing-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
}

.landing-glow-a {
  width: 520px;
  height: 520px;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(52, 245, 164, 0.12);
}

.landing-glow-b {
  width: 400px;
  height: 400px;
  top: 280px;
  right: -120px;
  background: rgba(59, 130, 246, 0.08);
}

.landing-hero {
  text-align: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 3rem;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.85rem 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(52, 245, 164, 0.08);
  border: 1px solid rgba(52, 245, 164, 0.22);
  border-radius: 999px;
}

.landing-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: landing-pulse 2s ease-in-out infinite;
}

@keyframes landing-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.landing-headline {
  margin: 0 0 1.15rem;
  font-size: clamp(2.35rem, 6.5vw, 3.85rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.045em;
  color: var(--text);
}

.landing-headline-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #6ee7b7 50%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-subheadline {
  margin: 0 auto 1.75rem;
  max-width: 620px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.landing-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-cta-arrow {
  transition: transform 0.2s ease;
}

.landing-cta-primary:hover .landing-cta-arrow {
  transform: translateX(3px);
}

.landing-cta-secondary {
  border: 1px solid var(--border-strong);
}

.landing-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--muted);
}

.landing-trust strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-large {
  padding: 0.95rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.landing-cta-primary.btn-large {
  box-shadow: 0 0 28px var(--accent-glow);
}

/* Product mockup */
.landing-showcase {
  width: 100%;
  margin-bottom: 4rem;
}

.landing-mockup {
  background: rgba(12, 17, 27, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.landing-mockup-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
}

.landing-mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.landing-mockup-dot:first-child { background: #ff5f57; }
.landing-mockup-dot:nth-child(2) { background: #febc2e; }
.landing-mockup-dot:nth-child(3) { background: #28c840; }

.landing-mockup-title {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.landing-mockup-body {
  padding: 1rem;
}

.landing-mockup-preview {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.landing-mockup-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(52, 245, 164, 0.15) 0%, transparent 50%),
    linear-gradient(225deg, rgba(59, 130, 246, 0.2) 0%, transparent 45%),
    #0a1018;
  border: 1px solid var(--border);
  overflow: hidden;
}

.landing-mockup-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.landing-mockup-play::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 10px solid transparent;
  border-left: 16px solid rgba(255, 255, 255, 0.85);
  border-right: 0;
}

.landing-mockup-pip {
  position: absolute;
  right: 8%;
  bottom: 10%;
  width: 28%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: linear-gradient(160deg, #1a2740, #0d1520);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.landing-mockup-inspector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}

.landing-mockup-tab {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.landing-mockup-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.landing-mockup-slider {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 60%, rgba(255, 255, 255, 0.1) 60%);
  margin-top: 0.25rem;
}

.landing-mockup-slider.short {
  background: linear-gradient(90deg, var(--accent) 40%, rgba(255, 255, 255, 0.1) 40%);
}

.landing-mockup-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
}

.landing-mockup-track {
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}

.landing-mockup-clip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 3px;
}

.landing-mockup-clip.overlay {
  left: 8%;
  width: 35%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.landing-mockup-clip.main {
  left: 0;
  width: 72%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

.landing-mockup-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 38%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  animation: landing-playhead 4s ease-in-out infinite;
}

@keyframes landing-playhead {
  0%, 100% { left: 12%; }
  50% { left: 68%; }
}

/* Features */
.landing-section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.landing-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-section-head h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.landing-section-head p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.landing-features {
  width: 100%;
  margin-bottom: 4rem;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.landing-feature {
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(19, 27, 43, 0.55);
  border: 1px solid var(--border);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.landing-feature:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 245, 164, 0.28);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.landing-feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.landing-feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}

.landing-feature p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Steps */
.landing-steps {
  width: 100%;
  margin-bottom: 3.5rem;
}

.landing-step-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-step {
  display: flex;
  gap: 1rem;
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  background: rgba(19, 27, 43, 0.4);
  border: 1px solid var(--border);
}

.landing-step-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(52, 245, 164, 0.1);
  border: 1px solid rgba(52, 245, 164, 0.25);
}

.landing-step h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.landing-step p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Final CTA */
.landing-final-cta {
  width: 100%;
  margin-bottom: 2.5rem;
}

.landing-final-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(52, 245, 164, 0.12), transparent),
    rgba(19, 27, 43, 0.7);
  border: 1px solid rgba(52, 245, 164, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.landing-final-card h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.landing-final-card p {
  margin: 0 auto 1.5rem;
  max-width: 420px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.landing-footer {
  width: 100%;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.landing-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .landing-feature-grid,
  .landing-step-list {
    grid-template-columns: 1fr;
  }

  .landing-mockup-preview {
    grid-template-columns: 1fr;
  }

  .landing-mockup-inspector {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .landing-mockup-tab {
    border-bottom: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
  }

  .landing-mockup-slider {
    flex: 1 1 100%;
  }

  .landing-page {
    padding-top: calc(var(--header-h) + 1.75rem);
  }
}

@media (max-width: 520px) {
  .landing-cta-row {
    flex-direction: column;
    width: 100%;
  }

  .landing-cta-row .btn-large {
    width: 100%;
    justify-content: center;
  }

  .landing-trust {
    flex-direction: column;
    gap: 0.35rem;
  }
}

.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 150;
  background: rgba(12, 17, 27, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-inner {
  padding: 1.25rem 0.85rem;
}

.sidebar-label {
  margin: 0 0 0.65rem 0.75rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 140;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

/* Sidebar nav — keep .tabs for JS */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tabs button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.tabs button .nav-icon {
  font-size: 0.95rem;
  opacity: 0.7;
  width: 1.25rem;
  text-align: center;
}

.tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tabs button.active {
  color: var(--accent);
  background: linear-gradient(90deg, rgba(52, 245, 164, 0.12) 0%, rgba(52, 245, 164, 0.03) 100%);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 24px rgba(52, 245, 164, 0.06);
}

.tabs button.active .nav-icon {
  opacity: 1;
}

.workspace {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 2rem;
}

.main-content:has(#panel-timeline.active) {
  max-width: none;
  margin: 0;
  padding: 0;
}

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-card {
  background: rgba(19, 27, 43, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.page-header { margin-bottom: 1.5rem; }

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
}

.lead {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 52ch;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.field-group { margin-bottom: 0; }

textarea,
input,
select {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(7, 11, 18, 0.6);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(52, 245, 164, 0.45);
  box-shadow: 0 0 0 3px rgba(52, 245, 164, 0.12);
  background: rgba(7, 11, 18, 0.85);
}

textarea::placeholder { color: var(--muted); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 540px) {
  .row { grid-template-columns: 1fr; }
}

.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}

.btn:hover { background: var(--surface-hover); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--accent) 100%);
  color: #04120a;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 20px rgba(52, 245, 164, 0.25);
}

.btn.primary:hover {
  box-shadow: 0 6px 28px rgba(52, 245, 164, 0.35);
  transform: translateY(-1px);
}

.btn.primary.is-loading {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
  transform: none;
}

.status {
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-height: 1.5rem;
  margin-top: 0.75rem;
}

.status.is-loading { color: var(--accent); }

.status.is-loading::after {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-left: 0.45rem;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: hook-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes hook-spin { to { transform: rotate(360deg); } }

/* Hook optimizer form */
.hook-shell { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; }

.hook-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.hook-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  .hook-form-grid { grid-template-columns: 1fr minmax(200px, 240px); align-items: start; }
}

.hook-form-main textarea {
  margin-bottom: 0;
  min-height: 148px;
  line-height: 1.55;
  resize: vertical;
}

.hook-form-side select { margin-bottom: 0; }

.editor-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .editor-form-grid { grid-template-columns: 1fr minmax(220px, 280px); align-items: end; }
}

#script-body {
  line-height: 1.65;
  white-space: pre-wrap;
}

.btn-block {
  width: 100%;
  padding: 0.9rem 1.25rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.results-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Badges */
.hook-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge--tone {
  color: #04120a;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 20px var(--accent-glow);
}

.badge--category {
  color: var(--accent);
  background: rgba(52, 245, 164, 0.08);
  border-color: rgba(52, 245, 164, 0.28);
  box-shadow: 0 0 14px rgba(52, 245, 164, 0.1);
}

.badge--pacing-perfect {
  color: #fde047;
  background: rgba(253, 224, 71, 0.1);
  border-color: rgba(253, 224, 71, 0.35);
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.15);
}

.badge--pacing-wordy {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.12);
}

.badge--pacing-balanced {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.1);
  border-color: rgba(147, 197, 253, 0.3);
  box-shadow: 0 0 12px rgba(147, 197, 253, 0.1);
}

/* Results grid */
.hook-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 900px) {
  .hook-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
}

.hook-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hook-card:hover {
  border-color: rgba(52, 245, 164, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hook-card h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.hook-card .hook-text {
  margin: 0;
  line-height: 1.55;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.hook-card .loop-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0.25rem 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hook-card .loop-text {
  margin: 0;
  line-height: 1.5;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.visual-prompt {
  margin: 0.15rem 0 0;
  padding: 0.75rem 0.85rem;
  background: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.5;
}

.visual-prompt strong {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.35rem;
}

.btn.copy {
  margin-top: auto;
  font-size: 0.78rem;
  padding: 0.5rem 0.85rem;
  width: 100%;
  border-radius: var(--radius-sm);
}

.ai-progress-wrapper {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.ai-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.ai-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
  box-shadow: 0 0 12px var(--accent-glow);
}

.ai-progress-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 0.5rem;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.history-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, border-color 0.2s;
}

.history-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.history-card-topic {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.history-card-date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.history-card .badge {
  align-self: flex-start;
}

ul { list-style: none; padding: 0; margin: 0; }

li {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.app-footer {
  text-align: center;
  padding: 1.25rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.app-footer a { color: var(--accent); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

.footer-sep { margin: 0 0.35rem; opacity: 0.5; }

code {
  font-size: 0.85em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

#health-dot.ok { color: var(--accent); }
#health-dot.bad { color: #f87171; }

/* ── Mobile: collapsible sidebar ── */
@media (max-width: 1023px) {
  .sidebar-hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-md);
  }

  .sidebar-toggle-input:checked ~ .app-shell .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle-input:checked ~ .app-shell .sidebar-backdrop {
    display: block;
  }

  .workspace { margin-left: 0; }

  .main-content { padding: 1.25rem 1rem 1.75rem; }

  .main-content:has(#panel-timeline.active) {
    padding: 0;
    max-width: none;
  }

  .workspace-card { padding: 1.25rem; border-radius: var(--radius-md); }

  h1 { font-size: 1.35rem; }

  .user-chip,
  #user-label { max-width: 36vw; font-size: 0.72rem; padding: 0.3rem 0.55rem; }

  .btn.sm { padding: 0.4rem 0.65rem; font-size: 0.72rem; }
}

@media (min-width: 1024px) {
  .sidebar-hamburger { display: none; }
  .sidebar-backdrop { display: none !important; }

  .app-shell:has(#panel-timeline.active) .sidebar-hamburger {
    display: flex !important;
  }

  .sidebar-toggle-input:checked ~ .app-shell:has(#panel-timeline.active) .sidebar-backdrop {
    display: block !important;
  }
}

/* ── Video Studio & AI Images ── */
.studio-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.studio-mode {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.studio-mode.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(52, 245, 164, 0.08);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
}

.media-result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.media-result h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.media-preview {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #000;
  display: block;
}

.image-preview {
  max-height: 560px;
  object-fit: contain;
}

.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.editor-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.editor-actions-row .btn { flex: 1; min-width: 160px; }

/* ── Pro Video Editor ── */
.ve-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.ve-toolbar-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ve-upload-btn { cursor: pointer; margin: 0; }

.ve-editor-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ve-media-bin {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  max-height: 520px;
  overflow-y: auto;
}

.ve-bin-hint { font-size: 0.78rem; margin: 0 0 0.75rem; }

.media-bin-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.media-bin-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  width: 100%;
}

.media-bin-item:hover {
  border-color: var(--accent);
  background: rgba(52, 245, 164, 0.06);
}

.media-bin-icon { grid-row: span 2; font-size: 0.85rem; opacity: 0.85; }
.media-bin-name { font-size: 0.78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-bin-meta { font-size: 0.68rem; color: var(--muted); grid-column: 2; }

.ve-upload-progress {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(52, 245, 164, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ve-upload-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.ve-upload-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #2dd4a0);
  border-radius: 999px;
  transition: width 0.15s ease;
}

#ve-upload-label { font-size: 0.82rem; color: var(--text-secondary); }

.ve-preview-loading {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ve-preview-loading[hidden] {
  display: none !important;
}

.ve-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ve-spin 0.7s linear infinite;
}

@keyframes ve-spin { to { transform: rotate(360deg); } }

/* Empty / welcome state */
.ve-preview-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(52, 245, 164, 0.08), transparent 70%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(255, 255, 255, 0.02) 11px,
      rgba(255, 255, 255, 0.02) 12px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 11px,
      rgba(255, 255, 255, 0.02) 11px,
      rgba(255, 255, 255, 0.02) 12px
    ),
    #0a0f14;
  text-align: center;
}

.ve-preview-empty[hidden] {
  display: none !important;
}

.ve-preview-frame.ve-drag-over .ve-preview-empty {
  border: 2px dashed var(--accent);
  background-color: rgba(52, 245, 164, 0.06);
}

.ve-empty-inner {
  max-width: 240px;
}

.ve-empty-icon {
  color: var(--accent);
  margin: 0 auto 0.75rem;
  opacity: 0.9;
}

.ve-empty-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.ve-empty-desc {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ve-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.ve-empty-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.media-bin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.media-bin-empty-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.media-bin-empty-title {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ve-media-bin.ve-drag-over {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(52, 245, 164, 0.25);
}

.ve-inspector-empty {
  padding: 0.25rem 0;
}

.ve-inspector-empty-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ve-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
}

.ve-steps li { margin-bottom: 0.35rem; }
.ve-steps strong { color: var(--text-secondary); font-weight: 600; }

.timeline-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}

.timeline-empty[hidden] {
  display: none !important;
}

.timeline-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent);
}

.ve-timeline-idle .timeline-playhead {
  opacity: 0.35;
}

.ve-transport .btn:disabled,
.ve-transport input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ve-preview-overlay[hidden],
.ve-preview-overlay[style*="display: none"] {
  display: none !important;
}

.ve-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.ve-preview-frame {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-height: 480px;
  margin: 0 auto;
  width: 100%;
  max-width: 320px;
}

.ve-preview-frame[data-aspect="16:9"] {
  aspect-ratio: 16 / 9;
  max-width: 100%;
  max-height: 360px;
}

.ve-preview-frame[data-aspect="1:1"] {
  aspect-ratio: 1 / 1;
  max-width: 360px;
}

.ve-preview-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.ve-preview-media[hidden] {
  display: none !important;
}

.ve-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.ve-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.ve-transport {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.ve-scrub { flex: 1; accent-color: var(--accent); min-width: 80px; }

.ve-volume { width: 72px; accent-color: var(--accent); flex-shrink: 0; }

.ve-time {
  font-family: "Roboto Mono", monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 3rem;
}

.ve-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.ve-timeline-wrap {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem 1rem;
  overflow-x: auto;
}

.timeline-ruler {
  position: relative;
  height: 1.25rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.ruler-mark {
  position: absolute;
  font-size: 0.65rem;
  color: var(--muted);
  transform: translateX(-50%);
}

.timeline-track-wrap {
  position: relative;
  min-height: 4.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}

.timeline-track {
  position: relative;
  height: 4rem;
  min-width: 100%;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 8px var(--accent-glow);
}

.tl-clip {
  position: absolute;
  top: 0.35rem;
  height: 3.3rem;
  min-width: 3rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(52, 245, 164, 0.15), rgba(52, 245, 164, 0.05));
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  text-align: left;
}

.tl-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.tl-clip-icon { font-size: 0.75rem; opacity: 0.8; }
.tl-clip-label { font-size: 0.72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl-clip-dur { font-size: 0.65rem; color: var(--muted); }

/* ── Image Lab ── */
.img-lab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.img-lab-tab {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.img-lab-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(52, 245, 164, 0.08);
}

.img-lab-panel { display: none; }
.img-lab-panel.active { display: block; }

.img-lab-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 1rem;
}

.img-lab-canvas-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-lab-canvas {
  max-width: 100%;
  max-height: 420px;
  display: block;
}

.img-lab-placeholder {
  position: absolute;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.img-lab-placeholder.hidden { display: none; }

.has-image .img-lab-placeholder { display: none; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
}

.adj-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.adj-grid input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ── Pro Editor: icons & multi-track ── */
.ve-ico, .ve-ico-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.ve-ico svg, .ve-ico-wrap svg { width: 100%; height: 100%; }

.ve-tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.ve-tool-btn, .ve-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  padding: 0.45rem 0.55rem;
  min-width: 2.25rem;
}

.ve-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  object-fit: contain;
}

.ve-inspector-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.ve-inspector-tab {
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.ve-inspector-tab.active {
  color: var(--accent);
  background: rgba(52, 245, 164, 0.1);
}

.emoji-picker { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;
  max-height: 140px;
  overflow-y: auto;
}

.emoji-btn {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 0.35rem;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.emoji-btn:hover { border-color: var(--accent); background: rgba(52, 245, 164, 0.08); }

.ve-delete-btn { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; }

.ve-timeline-studio {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.tl-toolbar-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.tl-zoom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.tl-body {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 220px;
}

.tl-labels {
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.tl-label-spacer { height: 1.5rem; border-bottom: 1px solid var(--border); }

.tl-track-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: 3.25rem;
  padding: 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.tl-track-label .ve-ico { width: 0.9rem; height: 0.9rem; opacity: 0.85; }

.track-video .tl-track-label { color: #34f5a4; }
.track-text .tl-track-label { color: #6ecbff; }
.track-overlay .tl-track-label { color: #f5c542; }
.track-audio .tl-track-label { color: #c084fc; }

.tl-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
}

.timeline-tracks { position: relative; }

.tl-track-row {
  position: relative;
  height: 3.25rem;
  border-bottom: 1px solid var(--border);
}

.tl-track-lane {
  position: relative;
  height: 100%;
  min-width: 100%;
}

.track-video .tl-track-lane { background: rgba(52, 245, 164, 0.03); }
.track-text .tl-track-lane { background: rgba(110, 203, 255, 0.03); }
.track-overlay .tl-track-lane { background: rgba(245, 197, 66, 0.03); }
.track-audio .tl-track-lane { background: rgba(192, 132, 252, 0.03); }

.tl-clip {
  position: absolute;
  top: 0.3rem;
  height: 2.65rem;
  min-width: 2.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.5rem 0 0.35rem;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

.tl-clip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 12px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.track-video .tl-clip { background: linear-gradient(180deg, rgba(52, 245, 164, 0.22), rgba(52, 245, 164, 0.08)); }
.track-text .tl-clip { background: linear-gradient(180deg, rgba(110, 203, 255, 0.22), rgba(110, 203, 255, 0.08)); }
.track-overlay .tl-clip { background: linear-gradient(180deg, rgba(245, 197, 66, 0.22), rgba(245, 197, 66, 0.08)); }
.track-audio .tl-clip { background: linear-gradient(180deg, rgba(192, 132, 252, 0.22), rgba(192, 132, 252, 0.08)); }

.tl-clip-ico { width: 0.85rem; height: 0.85rem; opacity: 0.9; flex-shrink: 0; }

.tl-clip-resize {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.08);
}

.tl-clip-resize:hover { background: var(--accent); }

body.tl-dragging { cursor: grabbing; }
body.tl-dragging .tl-clip { cursor: grabbing; }

.ve-timeline-studio .timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 0 8px var(--accent-glow);
}

.ve-timeline-studio .timeline-ruler {
  position: relative;
  height: 1.5rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.ve-timeline-studio .timeline-empty {
  position: absolute;
  inset: 1.5rem 0 0;
  z-index: 0;
}

.media-bin-empty-icon.ve-ico { width: 2rem; height: 2rem; margin-bottom: 0.5rem; opacity: 0.6; }

@media (max-width: 900px) {
  .ve-editor-grid { grid-template-columns: 1fr; }
  .ve-media-bin { max-height: 180px; }
  .ve-layout, .img-lab-layout { grid-template-columns: 1fr; }
  .ve-preview-frame { max-height: 360px; }
  .tl-body { grid-template-columns: 64px 1fr; }
  .tl-track-label span:last-child { display: none; }
  .ve-tool-group { width: 100%; }
  .emoji-grid { grid-template-columns: repeat(5, 1fr); }
}

/* AI Image Generator */
.img-prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.img-prompt-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
}

.img-prompt-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.img-gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.img-fallback-banner {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 180, 80, 0.12);
  border: 1px solid rgba(255, 180, 80, 0.35);
  color: #f5d9a8;
  font-size: 0.85rem;
}

.img-gen-gallery {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.img-gen-gallery-title {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
}

.img-gen-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.img-gen-thumb {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
}

.img-gen-thumb.active {
  border-color: var(--accent);
}

.img-gen-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.img-gen-thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.2rem 0.35rem;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
}
