:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --primary-subtle: #eff6ff;
  --secondary: #059669;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --dark: #0f172a;
  --card-bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.15);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f1f5f9;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Header & Glassmorphic Top Bar */
.app-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Mode Switcher Toggle */
.mode-switcher {
  display: flex;
  background: #e2e8f0;
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border: none;
  background: transparent;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.mode-btn.pro.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
}

/* Secondary Module Stepper / Breadcrumbs Bar */
.module-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: auto;
}

.module-nav-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.stepper-scroll-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.stepper-scroll-btn svg {
  display: block;
}

.stepper-scroll-btn:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  transform: scale(1.08);
}

.stepper-scroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.stepper-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  flex: 1;
  min-width: 0;
  padding: 6px 3px;
  scroll-behavior: smooth;
}

.step-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.35;
}

.step-tab:hover {
  background: var(--surface);
  color: var(--dark);
}

.step-tab.active {
  background: var(--primary-subtle);
  color: var(--primary-dark);
  border-color: #bfdbfe;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
}

.step-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 800;
}

.step-tab.active .step-badge {
  background: var(--primary);
  color: #ffffff;
}

.step-page-tag {
  font-size: 0.70rem;
  font-weight: 700;
  padding: 1px 6px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 6px;
  margin-left: 2px;
  border: 1px solid #e2e8f0;
}

.step-tab.active .step-page-tag {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
}

/* Tira de Progreso Explicada Paso a Paso ("Con Manzanitas") */
.dyn-stepper-progress-strip {
  max-width: 1440px;
  margin: 0.35rem auto 0;
  padding: 0.4rem 0.5rem 0.15rem;
  border-top: 1px solid #f1f5f9;
  box-sizing: border-box;
}

.dyn-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
}

.dyn-progress-step-pill {
  color: #1e293b;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dyn-progress-percent {
  color: #2563eb;
  font-weight: 800;
  font-size: 0.76rem;
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
}

.dyn-progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}

.dyn-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #10b981 100%);
  border-radius: 9999px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Container */
.app-main {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* ========================================================
   FAITHFUL INTERACTIVE MODE (MODO FIEL INTERACTIVO 1:1)
   ======================================================== */
.faithful-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
}

.faithful-layout .book-reader-col {
  width: 100%;
  max-width: 1000px;
}

/* Mobile Mode Switcher (< 1024px) */
.mobile-layout-switcher {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 0.35rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
}

.mobile-switcher-btn {
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.mobile-switcher-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-weight: 800;
}

/* Columna Izquierda: Visor del Libro Fiel */
.book-reader-col {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  z-index: 10;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

/* Barra de Herramientas del Lector */
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1.5px solid #f1f5f9;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.reader-nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reader-nav-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.reader-nav-btn svg {
  display: block;
}

.reader-nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.reader-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
  transform: none !important;
}

.page-badge-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-nav-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-indicator-pill {
  font-weight: 800;
  font-size: 0.85rem;
  color: #0f172a;
  white-space: nowrap;
}

.quick-page-input {
  width: 46px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 0 2px;
  transition: all 0.2s ease;
}

.quick-page-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.page-topic-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 2px 9px;
  border-radius: 9999px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.zoom-controls {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 4px;
  gap: 2px;
}

.zoom-btn {
  background: transparent;
  border: none;
  color: #475569;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.zoom-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.zoom-preset-btn {
  font-size: 0.72rem;
  font-weight: 800;
  width: auto;
  min-width: 38px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
}

.zoom-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.zoom-preset-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.zoom-label {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace;
  color: #64748b;
  min-width: 38px;
  text-align: center;
}

.view-mode-toggles {
  display: flex;
  background: #f1f5f9;
  padding: 2px;
  border-radius: 10px;
  gap: 2px;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  font-weight: 800;
}

/* Viewport con Scroll y Zoom Suave (Idéntico al stage-wrap del prototipo fiel-v2) */
.book-page-viewport {
  position: relative;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: safe center;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 4px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  box-shadow: none;
}

.book-page-stage-wrap {
  flex: none;
  width: calc(min(100%, 1000px) * var(--z, 1));
  transition: width 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  margin: 0 auto;
}

/* Efecto Lomo del Libro (Book Spine Shadow) */
.book-spine-effect {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 22px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.04) 40%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}

.book-page-image {
  width: 100%;
  height: auto;
  display: block;
  /* High-quality smooth anti-aliased resampling for ultra-high-res 300 DPI pages */
  image-rendering: auto;
  image-rendering: smooth;
  filter: contrast(1.05) saturate(1.02);
}

/* Answer Sheet Column (Hoja de Respuestas Interactiva) */
.answersheet-col {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.sheet-header {
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.sheet-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sheet-section-title h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
}

/* ========================================================
   DYNAMIC MODE (MODO DINÁMICO GAMIFICADO)
   ======================================================== */
.dynamic-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.content-panel {
  display: none;
  animation: fadeIn 0.35s ease forwards;
}

.content-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Styling */
.game-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-blue { background: #eff6ff; color: #1d4ed8; }
.tag-green { background: #ecfdf5; color: #047857; }
.tag-purple { background: #faf5ff; color: #7e22ce; }
.tag-amber { background: #fffbeb; color: #b45309; }

/* Interactive Question Items */
.question-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

.question-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.question-prompt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.q-number {
  background: var(--primary);
  color: #ffffff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
}

.option-label:hover {
  border-color: var(--primary-light);
  background: #f8fafc;
}

.option-label input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.option-label.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary-dark);
  font-weight: 600;
}

.option-label.correct {
  border-color: var(--secondary) !important;
  background: #dcfce7 !important;
  color: #166534 !important;
}

.option-label.incorrect {
  border-color: var(--danger) !important;
  background: var(--danger-light) !important;
  color: #991b1b !important;
}

/* Word Bank Box */
.word-bank-box {
  background: #fefce8;
  border: 2px dashed #facc15;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.word-bank-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #854d0e;
  margin-bottom: 0.5rem;
}

.word-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.word-pill {
  background: #ffffff;
  border: 1px solid #fde047;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #713f12;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Modern Audio Bar with Equalizer & Speed Control */
.audio-player-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 1.25rem 0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  flex-wrap: wrap;
}

.audio-main-ctrls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.play-circle-btn:hover {
  transform: scale(1.06);
  background: var(--primary-dark);
}

.audio-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.audio-meta p {
  font-size: 0.78rem;
  opacity: 0.75;
}

.audio-extra-ctrls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.speed-select {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.speed-select option {
  background: #0f172a;
  color: white;
}

/* Result Bands Container (Pág 7) */
.result-bands-card {
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
}

.band-row {
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.band-green { background: #16a34a; }
.band-yellow { background: #ca8a04; }
.band-red { background: #dc2626; }

/* ========================================================
   SESSION 1: ANNA & CARLOS DIALOGUE & TRACK 05 PLAYER
   ======================================================== */

/* Task 1: Topic Question Box */
.s1-task1-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.s1-task1-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.98rem;
  color: #1e293b;
}

.s1-task-badge {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.s1-topic-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.s1-topic-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.16s ease;
  user-select: none;
}

.s1-topic-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.s1-topic-btn.selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.s1-topic-btn.correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

.s1-topic-btn.incorrect {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.s1-topic-feedback {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.s1-topic-feedback.correct {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.s1-topic-feedback.incorrect {
  background: #fee2e2;
  color: #991c1c;
  border: 1px solid #fca5a5;
}

/* Master Audio Console (Track 05) */
.track05-player-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.track05-controls-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.track05-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: all 0.16s ease;
  user-select: none;
}

.track05-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.track05-play-btn.playing {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  animation: playPulse 1.5s infinite;
}

@keyframes playPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.track05-rewind-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.track05-rewind-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.track05-time-info {
  font-family: monospace;
  font-size: 0.84rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  gap: 4px;
}

.track05-timeline-container {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track05-scrubber {
  width: 100%;
  accent-color: #10b981;
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.track05-speaker-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.track05-speaker-pill .pill-dot {
  color: #10b981;
  font-size: 0.7rem;
  animation: blinkDot 1.2s infinite alternate;
}

@keyframes blinkDot {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.track05-controls-right {
  display: flex;
  align-items: center;
}

.track05-speed-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.track05-speed-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.track05-speed-btn.slow {
  background: #f59e0b;
  color: #1e1b4b;
  border-color: #fbbf24;
}

/* Dialogue Stage */
.dialogue-stage {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 1rem 0 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.characters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.character-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.character-card:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

.character-card.speaking {
  background: #ecfdf5;
  transform: scale(1.04);
}

.char-anna.speaking {
  background: #fdf2f8;
}

.avatar-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 3px;
  background: #e2e8f0;
  transition: var(--transition);
  flex-shrink: 0;
}

.char-anna .avatar-wrapper {
  background: linear-gradient(135deg, #fbcfe8, #f472b6);
}

.char-carlos .avatar-wrapper {
  background: linear-gradient(135deg, #bbf7d0, #34d399);
}

.character-card.speaking .avatar-wrapper {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.35);
}

.char-anna.speaking .avatar-wrapper {
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.4), 0 0 20px rgba(244, 114, 182, 0.35);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #ffffff;
}

.speaking-pulse {
  position: absolute;
  bottom: 0px;
  right: 0px;
  background: #10b981;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid white;
}

.char-anna .speaking-pulse {
  background: #ec4899;
}

.sound-wave {
  width: 2px;
  height: 12px;
  background: #ffffff;
  border-radius: 1px;
  animation: eqBounce 0.6s ease-in-out infinite alternate;
}

.sound-wave:nth-child(2) {
  animation-delay: 0.18s;
  height: 16px;
}

.sound-wave:nth-child(3) {
  animation-delay: 0.36s;
  height: 10px;
}

@keyframes eqBounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

.character-card.speaking .speaking-pulse {
  display: flex;
}

.char-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.char-name {
  font-weight: 800;
  font-size: 1.12rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-voice-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
}

.char-status {
  font-size: 0.78rem;
  color: #64748b;
}

.stage-center-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.stage-chat-icon {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.stage-chat-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
}

.stage-active-speaker {
  font-size: 0.76rem;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 3px;
}

/* Chat timeline */
.chat-bubbles {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 1.5rem 0;
}

.chat-bubble {
  display: flex;
  gap: 0.85rem;
  max-width: 90%;
  opacity: 0.82;
  transition: all 0.2s ease;
  align-items: flex-start;
}

.chat-bubble.active {
  opacity: 1;
  transform: translateX(6px);
}

.chat-bubble.carlos {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble.carlos.active {
  transform: translateX(-6px);
}

.bubble-avatar-mini {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  background: #ffffff;
}

.bubble-content {
  padding: 0.95rem 1.35rem 1.15rem;
  border-radius: 18px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  font-size: 1rem;
  line-height: 1.8;
  position: relative;
  flex: 1;
}

.chat-bubble.anna .bubble-content {
  background: #fdf4ff;
  border-color: #f0abfc;
  border-top-left-radius: 4px;
}

.chat-bubble.carlos .bubble-content {
  background: #f0fdf4;
  border-color: #86efac;
  border-top-right-radius: 4px;
}

.chat-bubble.active .bubble-content {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.16);
  border-width: 2px;
}

.bubble-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.bubble-speaker {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.chat-bubble.anna .bubble-speaker { color: #c026d3; }
.chat-bubble.carlos .bubble-speaker { color: #047857; }

.bubble-play-line-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 10px;
  padding: 2px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bubble-play-line-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
  transform: scale(1.04);
}

.bubble-text {
  color: #1e293b;
  font-size: 0.98rem;
}

/* Actions & Feedback */
.s1-dialogue-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.s1-actions-left {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.s1-dialogue-feedback-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.5;
}

.s1-dialogue-feedback-box.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
}

.s1-dialogue-feedback-box.partial {
  background: #fffbeb;
  color: #92400e;
  border: 1.5px solid #fde68a;
}

/* AI Speaking Coach Card */
.ai-coach-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #2e1065 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-lg);
}

.target-phrase-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.target-phrase-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fbbf24;
}

.mic-action-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.mic-action-btn:hover {
  transform: translateY(-2px);
  background: #dc2626;
}

.mic-action-btn.recording {
  animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Primary Action Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Frequency Meter */
.frequency-meter {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 1.5rem 0;
}

.freq-slider-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 1.25rem 0;
}

.freq-slider {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: #cbd5e1;
  cursor: pointer;
}

.freq-display {
  background: var(--dark);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.15rem;
  min-width: 170px;
  text-align: center;
}

/* Activity Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.activity-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.activity-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f1f5f9;
}

.activity-card-body {
  padding: 1rem;
}

.activity-select {
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  background: #f8fafc;
}

.activity-card.correct {
  border-color: var(--secondary);
}

.activity-card.correct .activity-select {
  background: #dcfce7;
  color: #166534;
  border-color: var(--secondary);
}

/* ========================================================
   MODERN SMART MEDIA CARDS & QR REPLACEMENT SYSTEM
   ======================================================== */
.hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

/* Smart Media Card: Replaces printed QR code with native interactive player */
.smart-media-card {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: #ffffff;
  border-radius: 4px; /* Bordes nítidos pro: elimina esquinas redondeadas que dejan ver el libro impreso */
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.16), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
  padding: 0.6rem 0.75rem;
  width: 180px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
  user-select: none;
  overflow: hidden;
  animation: smartAudioPulse 3.2s ease-in-out infinite;
}

/* Máscara sólida interna opaca para asegurar que jamás se transparente el fondo del libro */
.smart-media-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: #ffffff;
  border-radius: 4px;
  z-index: -1;
  pointer-events: none;
}

.smart-media-card[data-type="youtube"] {
  animation: smartYoutubePulse 3.2s ease-in-out infinite;
}

.smart-media-card[data-type="spotify"] {
  animation: smartSpotifyPulse 3.2s ease-in-out infinite;
}

/* Diagonal glass sheen reflection sweeping across the card */
.smart-media-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -140%;
  width: 75%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-25deg);
  animation: cardSheenSweep 4.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes cardSheenSweep {
  0%, 65% { left: -140%; }
  100% { left: 190%; }
}

/* Ambient radar glow for idle audio widgets */
@keyframes smartAudioPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35), 0 10px 25px -4px rgba(15, 23, 42, 0.15);
    border-color: #93c5fd;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(37, 99, 235, 0), 0 14px 28px -4px rgba(37, 99, 235, 0.25);
    border-color: #2563eb;
  }
}

/* Ambient radar glow for idle video widgets */
@keyframes smartYoutubePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35), 0 10px 25px -4px rgba(15, 23, 42, 0.15);
    border-color: #fca5a5;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, 0), 0 14px 28px -4px rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
  }
}

/* Ambient radar glow for idle music widgets */
@keyframes smartSpotifyPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.35), 0 10px 25px -4px rgba(15, 23, 42, 0.15);
    border-color: #86efac;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0), 0 14px 28px -4px rgba(16, 185, 129, 0.25);
    border-color: #10b981;
  }
}

