/* ============================================================================
   SYLLOVO STUDIO v2.0 — ELEVENLABS-INSPIRED PURE WHITE & CRISP BLACK DESIGN
   Default: Pure Crisp White (#FFFFFF) + Pitch Black (#09090B)
   Supports: Light (Default) | Dark (Night) | Auto (System)
   Desktop: Clean Left Sidebar + Spacious Canvas (Zero Tab Cutoff)
   Mobile: Uncluttered Native App Shell + Guided Next Step + 5-Icon Bottom Bar
   ============================================================================ */

:root,
[data-theme="light"] {
  --bg-app: #ffffff;
  --bg-sidebar: #fafafa;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-hover: #f4f4f5;
  --bg-active: #09090b;
  --text-active-on-dark: #ffffff;
  --text-main: #09090b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #09090b;
  --accent-hover: #27272a;
  --accent-fg: #ffffff;
  --brand-blue: #2563eb;
  --brand-blue-soft: #eff6ff;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --rose-border: #fecdd3;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg-app: #09090b;
  --bg-sidebar: #121215;
  --bg-surface: #18181b;
  --bg-subtle: #27272a;
  --bg-hover: #27272a;
  --bg-active: #ffffff;
  --text-active-on-dark: #09090b;
  --text-main: #fafafa;
  --text-secondary: #d4d4d8;
  --text-muted: #a1a1aa;
  --border: #27272a;
  --border-strong: #3f3f46;
  --accent: #fafafa;
  --accent-hover: #e4e4e7;
  --accent-fg: #09090b;
  --brand-blue: #3b82f6;
  --brand-blue-soft: rgba(59, 130, 246, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.35);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.35);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(244, 63, 94, 0.35);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.14);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.6);
}

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

html, body {
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   APP SHELL: LEFT SIDEBAR (DESKTOP) + MAIN WORKSPACE
   ============================================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Left Sidebar (Desktop) */
.app-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.03em;
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
}

/* Course Switcher inside Sidebar */
.sidebar-course-box {
  margin-bottom: 16px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.course-select {
  width: 100%;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}

.course-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Sidebar Navigation Links */
.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--bg-active);
  color: var(--text-active-on-dark);
  font-weight: 600;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-active-on-dark);
}

[data-theme="dark"] .nav-item.active .nav-badge {
  background: rgba(0, 0, 0, 0.18);
  color: var(--text-active-on-dark);
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.office-cluster-mini {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  display: inline-block;
  margin-right: 6px;
}

/* ============================================================================
   MAIN WORKSPACE AREA (TOP HEADER + SCROLLABLE CONTENT)
   ============================================================================ */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-app);
  overflow: hidden;
}

.top-header {
  height: 58px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
}

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

.mobile-only-logo {
  display: none;
}

.page-current-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
}

.header-course-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

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

/* Theme Segmented Control (Light | Dark | Auto) */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}

.theme-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.12s;
}

.theme-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* Role / User Select */
.role-select {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Scrollable Workspace Container */
.workspace-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 64px 28px;
}

.workspace-inner {
  max-width: 1180px;
  margin: 0 auto;
}

/* ============================================================================
   GUIDED "WHAT TO DO NEXT" HERO BAR (ZERO CONFUSION ON FIRST LOOK)
   ============================================================================ */
.guided-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.guided-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guided-step-badge {
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.guided-text-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.guided-text-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ============================================================================
   CARDS, BUTTONS, PILLS & TABLES (CLEAN ELEVENLABS STYLE)
   ============================================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
  border-color: var(--emerald);
}

.btn-emerald:hover:not(:disabled) {
  opacity: 0.92;
  background: var(--emerald);
}

