/* =====================================================================
   VOXFLOW — ELEVENLABS / APPLE CREATIVE STUDIO DESIGN SYSTEM
   Archetype: Minimalist Canvas with Floating Frosted Glass Action Dock
   ===================================================================== */

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  /* Obsidian Studio Dark (Default) */
  --bg-page: #09090b;
  --bg-canvas: #09090b;
  --bg-dock: rgba(22, 22, 26, 0.82);
  --bg-dock-hover: rgba(32, 32, 38, 0.95);
  --bg-card: #141417;
  --bg-card-subtle: #1a1a20;
  --bg-hover: #22222a;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-dock: rgba(255, 255, 255, 0.12);
  --border-active: #f59e0b;

  --text-main: #f4f4f6;
  --text-muted: #8e8e98;
  --text-ghost: #52525c;
  --text-inverted: #09090b;

  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --accent-teal: #10b981;
  --accent-purple: #a855f7;
  --accent-coral: #f97316;

  --dock-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body.theme-light {
  --bg-page: #f8fafc;
  --bg-canvas: #f8fafc;
  --bg-dock: rgba(255, 255, 255, 0.88);
  --bg-dock-hover: rgba(255, 255, 255, 0.98);
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-dock: rgba(0, 0, 0, 0.12);
  --border-active: #d97706;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-ghost: #94a3b8;
  --text-inverted: #ffffff;

  --dock-shadow: 0 20px 48px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* App Wrapper */
.studio-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  padding-bottom: 120px; /* space for floating dock */
}

/* =====================================================================
   TOP NAVIGATION BAR
   ===================================================================== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  z-index: 20;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo-svg {
  width: 34px;
  height: 34px;
  display: block;
}

.pwa-install-btn {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.pwa-install-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-amber);
  transform: scale(1.06);
}

.brand-titles {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-code);
}

/* Mode Switcher Pill */
.mode-pill-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-btn svg {
  width: 14px;
  height: 14px;
}

.mode-btn:hover {
  color: var(--text-main);
}

.mode-btn.active {
  background: var(--bg-hover);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-action-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
}

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

.nav-action-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  border-color: var(--border-dock);
}

.badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--accent-amber);
  color: var(--text-inverted);
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-code);
  padding: 1px 5px;
  border-radius: 9999px;
}

.status-indicator-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 0 2px var(--bg-page);
}

.icon-sun, .icon-moon {
  width: 17px;
  height: 17px;
}

body.theme-dark .icon-moon { display: none; }
body.theme-light .icon-sun { display: none; }

/* =====================================================================
   MAIN CREATIVE CANVAS (TTS Mode)
   ===================================================================== */
.studio-canvas-container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}

.canvas-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.canvas-view.hidden {
  display: none;
}

.canvas-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.presets-title {
  font-size: 0.75rem;
  color: var(--text-ghost);
  font-weight: 500;
  white-space: nowrap;
}

.preset-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}

.preset-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-dock);
}

.canvas-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 120ms ease;
}

.text-tool-btn svg {
  width: 13px;
  height: 13px;
}

.text-tool-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

/* The ElevenLabs Pure Stage Textarea */
.textarea-stage {
  flex: 1;
  display: flex;
  min-height: 48vh;
  margin-bottom: 16px;
}

#text-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-size: 1.25rem;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding: 10px 0;
}

#text-input::placeholder {
  color: var(--text-ghost);
  opacity: 0.6;
}

.canvas-footer-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-ghost);
  font-family: var(--font-code);
}

.stats-group .sep {
  opacity: 0.4;
}

/* =====================================================================
   UNIFIED STT CANVAS (Transcribe Mode)
   ===================================================================== */
.stt-canvas-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.stt-engine-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 9999px;
  color: var(--accent-coral);
  font-size: 0.74rem;
  font-weight: 600;
  font-family: var(--font-code);
  margin-bottom: 16px;
}

.groq-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-coral);
  box-shadow: 0 0 6px var(--accent-coral);
}

.stt-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.stt-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 32px;
}

.stt-interaction-zone {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  margin-bottom: 24px;
}

.stt-record-card, .stt-upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  transition: all 180ms ease;
}

.stt-record-card:hover, .stt-upload-card:hover {
  border-color: var(--border-dock);
  background: var(--bg-card-subtle);
}

/* Mic Halo Button */
.mic-halo-container {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 14px;
  transition: all 200ms ease;
}

