/* ==========================================================================
   m01-datos-medicion.css: Estilos encapsulados para el Módulo 01
   Estadística Correlacional Interactiva - Datos, Medición y Variabilidad
   Rediseño Iteración 2: Estética Minimalista, Clásica, Sobria y Layout 2 Columnas
   ========================================================================== */

/* --- 0. VARIABLES DE MÓDULO (PALETA SOBRIA Y ACADÉMICA) --- */
:root {
  --m01-bg-base: #ffffff;
  --m01-bg-subtle: #f8fafc;
  --m01-bg-muted: #f1f5f9;
  --m01-border-light: #e2e8f0;
  --m01-border-medium: #cbd5e1;
  --m01-text-main: #0f172a;
  --m01-text-secondary: #334155;
  --m01-text-muted: #64748b;
  --m01-accent-primary: #2563eb;
  --m01-accent-primary-light: #eff6ff;
  --m01-accent-primary-border: #bfdbfe;
  --m01-accent-secondary: #0284c7;
  --m01-accent-amber: #d97706;
  --m01-accent-amber-light: #fffbeb;
  --m01-accent-amber-border: #fde68a;
  --m01-outlier: #dc2626;
  --m01-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --m01-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
  --m01-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.07);
  --m01-radius: 12px;
}

[data-bs-theme="dark"] {
  --m01-bg-base: #0f172a;
  --m01-bg-subtle: #1e293b;
  --m01-bg-muted: #334155;
  --m01-border-light: #334155;
  --m01-border-medium: #475569;
  --m01-text-main: #f8fafc;
  --m01-text-secondary: #cbd5e1;
  --m01-text-muted: #94a3b8;
  --m01-accent-primary: #3b82f6;
  --m01-accent-primary-light: rgba(59, 130, 246, 0.12);
  --m01-accent-primary-border: rgba(59, 130, 246, 0.35);
  --m01-accent-secondary: #38bdf8;
  --m01-accent-amber: #f59e0b;
  --m01-accent-amber-light: rgba(245, 158, 11, 0.12);
  --m01-accent-amber-border: rgba(245, 158, 11, 0.35);
  --m01-outlier: #ef4444;
  --m01-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --m01-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --m01-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* --- 1. CABECERA EDITORIAL SIMPLE --- */
body:has(.m01-module-intro) {
  background: var(--m01-bg-base);
  color: var(--m01-text-main);
}

body:has(.m01-module-intro) .rs-lesson-page-wrap {
  padding-top: 0;
}

.m01-module-intro {
  max-width: 1180px;
  margin-inline: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding: 3.5rem 1.25rem 4rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.m01-module-kicker {
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--m01-accent-primary);
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.m01-title {
  font-size: clamp(2.1rem, 3.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--m01-text-main);
  margin: 0;
  letter-spacing: 0;
}

.m01-module-lead {
  font-size: clamp(0.98rem, 1.25vw, 1.15rem);
  color: var(--m01-text-secondary);
  line-height: 1.65;
  max-width: 920px;
  margin: 0.8rem 0 0;
}

/* --- 2. BLOQUE EDITORIAL Y PREGUNTA SOCIAL --- */
.m01-editorial-block {
  margin: 1.75rem 0 2.25rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--m01-text-main);
}

.m01-social-question-title {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  font-weight: 650;
  color: var(--m01-text-main);
  margin-top: 0;
  margin-bottom: 0.8rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 850px;
  margin-inline: auto;
  text-align: center;
}

.m01-social-question-intro {
  max-width: 78ch;
  margin-inline: auto;
}

.m01-social-question-intro > p {
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.m01-group-comparison-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.m01-group-col {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--m01-shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.m01-group-col:hover {
  border-color: var(--m01-border-medium);
  box-shadow: var(--m01-shadow-md);
}

.m01-group-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.6rem;
}

.m01-badge-a {
  background: var(--m01-bg-muted);
  color: var(--m01-text-secondary);
  border: 1px solid var(--m01-border-medium);
}

.m01-badge-b {
  background: var(--m01-accent-primary-light);
  color: var(--m01-accent-primary);
  border: 1px solid var(--m01-accent-primary-border);
}

.m01-group-col h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--m01-text-main);
}

.m01-group-col p {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
  color: var(--m01-text-secondary);
}

/* --- 3. IDEA CENTRAL (SECUENCIA CONCEPTUAL) --- */
.m01-sequence-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0 3.5rem 0;
}

