/* ==========================================================================
   AuraForge Design System & Core Styles
   Optimized for macOS Apple Silicon Studio Aesthetic
   Theme: Deep Charcoal & Soft Navy with Glassmorphism & Pastel Gradients
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette - Clean Claymorphic Dark */
  --bg-darkest: #0a0c12;
  --bg-base: #0f121a;
  --bg-surface: #141822;
  --bg-card: #181c28;
  --bg-card-hover: #1e2332;
  --bg-glass: rgba(22, 26, 38, 0.85);
  --bg-glass-heavy: #141824;

  /* Borders & Inset Depth */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.09);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(157, 143, 224, 0.2);

  /* Professional Literary Accents (Obsidian & Champagne) */
  --accent-lavender: #e2c293;
  --accent-lavender-glow: rgba(226, 194, 147, 0.18);
  --accent-rose: #c46b85;
  --accent-rose-glow: rgba(196, 107, 133, 0.18);
  --accent-peach: #d98d66;
  --accent-peach-glow: rgba(217, 141, 102, 0.18);
  --accent-teal: #4e9b88;
  --accent-teal-glow: rgba(78, 155, 136, 0.18);
  --accent-emerald: #4e9b88;

  /* Subtle Tactile Gradients */
  --grad-primary: #e2c293;
  --grad-sensual: linear-gradient(135deg, #c46b85 0%, #e2c293 100%);
  --grad-dark: linear-gradient(180deg, #181923 0%, #0d0e13 100%);
  --grad-subtle-glow: radial-gradient(circle at 50% 0%, rgba(226, 194, 147, 0.08), transparent 70%);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b95a5;
  --text-dim: #5a6474;

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Shadows & Blurs */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(184, 164, 248, 0.2);
  --shadow-rose-glow: 0 0 30px rgba(244, 143, 177, 0.2);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --trans-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --trans-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] {
  --bg-darkest: #f4f3f7;
  --bg-base: #eceaf3;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9f8fc;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-heavy: #ffffff;

  --border-subtle: rgba(65, 50, 95, 0.08);
  --border-medium: rgba(65, 50, 95, 0.14);
  --border-highlight: rgba(65, 50, 95, 0.22);
  --border-glow: rgba(90, 69, 184, 0.2);

  --text-primary: #140f20;
  --text-secondary: #383149;
  --text-muted: #5e5672;
  --text-dim: #7e7594;

  --shadow-sm: 0 2px 8px rgba(78, 70, 99, 0.08);
  --shadow-md: 0 6px 18px rgba(78, 70, 99, 0.11);
  --shadow-lg: 0 12px 32px rgba(78, 70, 99, 0.15);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

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

input, textarea, button, select {
  font-family: inherit;
  color: inherit;
  outline: none;
}

/* Ambient Background Glow Orbs */
.ambient-glow-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  animation: floatOrb 25s infinite ease-in-out alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-lavender);
  top: -100px;
  left: 15%;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--accent-rose);
  bottom: -150px;
  right: 10%;
  animation-duration: 32s;
  animation-delay: -7s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: var(--accent-teal);
  top: 40%;
  left: 60%;
  animation-duration: 28s;
  animation-delay: -14s;
  opacity: 0.15;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* ==========================================================================
   Desktop Shell Layout
   ========================================================================== */

#app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: radial-gradient(circle at 50% 20%, rgba(25, 29, 44, 0.6) 0%, rgba(10, 12, 17, 0.95) 100%);
}