.btn-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-border);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* Status Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-emerald {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.pill-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.pill-blue {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.pill-rose {
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid var(--rose-border);
}

.pill-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Approval & Finalize Bar */
.approval-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.approval-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Clean Outline Table / List */
.clean-table {
  width: 100%;
  border-collapse: collapse;
}

.clean-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.clean-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13.5px;
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.clean-table tr:hover td {
  background: var(--bg-subtle);
}

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

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ============================================================================
   VIDEO STUDIO (CLEAN SLIDE + VIDEO + NARRATION WORKSPACE)
   ============================================================================ */
.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.clip-pill-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.clip-tab-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}

.clip-tab-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.studio-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.stage-preview-box {
  background: #09090b;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-preview-box img,
.stage-preview-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.narration-list {
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.sentence-item {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.12s;
}

.sentence-item:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.sentence-item.active {
  border-color: var(--accent);
  background: var(--bg-subtle);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ============================================================================
   COLLAPSIBLE DETAILS / ON-DEMAND DRAWERS (KEEP UI UNCLUTTERED)
   ============================================================================ */
details.clean-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin-bottom: 16px;
  overflow: hidden;
}

details.clean-drawer summary {
  padding: 13px 16px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}

details.clean-drawer summary::-webkit-details-marker {
  display: none;
}

details.clean-drawer .drawer-body {
  padding: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================================
   BLOG & ABOUT CARDS
   ============================================================================ */
.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg-surface);
  transition: box-shadow 0.15s;
}

.blog-card:hover {
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-md);
  max-height: 90vh;
  overflow-y: auto;
}

/* ============================================================================
   MOBILE NATIVE APP RESPONSIVE RULES (<= 900px)
   ============================================================================ */
.mobile-bottom-nav {
  display: none;
}

.mobile-menu-sheet {
  display: none;
}

@media (max-width: 900px) {
  .app-sidebar {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only-logo {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .top-header {
    height: 54px;
    padding: 0 14px;
  }

  .page-current-title {
    font-size: 14.5px;
  }

  .header-course-pill {
    display: none;
  }

  .workspace-scroll {
    padding: 14px 14px 92px 14px;
  }

  .guided-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .guided-banner .btn {
    width: 100%;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .studio-main-grid {
    grid-template-columns: 1fr !important;
  }

  /* Responsive Table -> Clean Mobile Cards */
  .clean-table thead {
    display: none;
  }

  .clean-table,
  .clean-table tbody,
  .clean-table tr,
  .clean-table td {
    display: block;
    width: 100%;
  }

  .clean-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg-surface);
  }

  .clean-table td {
    border-bottom: none;
    padding: 4px 0;
  }

  /* Sticky Native Bottom Bar */
  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 9000;
    padding: 4px 6px env(safe-area-inset-bottom, 4px) 6px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10.5px;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 10px;
    cursor: pointer;
  }

  .mobile-nav-btn .m-icon {
    font-size: 17px;
  }

  .mobile-nav-btn.active {
    color: var(--text-main);
    background: var(--bg-subtle);
    font-weight: 700;
  }

  /* Mobile More Sheet */
  .mobile-menu-sheet.open {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9500;
    align-items: flex-end;
  }

  .mobile-sheet-card {
    width: 100%;
    background: var(--bg-surface);
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 32px 16px;
    border-top: 1px solid var(--border);
  }
}


/* ============================================================================
   CAMTASIA-STYLE INTERACTIVE TIMELINE, PLAYHEAD, DRAG/EXPAND CHUNKS & VU METER
   Modeled directly on Rupesh's local Camtasia + Pluralsight Audio Level Helper
   (-12 dB to -6 dB Target Range, -9.4 dB sweet spot)
   ============================================================================ */

.camtasia-workbench {
  display: grid;
  grid-template-columns: 220px 1fr 310px;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.camtasia-library-pane {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 430px;
  overflow-y: auto;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  cursor: grab;
  user-select: none;
  transition: all 0.12s;
}

.lib-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateX(2px);
}

.lib-item:active {
  cursor: grabbing;
}

.lib-item.audio-helper-item {
  background: var(--emerald-soft);
  border-color: var(--emerald-border);
  font-weight: 700;
}

/* Transport Controls Under Canvas */
.camtasia-transport-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #18181b;
  color: #fafafa;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 12.5px;
}

.transport-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #3f3f46;
  background: #27272a;
  color: #fafafa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
}

.transport-btn:hover {
  background: #3f3f46;
  transform: scale(1.06);
}

.transport-btn.play-main {
  width: 40px;
  height: 40px;
  background: #10b981;
  border-color: #10b981;
  color: #09090b;
  font-size: 15px;
  font-weight: 800;
}

/* Bottom Multi-Track Camtasia Timeline Dock + Right VU Meter */
.camtasia-timeline-dock {
  background: #141417;
  color: #e4e4e7;
  border: 1px solid #27272a;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.timeline-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #1c1c21;
  border-bottom: 1px solid #27272a;
  flex-wrap: wrap;
}

.tl-tool-btn {
  background: #27272a;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tl-tool-btn:hover {
  background: #3f3f46;
}

.tl-tool-btn.active {
  background: #10b981;
  color: #09090b;
  border-color: #10b981;
}

.timeline-body-with-meter {
  display: grid;
  grid-template-columns: 110px 1fr 86px;
  min-height: 226px;
}

/* Left Track Headers (Ruler spacer + Narration + Slides) */
.timeline-track-headers {
  background: #18181c;
  border-right: 1px solid #27272a;
  display: flex;
  flex-direction: column;
}

.th-ruler-spacer {
  height: 34px;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 10.5px;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.th-track-label {
  height: 88px;
  border-bottom: 1px solid #27272a;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #f4f4f5;
}

.th-track-sub {
  font-size: 10px;
  color: #a1a1aa;
  font-weight: 500;
}

/* Center Scrollable Multi-Track Canvas */
.timeline-scroll-area {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: #101014;
}

.timeline-canvas-inner {
  position: relative;
  min-height: 210px;
}

/* Time Ruler (Hover shows ew-resize cursor to scrub anywhere) */
.timeline-ruler {
  height: 34px;
  background: #18181c;
  border-bottom: 1px solid #2d2d35;
  position: relative;
  cursor: ew-resize;
}

.timeline-ruler:hover {
  background: #202028;
}

.ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #3f3f46;
  padding-left: 5px;
  padding-top: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: #a1a1aa;
  pointer-events: none;
}

