/* ==========================================================================
   ¿Destino o libre albedrío? — Estética «Ateneo Mediterráneo Contemporáneo»
   Totalmente adaptable (360px – 1920px+), cero desbordamiento horizontal
   ========================================================================== */

:root {
  --bg-page: #F7F8FA;
  --bg-card: #FFFFFF;
  --bg-soft: #EEF2F7;
  --bg-warm: #FDFBF7;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --ink: #0F1E36;
  --ink-body: #334155;
  --ink-muted: #64748B;

  --primary: #1D4ED8;
  --primary-deep: #1E3A8A;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;

  --terracotta: #C2410C;
  --terracotta-soft: #FFF7ED;
  --terracotta-border: #FED7AA;

  --gold: #D97706;
  --gold-bright: #F59E0B;
  --gold-soft: #FEF3C7;

  --sage: #0F766E;
  --sage-soft: #F0FDFA;

  --ok: #047857;
  --ok-soft: #ECFDF5;
  --ok-border: #A7F3D0;

  --err: #BE123C;
  --err-soft: #FFF1F2;
  --err-border: #FECDD3;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-reading: 'Newsreader', Georgia, serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 3px rgba(15, 30, 54, 0.06);
  --shadow-sm: 0 4px 14px rgba(15, 30, 54, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 30, 54, 0.09);
  --shadow-lg: 0 20px 48px rgba(11, 22, 44, 0.16);

  --text-scale: 1;
  --transcript-size: 1.125rem;
}

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

html {
  font-size: calc(16px * var(--text-scale, 1));
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

body.has-mini-player {
  padding-bottom: 112px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary-deep);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Header & Nav (desanclado y compacto en px para no estorbar en TV) ---------- */
.site-header {
  position: relative;
  z-index: 200;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 8px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 0;
}

.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0B162C, #1E3A8A);
  color: var(--gold-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px;
  min-width: 0;
}
.primary-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-body);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.nav-tab:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-tab.is-active {
  background: var(--primary-deep);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.24);
}

.nav-icon {
  font-size: 14px;
  line-height: 1;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.text-scale-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

.scale-btn {
  min-width: 30px;
  min-height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  transition: background-color 0.15s ease;
}

.scale-btn:hover:not(:disabled) {
  background: #FFFFFF;
  color: var(--primary-deep);
}

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

.scale-val {
  min-height: 30px;
  padding: 0 5px;
  border: none;
  background: transparent;
  color: var(--primary-deep);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scale-val:hover {
  text-decoration: underline;
}

.progress-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 10px;
  min-width: 96px;
}

.progress-pill-text {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-deep);
  white-space: nowrap;
}

.progress-bar-mini {
  width: 100%;
  height: 5px;
  background: #DCE4F0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--sage));
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ---------- Main Shell ---------- */
.main-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  min-height: calc(100vh - 160px);
}

.view-panel {
  animation: fadeSlideUp 0.25s ease;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.18s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary-deep);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.24);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-1px);
}

.btn-amber {
  background: var(--gold-bright);
  color: #0B162C;
  font-weight: 700;
}
.btn-amber:hover:not(:disabled) {
  background: #FBBF24;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--primary);
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
  backdrop-filter: blur(6px);
}
.btn-ghost-light:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

.btn-sm {
  min-height: 38px;
  padding: 0.42rem 0.85rem;
  font-size: 0.84rem;
}

/* ---------- Hero Panorámico ---------- */
.hero-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, #0B162C 0%, #162B52 55%, #1E3A6E 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
}

.hero-content {
  padding: 2.5rem 2.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
  z-index: 2;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #FCD34D;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.12;
  font-weight: 800;
  color: #FFFFFF;
}

.hero-lead {
  font-size: 1.02rem;
  color: #E2E8F0;
  max-width: 58ch;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.hero-stat-chip {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  color: #F1F5F9;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.hero-media {
  position: relative;
  min-height: 300px;
  background: #0B162C;
  cursor: zoom-in;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.hero-media:hover img {
  transform: scale(1.03);
}

.hero-media-badge {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(11, 22, 44, 0.78);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

/* ---------- Generic Section Headings & Cards ---------- */
.section-heading-block {
  margin-bottom: 1.35rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  margin-bottom: 0.3rem;
}

.section-heading-block h2 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  color: var(--ink);
  line-height: 1.22;
}

.section-heading-block p {
  color: var(--ink-body);
  margin-top: 0.35rem;
  max-width: 72ch;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

/* ---------- Inicio: Objectives & Arcos Map ---------- */
.objectives-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.objective-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.objective-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.objective-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
}

.objective-card p {
  font-size: 0.9rem;
  color: var(--ink-body);
}

.arcs-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.arc-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.arc-group-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.arc-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  margin-bottom: 0.35rem;
}

.arc-group[data-arc="2"] .arc-badge {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.arc-group[data-arc="3"] .arc-badge {
  background: var(--sage-soft);
  color: var(--sage);
}

.arc-group-header h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  color: var(--ink);
}

.arc-group-desc {
  font-size: 0.92rem;
  color: var(--ink-body);
  margin-top: 0.2rem;
}

.arc-sections-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.map-node-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.map-node-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.map-node-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0F1E36;
  position: relative;
}

