:root {
  --bg-dark: #09090b;
  --bg-card: rgba(18, 24, 38, 0.72);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(139, 92, 246, 0.4);
  --border-focus: #8b5cf6;
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.35);
  --accent-pink: #ec4899;
  --accent-pink-glow: rgba(236, 72, 153, 0.35);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.35);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  background-attachment: fixed;
}

/* 🌌 Premium Glass Panels & Specular Reflection */
.glass-panel {
  background: var(--bg-card) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: var(--border-glow) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px var(--accent-purple-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* ⚡ Glowing Animated Gradient Shift Buttons */
.btn-primary {
  position: relative;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple), var(--accent-cyan)) !important;
  background-size: 200% 200% !important;
  animation: gradientShift 4s ease infinite !important;
  box-shadow: 0 4px 20px var(--accent-pink-glow) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 30px rgba(236, 72, 153, 0.6), 0 0 20px var(--accent-purple-glow) !important;
}

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

/* Three.js 3D Ambient Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Glassmorphic Toast Notification System */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateX(120%);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(6, 78, 59, 0.85);
}

.toast-success .toast-icon {
  color: #34d399;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.85);
}

.toast-error .toast-icon {
  color: #f87171;
}

.toast-info {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(88, 28, 135, 0.85);
}

.toast-info .toast-icon {
  color: #a78bfa;
}


/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  background: rgba(9, 9, 11, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-free {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-green);
  color: #34d399;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-free::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}

/* Ultra-Premium Glass Feature Module Switcher Dock */
.nav-tabs {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  align-items: center !important;
  gap: 0.65rem !important;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  padding: 0.45rem 0.65rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  max-width: 100% !important;
  scrollbar-width: none !important;
}

.nav-tabs::-webkit-scrollbar {
  display: none !important;
}

.nav-btn {
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 14px !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.nav-btn .nav-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.nav-btn .nav-text-col {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.nav-btn .nav-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: #f1f5f9;
  letter-spacing: -0.2px;
}

.nav-btn .nav-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
}

.nav-btn:hover {
  color: #fff !important;
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25) !important;
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(236, 72, 153, 0.3)) !important;
  border: 1px solid rgba(236, 72, 153, 0.7) !important;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.nav-btn.active .nav-icon-badge {
  background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.6) !important;
}

.nav-btn.active .nav-title {
  color: #ffffff !important;
}

.nav-btn.active .nav-subtitle {
  color: #38bdf8 !important;
}

/* Avatar Gallery Studio Card */
.avatar-gallery-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  padding: 1.35rem;
  margin-top: 1.1rem;
  margin-bottom: 1.1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.2);
}

.avatar-filter-pill {
  border-radius: 20px !important;
  font-size: 0.78rem !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(30, 41, 59, 0.6) !important;
  color: var(--text-muted) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

.avatar-filter-pill:hover {
  border-color: var(--accent-purple) !important;
  color: #fff !important;
  background: rgba(139, 92, 246, 0.15) !important;
}

.avatar-filter-pill.active-pill {
  border-color: var(--accent-purple) !important;
  background: rgba(139, 92, 246, 0.25) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.4) !important;
}

.avatar-grid-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 0.65rem;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.3rem;
  box-sizing: border-box;
  width: 100%;
}

.avatar-grid-scroll::-webkit-scrollbar {
  width: 6px;
}
.avatar-grid-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.4);
  border-radius: 10px;
}

/* Layout */
.app-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.75rem;
}

/* Studio Glass Panels */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  transition: border-color 0.2s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

/* Text Input Section */
.textarea-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
}