.big-mic-button {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ef4444;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.big-mic-button svg {
  width: 24px;
  height: 24px;
}

.big-mic-button .mic-svg-active { display: none; }

.recording .mic-halo-container {
  animation: halo-pulse 1.4s infinite;
}

.recording .big-mic-button .mic-svg-idle { display: none; }
.recording .big-mic-button .mic-svg-active { display: block; }

@keyframes halo-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.rec-timer-large {
  font-family: var(--font-code);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.rec-prompt-hint {
  font-size: 0.78rem;
  color: var(--text-ghost);
}

#stt-live-canvas {
  width: 200px;
  height: 28px;
  margin-top: 10px;
}

.stt-or-divider {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-ghost);
}

/* File Upload Card */
.stt-upload-card {
  cursor: pointer;
}

.stt-upload-card svg {
  width: 32px;
  height: 32px;
  color: var(--accent-coral);
  margin-bottom: 12px;
  opacity: 0.85;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.btn-browse-audio {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms ease;
}

.btn-browse-audio:hover {
  background: var(--text-main);
  color: var(--text-inverted);
}

.file-picked-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border-dock);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  margin-top: 10px;
}

.file-picked-chip.hidden { display: none; }

.btn-remove-picked {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Transcribe Main Action Button */
.stt-action-strip {
  width: 100%;
  max-width: 420px;
}

.btn-transcribe-main {
  width: 100%;
  height: 48px;
  background: var(--accent-coral);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transition: all 150ms ease;
}

.btn-transcribe-main:hover:not(.disabled) {
  background: #ea580c;
  transform: translateY(-1px);
}

.btn-transcribe-main.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-transcribe-main.loading .btn-spinner { display: inline-block; }

/* Transcript Result Card */
.transcript-result-box {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 20px;
  margin-top: 24px;
  text-align: left;
}

.transcript-result-box.hidden { display: none; }

.transcript-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.75rem;
  cursor: pointer;
}

.result-btn.primary {
  background: var(--accent-amber);
  color: var(--text-inverted);
  border-color: var(--accent-amber);
  font-weight: 600;
}

.transcript-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
}

/* =====================================================================
   SLEEK FLOATING STUDIO DOCK (Bottom Bar)
   ===================================================================== */
.floating-dock-container {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 50;
  pointer-events: none;
  padding: 0 16px;
}

.floating-dock, .dock-player-bar {
  pointer-events: auto;
  background: var(--bg-dock);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-dock);
  border-radius: 9999px;
  box-shadow: var(--dock-shadow);
  display: flex;
  align-items: center;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-dock {
  padding: 6px 8px;
  gap: 6px;
}

/* Pill Buttons inside Dock */
.dock-pill-btn {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  transition: all 140ms ease;
}

.dock-pill-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.voice-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-pill-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.pill-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.pill-caption {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chevron-down {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 150ms ease;
}

.model-indicator-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 6px var(--accent-teal);
}

.speed-pill svg {
  width: 14px;
  height: 14px;
  color: var(--accent-amber);
}

.speed-label {
  font-size: 0.78rem;
  font-family: var(--font-code);
  font-weight: 600;
}

.dock-divider {
  width: 1px;
  height: 26px;
  background: var(--border-subtle);
  margin: 0 2px;
}

/* Dock Icon Button (Mic) */
.dock-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 140ms ease;
}

.dock-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

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

/* Master Primary Generate Button */
.dock-generate-btn {
  height: 44px;
  padding: 0 22px 0 18px;
  border-radius: 9999px;
  background: var(--accent-amber);
  color: var(--text-inverted);
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-generate-btn:hover:not(:disabled) {
  background: var(--accent-amber-hover);
  transform: translateY(-1px);
}

.dock-generate-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.dock-generate-btn:disabled, .dock-generate-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.icon-sparkle {
  width: 16px;
  height: 16px;
}

.btn-spinner-icon {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.dock-generate-btn.loading .btn-spinner-icon { display: inline-block; }
.dock-generate-btn.loading .icon-sparkle { display: none; }

.shortcut-badge {
  font-size: 0.65rem;
  font-family: var(--font-code);
  background: rgba(0, 0, 0, 0.16);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* Dropdown Menus on Dock */
.model-dropdown-wrapper, .speed-dropdown-wrapper {
  position: relative;
}

.dock-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-dock);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--dock-shadow);
  width: 290px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
  backdrop-filter: blur(20px);
}

.dock-dropdown-menu.hidden { display: none; }

.dropdown-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 120ms ease;
}

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