.map-node-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-node-roman {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(11, 22, 44, 0.86);
  color: #FCD34D;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
}

.map-node-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.map-node-body h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.28;
  color: var(--ink);
}

.map-node-sub {
  font-size: 0.82rem;
  color: var(--terracotta);
  font-weight: 600;
}

.map-node-summary {
  font-size: 0.86rem;
  color: var(--ink-body);
  flex: 1;
}

.map-node-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.status-chip {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--ink-muted);
}

.status-chip.is-done {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- Recorrido I-IX ---------- */
.stepper-shell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-xs);
}

.arc-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.arc-pill {
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-body);
}
.arc-pill.is-active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.section-stepper {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.section-stepper::-webkit-scrollbar {
  display: none;
}

.step-btn {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-body);
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.step-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.step-btn.is-current {
  background: var(--primary-deep);
  color: #FFFFFF;
  border-color: var(--primary-deep);
  box-shadow: 0 3px 10px rgba(30, 58, 138, 0.22);
}

.step-btn.is-completed:not(.is-current) {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
}

.step-roman {
  font-family: var(--font-display);
  font-weight: 700;
}

.lesson-module-header {
  background: linear-gradient(135deg, #FFFFFF 0%, #F4F7FB 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.module-meta-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.module-arc-tag {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terracotta);
  background: var(--terracotta-soft);
  border: 1px solid var(--terracotta-border);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.module-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  color: var(--ink);
  line-height: 1.2;
}

.module-subtitle {
  font-size: 1rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 0.25rem;
}

.quick-audio-bar {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.quick-audio-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.quick-audio-info strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ink);
}

.quick-audio-info span {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.quick-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Hilo conductor & Puente */
.bridge-box {
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.35rem;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
}

.bridge-box.is-closing {
  border-left-color: var(--terracotta);
  background: var(--terracotta-soft);
  margin-top: 1.6rem;
  margin-bottom: 0;
}

.bridge-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-deep);
  margin-bottom: 0.3rem;
}

.bridge-box.is-closing .bridge-label {
  color: var(--terracotta);
}

.bridge-box p {
  font-size: 0.96rem;
  color: var(--ink);
}

/* Articulación conceptual + Galería Visual */
.content-split-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.block-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.block-title-row h3 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--ink);
}

.block-tag {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-body);
}

.explanation-prose {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.explanation-prose p {
  color: var(--ink-body);
  font-size: 0.99rem;
}

.key-idea-callout {
  background: var(--bg-warm);
  border: 1px solid var(--terracotta-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-top: 0.35rem;
}

.key-idea-callout strong {
  color: var(--terracotta);
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* Láminas Nano Banana en la sección */
.plates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
}

.plate-card {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.plate-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0F1E36;
  overflow: hidden;
  cursor: zoom-in;
}

.plate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.plate-media:hover img {
  transform: scale(1.03);
}

.plate-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 30, 54, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
}

.plate-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.plate-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.plate-body h4 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  color: var(--ink);
}

.plate-body p {
  font-size: 0.88rem;
  color: var(--ink-body);
}

.cultural-details {
  margin-top: auto;
  padding-top: 0.4rem;
}

.cultural-details summary {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--primary-deep);
  cursor: pointer;
  padding: 0.35rem 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cultural-details summary::before {
  content: "▸";
  transition: transform 0.18s ease;
}
.cultural-details[open] summary::before {
  transform: rotate(90deg);
}

.cultural-details-body {
  margin-top: 0.45rem;
  padding: 0.7rem 0.85rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--ink-body);
}

/* Vocabulario Ilustrado en Sección */
.vocab-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.vocab-mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.vocab-mini-thumb {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  cursor: zoom-in;
  border: 1px solid var(--border);
}

.vocab-mini-content {
  min-width: 0;
}

