/* ============================================================================
   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 — ChatGPT / Linear / Notion Collapsible & Pinnable) */
.app-sidebar {
  width: 260px;
  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;
  overflow-x: hidden;
  transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), padding 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width, transform;
  position: relative;
  z-index: 200;
}

.sidebar-hide-when-collapsed,
.nav-label-text {
  transition: opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1), transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 1;
  transform: translateX(0);
}

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

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

.brand-logo {
  width: 32px;
  height: 32px;
  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;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.logo-expand-icon {
  display: none;
  align-items: center;
  justify-content: center;
}

/* ChatGPT / Linear Top-Right Sidebar Collapse / Pin Button */
.sidebar-collapse-btn,
.header-sidebar-open-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.65;
  transition: all 0.15s ease;
}

.app-sidebar:hover .sidebar-collapse-btn,
.sidebar-collapse-btn:hover,
.header-sidebar-open-btn:hover {
  opacity: 1;
  color: var(--text-main);
  background: var(--bg-hover);
  border-color: var(--border);
}

/* Collapsed Icon Rail Mode (64px) + ChatGPT Logo-Hover Expand + Hover-Peek Drawer */
.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .app-sidebar {
  width: 64px;
  padding: 16px 8px;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .sidebar-hide-when-collapsed,
.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .nav-label-text {
  display: none !important;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .brand-row {
  justify-content: center;
  padding: 4px 0 14px 0;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .nav-item {
  justify-content: center;
  padding: 10px 0;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .nav-item-left {
  justify-content: center;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .sidebar-user-card {
  justify-content: center;
  padding: 8px 0;
}

/* Exact ChatGPT Behavior: Hovering the 'S' Logo when collapsed morphs it into the Expand/Pin Icon! */
.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .brand-logo:hover .logo-letter {
  display: none;
}

.app-layout.sidebar-collapsed:not(.sidebar-hover-peek) .brand-logo:hover .logo-expand-icon {
  display: inline-flex;
}

/* Hover-Peek Mode (When collapsed, hovering near the rail smoothly peeks the full 260px sidebar so you can click or pin!) */
.app-layout.sidebar-collapsed.sidebar-hover-peek .app-sidebar {
  width: 260px;
  box-shadow: var(--shadow-md);
}

.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 (ChatGPT / Linear / Vercel Style — Zero Text Cutoff) */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: all 0.14s ease;
}

.sidebar-user-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.sidebar-user-card.active {
  background: var(--bg-active);
  color: var(--text-active-on-dark);
  border-color: var(--bg-active);
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.sidebar-user-card.active .sidebar-user-avatar {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-active-on-dark);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card.active .sidebar-user-sub {
  color: rgba(255, 255, 255, 0.75);
}

.sidebar-gear-icon {
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.75;
}

.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) var(--radius-md) 0 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-bottom: none;
  aspect-ratio: 16 / 9;
  max-height: 40vh;
  min-height: 230px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-preview-box img,
.stage-preview-box video {
  width: 100%;
  height: 100%;
  max-height: 40vh;
  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;
  min-height: 226px;
}

.timeline-body-with-meter.meter-open {
  grid-template-columns: 110px 1fr 90px;
}

/* 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 pointer/hand cursor to click or drag-scrub anywhere) */
.timeline-ruler {
  height: 34px;
  background: #18181c;
  border-bottom: 1px solid #2d2d35;
  position: relative;
  cursor: pointer;
}

.timeline-ruler:active {
  cursor: grabbing;
}

.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 (20px Wide Hit-Box + Draggable Time Pill + z-index: 45) */
.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #10b981;
  z-index: 45;
  cursor: ew-resize;
}

.timeline-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -9px;
  width: 20px;
  cursor: ew-resize;
}

.timeline-playhead:active,
.playhead-cap:active,
.playhead-time-pill:active {
  cursor: grabbing;
}

.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: ew-resize;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.6);
  transition: transform 0.1s;
  z-index: 46;
}

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

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

