/* ==========================================================================
   STYLES.CSS — mtips5s 360° Spatial Director & Cut-Scene Studio
   Designed strictly following: mtips5s_30_VPS3_UX_UI_Design Standards
   Dark Obsidian Glassmorphism · 8pt Grid System · Plus Jakarta Sans · High Ergonomics
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (from mtips5s_30_VPS3_UX_UI_Design/theme.css)
   -------------------------------------------------------------------------- */
:root {
  /* Color Scheme declaration per modern-web-guidance */
  color-scheme: dark light;
  interpolate-size: allow-keywords;

  /* Color Palette - Graphite Tech & Dark Obsidian (from mtips5s_motions & VPS3) */
  --bg-app: #0a0a0c;
  --bg-sidebar: #0f0f12;
  --bg-surface: #17171a;
  --bg-surface-elevated: #1c1c21;
  --bg-surface-3: #26262c;
  --bg-card: rgba(23, 23, 26, 0.78);
  --bg-glass: rgba(23, 23, 26, 0.68);
  --bg-input: #1c1c21;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #5e6ad2;
  --border-accent: rgba(94, 106, 210, 0.38);

  --text-main: #f7f8f8;
  --text-primary: #ffffff;
  --text-secondary: #c9cdd1;
  --text-muted: #8a8f98;
  --text-dim: #62666d;
  --text-inverse: #0a0a0c;

  /* Brand Accents — Electric Indigo & Motions Studio Spectrum */
  --accent-primary: #5e6ad2;       /* Electric Indigo */
  --accent-primary-hover: #6b76e5;
  --accent-primary-dark: #9aa2f2;  /* High-contrast text on dark tint */
  --accent-primary-light: rgba(94, 106, 210, 0.22);
  --accent-secondary: #8b7aff;     /* Violet */
  --accent-cyan: #5294e2;          /* Electric Blue */
  --accent-cyan-soft: rgba(82, 148, 226, 0.16);
  --accent-cyan-text: #9ac2f1;
  --accent-emerald: #4cc38a;       /* Emerald Success */
  --accent-emerald-soft: rgba(76, 195, 138, 0.16);
  --accent-emerald-text: #8adfb6;
  --accent-rose: #eb5757;          /* Danger Rose */
  --accent-rose-soft: rgba(235, 87, 87, 0.16);
  --accent-rose-text: #f4a9a9;
  --accent-amber: #f2c94c;         /* Warning Amber */
  --accent-amber-soft: rgba(242, 201, 76, 0.16);
  --accent-amber-text: #f5d77a;

  /* Gradient Tokens */
  --grad-primary: linear-gradient(135deg, #5e6ad2 0%, #8b7aff 50%, #ec4899 100%);
  --grad-btn-primary: linear-gradient(180deg, #6b76e5 0%, #5e6ad2 100%);
  --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  --grad-glow: radial-gradient(circle at 50% 0%, rgba(94, 106, 210, 0.22) 0%, transparent 70%);
  --grad-cyan: linear-gradient(135deg, #5294e2 0%, #3b82f6 100%);
  --grad-emerald: linear-gradient(135deg, #5ecd97 0%, #4cc38a 100%);
  --grad-amber: linear-gradient(135deg, #f5d77a 0%, #f2c94c 100%);

  /* Shadows & Specular Edge Elevation (from mtips5s_motions) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-pill: 0 4px 18px rgba(94, 106, 210, 0.38), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(94, 106, 210, 0.35);
  --shadow-cyan-glow: 0 0 24px rgba(82, 148, 226, 0.25);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.45), 0 14px 40px rgba(0, 0, 0, 0.5);

  /* Radius Scale */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;

  /* Spacing Scale (8pt Grid System) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme Variables (from mtips5s_30_VPS3_UX_UI_Design/theme.css) */
[data-theme="light"] {
  color-scheme: light;
  --bg-app: #f8fafc;
  --bg-sidebar: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.78);
  --bg-input: #f8fafc;
  --bg-overlay: rgba(15, 23, 42, 0.6);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;
  --border-accent: rgba(79, 70, 229, 0.25);

  --text-main: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* --------------------------------------------------------------------------
   2. BASE RESET & TYPOGRAPHY
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.15rem, 1rem + 0.8vw, 1.45rem); }
h2 { font-size: clamp(1rem, 0.92rem + 0.5vw, 1.25rem); }
h3 { font-size: clamp(0.92rem, 0.86rem + 0.3vw, 1.1rem); }

p {
  color: var(--text-secondary);
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.85em;
  color: var(--accent-cyan);
}

[data-theme="light"] code {
  background: rgba(0, 0, 0, 0.06);
  color: #0284c7;
}

/* --------------------------------------------------------------------------
   3. APP CONTAINER & STUDIO LAYOUT (from layout.css)
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  background-color: var(--bg-app);
  /* Clip ambient glows without making the shell a scroll container.
     Focus/scrollIntoView must only scroll the content panes. */
  overflow: clip;
  position: relative;
}

/* Ambient Glow Blobs */
.app-container::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-container::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: 220px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   4. SIDEBAR NAVIGATION (from layout.css)
   -------------------------------------------------------------------------- */
.sidebar {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  background: var(--bg-sidebar, #0c101c);
  border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 0 16px 0;
  transition: transform var(--transition-base), width var(--transition-base);
  user-select: none;
}

/* Muse Slim Rail Top */
.muse-rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.muse-rail-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.muse-rail-logo:hover {
  transform: scale(1.08);
}

.btn-sidebar-close {
  display: none;
  position: absolute;
  top: -4px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #fff);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  z-index: 10;
  transition: all 0.2s ease;
}

.btn-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

/* Muse Slim Rail Navigation Items */
.muse-rail-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: none;
}

.muse-rail-nav::-webkit-scrollbar {
  display: none;
}

/* Muse Rail Button Base (Identical to Muse UI Screenshot) */
.muse-rail-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
}

.muse-rail-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: scale(1.05);
}

/* Active State: subtle circle ring backdrop like Muse chat icon */
.muse-rail-btn.active {
  background: #27272a;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.35);
}

.muse-rail-btn .rail-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  display: block;
  transition: transform 0.2s ease;
}

.muse-rail-btn:hover .rail-icon {
  stroke-width: 2;
}

.btn-rail-new-chat {
  color: #818cf8;
}

.btn-rail-new-chat:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

/* Muse Rail Bottom Dock */
.muse-rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