.dropdown-item.active {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.item-tag {
  font-size: 0.62rem;
  font-family: var(--font-code);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.item-tag.ultra { background: rgba(16, 185, 129, 0.15); color: var(--accent-teal); }
.item-tag.expressive { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.item-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.speed-menu {
  width: 160px;
}

.speed-opt {
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-family: var(--font-code);
  text-align: left;
  cursor: pointer;
  color: var(--text-muted);
}

.speed-opt:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.speed-opt.active {
  color: var(--accent-amber);
  font-weight: 600;
  background: rgba(245, 158, 11, 0.1);
}

/* =====================================================================
   DOCK AUDIO WAVEFORM PLAYER BAR
   ===================================================================== */
.dock-player-bar {
  padding: 6px 14px;
  gap: 16px;
  max-width: 820px;
  width: 100%;
}

.dock-player-bar.hidden { display: none; }

.player-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.dock-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-amber);
  color: var(--text-inverted);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  transition: transform 120ms ease;
}

.dock-play-btn:hover {
  transform: scale(1.06);
}

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

.dock-play-btn .icon-pause { display: none; }
.dock-play-btn.playing .icon-play { display: none; }
.dock-play-btn.playing .icon-pause { display: block; }

.player-meta-info {
  display: flex;
  flex-direction: column;
}

.player-voice-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.player-model-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Waveform Scrubber */
.player-waveform-wrapper {
  position: relative;
  flex: 1;
  height: 42px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
}

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

.dock-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #ffffff;
  pointer-events: none;
  box-shadow: 0 0 6px #ffffff;
}

.player-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.player-time-badge {
  font-size: 0.72rem;
  font-family: var(--font-code);
  color: var(--text-muted);
  width: 72px;
}

.dock-icon-action {
  height: 34px;
  padding: 0 12px;
  border-radius: 9999px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 120ms ease;
}

.dock-icon-action:hover {
  border-color: var(--border-dock);
}

.dock-icon-action.download-accent {
  background: #ffffff;
  color: #09090b;
  border: none;
  font-weight: 600;
}

.dock-icon-action.download-accent:hover {
  background: #f4f4f5;
}

.dock-icon-action.close-player {
  width: 34px;
  padding: 0;
  justify-content: center;
  background: transparent;
  border-color: transparent;
  color: var(--text-ghost);
}

.dock-icon-action.close-player:hover {
  color: var(--text-main);
}

/* =====================================================================
   VOICE ACTOR DRAWER (Slide-Over Sheet)
   ===================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop.hidden { display: none; }

.voice-drawer {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border-dock);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding: 24px;
  animation: slide-drawer-left 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-drawer-left {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.drawer-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drawer-close-btn {
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-close-btn:hover {
  color: var(--text-main);
}

.drawer-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
}

.drawer-search-bar svg {
  width: 16px;
  height: 16px;
  color: var(--text-ghost);
}

.drawer-search-bar input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.84rem;
  color: var(--text-main);
}

.drawer-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 120ms ease;
}

.filter-pill.active {
  background: var(--text-main);
  color: var(--text-inverted);
  border-color: var(--text-main);
  font-weight: 600;
}

.filter-pill-fav .star-pill-icon {
  width: 12px;
  height: 12px;
  color: #f59e0b;
}

.pill-count-badge {
  font-size: 0.65rem;
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.filter-pill.active .pill-count-badge {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

/* Voice Card Grid - Full Width Studio Rows */
.drawer-voices-grid {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.voice-select-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 140ms ease;
  position: relative;
}

.voice-select-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-dock);
}

.voice-select-card.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 1px var(--accent-amber);
}

.card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.card-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.08));
  color: var(--accent-amber);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-pick {
  font-size: 0.62rem;
  color: var(--accent-amber);
}

.card-accent {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.card-tone {
  font-size: 0.65rem;
  color: var(--text-ghost);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.voice-preview-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 130ms ease;
  flex-shrink: 0;
  padding: 0;
}

.voice-preview-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
  transform: scale(1.08);
}

.voice-preview-btn svg {
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.voice-preview-btn.playing {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

.voice-preview-btn.playing svg {
  fill: #000;
}

.voice-fav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 130ms ease;
  flex-shrink: 0;
  padding: 0;
}

.voice-fav-btn:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

.voice-fav-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  pointer-events: none;
  transition: all 130ms ease;
}

.voice-fav-btn.favorited {
  color: #f59e0b;
}

.voice-fav-btn.favorited svg {
  fill: #f59e0b;
  stroke: #f59e0b;
  filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.5));
}