.playhead-time-pill {
  position: absolute;
  top: 23px;
  left: 5px;
  background: #10b981;
  color: #09090b;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: auto;
  cursor: ew-resize;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  z-index: 46;
}

/* 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;
  }
  .timeline-body-with-meter.meter-open {
    grid-template-columns: 78px 1fr 68px;
  }
}


/* ============================================================================
   SYLLOVO STUDIO v6.0 — MOBILE-FIRST CAPCUT / FRAME.IO / DESCRIPT VIDEO EDITOR
   + OPEN-SOURCE PLYR & WAVESURFER.JS v7 + FULLSCREEN MODE + ZERO OVERFLOW
   ============================================================================ */

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

.header-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.page-current-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-inner,
.card,
.studio-main-grid > *,
.camtasia-workbench > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > * {
  min-width: 0;
  max-width: 100%;
}

/* Stage Container + Fullscreen Mode (Works on Android, iOS & Desktop) */
.studio-player-shell {
  background: #09090b;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  position: relative;
}

.studio-player-shell:fullscreen,
.studio-player-shell:-webkit-full-screen,
.studio-player-shell.stage-fullscreen-active {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: #000000 !important;
}

.studio-player-shell:fullscreen .stage-preview-box,
.studio-player-shell:-webkit-full-screen .stage-preview-box,
.studio-player-shell.stage-fullscreen-active .stage-preview-box {
  flex: 1 1 auto !important;
  aspect-ratio: auto !important;
  height: calc(100vh - 68px) !important;
  max-height: calc(100vh - 68px) !important;
  padding: 20px 28px 34px 28px !important;
  border: none !important;
  background: #000000 !important;
}

.studio-player-shell:fullscreen .stage-preview-box img,
.studio-player-shell:-webkit-full-screen .stage-preview-box img,
.studio-player-shell.stage-fullscreen-active .stage-preview-box img,
.studio-player-shell:fullscreen .stage-preview-box video,
.studio-player-shell:-webkit-full-screen .stage-preview-box video,
.studio-player-shell.stage-fullscreen-active .stage-preview-box video {
  max-height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

/* Permanent Safeguard (ZERO-STAGE-OVERLAY-BUTTONS-01): Zero top overlay buttons/text on the 16:9 slide/video screen */
.stage-top-overlay {
  display: none !important;
}

/* YouTube-Style Single Bottom Control Bar (.yt-control-bar) */
.yt-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  padding: 6px 10px 7px 10px;
  background: #0c0c0f;
  color: #f4f4f5;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 44px;
  position: relative;
  z-index: 30;
  flex-wrap: wrap;
}

.yt-ctrl-left,
.yt-ctrl-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.yt-ctrl-left {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.yt-ctrl-right {
  flex-shrink: 0;
}

.stage-preview-box.slide-stage-clean-bg {
  background: #ffffff;
}

.yt-icon-btn {
  background: transparent;
  color: #e4e4e7;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
  white-space: nowrap;
}

.yt-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.yt-icon-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}

.yt-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #10b981;
  color: #09090b;
  border: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.12s, background 0.12s;
}

.yt-play-btn:hover {
  background: #34d399;
  transform: scale(1.06);
}