.smart-media-card:hover {
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.22));
  border-color: var(--primary);
}

/* Active playing state: pulsating border and soft glow */
.smart-media-card.is-playing {
  border-color: var(--primary);
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 100%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3), 0 16px 32px rgba(37, 99, 235, 0.25);
  animation: playingPulseGlow 1.8s ease-in-out infinite alternate;
}

@keyframes playingPulseGlow {
  0% {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 12px 24px rgba(37, 99, 235, 0.18);
  }
  100% {
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.45), 0 18px 36px rgba(37, 99, 235, 0.3);
  }
}

.smart-media-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  position: relative;
  z-index: 2;
}

.smart-card-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2.5px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-audio { background: #dbeafe; color: #1d4ed8; }
.tag-video { background: #fee2e2; color: #b91c1c; }
.tag-music { background: #dcfce7; color: #15803d; }

/* Pulsing Live Dot inside Tag */
.smart-live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.smart-live-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
  animation: liveDotPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes liveDotPing {
  0% { transform: scale(1); opacity: 0.85; }
  70%, 100% { transform: scale(2.6); opacity: 0; }
}

/* Fallback QR trigger button: cautious and discreet access */
.smart-qr-trigger {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: var(--transition);
}

.smart-qr-trigger:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.smart-media-card-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 2;
}

.smart-media-playbtn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
}

/* Expanding Radar Ripple around Play Button */
.smart-media-playbtn::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.55);
  opacity: 0;
  animation: playBtnPulseRing 2.4s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
  pointer-events: none;
}

.smart-media-playbtn.youtube-btn::before {
  border-color: rgba(239, 68, 68, 0.55);
}

.smart-media-playbtn.spotify-btn::before {
  border-color: rgba(16, 185, 129, 0.55);
}

@keyframes playBtnPulseRing {
  0% {
    transform: scale(0.9);
    opacity: 0.85;
  }
  60%, 100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.smart-media-playbtn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.smart-media-playbtn.youtube-btn {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.smart-media-playbtn.youtube-btn:hover {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

.smart-media-playbtn.spotify-btn {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.smart-media-playbtn.spotify-btn:hover {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.smart-media-meta {
  flex: 1;
  min-width: 0;
}

.smart-media-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-media-sub {
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Soundwave Equalizer Bars (playing state) */
.smart-equalizer {
  display: none;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  margin-top: 3px;
}

.smart-media-card.is-playing .smart-equalizer {
  display: flex;
}

.smart-equalizer span {
  width: 3px;
  background: #2563eb;
  border-radius: 2px;
  height: 3px;
}

.smart-media-card.is-playing .smart-equalizer span:nth-child(1) {
  animation: eqBar1 0.75s ease-in-out infinite alternate;
}
.smart-media-card.is-playing .smart-equalizer span:nth-child(2) {
  animation: eqBar2 0.55s ease-in-out infinite alternate 0.15s;
}
.smart-media-card.is-playing .smart-equalizer span:nth-child(3) {
  animation: eqBar3 0.85s ease-in-out infinite alternate 0.05s;
}
.smart-media-card.is-playing .smart-equalizer span:nth-child(4) {
  animation: eqBar4 0.65s ease-in-out infinite alternate 0.2s;
}

@keyframes eqBar1 {
  0% { height: 3px; }
  100% { height: 12px; }
}
@keyframes eqBar2 {
  0% { height: 4px; }
  100% { height: 14px; }
}
@keyframes eqBar3 {
  0% { height: 2px; }
  100% { height: 10px; }
}
@keyframes eqBar4 {
  0% { height: 5px; }
  100% { height: 13px; }
}

/* ========================================================
   ON-PAGE DIRECT INTERACTIVE LAYER (RESPONDER SOBRE EL LIBRO)
   ======================================================== */
.onpage-interactive-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 17;
}

/* ========================================================
   RICHMOND & MCGRAW-HILL HIGH-END EDITORIAL INTERACTION SUITE
   ======================================================== */

/* Clean Page Mode: instantly hides interactive overlays when inspecting the textbook page */
.book-page-canvas.clean-page-mode .onpage-interactive-layer {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.onpage-interactive-layer {
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Micro-Interaction Animation Keyframes */
@keyframes edtechSuccessBounce {
  0% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, -50%) scale(1.08); }
  65% { transform: translate(-50%, -50%) scale(0.97); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes edtechGentleWobble {
  0%, 100% { transform: translate(-50%, -50%); }
  20% { transform: translate(calc(-50% - 4px), -50%); }
  40% { transform: translate(calc(-50% + 4px), -50%); }
  60% { transform: translate(calc(-50% - 3px), -50%); }
  80% { transform: translate(calc(-50% + 2px), -50%); }
}

@keyframes edtechStampIn {
  0% { transform: translate(-50%, -50%) scale(1.22) rotate(-2deg); opacity: 0.6; }
  70% { transform: translate(-50%, -50%) scale(0.96) rotate(1deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes edtechMagneticSnap {
  0% { transform: scale(1.18); }
  55% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes edtechRadarPulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes edtechScorePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); filter: drop-shadow(0 0 8px #10b981); }
  100% { transform: scale(1); }
}

/* Non-Invasive Editorial Inputs Over Textbook Lines (Fill-in-the-blank) */
.onpage-input {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  border: 1px solid rgba(37, 99, 235, 0.28);
  border-bottom: 2.5px solid #2563eb;
  border-radius: 5px;
  padding: 0 6px;
  height: 24px;
  line-height: normal;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #1e3a8a;
  text-align: center;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  z-index: 18;
}

.onpage-input:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
  z-index: 25;
}

.onpage-input:focus {
  outline: none;
  background: #ffffff;
  border: 1.5px solid #1d4ed8;
  border-bottom: 3px solid #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28), 0 0 0 2px rgba(37, 99, 235, 0.2);
  transform: translate(-50%, -50%) scale(1.03);
  z-index: 30;
}

textarea.onpage-input,
.onpage-textarea {
  text-align: left;
  padding: 8px 10px;
  line-height: 1.48;
  border: 1.5px solid rgba(37, 99, 235, 0.45);
  border-radius: 8px;
  resize: none;
  background: rgba(255, 255, 255, 0.88);
  font-family: inherit;
}

.onpage-input.is-correct {
  background-color: rgba(240, 253, 244, 0.95) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2316a34a'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 5px center !important;
  background-size: 14px 14px !important;
  border-color: #16a34a !important;
  border-bottom: 3px solid #15803d !important;
  color: #15803d !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.22);
  animation: edtechSuccessBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.onpage-input.is-wrong {
  background-color: rgba(254, 242, 242, 0.95) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23dc2626'%3E%3Cpath fill-rule='evenodd' d='M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 5px center !important;
  background-size: 13px 13px !important;
  border-color: #dc2626 !important;
  border-bottom: 3px solid #b91c1c !important;
  color: #b91c1c !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
  animation: edtechGentleWobble 0.4s ease-in-out;
}

/* Non-Invasive Editorial Select Dropdowns */
.onpage-select {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1.5px solid rgba(37, 99, 235, 0.55);
  border-bottom: 2.5px solid #2563eb;
  border-radius: 6px;
  padding: 0 6px;
  height: 24px;
  line-height: 21px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
  transition: all 0.16s ease;
  box-sizing: border-box;
  z-index: 18;
}

.onpage-select:hover,
.onpage-select:focus {
  outline: none;
  background: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
  transform: translate(-50%, -50%) scale(1.02);
  z-index: 30;
}

.onpage-select.is-correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
  animation: edtechSuccessBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onpage-select.is-wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
  animation: edtechGentleWobble 0.4s ease-in-out;
}

/* Choice Selection Zones (Multiple Choice, Image Hotspots) */
.onpage-choice {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  pointer-events: auto;
  border: 2px dashed transparent;
  z-index: 19;
}

.onpage-choice:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.08);
}

.onpage-choice.is-selected {
  border: 2.5px solid #2563eb !important;
  background: rgba(37, 99, 235, 0.16) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
  animation: edtechStampIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.onpage-choice.is-correct {
  border: 3px solid #16a34a !important;
  background: rgba(22, 163, 74, 0.2) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
  animation: edtechSuccessBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onpage-choice.is-wrong {
  border: 3px solid #dc2626 !important;
  background: rgba(220, 38, 38, 0.18) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
  animation: edtechGentleWobble 0.4s ease-in-out;
}

/* Audio Radar Hotspots */
.faithful-hotspot-item[data-type="audio"],
.faithful-hotspot-item[data-track] {
  animation: edtechRadarPulse 2.8s infinite;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.faithful-hotspot-item[data-type="audio"]:hover,
.faithful-hotspot-item[data-track]:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

/* Dynamic Split-View Synchronized Worksheet Cards (Pages 29-112) */
.dyn-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dyn-sheet-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  transition: border-color 0.15s ease;
}

.dyn-sheet-row:hover {
  border-color: #cbd5e1;
}

.dyn-sheet-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dyn-sheet-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dyn-sheet-control {
  width: 100%;
}

.dyn-sheet-input,
.dyn-sheet-select,
.dyn-sheet-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.dyn-sheet-input:focus,
.dyn-sheet-select:focus,
.dyn-sheet-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dyn-sheet-input.is-correct,
.dyn-sheet-select.is-correct,
.dyn-sheet-textarea.is-correct {
  border-color: #16a34a !important;
  background-color: #f0fdf4 !important;
  color: #15803d !important;
}

.dyn-sheet-input.is-wrong,
.dyn-sheet-select.is-wrong,
.dyn-sheet-textarea.is-wrong {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

.dyn-sheet-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dyn-sheet-choice-btn {
  padding: 5px 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dyn-sheet-choice-btn:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.dyn-sheet-choice-btn.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.onpage-score-badge.pulse {
  animation: edtechScorePulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ========================================================
   BANCO DE PALABRAS INTERACTIVO ON-PAGE (Page 5 Part 3)
   ======================================================== */
.onpage-wordbank-container {
  position: absolute;
  transform: translateX(-50%);
  pointer-events: auto;
  z-index: 22;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 6px 14px 8px 14px;
  box-sizing: border-box;
  max-width: 95%;
  transition: all 0.2s ease;
  user-select: none;
}

.onpage-wordbank-container.drag-over {
  border-color: #f59e0b;
  background: rgba(254, 243, 199, 0.95);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
}

.wordbank-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #cbd5e1;
}

.wordbank-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wordbank-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
}

.wordbank-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.wordbank-reset-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 3px;
}

.wordbank-reset-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.wordbank-chips-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

/* Fichas de Palabras (Word Bank Chips) */
.wordbank-chip {
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1.5px solid #38bdf8;
  color: #0369a1;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  padding: 3px 11px;
  border-radius: 14px;
  cursor: grab;
  box-shadow: 0 2px 4px rgba(3, 105, 161, 0.12);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.wordbank-chip:hover:not(.is-used) {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0c4a6e;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(3, 105, 161, 0.22);
}

.wordbank-chip:active:not(.is-used) {
  cursor: grabbing;
  transform: scale(0.96);
}

.wordbank-chip.is-selected {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.4), 0 4px 10px rgba(2, 132, 199, 0.3) !important;
  transform: translateY(-2px) scale(1.05);
  animation: pulseChip 1.4s infinite alternate;
}

@keyframes pulseChip {
  0% { box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3); }
  100% { box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.55); }
}

.wordbank-chip.is-used {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  text-decoration: line-through;
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Huecos de Respuesta sobre las Líneas del Libro (Word Bank Slot) */
.onpage-wordbank-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  min-width: 50px;
  height: 24px;
  background: rgba(240, 249, 255, 0.85);
  border: 1.5px dashed #0284c7;
  border-radius: 6px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0369a1;
  user-select: none;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.18);
  z-index: 18;
}

.onpage-wordbank-slot:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}

.onpage-wordbank-slot.drag-over {
  background: #bae6fd !important;
  border: 2px solid #0284c7 !important;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.35) !important;
  z-index: 30;
}

.onpage-wordbank-slot.is-filled {
  border-style: solid;
  border-color: #0284c7;
  background: #ffffff;
  color: #0c4a6e;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.15);
}

.onpage-wordbank-slot .slot-word {
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: grab;
}

.onpage-wordbank-slot .slot-word:active {
  cursor: grabbing;
}

.onpage-wordbank-slot .slot-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
  border: none;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.12s ease;
}

.onpage-wordbank-slot .slot-remove-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.onpage-wordbank-slot.is-correct {
  background: #f0fdf4 !important;
  border: 1.5px solid #16a34a !important;
  color: #15803d !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25) !important;
}

.onpage-wordbank-slot.is-correct .slot-remove-btn {
  display: none;
}

.onpage-wordbank-slot.is-wrong {
  background: #fef2f2 !important;
  border: 1.5px solid #dc2626 !important;
  color: #b91c1c !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25) !important;
}

/* Zonas de Opción Múltiple Clicables Directas sobre el Libro (Part 1 Signs & Listening) */
.onpage-choice-zone {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 18;
}

.onpage-choice-zone:hover {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(59, 130, 246, 0.12);
}

.onpage-choice-zone.selected {
  border: 2px solid #2563eb;
  background: rgba(37, 99, 235, 0.20);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.calibrator-active .onpage-choice-zone {
  border: 2px dashed #f59e0b !important;
  background: rgba(245, 158, 11, 0.15) !important;
}

.onpage-choice-zone.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #2563eb;
  color: #ffffff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.onpage-choice-zone.selected.is-correct {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.2);
}
.onpage-choice-zone.selected.is-correct::after {
  background: #16a34a;
}

.onpage-choice-zone.selected.is-wrong {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.18);
}
.onpage-choice-zone.selected.is-wrong::after {
  content: '✗';
  background: #dc2626;
}

/* Barra Flotante de Calificación y Navegación Directa sobre el Libro */
.onpage-action-bar {
  position: sticky;
  bottom: 0.85rem;
  left: 50%;
  margin: 0.85rem auto 0;
  width: max-content;
  max-width: 96%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 100;
  flex-wrap: wrap;
  justify-content: center;
}

.onpage-nav-arrow-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  white-space: nowrap;
}

.onpage-nav-arrow-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.onpage-nav-arrow-btn.next {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #3b82f6;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

.onpage-nav-arrow-btn.next:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.5);
  color: #ffffff;
}

.onpage-nav-arrow-btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: none !important;
}