.ruler-subtick {
  position: absolute;
  bottom: 0;
  height: 7px;
  border-left: 1px solid #2d2d35;
  pointer-events: none;
}

/* Track Lanes */
.timeline-track-lane {
  height: 88px;
  border-bottom: 1px solid #232329;
  position: relative;
  background-image: linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 100%;
}

/* Built-In Audio Level Helper Overlay Band (-12 dB to -6 dB sweet spot) */
.audio-helper-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  height: 34px;
  background: rgba(16, 185, 129, 0.11);
  border-top: 1px dashed rgba(16, 185, 129, 0.65);
  border-bottom: 1px dashed rgba(16, 185, 129, 0.65);
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
}

.audio-helper-band-label {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #34d399;
  background: rgba(9, 9, 11, 0.78);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Draggable & Resizable Voice Chunks & Slide Chunks */
.tl-chunk {
  position: absolute;
  top: 8px;
  height: 72px;
  border-radius: 7px;
  overflow: hidden;
  cursor: grab;
  transition: box-shadow 0.1s, border-color 0.1s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 3;
}

.tl-chunk:active {
  cursor: grabbing;
}

.tl-chunk.voice-chunk {
  background: linear-gradient(180deg, #27303f 0%, #1e2631 100%);
  border: 1.5px solid #475569;
}

.tl-chunk.slide-chunk {
  background: linear-gradient(180deg, #2d2640 0%, #1f1a2e 100%);
  border: 1.5px solid #6d28d9;
}

.tl-chunk:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  z-index: 5;
}

.tl-chunk.selected {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
  z-index: 6;
}

/* Left & Right Drag-to-Expand / Trim Handles (cursor: ew-resize) */
.chunk-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize !important;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: transparent;
  transition: background 0.12s, color 0.12s;
}

.chunk-resize-handle.left {
  left: 0;
  border-right: 1px solid transparent;
}

.chunk-resize-handle.right {
  right: 0;
  border-left: 1px solid transparent;
}

.tl-chunk:hover .chunk-resize-handle {
  background: rgba(56, 189, 248, 0.32);
  color: #ffffff;
}

.chunk-resize-handle:hover {
  background: #10b981 !important;
  color: #09090b !important;
  width: 13px;
}

.chunk-header-bar {
  padding: 3px 12px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.28);
  color: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  pointer-events: none;
}

.chunk-drag-hint {
  font-size: 9.5px;
  color: #38bdf8;
  opacity: 0;
  transition: opacity 0.12s;
}

.tl-chunk:hover .chunk-drag-hint {
  opacity: 1;
}

/* Playhead / Draggable Time Cursor */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #10b981;
  z-index: 20;
  cursor: ew-resize;
}

.playhead-cap {
  position: absolute;
  top: 0;
  left: -9px;
  width: 20px;
  height: 22px;
  background: #10b981;
  color: #09090b;
  border-radius: 4px 4px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.6);
  transition: transform 0.1s;
}

.playhead-cap:hover {
  transform: scale(1.18);
  background: #34d399;
}

.playhead-cap:active {
  cursor: grabbing;
}

.playhead-time-pill {
  position: absolute;
  top: 24px;
  left: 6px;
  background: #10b981;
  color: #09090b;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}

/* Right-Edge Vertical Camtasia Audio Level Meter (-12 dB to -6 dB Target) */
.camtasia-vu-meter {
  background: #18181c;
  border-left: 1px solid #27272a;
  padding: 8px 8px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.vu-scale-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 148px;
  width: 100%;
  justify-content: center;
  position: relative;
}

.vu-ticks {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #a1a1aa;
  text-align: right;
  padding: 2px 0;
}

.vu-bars {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: flex-end;
  background: #09090b;
  padding: 3px;
  border-radius: 5px;
  border: 1px solid #27272a;
  position: relative;
}

/* Highlighted -6 dB to -12 dB Target Zone on the VU Meter */
.vu-target-box {
  position: absolute;
  left: -2px;
  right: -2px;
  top: 12%;
  height: 18%;
  border: 1.5px solid #10b981;
  background: rgba(16, 185, 129, 0.16);
  border-radius: 3px;
  pointer-events: none;
  z-index: 4;
}

.vu-bar-col {
  width: 9px;
  height: 100%;
  background: #18181b;
  border-radius: 2px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.vu-bar-fill {
  width: 100%;
  height: 78%;
  background: linear-gradient(0deg, #10b981 0%, #10b981 75%, #f59e0b 90%, #ef4444 100%);
  transition: height 0.08s ease-out;
}

.vu-db-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .camtasia-workbench {
    grid-template-columns: 1fr !important;
  }
  .camtasia-library-pane {
    max-height: 180px;
  }
  .timeline-body-with-meter {
    grid-template-columns: 78px 1fr 68px;
  }
}