/* macOS Titlebar */
.mac-titlebar {
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(14, 16, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 50;
}

.mac-traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 160px;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s var(--trans-smooth);
}
.traffic-light:hover { transform: scale(1.15); }
.traffic-red { background: #ff5f56; border: 1px solid #e0443e; }
.traffic-yellow { background: #ffbd2e; border: 1px solid #dea123; }
.traffic-green { background: #27c93f; border: 1px solid #1aab29; }

.app-branding {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.brand-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--accent-lavender-glow);
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-version {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.system-status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.status-badge.highlight {
  background: rgba(184, 164, 248, 0.1);
  border-color: rgba(184, 164, 248, 0.25);
  color: var(--accent-lavender);
}

.status-badge.secure {
  background: rgba(77, 208, 225, 0.08);
  border-color: rgba(77, 208, 225, 0.25);
  color: var(--accent-teal);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulseLight 2s infinite;
}

.pulse-dot.teal {
  background: var(--accent-teal);
  box-shadow: 0 0 8px var(--accent-teal);
}

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

.btn-lock-quick {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s var(--trans-smooth);
}

.btn-lock-quick:hover {
  background: rgba(244, 143, 177, 0.15);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

/* ==========================================================================
   Main App Body (Sidebar + Content Stage)
   ========================================================================== */

.app-workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - 58px);
  overflow: hidden;
  position: relative;
}

/* Legacy sidebar hide/collapse for full top navigation */
.app-sidebar {
  display: none !important;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0 10px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-tab-btn .tab-icon {
  font-size: 18px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--trans-spring);
}

.nav-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-tab-btn:hover .tab-icon {
  transform: scale(1.15);
}

.nav-tab-btn.active {
  background: rgba(184, 164, 248, 0.12);
  border-color: rgba(184, 164, 248, 0.3);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nav-tab-btn.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  box-shadow: 0 0 10px var(--accent-lavender);
}

.nav-tab-btn .tab-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.nav-tab-btn.active .tab-badge {
  background: rgba(184, 164, 248, 0.22);
  color: var(--accent-lavender);
}

/* Sidebar Hardware Telemetry Card */
.sidebar-hardware-box {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hardware-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.chip-tag {
  background: rgba(184, 164, 248, 0.15);
  color: var(--accent-lavender);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.memory-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.meter-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 32%;
  background: var(--grad-sensual);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--trans-smooth);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Content Stage & Studios
   ========================================================================== */

.app-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
}

/* Custom Scrollbars */
.app-stage::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.app-stage::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.app-stage::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

.app-stage::-webkit-scrollbar-thumb:hover,
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Studio Section Pages */
.studio-view {
  display: none;
  animation: fadeInStage 0.3s var(--trans-smooth) forwards;
}

.studio-view.active {
  display: flex !important;
  flex-direction: column !important;
}

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

/* Section Header Component */
.studio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.header-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.studio-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.studio-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 650px;
}

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

/* Glass Card Components */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.25s var(--trans-smooth), box-shadow 0.25s var(--trans-smooth);
}

.glass-panel:hover {
  border-color: var(--border-medium);
}

.glass-panel.glow-accent {
  box-shadow: var(--shadow-glow);
  border-color: var(--border-glow);
}

/* Grid Layouts */
.studio-layout-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}

.studio-layout-three-col {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* Buttons & Inputs */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: #0d0f17;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 16px var(--accent-lavender-glow);
  transition: all 0.25s var(--trans-spring);
}

.btn-primary:hover {
  transform: translateY(-1.5px) scale(1.02);
  box-shadow: 0 6px 22px rgba(184, 164, 248, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: scale(1.06);
}

/* Form Controls */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

.textarea-field {
  width: 100%;
  background: rgba(12, 14, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s var(--trans-smooth), box-shadow 0.2s var(--trans-smooth);
}

.textarea-field:focus {
  border-color: var(--accent-lavender);
  box-shadow: 0 0 0 3px rgba(184, 164, 248, 0.15);
}

.text-input {
  width: 100%;
  background: rgba(12, 14, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.2s var(--trans-smooth);
}

.text-input:focus {
  border-color: var(--accent-lavender);
  box-shadow: 0 0 0 2px rgba(184, 164, 248, 0.15);
}

select.textarea-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23b8a4f8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option {
  background: #12151e;
  color: #f8fafc;
  padding: 8px 12px;
}

/* Range Slider Control with Glow */
.range-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: background 0.2s;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-lavender);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-lavender);
  border: 2px solid #ffffff;
  transition: transform 0.15s var(--trans-smooth), background 0.15s;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--accent-rose);
  box-shadow: 0 0 14px var(--accent-rose);
}

/* Interactive Chips & Pills */
.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
  user-select: none;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: rgba(184, 164, 248, 0.16);
  border-color: var(--accent-lavender);
  color: var(--accent-lavender);
  box-shadow: 0 2px 10px rgba(184, 164, 248, 0.2);
}

.filter-chip.rose.active {
  background: rgba(244, 143, 177, 0.16);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
}

.filter-chip.peach.active {
  background: rgba(255, 170, 138, 0.16);
  border-color: var(--accent-peach);
  color: var(--accent-peach);
}

