/* ==========================================================================
   IN4143 - Análisis de Datos e Inferencia Causal (FCFM, Universidad de Chile)
   Auxiliar 10 y Cápsula de Repaso
   Estilos principales (CSS puro, sin frameworks)
   ========================================================================== */

:root {
  --fcfm-navy: #0f2a4a;
  --fcfm-navy-deep: #091c33;
  --fcfm-navy-soft: #1a3d66;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-pauta: #f8fafc;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --success-bg: #ecfdf5;
  --success-border: #6ee7b7;
  --success-text: #065f46;
  --success-solid: #059669;

  --danger-bg: #fef2f2;
  --danger-border: #fca5a5;
  --danger-text: #991b1b;
  --danger-solid: #dc2626;

  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --warning-text: #92400e;

  --teal-accent: #0f766e;
  --orange-accent: #c2410c;

  --sidebar-width: 292px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 74, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 42, 74, 0.07);
  --transition: 0.18s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--fcfm-navy);
  line-height: 1.3;
  margin-top: 0;
}

p {
  margin-top: 0;
  margin-bottom: 0.9rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-subtle);
  color: var(--fcfm-navy);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--fcfm-navy);
  color: #ffffff;
  padding: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(15, 42, 74, 0.18);
}

.mobile-topbar__brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-topbar__code {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 600;
}

.mobile-topbar__title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  z-index: 45;
  backdrop-filter: blur(1px);
}

.sidebar-backdrop.is-open {
  display: block;
}

/* App Shell */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--fcfm-navy);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.sidebar__header {
  padding: 1.35rem 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
  background: rgba(29, 78, 216, 0.35);
  border: 1px solid rgba(147, 197, 253, 0.28);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}

.sidebar__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.sidebar__subtitle {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.35;
}

.sidebar__close {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar__nav {
  padding: 0.9rem 0.75rem;
  flex: 1 0 auto;
}

.sidebar__nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  padding: 0 0.6rem;
  margin-bottom: 0.45rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.52rem 0.65rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 0.855rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

.nav-link.is-active {
  background: var(--accent);
  color: #ffffff;
}

.nav-link__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.nav-link.is-active .nav-link__num {
  background: rgba(255, 255, 255, 0.22);
}

/* Sidebar Progress Checklist */
.sidebar__progress {
  margin: 0.25rem 0.85rem 1.1rem;
  padding: 0.9rem;
  background: rgba(9, 28, 51, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.progress-header__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e2e8f0;
}

.progress-header__count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #93c5fd;
}

.progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.28s ease;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.checklist__item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.2rem 0.25rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.checklist__item label:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.checklist__item input[type="checkbox"] {
  accent-color: #10b981;
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.checklist__item.is-done label {
  color: #94a3b8;
  text-decoration: line-through;
}

.progress-reset {
  margin-top: 0.65rem;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font: inherit;
  font-size: 0.74rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.progress-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 2rem 2.25rem 4rem;
}

.content-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Hero / Header Card */
.hero-card {
  background: linear-gradient(135deg, var(--fcfm-navy) 0%, #163a63 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem 2.2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(96, 165, 250, 0.2) 0%,
    rgba(96, 165, 250, 0) 70%
  );
  pointer-events: none;
}

.hero-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #bfdbfe;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.hero-card__title {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  letter-spacing: -0.015em;
}

.hero-card__lead {
  color: #e2e8f0;
  font-size: 0.98rem;
  max-width: 72ch;
  margin-bottom: 1.25rem;
}

.hero-team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.84rem;
  color: #dbeafe;
}

.hero-team strong {
  color: #ffffff;
}

/* Sections & Cards */
.section {
  scroll-margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}

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

.section-header__kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.section-header__title {
  font-size: 1.42rem;
  font-weight: 700;
  margin: 0;
}

.section-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.45rem 1.6rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.15rem;
}

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.callout strong {
  color: var(--fcfm-navy);
}

/* Objectives Grid */
.objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem;
  margin-top: 0.85rem;
}

.objective-item {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
}

.objective-item__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.objective-item__title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--fcfm-navy);
  margin-bottom: 0.3rem;
}

.objective-item__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.46rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

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

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

.btn--secondary {
  background: #ffffff;
  color: var(--fcfm-navy);
  border-color: var(--border-medium);
}

.btn--secondary:hover {
  background: var(--bg-subtle);
  border-color: #94a3b8;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-light);
}

.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--fcfm-navy);
}

.btn--done {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

.btn--done:hover {
  border-color: var(--success-solid);
  color: var(--success-text);
}

.btn--done.is-completed {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

/* Video Slot Component */
.video-slot {
  margin-bottom: 1.25rem;
}

.video-placeholder {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px dashed #94a3b8;
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
}

.video-placeholder__icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: var(--fcfm-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(15, 42, 74, 0.18);
}

.video-placeholder__body {
  min-width: 0;
  flex: 1;
}

.video-placeholder__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.video-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}

.video-duration {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.video-placeholder__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fcfm-navy);
  margin: 0 0 0.2rem;
}

.video-placeholder__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.video-embed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-embed-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.video-embed-card__title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--fcfm-navy);
  margin: 0;
}

.video-frame-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #0f172a;
}

.video-frame-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Comentes (VyF) */
.comentes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-bottom: 1rem;
}

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

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  background: var(--bg-subtle);
  color: var(--fcfm-navy);
}