.m01-flow-step {
  padding: 1.25rem;
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.m01-flow-step-num {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--m01-accent-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m01-flow-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.2rem 0;
  color: var(--m01-text-main);
}

.m01-flow-step p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--m01-text-secondary);
  margin: 0;
}

.m01-kw {
  font-weight: 700;
  color: var(--m01-accent-primary);
  border-bottom: 1px dotted var(--m01-accent-primary);
}

/* --- 4. SUPERFICIE DEL LABORATORIO & LAYOUT EN 2 COLUMNAS (CON BREAKOUT ROBUSTO) --- */
.rs-lesson-section.column-screen-inset#laboratorio-interactivo,
.rs-lesson-section#laboratorio-interactivo,
.rs-lesson-section.column-screen-inset#laboratorios-interactivos,
.rs-lesson-section#laboratorios-interactivos {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}

.m01-lab-surface.m01-lab-breakout,
#m01-lab-root {
  background: #eef3f8;
  color: var(--m01-text-main);
  border-radius: 8px;
  padding: 1.35rem;
  margin: 3.5rem 0;
  border: 1px solid var(--m01-border-light);
  box-shadow: var(--m01-shadow-md);
  position: relative;
  width: min(1380px, calc(100vw - 2.5rem)) !important;
  max-width: 100vw !important;
  margin-left: 50% !important;
  transform: translateX(-50%) !important;
  box-sizing: border-box !important;
}

@media (max-width: 991px) {
  .m01-lab-surface.m01-lab-breakout,
  #m01-lab-root {
    width: min(1380px, calc(100vw - 1.5rem)) !important;
  }
}

.m01-lab-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--m01-border-light);
}

.m01-lab-title {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 800;
  color: var(--m01-text-main);
  margin: 0 0 0.4rem 0;
}

.m01-lab-desc,
.m01-lab-description {
  font-size: 0.95rem;
  color: var(--m01-text-secondary);
  margin: 0.5rem 0 1.5rem;
  max-width: 920px;
  line-height: 1.65;
}

/* Layout Grid principal en 2 columnas: izquierda acotada (300px), derecha expansiva (1fr) */
.m01-lab-layout {
  display: grid !important;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) !important;
  gap: 1.75rem !important;
  align-items: start !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Forzar ubicación en grilla para prevenir secuestro de selectores globales de Quarto */
.m01-lab-layout > .m01-lab-sidebar,
.m01-lab-layout > aside.m01-lab-sidebar,
.m01-lab-sidebar {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.m01-lab-layout > .m01-lab-main,
.m01-lab-layout > main.m01-lab-main,
.m01-lab-main {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 2 !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 991px) {
  .m01-lab-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .m01-lab-layout > .m01-lab-sidebar,
  .m01-lab-layout > aside.m01-lab-sidebar,
  .m01-lab-sidebar {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
  .m01-lab-layout > .m01-lab-main,
  .m01-lab-layout > main.m01-lab-main,
  .m01-lab-main {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
}

/* --- 5. BARRA LATERAL DE CONFIGURACIÓN --- */
.m01-lab-sidebar {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.m01-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--m01-border-light);
}

.m01-sidebar-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--m01-text-main);
  margin: 0;
}

.m01-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--m01-border-medium);
  color: var(--m01-text-main);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

@media (max-width: 991px) {
  .m01-sidebar-toggle {
    display: inline-block;
  }
  .m01-sidebar-content.is-collapsed {
    display: none;
  }
}

.m01-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.m01-ctrl-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.m01-ctrl-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--m01-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m01-seg-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  width: 100%;
  background: var(--m01-bg-muted);
  border: 1px solid var(--m01-border-light);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.m01-seg-btn {
  min-width: 0;
  width: 100%;
  background: transparent;
  color: var(--m01-text-secondary);
  border: none;
  padding: 0.55rem 0.4rem;
  border-radius: 4px;
  font-size: clamp(0.7rem, 0.8vw, 0.78rem);
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: normal;
  overflow: hidden;
}

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

.m01-seg-btn.active {
  background: var(--m01-bg-base);
  color: var(--m01-accent-primary);
  font-weight: 700;
  box-shadow: var(--m01-shadow-sm);
}

.m01-chk-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.m01-chk-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.86rem;
  color: var(--m01-text-secondary);
  cursor: pointer;
  user-select: none;
}

.m01-chk-label input[type="checkbox"] {
  accent-color: var(--m01-accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.m01-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--m01-border-light);
}

