/* ===== AudioLingua — Premium Production Dark Theme v3 ===== */

:root {
  /* Primary palette */
  --purple-50: #F5F3FF;
  --purple-100: #EDE9FE;
  --purple-200: #DDD6FE;
  --purple-400: #A78BFA;
  --purple-500: #8B5CF6;
  --purple-600: #7C3AED;
  --purple-700: #6D28D9;
  --purple-800: #5B21B6;

  /* Secondary palette */
  --cyan-400: #22D3EE;
  --cyan-500: #06B6D4;
  --cyan-600: #0891B2;

  /* Accent */
  --amber-400: #FBBF24;
  --amber-500: #F59E0B;

  /* Success / Error */
  --emerald-400: #34D399;
  --emerald-500: #10B981;
  --rose-400: #FB7185;
  --rose-500: #EF4444;

  /* Surfaces */
  --bg: #07070F;
  --bg-alt: #0C0C1A;
  --surface: rgba(12, 12, 30, 0.75);
  --surface-hover: rgba(22, 22, 50, 0.85);
  --surface-active: rgba(28, 28, 60, 0.9);

  /* Text */
  --text: #EEEEF8;
  --text-muted: #8888B0;
  --text-dim: #5A5A80;
  --text-on-primary: #FFFFFF;

  /* Borders */
  --border: rgba(139, 92, 246, 0.15);
  --border-light: rgba(139, 92, 246, 0.3);
  --border-cyan: rgba(6, 182, 212, 0.25);
  --border-amber: rgba(245, 158, 11, 0.25);
  --border-error: rgba(239, 68, 68, 0.3);
  --border-success: rgba(16, 185, 129, 0.3);

  /* Glows */
  --glow-purple: rgba(139, 92, 246, 0.25);
  --glow-purple-strong: rgba(139, 92, 246, 0.4);
  --glow-cyan: rgba(6, 182, 212, 0.2);
  --glow-amber: rgba(245, 158, 11, 0.18);
  --glow-emerald: rgba(16, 185, 129, 0.2);

  /* Spacing & Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 4px 32px var(--glow-purple);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* ─── Ambient Background ──────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 55% at 0% 15%, rgba(124, 58, 237, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 40%, rgba(6, 182, 212, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 45% 35% at 50% 85%, rgba(251, 191, 36, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 20% 60%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    var(--bg);
  animation: bgShift 25s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0%   { background-position: 0% 0%; }
  25%  { background-position: 100% 0%; }
  50%  { background-position: 100% 100%; }
  75%  { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

/* ─── Grid Overlay ────────────────────────────────────────────────────────── */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 50% at center, black, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at center, black, transparent 70%);
}

/* ─── Animated Particles ──────────────────────────────────────────────────── */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle 15s ease-in-out infinite;
}

.particle:nth-child(1)  { left: 8%;  width: 2px;  height: 2px;  animation-delay: 0s;    background: var(--purple-500); }
.particle:nth-child(2)  { left: 22%; width: 3px;  height: 3px;  animation-delay: 1.8s;  background: var(--cyan-500); }
.particle:nth-child(3)  { left: 35%; width: 2px;  height: 2px;  animation-delay: 3.5s;  background: var(--amber-500); }
.particle:nth-child(4)  { left: 50%; width: 3px;  height: 3px;  animation-delay: 5s;    background: var(--purple-400); }
.particle:nth-child(5)  { left: 65%; width: 2px;  height: 2px;  animation-delay: 6.5s;  background: var(--cyan-400); }
.particle:nth-child(6)  { left: 78%; width: 4px;  height: 4px;  animation-delay: 8s;    background: var(--amber-400); }
.particle:nth-child(7)  { left: 45%; width: 2px;  height: 2px;  animation-delay: 2.5s;  background: var(--purple-500); }
.particle:nth-child(8)  { left: 15%; width: 3px;  height: 3px;  animation-delay: 4.2s;  background: var(--cyan-400); }
.particle:nth-child(9)  { left: 68%; width: 2px;  height: 2px;  animation-delay: 7s;    background: var(--amber-500); }
.particle:nth-child(10) { left: 38%; width: 3px;  height: 3px;  animation-delay: 9.5s;  background: var(--purple-400); }
.particle:nth-child(11) { left: 85%; width: 2px;  height: 2px;  animation-delay: 1s;    background: var(--cyan-500); }
.particle:nth-child(12) { left: 5%;  width: 4px;  height: 4px;  animation-delay: 3s;    background: var(--amber-400); }