.onpage-nav-arrow-btn .nav-arrow-sub {
  font-size: 0.74rem;
  color: #cbd5e1;
  font-weight: 700;
}

.onpage-nav-arrow-btn.next .nav-arrow-sub {
  color: #e0f2fe;
}

.onpage-score-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.35rem;
}

.onpage-score-pill strong {
  color: #38bdf8;
  font-size: 1.05rem;
  font-weight: 800;
}

.btn-check-onpage {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.42rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.38);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-check-onpage:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-reset-onpage {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-reset-onpage:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ========================================================
   MODO CALIBRADOR / EDITOR VISUAL DE MAQUETADO
   ======================================================== */
.calibrator-active .book-page-canvas {
  cursor: crosshair;
}

.calibrator-active .smart-media-card,
.calibrator-active .fld,
.calibrator-active .onpage-input,
.calibrator-active .onpage-select,
.calibrator-active .onpage-choice-zone,
.calibrator-active .onpage-wordbank-slot,
.calibrator-active .onpage-wordbank-container {
  cursor: move !important;
  outline: 2px dashed #f59e0b !important;
  outline-offset: 2px;
}

.calibrator-active .onpage-choice-zone {
  border: 2px dashed #f59e0b !important;
  background: rgba(245, 158, 11, 0.15) !important;
}

/* Pause card animations during layout calibration so dragging has perfect precision */
.calibrator-active .smart-media-card,
.calibrator-active .smart-media-card::before,
.calibrator-active .smart-media-card::after,
.calibrator-active .smart-media-playbtn::before,
.calibrator-active .smart-live-dot::after {
  animation: none !important;
}

.calibrator-active .is-calibrating-selected {
  outline: 2.5px solid #2563eb !important;
  outline-offset: 2px;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.6) !important;
  position: absolute;
}

/* Tirador de Redimensionado en la Esquina Inferior Derecha */
.calibrator-resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #2563eb;
  border: 2.5px solid #ffffff;
  border-radius: 4px;
  cursor: se-resize !important;
  z-index: 100;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.calibrator-resize-handle:hover {
  background: #0284c7;
  transform: translate(-50%, -50%) scale(1.3);
}

.calibrator-resize-handle:active {
  background: #0369a1;
}

/* Modo de Herramienta Calibrador: Mover vs Redimensionar */
.hud-mode-switch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px;
  border-radius: 8px;
}

.hud-mode-btn {
  padding: 0.4rem 0.5rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.hud-mode-btn.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.calibrator-grid-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 5% 5%;
  pointer-events: none;
  z-index: 16;
}

/* Panel Flotante HUD del Calibrador */
.calibrator-hud {
  position: fixed;
  top: 90px;
  right: 1.5rem;
  width: 325px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
  z-index: 2500;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.calibrator-hud-header {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calibrator-hud-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hud-icon {
  font-size: 1.25rem;
}

.calibrator-hud-title strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
}

.calibrator-hud-title small {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 700;
}

.hud-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.hud-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.calibrator-hud-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Fila de creación y borrado de recuadros */
.hud-create-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-hud-add {
  flex: 1;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: var(--transition);
}

.btn-hud-add:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.btn-hud-delete {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-hud-delete:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: translateY(-1px);
}

/* Menú flotante de selección de tipo de recuadro */
.hud-add-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.45rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.hud-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  border: none;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  color: #f1f5f9;
  transition: var(--transition);
}

.hud-menu-item:hover {
  background: rgba(37, 99, 235, 0.28);
  color: #ffffff;
}

.hud-menu-item .item-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.hud-menu-item .item-info {
  display: flex;
  flex-direction: column;
}

.hud-menu-item .item-info strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.hud-menu-item .item-info small {
  font-size: 0.66rem;
  color: #94a3b8;
  line-height: 1.2;
}

.hud-meta-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.coord-field.full-width {
  width: 100%;
}

.coord-field.full-width input {
  text-align: left !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
  color: #ffffff !important;
  padding: 0.45rem 0.6rem !important;
}

.hud-target-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hud-target-row label,
.coord-field label,
.nudge-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.hud-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  width: 100%;
}

.hud-select option {
  background: #0f172a;
  color: #ffffff;
}

.hud-coords-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.coord-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.coord-field input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.4rem 0.4rem;
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  width: 100%;
}

.hud-nudge-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nudge-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.nudge-mid {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nudge-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}

.nudge-btn:hover {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 900;
}

.nudge-center {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #64748b;
}

.nudge-hint {
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.2;
}

.hud-actions-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.btn-hud-save,
.btn-hud-copy,
.btn-hud-reset {
  flex: 1;
  padding: 0.45rem 0.4rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-hud-save {
  background: #2563eb;
  color: #ffffff;
}

.btn-hud-save:hover {
  background: #1d4ed8;
}

.btn-hud-copy {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-hud-copy:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-hud-reset {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-hud-reset:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* ========================================================
   FILMSTRIP THUMBNAILS NAVIGATION (P5 - P14)
   ======================================================== */
.page-thumbnails-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.25rem 0.25rem;
  border-top: 1.5px solid #f1f5f9;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.thumb-card {
  flex: 0 0 64px;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #f8fafc;
  padding: 3px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thumb-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  background: #ffffff;
}

.thumb-card.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.thumb-card img {
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  background: #ffffff;
}

.thumb-card .thumb-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 3px;
  line-height: 1;
}

.thumb-card.active .thumb-label {
  color: var(--primary);
  font-weight: 800;
}

/* ========================================================
   PERSISTENT FLOATING AUDIO DOCK PLAYER
   ======================================================== */
.audio-dock-player {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(94%, 900px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12);
  padding: 0.85rem 1.25rem;
  z-index: 1000;
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.audio-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.audio-dock-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 170px;
}

.audio-pulse-indicator {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 20px;
  padding: 2px;
}

.audio-pulse-indicator span {
  width: 3.5px;
  height: 4px;
  background: #38bdf8;
  border-radius: 2px;
  transition: height 0.2s;
}

.audio-pulse-indicator.active span {
  animation: dockSoundwave 0.8s ease-in-out infinite alternate;
}

.audio-pulse-indicator.active span:nth-child(1) { animation-delay: 0.1s; }
.audio-pulse-indicator.active span:nth-child(2) { animation-delay: 0.3s; }
.audio-pulse-indicator.active span:nth-child(3) { animation-delay: 0.15s; }
.audio-pulse-indicator.active span:nth-child(4) { animation-delay: 0.4s; }

@keyframes dockSoundwave {
  0% { height: 4px; }
  100% { height: 18px; }
}

.audio-dock-text {
  display: flex;
  flex-direction: column;
}

.audio-dock-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

.audio-dock-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

.audio-dock-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 440px;
  justify-content: center;
}