.stat-chip--score {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.comente-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  margin-bottom: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}

.comente-card.is-correct {
  border-color: var(--success-border);
}

.comente-card.is-incorrect {
  border-color: var(--danger-border);
}

.comente-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.comente-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.45rem;
  border-radius: 6px;
  background: var(--fcfm-navy);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.topic-badge--refuerzo {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.comente-statement {
  font-size: 0.97rem;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.vyf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.vyf-btn {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.vyf-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.vyf-btn.is-selected-correct {
  background: var(--success-solid);
  border-color: var(--success-solid);
  color: #ffffff;
}

.vyf-btn.is-selected-wrong {
  background: var(--danger-solid);
  border-color: var(--danger-solid);
  color: #ffffff;
}

.vyf-btn.is-correct-hint {
  background: var(--success-bg);
  border-color: var(--success-solid);
  color: var(--success-text);
}

.comente-feedback {
  margin-top: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
}

.comente-feedback.is-visible {
  display: block;
}

.comente-feedback--correct {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.comente-feedback--wrong {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.comente-pauta {
  margin-top: 0.75rem;
  padding: 0.9rem 1.05rem;
  background: var(--bg-pauta);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--fcfm-navy);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: none;
}

.comente-pauta.is-open {
  display: block;
}

.comente-pauta__label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fcfm-navy);
  margin-bottom: 0.35rem;
}

/* Sub-questions (Development Exercises) */
.exercise-intro {
  margin-bottom: 1.25rem;
}

.subquestion {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.subquestion__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.subquestion__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.subquestion__prompt {
  flex: 1;
  min-width: 0;
  font-size: 0.96rem;
  color: var(--text-primary);
}

.subquestion__prompt ol,
.subquestion__prompt ul,
.pauta-content ol,
.pauta-content ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.35rem;
}

.subquestion__prompt li,
.pauta-content li {
  margin-bottom: 0.38rem;
}

.subquestion__actions {
  margin-top: 0.9rem;
  padding-left: 2.5rem;
}

.pauta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition);
}

.pauta-toggle:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.pauta-toggle[aria-expanded="true"] {
  background: var(--fcfm-navy);
  border-color: var(--fcfm-navy);
  color: #ffffff;
}

.pauta-toggle__chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.72rem;
}

.pauta-toggle[aria-expanded="true"] .pauta-toggle__chevron {
  transform: rotate(180deg);
}

.pauta-box {
  display: none;
  margin-top: 0.95rem;
  margin-left: 2.5rem;
  background: var(--bg-pauta);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--fcfm-navy);
  border-radius: var(--radius-sm);
  padding: 1.05rem 1.2rem;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.pauta-box.is-open {
  display: block;
}

.pauta-box__title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fcfm-navy);
  margin-bottom: 0.55rem;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0.9rem 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

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

.data-table th,
.data-table td {
  padding: 0.55rem 0.78rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.data-table thead th {
  background: #f1f5f9;
  color: var(--fcfm-navy);
  font-weight: 700;
  font-size: 0.82rem;
  border-bottom: 2px solid var(--border-medium);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.data-table--centered th,
.data-table--centered td {
  text-align: center;
}

.data-table--centered th:first-child,
.data-table--centered td:first-child {
  text-align: left;
}

.table-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -0.45rem;
  margin-bottom: 0.85rem;
  font-style: italic;
}

/* Math Display Overflow Safety */
.math-block {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.35rem 0;
  margin: 0.5rem 0;
}

.katex-display {
  margin: 0.65rem 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0;
}

/* SVG Figures */
.figure-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  text-align: center;
}

.figure-card svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.figure-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  text-align: left;
}

.figure-caption--center {
  text-align: center;
}

/* Color text utilities matching LaTeX textcolor */
.text-orange {
  color: var(--orange-accent);
  font-weight: 600;
}

.text-blue {
  color: var(--accent);
  font-weight: 600;
}

.text-teal {
  color: var(--teal-accent);
  font-weight: 600;
}

/* Summary Section Styling */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.summary-card__title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--fcfm-navy);
  margin-bottom: 0.7rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-light);
}

.summary-card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.summary-card li {
  margin-bottom: 0.48rem;
}

.contrast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.contrast-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  font-size: 0.89rem;
}

.contrast-box__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fcfm-navy);
  margin-bottom: 0.45rem;
}

.badge-test {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.42rem;
  border-radius: 4px;
  vertical-align: middle;
}

.badge-test--yes {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-test--no {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

/* Footer */
.page-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .mobile-topbar {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    width: min(310px, 86vw);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
    padding: 1.25rem 1rem 3rem;
  }

  .hero-card {
    padding: 1.4rem 1.25rem;
  }

  .hero-card__title {
    font-size: 1.38rem;
  }

  .card {
    padding: 1.15rem 1.1rem;
  }

  .subquestion {
    padding: 1rem 1rem;
  }

  .subquestion__actions,
  .pauta-box {
    margin-left: 0;
    padding-left: 0;
  }

  .video-placeholder {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .mobile-topbar,
  .sidebar-backdrop,
  .btn,
  .pauta-toggle,
  .vyf-options,
  .comentes-toolbar,
  .video-slot {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .pauta-box,
  .comente-pauta {
    display: block !important;
    margin-left: 0;
    break-inside: avoid;
  }

  .card,
  .subquestion,
  .comente-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