.vocab-mini-term {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--ink);
}

.vocab-mini-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sage);
  background: var(--sage-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.25rem;
}

.vocab-mini-def {
  font-size: 0.86rem;
  color: var(--ink-body);
  margin-top: 0.2rem;
}

.vocab-mini-quote {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 0.35rem;
}

/* ---------- Actividades Interactivas ---------- */
.activities-stack {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.activity-card.is-solved {
  border-color: var(--ok-border);
}

.activity-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.activity-type-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  margin-bottom: 0.3rem;
}

.activity-head h4 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.activity-instruction {
  font-size: 0.92rem;
  color: var(--ink-body);
  margin-top: 0.2rem;
}

.activity-status-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-muted);
  white-space: nowrap;
}
.activity-status-badge.is-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Mecánica: Emparejamiento */
.matching-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.matching-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.matching-col-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.match-item {
  width: 100%;
  min-height: 48px;
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.match-item:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.match-item.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
  font-weight: 700;
}

.match-item.is-matched {
  border-color: var(--ok-border);
  background: var(--ok-soft);
  color: var(--ok);
  cursor: default;
}

.match-item.is-wrong {
  border-color: var(--err);
  background: var(--err-soft);
  animation: shakeX 0.3s ease;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.match-tag {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(4, 120, 87, 0.14);
  color: var(--ok);
  flex-shrink: 0;
}

/* Mecánica: Opción múltiple / Interpretativa */
.mc-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.mc-item {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

.mc-question {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mc-opt {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  text-align: left;
  font-size: 0.91rem;
  color: var(--ink-body);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: all 0.15s ease;
}

.mc-opt:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.mc-opt.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
}

.mc-opt.is-incorrect {
  border-color: var(--err);
  background: var(--err-soft);
  color: var(--err);
}

.mc-letter {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mc-opt.is-correct .mc-letter {
  background: var(--ok);
  color: #fff;
}
.mc-opt.is-incorrect .mc-letter {
  background: var(--err);
  color: #fff;
}

/* Feedback banner */
.feedback-note {
  margin-top: 0.7rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
}
.feedback-note.is-ok {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  color: #065F46;
}
.feedback-note.is-err {
  background: var(--err-soft);
  border: 1px solid var(--err-border);
  color: #9F1239;
}
.feedback-note.is-info {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary-deep);
}

/* Mecánica: Matriz Verdadero/Falso */
.vf-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vf-row {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.vf-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.vf-statement {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}

.vf-buttons {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.vf-btn {
  min-width: 88px;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  font-weight: 700;
  font-size: 0.85rem;
}
.vf-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.vf-btn.is-correct {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.vf-btn.is-incorrect {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}

/* Mecánica: Simulador Cono SVG (Sec. III) */
.cone-sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.cone-svg-box {
  background: linear-gradient(180deg, #0B162C 0%, #162B52 100%);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cone-svg-box svg {
  width: 100%;
  max-width: 310px;
  height: auto;
}

.cone-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cone-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.cone-slider {
  width: 100%;
  accent-color: var(--primary-deep);
  height: 30px;
  cursor: pointer;
}

.cone-stage-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.cone-stage-card h5 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  color: var(--primary-deep);
  margin-bottom: 0.35rem;
}

/* Mecánica: Clasificador */
.classifier-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.classifier-item {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.classifier-prompt {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

.classifier-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cls-btn {
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-body);
}
.cls-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.cls-btn.is-correct {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.cls-btn.is-incorrect {
  background: var(--err);
  border-color: var(--err);
  color: #fff;
}

/* Mecánica: Cloze Conectores */
.cloze-paragraph {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 1rem;
  line-height: 1.95;
  color: var(--ink);
  margin-bottom: 1rem;
}

.cloze-select {
  display: inline-block;
  min-height: 38px;
  padding: 0.25rem 0.6rem;
  margin: 0 0.2rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  background: #FFFFFF;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-deep);
  max-width: 100%;
}
.cloze-select.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.cloze-select.is-incorrect {
  border-color: var(--err);
  background: var(--err-soft);
  color: var(--err);
}

/* Mecánica: Simulador Contextual del Agua (Sec. VI) */
.water-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.water-tab-btn {
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink-body);
  text-align: center;
}
.water-tab-btn.is-active {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
  color: #FFFFFF;
}

.water-stage {
  background: linear-gradient(135deg, #EFF6FF, #F8FAFC);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-bottom: 1.1rem;
}

.water-stage-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}
.water-stage-badge.is-good {
  background: var(--ok-soft);
  color: var(--ok);
}
.water-stage-badge.is-bad {
  background: var(--err-soft);
  color: var(--err);
}

/* Mecánica: Ordenamiento lógico (Sec. VII) */
.sequence-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.sequence-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-warm);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.sequence-row.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.sequence-row.is-incorrect {
  border-color: var(--err);
  background: var(--err-soft);
}

.sequence-pos {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary-deep);
  color: #fff;
  font-weight: 800;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sequence-text {
  flex: 1;
  font-size: 0.93rem;
  color: var(--ink);
  min-width: 0;
}

.sequence-arrows {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.seq-move-btn {
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  font-weight: 800;
  font-size: 0.95rem;
}
.seq-move-btn:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.activity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.module-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ---------- Atlas y Vocabulario ---------- */
.atlas-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.atlas-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.search-input-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-page);
  font-size: 0.94rem;
}
.search-input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.65;
}

.mode-switch {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.mode-switch-btn {
  min-height: 38px;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-body);
}
.mode-switch-btn.is-active {
  background: var(--primary-deep);
  color: #fff;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-chip {
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-body);
}
.filter-chip.is-active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.15rem;
}

.atlas-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.atlas-card-media {
  aspect-ratio: 4 / 3;
  background: #0F1E36;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

.atlas-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-sec-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(11, 22, 44, 0.84);
  color: #FCD34D;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.atlas-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.atlas-cat-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sage);
}

.atlas-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
}