.filter-chip.teal.active {
  background: rgba(77, 208, 225, 0.16);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

/* ==========================================================================
   Story Studio Specifics
   ========================================================================== */

.script-output-box {
  background: rgba(9, 11, 16, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 480px;
  max-height: 600px;
  overflow-y: auto;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.script-header-card {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.script-title-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
}

.script-beat-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(184, 164, 248, 0.15);
  color: var(--accent-lavender);
  border: 1px solid rgba(184, 164, 248, 0.25);
  font-weight: 600;
}

.sensory-highlight {
  background: rgba(244, 143, 177, 0.14);
  color: #ffb4cc;
  padding: 1px 5px;
  border-radius: 4px;
  border-bottom: 1px dashed var(--accent-rose);
  font-weight: 500;
}

.piercing-highlight {
  background: rgba(77, 208, 225, 0.14);
  color: #80deea;
  padding: 1px 5px;
  border-radius: 4px;
  border-bottom: 1px dashed var(--accent-teal);
  font-weight: 500;
}

.dialogue-speaker {
  display: block;
  font-weight: 700;
  color: var(--accent-lavender);
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-top: 14px;
  margin-bottom: 2px;
}

.dialogue-speaker.julian { color: var(--accent-peach); }
.dialogue-speaker.maya { color: var(--accent-teal); }

.dialogue-quote {
  font-style: italic;
  color: var(--text-primary);
  padding-left: 12px;
  border-left: 2px solid rgba(184, 164, 248, 0.4);
  margin-bottom: 8px;
}

/* Chat Refinement Under Story */
.refinement-chat-dock {
  margin-top: 16px;
  background: rgba(15, 18, 26, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text-primary);
  padding: 4px 8px;
}

/* Story Version History Modal */
.version-diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.diff-pane {
  background: rgba(10, 12, 18, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
}

/* Story Library Cards */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.story-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.25s var(--trans-smooth);
}

.story-card-item:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 164, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.story-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.story-card-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* ==========================================================================
   Voice Studio Specifics
   ========================================================================== */

.voice-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.voice-profile-card {
  background: rgba(18, 22, 33, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
  position: relative;
  overflow: hidden;
}

.voice-profile-card:hover {
  border-color: var(--border-medium);
  background: rgba(24, 30, 46, 0.85);
  transform: translateY(-2px);
}

.voice-profile-card.selected {
  border-color: var(--accent-lavender);
  background: rgba(184, 164, 248, 0.1);
  box-shadow: 0 4px 18px rgba(184, 164, 248, 0.15);
}

.voice-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-avatar-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

.voice-profile-card.selected .voice-avatar-thumb {
  border-color: var(--accent-lavender);
}

.voice-meta-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.voice-meta-timbre {
  font-size: 11.5px;
  color: var(--accent-lavender);
}

.waveform-canvas-box {
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 120px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
}

.audio-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(14, 17, 26, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.play-pause-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #0d0f17;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--accent-lavender-glow);
  transition: transform 0.2s var(--trans-spring);
}

.play-pause-btn:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   Image & Face Studio Specifics
   ========================================================================== */

.character-card-list {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.character-thumb-card {
  min-width: 130px;
  width: 130px;
  background: rgba(18, 22, 33, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s var(--trans-smooth);
}

.character-thumb-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.character-thumb-card.active {
  border-color: var(--accent-rose);
  background: rgba(244, 143, 177, 0.12);
  box-shadow: 0 4px 16px rgba(244, 143, 177, 0.2);
}

.character-portrait-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.character-thumb-name {
  font-weight: 600;
  font-size: 12.5px;
  text-align: center;
}

.image-preview-stage {
  background: #090b10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.image-preview-stage img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--trans-smooth);
}

.image-preview-stage:hover img {
  transform: scale(1.01);
}

.image-floating-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(10, 12, 18, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-action-toolbar {
  position: absolute;
  bottom: 16px;
  background: rgba(14, 17, 26, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Video Module Specifics
   ========================================================================== */

.video-canvas-container {
  background: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  min-height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-frame-display {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  transition: transform 0.1s linear;
}

.timeline-scrubber {
  width: 100%;
  padding: 12px 18px;
  background: rgba(14, 17, 26, 0.9);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ==========================================================================
   Modals & App Lock Screen
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--trans-smooth);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.lock-card {
  width: 420px;
  background: rgba(18, 22, 33, 0.88);
  border: 1px solid rgba(184, 164, 248, 0.25);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  position: relative;
}

.lock-icon-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(184, 164, 248, 0.12);
  border: 1px solid rgba(184, 164, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
  box-shadow: 0 0 25px var(--accent-lavender-glow);
  animation: pulseLock 3s infinite ease-in-out;
}

@keyframes pulseLock {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px var(--accent-lavender-glow); }
  50% { transform: scale(1.05); box-shadow: 0 0 35px var(--accent-rose-glow); }
}

.pin-dots {
  display: flex;
  gap: 14px;
  margin: 24px 0;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border-medium);
  transition: all 0.2s var(--trans-spring);
}

.pin-dot.filled {
  background: var(--accent-lavender);
  box-shadow: 0 0 10px var(--accent-lavender);
  transform: scale(1.2);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 240px;
  margin-bottom: 20px;
}

.keypad-btn {
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--trans-smooth);
}

.keypad-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.08);
}

.keypad-btn:active {
  background: var(--accent-lavender);
  color: #000;
  transform: scale(0.95);
}

/* Modal Window Default */
.standard-modal {
  width: 680px;
  max-width: 90vw;
  background: rgba(16, 20, 30, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

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

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast-item {
  background: rgba(18, 22, 33, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(184, 164, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideToast 0.3s var(--trans-spring) forwards;
}

@keyframes slideToast {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Generation Progress Bar Overlay */
.progress-pulse-strip {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-pulse-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-sensual);
  box-shadow: 0 0 10px var(--accent-rose);
  transition: width 0.3s ease;
}