@keyframes floatParticle {
  0%   { transform: translateY(105vh) scale(0);  opacity: 0; }
  15%  { opacity: 0.7; }
  50%  { transform: translateY(50vh) scale(1);   opacity: 0.4; }
  85%  { opacity: 0.7; }
  100% { transform: translateY(-10vh) scale(0);  opacity: 0; }
}

/* ─── Custom Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.35); }

/* ─── HEADER ──────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 15, 0.75);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border-bottom: 1px solid rgba(139, 92, 246, 0.10);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2), transparent);
  pointer-events: none;
}

.header-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-icon-wrapper {
  position: relative;
  flex-shrink: 0;
}

.logo-glow {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-500), var(--cyan-500), var(--amber-500));
  opacity: 0.25;
  filter: blur(10px);
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.08); }
}

.logo-icon {
  position: relative;
  z-index: 1;
  display: block;
}

.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--purple-400) 0%, var(--purple-500) 40%, var(--cyan-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: -1px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--text-muted);
}

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

.header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.18);
  border-radius: 99px;
  font-size: 0.7rem;
  color: var(--cyan-400);
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.header-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-500);
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── MAIN CONTAINER ──────────────────────────────────────────────────────── */
.main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  width: 100%;
  flex: 1;
}

/* ─── TABS ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 0;
  background: rgba(12, 12, 30, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 5px 6px;
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

.tabs::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15), transparent);
  pointer-events: none;
}

.tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple-500), var(--cyan-500));
  transition: all var(--transition-slow);
  transform: translateX(-50%);
  border-radius: 2px;
  opacity: 0;
}

.tab:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.06);
  border-color: rgba(139, 92, 246, 0.08);
  transform: translateY(-1px);
}

.tab:hover::after {
  width: 40%;
  opacity: 1;
}

.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(0);
}

.tab.active::after {
  width: 70%;
  opacity: 1;
}

.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.tab-icon svg {
  width: 17px;
  height: 17px;
}

.tab.active .tab-icon svg {
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.4));
}

.tab-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ─── Mode Panels ─────────────────────────────────────────────────────────── */
.mode-panel {
  display: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ─── Card (Glassmorphism Premium) ────────────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 32px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), rgba(6, 182, 212, 0.3), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), transparent 40%, transparent 60%, rgba(6, 182, 212, 0.04));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: 0 8px 48px rgba(139, 92, 246, 0.18);
}

.card + .card {
  margin-top: 20px;
}

/* ─── Panel Header ────────────────────────────────────────────────────────── */
.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.panel-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius);
  flex-shrink: 0;
  color: var(--purple-400);
}

.panel-icon svg {
  width: 22px;
  height: 22px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.5;
}

/* ─── Textarea ────────────────────────────────────────────────────────────── */
.textarea-wrapper {
  margin-bottom: 24px;
}

.textarea-wrapper textarea {
  width: 100%;
  min-height: 160px;
  max-height: 420px;
  padding: 16px 18px;
  background: rgba(8, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.textarea-wrapper textarea:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px var(--glow-purple), 0 0 20px rgba(139, 92, 246, 0.05);
}

.textarea-wrapper textarea::placeholder {
  color: var(--text-dim);
  font-size: 0.88rem;
}

.textarea-wrapper textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.textarea-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.char-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  transition: color var(--transition);
}

.char-count.near-limit { color: var(--amber-500); }
.char-count.at-limit { color: var(--rose-500); }

/* ─── Upload Zone ─────────────────────────────────────────────────────────── */
.upload-zone, .clone-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  padding: 36px 28px;
  transition: all var(--transition);
  position: relative;
  background: rgba(8, 8, 20, 0.25);
}

.upload-zone::before, .clone-upload-zone::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), transparent 40%, transparent 60%, rgba(6, 182, 212, 0.06));
  pointer-events: none;
}

.upload-zone:hover, .clone-upload-zone:hover {
  border-color: var(--purple-500);
  background: rgba(139, 92, 246, 0.04);
  box-shadow: 0 0 40px var(--glow-purple), inset 0 0 40px rgba(139, 92, 246, 0.02);
  transform: translateY(-2px);
}

.upload-zone.drag-over, .clone-upload-zone.drag-over {
  border-color: var(--purple-500);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 60px var(--glow-purple-strong), inset 0 0 40px rgba(139, 92, 246, 0.04);
  transform: scale(1.015);
  border-style: solid;
}

.upload-zone .upload-icon, .clone-upload-zone .upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}

.upload-zone:not(.drag-over) .upload-icon svg {
  color: var(--text-dim);
}