.m01-btn {
  background: var(--m01-bg-base);
  color: var(--m01-text-main);
  border: 1px solid var(--m01-border-medium);
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.m01-btn:hover {
  border-color: var(--m01-accent-primary);
  color: var(--m01-accent-primary);
}

.m01-btn.active {
  background: var(--m01-accent-primary);
  color: #ffffff;
  border-color: var(--m01-accent-primary);
}

.m01-btn.btn-outlier.active {
  background: var(--m01-outlier);
  color: #ffffff;
  border-color: var(--m01-outlier);
}

.m01-btn.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--m01-text-muted);
  font-size: 0.82rem;
}

.m01-btn.btn-ghost:hover {
  color: var(--m01-text-main);
  background: var(--m01-bg-muted);
}

/* --- 6. FRANJA DE ESTADÍSTICAS COMPACTA --- */
.m01-lab-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.m01-stats-banner {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.m01-stat-group-badge {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.m01-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--m01-text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.m01-stat-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--m01-accent-primary);
}

.m01-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.m01-stat-value {
  font-family: var(--rs-font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--m01-text-main);
}

.m01-stat-value.val-mean {
  color: var(--m01-accent-primary);
}

.m01-stat-value.val-median {
  color: var(--m01-accent-amber);
}

.m01-stat-value.val-sd {
  color: var(--m01-text-main);
}

.m01-stat-secondary {
  font-size: 0.78rem;
  color: var(--m01-text-muted);
  font-family: var(--rs-font-mono, monospace);
}

/* --- 7. PANEL CONTEXTUAL E INTERPRETACIÓN --- */
.m01-household-panel {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.m01-hh-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--m01-text-secondary);
}

.m01-hh-id {
  background: var(--m01-accent-primary-light);
  color: var(--m01-accent-primary);
  font-family: var(--rs-font-mono, monospace);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--m01-accent-primary-border);
}

.m01-hh-empty {
  color: var(--m01-text-muted);
  font-style: italic;
  font-size: 0.86rem;
}

.m01-dynamic-interpretation {
  background: var(--m01-bg-subtle);
  border-left: 3px solid var(--m01-accent-primary);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid var(--m01-border-light);
  border-right: 1px solid var(--m01-border-light);
  border-bottom: 1px solid var(--m01-border-light);
}

.m01-interp-text {
  font-size: 0.92rem;
  color: var(--m01-text-main);
  line-height: 1.55;
  margin: 0;
}

.m01-interp-text strong {
  color: var(--m01-accent-primary);
  font-weight: 700;
}

/* --- 8. LIENZO SVG (DOTPLOT E HISTOGRAMA SINCRONIZADOS) --- */
.m01-canvas-container {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  padding: 1rem 0.5rem;
  position: relative;
  overflow: hidden;
}

.m01-svg-canvas {
  width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  user-select: none;
}

.m01-dot {
  cursor: pointer;
  transition: r 0.15s ease, fill-opacity 0.15s ease, stroke-width 0.15s ease;
}

.m01-dot:hover, .m01-dot.is-selected {
  stroke: var(--m01-text-main);
  stroke-width: 2.5px;
  r: 9px;
}

.m01-hist-bar {
  cursor: pointer;
  transition: fill-opacity 0.15s ease, stroke-width 0.15s ease;
}

.m01-hist-bar:hover {
  fill-opacity: 0.9;
  stroke: var(--m01-text-main);
  stroke-width: 1.5px;
}

.m01-legend-dot {
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--m01-text-secondary);
}

/* --- 9. RECORRIDO GUIADO EMERGENTE --- */
.m01-guided-tour-panel {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-accent-primary-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: none;
  box-shadow: var(--m01-shadow-sm);
}

.m01-guided-tour-panel.is-active {
  display: block;
}

.m01-guided-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.m01-guided-step-badge {
  background: var(--m01-accent-primary-light);
  color: var(--m01-accent-primary);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--m01-accent-primary-border);
}

.m01-guided-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--m01-text-main);
  margin: 0;
}

.m01-guided-desc {
  font-size: 0.92rem;
  color: var(--m01-text-secondary);
  line-height: 1.55;
  margin: 0 0 1rem 0;
}

.m01-guided-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.m01-guided-dots {
  display: flex;
  gap: 0.45rem;
}

.m01-guided-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--m01-border-medium);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.m01-guided-dot.active {
  background: var(--m01-accent-primary);
  transform: scale(1.3);
}