textarea#tts-input {
  width: 100%;
  height: 220px;
  background: rgba(9, 9, 11, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.2rem;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

textarea#tts-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.25);
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.sample-prompts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.sample-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sample-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border-color: var(--accent-purple);
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.control-group label span.val {
  color: var(--accent-cyan);
  font-family: monospace;
}

select, input[type="range"] {
  width: 100%;
}

select.voice-select {
  background: rgba(9, 9, 11, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.7rem;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

select.voice-select:focus {
  border-color: var(--accent-purple);
}

input[type="range"] {
  accent-color: var(--accent-purple);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
}

/* Action Buttons */
.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #06b6d4);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 25px rgba(139, 92, 246, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.65), 0 0 20px rgba(236, 72, 153, 0.4);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Waveform Canvas & Audio Player */
.audio-output-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

canvas#waveform-canvas {
  width: 100%;
  height: 90px;
  background: rgba(9, 9, 11, 0.8);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.audio-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-play-pause {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-play-pause:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  color: #fff;
}


/* Sidebar History & Voice Cards */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.voice-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem;
  background: rgba(9, 9, 11, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-card:hover, .voice-card.selected {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
}

.avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #27272a;
}

.voice-meta {
  flex: 1;
}

.voice-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

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

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.history-item:last-child {
  border-bottom: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top:0; left:0; width:100vw; height:100vh;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

/* ====================================================== */
/*  ULTRA-RESPONSIVE CROSS-DEVICE BREAKPOINT SYSTEM       */
/* ====================================================== */

/* Desktop & Laptop Screens (1024px+) */
@media (min-width: 1024px) {
  .controls-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .avatar-grid-scroll {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

/* Tablet & Mobile Desktop Mode (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 0 1.25rem;
    margin: 1.5rem auto;
  }

  .controls-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .avatar-grid-scroll {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  }
}

/* Smartphone & Touch Mobile View (under 768px) */
@media (max-width: 767px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
  }

  .logo-container {
    justify-content: space-between;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.3rem;
    gap: 0.35rem;
  }

  .nav-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
  }

  .app-container {
    grid-template-columns: 1fr;
    padding: 0 0.75rem;
    margin: 1rem auto;
    gap: 1rem;
  }

  .glass-panel {
    padding: 1rem;
    border-radius: 16px;
  }

  textarea#tts-input {
    height: 150px;
    font-size: 0.95rem;
  }

  .avatar-gallery-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .avatar-grid-scroll {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    max-height: 340px;
  }

  .controls-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .btn-primary {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
  }

  /* Quick Dock Mobile Touch Optimization */
  .quick-dock-container {
    bottom: 12px;
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
    border-radius: 24px;
    max-width: 98vw;
  }

  .dock-item {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  .dock-tooltip {
    display: none !important;
  }
}

/* Extra Small Phones (under 400px) */
@media (max-width: 399px) {
  .avatar-grid-scroll {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .logo-text {
    font-size: 1.25rem;
  }
}


/* State-of-the-Art macOS Sequoia Glassmorphism Quick-Nav Dock */
.quick-dock-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(139, 92, 246, 0.25);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 95vw;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-dock-container::-webkit-scrollbar {
  display: none;
}

.quick-dock-container:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.45);
}

.dock-item {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex-shrink: 0;
}

.dock-item:hover {
  transform: translateY(-8px) scale(1.18);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.dock-item.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(6, 182, 212, 0.4));
  color: #fff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}

.dock-active-dot {
  position: absolute;
  bottom: -4px;
  width: 5px;
  height: 5px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  display: none;
}

.dock-item.active .dock-active-dot {
  display: block;
}

.dock-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 0.2rem;
  flex-shrink: 0;
}

.dock-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  border-color: transparent;
}

.dock-tooltip {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.dock-item:hover .dock-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}




/* ====================================================== */
/*  ULTRA-PREMIUM 3D LOGO CONTAINER STYLING              */
/* ====================================================== */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4), 0 0 30px rgba(6, 182, 212, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.5);
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-icon:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.6), 0 0 45px rgba(6, 182, 212, 0.5);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}


/* ====================================================== */
/*  MOBILE NATIVE BOTTOM NAVIGATION BAR & INSTALL BANNER  */
/* ====================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 9998;
  justify-content: space-around;
  align-items: center;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 70px;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.mobile-nav-item i {
  font-size: 1.15rem;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: var(--accent-purple);
}

/* ====================================================== */
/*  ULTRA-RESPONSIVE MOBILE & TABLET STYLING SYSTEM       */
/* ====================================================== */