.yt-timecode {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #d4d4d8;
  padding: 0 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.yt-inline-caption {
  font-size: 12px;
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 440px;
}

.stage-fullscreen-active .yt-inline-caption,
#studio-player-shell:fullscreen .yt-inline-caption,
#studio-player-shell:-webkit-full-screen .yt-inline-caption {
  max-width: 780px;
  font-size: 12.5px;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.yt-gear-popover {
  position: absolute;
  bottom: 52px;
  right: 14px;
  width: 260px;
  background: rgba(18, 18, 22, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 60;
  color: #fafafa;
}

/* Course Outline Status Filters & Time Summary */
.outline-status-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.status-filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
}

.status-filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.status-filter-pill.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.clip-owner-select {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Top Overlay Bar Inside Video/Slide Stage (Mode Switcher + Fullscreen Button) */
.stage-top-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 15;
  pointer-events: none;
}

.stage-top-overlay > * {
  pointer-events: auto;
}

.stage-overlay-pill {
  background: rgba(9, 9, 11, 0.78);
  backdrop-filter: blur(8px);
  color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stage-fullscreen-btn {
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.12s, background 0.12s;
}

.stage-fullscreen-btn:hover {
  background: #10b981;
  color: #09090b;
  border-color: #10b981;
  transform: scale(1.04);
}

/* Live Caption Subtitle Bar Inside Stage */
.stage-live-caption {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(6px);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 12;
  pointer-events: none;
}

/* Open-Source WaveSurfer.js v7 Waveform Dock */
.wavesurfer-box {
  position: relative;
  background: #101014;
  border-bottom: 1px solid #27272a;
  padding: 6px 0;
}

/* CapCut / Descript Style Segmented Drawer Tabs Below Timeline */
.studio-bottom-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow-x: auto;
}

.studio-subtab-btn,
.studio-bottom-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.12s;
}

.studio-subtab-btn.active,
.studio-bottom-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

/* ============================================================================
   EXPLICIT PRODUCTION TIME-GAP CLUES (0.5s / 1.0s / 1.5s) & LOCKED VOICE CHUNKS
   ============================================================================ */
.tl-rule-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
  font-family: var(--font-mono);
}

.tl-rule-pill.emerald {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.timeline-gap-clue-layer {
  position: absolute;
  top: 34px;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 4;
}

.tl-gap-clue {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  border-left: 1px dashed rgba(244, 63, 94, 0.55);
  border-right: 1px dashed rgba(244, 63, 94, 0.55);
  background: repeating-linear-gradient(
    45deg,
    rgba(244, 63, 94, 0.08),
    rgba(244, 63, 94, 0.08) 4px,
    rgba(244, 63, 94, 0.16) 4px,
    rgba(244, 63, 94, 0.16) 8px
  );
  transition: background 0.12s;
}

.tl-gap-clue.gap-pill-slide {
  border-left-color: rgba(168, 85, 247, 0.65);
  border-right-color: rgba(168, 85, 247, 0.65);
  background: repeating-linear-gradient(
    45deg,
    rgba(168, 85, 247, 0.1),
    rgba(168, 85, 247, 0.1) 4px,
    rgba(168, 85, 247, 0.22) 4px,
    rgba(168, 85, 247, 0.22) 8px
  );
}

.tl-gap-clue:hover {
  background: rgba(16, 185, 129, 0.22);
}

.tl-gap-pill-text {
  background: #09090b;
  color: #fda4af;
  border: 1px solid #f43f5e;
  border-radius: 4px;
  padding: 1px 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.tl-gap-clue.gap-pill-slide .tl-gap-pill-text {
  color: #e9d5ff;
  border-color: #a855f7;
}

.tl-chunk.voice-chunk.voice-locked {
  border-color: #10b981;
  background: linear-gradient(180deg, #132a23 0%, #0d1f1a 100%);
}

.chunk-db-lock-tag {
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  padding: 0 5px;
  border-radius: 4px;
}

.playhead-cursor-actions {
  position: absolute;
  top: 22px;
  left: 66px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  z-index: 45;
  pointer-events: auto;
}

.playhead-action-btn {
  background: #ec4899;
  color: #ffffff;
  border: 1px solid #f472b6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s, background 0.12s;
}

.playhead-action-btn:hover {
  background: #db2777;
  transform: scale(1.06);
}

.playhead-action-btn.zoom {
  background: #27272a;
  border-color: #52525b;
}

/* High-Visibility Top-Right & Fullscreen-Mirrored Toast Notifications */
.studio-toast-container {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 25000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 400px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.stage-toast-mirror {
  position: absolute;
  top: 48px;
  right: 16px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 380px;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

.studio-toast {
  background: #121217;
  color: #fafafa;
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  border-left: 5px solid #10b981;
  border-radius: 11px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 18px rgba(16, 185, 129, 0.25);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-toast.toast-fixing {
  border-color: rgba(245, 158, 11, 0.7);
  border-left-color: #f59e0b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.68), 0 0 20px rgba(245, 158, 11, 0.28);
}

.studio-toast.toast-queued {
  border-color: rgba(59, 130, 246, 0.65);
  border-left-color: #3b82f6;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 18px rgba(59, 130, 246, 0.25);
}

.studio-toast-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-top: 2px;
}

.studio-toast-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  animation: toastProgressFill 0.9s ease-out forwards;
}

@keyframes toastProgressFill {
  from {
    width: 12%;
  }
  to {
    width: 100%;
  }
}

.live-fix-banner {
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.live-fix-banner.fixing {
  background: rgba(245, 158, 11, 0.14);
  border: 1.5px solid #f59e0b;
  color: var(--text-main);
}

.live-fix-banner.fixed {
  background: rgba(16, 185, 129, 0.13);
  border: 1.5px solid #10b981;
  color: var(--text-main);
}

.live-fix-banner.queued {
  background: rgba(59, 130, 246, 0.12);
  border: 1.5px solid #3b82f6;
  color: var(--text-main);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: background 0.12s;
}

.cmdk-item:hover {
  background: var(--bg-hover);
}

/* ============================================================================
   YOUTUBE / PLYR / QUICKTIME INTERACTIVE VIDEO SCRUBBING & PROGRESS BAR
   (Expands on Stage Hover · Easy Drag Cursor · Chapter Ticks · Fullscreen Player)
   ============================================================================ */
.stage-video-scrub-wrap {
  position: relative;
  width: 100%;
  height: 18px;
  background: #121216;
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
  user-select: none;
  z-index: 25;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-video-scrub-wrap:active,
.stage-scrub-thumb:active {
  cursor: grabbing;
}

.stage-scrub-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  transition: height 0.14s ease, background 0.14s ease;
  overflow: visible;
}

.studio-player-shell:hover .stage-scrub-track,
.stage-video-scrub-wrap:hover .stage-scrub-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.3);
}

.stage-scrub-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 999px;
  pointer-events: none;
}

.stage-scrub-thumb {
  position: absolute;
  top: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%) scale(0.85);
  transition: transform 0.14s ease, background 0.14s ease;
  cursor: grab;
  z-index: 4;
}

.studio-player-shell:hover .stage-scrub-thumb,
.stage-video-scrub-wrap:hover .stage-scrub-thumb {
  transform: translate(-50%, -50%) scale(1.12);
  background: #34d399;
}

.stage-scrub-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(9, 9, 11, 0.72);
  pointer-events: none;
  z-index: 2;
}