.upload-zone:hover .upload-icon,
.clone-upload-zone:hover .upload-icon {
  transform: scale(1.12);
}

.upload-zone.drag-over .upload-icon,
.clone-upload-zone.drag-over .upload-icon {
  transform: scale(1.15);
  color: var(--purple-400);
}

.upload-text {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
}

.upload-text strong {
  color: var(--purple-400);
  font-weight: 600;
}

.upload-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 4px;
  display: inline-block;
}

/* ─── File Info ───────────────────────────────────────────────────────────── */
.file-info {
  display: none;
  margin-top: 16px;
  padding: 10px 16px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: var(--radius);
  font-size: 0.84rem;
  color: var(--purple-400);
  font-weight: 500;
  animation: fadeIn 0.3s ease-out;
}

/* ─── Form Rows ───────────────────────────────────────────────────────────── */
.language-row, .voice-row, .emotion-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 20px;
}

.voice-row, .emotion-row {
  margin-top: 16px;
}

.select-group {
  flex: 1;
}

.select-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 11px 40px 11px 14px;
  background: rgba(8, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px var(--glow-purple);
}

.select-wrapper select:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.select-wrapper select option {
  background: var(--bg-alt);
  color: var(--text);
  padding: 10px;
}

.select-wrapper select optgroup {
  background: var(--bg-alt);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.select-wrapper select:focus + .select-arrow {
  color: var(--purple-500);
}

.swap-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  padding-bottom: 11px;
  user-select: none;
  flex-shrink: 0;
}

.swap-icon svg {
  width: 20px;
  height: 20px;
}

.voice-group, .emotion-group {
  max-width: 100%;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 32px;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  width: 100%;
  margin-top: 24px;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

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

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

/* ─── Ripple Effect ───────────────────────────────────────────────────────── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0);
  animation: rippleAnim 0.7s ease-out;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ─── Primary Button ──────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--purple-600) 0%, var(--purple-700) 50%, var(--purple-800) 100%);
  color: #fff;
  box-shadow: 0 4px 24px var(--glow-purple);
  position: relative;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(139, 92, 246, 0.4), 0 0 60px rgba(139, 92, 246, 0.1);
  background: linear-gradient(135deg, var(--purple-500) 0%, var(--purple-700) 50%, var(--purple-800) 100%);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.2));
}

/* ─── Download Button ─────────────────────────────────────────────────────── */
.btn-download {
  background: linear-gradient(135deg, var(--emerald-500) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 24px var(--glow-emerald);
}

.btn-download::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(16, 185, 129, 0.4);
}

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

/* ─── Progress Section ────────────────────────────────────────────────────── */
.progress-card {
  text-align: center;
}

.progress-title {
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--purple-400), var(--cyan-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(8, 8, 20, 0.6);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--purple-500), var(--purple-400), var(--cyan-500), var(--amber-500), var(--purple-500));
  background-size: 300% 100%;
  animation: gradientMove 2s ease-in-out infinite;
  transition: width 0.5s ease-out;
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ─── Audio Visualizer ────────────────────────────────────────────────────── */
.visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  margin: 16px 0;
}

.visualizer-bar {
  width: 4px;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to top, var(--purple-600), var(--purple-400), var(--cyan-500));
  animation: vizAnim 1.4s ease-in-out infinite;
  opacity: 0.6;
  transition: height 0.3s ease;
}

.visualizer-bar:nth-child(1)  { animation-delay: 0s;     height: 25%; }
.visualizer-bar:nth-child(2)  { animation-delay: 0.12s;  height: 50%; }
.visualizer-bar:nth-child(3)  { animation-delay: 0.24s;  height: 75%; }
.visualizer-bar:nth-child(4)  { animation-delay: 0.36s;  height: 60%; }
.visualizer-bar:nth-child(5)  { animation-delay: 0.48s;  height: 90%; }
.visualizer-bar:nth-child(6)  { animation-delay: 0.6s;   height: 40%; }
.visualizer-bar:nth-child(7)  { animation-delay: 0.72s;  height: 70%; }
.visualizer-bar:nth-child(8)  { animation-delay: 0.84s;  height: 30%; }
.visualizer-bar:nth-child(9)  { animation-delay: 0.96s;  height: 85%; }
.visualizer-bar:nth-child(10) { animation-delay: 1.08s;  height: 45%; }
.visualizer-bar:nth-child(11) { animation-delay: 1.2s;   height: 65%; }
.visualizer-bar:nth-child(12) { animation-delay: 1.32s;  height: 35%; }