.audio-btn-step {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.audio-btn-step:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.audio-btn-playpause {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
  transition: var(--transition);
  flex-shrink: 0;
}

.audio-btn-playpause:hover {
  transform: scale(1.08);
}

.audio-dock-scrub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 130px;
}

.audio-time {
  font-size: 0.72rem;
  font-family: monospace;
  font-weight: 700;
  color: #cbd5e1;
  min-width: 32px;
}

.audio-progress-slider {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.audio-dock-extras {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.speed-selector {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 2px 4px;
  gap: 2px;
}

.speed-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  padding-left: 4px;
  display: none;
}

@media (min-width: 768px) {
  .speed-label {
    display: inline;
  }
}

.speed-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.speed-btn.active {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 900;
}

.audio-btn-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: var(--transition);
}

.audio-btn-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ========================================================
   RESOURCE & QR CAUTIOUS FALLBACK MODAL
   ======================================================== */
.resource-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.resource-modal-card {
  background: #ffffff;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.resource-modal-header {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resource-modal-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resource-modal-icon {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.resource-modal-sub {
  font-size: 0.75rem;
  color: #64748b;
}

.resource-close-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.resource-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.resource-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.resource-qr-box {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.resource-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.resource-qr-hint {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
  max-width: 340px;
}

.resource-link-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.resource-link-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
}

.resource-link-row {
  display: flex;
  gap: 0.5rem;
}

.resource-url-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #334155;
  font-family: monospace;
}

.resource-actions-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ========================================================
   MOBILE FLOATING ACTION BUTTON (FAB)
   ======================================================== */