.stage-scrub-tooltip {
  position: absolute;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(9, 9, 11, 0.94);
  color: #ffffff;
  border: 1px solid #10b981;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  z-index: 30;
}

.stage-video-scrub-wrap:hover .stage-scrub-tooltip {
  opacity: 1;
}

/* ============================================================================
   IMMEDIATE DRAG GUARD UNDO / REDO FLOATING BAR & BUTTON HIGHLIGHTS
   ============================================================================ */
.instant-drag-undo-bar {
  background: linear-gradient(90deg, #18181b 0%, #1e1b4b 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
  animation: toastSlideIn 0.16s ease-out;
}

.transport-btn.undo-active-glow,
.tl-tool-btn.undo-highlight {
  background: #f59e0b !important;
  color: #09090b !important;
  border-color: #fbbf24 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.transport-btn.redo-active-glow,
.tl-tool-btn.redo-highlight {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #60a5fa !important;
  font-weight: 800 !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.45);
}

.transport-btn:disabled,
.tl-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .mobile-only-inline {
    display: inline-flex !important;
  }

  .top-header {
    padding: 0 10px;
    gap: 6px;
  }

  .page-current-title {
    font-size: 14px;
    max-width: 140px;
  }

  .role-select {
    padding: 4px 8px;
    font-size: 11.5px;
  }

  .camtasia-transport-bar {
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .stage-live-caption {
    font-size: 11px;
    padding: 5px 8px;
    bottom: 6px;
  }
}

/* ============================================================================
   v8.9: DESKTOP 2-COLUMN VIDEO STAGE + RIGHT-SIDE COMMENT/SCREENSHOT DOCK
         & INTERACTIVE SPOTLIGHT GUIDED TOUR OVERLAY
   ============================================================================ */
.studio-hero-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 365px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

.stage-16x9-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 44vh;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-16x9-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.studio-player-shell.stage-fullscreen-active .stage-16x9-frame,
.studio-player-shell:fullscreen .stage-16x9-frame,
.studio-player-shell:-webkit-full-screen .stage-16x9-frame {
  max-height: calc(100vh - 115px) !important;
  height: 100%;
  width: auto;
}

.studio-side-comment-dock {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 52vh;
  min-height: 310px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.side-dock-header {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.side-dock-composer {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-target-pill {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.side-target-pill.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--emerald);
  color: var(--emerald);
  font-weight: 700;
}

.side-target-pill.active-pin {
  background: #ec4899;
  border-color: #f472b6;
  color: #fff;
  font-weight: 700;
}

.side-dock-textarea {
  width: 100%;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  min-height: 46px;
}

.side-dock-textarea.large-chat-box {
  flex: 1;
  min-height: 185px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-subtle);
}

.side-dock-textarea:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.side-dock-collapsed-history-bar {
  padding: 7px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

.side-dock-collapsed-history-bar:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Studio Color Palette Swatch Bar (Top Header + Settings) */
.palette-swatch-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}

.palette-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.palette-dot:hover {
  transform: scale(1.18);
}

.palette-dot.active {
  transform: scale(1.22);
  box-shadow: 0 0 0 2px var(--text-main);
}

.palette-custom-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px dashed var(--border-strong);
  cursor: pointer;
}

/* Curated Studio Color Palettes */
[data-palette="pluralsight"] {
  --bg-active: #e80a89;
  --accent: #e80a89;
  --accent-hover: #c00772;
  --emerald: #e80a89;
  --brand-blue: #e80a89;
}
[data-theme="light"][data-palette="pluralsight"] {
  --bg-sidebar: #fdf7fb;
  --bg-subtle: #fceef6;
}
[data-theme="dark"][data-palette="pluralsight"] {
  --bg-sidebar: #180f15;
  --bg-subtle: #281722;
}

[data-palette="ocean"] {
  --bg-active: #0284c7;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --emerald: #0284c7;
  --brand-blue: #0284c7;
}
[data-theme="light"][data-palette="ocean"] {
  --bg-sidebar: #f4f9fd;
  --bg-subtle: #e8f3fb;
}
[data-theme="dark"][data-palette="ocean"] {
  --bg-sidebar: #0c1520;
  --bg-subtle: #152334;
}

[data-palette="violet"] {
  --bg-active: #7c3aed;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --emerald: #7c3aed;
  --brand-blue: #7c3aed;
}
[data-theme="light"][data-palette="violet"] {
  --bg-sidebar: #f8f6ff;
  --bg-subtle: #f0ebff;
}
[data-theme="dark"][data-palette="violet"] {
  --bg-sidebar: #13101d;
  --bg-subtle: #211b32;
}

[data-palette="forest"] {
  --bg-active: #059669;
  --accent: #059669;
  --accent-hover: #047857;
  --emerald: #059669;
  --brand-blue: #059669;
}
[data-theme="light"][data-palette="forest"] {
  --bg-sidebar: #f4fbf8;
  --bg-subtle: #e6f7ef;
}
[data-theme="dark"][data-palette="forest"] {
  --bg-sidebar: #0c1713;
  --bg-subtle: #142720;
}

[data-palette="amber"] {
  --bg-active: #d97706;
  --accent: #d97706;
  --accent-hover: #b45309;
  --emerald: #d97706;
  --brand-blue: #d97706;
}
[data-theme="light"][data-palette="amber"] {
  --bg-sidebar: #fffbf2;
  --bg-subtle: #fef3dc;
}
[data-theme="dark"][data-palette="amber"] {
  --bg-sidebar: #18130b;
  --bg-subtle: #292013;
}

.side-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.side-attach-btn:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

.side-dock-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--bg-subtle);
}

