:root {
  --bg-main: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(26, 34, 52, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #2563eb;
  --border-glow: rgba(37, 99, 235, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-secondary: #f97316;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.25);
  --shadow-glow-recording: 0 0 30px rgba(239, 68, 68, 0.4);
}

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

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(249, 115, 22, 0.06) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tipografía y Encabezados */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Header Navbar */
.app-header {
  height: 68px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #f97316);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.35);
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Navegación de Escritorio y Tabs */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-item-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item-link.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.nav-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

/* Menú Móvil Desplegable */
.mobile-menu-container {
  display: none;
  position: relative;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover, .mobile-menu-btn:active {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-primary);
}

.mobile-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  max-width: 90vw;
  background: rgba(11, 15, 25, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(37, 99, 235, 0.2);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 9999;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mobile-dropdown-menu.open {
  display: flex;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 2px;
}

.dropdown-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dropdown-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  background: transparent;
  transition: all 0.15s ease;
}

.dropdown-link .link-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.dropdown-link .link-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.dropdown-link .link-text strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.dropdown-link .link-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropdown-link:hover, .dropdown-link:active {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.dropdown-link.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(249, 115, 22, 0.15));
  border: 1px solid rgba(37, 99, 235, 0.4);
}

.dropdown-link.active .link-text strong {
  color: #fff;
}

.dropdown-footer {
  margin-top: 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.dropdown-profile-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-profile-info .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 6px var(--accent-success);
}

/* Header Right Area */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cockpit-selector-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
  transition: border-color 0.2s;
}

.cockpit-selector-box:hover {
  border-color: var(--accent-primary);
}

.cockpit-profile-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 280px;
}

.cockpit-profile-select option {
  background: #111827;
  color: #f8fafc;
  padding: 6px;
}

.mobile-client-select-wrap {
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mobile-client-select-wrap .mobile-select {
  background: #1a2234;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 8px;
  color: #fff;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
}

.active-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.active-profile-pill strong {
  color: #ffffff;
}

.active-profile-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

.api-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.api-status-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

/* ==========================================================
   BARRA RÁPIDA MÓVIL: Selector de Entrenamiento en Pantalla Principal
   ========================================================== */
.mobile-quick-bar {
  display: none;
}

/* Main Container */
.main-content {
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

/* Cards y Componentes Base */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================
   CABINA DE CONTROL (COCKPIT EJECUTIVO) - SINGLE SCREEN 100VH
   ========================================================== */
#interview-tab {
  height: calc(100vh - 68px - 24px);
  max-height: calc(100vh - 68px - 24px);
  overflow: hidden;
}

#interview-tab.active {
  display: flex;
  flex-direction: column;
}