.mobile-floating-fab {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  z-index: 900;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-floating-fab:hover {
  transform: translateY(-2px) scale(1.03);
}

/* ========================================================
   RESPONSIVE ADAPTATIONS (< 1024px and < 640px)
   ======================================================== */
@media (max-width: 1024px) {
  .faithful-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .book-reader-col {
    position: static;
  }

  .mobile-layout-switcher {
    display: grid;
  }

  .mobile-floating-fab {
    display: flex;
  }

  .desktop-only {
    display: none !important;
  }

  /* When on mobile, toggle active column based on active tab */
  .faithful-layout[data-mobile-active="book"] .answersheet-col {
    display: none !important;
  }

  .faithful-layout[data-mobile-active="answers"] .book-reader-col {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .audio-dock-player {
    bottom: 0.5rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    width: 96%;
  }

  .audio-dock-inner {
    gap: 0.6rem;
  }

  .audio-dock-info {
    min-width: 120px;
  }

  .audio-dock-controls {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .mobile-floating-fab {
    bottom: 5.5rem; /* Ensure it stays above bottom audio dock */
  }

  .smart-media-card {
    width: 155px;
    padding: 0.5rem 0.6rem;
  }

  .smart-media-playbtn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ========================================================
   TEACHER DASHBOARD & PROGRESS TRACKING (PANEL DEL MAESTRO)
   ======================================================== */
.teacher-panel-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1440px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.teacher-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: #eff6ff; color: #1d4ed8; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.purple { background: #faf5ff; color: #7e22ce; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Curriculum Tracker Checklist */
.curriculum-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}

.curriculum-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.curriculum-item.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.curriculum-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.curriculum-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--secondary);
  cursor: pointer;
}

/* Teacher Gradebook Table */
.gradebook-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.gradebook-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.gradebook-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.gradebook-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.gradebook-table tr:hover td {
  background: #f8fafc;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-green { background: #dcfce7; color: #15803d; }
.status-yellow { background: #fef9c3; color: #854d0e; }
.status-red { background: #fee2e2; color: #991b1b; }

/* Word Ordering Drills (Task 2 p.12) */
.scramble-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.scramble-words {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.scramble-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  font-size: 0.92rem;
}

/* Category Columns (Task 2 p.9) */
.category-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}

.category-col {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  min-height: 240px;
}

.category-col.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.category-col-header {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #cbd5e1;
}

.cat-school .category-col-header { color: #2563eb; border-color: #2563eb; }
.cat-home .category-col-header { color: #059669; border-color: #059669; }
.cat-free .category-col-header { color: #d97706; border-color: #d97706; }
.cat-work .category-col-header { color: #7e22ce; border-color: #7e22ce; }

.cat-col-counter {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid currentColor;
}

.category-dropzone {
  min-height: 160px;
  flex: 1;
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.category-dropzone:empty::before {
  content: "Arrastra o toca para soltar aquí...";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem 0.5rem;
  pointer-events: none;
}

@media (max-width: 900px) {
  .category-columns-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .category-columns-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   QR PROJECTOR & CLASS MANAGEMENT STYLES
   ======================================================== */
.class-hero-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 15px 30px rgba(30, 58, 138, 0.25);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.class-hero-info h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
}

.class-hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.class-code-badge {
  background: #fbbf24;
  color: #78350f;
  font-family: monospace;
  font-weight: 900;
  font-size: 1.2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  letter-spacing: 1px;
}

.projector-modal-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.projector-qr-box {
  background: #f8fafc;
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  padding: 1.5rem;
  display: inline-block;
  margin: 1.25rem 0;
}

.student-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ========================================================
   BARRA INFERIOR DE NAVEGACIÓN (MODO FIEL 1:1)
   ======================================================== */
.faithful-bottom-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  margin-top: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.bottom-nav-arrow-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
}

.bottom-nav-arrow-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  border-color: #94a3b8;
}

.bottom-nav-arrow-btn.prev {
  background: #f1f5f9;
}

.bottom-nav-arrow-btn.next {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.bottom-nav-arrow-btn.next:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.bottom-nav-arrow-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.nav-arrow-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-arrow-content {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.bottom-nav-arrow-btn.next .nav-arrow-content {
  text-align: right;
}

.nav-arrow-title {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.nav-arrow-sub {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.8;
}

.filmstrip-container {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  position: relative;
}

.filmstrip-scroll-btn {
  width: 28px;
  height: 54px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.filmstrip-scroll-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: scale(1.05);
}

.filmstrip-container .page-thumbnails-strip {
  border-top: none;
  margin-top: 0;
  padding: 0.2rem 0.2rem;
}

/* ========================================================
   MODO DINÁMICO: PART 1. NOTICES & SIGNS (PREMIUM MODULE)
   ======================================================== */
.dyn-instructions-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #bae6fd;
  border-left: 5px solid #0284c7;
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.dyn-instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.dyn-instructions-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dyn-instructions-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: #0284c7;
  color: #ffffff;
}

.dyn-instructions-body {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.dyn-instructions-body p {
  margin-bottom: 0.4rem;
}

.dyn-instructions-es {
  color: #64748b;
  font-style: italic;
  font-size: 0.88rem;
}

.dyn-example-box {
  background: #ffffff;
  border: 1px dashed #38bdf8;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.86rem;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.dyn-example-tag {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.76rem;
  white-space: nowrap;
}

/* Question Cards Grid */
.dyn-questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dyn-question-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.dyn-question-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.dyn-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.dyn-card-num-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dyn-q-badge {
  background: #2563eb;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.dyn-category-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dyn-audio-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.dyn-audio-chip:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: scale(1.05);
}

/* REALISTIC SCHOOL SIGNS STYLING */
.dyn-sign-wrapper {
  margin: 0.5rem 0 1rem 0;
  display: flex;
  justify-content: center;
}

.school-sign-box {
  width: 100%;
  max-width: 290px;
  border-radius: 10px;
  border: 2.5px solid #0f172a;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  font-family: 'Inter', -apple-system, sans-serif;
  user-select: none;
  transition: transform 0.2s ease;
}

.school-sign-box:hover {
  transform: scale(1.02);
}

/* Sign 1: Library Two-Tone */
.sign-library {
  background: #ffffff;
}

.sign-library-top {
  background: #ffffff;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-bottom: 2.5px solid #0f172a;
}

.sign-library-top h3 {
  color: #dc2626;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin: 0;
  text-transform: uppercase;
}

.sign-library-bottom {
  background: #facc15;
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Sign 2: Cafeteria Yellow */
.sign-cafeteria {
  background: #facc15;
  padding: 0.9rem 1rem;
  border: 3px solid #0f172a;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sign-cafeteria-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.sign-cafeteria-text {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Sign 3: Phone Prohibition White */
.sign-phones {
  background: #ffffff;
  padding: 0.85rem 1rem;
  border: 2.5px solid #0f172a;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sign-phones-symbol {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #dc2626;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sign-phones-symbol::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background: #dc2626;
  transform: rotate(-45deg);
}

.sign-phones-symbol span {
  font-size: 1.4rem;
  line-height: 1;
}

.sign-phones-text {
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Sign 4: Bus Yellow */
.sign-bus {
  background: #facc15;
  padding: 0.85rem 1rem;
  border: 2.5px solid #0f172a;
  text-align: center;
}

.sign-bus-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.sign-bus-title {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sign-bus-time {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0.15rem 0;
  letter-spacing: -0.01em;
}

.sign-bus-alert {
  color: #b91c1c;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sign 5: Test Progress White */
.sign-test {
  background: #ffffff;
  padding: 0.85rem 1rem;
  border: 2.5px solid #0f172a;
  text-align: center;
}

.sign-test-symbol {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid #dc2626;
  margin: 0 auto 0.4rem auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sign-test-symbol::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background: #dc2626;
  transform: rotate(-45deg);
}

.sign-test-symbol span {
  font-size: 1.3rem;
  line-height: 1;
}

.sign-test-title {
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.25;
}

.sign-test-alert {
  color: #dc2626;
  font-size: 0.88rem;
  font-weight: 900;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Question Stem Text */
.dyn-question-prompt-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

/* Interactive Options */
.dyn-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.dyn-option-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  transition: all 0.18s ease;
  user-select: none;
}

.dyn-option-card:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
  transform: translateX(3px);
}

.dyn-option-card input[type="radio"] {
  accent-color: #2563eb;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.dyn-option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
  flex-shrink: 0;
}

.dyn-option-card.selected {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.dyn-option-card.selected .dyn-option-letter {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.dyn-option-card.correct {
  background: #f0fdf4 !important;
  border-color: #16a34a !important;
  color: #15803d !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25) !important;
}

.dyn-option-card.correct .dyn-option-letter {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.dyn-option-card.incorrect {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25) !important;
}

.dyn-option-card.incorrect .dyn-option-letter {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

/* Teacher Explanation Box */
.dyn-explanation-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: #166534;
  line-height: 1.45;
  margin-top: 0.5rem;
  animation: fadeInDown 0.25s ease;
}

.dyn-explanation-box strong {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 800;
  color: #15803d;
}

/* Part 1 Dedicated Action Bar */
.dyn-part1-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  margin-top: 1rem;
}

.dyn-part1-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dyn-progress-pill {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
}

.dyn-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.dyn-score-badge.success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.dyn-score-badge.warning {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.dyn-score-badge.danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.dyn-part1-btns {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-dyn-check {
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-dyn-check:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-dyn-reset {
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dyn-reset:hover {
  background: #f1f5f9;
  color: #1e293b;
  border-color: #94a3b8;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   MODO DINÁMICO: SECTION A PART 3 (WORD BANK INTERACTIVO)
   ======================================================== */
.dyn-wordbank-wrapper {
  margin-top: 1.5rem;
}

.dyn-wb-container {
  background: linear-gradient(145deg, #f8fafc 0%, #f0f9ff 100%);
  border: 2px solid #bae6fd;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
  margin-bottom: 1.25rem;
  transition: all 0.2s ease;
}

.dyn-wb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #cbd5e1;
}

.dyn-wb-title-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dyn-wb-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dyn-wb-counter-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #7dd3fc;
  border-radius: 12px;
}

.dyn-active-speaker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dyn-active-speaker.is-speaking {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 2px 8px rgba(37, 99, 235, 0.2);
  animation: speakerPulse 0.8s infinite alternate ease-in-out;
}

@keyframes speakerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.dyn-active-speaker .speaker-wave {
  font-size: 0.85rem;
}

.dyn-active-speaker .speaker-avatar {
  font-size: 1.05rem;
  line-height: 1;
}

.dyn-active-speaker .speaker-name {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.dyn-voice-selector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 0.4rem 0 0.75rem;
}

.dyn-voice-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #475569;
}

.dyn-voice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dyn-voice-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.dyn-voice-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.dyn-voice-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}

.dyn-wb-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0 0.35rem;
}

.dyn-wb-chip {
  background: #ffffff;
  border: 2px solid #38bdf8;
  color: #0369a1;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.14);
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dyn-wb-chip .chip-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.dyn-wb-chip .chip-word {
  font-size: 0.95rem;
  font-weight: 800;
}

.dyn-wb-chip .chip-audio-btn {
  font-size: 0.82rem;
  opacity: 0.6;
  padding: 1px 3px;
  border-radius: 4px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.dyn-wb-chip:hover .chip-audio-btn {
  opacity: 1;
}

.dyn-wb-chip .chip-audio-btn:hover {
  background: rgba(2, 132, 199, 0.18);
  transform: scale(1.2);
}

.dyn-wb-chip:hover:not(.is-used) {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0c4a6e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.24);
}

.dyn-wb-chip:active:not(.is-used) {
  cursor: grabbing;
  transform: scale(0.96);
}

.dyn-wb-chip.is-selected {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0369a1 !important;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.35), 0 4px 12px rgba(2, 132, 199, 0.25) !important;
  transform: translateY(-2px) scale(1.05);
  animation: pulseChip 1.4s infinite alternate;
}

.dyn-wb-chip.is-used {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  text-decoration: line-through;
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.dyn-gap-text-box {
  background: white;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  line-height: 2.9;
  font-size: 1.05rem;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.dyn-story-card-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 9px;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #166534;
  line-height: 1.5;
}

.dyn-story-icon {
  font-size: 1.2rem;
}

.dyn-story-title {
  color: #14532d;
  font-size: 0.95rem;
}

.dyn-story-hint {
  color: #15803d;
  font-size: 0.82rem;
  margin-left: auto;
}

.dyn-story-body {
  line-height: 2.9;
  font-size: 1.05rem;
}

.dyn-gap-num {
  font-weight: 800;
  color: #2563eb;
  margin-right: 2px;
  user-select: none;
}

.dyn-gap-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 34px;
  border: 2px dashed #93c5fd;
  border-radius: 9px;
  background: #f8fafc;
  vertical-align: middle;
  margin: 0 4px;
  padding: 0 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 800;
  color: #0284c7;
  font-size: 0.95rem;
  user-select: none;
  box-sizing: border-box;
  gap: 4px;
}

.dyn-gap-target:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.dyn-gap-target.drag-over {
  background: #bae6fd !important;
  border-color: #0284c7 !important;
  border-style: solid;
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.35);
}

.dyn-gap-target.is-filled {
  border-style: solid;
  border-color: #38bdf8;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.15);
}

.dyn-gap-target.is-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.dyn-gap-target.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.dyn-gap-target .slot-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.dyn-gap-target .slot-word {
  font-size: 0.95rem;
  font-weight: 800;
}

.dyn-gap-target .slot-audio-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.8rem;
  opacity: 0.65;
  transition: all 0.15s ease;
}

.dyn-gap-target .slot-audio-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.dyn-gap-target .gap-remove-btn {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
  border: none;
  font-size: 9px;
  font-weight: 900;
  cursor: pointer;
  margin-left: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.12s ease;
}

.dyn-gap-target .gap-remove-btn:hover {
  background: #ef4444;
  color: white;
}

/* ========================================================
   MODO DINÁMICO: SECTION B PART 1 (SHORT DIALOGUES - PURE VISUAL)
   ======================================================== */
.dyn-visual-q-card {
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  margin-bottom: 1.5rem;
}

.dyn-visual-q-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.dyn-visual-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.dyn-visual-q-prompt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #1e293b;
}

.dyn-visual-q-num {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.dyn-visual-choices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 0.5rem;
}

@media (max-width: 680px) {
  .dyn-visual-choices-grid {
    grid-template-columns: 1fr;
  }
}

.dyn-visual-choice-card {
  position: relative;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  overflow: hidden;
}

.dyn-visual-choice-card:hover {
  transform: translateY(-3px);
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 6px 16px rgba(3, 105, 161, 0.12);
}

.dyn-visual-choice-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), 0 6px 18px rgba(37, 99, 235, 0.15);
  transform: translateY(-3px);
}

.dyn-visual-choice-card.correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
}

.dyn-visual-choice-card.incorrect {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  opacity: 0.75;
}

.school-sign-img {
  width: auto;
  max-width: 100%;
  max-height: 210px;
  border-radius: 10px;
  border: 2px solid #0f172a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  object-fit: contain;
}

.school-sign-img:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.dyn-visual-img-wrap {
  width: 100%;
  height: 195px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  padding: 6px;
  box-sizing: border-box;
  overflow: hidden;
}

.dyn-visual-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.dyn-visual-choice-card:hover .dyn-visual-img-wrap img {
  transform: scale(1.04);
}

.dyn-visual-badge {
  margin-top: 0.65rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-weight: 900;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.dyn-visual-choice-card:hover .dyn-visual-badge {
  background: #bae6fd;
  color: #0284c7;
}

.dyn-visual-choice-card.selected .dyn-visual-badge {
  background: #2563eb;
  color: white;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.dyn-visual-choice-card.correct .dyn-visual-badge {
  background: #10b981;
  color: white;
}

.dyn-visual-choice-card.incorrect .dyn-visual-badge {
  background: #ef4444;
  color: white;
}

/* ========================================================
   MODO DINÁMICO: BARRA INFERIOR Y BANNER "CON MANZANITAS"
   ======================================================== */
.dyn-bottom-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 0.85rem 1.25rem;
  margin: 2.25rem 0 1rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.btn-dyn-nav-prev, .btn-dyn-nav-next {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
  color: #1e293b;
}

.btn-dyn-nav-prev:hover:not(:disabled), .btn-dyn-nav-next:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.btn-dyn-nav-prev:disabled, .btn-dyn-nav-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.nav-btn-text {
  display: flex;
  flex-direction: column;
}

.nav-btn-sub {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-btn-main {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}

.dyn-nav-center-guide {
  text-align: center;
  flex: 1;
}

.guide-apple-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 2px 10px;
  border-radius: 9999px;
  margin-bottom: 0.25rem;
}

.guide-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.guide-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.dyn-finish-cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.dyn-finish-cta-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 260px;
}

.dyn-finish-apple {
  font-size: 2.2rem;
  line-height: 1;
}

.dyn-finish-cta-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #14532d;
  margin: 0 0 0.25rem 0;
}

.dyn-finish-cta-desc {
  font-size: 0.88rem;
  color: #166534;
  margin: 0;
  line-height: 1.4;
}

.btn-dyn-cta-advance {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #16a34a;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.35);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-dyn-cta-advance:hover {
  background: #15803d;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.btn-dyn-cta-advance:active {
  transform: scale(0.98);
}

.btn-dyn-cta-advance .cta-arrow {
  font-size: 1.15rem;
  transition: transform 0.15s ease;
}

.btn-dyn-cta-advance:hover .cta-arrow {
  transform: translateX(4px);
}

/* ========================================================
   SESSION 1: VOCABULARY & WARM-UP (PÁGINAS 8 Y 9)
   ======================================================== */

/* Part 1: Icebreaker Card & Grid */
.s1-icebreaker-card {
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.s1-icebreaker-counter .icebreaker-badge {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.s1-icebreaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.s1-interview-card {
  background: #ffffff;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s ease;
}

.s1-interview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
}

.s1-interview-card.is-filled {
  border-color: #10b981;
  background: #f0fdf4;
}

.s1-interview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.s1-interview-icon {
  font-size: 1.9rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.s1-interview-card.is-filled .s1-interview-icon {
  background: #dcfce7;
}

.s1-interview-meta {
  flex: 1;
  min-width: 0;
}

.s1-interview-num {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #b45309;
  letter-spacing: 0.5px;
}

.s1-interview-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e293b;
  margin: 1px 0 0;
  line-height: 1.3;
}

.s1-speak-q-btn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.s1-speak-q-btn:hover {
  background: #fde68a;
  color: #78350f;
  transform: scale(1.03);
}

.s1-interview-qbubble {
  background: #fffbeb;
  border: 1px dashed #fcd34d;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.35;
}

.s1-interview-input-wrap {
  display: flex;
  gap: 6px;
  align-items: center;
}

.s1-interview-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #ffffff;
}

.s1-interview-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.s1-sim-btn {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.s1-sim-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.s1-interview-status {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.s1-interview-card.is-filled .s1-interview-status {
  color: #15803d;
}

.s1-icebreaker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #fde68a;
  flex-wrap: wrap;
}

.s1-icebreaker-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Part 2: Task 1 Vocabulary Cards & Studio */
.s1-filter-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.25rem 0 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.s1-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.s1-filter-btn {
  background: #f8fafc;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.s1-filter-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.s1-filter-btn.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.s1-cards-counter-pill {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid #ddd6fe;
}

.s1-active-chip-banner {
  background: #ede9fe;
  border: 1.5px solid #c4b5fd;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #5b21b6;
  font-size: 0.88rem;
}

.s1-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.s1-routine-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.s1-routine-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.s1-routine-card.is-correct {
  border-color: #10b981;
  background: #f0fdf4;
}

.s1-routine-card.is-incorrect {
  border-color: #ef4444;
  background: #fef2f2;
}

.s1-card-img-container {
  position: relative;
  height: 160px;
  background: #f1f5f9;
  overflow: hidden;
}

.s1-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.s1-routine-card:hover .s1-card-img {
  transform: scale(1.04);
}

.s1-card-num-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 2;
}

.s1-card-sound-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.15s ease;
  z-index: 2;
}

.s1-card-sound-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.s1-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.s1-card-drop-slot {
  min-height: 48px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  background: #fafafa;
  transition: all 0.2s ease;
}

.s1-card-drop-slot:hover {
  border-color: #8b5cf6;
  background: #faf5ff;
}

.s1-card-drop-slot.drag-over {
  border-color: #7c3aed;
  background: #ede9fe;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.s1-slot-placeholder {
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  user-select: none;
}

.s1-card-filled-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #c4b5fd;
  gap: 6px;
}

.s1-card-filled-chip .chip-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s1-chip-remove-btn {
  background: none;
  border: none;
  color: #7c3aed;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0 2px;
  line-height: 1;
}

.s1-chip-remove-btn:hover {
  color: #dc2626;
}

.s1-card-feedback-badge {
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.s1-card-feedback-badge.correct {
  color: #15803d;
}

.s1-card-feedback-badge.incorrect {
  color: #b91c1c;
}

/* Part 3: Task 2 Categorization Pool & Board */
.s1-cat-pool-container {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.s1-cat-pool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.s1-cat-pool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}

.s1-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
  user-select: none;
}

.s1-cat-chip:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.s1-cat-chip.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.s1-cat-chip.is-correct {
  border-color: #10b981;
  background: #dcfce7;
  color: #14532d;
}

.s1-cat-chip.is-incorrect {
  border-color: #ef4444;
  background: #fee2e2;
  color: #7f1d1d;
}

.s1-cat-chip-remove {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  padding-left: 2px;
}

.s1-cat-chip-remove:hover {
  color: #dc2626;
}

.s1-cat-progress-badge span {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid #ddd6fe;
}

/* Footer & Scoring */
.s1-action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.s1-score-box {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.s1-score-box.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.s1-score-box.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* ========================================================
   CALIBRATOR HUD: ASPECT RATIO LOCK & AUTO-PX INDICATOR
   ======================================================== */
.hud-aspect-lock-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  cursor: pointer;
  padding: 1px 7px;
  font-size: 0.78rem;
  line-height: 1.2;
  color: #e2e8f0;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-aspect-lock-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #60a5fa;
  transform: scale(1.05);
}

.hud-aspect-lock-btn.locked {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  color: #a7f3d0;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.hud-aspect-lock-btn.unlocked {
  background: rgba(239, 68, 68, 0.25);
  border-color: #f87171;
  color: #fca5a5;
}

.hud-auto-px-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  border-radius: 6px;
  padding: 5px 8px;
  margin-top: 3px;
}

.hud-lock-pill {
  background: #059669;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.hud-auto-px-text {
  font-size: 0.72rem;
  color: #a7f3d0;
  line-height: 1.25;
}

/* ========================================================
   SESSION 2 DYNAMIC MODE: CHARADES, PHOTOS & SORTER
   ======================================================== */

/* 1. Mime the Action (Charades) */
.s2-charades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.s2-charade-card {
  background: #ffffff;
  border: 2px solid #e9d5ff;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(147, 51, 234, 0.06);
}

.s2-charade-card:hover {
  border-color: #c084fc;
  box-shadow: 0 6px 16px rgba(147, 51, 234, 0.12);
}

.s2-charade-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.s2-charade-avatar {
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #faf5ff;
  border-radius: 10px;
  border: 1px solid #f3e8ff;
  flex-shrink: 0;
}

.s2-charade-info {
  flex: 1;
}

.s2-charade-tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #9333ea;
  letter-spacing: 0.05em;
}

.s2-charade-clue {
  font-size: 0.84rem;
  color: #334155;
  font-style: italic;
  margin: 0.15rem 0 0 0;
  line-height: 1.3;
}

.s2-charade-prompt {
  font-size: 0.88rem;
  color: #581c87;
  padding: 0.35rem 0.6rem;
  background: #fdf4ff;
  border-radius: 6px;
  border-left: 3px solid #c084fc;
}

.s2-charade-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.s2-opt-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.s2-opt-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #a855f7;
  color: #6b21a8;
  transform: translateX(3px);
}

.s2-opt-btn.correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  font-weight: 700;
}

.s2-opt-btn.wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
  opacity: 0.85;
}

.s2-charade-feedback {
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1.2rem;
}

/* 2. Photo Studio Match (Task 1) */
.s2-vocab-box-rack {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.s2-vocab-box-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.86rem;
  color: #1e293b;
}

.s2-vocab-box-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.s2-vocab-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
  user-select: none;
}

.s2-vocab-chip:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.s2-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.s2-photo-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.s2-photo-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.1);
}