/* =================================================================== */
/* LUXURY HOVER TOOLTIP (DARK GLASSMORPHISM WITH POINTER)              */
/* =================================================================== */
.muse-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  background: rgba(18, 22, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  z-index: 99999;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tooltip Arrow */
.muse-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent rgba(255, 255, 255, 0.14) transparent transparent;
}

.muse-tooltip::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: transparent rgba(18, 22, 34, 0.96) transparent transparent;
}

.tooltip-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.tooltip-desc {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
  line-height: 1.2;
}

/* Hover Trigger */
.muse-rail-btn:hover .muse-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0) scale(1);
}

.muse-system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 0 10px;
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  font-family: 'JetBrains Mono', monospace;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.38);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

[data-theme="light"] .brand-title {
  background: linear-gradient(120deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}

/* Sidebar Navigation Menu */
.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  padding: var(--space-3) var(--space-3) var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  background: transparent;
  position: relative;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(94, 106, 210, 0.2) 0%, rgba(94, 106, 210, 0.04) 100%);
  border-color: rgba(94, 106, 210, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .nav-item.active {
  color: var(--accent-primary);
  background: #ffffff;
  border-color: rgba(94, 106, 210, 0.35);
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.7);
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  display: inline-flex;
  justify-content: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.nav-item.active .nav-badge {
  background: var(--accent-primary-light);
  color: var(--accent-primary-dark);
  border: 1px solid rgba(94, 106, 210, 0.35);
}

/* Sidebar Footer (Readiness & Tools) */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: rgba(0, 0, 0, 0.15);
}

.study-progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 600;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

[data-theme="light"] .progress-bar-wrap {
  background: rgba(0, 0, 0, 0.08);
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease-out;
}

/* --------------------------------------------------------------------------
   5. MAIN WRAPPER & TOPBAR (from layout.css)
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.topbar {
  height: 56px;
  min-height: 56px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface, rgba(14, 18, 28, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 30;
  gap: 12px;
}

[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-app-region: no-drag;
  min-width: 0;
  flex: 1;
}

.page-title-box {
  min-width: 0;
}

/* Muse Brand Header in Topbar */
.header-muse-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-muse-brand .muse-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.header-muse-brand .muse-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.header-muse-brand .muse-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.header-muse-brand .muse-subtitle {
  font-size: 0.73rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 580px;
}

.header-studio-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.page-title-box h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-title-box p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-app-region: no-drag;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box input {
  width: 100%;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-8) 0 var(--space-3);
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.search-icon-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.82rem;
  pointer-events: none;
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* --------------------------------------------------------------------------
   6. BUTTONS & CONTROLS (from components.css)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  font-family: inherit;
  outline: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--grad-btn-primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(94, 106, 210, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #7883ee 0%, #636fe0 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(94, 106, 210, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-gradient {
  background: var(--grad-primary);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 16px rgba(94, 106, 210, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-gradient:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(94, 106, 210, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-secondary {
  background: #1c1c21;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-secondary:hover {
  background: #26262c;
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 8px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.btn-emerald {
  background: var(--grad-emerald);
  color: #042315;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(76, 195, 138, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-emerald:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(76, 195, 138, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-cyan {
  background: var(--grad-cyan);
  color: #061938;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(82, 148, 226, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-cyan:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(82, 148, 226, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-amber {
  background: var(--grad-amber);
  color: #3b2800;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 14px rgba(242, 201, 76, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-amber:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(242, 201, 76, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-accent);
  background: #26262c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  line-height: 1.1;
  white-space: nowrap;
}

.badge-emerald, .badge-basic {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-text);
  border-color: rgba(76, 195, 138, 0.35);
}

.badge-amber, .badge-medium {
  background: var(--accent-amber-soft);
  color: var(--accent-amber-text);
  border-color: rgba(242, 201, 76, 0.35);
}

.badge-rose, .badge-advanced {
  background: var(--accent-rose-soft);
  color: var(--accent-rose-text);
  border-color: rgba(235, 87, 87, 0.35);
}

.badge-cyan {
  background: var(--accent-cyan-soft);
  color: var(--accent-cyan-text);
  border-color: rgba(82, 148, 226, 0.35);
}

.badge-primary, .badge-completed {
  background: var(--accent-primary-light);
  color: var(--accent-primary-dark);
  border-color: rgba(94, 106, 210, 0.38);
}

/* Select & Inputs */
.select-field, .input-field {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  outline: none;
  transition: all var(--transition-fast);
}

.select-field:focus, .input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.select-compact {
  height: 34px;
  padding: 4px 8px;
}

.control-dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. CAMERA & SPATIAL HERO WORKSPACE
   -------------------------------------------------------------------------- */
.camera-focus-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
}

.camera-control-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.camera-primary-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.camera-primary-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.camera-primary-actions .btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.camera-dropdowns-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.camera-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-top: 2px;
}

.quick-genre-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.quick-genre-item select {
  flex: 1;
}

/* --------------------------------------------------------------------------
   SETTINGS TAB & SYSTEM CONFIG CARDS
   -------------------------------------------------------------------------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4);
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
  transition: all var(--transition-fast);
}

.settings-card:hover {
  border-color: var(--border-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 18px rgba(0, 0, 0, 0.35);
}

.settings-card-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-card-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-fields-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.settings-field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-field-row label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.settings-field-row select,
.settings-field-row input {
  width: 100%;
}

/* Viewport Stage (Equirectangular Canvas + Live Video · MuseFlow Cyber Matrix Viewfinder) */
.viewport-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  background-color: #0c0d12;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(94, 106, 210, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), aspect-ratio 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.viewport-stage:active {
  cursor: grabbing;
}

.viewport-stage.cinema-mode {
  aspect-ratio: 16 / 9;
  max-height: 460px;
  max-width: 100%;
}

.viewport-stage.vertical-mode {
  aspect-ratio: 9 / 16;
  max-width: 320px;
  max-height: 520px;
  margin: 0 auto;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(94, 106, 210, 0.4);
}

/* 1. Cyber Matrix Dots Canvas Backdrop (MuseFlow Inspired) */
.stage-cyber-grid {
  position: absolute;
  inset: 0;
  background-color: #0c0d12;
  background-image: 
    radial-gradient(rgba(148, 163, 184, 0.15) 1.2px, transparent 1.2px),
    linear-gradient(to bottom, rgba(94, 106, 210, 0.03) 1px, transparent 1px);
  background-size: 20px 20px, 100% 4px;
  pointer-events: none;
  z-index: 1;
}