.side-comment-card {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.12s ease;
}

.side-comment-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.side-comment-card.applied {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

/* Interactive Spotlight Guided Tour */
.tour-backdrop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.64);
  backdrop-filter: blur(2px);
  z-index: 10000;
}

.tour-spotlight-target {
  position: relative !important;
  z-index: 10002 !important;
  box-shadow: 0 0 0 4px #10b981, 0 0 0 9px rgba(16, 185, 129, 0.28), 0 12px 36px rgba(0, 0, 0, 0.65) !important;
  border-radius: 10px !important;
  transition: box-shadow 0.2s ease !important;
}

.tour-floating-coachmark {
  position: fixed;
  z-index: 10005;
  background: #121217;
  color: #fafafa;
  border: 2px solid #10b981;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.72), 0 0 24px rgba(16, 185, 129, 0.35);
  max-width: 390px;
  transition: top 0.2s cubic-bezier(0.22, 1, 0.36, 1), left 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.tour-coachmark-arrow {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: #10b981;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}

@media (max-width: 1080px) {
  .studio-hero-stage-grid {
    grid-template-columns: 1fr;
  }

  .studio-side-comment-dock {
    max-height: 340px;
  }
}

/* ============================================================================
   OFFICIAL PLURALSIGHT COURSE OUTLINE HTML RENDERER (SOURCE OF TRUTH)
   ============================================================================ */
.official-html-outline-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main);
}