.s2-photo-card.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.s2-photo-card.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.s2-photo-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s2-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.s2-photo-card:hover .s2-photo-img {
  transform: scale(1.03);
}

.s2-photo-num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.s2-photo-speak-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  padding: 4px 9px;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
}

.s2-photo-speak-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.s2-photo-body {
  padding: 0.85rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.s2-photo-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.s2-photo-select {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  background-color: #ffffff;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.s2-photo-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.s2-photo-status {
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1.2rem;
}

/* 3. Sorter: Actions vs Things (Task 2) */
.s2-sorter-pool-wrap {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.s2-sorter-pool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.s2-sorter-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 48px;
  padding: 6px;
  border-radius: 8px;
  background: #f8fafc;
}

.s2-sort-chip {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 24px;
  padding: 5px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.s2-sort-chip:hover {
  border-color: #3b82f6;
  color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.s2-sort-chip.is-correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
  color: #15803d !important;
}

.s2-sort-chip.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.s2-chip-speak-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.s2-chip-speak-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

.s2-chip-del-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1;
  color: #94a3b8;
  margin-left: 2px;
  transition: color 0.15s ease;
}

.s2-chip-del-btn:hover {
  color: #ef4444;
}

.s2-sorter-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .s2-sorter-columns-grid {
    grid-template-columns: 1fr;
  }
}

.s2-sorter-col {
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.s2-sorter-col.actions {
  border-color: #86efac;
  background: #f0fdf4;
}

.s2-sorter-col.things {
  border-color: #93c5fd;
  background: #eff6ff;
}

.s2-sorter-col.drag-over {
  border-style: solid;
  transform: scale(1.01);
}

.s2-sorter-col.actions.drag-over {
  background: #dcfce7;
  border-color: #16a34a;
}

.s2-sorter-col.things.drag-over {
  background: #dbeafe;
  border-color: #2563eb;
}

.s2-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.s2-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.s2-col-icon {
  font-size: 1.5rem;
}

.s2-col-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.s2-col-subtitle {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
}

.s2-col-counter {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.1);
  color: #1e293b;
}

.s2-col-dropzone {
  min-height: 180px;
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  background: rgba(255,255,255,0.6);
}

.s2-drop-placeholder {
  width: 100%;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: auto 0;
  padding: 2rem 1rem;
  pointer-events: none;
}

/* ========================================================
   SESSION 2: LISTENING & READING EXTENSIONS (PÁGS. 17 Y 18)
   ======================================================== */

/* Quick Navigation Anchor Bar for Session 2 */
.s2-quick-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.s2-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  background: white;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.s2-nav-pill:hover, .s2-nav-pill.active {
  background: #1e3a8a;
  color: white;
  border-color: #1e3a8a;
}

/* Listening Track 07 Player Studio */
.s2-listen-player {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.2);
}

.s2-listen-player-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.s2-listen-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.s2-player-btn-main {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3b82f6;
  border: none;
  color: white;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.s2-player-btn-main:hover {
  background: #2563eb;
  transform: scale(1.06);
}

.s2-listen-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  color: #f8fafc;
}

.s2-listen-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.s2-listen-ctrls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.s2-speed-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.s2-speed-btn.active, .s2-speed-btn:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Individual Speaker Triggers */
.s2-speaker-pills-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  flex-wrap: wrap;
  align-items: center;
}

.s2-speaker-pill-label {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 700;
  margin-right: 0.25rem;
}

.s2-speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.s2-speaker-chip:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #60a5fa;
  color: white;
}

.s2-speaker-chip.playing {
  background: #2563eb;
  border-color: #93c5fd;
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

/* Gallery of 5 Pictures (A-E) */
.s2-listen-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.s2-gallery-card {
  background: white;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.s2-gallery-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.s2-gallery-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f5f9;
}

.s2-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.s2-gallery-card:hover .s2-gallery-img {
  transform: scale(1.04);
}

.s2-gallery-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1e3a8a;
  color: white;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.s2-gallery-info {
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.s2-gallery-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
}

.s2-gallery-speak-btn {
  background: #e2e8f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.s2-gallery-speak-btn:hover {
  background: #3b82f6;
  color: white;
}

/* Match People 1-5 Grid */
.s2-people-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.s2-person-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.s2-person-item.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.s2-person-item.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.s2-person-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e3a8a;
  min-width: 75px;
}

.s2-person-speak-btn {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.s2-person-speak-btn:hover {
  background: #2563eb;
  color: white;
}

.s2-person-select {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: white;
  font-weight: 700;
  color: #1e293b;
  font-size: 0.85rem;
  cursor: pointer;
}

.s2-person-status {
  font-size: 0.85rem;
  min-width: 24px;
  text-align: center;
}

/* Task 2 Listening Gap-fills */
.s2-listen-gaps-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.s2-listen-gap-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  background: white;
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #1e293b;
  transition: all 0.2s ease;
}

.s2-listen-gap-row.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.s2-listen-gap-row.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.s2-gap-num {
  font-weight: 800;
  color: #2563eb;
}

.s2-inline-input {
  border: 2px solid #94a3b8;
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  background: #f8fafc;
  font-size: 0.92rem;
  transition: border-color 0.15s;
}

.s2-inline-input:focus {
  outline: none;
  border-color: #2563eb;
  background: white;
}

.s2-gap-speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  opacity: 0.75;
  transition: opacity 0.15s;
  margin-left: auto;
}

.s2-gap-speak-btn:hover {
  opacity: 1;
}

/* AI Speaking Coach Studio for Session 2 */
.s2-speaking-coach-card {
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
  border: 2px solid #99f6e4;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.s2-coach-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.s2-coach-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0d9488;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.s2-coach-selector-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.s2-coach-phrase-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: white;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.s2-coach-phrase-btn.active {
  background: #0d9488;
  color: white;
  border-color: #0d9488;
}

.s2-coach-target-box {
  background: white;
  border: 2px dashed #0d9488;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.s2-coach-target-phrase {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f766e;
  margin-bottom: 0.35rem;
}

.s2-coach-target-sub {
  font-size: 0.82rem;
  color: #64748b;
}

.s2-coach-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.s2-mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #0d9488;
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
  transition: all 0.2s ease;
}

.s2-mic-btn:hover {
  background: #0f766e;
  transform: translateY(-2px);
}

.s2-mic-btn.recording {
  background: #ef4444;
  animation: s2-pulse-ring 1.5s infinite;
}

@keyframes s2-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.s2-coach-result-card {
  background: white;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  padding: 0.85rem 1.15rem;
  text-align: center;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ========================================================
   READING: A RAINY AFTERNOON (PÁGINA 18) STYLES
   ======================================================== */

.s2-read-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
}

@media (max-width: 860px) {
  .s2-read-hero-grid {
    grid-template-columns: 1fr;
  }
}

.s2-read-img-card {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #cbd5e1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  position: relative;
  background: #0f172a;
}

.s2-read-img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 440px;
}

.s2-read-img-overlay-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: white;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.35;
}

.s2-story-passage-box {
  background: #ffffff;
  border: 2px solid #fed7aa;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(251, 146, 60, 0.08);
}

.s2-story-passage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #fed7aa;
}

.s2-story-text {
  font-size: 1.05rem;
  line-height: 1.95;
  color: #334155;
}

.s2-story-sentence {
  display: inline;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.s2-story-sentence:hover {
  background: #fef08a;
  color: #854d0e;
}

.s2-story-sentence.active-speaking {
  background: #fde047;
  color: #713f12;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
}

/* Task 1 Main Idea Quiz Cards */
.s2-topic-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.s2-topic-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.s2-topic-card:hover {
  border-color: #f97316;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.12);
}

.s2-topic-card.selected {
  border-color: #f97316;
  background: #fff7ed;
}

.s2-topic-card.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.s2-topic-card.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.s2-topic-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.s2-topic-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

/* Task 2 Characters Matcher */
.s2-char-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.s2-char-match-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 0.85rem 1.15rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  transition: all 0.2s ease;
}

@media (max-width: 640px) {
  .s2-char-match-row {
    grid-template-columns: 1fr;
  }
}

.s2-char-match-row.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.s2-char-match-row.is-wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.s2-char-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
}

.s2-char-avatar {
  font-size: 1.35rem;
}

.s2-char-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: white;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
}

.s2-char-status {
  min-width: 24px;
  text-align: center;
  font-size: 1rem;
}






/* ========================================================
   PAGE 18: INTERACTIVE LINE MATCHING ("CONNECT THE DOTS")
   ======================================================== */
.p18-lines-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 24;
}

.p18-lines-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.p18-match-line {
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
  cursor: pointer;
  pointer-events: stroke;
  transition: stroke 0.25s ease, stroke-width 0.15s ease;
}

.p18-match-line:hover {
  stroke-width: 6 !important;
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.5));
}

.p18-rubberband-line {
  stroke-dasharray: 6 4;
  animation: p18Dash 0.8s linear infinite;
  pointer-events: none;
}

@keyframes p18Dash {
  to { stroke-dashoffset: -20; }
}

.p18-connector-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  cursor: pointer;
  pointer-events: auto;
  z-index: 26;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  -webkit-user-select: none;
}

.p18-connector-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563eb;
  transition: all 0.2s ease;
}

.p18-connector-dot:hover {
  transform: translate(-50%, -50%) scale(1.3);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
  border-color: #1d4ed8;
}

.p18-connector-dot.is-active {
  transform: translate(-50%, -50%) scale(1.35);
  background: #2563eb;
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.35), 0 4px 12px rgba(37, 99, 235, 0.4);
  animation: p18Pulse 1.2s infinite alternate;
}

.p18-connector-dot.is-active::after {
  background: #ffffff;
  transform: scale(1.2);
}

.p18-connector-dot.is-connected {
  border-color: #059669;
}