.viewport-stage canvas,
.viewport-stage video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
}

/* 2. Director Monitor L-Bracket Viewfinder Corners */
.viewfinder-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 6;
  transition: all 0.25s ease;
}

.corner-top-left {
  top: 12px;
  left: 12px;
  border-top: 2px solid var(--accent-primary);
  border-left: 2px solid var(--accent-primary);
  box-shadow: -2px -2px 8px rgba(94, 106, 210, 0.45);
}

.corner-top-right {
  top: 12px;
  right: 12px;
  border-top: 2px solid var(--accent-primary);
  border-right: 2px solid var(--accent-primary);
  box-shadow: 2px -2px 8px rgba(94, 106, 210, 0.45);
}

.corner-bottom-left {
  bottom: 12px;
  left: 12px;
  border-bottom: 2px solid var(--accent-primary);
  border-left: 2px solid var(--accent-primary);
  box-shadow: -2px 2px 8px rgba(94, 106, 210, 0.45);
}

.corner-bottom-right {
  bottom: 12px;
  right: 12px;
  border-bottom: 2px solid var(--accent-primary);
  border-right: 2px solid var(--accent-primary);
  box-shadow: 2px 2px 8px rgba(94, 106, 210, 0.45);
}

/* 3. Optical Center Crosshair Reticle */
.center-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.viewport-stage:hover .center-crosshair {
  opacity: 0.85;
}

.crosshair-ring {
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 50%;
}

.crosshair-line {
  position: absolute;
  background: rgba(94, 106, 210, 0.65);
}

.crosshair-line.line-h {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.crosshair-line.line-v {
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  transform: translateX(-50%);
}

.crosshair-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* 4. MuseFlow Floating Glassmorphism Toolbar (.canvas-tools) */
.canvas-tools {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: rgba(23, 25, 35, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}

.canvas-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a1c25;
  color: #94a3b8;
  border: 1px solid #363946;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.canvas-tool-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.18s ease, stroke 0.18s ease;
}

.canvas-tool-btn:hover {
  background: #252834;
  border-color: var(--accent-primary);
  color: #f8fafc;
  transform: translateY(-1px);
}

.canvas-tool-btn:hover svg {
  transform: scale(1.1);
  stroke: #ffffff;
}

.canvas-tool-btn:active {
  transform: translateY(0);
}

.canvas-tool-btn.active {
  background: rgba(94, 106, 210, 0.25);
  border-color: var(--accent-primary);
  color: #c7d2fe;
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.4);
}

.canvas-tool-btn.active svg {
  stroke: #a5b4fc;
}

/* 5. Camera Live HUD Pill (Top Left) */
.camera-live-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 21, 34, 0.85);
  backdrop-filter: blur(12px);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
  animation: pulseGlow 1.5s infinite;
}

/* 6. Quick Telemetry Pill on Viewport (Below Live HUD) */
.camera-telemetry-pill {
  position: absolute;
  top: 50px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 21, 34, 0.8);
  backdrop-filter: blur(12px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.telemetry-mini-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* 7. Cinematography Overlays */
.camera-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.grid-thirds {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, transparent 33.1%, rgba(255, 255, 255, 0.22) 33.3%, transparent 33.5%, transparent 66.4%, rgba(255, 255, 255, 0.22) 66.6%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255, 255, 255, 0.22) 33.3%, transparent 33.5%, transparent 66.4%, rgba(255, 255, 255, 0.22) 66.6%, transparent 66.8%);
}

.safe-zone-box {
  position: absolute;
  top: 5%;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 9 / 16;
  border: 1.5px dashed var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.axis-180-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  border-left: 1.5px dashed var(--accent-amber);
  opacity: 0.65;
  display: none !important; /* Đã ẩn trên giao diện; lưu ngầm cho Agent tham khảo */
}

/* Ẩn các công cụ xoay 360 & trục 180 theo yêu cầu người dùng, giữ ngầm logic cho Agent */
#overlayAxis180,
#btnCanvasPan,
#btnCanvasReset,
#tab-spatial,
#btnNavStudio,
.studio-subtab-btn[data-subtab="subtab-camera"] {
  display: none !important;
}

/* Ẩn các nút điều hướng nhanh trong sidebar theo yêu cầu (giữ lại Chat chính, Cài đặt, Theme) */
#btnNavSearch,
#btnNavStudioLibrary,
#btnNavTelemetry,
#btnNavSingleAngle {
  display: none !important;
}

/* Ẩn icon chế độ Sáng / Tối theo yêu cầu */
#railThemeToggleBtn,
#themeToggleBtn {
  display: none !important;
}

.bokeh-leaf-guide {
  position: absolute;
  top: 54px;
  right: 14px;
  background: rgba(16, 185, 129, 0.16);
  backdrop-filter: blur(8px);
  border: 1px dashed var(--accent-emerald);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  font-size: 0.70rem;
  color: #34d399;
  text-align: right;
  line-height: 1.3;
  z-index: 9;
}

.bokeh-guide-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bokeh-guide-inner svg {
  stroke: var(--accent-emerald);
  flex-shrink: 0;
}

/* 8. Standby Cyber Hologram State Hint */
.stage-standby-hint {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 3;
  pointer-events: none;
  text-align: center;
  padding: 20px;
  max-width: 420px;
}

.standby-hologram {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
}

.hologram-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px dashed rgba(94, 106, 210, 0.55);
}

.hologram-ring.outer {
  inset: 0;
  animation: rotateClockwise 12s linear infinite;
}

.hologram-ring.inner {
  inset: 7px;
  border-color: rgba(6, 182, 212, 0.65);
  border-style: solid;
  border-top-color: transparent;
  animation: rotateCounterClockwise 8s linear infinite;
}

.hologram-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hologram-icon svg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.75));
  transition: transform 0.3s ease;
}