.atlas-card-body p {
  font-size: 0.88rem;
  color: var(--ink-body);
}

.atlas-quote {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
  border-left: 2px solid var(--gold);
  padding-left: 0.6rem;
  margin-top: 0.2rem;
}

.atlas-card-foot {
  margin-top: auto;
  padding-top: 0.55rem;
}

/* Flashcards 3D */
.flashcard-stage {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.flashcard-perspective {
  width: 100%;
  perspective: 1200px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 410px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.flashcard-inner.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.85rem;
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #F8FAFC, #EFF6FF);
}

.flashcard-front-img {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.flashcard-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

/* ---------- Taller Crítico ---------- */
.taller-blocks {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.dilemma-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.notebook-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.notebook-prompt-card {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.notebook-prompt-card h4 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.connector-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.connector-chip {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border: 1px solid var(--primary-border);
}

.notebook-textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: #FFFFFF;
  font-size: 0.94rem;
  line-height: 1.55;
  resize: vertical;
}
.notebook-textarea:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.notebook-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.4rem;
}

/* ---------- Transcripción Íntegra ---------- */
.transcript-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.transcript-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.transcript-jump-pills {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.transcript-jump-pills::-webkit-scrollbar {
  display: none;
}

.transcript-jump-btn {
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.transcript-jump-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.transcript-article {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.transcript-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-sm);
}

.transcript-sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1.5px solid var(--border);
}

.transcript-sec-head h3 {
  font-family: var(--font-display);
  font-size: 1.42rem;
  color: var(--ink);
}

.transcript-sec-sub {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.transcript-para {
  position: relative;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-family: var(--font-reading);
  font-size: var(--transcript-size);
  line-height: 1.78;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  margin-bottom: 0.55rem;
}

.transcript-para:hover {
  background: var(--bg-soft);
  border-left-color: var(--border-strong);
}

.transcript-para.is-playing {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.transcript-para-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: rgba(29, 78, 216, 0.08);
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
  margin-right: 0.55rem;
  vertical-align: middle;
}

.transcript-note-box {
  margin-top: 1rem;
  padding: 0.85rem 1.05rem;
  background: var(--bg-warm);
  border: 1px solid var(--terracotta-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink-body);
}

mark.search-hl {
  background: #FDE68A;
  color: var(--ink);
  padding: 0 2px;
  border-radius: 3px;
}

/* ---------- Estudio de Audio I-IX ---------- */
.audio-studio-hero {
  background: linear-gradient(135deg, #0B162C, #1E3A8A);
  color: #FFFFFF;
  border-radius: var(--radius-xl);
  padding: 1.65rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.studio-top-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: center;
}

.studio-artwork {
  width: 160px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.studio-now-kicker {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FCD34D;
}

.studio-now-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  margin: 0.2rem 0;
}

.studio-now-sub {
  font-size: 0.92rem;
  color: #CBD5E1;
}

.studio-live-cue {
  margin-top: 1.1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  font-family: var(--font-reading);
  font-size: 1.02rem;
  color: #F8FAFC;
}

.studio-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.studio-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.studio-scrubber-row input[type="range"] {
  flex: 1;
  accent-color: var(--gold-bright);
  cursor: pointer;
}

.studio-time {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: #E2E8F0;
  min-width: 44px;
}

.audio-tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.track-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.track-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow-sm);
}

.track-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.track-info {
  flex: 1;
  min-width: 0;
}

.track-roman {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--terracotta);
}

.track-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.25;
}