@keyframes vizAnim {
  0%, 100% { transform: scaleY(0.35); opacity: 0.35; }
  50% { transform: scaleY(1); opacity: 0.9; }
}

/* ─── Result Section ──────────────────────────────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.result-header .section-title {
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--emerald-400), #34D399, var(--emerald-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
}

.result-icon svg {
  width: 24px;
  height: 24px;
}

.audio-wrapper {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.audio-wrapper video {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

audio {
  width: 100%;
  max-width: 520px;
  height: 48px;
  border-radius: var(--radius);
}

audio::-webkit-media-controls-panel {
  background: var(--bg-alt);
  border-radius: var(--radius);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
  color: var(--text);
  font-family: var(--font);
}

audio::-webkit-media-controls-play-button {
  background: var(--purple-500);
  border-radius: 50%;
  transition: background var(--transition);
}

/* ─── Skeleton Loading ────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(139, 92, 246, 0.04) 25%,
    rgba(139, 92, 246, 0.12) 50%,
    rgba(139, 92, 246, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeletonAnim 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonAnim {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 10px; width: 80%; }
.skeleton-text.short { width: 50%; }
.skeleton-text.long { width: 95%; }
.skeleton-block { height: 120px; margin-bottom: 16px; }

/* ─── Toast Notifications Premium ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(12, 12, 30, 0.92);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(139, 92, 246, 0.05);
  animation: toastSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: all;
  min-width: 320px;
}

.toast.toast-error {
  border-color: var(--border-error);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(239, 68, 68, 0.08);
}

.toast.toast-success {
  border-color: var(--border-success);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(16, 185, 129, 0.08);
}

.toast.toast-info {
  border-color: var(--border-cyan);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(6, 182, 212, 0.08);
}

.toast.toast-warning {
  border-color: var(--border-amber);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 40px rgba(245, 158, 11, 0.08);
}

.toast-icon {
  font-size: 1.2rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0 0 8px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text); }

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(60px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(60px) scale(0.92);
  }
}

/* ─── Error Messages ──────────────────────────────────────────────────────── */
.error-msg {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid var(--border-error);
  border-radius: var(--radius);
  color: var(--rose-400);
  font-size: 0.84rem;
  font-weight: 500;
  animation: shake 0.4s ease-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

/* ─── FOOTER ──────────────────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  background: rgba(7, 7, 15, 0.75);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid rgba(139, 92, 246, 0.08);
}

.footer-content {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-brand svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.footer-tech {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  transition: all var(--transition);
  text-transform: uppercase;
}

.tech-badge:hover {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--purple-400);
  box-shadow: 0 0 20px var(--glow-purple);
  transform: translateY(-1px);
}

.footer-copy {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ─── Voice Clone ─────────────────────────────────────────────────────────── */
.clone-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.clone-header-icon { font-size: 2rem; line-height: 1; }
.clone-subtitle { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }

.clone-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clone-section-title svg {
  width: 16px;
  height: 16px;
  color: var(--purple-400);
  flex-shrink: 0;
}

.clone-upload-section {
  background: rgba(8, 8, 20, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.clone-upload-section:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.clone-upload-zone {
  min-height: 150px;
  padding: 24px;
}

.clone-name-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.clone-name-group {
  flex: 1;
}

.clone-name-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clone-input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(8, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.clone-input:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px var(--glow-purple);
}

.clone-input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.clone-input:hover {
  border-color: rgba(139, 92, 246, 0.25);
}

.clone-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: var(--radius);
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-out;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(139, 92, 246, 0.15);
  border-top-color: var(--purple-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.clone-progress p {
  font-size: 0.85rem;
  color: var(--purple-400);
  font-weight: 500;
}

.clone-success {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease-out;
}

.clone-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  flex-shrink: 0;
}

.clone-success-icon svg {
  width: 26px;
  height: 26px;
}

.clone-success-title {
  font-size: 0.9rem;
  color: var(--emerald-400);
  font-weight: 600;
}

.clone-success-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.clone-voices-section {
  margin-top: 8px;
}

.clone-voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clone-voice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(8, 8, 20, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  animation: fadeIn 0.3s ease-out;
}

.clone-voice-item:hover {
  border-color: var(--purple-500);
  box-shadow: 0 0 24px var(--glow-purple);
  background: rgba(8, 8, 20, 0.4);
  transform: translateX(2px);
}

.clone-voice-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.clone-voice-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.clone-voice-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.clone-voice-meta {
  font-size: 0.73rem;
  color: var(--text-dim);
}

.clone-voice-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all var(--transition-fast);
  line-height: 1;
  flex-shrink: 0;
}

.clone-voice-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--rose-400);
}