@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateCounterClockwise {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.standby-copy .standby-title {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f1f5f9;
  text-transform: uppercase;
}

.standby-copy .standby-sub {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.4;
}

.standby-copy strong {
  color: var(--accent-cyan);
}

/* 9. Director Monitor Bottom Radar Bar (.stage-bottom-radar) */
.stage-bottom-radar {
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(16, 21, 34, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.radar-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radar-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.radar-tag.live-badge {
  background: rgba(94, 106, 210, 0.25);
  color: #c7d2fe;
  border: 1px solid rgba(94, 106, 210, 0.4);
}

.radar-tag.ready-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.radar-metric {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.radar-metric strong {
  color: #f8fafc;
}

.pitch-ladder-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pitch-ladder-bar {
  width: 16px;
  height: 2px;
  background: rgba(148, 163, 184, 0.4);
}

.pitch-ladder-center {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   8. SPACE WORKFLOW & SUFFICIENCY ADVISOR
   -------------------------------------------------------------------------- */
.space-workflow-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.space-workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.space-workflow-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.space-workflow-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.space-workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: stretch;
}

@media (max-width: 768px) {
  .space-workflow-grid {
    grid-template-columns: 1fr;
  }
}

.captured-photos-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 0;
  box-sizing: border-box;
}

.sufficiency-advisor-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   9. COLLAPSIBLE SECTIONS & GLASS CARDS
   -------------------------------------------------------------------------- */
.collapsible-sections-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.collapsible-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
  backdrop-filter: blur(16px);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.collapsible-section:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
  transform: translateY(-1px);
}

[data-theme="light"] .collapsible-section:hover {
  border-color: rgba(0, 0, 0, 0.14);
}

.collapsible-section[open] {
  border-color: var(--border-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-glow);
}

.collapsible-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  user-select: none;
  background: var(--grad-surface);
  transition: background var(--transition-fast);
}

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

.collapsible-summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .collapsible-summary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.summary-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.summary-title-group > div {
  min-width: 0;
  flex: 1;
}

.summary-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.summary-heading {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  word-break: break-word;
  overflow-wrap: break-word;
}

.summary-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.collapse-toggle-indicator {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--transition-base);
  font-size: 0.8rem;
}

.collapse-toggle-indicator::after {
  content: '▼';
}

.collapsible-section[open] .collapse-toggle-indicator {
  transform: rotate(-180deg);
  color: var(--accent-primary);
}

.collapsible-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeIn 0.25s ease-out;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

/* Sub-collapsibles inside sections */
.sub-collapsible {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sub-collapsible-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.sub-collapsible-summary::-webkit-details-marker {
  display: none;
}

.sub-collapsible[open] .collapse-toggle-indicator {
  transform: rotate(-180deg);
}

/* --------------------------------------------------------------------------
   10. 4-PILLAR MASTER BLUEPRINT CARDS
   -------------------------------------------------------------------------- */
.blueprint-pillars-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.blueprint-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
}

.blueprint-pillar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
  transition: all var(--transition-fast);
}

.blueprint-pillar-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 18px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   11. STAT CARDS & TELEMETRY GRID (from components.css)
   -------------------------------------------------------------------------- */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
}

.metric-box, .stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
  transition: all var(--transition-fast);
}

.metric-box:hover, .stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 18px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.metric-label, .stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value, .stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.metric-sub, .stat-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   12. RIGS GRID & CUT-SCENE CARDS
   -------------------------------------------------------------------------- */
.rigs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);
}

.rig-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  transition: all var(--transition-fast);
}

.rig-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}

.rig-media-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rig-media-box {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #050811;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rig-media-box video,
.rig-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   13. STORYBOARD SCRIPT & STORY ARC
   -------------------------------------------------------------------------- */
.story-arc-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
}

.story-arc-step {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.script-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  transition: border-color var(--transition-fast);
}

.script-card:hover {
  border-color: var(--border-accent);
}

/* --------------------------------------------------------------------------
   14. MODAL DIALOGS (per modern-web-guidance)
   -------------------------------------------------------------------------- */
dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  padding: 0;
  max-width: 680px;
  width: 90vw;
  max-height: 85vh;
  box-shadow: var(--shadow-lg);
  margin: auto;
}

dialog::backdrop {
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-inner {
  padding: var(--space-5);
  overflow-y: auto;
  max-height: 85vh;
}

/* Sidebar Dimmed Backdrop on Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Library Grid Responsive Layout */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--space-4);
}

