/* ==========================================================================
   Dubber Studio — Modern Glassmorphic Design System
   Pure Vanilla CSS with Curated HSL Dark Mode & Vibrant Neon Accents
   ========================================================================== */

:root {
  /* Core Color Palette */
  --bg-darkest: #070a12;
  --bg-dark: #0c101c;
  --bg-card: rgba(17, 24, 39, 0.68);
  --bg-card-hover: rgba(26, 36, 58, 0.75);
  --bg-input: rgba(13, 19, 33, 0.85);
  
  /* Borders & Glass Effects */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  --border-focus: #6366f1;
  --glass-blur: blur(20px);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  
  /* Brand Accents */
  --primary-indigo: #6366f1;
  --primary-purple: #8b5cf6;
  --primary-pink: #d946ef;
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  
  /* Gradients */
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --male-gradient: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  --female-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  --glow-gradient: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0) 70%);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Glowing Background Orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: 0;
  opacity: 0.45;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.glow-1 {
  top: -10%;
  left: 20%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
}

.glow-2 {
  top: 30%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.3), transparent 70%);
  animation-delay: -5s;
}

.glow-3 {
  bottom: -10%;
  left: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25), transparent 70%);
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 60px) scale(1.08); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* Reusable Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 18, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand,
.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon,
.logo-icon-wrapper {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  position: relative;
  overflow: hidden;
}

.brand-icon svg,
.logo-svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  display: block;
}

.brand-text h1,
.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.brand-badge,
.version-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #6366f1, #d946ef);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-top: 0.15rem;
}

/* Nav Links Pill Bar */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.nav-link.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.header-actions,
.header-status {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.system-status-pill,
.header-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: #34d399;
}

.status-dot,
.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  display: inline-block;
  animation: pulseEmerald 2s infinite;
}

@keyframes pulseEmerald {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.75; }
}

/* Main Content Container */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.12rem;
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Input Card */
.input-card {
  padding: 1.75rem;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 20, 36, 0.75);
}