.official-html-outline-body.outline-inline-editable {
  outline: 2px dashed var(--emerald);
  outline-offset: 6px;
  border-radius: 10px;
  padding: 6px;
  background: var(--bg-subtle);
}

.outline-doc-top-p {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.outline-table-card {
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface);
}

.outline-html-table {
  width: 100%;
  border-collapse: collapse;
}

.outline-html-table th,
.outline-html-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  vertical-align: top;
  text-align: left;
}

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

.outline-section-banner-row th {
  background: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 800;
  font-size: 14px;
  border-bottom: 1.5px solid var(--border-strong);
  padding: 10px 14px;
}

.outline-label-col {
  width: 240px;
  min-width: 190px;
  max-width: 270px;
  background: rgba(128, 128, 128, 0.04);
  border-right: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.outline-val-col {
  color: var(--text-main);
  font-size: 13.5px;
}

.outline-doc-module-hdr {
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-blue);
  margin: 8px 0 6px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.outline-doc-clip-hdr {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: 7px;
  border-left: 3px solid var(--emerald);
  margin: 10px 0 6px 0;
}

.outline-doc-bullet {
  padding-left: 12px;
  margin: 4px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.outline-doc-to {
  font-weight: 700;
  color: var(--text-main);
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--emerald);
  padding: 5px 9px;
  border-radius: 6px;
  margin: 4px 0;
  font-size: 12.5px;
}

.outline-proof-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(232, 10, 137, 0.12);
  color: #e80a89;
  font-weight: 700;
  font-size: 11.5px;
}

.outline-lo-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--emerald-bg);
  color: var(--emerald);
  font-weight: 700;
  font-size: 11.5px;
}

.outline-nested-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
}

.outline-nested-table th {
  background: var(--bg-subtle);
  font-weight: 800;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-strong);
}

.outline-nested-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================================
   v10.2: PROGRESSIVE DISCLOSURE UX, COMPACT PALETTE POPOVER & FLOATING SYLLOVO AI LAUNCHER
   ============================================================================ */
.palette-popover-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.palette-swatch-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.clip-depth-link {
  background: transparent;
  border: none;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--emerald);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
}

.clip-depth-link:hover {
  background: var(--emerald-bg);
}