.track-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.full-audio-banner {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

/* ---------- Lightbox Modal ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 22, 44, 0.82);
  backdrop-filter: blur(6px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(11, 22, 44, 0.82);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.lightbox-figure img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #0B162C;
}

.lightbox-caption {
  padding: 1.25rem 1.5rem;
}

.lightbox-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.25rem;
}

.lightbox-caption h3 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.lightbox-caption p {
  font-size: 0.94rem;
  color: var(--ink-body);
}

/* ---------- Botón flotante de retorno al menú ---------- */
.back-to-menu-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(15, 30, 54, 0.88);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 18px rgba(11, 22, 44, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.back-to-menu-btn:hover {
  background: var(--primary-deep);
  transform: translateY(-2px);
}

body.has-mini-player .back-to-menu-btn {
  bottom: 84px;
}

/* ---------- Mini-reproductor Flotante (compacto en px) ---------- */
.mini-player {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(960px, calc(100% - 24px));
  z-index: 350;
  background: rgba(15, 30, 54, 0.96);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(11, 22, 44, 0.36);
  backdrop-filter: blur(12px);
  padding: 8px 14px;
}

.mini-player-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-player-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 200px;
}

.mini-player-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold-bright);
  flex-shrink: 0;
}

.mini-player-dot.is-pulse {
  animation: pulseGold 1.4s infinite;
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65); }
  50%      { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}

.mini-player-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mini-player-titles strong {
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-titles span {
  font-size: 12px;
  color: #CBD5E1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 2 1 340px;
  min-width: 0;
}

.mini-btn {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
}
.mini-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.mini-btn-play {
  background: var(--gold-bright);
  color: #0B162C;
  border-color: transparent;
  font-weight: 800;
}

.mini-seek-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 110px;
}

.mini-seek-group input[type="range"] {
  flex: 1;
  min-width: 60px;
  accent-color: var(--gold-bright);
}

.mini-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #CBD5E1;
}

.mini-speed {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #162B52;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 1.5rem 1.25rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--ink-body);
}

.footer-note {
  color: var(--ink-muted);
}

/* ==========================================================================
   MEDIA QUERIES (Tableta / Zoom TV <= 980px o alto reducido, Móvil <= 640px)
   ========================================================================== */
@media (max-width: 980px), (max-height: 680px) {
  .brand-subtitle {
    display: none;
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 8px 12px;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    border-top: 1px solid var(--border);
    padding-top: 4px;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 230px;
    max-height: 300px;
    order: -1;
  }

  .objectives-grid,
  .arc-sections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cone-sim-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 620px) {
  .mini-player {
    padding: 6px 10px;
    bottom: 6px;
  }
}

@media (max-width: 640px) {
  .main-shell {
    padding: 1rem 0.85rem 3rem;
  }

  .header-inner {
    padding: 6px 10px;
  }

  .header-tools {
    gap: 6px;
  }

  .scale-btn {
    min-width: 26px;
    min-height: 28px;
    padding: 0 4px;
    font-size: 12px;
  }

  .scale-val {
    padding: 0 3px;
    font-size: 11px;
  }

  .progress-pill {
    min-width: auto;
    padding: 4px 8px;
  }

  .hero-content {
    padding: 1.5rem 1.25rem;
  }

  .objectives-grid,
  .arc-sections-grid,
  .matching-grid,
  .water-tabs,
  .studio-top-grid {
    grid-template-columns: 1fr;
  }

  .studio-artwork {
    width: 100%;
    height: 170px;
  }

  .vf-row-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .vf-buttons {
    width: 100%;
  }

  .vf-btn {
    flex: 1;
  }

  .card,
  .content-split-block,
  .activity-card,
  .transcript-section-card,
  .lesson-module-header {
    padding: 1.1rem;
  }

  .mini-player {
    width: calc(100% - 16px);
    bottom: 8px;
    padding: 6px 10px;
  }

  .mini-player-controls {
    width: 100%;
    flex-basis: 100%;
  }

  body.has-mini-player .back-to-menu-btn {
    bottom: 116px;
  }
}