/* --------------------------------------------------------------------------
   15. MOBILE BOTTOM NAVIGATION & RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 10, 12, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 80;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px env(safe-area-inset-bottom, 0);
}

[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: rgba(0, 0, 0, 0.1);
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  text-align: center;
  user-select: none;
}

.bottom-nav .nav-item span:not(.nav-icon) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  line-height: 1.1;
}

.bottom-nav .nav-item.active {
  color: var(--accent-primary);
}

.bottom-nav .nav-item.active::before {
  display: none;
}

.bottom-nav .nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* ==========================================================================
   TABLET & MOBILE BREAKPOINT (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: clip;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
    transition: transform var(--transition-base);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .bottom-nav {
    display: flex;
  }

  .main-wrapper {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Responsive Topbar */
  .topbar {
    height: auto;
    min-height: 52px;
    padding: max(8px, env(safe-area-inset-top, 8px)) 12px 8px 12px;
    gap: 8px 10px;
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar-left {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .page-title-box {
    min-width: 0;
    flex: 1;
  }

  .page-title-box h1 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-title-box p,
  .header-muse-brand .muse-subtitle {
    display: none;
  }

  .topbar-right {
    gap: 6px;
    flex-wrap: wrap;
  }

  @media (max-width: 680px) {
    .topbar {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      padding: max(6px, env(safe-area-inset-top, 6px)) 10px 8px 10px;
      gap: 7px;
      height: auto;
    }

    .topbar-left {
      display: flex;
      align-items: center;
      width: 100%;
      min-width: 0;
    }

    .page-title-box h1 {
      font-size: 0.86rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: calc(100vw - 75px);
    }

    .topbar-right {
      display: flex;
      align-items: center;
      gap: 6px;
      width: 100%;
      justify-content: space-between;
    }

    .mode-toggle-group {
      flex: 1;
      display: flex;
      min-width: 0;
    }

    .mode-toggle-group .btn {
      flex: 1;
      justify-content: center;
      padding: 5px 8px !important;
      font-size: 0.76rem !important;
      white-space: nowrap;
    }

    #btnOpenCodexProviderModal {
      flex-shrink: 0;
      padding: 5px 8px !important;
      font-size: 0.76rem !important;
    }

    #themeToggleBtn {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
    }
  }

  @media (max-width: 440px) {
    #btnOpenCodexProviderModal span:last-child {
      display: none;
    }
    #btnOpenCodexProviderModal {
      padding: 5px 8px !important;
    }
  }

  #btnCollapseAllSections,
  #btnExpandAllSections {
    display: none;
  }

  .search-box {
    width: 130px;
  }

  .search-box input {
    height: 32px;
    font-size: 0.78rem;
    padding-right: 28px;
  }

  .select-compact {
    height: 32px;
    font-size: 0.76rem;
  }

  /* Content Area */
  .content-area {
    padding: 10px 10px 76px 10px;
    max-width: 100vw;
    overflow-x: hidden;
    gap: 12px;
  }

  .camera-focus-card {
    padding: 10px;
    border-radius: var(--radius-md);
  }

  .camera-primary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .camera-primary-actions .btn {
    padding: 8px 6px;
    font-size: 0.74rem;
    justify-content: center;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #btnPickSpacePhotos {
    grid-column: span 2;
  }

  .camera-quick-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .quick-genre-item {
    width: 100%;
    min-width: 0;
  }

  .camera-quick-bar button {
    width: 100%;
    justify-content: center;
    padding: 7px 10px;
    font-size: 0.76rem;
  }

  .camera-dropdowns-row {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .control-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .control-dropdown-item label {
    font-size: 0.74rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .control-dropdown-item select {
    flex: 1;
    min-width: 0;
    max-width: 65%;
    font-size: 0.75rem;
  }

  .viewport-stage {
    max-height: 280px;
    aspect-ratio: 16 / 9;
  }

  .viewport-stage.vertical-mode {
    max-width: 240px;
    max-height: 420px;
  }

  .canvas-tools {
    top: 6px;
    right: 6px;
    padding: 3px 4px;
    gap: 3px;
  }

  .canvas-tool-btn {
    width: 26px;
    height: 26px;
    font-size: 11px;
    padding: 0;
  }

  .viewfinder-corner {
    width: 16px;
    height: 16px;
  }

  .corner-top-left, .corner-bottom-left { left: 6px; }
  .corner-top-right, .corner-bottom-right { right: 6px; }
  .corner-top-left, .corner-top-right { top: 6px; }
  .corner-bottom-left, .corner-bottom-right { bottom: 6px; }

  .center-crosshair {
    width: 32px;
    height: 32px;
  }

  .camera-live-hud {
    top: 6px;
    left: 6px;
    padding: 3px 8px;
    font-size: 0.65rem;
  }

  .camera-telemetry-pill {
    display: none; /* Already integrated in Bottom Radar Bar */
  }

  .stage-bottom-radar {
    bottom: 6px;
    left: 6px;
    right: 6px;
    padding: 4px 8px;
  }

  .stage-bottom-radar .fov-tag,
  .stage-bottom-radar .stream-res,
  .stage-bottom-radar .pitch-ladder-indicator {
    display: none;
  }

  .bokeh-leaf-guide {
    top: 42px;
    right: 6px;
    padding: 3px 6px;
    font-size: 0.6rem;
    max-width: 110px;
  }

  /* Space Workflow Panel */
  .space-workflow-panel {
    padding: 10px;
  }

  .space-workflow-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .space-workflow-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .space-workflow-actions .btn {
    padding: 6px 8px;
    font-size: 0.74rem;
    justify-content: center;
  }

  #btnJumpToSingleAnglePlan {
    grid-column: span 2;
  }

  .space-workflow-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Collapsible Sections */
  .collapsible-summary {
    padding: 12px 10px;
  }

  .summary-title-group {
    min-width: 0;
    flex: 1;
    gap: 8px;
  }

  .summary-title-group > div {
    min-width: 0;
    flex: 1;
  }

  .summary-heading {
    font-size: 0.86rem;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .summary-sub {
    font-size: 0.7rem;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .collapsible-body {
    padding: 10px;
    gap: 10px;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .section-toolbar .control-dropdown-item {
    width: 100%;
  }

  .section-toolbar .btn {
    width: 100%;
    justify-content: center;
  }

  .topic-input-row {
    flex-wrap: wrap;
  }

  .topic-input-row input {
    flex: 1 1 100%;
  }

  .topic-input-row button {
    width: 100%;
    justify-content: center;
  }

  .telemetry-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .metric-box, .stat-card {
    padding: 8px;
  }

  .metric-value, .stat-value {
    font-size: 1.15rem;
  }

  .rig-compare-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .media-frame {
    aspect-ratio: 16 / 9;
  }

  .rigs-grid {
    grid-template-columns: 1fr;
  }

  .library-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dialog-inner {
    padding: 12px;
  }
}

/* ==========================================================================
   EXTRA SMALL MOBILE BREAKPOINT (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .topbar {
    padding: 6px 10px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    flex: 1;
    width: auto;
  }

  .telemetry-grid {
    grid-template-columns: 1fr;
  }

  .camera-telemetry-pill {
    display: none;
  }

  .suggested-shots-list {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   16. SLEEK SCROLLBARS & KEYFRAME ANIMATIONS (from animations.css)
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

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

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

/* Topic Bar */
.topic-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.topic-input-row {
  display: flex;
  gap: 8px;
}

.topic-input-row input {
  flex: 1;
}

.agent-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   17. COMPONENT REFINEMENTS & DETAILED ELEMENTS
   (from mtips5s_30_VPS3_UX_UI_Design: 8pt Grid, Clean Hierarchy, Micro-interactions)
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.card-header > div:first-child {
  min-width: 0;
  flex: 1;
}

/* Photo Strip in Space Workflow */
.photos-strip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  align-items: flex-start;
  padding: 4px 0 8px;
  min-width: 0;
}

.photo-thumb-card {
  position: relative;
  width: 112px;
  min-width: 112px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-self: flex-start;
  height: fit-content;
  flex-shrink: 0;
}

.photo-thumb-card.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.photo-thumb-card img {
  width: 100%;
  height: 65px;
  object-fit: cover;
  display: block;
}

/* Active Photo Detail Preview inside Space Workflow Tray */
.active-photo-preview-box {
  margin-top: auto;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.active-photo-preview-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 600px) {
  .active-photo-preview-layout {
    grid-template-columns: 1fr;
  }
}

.active-photo-img-wrap {
  width: 100%;
  height: 100%;
  min-height: 95px;
  max-height: 140px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
}

.active-photo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.active-photo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  justify-content: center;
}

.active-photo-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.active-photo-info-item {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  padding-bottom: 2px;
}

.active-photo-info-item strong {
  color: #fde68a;
}

.active-photo-info-callout {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid #38bdf8;
}

.photo-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.photo-thumb-remove:hover {
  background: var(--accent-rose);
}

.photo-thumb-meta {
  padding: 4px 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Confidence Bar */
.confidence-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 6px 0;
}

.confidence-bar-fill {
  height: 100%;
  background: var(--grad-emerald);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease-out;
}

/* Suggested Shots */
.suggested-shots-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  margin-top: 6px;
}