.cockpit-container {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 16px;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.cockpit-col-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.cockpit-col-left::-webkit-scrollbar {
  width: 4px;
}
.cockpit-col-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.cockpit-col-right {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Tarjetas individuales del Cockpit */
.cockpit-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cockpit-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* 1. Tarjeta de Conexión de Audio */
.audio-source-cockpit {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.source-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Medidor VU en vivo */
.call-audio-meter-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Fila de controles de Micrófono & Ganancia en modo compacto */
.mic-controls-row.compact {
  padding: 6px 10px;
  gap: 8px;
}

/* 2. Tarjeta del Centro de Escucha */
.listen-control-cockpit {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(26, 34, 52, 0.55) 0%, rgba(17, 24, 39, 0.85) 100%);
  flex-shrink: 0;
}

.listen-cockpit-status {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.visualizer-container.compact {
  height: 32px;
  width: 100%;
}

.listen-control-cockpit .main-record-btn {
  width: 100%;
  height: 52px;
  font-size: 1.05rem;
  border-radius: var(--radius-full);
}

/* 3. Tarjeta de Transcripción en Vivo */
.live-transcript-cockpit {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 180px;
}

.live-transcript-cockpit .live-caption-text {
  flex: 1;
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #f8fafc;
}

.live-transcript-cockpit .live-caption-text::-webkit-scrollbar {
  width: 4px;
}
.live-transcript-cockpit .live-caption-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Píldoras de Respuesta Rápida a Clientes */
.quick-client-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.quick-pills-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.quick-pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.quick-pill-btn:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: #2563eb;
  color: #ffffff;
  transform: translateY(-1px);
}

.quick-pill-btn:active {
  transform: translateY(0);
}

.question-input-wrapper.compact {
  display: flex;
  gap: 8px;
  align-items: center;
}

.question-text-area.compact {
  min-height: 42px;
  font-size: 0.88rem;
  padding: 8px 12px;
}

.question-input-wrapper.compact .btn-icon-action {
  width: 42px;
  height: 42px;
}

/* ==========================================================
   CABINA RESPONSIVE ULTRA-PROFESIONAL (iOS / ANDROID / MOBILE)
   EXPERIENCIA SINGLE SCREEN 100dvh EN UNA SOLA PANTALLA
   ========================================================== */
@media (max-width: 900px) {
  /* 1. Bloqueo de scroll global en pantalla de entrevista para experiencia nativa (Single Screen) */
  body:not(.page-training):not(.page-settings),
  body:has(#interview-tab.active) {
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }

  /* Scroll normal habilitado para páginas independientes (Entrenamiento y Configuración) */
  body.page-training, body.page-settings {
    height: auto !important;
    min-height: 100dvh;
    overflow-y: auto !important;
    position: static !important;
  }

  /* 2. Header Ultra-Compacto para celular */
  .app-header {
    height: 52px;
    min-height: 52px;
    padding: 0 12px;
    padding-top: max(4px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  .brand-logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }

  .brand-logo-icon svg {
    width: 16px;
    height: 16px;
  }

  .brand-tagline {
    display: none;
  }

  .brand-name {
    font-size: 0.88rem;
    white-space: nowrap;
  }

  /* Ocultar navegación tradicional de escritorio en celular */
  .desktop-nav {
    display: none !important;
  }

  /* Mostrar botón del menú desplegable */
  .mobile-menu-container {
    display: block !important;
    position: relative;
  }

  .nav-tabs {
    padding: 2px;
    gap: 2px;
  }

  .tab-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
    gap: 4px;
    border-radius: var(--radius-full);
  }

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

  .header-right {
    display: none !important;
  }

  /* 2.1 Barra Rápida de Entrenamiento — siempre visible en la pantalla principal */
  .mobile-quick-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    background: linear-gradient(180deg, rgba(20, 27, 43, 0.92) 0%, rgba(13, 18, 30, 0.92) 100%);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 52px;
    z-index: 90;
    flex-shrink: 0;
  }

  .mobile-quick-select-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: var(--radius-full);
    padding: 7px 12px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
  }

  .mobile-quick-icon {
    flex-shrink: 0;
    color: var(--accent-primary);
  }

  .mobile-quick-chevron {
    flex-shrink: 0;
    color: var(--text-muted);
  }

  .mobile-quick-select {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
  }

  .mobile-quick-status {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
  }

  .mobile-quick-status .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
  }

  .mobile-quick-status.ready {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
  }

  .mobile-quick-status.ready .dot {
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
  }

  /* 3. Main container móvil */
  .main-content {
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    height: calc(100dvh - 52px - 52px);
    max-height: calc(100dvh - 52px - 52px);
    overflow: hidden;
    min-height: 0;
  }

  .page-content-scroll {
    height: auto !important;
    min-height: calc(100dvh - 52px);
    max-height: none !important;
    overflow-y: visible !important;
    padding: 12px 10px 48px !important;
  }

  /* 4. Tab de Entrevista: EXACTAMENTE 100% VISIBLE EN UNA SOLA PANTALLA */
  #interview-tab {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .cockpit-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    gap: 6px;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  /* 5. Zona Superior: Deck de Control y Audio (Compacto, ~42% de alto) */
  .cockpit-col-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    height: auto;
    max-height: 42%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 0;
  }

  .cockpit-col-left::-webkit-scrollbar {
    display: none;
  }

  /* Barra de Fuente de Audio compacta pero legible */
  .audio-source-cockpit {
    padding: 6px 10px;
    gap: 6px;
    border-radius: 12px;
  }

  .source-compact-header {
    gap: 6px;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .audio-source-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
  }

  .source-tab-btn {
    padding: 6px 7px;
    font-size: 0.68rem;
    border-radius: 8px;
    min-height: 30px;
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
  }

  .source-tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #callConnectionBox {
    flex-shrink: 0;
    width: 100%;
    display: flex;
  }

  #callConnectionBox .btn-primary-sm,
  #callConnectionBox .btn-danger-sm {
    width: 100%;
    justify-content: center;
  }

  .btn-primary-sm, .btn-danger-sm {
    padding: 5px 10px;
    font-size: 0.72rem;
    height: 30px;
    white-space: nowrap;
  }

  /* Centro de Escucha Compacto */
  .listen-control-cockpit {
    padding: 8px 10px;
    gap: 7px;
    border-radius: 12px;
  }

  .listen-cockpit-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .listen-control-cockpit .status-pill {
    padding: 3px 9px;
    font-size: 0.74rem;
  }

  .timer-display {
    font-size: 0.76rem;
    padding: 3px 8px;
  }

  .visualizer-container.compact {
    height: 16px;
  }

  /* Botón gigante de Escuchar adaptado a móvil */
  .listen-control-cockpit .main-record-btn {
    height: 48px;
    min-height: 48px;
    font-size: 0.96rem;
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
  }

  .listen-control-cockpit .main-record-btn .btn-shortcut-hint {
    display: none;
  }

  .control-actions-row {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .control-actions-row .btn-subtle {
    padding: 5px 10px;
    font-size: 0.72rem;
    height: 28px;
    flex: 1;
    justify-content: center;
  }

  /* Subtítulos en Vivo + Píldoras Rápidas */
  .live-transcript-cockpit {
    padding: 7px 10px;
    gap: 5px;
    min-height: 0;
    max-height: 92px;
    border-radius: 12px;
  }

  .live-caption-header {
    padding-bottom: 3px;
    font-size: 0.68rem;
  }

  .live-transcript-cockpit .live-caption-text {
    min-height: 28px;
    max-height: 40px;
    padding: 4px 8px;
    font-size: 0.8rem;
    line-height: 1.35;
    overflow-y: auto;
  }

  /* Píldoras con scroll táctil suave horizontal */
  .quick-client-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 3px 0;
    scrollbar-width: none;
  }

  .quick-client-pills::-webkit-scrollbar {
    display: none;
  }

  .quick-pills-label {
    display: none;
  }

  .quick-pill-btn {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 0.7rem;
    min-height: 28px;
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.3);
  }

  .question-input-wrapper.compact {
    display: none; /* Ocultar textarea manual en móvil para dar 100% espacio al teleprompter */
  }

  /* 6. Zona Inferior: Teleprompter a Pantalla Completa en Móvil (Toma TODO el espacio restante) */
  .cockpit-col-right {
    flex: 1;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .teleprompter-card.full-screen-card {
    height: 100%;
    min-height: 0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: #080c14;
  }

  .teleprompter-toolbar {
    padding: 6px 10px;
    min-height: 36px;
    background: rgba(15, 23, 42, 0.9);
  }

  .teleprompter-tag {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .teleprompter-stats {
    font-size: 0.7rem;
    gap: 5px;
  }

  .font-size-group {
    padding: 2px 4px;
  }

  .font-btn {
    width: 28px;
    height: 26px;
    font-size: 0.74rem;
  }

  .font-size-display {
    font-size: 0.7rem;
    min-width: 26px;
  }

  .teleprompter-card.full-screen-card .teleprompter-viewport {
    flex: 1;
    min-height: 0;
    padding: 8px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .teleprompter-text {
    font-size: 1.15rem !important; /* Tipografía grande y nítida para lectura cómoda */
    line-height: 1.5;
    font-weight: 500;
  }

  .teleprompter-placeholder {
    padding: 0.8rem 0.5rem;
    gap: 6px;
  }

  .teleprompter-placeholder-icon svg {
    width: 28px;
    height: 28px;
  }

  .teleprompter-placeholder h3 {
    font-size: 0.88rem;
  }

  .teleprompter-placeholder p {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .teleprompter-footer-bar {
    display: none; /* Ocultar footer para maximizar área de lectura */
  }

  /* Scroll normal para las pestañas secundarias (Entrenamiento y Configuración) */
  #training-tab.active, #settings-tab.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    padding-bottom: 24px;
  }

  .training-layout, .settings-grid, .profiles-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .profile-editor-card {
    padding: 1.1rem;
    gap: 1.1rem;
    border-radius: var(--radius-lg);
  }

  .profile-editor-card .editor-header h2 {
    font-size: 1.05rem !important;
  }

  .editor-actions-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .editor-actions-group .btn-outline,
  .editor-actions-group .btn-danger-outline {
    min-width: 0;
    padding: 9px 8px;
    font-size: 0.76rem;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #deleteProfileBtn {
    grid-column: 1 / -1;
  }

  .form-grid {
    gap: 1rem;
  }

  .profiles-sidebar > div[style*="justify-content"] {
    flex-wrap: wrap;
    gap: 10px !important;
  }

  .profile-item-btn {
    padding: 10px 12px;
    min-width: 0;
  }

  .profile-item-btn > div {
    min-width: 0;
    overflow: hidden;
  }

  .profile-item-btn span,
  .profile-item-btn small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Evitar que celdas de grid/flex fuercen overflow horizontal por su contenido */
  .profiles-layout, .profiles-sidebar, .profiles-list,
  .form-grid, .form-group, .form-grid > *,
  .profile-editor-card, .editor-header, .editor-header > div {
    min-width: 0;
  }

  .form-input, .form-select, .form-textarea {
    width: 100%;
    max-width: 100%;
  }

  .modal-container {
    max-width: 100%;
    max-height: 90vh;
  }

  .modal-header, .modal-body, .modal-footer {
    padding: 1rem;
  }
}

/* ==========================================================
   PANTALLA DE ENTREVISTA (LIVE ROOM - LEGACY COMPAT)
   ========================================================== */
.interview-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
}

/* Selector de Fuente de Audio y Conexión de Llamada */
.audio-source-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audio-source-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.audio-source-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.source-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.source-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.source-tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.source-badge-recom {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Tarjeta de Conexión de Llamada Meet / Discord */
.call-connection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(26, 34, 52, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 10px;
}

.call-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.call-status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.call-status-indicator .dot.active {
  background: var(--accent-success);
  box-shadow: 0 0 10px var(--accent-success);
}

.btn-primary-sm {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary-sm:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-danger);
}

/* Fila de controles de Micrófono & Ganancia */
.mic-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.mic-device-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.form-select-sm {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
  font-size: 0.8rem;
}

.gain-slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gain-slider {
  width: 110px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Banner de Estado Superior */
.interview-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
}

.status-indicator-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.status-pill.ready {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-pill.listening {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
  animation: pulseListen 1.5s infinite;
}

.status-pill.processing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.status-pill.answered {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

@keyframes pulseListen {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.03); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Panel Central de Control de Grabación */
.controls-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1.25rem;
  background: linear-gradient(180deg, rgba(26, 34, 52, 0.6) 0%, rgba(17, 24, 39, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Visualizador de Ondas de Audio */
.visualizer-container {
  width: 100%;
  max-width: 600px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#audioCanvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}

/* Botón Gigante de Escuchar / Terminar */
.main-record-btn {
  position: relative;
  min-width: 280px;
  height: 64px;
  padding: 0 2rem;
  border-radius: var(--radius-full);
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  user-select: none;
}

/* Estado Escuchar (Reposo) */
.main-record-btn.state-idle {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.45);
}

.main-record-btn.state-idle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.6);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.main-record-btn.state-idle:active {
  transform: translateY(1px);
}

/* Estado Grabando / Escuchando (Pulsante Rojo) */
.main-record-btn.state-recording {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: var(--shadow-glow-recording);
  animation: recordGlow 2s infinite ease-in-out;
}

.main-record-btn.state-recording:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

@keyframes recordGlow {
  0% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.8); }
  100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

/* Estado Procesando */
.main-record-btn.state-processing {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  cursor: wait;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-shortcut-hint {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: 6px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Acciones secundarias de grabación */
.control-actions-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

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

.btn-subtle:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Transcripción de la Pregunta */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.question-text-area {
  width: 100%;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.4;
  padding: 10px 14px;
  resize: none;
  font-family: var(--font-sans);
  min-height: 52px;
  transition: border-color 0.2s;
}

.question-text-area:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.question-text-area::placeholder {
  color: var(--text-muted);
}

.btn-icon-action {
  background: var(--accent-primary);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-icon-action:hover {
  background: var(--accent-primary-hover);
}

/* ==========================================================
   SECCIÓN DE ENTRENAMIENTO / PERFILES
   ========================================================== */
.profiles-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.profiles-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.profile-item-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-item-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.profile-item-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--accent-primary);
  color: #ffffff;
}

.profile-badge-default {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent-primary);
  color: white;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Formulario de Perfil */
.profile-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.editor-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group label .help-text {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

/* Botones Principales */
.btn-primary {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-outline.is-active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger-outline {
  background: transparent;
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-danger);
}

/* ==========================================================
   SECCIÓN HISTORIAL
   ========================================================== */
.history-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}

.history-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-profile-tag {
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.history-question {
  font-size: 1rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.history-answer {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-primary);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================
   SECCIÓN CONFIGURACIÓN
   ========================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}

.key-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* Modal de Vista Previa y Diálogos */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 750px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-body pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #a5f3fc;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.25s ease forwards;
  pointer-events: auto;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.toast.info .toast-icon {
  color: #60a5fa;
}

.toast.success {
  border-left: 4px solid var(--accent-success);
}

.toast.success .toast-icon {
  color: var(--accent-success);
}

.toast.error {
  border-left: 4px solid var(--accent-danger);
}

.toast.error .toast-icon {
  color: var(--accent-danger);
}

.toast.warning {
  border-left: 4px solid var(--accent-warning);
}

.toast.warning .toast-icon {
  color: var(--accent-warning);
}

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

/* Responsive adjustments */
@media (max-width: 900px) {
  .profiles-layout {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   ESTILOS PARA MEDIDOR VU DE LLAMADA EN VIVO Y GUÍA
   ========================================================== */
.call-audio-meter-box {
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.call-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}

.call-meter-title {
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.call-meter-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.call-meter-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.call-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #f97316 70%, #2563eb 100%);
  border-radius: 6px;
  transition: width 0.08s ease-out;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.call-meter-bar.active-sound {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
}

.call-meter-status-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

.call-guide-box {
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  line-height: 1.5;
}

.call-guide-title {
  color: #93c5fd;
  font-weight: 600;
  margin-bottom: 6px;
}

.call-guide-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.call-guide-list li {
  color: var(--text-secondary);
}

.call-guide-list li strong {
  color: var(--text-primary);
}

.call-guide-tip {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(37, 99, 235, 0.08);
  border-left: 3px solid #2563eb;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #cbd5e1;
  font-size: 0.74rem;
}

/* ==========================================================
   ESTILOS PARA TRANSCRIPCIÓN EN VIVO (SUBTÍTULOS EN PANTALLA)
   ========================================================== */
.live-caption-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
  min-height: 72px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.live-caption-card.active-listening {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

.live-caption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.live-caption-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 1.5s infinite;
}

.live-caption-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.live-caption-text {
  font-size: 1.02rem;
  line-height: 1.45;
  color: #f1f5f9;
  font-weight: 500;
  min-height: 28px;
  transition: color 0.2s ease;
  word-break: break-word;
}

.live-caption-text.empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}


/* ==========================================================
   ENTRENAMIENTO — REDISEÑO
   ========================================================== */
.training-page {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.training-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 2px 0;
}

.training-hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.training-hero p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 4px;
  max-width: 560px;
}

.training-hero-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  min-width: 0;
  max-width: 100%;
}

.stat-chip strong {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.stat-num {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-chip-active {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  flex-shrink: 0;
}

.profiles-layout {
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.profiles-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  gap: 12px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.sidebar-actions {
  display: flex;
  gap: 6px;
}

.sidebar-actions .btn-primary-sm,
.sidebar-actions .btn-subtle {
  height: 32px;
  padding: 0 12px;
}

.profile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-muted);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-search:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.profile-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 10px 0;
}

.profiles-list {
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
}

.profiles-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 18px 8px;
}

.profile-item-btn {
  gap: 12px;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.profile-item-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.06));
  box-shadow: inset 3px 0 0 var(--accent-primary);
}

.profile-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #f97316);
}

.profile-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-item-text small {
  color: var(--text-muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Editor */
.profile-editor-card {
  padding: 0;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

.profile-editor-card .editor-header {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  align-items: flex-start;
}

.editor-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-secondary);
}

.editor-title-block h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.editor-title-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

#profileForm {
  display: flex;
  flex-direction: column;
}

.form-section {
  border: none;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}

.form-section legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin-bottom: 1rem;
  float: left;
  width: 100%;
}

.form-section legend + * {
  clear: both;
}

.form-section legend strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
}