/* ─── Emotion Curve ───────────────────────────────────────────────────────── */
.emotion-segments-container {
  margin-top: 20px;
}

.emotion-segments-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
}

.emotion-segment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(8, 8, 20, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease-out;
  transition: border-color var(--transition);
}

.emotion-segment-row:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.emotion-segment-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.emotion-segment-select {
  flex: 1;
}

.emotion-segment-select select {
  width: 100%;
  padding: 7px 32px 7px 12px;
  background: rgba(8, 8, 20, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.emotion-segment-select select:focus {
  outline: none;
  border-color: var(--purple-500);
  box-shadow: 0 0 0 3px var(--glow-purple);
}

/* ─── Podcast Studio ──────────────────────────────────────────────────────── */
.podcast-topic-row {
  margin-top: 0;
  margin-bottom: 16px;
}

.podcast-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.podcast-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: rgba(8, 8, 20, 0.6);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  transition: background var(--transition);
}

.podcast-slider:hover {
  background: rgba(8, 8, 20, 0.8);
}

.podcast-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  cursor: pointer;
  box-shadow: 0 0 14px var(--glow-purple);
  transition: transform var(--transition-fast);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.podcast-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.podcast-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-600), var(--purple-500));
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 14px var(--glow-purple);
}

.podcast-slider-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple-400);
  min-width: 24px;
  text-align: center;
}

/* ─── Voice Dialogue ──────────────────────────────────────────────────────── */
.dialogue-chat-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: rgba(8, 8, 20, 0.3);
  min-height: 300px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 16px;
}

.dialogue-chat-container::-webkit-scrollbar {
  width: 4px;
}

.dialogue-chat-container::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.15);
  border-radius: 99px;
}

.dialogue-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialogue-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 85%;
  animation: fadeIn 0.3s ease-out;
}

.dialogue-message.dialogue-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.dialogue-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 1.2rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: 50%;
  color: var(--purple-400);
}

.dialogue-avatar svg {
  width: 16px;
  height: 16px;
}

.dialogue-message.dialogue-user .dialogue-avatar {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.08));
  border-color: rgba(6, 182, 212, 0.15);
  color: var(--cyan-400);
}

.dialogue-bubble {
  padding: 10px 14px;
  background: rgba(15, 15, 40, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.5;
  word-wrap: break-word;
  transition: border-color var(--transition);
}

.dialogue-bubble:hover {
  border-color: rgba(139, 92, 246, 0.15);
}

.dialogue-message.dialogue-user .dialogue-bubble {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.22);
}

.dialogue-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.dialogue-input-row .clone-input {
  flex: 1;
  margin-bottom: 0;
}