.suggested-shot-card {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

/* Rig Comparison Grid (BTS vs POV) */
.rig-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  background: #060913;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 3;
}

.media-tag.bts {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.media-tag.pov {
  border-color: rgba(6, 182, 212, 0.4);
  color: #22d3ee;
}

.cut-lesson-banner {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 10px;
  border-radius: 4px;
}

/* Single-Angle Scenes List */
.single-angle-scenes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.single-angle-scene-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  align-items: start;
  transition: all var(--transition-fast);
}

.single-angle-scene-card:hover {
  border-color: var(--border-accent);
}

@media (max-width: 640px) {
  .single-angle-scene-card {
    grid-template-columns: 1fr;
  }
}

.single-angle-scene-thumb {
  position: relative;
  aspect-ratio: 9 / 12;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.single-angle-scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialogue-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.dialogue-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

/* Arc Step Card */
.arc-step-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.script-step-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  align-items: start;
}

@media (max-width: 640px) {
  .script-step-card {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   CODEX PROVIDER & MULTI-PROVIDER GATEWAY UI (mtips5s_codexmobile standard)
   ============================================================================ */
.codex-topbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px 6px;
}

.codex-provider-form {
  container-type: inline-size;
}

.codex-provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

@container (max-width: 680px) {
  .codex-provider-grid {
    grid-template-columns: 1fr;
  }
}

.codex-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.codex-fieldset legend {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent-indigo);
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.codex-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.codex-field label,
.codex-label-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.codex-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.codex-radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.codex-radio-pill:has(input:checked) {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.14);
  color: #a5b4fc;
}

.codex-radio-pill input[type="radio"],
.codex-checkbox-row input[type="checkbox"] {
  accent-color: var(--accent-indigo);
}

.codex-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.4;
}

.codex-accounts-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.codex-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
}

.codex-account-item.active {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
}

.codex-status-banner {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.78rem;
  color: var(--text-main);
}

/* ==========================================================================
   IMAJEV & JEV HIGH-SPEED VISION INTELLIGENCE STYLES
   ========================================================================== */
.imajev-intelligence-container {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: fadeInFast 0.25s ease-out;
}

.imajev-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.imajev-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 8px;
  margin-top: 8px;
}

.imajev-metric-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.imajev-metric-pill .metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.imajev-metric-pill .metric-val {
  font-size: 0.78rem;
  color: var(--text-main);
  font-weight: 600;
}

.imajev-next-shot-callout {
  margin-top: 8px;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 6px 10px;
}

.photo-thumb-imajev {
  margin-top: 2px;
  font-size: 0.65rem;
  color: #34d399;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   DEEP SPATIAL VISION: YOLO + MOBILESAM + OPENCV STYLES
   ========================================================================== */
.deep-vision-container {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  animation: fadeInFast 0.25s ease-out;
}

.deep-vision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.25);
}

.deep-vision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
  margin-top: 10px;
}

.deep-vision-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deep-vision-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.deep-vision-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.deep-vision-row strong {
  color: var(--text-main);
}

.deep-vision-badge-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.photo-thumb-deep {
  margin-top: 2px;
  font-size: 0.63rem;
  color: #38bdf8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================================================== */
/* MUSE AI ULTRA-SIMPLE SPATIAL DIRECTOR & CHAT ARTIFACT STUDIO               */
/* ========================================================================== */
.content-area:has(#tab-muse-chat:not([style*="display: none"])),
.content-area.muse-active {
  padding: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

.muse-workspace {
  display: flex;
  width: 100%;
  height: 100%;
  flex: 1;
  background: var(--bg-base, #080a10);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.muse-chat-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
  background: var(--bg-base, #080a10);
}

.muse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: var(--bg-surface, rgba(18, 24, 38, 0.75));
  backdrop-filter: blur(12px);
  z-index: 10;
  gap: 12px;
}

.muse-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.muse-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.muse-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.muse-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
}

.muse-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chat Feed */
.muse-chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  min-height: 0;
}

.muse-feed-inner {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty Hero State */
.muse-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  gap: 20px;
  max-width: 640px;
  margin: 40px auto 0 auto;
}

.muse-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.muse-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main, #fff);
  letter-spacing: -0.02em;
}

.muse-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.6;
}

.muse-dropzone {
  width: 100%;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: 18px;
  padding: 30px 20px;
  background: rgba(99, 102, 241, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.muse-dropzone:hover, .muse-dropzone.dragover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.muse-dropzone-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.muse-presets-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  margin-top: 10px;
}

.muse-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
}

.muse-preset-card {
  background: var(--bg-surface, rgba(18, 24, 38, 0.6));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.muse-preset-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.muse-preset-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: uppercase;
}

.muse-preset-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main, #f1f5f9);
}

/* Chat Messages */
.muse-msg-row {
  display: flex;
  gap: 12px;
  width: 100%;
  animation: fadeInMsg 0.25s ease;
}

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

.muse-msg-row.user {
  justify-content: flex-end;
}

.muse-msg-bubble {
  max-width: 85%;
  padding: 14px 18px;
  font-size: 0.93rem;
  line-height: 1.6;
  border-radius: 20px;
  word-break: break-word;
}

.muse-msg-row.user .muse-msg-bubble {
  background: #312e81;
  color: #e0e7ff;
  border-bottom-right-radius: 4px;
}

.muse-msg-row.assistant .muse-msg-bubble {
  background: var(--bg-surface, rgba(18, 24, 38, 0.85));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--text-main, #f1f5f9);
  border-bottom-left-radius: 4px;
}

/* Muse Thinking Box - Modern AI Reasoning Dropdown */
.muse-thinking-box {
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  font-size: 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.muse-thinking-box:hover {
  border-color: rgba(129, 140, 248, 0.45);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
}

.muse-thinking-details summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  user-select: none;
}

.muse-thinking-details summary::-webkit-details-marker {
  display: none;
}

.thinking-sparkle {
  font-size: 0.95rem;
  line-height: 1;
}

.thinking-title {
  font-weight: 600;
  color: #c7d2fe;
  flex: 1;
  font-size: 0.82rem;
}

.thinking-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.thinking-toggle-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.muse-thinking-details[open] .thinking-toggle-icon {
  transform: rotate(180deg);
}

.muse-thinking-body {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  line-height: 1.6;
  font-size: 0.80rem;
  background: rgba(0, 0, 0, 0.2);
  white-space: pre-wrap;
}