.form-section legend small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.section-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #60a5fa;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.form-group label {
  font-size: 0.82rem;
}

.form-textarea {
  min-height: 96px;
}

.profile-editor-card .editor-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid var(--border-subtle);
  padding: 0.9rem 1.6rem;
  background: rgba(13, 18, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.save-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.save-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.2s, box-shadow 0.2s;
}

.save-status.dirty {
  color: #fbbf24;
}

.save-status.dirty .save-status-dot {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

@media (max-width: 900px) {
  .profiles-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .profiles-sidebar {
    position: static;
    max-height: none;
    padding: 12px;
  }

  .profiles-list {
    max-height: 260px;
  }

  .training-hero h1 {
    font-size: 1.3rem;
  }

  .profile-editor-card .editor-header,
  .form-section {
    padding: 1.1rem 1rem;
  }

  .profile-editor-card .editor-footer {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    flex-wrap: nowrap;
  }

  .profile-editor-card .editor-footer .btn-primary {
    padding: 10px 14px;
  }

  .profile-item-btn > div {
    overflow: visible;
  }
}

.profile-item-btn .profile-avatar {
  display: flex;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

/* ---------- Carga de .txt en entrenamiento ---------- */
.label-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.txt-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.txt-upload-btn:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.55);
}

.docs-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 22px 16px;
  border: 2px dashed rgba(37, 99, 235, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(37, 99, 235, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.docs-dropzone svg { color: #60a5fa; }
.docs-dropzone strong { color: var(--text-primary); }
.docs-dropzone small { color: var(--text-muted); font-size: 0.76rem; }

.docs-dropzone:hover,
.docs-dropzone.dragging {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.7);
}

.docs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 0;
}

.doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fdba74;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.doc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.doc-info strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-info small {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-remove {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.doc-remove:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.docs-usage {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-usage[hidden] { display: none; }

.docs-usage small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.docs-usage-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.docs-usage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #f97316);
}

.docs-usage.over small { color: #fbbf24; }

@media (max-width: 900px) {
  .form-group label { flex-wrap: wrap; gap: 6px; }
}

/* ---------- Selector de idioma ES / EN ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.lang-toggle button {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-toggle button:hover { color: var(--text-primary); }

.lang-toggle button.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #f97316);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.lang-toggle.floating {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  background: rgba(13, 18, 30, 0.9);
}

@media (max-width: 900px) {
  .app-header .lang-toggle { margin-left: auto; margin-right: 6px; }
  .lang-toggle button { padding: 5px 8px; }
}

/* ---------- Micrófono 3D ---------- */
.mic3d-stage {
  position: relative;
  width: 100%;
  height: 170px;
  cursor: pointer;
  border-radius: var(--radius-md);
  background:
    radial-gradient(ellipse at 50% 70%, rgba(37, 99, 235, 0.14), transparent 65%),
    radial-gradient(ellipse at 50% 100%, rgba(249, 115, 22, 0.08), transparent 60%);
  overflow: hidden;
}

.mic3d-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mic3d-stage.mic3d-unavailable {
  display: none;
}

@media (max-width: 900px) {
  .mic3d-stage {
    height: 78px;
  }

  .listen-control-cockpit .visualizer-container.compact {
    display: none;
  }
}

.storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}
.storage-badge[hidden] { display: none; }
.storage-badge.ok { color: #34d399; background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.3); }
.storage-badge.warn { color: #fbbf24; background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); }
.storage-badge.warn .stat-dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.storage-badge.info { color: #93c5fd; background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.3); }
.storage-badge.info .stat-dot { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }

.rules-textarea {
  border-color: rgba(249, 115, 22, 0.35);
  background: rgba(249, 115, 22, 0.04);
}

.field-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
}