.syllovo-ai-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.42), 0 4px 12px rgba(0, 0, 0, 0.22);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.syllovo-ai-fab:hover {
  transform: translateY(-2px) scale(1.03);
  background: #059669;
  box-shadow: 0 14px 34px rgba(16, 185, 129, 0.55), 0 6px 16px rgba(0, 0, 0, 0.28);
}

.syllovo-ai-fab-icon {
  font-size: 15px;
  line-height: 1;
}

.syllovo-ai-fab-label {
  letter-spacing: -0.01em;
}

@media (max-width: 900px) {
  .syllovo-ai-fab {
    bottom: 72px;
    right: 14px;
    padding: 9px 13px;
    font-size: 12px;
  }
}

/* ============================================================================
   v10.4: SMOOTH IN-PLACE SLIDE AUTO-REFRESH (0 PAGE RELOAD) & COLOR-CODED
   STUDIO BUG / UX CHAT MODE (ELECTRIC VIOLET #7C3AED + AMBER #F59E0B)
   ============================================================================ */
#studio-stage-img {
  transition: opacity 0.22s ease, filter 0.22s ease, box-shadow 0.35s ease;
}

#studio-stage-img.stage-img-refreshing {
  opacity: 0.62;
  filter: saturate(1.12) brightness(1.03);
}

#studio-stage-img.stage-img-refreshed-glow {
  box-shadow: 0 0 0 3px #10b981, 0 0 26px rgba(16, 185, 129, 0.55);
}

.stage-smooth-refresh-pill {
  position: absolute;
  bottom: 48px;
  right: 14px;
  z-index: 46;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(8px);
  border: 1.5px solid #10b981;
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-sans);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.stage-smooth-refresh-pill.visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-mode-switcher-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.chat-mode-tab {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.chat-mode-tab.active-content-mode {
  background: rgba(16, 185, 129, 0.13);
  border-color: #10b981;
  color: #047857;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.18);
}

[data-theme="dark"] .chat-mode-tab.active-content-mode {
  color: #34d399;
}

.chat-mode-tab.active-bug-mode {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(245, 158, 11, 0.14));
  border-color: #7c3aed;
  color: #6d28d9;
  box-shadow: 0 1px 6px rgba(124, 58, 237, 0.25);
}

[data-theme="dark"] .chat-mode-tab.active-bug-mode {
  color: #c4b5fd;
}

.studio-side-comment-dock.studio-bug-mode {
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.28), var(--shadow-sm);
}

.side-dock-header.studio-bug-header {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(245, 158, 11, 0.08));
  border-bottom-color: rgba(124, 58, 237, 0.35);
}

.pill-violet-bug {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

[data-theme="dark"] .pill-violet-bug {
  color: #c4b5fd;
}

.side-target-pill.studio-bug-pill {
  border-color: #7c3aed;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  font-weight: 700;
}

.studio-bug-quick-bar {
  padding: 7px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.09), rgba(245, 158, 11, 0.07));
  border: 1px solid rgba(124, 58, 237, 0.38);
  margin-bottom: 8px;
}

.studio-bug-chip {
  background: var(--bg-surface);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #6d28d9;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.14s ease;
}

[data-theme="dark"] .studio-bug-chip {
  color: #ddd6fe;
}

.studio-bug-chip:hover {
  background: #7c3aed;
  color: #ffffff;
}

.side-dock-textarea.studio-bug-textarea {
  border-color: #7c3aed !important;
  background: rgba(124, 58, 237, 0.03);
}

.side-dock-textarea.studio-bug-textarea:focus {
  outline: none;
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.btn-violet-bug {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  color: #ffffff !important;
  border: 1px solid #f59e0b !important;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.32);
}

.btn-violet-bug:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6) !important;
}

.live-fix-banner.studio-bug-banner {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(245, 158, 11, 0.08));
  border: 1.5px solid #7c3aed;
  border-radius: 8px;
  padding: 7px 9px;
}

.side-comment-card.studio-bug-card {
  border-left: 3px solid #7c3aed;
  background: rgba(124, 58, 237, 0.05);
}