.muse-thinking-body p {
  margin: 4px 0;
}

.muse-reply-text {
  line-height: 1.65;
  color: var(--text-main, #f1f5f9);
}

.muse-stream-cursor {
  display: inline-block;
  margin-left: 3px;
  color: #818cf8;
  font-weight: 700;
  animation: museStreamBlink 0.75s steps(2, start) infinite;
}

@keyframes museStreamBlink {
  to {
    visibility: hidden;
  }
}

/* =================================================================== */
/* MTIPS5S_CODEXMOBILE PARADIGM: LIVE OVERLAY & COMMAND ROWS          */
/* =================================================================== */

/* Live Overlay Activity Indicator (from ConversationLiveOverlay.vue) */
.live-overlay-bubble {
  background: rgba(15, 23, 42, 0.9) !important;
  border: 1px solid rgba(129, 140, 248, 0.3) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  max-width: 90% !important;
  padding: 14px 16px !important;
}

.live-overlay-activity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-overlay-primary-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-overlay-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(129, 140, 248, 0.25);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.live-overlay-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #c7d2fe;
}

.live-overlay-detail-list {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-overlay-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.live-overlay-detail-row[data-tone="search"] {
  border-color: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.live-overlay-detail-row[data-tone="command"] {
  border-color: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.live-overlay-detail-row[data-tone="file"] {
  border-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.live-overlay-detail-row .icon-svg {
  font-size: 0.82rem;
  line-height: 1;
}

/* Tool Execution Group (from ConversationCommandMessage.vue) */
.cmd-group-container {
  margin-bottom: 12px;
  border-radius: var(--radius-sm, 8px);
  border: 1px dashed rgba(129, 140, 248, 0.3);
  background: rgba(15, 23, 42, 0.4);
  padding: 8px 10px;
}

.cmd-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cmd-group-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  letter-spacing: 0.5px;
}

.cmd-group-summary-text {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.worked-cmd-item {
  margin-bottom: 6px;
}

.worked-cmd-item:last-child {
  margin-bottom: 0;
}

.cmd-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  color: inherit;
}

.cmd-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(129, 140, 248, 0.4);
}

.cmd-chevron {
  font-size: 9px;
  color: #94a3b8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.cmd-chevron-open {
  transform: rotate(90deg);
}

.cmd-icon {
  font-size: 0.82rem;
  line-height: 1;
}

.cmd-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: #e2e8f0;
}

.cmd-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
}

.cmd-status.is-running {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

.cmd-output-wrap {
  border-radius: 0 0 6px 6px;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
  margin-top: -2px;
}

.cmd-output-wrap.cmd-output-visible {
  display: block;
}

.cmd-output-inner {
  padding: 8px 12px;
}

.cmd-output {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.70rem;
  color: #a5b4fc;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow-y: auto;
}

.muse-msg-bubble h1, .muse-msg-bubble h2, .muse-msg-bubble h3 {
  margin: 12px 0 6px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.muse-msg-bubble ul, .muse-msg-bubble ol {
  margin: 6px 0 10px 20px;
}

.muse-msg-bubble li {
  margin-bottom: 4px;
}

.muse-msg-bubble strong {
  color: #a5b4fc;
}

/* Image Card in Bubble */
.muse-media-card {
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
  max-width: 520px;
  position: relative;
}

.muse-media-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.muse-media-img:hover {
  transform: scale(1.02);
}

.muse-media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Artifact Card */
.muse-artifact-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(18, 24, 38, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.muse-artifact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.muse-artifact-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.muse-artifact-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #818cf8;
}

.muse-artifact-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.muse-artifact-sub {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  font-family: 'JetBrains Mono', monospace;
}

.muse-artifact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Quick Prompt Chips */
.muse-chips-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}

.muse-chips-container::-webkit-scrollbar {
  display: none;
}

.muse-chip {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #cbd5e1);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.muse-chip:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.muse-chip.highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
  border-color: #818cf8;
  color: #fff;
}

/* Docked Input Bar inside flex column (.muse-chat-pane) */
.muse-input-dock {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 20px 16px 20px;
  background: var(--bg-base, #080a10);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.muse-input-dock-inner {
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.muse-input-box {
  background: var(--bg-surface, rgba(18, 24, 38, 0.95));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 24px;
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease;
}

.muse-input-box:focus-within {
  border-color: #818cf8;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.muse-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main, #f1f5f9);
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  min-height: 24px;
  padding: 4px 0;
  outline: none;
}

.muse-textarea::placeholder {
  color: var(--text-muted, #64748b);
}

.muse-input-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.muse-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.muse-round-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.muse-send-btn {
  background: #6366f1;
  color: #fff;
}

.muse-send-btn:hover {
  background: #4f46e5;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.muse-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Split View / Live HTML Preview Pane */
.muse-preview-pane {
  display: none;
  flex: 1;
  height: 100%;
  border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  background: #090d16;
  flex-direction: column;
}

.muse-workspace.split-active .muse-preview-pane {
  display: flex;
}

.muse-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-surface, rgba(18, 24, 38, 0.9));
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.muse-preview-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #090d16;
}

/* Webcam Modal */
.muse-cam-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.muse-cam-modal.active {
  display: flex;
}

.muse-cam-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-surface, #121826);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.muse-cam-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.muse-cam-body {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.muse-cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muse-cam-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 640px) {
  .muse-cam-card {
    width: 95vw;
    border-radius: 16px;
  }

  .muse-cam-header {
    padding: 12px 14px;
  }

  .muse-cam-footer {
    padding: 12px 14px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    text-align: center;
  }

  .muse-cam-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Responsive adjustments for Muse AI Workspace */
@media (max-width: 960px) {
  .muse-workspace.split-active {
    flex-direction: column;
  }

  .muse-workspace.split-active .muse-chat-pane {
    height: 52%;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  }

  .muse-workspace.split-active .muse-preview-pane {
    height: 48%;
    border-left: none;
  }

  .muse-msg-bubble {
    max-width: 92%;
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .muse-artifact-card {
    padding: 12px;
  }
}

/* On Mobile Screens (< 768px), Split View turns into a Fullscreen Dedicated Preview Layer */
@media (max-width: 768px) {
  .muse-workspace.split-active {
    position: relative;
    flex-direction: column;
  }

  .muse-workspace.split-active .muse-chat-pane {
    height: 100% !important;
    width: 100% !important;
    border-bottom: none;
  }

  .muse-workspace.split-active .muse-preview-pane {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 50;
    border-left: none;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6);
  }

  .muse-preview-header {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .muse-preview-header #musePreviewTitle {
    font-size: 0.8rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
  }

  .muse-preview-header .btn-sm {
    padding: 4px 8px;
    font-size: 0.74rem;
  }
}

@media (max-width: 640px) {
  .muse-header {
    padding: 10px 14px;
  }

  .muse-subtitle {
    display: none;
  }

  .muse-chat-feed {
    padding: 12px 10px calc(90px + env(safe-area-inset-bottom, 0px)) 10px;
  }

  .muse-input-dock {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) 10px;
  }

  .muse-chips-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    padding-bottom: 4px;
    max-width: 100%;
  }

  .muse-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .muse-artifact-actions {
    flex-direction: column;
  }

  .muse-artifact-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Single-angle scene card responsive fix */
  .single-angle-scene-card {
    grid-template-columns: 1fr !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .single-angle-scene-thumb {
    width: 100%;
    max-width: 280px;
    max-height: 180px;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
  }

  .single-angle-scene-thumb img {
    object-fit: contain;
    background: #05070d;
  }

  .single-angle-scene-card * {
    min-width: 0;
    word-break: break-word;
  }

  .single-angle-scene-card .badge,
  .script-step-card .badge,
  .space-workflow-panel .badge {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 100%;
    display: inline-block;
    line-height: 1.35;
  }

  /* Script step card responsive fix */
  .script-step-card {
    grid-template-columns: 1fr !important;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .script-step-card img {
    max-height: 180px;
    width: 100%;
    object-fit: contain;
    background: #05070d;
    border-radius: var(--radius-sm);
  }

  /* Accessible dialogs on mobile */
  dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    border-radius: var(--radius-md) !important;
  }

  .dialog-inner {
    padding: 12px 10px !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
  }
}

@media (max-width: 540px) {
  .muse-hero {
    padding: 16px 10px;
    gap: 12px;
  }

  .muse-hero-title {
    font-size: 1.15rem;
  }

  .muse-hero-desc {
    font-size: 0.82rem;
  }

  .muse-dropzone {
    padding: 18px 12px;
    border-radius: 14px;
  }

  .muse-dropzone-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .muse-dropzone-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .muse-presets-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }

  .muse-preset-card {
    padding: 8px;
  }

  .muse-preset-card img {
    height: 70px;
  }
}

/* =================================================================== */
/* CONSOLIDATED STUDIO SUB-NAVIGATION BAR                              */
/* =================================================================== */
#studioSectionsWrapper {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.studio-subnav-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 8px 12px;
  margin: 0 0 12px 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.studio-subnav-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.studio-subnav-scroll::-webkit-scrollbar {
  display: none;
}

.studio-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
}