/* --- 10. EXPLICADOR ANIMADO DE DISPERSIÓN (SECCIÓN 10) --- */
.m01-explainer-section {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  border-radius: var(--m01-radius);
  padding: clamp(1.25rem, 3vw, 2.25rem);
  margin: 3.5rem 0;
  color: var(--m01-text-main);
  box-shadow: var(--m01-shadow-sm);
}

.m01-explainer-title {
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-weight: 800;
  margin: 0 0 0.4rem 0;
  color: var(--m01-text-main);
}

.m01-explainer-subtitle {
  font-size: 0.95rem;
  color: var(--m01-text-secondary);
  margin: 0 0 1.5rem 0;
}

.m01-explainer-layout {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1.4fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 900px) {
  .m01-explainer-layout {
    grid-template-columns: 1fr;
  }
}

.m01-explainer-controls {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.m01-step-selector {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.m01-step-btn {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  color: var(--m01-text-secondary);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.m01-step-btn:hover {
  border-color: var(--m01-border-medium);
  color: var(--m01-text-main);
}

.m01-step-btn.active {
  background: var(--m01-accent-primary-light);
  color: var(--m01-accent-primary);
  border-color: var(--m01-accent-primary-border);
  font-weight: 700;
}

.m01-step-num-icon {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--m01-bg-muted);
  color: var(--m01-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
}

.m01-step-btn.active .m01-step-num-icon {
  background: var(--m01-accent-primary);
  color: #ffffff;
}

.m01-explainer-formula-box {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  border-radius: 6px;
  padding: 0.9rem;
  font-family: var(--rs-font-mono, monospace);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--m01-text-main);
}

.m01-explainer-formula-box span.highlight-math {
  background: var(--m01-accent-primary-light);
  color: var(--m01-accent-primary);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
  border: 1px solid var(--m01-accent-primary-border);
}

.m01-explainer-canvas-wrap {
  background: var(--m01-bg-base);
  border: 1px solid var(--m01-border-light);
  border-radius: 10px;
  padding: 1rem 0.5rem;
  overflow: hidden;
}

/* --- 11. FÓRMULAS, TABLAS E INTERPRETACIÓN SOCIOLÓGICA --- */
.m01-formula-card {
  background: var(--m01-bg-subtle);
  border: 1px solid var(--m01-border-light);
  border-radius: var(--m01-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.m01-formula-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1.08rem;
  color: var(--m01-text-main);
  font-weight: 700;
}

.m01-symbol-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--m01-border-medium);
}

.m01-symbol-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: var(--m01-text-secondary);
}

.m01-symbol-tag {
  font-family: var(--rs-font-mono, monospace);
  font-weight: 700;
  background: var(--m01-bg-muted);
  color: var(--m01-accent-primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--m01-border-light);
  flex-shrink: 0;
}

.m01-table-wrap {
  overflow-x: auto;
  margin: 1.75rem 0;
  border-radius: 8px;
  border: 1px solid var(--m01-border-light);
}

.m01-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.m01-table th {
  background: var(--m01-bg-subtle);
  color: var(--m01-text-main);
  padding: 0.85rem 1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--m01-border-medium);
}

.m01-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--m01-border-light);
  font-family: var(--rs-font-mono, monospace);
  color: var(--m01-text-secondary);
}

.m01-table td:first-child {
  font-family: inherit;
  font-weight: 600;
  color: var(--m01-text-main);
}

.m01-table tr:nth-child(even) {
  background: var(--m01-bg-subtle);
}

.m01-compact-note {
  color: var(--m01-text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.85rem 0 1rem;
}

.m01-inline-math,
.m01-inline-equation {
  font-family: var(--rs-font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  font-weight: 650;
}

.m01-inline-equation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.m01-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  text-align: center;
  line-height: 1.25;
  vertical-align: middle;
}

.m01-fraction > span:first-child {
  border-bottom: 1px solid currentColor;
  padding: 0 0.25rem 0.1rem;
}

.m01-fraction > span:last-child {
  padding: 0.1rem 0.25rem 0;
}

.m01-case-id,
.m01-case-detail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0 0.35rem;
}

.m01-case-id {
  color: var(--m01-accent-primary);
  font-weight: 800;
}

/* --- 12. ACCESIBILIDAD Y REDUCCIÓN DE MOVIMIENTO --- */
.m01-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .m01-dot, .m01-hist-bar, .m01-btn, .m01-seg-btn, .m01-step-btn {
    transition: none !important;
  }
}