.dialogue-send-btn {
  width: auto;
  margin-top: 0;
  padding: 11px 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Emotion STT ─────────────────────────────────────────────────────────── */
.emotion-stt-result {
  margin-top: 20px;
  padding: 20px;
  background: rgba(8, 8, 20, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  animation: fadeIn 0.4s ease-out;
}

.emotion-stt-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  padding: 12px 16px;
  background: rgba(12, 12, 30, 0.5);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.emotion-stt-word {
  display: inline;
  padding: 1px 3px;
  border-radius: 3px;
  transition: background var(--transition);
}

.emotion-stt-word.emotion-neutral { color: var(--text); }
.emotion-stt-word.emotion-positive { color: var(--emerald-400); background: rgba(52, 211, 153, 0.06); }
.emotion-stt-word.emotion-negative { color: var(--rose-400); background: rgba(251, 113, 133, 0.06); }
.emotion-stt-word.emotion-excited { color: var(--amber-400); background: rgba(251, 191, 36, 0.06); }
.emotion-stt-word.emotion-sad { color: #818CF8; background: rgba(129, 140, 248, 0.06); }

.emotion-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.emotion-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.emotion-tag.neutral { background: rgba(160, 160, 180, 0.08); color: var(--text-muted); border-color: var(--border); }
.emotion-tag.positive { background: rgba(52, 211, 153, 0.08); color: var(--emerald-400); border-color: rgba(52, 211, 153, 0.25); }
.emotion-tag.negative { background: rgba(251, 113, 133, 0.08); color: var(--rose-400); border-color: rgba(251, 113, 133, 0.25); }
.emotion-tag.excited { background: rgba(251, 191, 36, 0.08); color: var(--amber-400); border-color: rgba(251, 191, 36, 0.25); }
.emotion-tag.sad { background: rgba(129, 140, 248, 0.08); color: #818CF8; border-color: rgba(129, 140, 248, 0.25); }

/* ─── Spinner Overlay ─────────────────────────────────────────────────────── */
.spinner-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--purple-400);
  font-weight: 500;
  animation: fadeIn 0.3s ease-out;
}

/* ─── Base Animations ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive: Tablet (≤900px) ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .main { padding: 20px 16px 40px; }
  .card { padding: 24px; border-radius: var(--radius-xl); }
  .header-content { padding: 10px 16px; }
  .logo-text h1 { font-size: 1.15rem; }
  .tagline { font-size: 0.6rem; }
  .logo-icon-wrapper .logo-icon { width: 32px; height: 32px; }
}

/* ─── Touch device optimizations (shared) ─────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .feature-card:hover,
  .btn-primary:hover:not(:disabled),
  .btn-download:hover,
  .tab:hover,
  .upload-zone:hover,
  .select-wrapper select:hover,
  .tech-badge:hover,
  .clone-voice-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .feature-card:active,
  .btn:active,
  .tab:active {
    transform: scale(0.97) !important;
  }
  .cursor-glow { display: none !important; }
  .particles { opacity: 0.4; }
}

/* ─── Responsive: Mobile (≤768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .main { padding: 12px 10px 28px; }
  .card { padding: 18px; border-radius: var(--radius-lg); }
  .header-content { padding: 8px 12px; gap: 8px; }
  .logo { gap: 10px; }
  .logo-text h1 { font-size: 1rem; }
  .tagline { display: none; }
  .header-badge { padding: 3px 8px; font-size: 0.55rem; gap: 4px; }
  .header-badge .dot { width: 4px; height: 4px; }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 6px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.66rem;
    min-height: 42px;
    gap: 6px;
    border-radius: 10px;
  }
  .tab-label { display: inline; }
  .tab-icon svg { width: 16px; height: 16px; }

  .panel-header {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    margin-bottom: 18px;
  }
  .panel-icon { width: 38px; height: 38px; }
  .panel-icon svg { width: 18px; height: 18px; }
  .panel-subtitle { font-size: 0.75rem; }
  .section-title { font-size: 1rem; }

  .language-row { flex-direction: column; gap: 10px; margin-top: 16px; }
  .swap-icon { display: none; }
  .voice-row, .emotion-row { flex-direction: column; margin-top: 10px; gap: 10px; }

  .select-group label { font-size: 0.65rem; margin-bottom: 5px; }
  .select-wrapper select {
    padding: 10px 36px 10px 12px;
    font-size: 0.82rem;
    min-height: 42px;
  }
  .voice-group, .emotion-group { max-width: 100%; }

  .btn {
    padding: 13px 20px;
    font-size: 0.85rem;
    margin-top: 18px;
    min-height: 44px;
  }

  .upload-zone, .clone-upload-zone {
    min-height: 120px;
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }
  .upload-zone .upload-icon, .clone-upload-zone .upload-icon { font-size: 2rem; }
  .upload-text { font-size: 0.82rem; }
  .upload-hint { font-size: 0.7rem; }
  .file-info { font-size: 0.78rem; padding: 8px 12px; }

  .textarea-wrapper textarea {
    min-height: 120px;
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .progress-title { font-size: 0.95rem; margin-bottom: 16px; }
  .progress-text { font-size: 0.78rem; }
  .visualizer { height: 48px; gap: 3px; }
  .visualizer-bar { width: 3px; }

  .audio-wrapper video { max-height: 280px; border-radius: var(--radius-lg); }
  audio { height: 42px; max-width: 100%; }

  .result-header { gap: 8px; }
  .result-icon svg { width: 20px; height: 20px; }
  .error-msg { font-size: 0.78rem; padding: 10px 14px; }

  .footer-content { padding: 14px 16px; gap: 8px; }
  .footer-tech { gap: 4px; }
  .tech-badge { font-size: 0.55rem; padding: 3px 8px; gap: 4px; }
  .footer-copy { font-size: 0.6rem; }

  .toast-container {
    left: 10px;
    right: 10px;
    max-width: none;
    top: 10px;
  }
  .toast {
    min-width: auto;
    padding: 12px 14px;
    font-size: 0.8rem;
  }
  .toast-icon { font-size: 1rem; }
  .toast-content { font-size: 0.78rem; }

  .clone-header { gap: 10px; margin-bottom: 18px; }
  .clone-section-title { font-size: 0.82rem; margin-bottom: 12px; }
  .clone-upload-section { padding: 16px; }
  .clone-upload-zone { min-height: 100px; padding: 16px; }
  .clone-name-row { flex-direction: column; gap: 10px; }
  .clone-input { padding: 10px 12px; font-size: 0.82rem; min-height: 42px; }
  .clone-progress { padding: 12px 16px; gap: 10px; }
  .clone-progress p { font-size: 0.8rem; }
  .clone-success { padding: 12px 16px; gap: 10px; }
  .clone-success-title { font-size: 0.82rem; }
  .clone-success-sub { font-size: 0.72rem; }
  .clone-voice-item { padding: 10px 14px; gap: 10px; }
  .clone-voice-name { font-size: 0.82rem; }
  .clone-voice-meta { font-size: 0.68rem; }
  .clone-voice-delete { padding: 8px; min-height: 36px; min-width: 36px; display: flex; align-items: center; justify-content: center; }

  .dialogue-chat-container { min-height: 200px; max-height: 280px; padding: 10px; }
  .dialogue-message { max-width: 92%; }
  .dialogue-bubble { font-size: 0.8rem; padding: 8px 12px; }
  .dialogue-avatar { width: 28px; height: 28px; }
  .dialogue-avatar svg { width: 14px; height: 14px; }
  .dialogue-input-row { gap: 8px; }
  .dialogue-send-btn { padding: 10px 16px; min-height: 42px; }

  .podcast-slider-value { font-size: 0.82rem; min-width: 20px; }
  .podcast-slider::-webkit-slider-thumb { width: 18px; height: 18px; }

  .emotion-segment-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px;
  }
  .emotion-segment-label { min-width: auto; font-size: 0.7rem; }
  .emotion-segment-select select { font-size: 0.78rem; padding: 6px 28px 6px 10px; min-height: 38px; }

  .emotion-stt-result { padding: 14px; }
  .emotion-stt-text { font-size: 0.82rem; padding: 10px 12px; }
  .emotion-tag { font-size: 0.7rem; padding: 4px 10px; }

  .spinner-overlay { font-size: 0.78rem; padding: 12px; gap: 8px; }
  .spinner { width: 16px; height: 16px; border-width: 2px; }

  .clone-section-title svg { width: 14px; height: 14px; }
  .dialogue-send-btn { width: auto; }
}

/* ─── Responsive: Small Mobile (≤600px) ───────────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 10px 8px 24px; }
  .card { padding: 16px; border-radius: var(--radius-lg); }
  .header-content { padding: 6px 10px; }
  .logo-icon-wrapper .logo-icon { width: 28px; height: 28px; }
  .logo-text h1 { font-size: 0.9rem; }

  .tabs { padding: 5px; gap: 5px; border-radius: var(--radius) var(--radius) 0 0; }
  .tab { padding: 7px 10px; font-size: 0.64rem; min-height: 40px; border-radius: 9px; }
  .tab-icon svg { width: 15px; height: 15px; }

  .panel-icon { width: 34px; height: 34px; }
  .panel-icon svg { width: 16px; height: 16px; }
  .section-title { font-size: 0.92rem; }
  .panel-subtitle { font-size: 0.72rem; }

  .select-wrapper select { font-size: 0.78rem; padding: 9px 32px 9px 10px; min-height: 40px; }

  .btn { padding: 12px 18px; font-size: 0.82rem; min-height: 42px; margin-top: 16px; }
  .btn-icon svg { width: 15px; height: 15px; }

  .upload-zone, .clone-upload-zone { min-height: 100px; padding: 16px 14px; border-radius: var(--radius); }
  .upload-zone .upload-icon, .clone-upload-zone .upload-icon { font-size: 1.6rem; }
  .upload-text { font-size: 0.78rem; }
  .upload-hint { font-size: 0.65rem; }

  .textarea-wrapper textarea { min-height: 100px; font-size: 0.82rem; padding: 10px 12px; }
  .char-count { font-size: 0.65rem; }

  .file-info { font-size: 0.75rem; padding: 7px 10px; }

  .language-row { gap: 8px; margin-top: 12px; }
  .voice-row, .emotion-row { gap: 8px; margin-top: 8px; }

  .progress-title { font-size: 0.88rem; }
  .progress-text { font-size: 0.75rem; }
  .visualizer { height: 40px; gap: 2px; }
  .visualizer-bar { width: 2px; }

  .audio-wrapper video { max-height: 220px; }
  audio { height: 38px; }

  .clone-header { flex-direction: column; text-align: center; gap: 8px; }
  .clone-header-icon { font-size: 1.5rem; }
  .clone-subtitle { font-size: 0.72rem; }
  .clone-section-title { font-size: 0.78rem; }
  .clone-upload-section { padding: 12px; }
  .clone-upload-zone { min-height: 80px; padding: 14px; }
  .clone-name-row { flex-direction: column; gap: 8px; }

  .dialogue-input-row { flex-direction: column; gap: 8px; }
  .dialogue-send-btn { width: 100%; }

  .emotion-segment-row { gap: 6px; }
  .emotion-stt-result { padding: 12px; }

  .toast-container { left: 8px; right: 8px; top: 8px; }
  .toast { padding: 10px 12px; }

  footer .footer-content { padding: 12px 16px; gap: 6px; }
  .tech-badge { font-size: 0.5rem; padding: 2px 6px; }

  .clone-voice-item { padding: 8px 12px; }
  .clone-progress { padding: 10px 14px; }
  .clone-success { padding: 10px 14px; }
}

/* ─── Responsive: Very Small (≤400px) ─────────────────────────────────────── */
@media (max-width: 400px) {
  .main { padding: 6px 6px 20px; }
  .card { padding: 12px; border-radius: var(--radius); }
  .header-content { padding: 4px 8px; }
  .logo-icon-wrapper .logo-icon { width: 24px; height: 24px; }
  .logo-text h1 { font-size: 0.82rem; }

  .tabs { padding: 4px; gap: 4px; border-radius: 10px 10px 0 0; }
  .tab { padding: 6px 8px; font-size: 0.6rem; min-height: 38px; border-radius: 8px; }
  .tab-icon svg { width: 14px; height: 14px; }

  .panel-icon { width: 30px; height: 30px; }
  .panel-icon svg { width: 14px; height: 14px; }
  .section-title { font-size: 0.85rem; }
  .panel-subtitle { font-size: 0.68rem; }

  .select-wrapper select { font-size: 0.75rem; padding: 8px 28px 8px 8px; min-height: 38px; }

  .btn { padding: 10px 16px; font-size: 0.78rem; min-height: 40px; margin-top: 14px; }

  .upload-zone, .clone-upload-zone { min-height: 80px; padding: 12px 10px; }
  .upload-zone .upload-icon, .clone-upload-zone .upload-icon { font-size: 1.3rem; }
  .upload-text { font-size: 0.72rem; }
  .upload-hint { font-size: 0.6rem; }

  .textarea-wrapper textarea { min-height: 80px; font-size: 0.78rem; padding: 8px 10px; }

  .dialogue-bubble { font-size: 0.75rem; padding: 7px 10px; }
  .dialogue-avatar { width: 24px; height: 24px; }
  .dialogue-avatar svg { width: 12px; height: 12px; }
  .dialogue-chat-container { min-height: 150px; max-height: 250px; padding: 8px; }
  .dialogue-message { max-width: 95%; }

  .clone-voice-item { padding: 6px 10px; gap: 8px; }
  .clone-voice-name { font-size: 0.78rem; }
  .clone-voice-meta { font-size: 0.62rem; }
}

/* ─── Reduced motion for accessibility ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .particles { display: none !important; }
}

/* ─── Mobile UX & Performance Polish (≤768px) ───────────────────────────────
   Appended LAST so it wins the cascade for global decoration + glass. The 9-tab
   tool bar labels and hero are tuned in their own media blocks above.
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Kill paint/CPU-heavy decoration -> faster first paint, smoother scroll,
     longer battery. Transform-only marquees are kept (cheap on GPU). */
  body::before { animation: none; }
  .bg-grid { display: none; }
  .particles { display: none; }
  .floating-bars { display: none; }
  .cursor-glow { display: none; }

  /* Lighter glass blur on mobile GPUs (backdrop-filter is expensive). */
  .card,
  .header,
  .landing-nav,
  .features-dropdown-menu,
  .mode-panel {
    backdrop-filter: blur(12px) saturate(1.1);
    -webkit-backdrop-filter: blur(12px) saturate(1.1);
  }

  /* Cleaner, snappier taps: no 300ms delay, no blue flash. */
  .btn, .tab, a, button, .select-wrapper select, .upload-zone, .clone-voice-delete {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Sticky header respects notched phones. */
  .header, .landing-nav { padding-top: env(safe-area-inset-top, 0); }
}