.studio-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  transform: translateY(-1px);
}

.studio-subtab-btn.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(14, 165, 233, 0.2));
  border-color: rgba(129, 140, 248, 0.6);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.25);
}

.studio-subtab-btn .subtab-icon {
  font-size: 0.95rem;
}

/* Studio Sub-panel visibility control */
.studio-hidden-panel {
  display: none !important;
}

/* ==========================================================================
   MUSE SAVED CHATS MODAL (KHO LƯU TRỮ CÁC ĐOẠN CHAT ĐÃ LƯU)
   ========================================================================== */
.muse-rail-btn {
  position: relative;
}

.muse-rail-count-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #6366f1;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.5);
  pointer-events: none;
}

dialog.muse-saved-chats-dialog {
  max-width: 820px;
  width: 94vw;
  max-height: 88vh;
  border-radius: 18px;
  border: 1px solid rgba(129, 140, 248, 0.28);
  background: rgba(13, 17, 28, 0.98);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.muse-saved-dialog-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  max-height: 86vh;
  overflow: hidden;
}

.muse-saved-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.muse-saved-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
}

.muse-saved-search-wrap {
  flex: 1 1 260px;
  min-width: 180px;
}

.muse-saved-search-wrap .input-field {
  width: 100%;
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  color: #fff;
}

.muse-saved-chats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 56vh;
  padding-right: 4px;
}

.muse-saved-chat-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 29, 45, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.18s ease;
  align-items: center;
}

.muse-saved-chat-card:hover {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(28, 37, 58, 0.9);
  transform: translateY(-1px);
}

.muse-saved-chat-card.is-current-session {
  border-color: rgba(16, 185, 129, 0.55);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.09), rgba(22, 29, 45, 0.88));
}

.muse-saved-thumb {
  width: 96px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.muse-saved-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muse-saved-thumb-placeholder {
  font-size: 1.5rem;
  opacity: 0.7;
}

.muse-saved-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.muse-saved-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.muse-saved-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.muse-saved-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
}

.muse-saved-snippet {
  font-size: 0.79rem;
  color: #cbd5e1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.muse-saved-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.muse-saved-empty {
  text-align: center;
  padding: 36px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.muse-toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.muse-toast-banner.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .muse-saved-chat-card {
    grid-template-columns: 1fr;
  }
  .muse-saved-thumb {
    width: 100%;
    height: 120px;
  }
}

/* ==========================================================================
   AUTHENTICATION & LOGIN MODAL STYLES (Studio Security)
   ========================================================================== */
dialog.login-dialog {
  max-width: 440px;
  width: 92vw;
  border-radius: 20px;
  background: linear-gradient(150deg, #131726, #0c0f1a);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.75), 0 0 45px rgba(99, 102, 241, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f1f5f9;
  padding: 0;
  overflow: hidden;
  margin: auto;
}

dialog.login-dialog::backdrop {
  background: rgba(4, 6, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-dialog-inner {
  padding: 34px 30px;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.login-icon {
  font-size: 1.15rem;
}

.login-title {
  font-size: 1.38rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.45;
}

.login-form .form-group {
  margin-bottom: 14px;
  text-align: left;
}

.login-form .form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.login-form .input-field {
  width: 100%;
  padding: 11px 14px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.login-form .input-field:focus {
  outline: none;
  border-color: #6366f1;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28);
}

.login-alert-box {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.38);
  color: #fca5a5;
  font-size: 0.84rem;
  margin-bottom: 16px;
  text-align: left;
  line-height: 1.45;
}

.btn-block {
  width: 100%;
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

dialog.user-account-dialog {
  border-radius: 18px;
  background: #111524;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  color: #f1f5f9;
  padding: 0;
  margin: auto;
}