.p18-connector-dot.is-connected::after {
  background: #059669;
}

@keyframes p18Pulse {
  0% { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4); }
  100% { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.1); }
}

.p18-line-del-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #ef4444;
  color: #ef4444;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  z-index: 27;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: all 0.15s ease;
  line-height: 1;
}

.p18-line-del-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: translate(-50%, -50%) scale(1.2);
}

.p18-tip-banner {
  position: absolute;
  top: 55.4%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 246, 255, 0.95);
  border: 1.5px solid #93c5fd;
  color: #1e40af;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  pointer-events: auto;
  z-index: 25;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Calibrator Duplicate and Copy-Paste Buttons */
.btn-hud-duplicate,
.btn-hud-copy-el,
.btn-hud-paste-el {
  transition: all 0.15s ease;
}
.btn-hud-duplicate:hover {
  background: #dbeafe !important;
  border-color: #3b82f6 !important;
  transform: translateY(-1px);
}
.btn-hud-copy-el:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  transform: translateY(-1px);
}
.btn-hud-paste-el:hover {
  background: #d1fae5 !important;
  border-color: #10b981 !important;
  transform: translateY(-1px);
}
/* Calibrator active element highlight */
.calibrator-active {
  outline: 2px solid #ff9800;
  outline-offset: 2px;
}
.adjust-selected {
  outline: 2px solid #ff9800;
  outline-offset: 2px;
}


/* ========================================================
   GROW TOGETHER STUDIO V3.0 — ENTERPRISE GRAPHITE & DAYLIGHT
   (Pearson ActiveBook / Richmond i-book / McGraw-Hill Connect)
   ======================================================== */

/* 1. Studio Theme Tokens (Graphite Dark Studio Default + Classroom Daylight) */
body[data-studio-theme="graphite"] {
  --studio-bg: #0b1120;
  --studio-surface: rgba(15, 23, 42, 0.92);
  --studio-card: #1e293b;
  --studio-border: rgba(255, 255, 255, 0.10);
  --studio-text: #f8fafc;
  --studio-muted: #94a3b8;
  --studio-page-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0b1120 75%) !important;
  color: #f8fafc;
}

body[data-studio-theme="daylight"] {
  --studio-bg: #e2e8f0;
  --studio-surface: rgba(255, 255, 255, 0.96);
  --studio-card: #ffffff;
  --studio-border: #cbd5e1;
  --studio-text: #0f172a;
  --studio-muted: #475569;
  --studio-page-shadow: 0 18px 42px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
  background: #e2e8f0 !important;
  color: #0f172a;
}