/* Tablet & Medium Screens (max-width: 1024px) */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 1.2rem;
    gap: 1.25rem;
  }

  header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(236, 72, 153, 0.5) transparent;
  }

  .nav-tabs::-webkit-scrollbar {
    height: 4px;
    display: block;
  }

  .nav-tabs::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    border-radius: 10px;
  }

  .nav-btn {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  body {
    font-size: 14px;
    padding-bottom: 75px; /* Space for fixed bottom nav bar */
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
  }

  .glass-panel {
    padding: 1rem;
    border-radius: 14px;
  }

  .panel-title {
    font-size: 1rem;
  }

  /* Responsive Textarea */
  textarea#tts-input {
    height: 160px;
    font-size: 0.95rem;
    padding: 0.85rem;
    border-radius: 10px;
  }

  /* Quick samples & tag buttons touch friendly */
  .sample-prompts {
    gap: 0.4rem;
    margin-bottom: 0.85rem;
  }

  .sample-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 16px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Avatar Gallery Card on Mobile */
  .avatar-gallery-card {
    padding: 0.85rem;
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
    border-radius: 16px;
  }

  #avatar-search-input {
    font-size: 0.8rem !important;
    padding: 0.5rem 2rem 0.5rem 2.1rem !important;
  }

  .avatar-grid-scroll {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    max-height: 360px;
  }

  .voice-card {
    padding: 0.55rem !important;
    gap: 8px !important;
    border-radius: 12px !important;
  }

  .avatar-img, .voice-card img {
    width: 38px !important;
    height: 38px !important;
  }

  .voice-name {
    font-size: 0.78rem !important;
  }

  .voice-desc {
    font-size: 0.68rem !important;
  }

  /* Tuning Controls Grid on Mobile */
  .controls-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .control-group label {
    font-size: 0.78rem;
  }

  select.voice-select {
    padding: 0.55rem;
    font-size: 0.82rem;
    border-radius: 8px;
    min-height: 42px;
  }

  /* Full Width Primary Generate Button on Mobile */
  .btn-primary {
    padding: 0.85rem 1rem;
    font-size: 0.98rem;
    border-radius: 10px;
    min-height: 48px;
  }

  /* Audio Output Box & Controls */
  .audio-output-section {
    padding: 0.85rem;
  }

  .audio-controls-row {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .btn-play-pause {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .btn-secondary {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    min-height: 38px;
  }

  /* Toast Notification positioning on mobile */
  #toast-container {
    bottom: 75px;
    left: 12px;
    right: 12px;
    max-width: calc(100vw - 24px);
  }

  /* Dialogue Studio Mobile Adaptations */
  .dialogue-line-card {
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .avatar-grid-scroll {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .mobile-bottom-nav {
    height: 58px;
  }

  .mobile-nav-item {
    font-size: 0.68rem;
  }

/* 💬 FLOATING FEEDBACK SYSTEM & MODAL */
.voxai-feedback-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.65rem 1.15rem;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5), 0 0 15px rgba(139, 92, 246, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.voxai-feedback-float-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(236, 72, 153, 0.7), 0 0 25px rgba(139, 92, 246, 0.6);
}

@media (max-width: 768px) {
  .voxai-feedback-float-btn {
    bottom: 74px; /* above mobile bottom bar */
    right: 16px;
    padding: 0.55rem 0.95rem;
    font-size: 0.78rem;
  }
}

.feedback-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.feedback-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.feedback-modal-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(236, 72, 153, 0.25);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.feedback-modal-overlay.active .feedback-modal-card {
  transform: scale(1);
}


/* ========================================================================== */
/*  🌟 UNIVERSAL NO-HIDDEN-BUTTONS MOBILE ENGINE (< 768px & < 480px)         */
/* ========================================================================== */

@media (max-width: 768px) {
  /* 1. Viewport & Prevent any horizontal clipping */
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
    padding-bottom: 75px !important;
  }

  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  /* 2. Top Banner: Fully visible without any clipping */
  .top-announcement-banner, #top-banner-div, div[style*="linear-gradient(90deg, #ec4899"] {
    padding: 0.45rem 0.6rem !important;
    font-size: 0.74rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .top-announcement-banner span, #top-banner-div span, div[style*="linear-gradient(90deg, #ec4899"] span {
    font-size: 0.74rem !important;
    line-height: 1.3 !important;
    width: 100% !important;
  }

  .top-announcement-banner-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    width: 100% !important;
  }

  .top-announcement-banner button, #top-banner-div button, div[style*="linear-gradient(90deg, #ec4899"] button {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.65rem !important;
    white-space: nowrap !important;
    border-radius: 16px !important;
  }

  /* 3. Header & Navigation: Full screen fit */
  header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.45rem !important;
    background: rgba(9, 9, 11, 0.98) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
  }

  .logo-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .logo-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 10px !important;
  }

  .logo-text {
    font-size: 1.15rem !important;
    white-space: nowrap !important;
  }

  .nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.3rem !important;
    padding: 0.3rem 0.4rem !important;
    border-radius: 12px !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    background: rgba(15, 23, 42, 0.95) !important;
  }

  .nav-tabs::-webkit-scrollbar { display: none !important; }

  .nav-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.76rem !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }

  /* 4. Hide desktop floating dock to prevent bottom nav collision */
  .quick-dock-container {
    display: none !important;
  }

  /* 5. Mobile Native Bottom Navigation */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 56px !important;
    background: rgba(9, 9, 11, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    z-index: 9998 !important;
    justify-content: space-around !important;
    align-items: center !important;
  }

  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
  }

  .mobile-nav-item i {
    font-size: 1.15rem !important;
  }

  .mobile-nav-item.active, .mobile-nav-item:hover {
    color: #ec4899 !important;
  }

  /* 6. Layout Grid: Single Column Flow */
  .app-container {
    grid-template-columns: 1fr !important;
    padding: 0 0.5rem !important;
    margin: 0.5rem auto !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .glass-panel {
    padding: 0.75rem !important;
    border-radius: 14px !important;
    width: 100% !important;
  }

  .panel-title {
    font-size: 0.95rem !important;
  }

  /* 7. Textarea & Samples */
  textarea#tts-input {
    height: 125px !important;
    font-size: 0.92rem !important;
    padding: 0.7rem !important;
    line-height: 1.5 !important;
    width: 100% !important;
  }

  .sample-prompts {
    gap: 0.35rem !important;
    margin-bottom: 0.55rem !important;
    flex-wrap: wrap !important;
  }

  .sample-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.72rem !important;
    border-radius: 14px !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* 8. Avatar Gallery Mobile Overhaul (Crystal Clear & Scrollable) */
  .avatar-gallery-card {
    padding: 0.75rem !important;
    margin: 0.6rem 0 !important;
    border-radius: 14px !important;
    width: 100% !important;
  }

  #active-selected-avatar-banner {
    padding: 0.65rem 0.85rem !important;
    border-radius: 12px !important;
  }

  #avatar-search-input {
    font-size: 0.78rem !important;
    padding: 0.45rem 1.8rem 0.45rem 2rem !important;
    width: 100% !important;
  }

  .avatar-grid-scroll {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
    max-height: 240px !important;
    overflow-y: auto !important;
    width: 100% !important;
  }

  .voice-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0.6rem 0.8rem !important;
    border-radius: 12px !important;
    background: rgba(30, 41, 59, 0.75) !important;
    width: 100% !important;
  }

  .voice-card img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .voice-card .voice-name {
    font-size: 0.86rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .voice-card .voice-desc {
    font-size: 0.72rem !important;
    color: #38bdf8 !important;
    font-weight: 600 !important;
    white-space: normal !important;
  }

  /* 9. Tuning Controls: 1-Column Mobile Grid */
  .controls-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-bottom: 0.85rem !important;
    width: 100% !important;
  }

  .control-group label {
    font-size: 0.76rem !important;
  }

  select.voice-select {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    min-height: 40px !important;
    width: 100% !important;
  }

  /* 10. Primary Generate & Render Buttons: Full Width Thumb Friendly */
  .action-buttons-wrapper {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
  }

  .btn-primary {
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    min-height: 46px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  /* 11. Audio Output Section: All Action Buttons (Download MP3, SRT Subtitles, Render Video) 100% Visible & Big */
  .audio-output-section {
    padding: 0.75rem !important;
    width: 100% !important;
  }

  #waveform-canvas {
    width: 100% !important;
    height: 75px !important;
    border-radius: 8px !important;
  }

  .audio-controls-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    align-items: stretch !important;
    width: 100% !important;
  }

  .btn-play-pause {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    font-size: 1.3rem !important;
    align-self: center !important;
    margin-bottom: 0.35rem !important;
  }

  .audio-controls-row .btn-secondary, 
  .audio-controls-row a.btn-secondary, 
  .audio-controls-row button.btn-secondary {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 10px !important;
  }

  /* 12. Movie Dialogue Studio Mobile Fit */
  .dialogue-line-card {
    padding: 0.65rem !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }

  .dialogue-controls-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* 13. AI Video Studio Mobile Grid */
  .video-studio-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 0 0.5rem !important;
    width: 100% !important;
  }

  .studio-card-panel {
    padding: 0.85rem !important;
    width: 100% !important;
  }

  /* 14. AI SFX / Voice Changer / Dubbing / Recorder Studio Grids */
  .sfx-grid, .changer-grid, .dubbing-grid, .recorder-grid, .vocal-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  /* 15. Feedback Modal on Mobile */
  .feedback-modal-card {
    max-height: 92vh !important;
    overflow-y: auto !important;
    width: 94% !important;
    padding: 1rem !important;
    border-radius: 16px !important;
  }
}