.dub-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  transition: all var(--transition-fast);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.input-group:focus-within {
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.input-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

.input-icon svg {
  width: 20px;
  height: 20px;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-family: var(--font-body);
  outline: none;
  min-width: 0;
}

.input-group input::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.glow-btn {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-icon svg {
  width: 15px;
  height: 15px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn-ghost svg {
  width: 16px;
  height: 16px;
}

/* Quick Presets */
.quick-presets {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.presets-label {
  color: var(--text-muted);
  font-weight: 500;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.preset-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Config Drawer */
.config-drawer-wrapper {
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.config-drawer-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0;
  transition: color var(--transition-fast);
}

.config-drawer-toggle:hover {
  color: var(--text-primary);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toggle-label svg {
  width: 18px;
  height: 18px;
  color: var(--primary-indigo);
}

.config-drawer-toggle * {
  pointer-events: none;
}

.toggle-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition-smooth), color var(--transition-fast);
}

.toggle-arrow.open,
.toggle-arrow.rotated {
  transform: rotate(180deg);
  color: var(--primary-indigo);
}

.config-panel {
  display: none;
  padding-top: 1.25rem;
  animation: fadeIn 0.3s ease-out;
}

.config-panel.open,
.config-panel.expanded {
  display: block !important;
}

/* Studio Tabs Bar */
.studio-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  background: rgba(13, 19, 33, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.studio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.studio-tab-btn * {
  pointer-events: none;
}

.studio-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.studio-tab-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* Tab Contents */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block !important;
  animation: tabFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Feature Info Card */
.feature-info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  margin-top: 0.5rem;
}

.feature-info-card .info-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.feature-info-card .info-text {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.feature-info-card strong {
  color: #ffffff;
}

/* Span utilities for grid */
.span-2 {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .span-2 {
    grid-column: span 1;
  }
}

/* Live Pacing Sandbox */
.pacing-sandbox-group {
  background: rgba(15, 23, 42, 0.55);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 0.5rem;
}

.pacing-sandbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sandbox-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pacing-sandbox-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pacing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.pacing-dur-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.duration-input {
  width: 75px !important;
  padding: 0.35rem 0.5rem !important;
  text-align: center;
  font-family: var(--font-mono);
}

.styled-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
  width: 100%;
}

.styled-input:focus {
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.pacing-result-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.25s ease-out;
}

.pacing-result-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #34d399;
  margin-bottom: 0.25rem;
}

.pacing-result-text {
  font-size: 0.88rem;
  color: #f1f5f9;
  line-height: 1.45;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.config-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.label-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.styled-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
  cursor: pointer;
}

.styled-select:focus {
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.styled-select option {
  background: #111827;
  color: #fff;
  padding: 0.5rem;
}

/* Switch */
.toggle-switch-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-indigo);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Slider header & range */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.val-badge {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.styled-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  margin: 0.5rem 0;
}

.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-indigo);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  transition: transform var(--transition-fast);
}

.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-male {
  background: rgba(6, 182, 212, 0.14);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-female {
  background: rgba(244, 63, 94, 0.14);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.badge-visual {
  background: rgba(6, 182, 212, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-audio {
  background: rgba(139, 92, 246, 0.16);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.section-badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Pipeline Stepper Grid */
.pipeline-section {
  animation: fadeIn 0.4s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-indigo);
  box-shadow: 0 0 10px var(--primary-indigo);
}

.pulse {
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.job-id-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
}

.timer-pill {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-pill);
  color: #a5b4fc;
}

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: rgba(15, 22, 38, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition-smooth);
}

.step-card.active {
  border-color: var(--primary-indigo);
  background: rgba(26, 35, 60, 0.85);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.25);
}

.step-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(14, 28, 32, 0.65);
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-icon {
  font-size: 1.4rem;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: auto;
  margin-left: 0.5rem;
}

.step-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.badge-running {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  animation: pulseRunning 2s infinite;
}

@keyframes pulseRunning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.badge-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.step-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 2.3em;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.step-card.completed .progress-bar {
  background: var(--accent-emerald);
}

.step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.step-pct {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Error Banner */
.error-banner {
  margin-top: 1.5rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.error-icon {
  font-size: 1.5rem;
}

.error-content h4 {
  font-family: var(--font-heading);
  color: #f87171;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.error-content p {
  color: #fca5a5;
  font-size: 0.9rem;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Showcase Section */
.showcase-section {
  animation: fadeIn 0.5s ease;
}

.showcase-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}

.video-player-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.player-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.video-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.video-meta-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Summary Metrics Card */
.summary-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-subtitle {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.summary-metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}

.metric-val.highlight {
  color: #a5b4fc;
}

.metric-val.highlight-green {
  color: #34d399;
}

/* Segments Table */
.segments-section {
  animation: fadeIn 0.4s ease;
}

.table-card {
  padding: 1.25rem;
  overflow: hidden;
}

.table-responsive {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.table-responsive::-webkit-scrollbar {
  width: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.styled-table th {
  position: sticky;
  top: 0;
  background: rgba(18, 26, 44, 0.95);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  z-index: 2;
}

.styled-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.styled-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.timestamp-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.pitch-pill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.gallery-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-play-overlay {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.gallery-play-overlay:hover {
  transform: scale(1.1);
}

.gallery-play-overlay svg {
  width: 22px;
  height: 22px;
  margin-left: 2px;
}

.gallery-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gallery-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.gallery-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.gallery-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.gallery-card:hover .gallery-thumbnail video {
  transform: scale(1.04);
  opacity: 1;
}

.play-overlay {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.6);
  pointer-events: none;
  transition: transform var(--transition-fast);
}

.gallery-card:hover .play-overlay {
  transform: scale(1.15);
}

.play-overlay svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.gallery-size-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-icon-sm:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary-indigo);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-icon-sm.btn-delete-video {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-icon-sm.btn-delete-video:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.7);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-delete-danger {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-delete-danger:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4) !important;
  transform: translateY(-1px);
}

.gallery-actions .btn-primary,
.gallery-actions .btn-ghost {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.82rem;
}

.loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }
  
  .header-container {
    padding: 0 1rem;
  }

  .main-content {
    padding: 2rem 1rem 4rem;
  }

  .input-group {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .input-group input {
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .btn-primary {
    width: 100%;
  }

  .stepper-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Advanced Studio UI Additions: Language Bridge, Tabs, Subtitles, Proofreader
   ========================================================================== */

/* Language Bridge Card */
.language-bridge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}

.lang-selector-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lang-pill-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.lang-icon {
  font-size: 0.95rem;
}

.lang-dropdown {
  width: 100%;
  background: rgba(13, 19, 33, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.65rem 0.9rem !important;
  color: var(--text-primary) !important;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-dropdown:hover, .lang-dropdown:focus {
  border-color: var(--primary-indigo) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.swap-lang-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.swap-lang-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.swap-lang-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.swap-lang-btn:hover {
  background: var(--brand-gradient);
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.5);
}

.swap-lang-btn:hover svg {
  transform: rotate(180deg);
}

.lang-direction-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  white-space: nowrap;
}

/* Studio Tabs */
.studio-tabs-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.studio-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.studio-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.studio-tab-btn.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.tab-content.active {
  display: block;
}

.span-2 {
  grid-column: 1 / -1;
}

.feature-info-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  color: #cbd5e1;
  font-size: 0.84rem;
  line-height: 1.5;
}

.feature-info-card .info-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Subtitle Explorer Card */
.transcript-explorer-card {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.explorer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.explorer-icon {
  font-size: 1.1rem;
}

.live-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  margin-left: 0.5rem;
}

.explorer-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.synced-transcript-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.synced-transcript-container::-webkit-scrollbar {
  width: 6px;
}

.synced-transcript-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.synced-line-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.synced-line-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.synced-line-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.15));
  border-color: var(--primary-indigo);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

.synced-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.synced-speaker {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.synced-texts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.synced-orig {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.synced-dub {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Script Proofreader Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out forwards;
}

.proofread-modal-card {
  width: 100%;
  max-width: 950px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  padding: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
}

.modal-title-group {
  display: flex;
  gap: 0.85rem;
}

.modal-title-group .modal-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.modal-title-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.75rem;
}

.proofread-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.proofread-segments-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.proofread-segment-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color var(--transition-fast);
}

.proofread-segment-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.segment-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.segment-time-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #a5b4fc;
}

.speaker-voice-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.proofread-texts-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
}

.orig-text-preview {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dub-text-editor {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dub-textarea {
  width: 100%;
  background: rgba(13, 19, 33, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  resize: vertical;
  min-height: 48px;
}

.dub-textarea:focus {
  outline: none;
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.dub-editor-footer {
  display: flex;
  justify-content: flex-end;
}

.optimize-single-btn {
  background: transparent;
  border: none;
  color: #818cf8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.optimize-single-btn:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  padding: 1.25rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
}

@media (max-width: 768px) {
  .language-bridge-card {
    flex-direction: column;
  }
  .proofread-texts-grid {
    grid-template-columns: 1fr;
  }
}

