body {
      font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    }

    /* Mejoras de legibilidad KaTeX en móvil y modo oscuro */
    .katex-display {
      overflow-x: auto;
      overflow-y: hidden;
      padding: 0.45rem 0.25rem;
      margin: 0.6rem 0;
      -webkit-overflow-scrolling: touch;
    }
    .katex {
      font-size: 1.03em;
    }
    .dark .katex {
      color: #e2e8f0;
    }

    /* Transiciones suaves para desplegables */
    .accordion-content {
      display: grid;
      grid-template-rows: 0fr;
      transition: grid-template-rows 0.26s ease-out;
    }
    .accordion-content.open {
      grid-template-rows: 1fr;
    }
    .accordion-inner {
      overflow: hidden;
    }

    /* Scrollbar sutil */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: rgba(148, 163, 184, 0.35);
      border-radius: 9999px;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: rgba(148, 163, 184, 0.55);
    }

    /* Visualizaciones matemáticas SVG (LP, Funciones, Diagramas de árbol) */
    .edu-viz {
      margin: 0.9rem 0;
      border-radius: 0.85rem;
      border: 1px solid #e2e8f0;
      background: #f8fafc;
      padding: 0.75rem 0.75rem 0.6rem;
    }
    .dark .edu-viz {
      border-color: #334155;
      background: #0f172a;
    }
    .edu-viz-title {
      font-size: 0.75rem;
      font-weight: 700;
      color: #475569;
      margin-bottom: 0.4rem;
      text-align: center;
      letter-spacing: 0.01em;
    }
    .dark .edu-viz-title {
      color: #cbd5e1;
    }
    .edu-viz svg {
      display: block;
      width: 100%;
      max-width: 560px;
      height: auto;
      margin: 0 auto;
      font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    }
    .viz-grid { stroke: #e2e8f0; stroke-width: 1; }
    .dark .viz-grid { stroke: #1e293b; }
    .viz-axis { stroke: #64748b; stroke-width: 1.5; }
    .dark .viz-axis { stroke: #94a3b8; }
    .viz-tick-text { fill: #64748b; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
    .dark .viz-tick-text { fill: #94a3b8; }
    .viz-region { fill: rgba(11, 94, 215, 0.16); stroke: none; }
    .dark .viz-region { fill: rgba(96, 165, 250, 0.22); }
    .viz-area { fill: rgba(16, 185, 129, 0.20); stroke: none; }
    .dark .viz-area { fill: rgba(52, 211, 153, 0.22); }
    .viz-line { stroke: #2563eb; stroke-width: 1.7; fill: none; }
    .dark .viz-line { stroke: #60a5fa; }
    .viz-line-sec { stroke: #0ea5e9; stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
    .dark .viz-line-sec { stroke: #38bdf8; }
    .viz-curve { stroke: #0b5ed7; stroke-width: 2.3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .dark .viz-curve { stroke: #60a5fa; }
    .viz-tangent { stroke: #f59e0b; stroke-width: 1.9; stroke-dasharray: 6 4; fill: none; }
    .dark .viz-tangent { stroke: #fbbf24; }
    .viz-asym { stroke: #ef4444; stroke-width: 1.4; stroke-dasharray: 5 4; fill: none; }
    .dark .viz-asym { stroke: #f87171; }
    .viz-opt-edge { stroke: #059669; stroke-width: 4; stroke-linecap: round; fill: none; }
    .dark .viz-opt-edge { stroke: #34d399; }
    .viz-dot { fill: #0b5ed7; stroke: #ffffff; stroke-width: 1.8; }
    .dark .viz-dot { fill: #60a5fa; stroke: #0f172a; }
    .viz-dot-opt { fill: #059669; stroke: #ffffff; stroke-width: 2; }
    .dark .viz-dot-opt { fill: #34d399; stroke: #0f172a; }
    .viz-dot-hole { fill: #f8fafc; stroke: #0b5ed7; stroke-width: 2.2; }
    .dark .viz-dot-hole { fill: #0f172a; stroke: #60a5fa; }
    .viz-label { fill: #1e293b; font-size: 11px; font-weight: 700; paint-order: stroke; stroke: #f8fafc; stroke-width: 3.5px; stroke-linejoin: round; }
    .dark .viz-label { fill: #f1f5f9; stroke: #0f172a; }
    .viz-label-opt { fill: #047857; font-size: 11px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 3.5px; stroke-linejoin: round; }
    .dark .viz-label-opt { fill: #6ee7b7; stroke: #0f172a; }
    .viz-tree-edge { stroke: #94a3b8; stroke-width: 1.8; fill: none; }
    .dark .viz-tree-edge { stroke: #64748b; }
    .viz-tree-node { fill: #ffffff; stroke: #cbd5e1; stroke-width: 1.4; }
    .dark .viz-tree-node { fill: #1e293b; stroke: #475569; }
    .viz-tree-root { fill: #eff6ff; stroke: #2563eb; stroke-width: 1.6; }
    .dark .viz-tree-root { fill: #172554; stroke: #60a5fa; }
    .viz-tree-prob-bg { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 1; }
    .dark .viz-tree-prob-bg { fill: #0f172a; stroke: #334155; }
    .viz-tree-text { fill: #1e293b; font-size: 11.5px; font-weight: 700; }
    .dark .viz-tree-text { fill: #f1f5f9; }
    .viz-tree-prob { fill: #1d4ed8; font-size: 10.5px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
    .dark .viz-tree-prob { fill: #93c5fd; }
.ad-slot { overflow: hidden; }
.viz-region { fill: rgba(11, 94, 215, 0.16); }
.dark .viz-region { fill: rgba(96, 165, 250, 0.22); }
.viz-line { stroke: #2563eb; }
.dark .viz-line { stroke: #60a5fa; }
.viz-lp-line-0 { stroke: #2563eb; stroke-width: 1.9; fill: none; }
.dark .viz-lp-line-0 { stroke: #60a5fa; }
.viz-lp-line-1 { stroke: #7c3aed; stroke-width: 1.9; fill: none; }
.dark .viz-lp-line-1 { stroke: #a78bfa; }
.viz-lp-line-2 { stroke: #d97706; stroke-width: 1.9; fill: none; }
.dark .viz-lp-line-2 { stroke: #fbbf24; }
.viz-lp-line-3 { stroke: #db2777; stroke-width: 1.9; fill: none; }
.dark .viz-lp-line-3 { stroke: #f472b6; }
.viz-lp-line-4 { stroke: #0891b2; stroke-width: 1.9; fill: none; }
.dark .viz-lp-line-4 { stroke: #22d3ee; }
.viz-lp-lbl-0 { fill: #1d4ed8; font-size: 11.5px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 4px; stroke-linejoin: round; }
.dark .viz-lp-lbl-0 { fill: #93c5fd; stroke: #0f172a; }
.viz-lp-lbl-1 { fill: #6d28d9; font-size: 11.5px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 4px; stroke-linejoin: round; }
.dark .viz-lp-lbl-1 { fill: #c4b5fd; stroke: #0f172a; }
.viz-lp-lbl-2 { fill: #b45309; font-size: 11.5px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 4px; stroke-linejoin: round; }
.dark .viz-lp-lbl-2 { fill: #fcd34d; stroke: #0f172a; }
.viz-lp-lbl-3 { fill: #be185d; font-size: 11.5px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 4px; stroke-linejoin: round; }
.dark .viz-lp-lbl-3 { fill: #f9a8d4; stroke: #0f172a; }
.viz-lp-lbl-4 { fill: #0e7490; font-size: 11.5px; font-weight: 800; paint-order: stroke; stroke: #f8fafc; stroke-width: 4px; stroke-linejoin: round; }
.dark .viz-lp-lbl-4 { fill: #67e8f9; stroke: #0f172a; }
.viz-curve { stroke: #0b5ed7; }
.dark .viz-curve { stroke: #60a5fa; }
.viz-dot { fill: #0b5ed7; }
.dark .viz-dot { fill: #60a5fa; }
.viz-dot-hole { stroke: #0b5ed7; }
.dark .viz-dot-hole { stroke: #60a5fa; }
.viz-tree-root { fill: #eff6ff; stroke: #2563eb; }
.dark .viz-tree-root { fill: #172554; stroke: #60a5fa; }
.viz-tree-prob { fill: #1d4ed8; }
.dark .viz-tree-prob { fill: #93c5fd; }
.viz-plane { fill: rgba(37, 99, 235, 0.10); stroke: rgba(37, 99, 235, 0.48); stroke-width: 1.4; }
.dark .viz-plane { fill: rgba(96, 165, 250, 0.14); stroke: rgba(96, 165, 250, 0.50); }
.viz-plane-sec { fill: rgba(16, 185, 129, 0.10); stroke: rgba(5, 150, 105, 0.50); stroke-width: 1.4; stroke-dasharray: 5 3; }
.dark .viz-plane-sec { fill: rgba(52, 211, 153, 0.14); stroke: rgba(52, 211, 153, 0.50); }
.viz-face { fill: rgba(14, 165, 233, 0.14); stroke: #0284c7; stroke-width: 1.5; stroke-linejoin: round; }
.dark .viz-face { fill: rgba(56, 189, 248, 0.18); stroke: #38bdf8; }
.viz-face-alt { fill: rgba(16, 185, 129, 0.14); stroke: #059669; stroke-width: 1.5; stroke-linejoin: round; }
.dark .viz-face-alt { fill: rgba(52, 211, 153, 0.18); stroke: #34d399; }
.viz-shape { fill: rgba(37, 99, 235, 0.12); stroke: #2563eb; stroke-width: 2; stroke-linejoin: round; }
.dark .viz-shape { fill: rgba(96, 165, 250, 0.16); stroke: #60a5fa; }
.viz-water { fill: rgba(14, 165, 233, 0.18); stroke: #0ea5e9; stroke-width: 1.4; }
.dark .viz-water { fill: rgba(56, 189, 248, 0.22); stroke: #38bdf8; }
.viz-vec { stroke: #2563eb; stroke-width: 2.2; fill: none; }
.dark .viz-vec { stroke: #60a5fa; }
.viz-vec-opt { stroke: #059669; stroke-width: 2.3; fill: none; }
.dark .viz-vec-opt { stroke: #34d399; }
.viz-vec-sec { stroke: #0ea5e9; stroke-width: 2; fill: none; }
.dark .viz-vec-sec { stroke: #38bdf8; }
.viz-perp { stroke: #f59e0b; stroke-width: 1.8; stroke-dasharray: 5 4; fill: none; }
.dark .viz-perp { stroke: #fbbf24; }
.viz-dim { stroke: #64748b; stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; }
.dark .viz-dim { stroke: #94a3b8; }
.viz-right-angle { fill: none; stroke: #f59e0b; stroke-width: 1.7; stroke-linejoin: round; }
.dark .viz-right-angle { stroke: #fbbf24; }
.viz-axis-triad { stroke: #94a3b8; stroke-width: 1.4; fill: none; }
.dark .viz-axis-triad { stroke: #64748b; }
.viz-muted-text { fill: #475569; font-size: 10.5px; font-weight: 600; paint-order: stroke; stroke: #f8fafc; stroke-width: 3px; stroke-linejoin: round; }
.dark .viz-muted-text { fill: #cbd5e1; stroke: #0f172a; }
.viz-sec-text { fill: #0369a1; font-size: 11px; font-weight: 700; paint-order: stroke; stroke: #f8fafc; stroke-width: 3px; stroke-linejoin: round; }
.dark .viz-sec-text { fill: #38bdf8; stroke: #0f172a; }
.slot-window {
  position: relative;
  height: 210px;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: inset 0 24px 28px -14px rgba(15, 23, 42, 0.28), inset 0 -24px 28px -14px rgba(15, 23, 42, 0.28);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 17%, #000 83%, transparent 100%);
}
.dark .slot-window {
  box-shadow: inset 0 26px 32px -12px rgba(2, 6, 23, 0.72), inset 0 -26px 32px -12px rgba(2, 6, 23, 0.72);
}
.slot-reel-track {
  will-change: transform, filter;
  transition: transform 1.8s cubic-bezier(0.15, 0.85, 0.25, 1), filter 0.2s ease-out;
}
.slot-reel-track.slot-spinning {
  filter: blur(1px);
}
.slot-reel-item {
  height: 210px;
  box-sizing: border-box;
  overflow: hidden;
}
@keyframes slotSettleBounce {
  0% { transform: translateY(0px); }
  45% { transform: translateY(8px); }
  100% { transform: translateY(0px); }
}
.slot-reel-track.slot-settled {
  animation: slotSettleBounce 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