.tag-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.55rem 0.5rem !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  text-align: center !important;
  width: 100% !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
}

.tag-btn:hover {
  transform: translateY(-2px) !important;
}

#quick-presets-grid, #expressive-tags-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.45rem !important;
  width: 100% !important;
}



/* ========================================================================== */
/*  🔒 HARD VIEWPORT WIDTH LOCK & ZERO-OVERFLOW ENGINE                        */
/* ========================================================================== */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 75px !important;
  }

  header {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0.5rem 0.65rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
    overflow: hidden !important;
  }

  .logo-container {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-sizing: border-box !important;
  }

  .logo-text {
    font-size: 1.15rem !important;
    white-space: nowrap !important;
  }

  .nav-tabs {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0.3rem !important;
    box-sizing: border-box !important;
  }

  .nav-tabs::-webkit-scrollbar { display: none !important; }

  .nav-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .app-container {
    width: 100% !important;
    max-width: 100vw !important;
    grid-template-columns: 1fr !important;
    padding: 0 0.5rem !important;
    margin: 0.5rem 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  main, section, .glass-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem !important;
    overflow: hidden !important;
  }

  textarea#tts-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 120px !important;
  }

  /* 2x2 Grids for Presets and Tags */
  #quick-presets-grid, #expressive-tags-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tag-btn {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.5rem 0.25rem !important;
    font-size: 0.74rem !important;
    font-weight: 800 !important;
    text-align: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .avatar-gallery-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.65rem !important;
  }

  .avatar-grid-scroll {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0.4rem !important;
    max-height: 220px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .voice-card {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.55rem 0.75rem !important;
  }

  .quick-dock-container {
    display: none !important;
  }
}



/* ⚡ GPU HARDWARE ACCELERATION & ZERO-STUTTER PERFORMANCE ENGINE */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  text-rendering: optimizeLegibility;
  contain: paint;
}

.avatar-grid-scroll, .nav-tabs, .app-container, .glass-panel {
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  will-change: transform, scroll-position;
}

.voice-card, .sample-btn, .tag-btn, .btn-primary, .nav-btn {
  transform: translateZ(0);
  backface-visibility: hidden;
}