/* Studio Theme Toggle Button in Header */
.studio-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.studio-theme-btn:hover {
  background: #2563eb;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

/* Graphite Studio Chrome Overrides */
body[data-studio-theme="graphite"] .app-header {
  background: rgba(15, 23, 42, 0.94) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

body[data-studio-theme="graphite"] .brand-title {
  color: #f8fafc !important;
}

body[data-studio-theme="graphite"] .brand-subtitle {
  color: #94a3b8 !important;
}

body[data-studio-theme="graphite"] .module-nav-bar {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body[data-studio-theme="graphite"] .step-tab {
  background: rgba(30, 41, 59, 0.85);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.10);
}

body[data-studio-theme="graphite"] .step-tab:hover {
  background: rgba(51, 65, 85, 0.95);
  color: #ffffff;
}

body[data-studio-theme="graphite"] .step-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

body[data-studio-theme="graphite"] .book-reader-col {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body[data-studio-theme="graphite"] .reader-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

body[data-studio-theme="graphite"] .page-indicator-pill {
  color: #f8fafc;
}

body[data-studio-theme="graphite"] .quick-page-input {
  background: #1e293b;
  color: #f8fafc;
  border-color: #475569;
}

body[data-studio-theme="graphite"] .reader-nav-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

body[data-studio-theme="graphite"] .zoom-controls,
body[data-studio-theme="graphite"] .view-mode-toggles {
  background: #1e293b;
  border-color: #334155;
}

body[data-studio-theme="graphite"] .zoom-btn,
body[data-studio-theme="graphite"] .zoom-label,
body[data-studio-theme="graphite"] .view-toggle-btn {
  color: #cbd5e1;
}

body[data-studio-theme="graphite"] .zoom-preset-btn {
  background: #0f172a;
  color: #94a3b8;
}

body[data-studio-theme="graphite"] .zoom-preset-btn.active,
body[data-studio-theme="graphite"] .view-toggle-btn.active {
  background: #2563eb;
  color: #ffffff;
}

body[data-studio-theme="graphite"] .faithful-bottom-nav-bar {
  background: rgba(15, 23, 42, 0.90);
  border-color: rgba(255, 255, 255, 0.10);
}

/* 2. Precision Textbook Canvas (Exact PDF TrimBox Aspect Ratio) */
.book-page-canvas {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 595.2754 / 765.3544;
  background: #ffffff;
  box-shadow: var(--studio-page-shadow, 0 18px 42px rgba(15, 23, 42, 0.22));
  border-radius: 6px;
  overflow: hidden;
}

.book-page-canvas > img.book-page-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* 3. Pure Top-Left Vector Coordinates (ZERO translate(-50%, -50%), ZERO oval distortion) */
.onpage-interactive-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

.fld {
  position: absolute;
  transform: none !important;
  box-sizing: border-box;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: auto !important;
  z-index: 26;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3A. Inline Text Inputs & Textareas (Write directly on textbook lines) */
.gt-inline-input {
  pointer-events: auto !important;
  cursor: text;
  user-select: text !important;
  -webkit-user-select: text !important;
  padding: 0 0.45cqw;
  border: 1px solid transparent;
  border-bottom: 2px dashed rgba(37, 99, 235, 0.55);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  color: #1e3a8a;
  font-weight: 700;
  font-size: clamp(10px, 1.45cqw, 18px);
  line-height: 1.15;
  text-align: left;
  outline: none;
}

.gt-inline-input::placeholder {
  color: rgba(37, 99, 235, 0.42);
  font-weight: 500;
  font-size: clamp(9px, 1.15cqw, 14px);
}

.gt-inline-input:hover {
  background: rgba(255, 255, 255, 0.90);
  border-color: rgba(37, 99, 235, 0.45);
  border-bottom: 2px solid #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  z-index: 25;
}

.gt-inline-input:focus {
  background: #ffffff;
  border: 1.5px solid #2563eb;
  border-bottom: 2.5px solid #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25), 0 0 0 3px rgba(37, 99, 235, 0.15);
  z-index: 35;
}

.gt-inline-input.filled {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 2px solid #1e3a8a;
  color: #0f172a;
}

.fld-textarea.gt-inline-input {
  padding: 0.4cqw 0.6cqw;
  border: 1.5px dashed rgba(37, 99, 235, 0.55);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  color: #1e3a8a;
  font-weight: 600;
  font-size: clamp(10px, 1.25cqw, 15px);
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
}

.fld-textarea.gt-inline-input:hover {
  background: rgba(255, 255, 255, 0.90);
  border: 1.5px solid #2563eb;
}

.fld-textarea.gt-inline-input:focus {
  background: #ffffff;
  border: 2px solid #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
  z-index: 35;
}

.fld-textarea.gt-inline-input.filled {
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid #1e3a8a;
  color: #0f172a;
}

/* 3B. Inline Select Dropdowns */
.gt-inline-select {
  padding: 0 0.35cqw;
  border: 1.5px solid rgba(37, 99, 235, 0.55);
  border-bottom: 2px solid #2563eb;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.90);
  color: #1e3a8a;
  font-weight: 700;
  font-size: clamp(9.5px, 1.32cqw, 16px);
  cursor: pointer;
  outline: none;
}

.gt-inline-select:hover,
.gt-inline-select:focus {
  background: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
  z-index: 30;
}

.gt-inline-select.filled {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1e3a8a;
}

/* 3C. Multiple Choice Zones (NO blue ovals! Clean Cambridge/Pearson line & card highlights) */
.fld-choice-line {
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 6px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.fld-choice-line:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.40);
}

.fld-choice-line .gt-choice-indicator {
  width: clamp(14px, 2.0cqw, 22px);
  height: clamp(14px, 2.0cqw, 22px);
  border-radius: 50%;
  border: 1.5px solid rgba(37, 99, 235, 0.45);
  background: rgba(255, 255, 255, 0.75);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(9px, 1.25cqw, 14px);
  font-weight: 900;
  margin-left: -0.3cqw;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.fld-choice-line:hover .gt-choice-indicator {
  border-color: #2563eb;
  transform: scale(1.08);
}

.fld-choice-line.filled {
  background: rgba(37, 99, 235, 0.11);
  border: 1.5px solid #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.fld-choice-line.filled .gt-choice-indicator {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Image Card Choice (Pages 5, 6, 7 picture cards) */
.fld-choice-card {
  background: transparent;
  border: 2px dashed transparent;
  border-radius: 10px !important;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5cqw;
}

.fld-choice-card:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.55);
}

.fld-choice-card .gt-choice-indicator {
  width: clamp(18px, 2.5cqw, 26px);
  height: clamp(18px, 2.5cqw, 26px);
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.5);
  background: rgba(255, 255, 255, 0.9);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(10px, 1.4cqw, 16px);
  font-weight: 900;
}

.fld-choice-card.filled {
  background: rgba(37, 99, 235, 0.12);
  border: 2.5px solid #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.fld-choice-card.filled .gt-choice-indicator {
  background: #2563eb;
  border-color: #ffffff;
  color: #ffffff;
}

/* Small circular/checkbox badges (Pages 10, 18, 44, 53) */
.fld-choice-badge,
.fld-checkbox,
.fld-match {
  padding: 0;
  border: 1.5px solid rgba(37, 99, 235, 0.65);
  background: rgba(255, 255, 255, 0.80);
  color: #1e3a8a;
  font-size: clamp(10px, 1.5cqw, 16px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fld-choice-badge,
.fld-match {
  border-radius: 50% !important;
}

.fld-checkbox {
  border-radius: 5px !important;
}

.fld-choice-badge.filled,
.fld-checkbox.filled {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.fld-match.filled {
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}

/* 3D. Word Bank Slots on Page */
.fld-slot {
  padding: 0 0.4cqw;
  border: 1.5px dashed rgba(37, 99, 235, 0.55);
  border-bottom: 2px solid #2563eb;
  border-radius: 5px;
  background: rgba(239, 246, 255, 0.65);
  color: #1e3a8a;
  font-weight: 700;
  font-size: clamp(9.5px, 1.38cqw, 17px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fld-slot:hover {
  background: rgba(219, 234, 254, 0.92);
  border-style: solid;
}

.fld-slot.filled {
  background: #ffffff;
  border: 1.5px solid #2563eb;
  color: #1e3a8a;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.16);
}

/* 4. Grading Feedback States (OK / BAD) */
.gt-inline-input.ok,
.gt-inline-select.ok,
.fld-slot.ok {
  background: rgba(220, 252, 231, 0.95) !important;
  border-color: #16a34a !important;
  color: #15803d !important;
  animation: edtechSuccessBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gt-inline-input.bad,
.gt-inline-select.bad,
.fld-slot.bad {
  background: rgba(254, 226, 226, 0.95) !important;
  border-color: #dc2626 !important;
  color: #b91c1c !important;
  animation: edtechGentleWobble 0.4s ease-in-out;
}

.fld-choice-line.ok,
.fld-choice-card.ok {
  background: rgba(22, 163, 74, 0.14) !important;
  border-color: #16a34a !important;
}

.fld-choice-line.ok .gt-choice-indicator,
.fld-choice-card.ok .gt-choice-indicator,
.fld-choice-badge.ok,
.fld-checkbox.ok,
.fld-match.ok {
  background: #16a34a !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.fld-choice-line.bad,
.fld-choice-card.bad {
  background: rgba(220, 38, 38, 0.12) !important;
  border-color: #dc2626 !important;
}

.fld-choice-line.bad .gt-choice-indicator,
.fld-choice-card.bad .gt-choice-indicator,
.fld-choice-badge.bad,
.fld-checkbox.bad,
.fld-match.bad {
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #ffffff !important;
}

.fld-match.selected,
.fld-slot.selected {
  outline: 2px solid #f59e0b;
  outline-offset: 1px;
  background: rgba(251, 191, 36, 0.25);
}

.book-page-canvas.armed .fld-slot:not(.filled) {
  animation: fldPulse 1.1s ease-in-out infinite;
}

.fld-slot.drop-target {
  outline: 2px solid #16a34a;
  background: rgba(34, 197, 94, 0.25);
}

@keyframes fldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); }
  60% { box-shadow: 0 0 0 .8cqw rgba(245, 158, 11, 0); }
}

.fld.flash {
  animation: fldFlash .9s ease 2;
}

@keyframes fldFlash {
  50% {
    box-shadow: 0 0 0 0.8cqw rgba(37, 99, 235, .55);
    background: rgba(251, 191, 36, .38);
  }
}

.book-page-canvas.clean-page-mode .fld {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* 5. Compact Editorial Smart Media Cards (Top-Left Anchored, Non-Invasive) */
.smart-media-card {
  transform: none !important;
  max-width: 24%;
  min-width: 155px;
  padding: 6px 9px !important;
  border-radius: 10px !important;
}

/* 6. Focus Studio Deck (Synchronized Interactive Mode Cards) */
.focus-studio-deck {
  margin-bottom: 1.5rem;
}

.focus-deck-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body[data-studio-theme="graphite"] .focus-deck-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.focus-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  margin-bottom: 1rem;
}

.focus-deck-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  padding: 3px 10px;
  border-radius: 999px;
}

.focus-deck-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.25rem 0 0;
}

.focus-deck-actions {
  display: flex;
  gap: 0.5rem;
}

.focus-deck-media-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.focus-media-pill {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.focus-deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.focus-item-card {
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

body[data-studio-theme="graphite"] .focus-item-card {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.10);
}

.focus-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.focus-item-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: inherit;
}

.focus-speak-btn {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.focus-input-control,
.focus-select-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid #94a3b8;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  box-sizing: border-box;
}

.focus-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.focus-choice-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.focus-choice-btn.selected {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.18);
}

.focus-choice-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #3b82f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* Next Blank Buttons (Toolbar + Floating Action Bar) */
.btn-next-blank {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border: 1.5px solid #93c5fd;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-next-blank:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-next-blank-bar {
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-next-blank-bar:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* Word bank dock (sticky at bottom of reader column, always reachable, 44px touch targets) */
.faithful-bank-dock {
  position: sticky;
  bottom: 3.8rem;
  z-index: 95;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #cbd5e1;
  border-top: 3px solid #2563eb;
  border-radius: 14px;
  padding: 10px 14px 12px;
  margin-top: 0.65rem;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12), 0 4px 14px rgba(15, 23, 42, 0.08);
}

body.editing-faithful .faithful-bank-dock {
  display: none !important;
}

body.editing-faithful .book-reader-col {
  padding-bottom: 42vh;
}

.faithful-bank-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.faithful-bank-title {
  font-size: 0.95rem;
  color: #1e3a8a;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.faithful-bank-hint {
  color: #475569;
  font-size: 13.5px;
  font-weight: 600;
  flex: 1;
  min-width: 150px;
}

.btn-bank-clear {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-bank-clear:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.faithful-bank-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 28vh;
  overflow-y: auto;
  padding: 2px;
}

.faithful-chip {
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid #2563eb;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
  color: #1e3a8a;
  border-radius: 999px !important;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
  transition: all 0.14s ease;
}

.faithful-chip:hover {
  background: #dbeafe;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.18);
}

.faithful-chip.armed {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px) scale(1.03);
}

.faithful-chip.used {
  opacity: 0.36;
  border-style: dashed;
  background: #f1f5f9;
  color: #64748b;
  box-shadow: none;
}

.faithful-chip.dragging {
  opacity: 0.25;
}

/* Bottom Sheet Editor */
.faithful-editor-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: #ffffff;
  border-top: 3px solid #2563eb;
  box-shadow: 0 -12px 36px rgba(15, 23, 42, 0.28);
  padding: 14px 18px 18px;
  max-width: 680px;
  margin: 0 auto;
  border-radius: 18px 18px 0 0 !important;
  animation: sheetSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.faithful-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.faithful-sheet-head strong {
  font-size: 1.05rem;
  color: #1e3a8a;
  font-weight: 800;
}

.btn-sheet-close {
  min-height: 36px;
  min-width: 36px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sheet-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.faithful-sheet-body {
  display: grid;
  gap: 10px;
}

.faithful-sheet-body input[type=text], .faithful-sheet-body textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid #2563eb;
  border-radius: 10px !important;
  font-weight: 600;
  font-size: 17px;
  font-family: inherit;
  color: #1e3a8a;
  background: #f8fafc;
  box-sizing: border-box;
}

.faithful-sheet-body input[type=text]:focus, .faithful-sheet-body textarea:focus {
  outline: none;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.faithful-sheet-body textarea {
  min-height: 130px;
  resize: vertical;
}

.faithful-sheet-body .sheet-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.sheet-opt-btn {
  min-height: 48px;
  padding: 8px 14px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 10px !important;
  font-weight: 600;
  font-size: 16px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sheet-opt-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.sheet-opt-btn.sel {
  border-color: #2563eb;
  background: #e0e7ff;
  color: #1e3a8a;
  font-weight: 700;
}

.drag-ghost {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  transform: translate(-50%, -120%);
  padding: 8px 16px;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

/* ============================================================================
   SECTION B PART 2 & PART 3: MODERN PEOPLE MATCH CARDS & TACTILE TRIP SLOTS
   ============================================================================ */
.dyn-people-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.dyn-people-match-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.dyn-people-match-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.dyn-people-match-card.is-selected {
  border-color: #2563eb;
  background: #f8fafc;
}

.dyn-people-match-card.is-correct {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}

.dyn-people-match-card.is-incorrect {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
}

.dyn-people-card-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dyn-people-num-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.dyn-people-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
}

.dyn-people-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  color: #0f172a;
  line-height: 1.2;
}

.dyn-people-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  color: #64748b;
}

.dyn-people-status-icon {
  font-weight: 800;
  font-size: 1rem;
}

.dyn-people-letter-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.dyn-letter-pill {
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dyn-letter-pill:hover {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.dyn-letter-pill.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.dyn-people-match-card.is-correct .dyn-letter-pill.active {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border-color: #166534;
}

.dyn-people-match-card.is-incorrect .dyn-letter-pill.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: #991b1b;
}

.dyn-modern-select,
select.people-select,
select.tt-select {
  width: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.dyn-modern-select:hover,
select.people-select:hover,
select.tt-select:hover {
  border-color: #60a5fa;
  background-color: #ffffff;
}

.dyn-modern-select:focus,
select.people-select:focus,
select.tt-select:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Tactile Inline Trip Slots (Section B Part 3) */
.dyn-trip-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 118px;
  min-height: 34px;
  padding: 3px 12px;
  margin: 2px 4px;
  border: 2px dashed #94a3b8;
  border-radius: 999px;
  background: #f8fafc;
  color: #1e3a8a;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.18s ease;
}

.dyn-trip-slot:hover {
  border-color: #2563eb;
  background: #eff6ff;
  transform: translateY(-1px);
}

.dyn-trip-slot.is-filled {
  border-style: solid;
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.dyn-trip-slot.is-correct {
  border-style: solid !important;
  border-color: #16a34a !important;
  background: #dcfce7 !important;
  color: #15803d !important;
}

.dyn-trip-slot.is-wrong {
  border-style: solid !important;
  border-color: #dc2626 !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

/* ==========================================================================
   SESSION 1 • PAGE 10 & 11 • EDITORIAL SCHOOL TIMETABLE & PILL QUESTIONS
   ========================================================================== */
.tt-studio-card {
  border-radius: 18px;
}

.tt-schedule-wrapper {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  margin-bottom: 1.5rem;
}

.tt-schedule-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 60%, #0284c7 100%);
  color: #ffffff;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
}

.tt-table-scroll {
  overflow-x: auto;
}

.tt-editorial-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-family: 'Inter', system-ui, sans-serif;
}

.tt-editorial-table thead th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.6rem;
  border-bottom: 2px solid #cbd5e1;
  text-align: center;
}

.tt-editorial-table tbody td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  text-align: center;
  font-size: 0.85rem;
}

.tt-editorial-table tbody tr:last-child td {
  border-bottom: none;
}

.tt-editorial-table .tt-time-cell {
  font-weight: 800;
  color: #334155;
  background: #f8fafc;
  white-space: nowrap;
  font-size: 0.82rem;
}

.tt-editorial-table .tt-break-row td {
  background: #fefce8;
  color: #854d0e;
  font-weight: 700;
}

.tt-break-cell {
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.tt-subj-badge {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.tt-subj-badge.subj-math {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.tt-subj-badge.subj-eng {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.tt-subj-badge.subj-pe {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.tt-subj-badge.subj-sci {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.tt-subj-badge.subj-hist {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

.tt-section-subtitle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.25rem 0 0.85rem;
}

.tt-task-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
}

.tt-questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 0.85rem;
}

.tt-question-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  transition: all 0.18s ease;
}

.tt-question-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.tt-question-card.is-correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}

.tt-question-card.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.tt-q-prompt {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  margin-bottom: 0.7rem;
}

.tt-q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.tt-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tt-opt-pill,
.tt-tf-pill {
  appearance: none;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tt-opt-pill:hover,
.tt-tf-pill:hover {
  border-color: #3b82f6;
  color: #1d4ed8;
  background: #eff6ff;
  transform: translateY(-1px);
}

.tt-opt-pill.is-active,
.tt-tf-pill.is-active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.tt-opt-pill.is-correct,
.tt-tf-pill.is-correct {
  border-color: #16a34a !important;
  background: #16a34a !important;
  color: #ffffff !important;
}

.tt-opt-pill.is-wrong,
.tt-tf-pill.is-wrong {
  border-color: #dc2626 !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.tt-tf-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tt-tf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  transition: all 0.18s ease;
}

.tt-tf-row.is-correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}

.tt-tf-row.is-wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.tt-tf-statement {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
}

.tt-tf-btns {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Dark / Graphite Theme Support for School Timetable */
body[data-studio-theme="graphite"] .tt-schedule-wrapper,
body.dark-mode .tt-schedule-wrapper {
  background: #0f172a;
  border-color: #334155;
}

body[data-studio-theme="graphite"] .tt-editorial-table thead th,
body.dark-mode .tt-editorial-table thead th {
  background: #1e293b;
  color: #f1f5f9;
  border-bottom-color: #334155;
}

body[data-studio-theme="graphite"] .tt-editorial-table tbody td,
body.dark-mode .tt-editorial-table tbody td {
  border-bottom-color: #1e293b;
  border-right-color: #1e293b;
}

body[data-studio-theme="graphite"] .tt-editorial-table .tt-time-cell,
body.dark-mode .tt-editorial-table .tt-time-cell {
  background: #111c33;
  color: #cbd5e1;
}

body[data-studio-theme="graphite"] .tt-question-card,
body[data-studio-theme="graphite"] .tt-tf-row,
body.dark-mode .tt-question-card,
body.dark-mode .tt-tf-row {
  background: #1e293b;
  border-color: #334155;
}

body[data-studio-theme="graphite"] .tt-q-prompt,
body[data-studio-theme="graphite"] .tt-tf-statement,
body[data-studio-theme="graphite"] .tt-section-subtitle,
body.dark-mode .tt-q-prompt,
body.dark-mode .tt-tf-statement,
body.dark-mode .tt-section-subtitle {
  color: #f8fafc;
}

body[data-studio-theme="graphite"] .tt-opt-pill,
body[data-studio-theme="graphite"] .tt-tf-pill,
body.dark-mode .tt-opt-pill,
body.dark-mode .tt-tf-pill {
  background: #0f172a;
  border-color: #475569;
  color: #e2e8f0;
}