/* =====================================================================
   LIBRARY DRAWER
   ===================================================================== */
.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.lib-storage-hint {
  font-size: 0.72rem;
  color: var(--text-ghost);
}

.lib-clear-btn {
  background: transparent;
  border: none;
  font-size: 0.72rem;
  color: #ef4444;
  cursor: pointer;
}

.library-items-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lib-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.lib-badge {
  font-size: 0.65rem;
  font-family: var(--font-code);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 4px;
}

.lib-text {
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
}

.lib-btn-reuse {
  background: transparent;
  border: none;
  color: var(--accent-amber);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
}

.lib-btn-del {
  background: transparent;
  border: none;
  color: var(--text-ghost);
  font-size: 0.85rem;
  cursor: pointer;
}

/* =====================================================================
   SETTINGS MODAL
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden { display: none; }

.settings-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dock);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--dock-shadow);
  overflow: hidden;
}

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

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-row svg {
  width: 18px;
  height: 18px;
  color: var(--accent-amber);
}

.modal-close-x {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body-content {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-explainer {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
}

.status-pill {
  font-size: 0.65rem;
  font-family: var(--font-code);
  padding: 1px 6px;
  border-radius: 4px;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-teal);
}

.secret-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.secret-input-wrapper input {
  width: 100%;
  height: 38px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0 36px 0 12px;
  font-family: var(--font-code);
  font-size: 0.78rem;
  color: var(--text-main);
  outline: none;
}

.secret-input-wrapper input:focus {
  border-color: var(--accent-amber);
}

.btn-reveal {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-ghost);
  cursor: pointer;
}

.field-help {
  font-size: 0.7rem;
  color: var(--text-ghost);
}

.modal-footer-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
}

.btn-ghost {
  background: transparent;
  border: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-solid {
  background: var(--accent-amber);
  color: var(--text-inverted);
  border: none;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* =====================================================================
   TOAST DECK
   ===================================================================== */
.toast-deck {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-dock);
  box-shadow: var(--dock-shadow);
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.success { border-color: rgba(16, 185, 129, 0.4); color: var(--accent-teal); }
.toast-item.error { border-color: rgba(239, 68, 68, 0.4); color: #ef4444; }
.toast-item.info { color: var(--text-main); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* =====================================================================
   MOBILE VIEWPORT PERFECTION (< 768px)
   ===================================================================== */
@media (max-width: 768px) {
  .top-nav {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .brand-tag {
    display: none;
  }

  .mode-pill-toggle {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }

  .mode-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .studio-canvas-container {
    padding: 8px 16px 140px 16px;
  }

  #text-input {
    font-size: 1.12rem;
    line-height: 1.6;
  }

  .presets-row {
    max-width: 100%;
    overflow-x: auto;
  }

  .floating-dock-container {
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 0 10px;
  }

  .floating-dock {
    width: 100%;
    max-width: 440px;
    padding: 5px 6px;
    gap: 4px;
    justify-content: space-between;
  }

  .dock-pill-btn {
    padding: 0 8px;
    height: 38px;
    gap: 6px;
  }

  .pill-title {
    font-size: 0.75rem;
  }

  .pill-caption, .shortcut-badge {
    display: none;
  }

  .voice-avatar-circle {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
  }

  .dock-divider {
    display: none;
  }

  .dock-icon-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .dock-generate-btn {
    padding: 0 14px;
    height: 38px;
    font-size: 0.78rem;
    gap: 6px;
    flex-shrink: 0;
  }

  .generate-label {
    font-size: 0.78rem;
  }

  /* Mobile Dock Player Bar */
  .dock-player-bar {
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    padding: 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .player-left-group {
    order: 1;
  }

  .player-waveform-wrapper {
    order: 2;
    flex: 1;
    min-width: 140px;
    height: 38px;
  }

  .player-right-group {
    order: 3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
  }

  .player-time-badge {
    font-size: 0.72rem;
  }

  .dock-icon-action.download-accent {
    padding: 0 12px;
    height: 32px;
    font-size: 0.75rem;
  }

  .btn-download-text {
    display: inline;
  }

  .voice-drawer {
    max-width: 100%;
    height: 85vh;
    margin-top: auto;
    border-left: none;
    border-top: 1px solid var(--border-dock);
    border-radius: 24px 24px 0 0;
    animation: slide-up-mobile 250ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slide-up-mobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .drawer-voices-grid {
    grid-template-columns: 1fr;
  }

  .stt-interaction-zone {
    grid-template-columns: 1fr;
  }
}

