/* Fuentes self-hosted (Baloo 2 + Nunito), subsets latin y latin-ext.
   Reemplaza el antiguo @import externo: elimina dependencia de internet y no
   bloquea el render. Archivos en assets/fonts/. */

/* Baloo 2 700 latin-ext */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/baloo2-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Baloo 2 700 latin */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/baloo2-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Baloo 2 800 latin-ext */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/baloo2-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Baloo 2 800 latin */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/baloo2-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 400 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 400 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 700 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/nunito-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 700 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/nunito-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 800 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/nunito-800-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 800 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/nunito-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Nunito 900 latin-ext */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/nunito-900-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Nunito 900 latin */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/nunito-900-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #23324d;
  --muted: #73819c;
  --paper: #f9fbff;
  --cream: #eaf1ff;
  --bg: #eef3fc;
  --yellow: #ffd34e;
  --yellow-deep: #e9a919;
  --coral: #ff7668;
  --teal: #45cbb3;
  --blue: #78a8f5;
  --purple: #9d82e6;
  --danger: #e45954;
  --success: #189b81;
  --border: #23324d;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(35, 50, 77, .05) 1px, transparent 1px);
  background-size: 20px 20px;
}

h1, h2, h3, .display {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
}

a { color: inherit; }

.shell {
  width: min(1000px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.shell-narrow {
  width: min(460px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 { font-size: 20px; }

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  flex: none;
}

.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px;
}

.card-puntos {
  background: #fff1ba;
}

.grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  color: white;
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 8px;
  font: 800 16px/1 'Baloo 2', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease;
}
.btn:active { transform: translateY(3px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[hidden] { display: none; }
.btn-teal { background: var(--teal); border-color: var(--ink); }
.btn-coral { background: var(--coral); border-color: var(--ink); }
.btn-outline { color: var(--ink); background: white; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-width: 2px; }
.btn-icon { min-height: 38px; width: 38px; padding: 0; font-size: 16px; border-width: 2px; }

label { display: block; margin: 0 0 6px; font-weight: 800; font-size: 13px; color: var(--ink); }

input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  color: var(--ink);
  background: #f5f7fb;
  border: 3px solid #dce3ed;
  border-radius: 8px;
  font: 700 15px/1.3 'Nunito', sans-serif;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
}
textarea { min-height: 90px; resize: vertical; }

.field { margin-bottom: 16px; }

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 14px;
  border: 2px solid transparent;
}
.alert-error { color: #8a2a26; background: #ffe6e4; border-color: #f5b6b1; }
.alert-success { color: #0d5f4f; background: #e2f7f2; border-color: #a9e6d8; }

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 80;
  max-width: min(420px, calc(100% - 28px));
  box-shadow: 0 10px 25px rgba(35, 50, 77, .18);
  animation: toast-in .25s ease;
  transform: translateX(-50%);
}
.toast.toast-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
  transition: opacity .35s ease, transform .35s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font: 900 11px/1 'Nunito', sans-serif;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.badge-yellow { color: #8a6110; background: #fff1ba; }
.badge-teal { color: #0d6b58; background: #daf3ec; }
.badge-coral { color: #9c342b; background: #ffe1dd; }
.badge-muted { color: var(--muted); background: #eef1f6; }

.muted { color: var(--muted); }

.stars { color: var(--yellow-deep); letter-spacing: 2px; }

.empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--muted);
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  flex: none;
  padding: 10px 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: white;
  font: 800 14px/1 'Baloo 2', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { background: var(--ink); color: white; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.table th, table.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 2px solid #d7dce6;
}
table.table thead th { border-bottom: 3px solid var(--ink); }
table.table th { font: 900 11px/1 'Nunito'; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
table.table tbody tr:nth-child(even) { background: #f6f7fb; }
table.table th.num, table.table td.num { text-align: center; }
table.table tr.fila-habilitada td { font-weight: 800; }
.table-wrap { overflow-x: auto; border-radius: 8px; }
.drag-handle { width: 28px; text-align: center; color: var(--muted); cursor: grab; touch-action: none; user-select: none; font-size: 15px; }
table.table tr.arrastrando { opacity: .4; }

.actividad-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.actividad-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 4px 6px 0 var(--ink);
}
.actividad-card:active {
  transform: translateY(1px) scale(.99);
  box-shadow: none;
}
.actividad-icono {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  background: var(--acento, var(--yellow));
  border: 3px solid var(--ink);
  border-radius: 10px;
}
.actividad-card h3 { font-size: 18px; }
.actividad-card p { margin: 0; color: var(--muted); font-size: 13.5px; font-weight: 700; }

/* Acentos de color determinísticos (ver color_por_texto() en helpers.php):
   distinguen visualmente actividades/materias sin depender de datos en BD. */
.acento-coral { --acento: var(--coral); }
.acento-teal { --acento: var(--teal); }
.acento-blue { --acento: var(--blue); }
.acento-purple { --acento: var(--purple); }
.acento-yellow { --acento: var(--yellow); }

.card-acento {
  border-left-width: 8px;
  border-left-color: var(--acento, var(--ink));
}

/* Insignia de logro con pulso suave, para llamar la atención sin ser molesta */
.badge-logro { animation: aprende-logro-pulso 1.8s ease-in-out infinite; }
@keyframes aprende-logro-pulso {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Barra de progreso con textura de rayas en movimiento (rango del alumno) */
.barra-progreso {
  background: #eef1f6;
  border-radius: 8px;
  height: 14px;
  overflow: hidden;
}
.barra-progreso > i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, var(--yellow-deep), var(--yellow-deep) 10px, #f3c862 10px, #f3c862 20px);
  background-size: 28px 28px;
  animation: aprende-barra-textura 1.1s linear infinite;
  transition: width .6s ease;
}
@keyframes aprende-barra-textura {
  to { background-position: 28px 0; }
}

/* Mascota guía (búho de SaBio): flota y habla con un mensaje contextual */
.mascota-saludo {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.mascota-icono {
  flex: none;
  font-size: 44px;
  line-height: 1;
  animation: aprende-mascota-flotar 2.6s ease-in-out infinite;
  filter: drop-shadow(2px 3px 0 rgba(35, 50, 77, .15));
}
@keyframes aprende-mascota-flotar {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}
.mascota-saludo .burbuja {
  position: relative;
  background: white;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
}
.mascota-saludo .burbuja p { margin: 0; font-weight: 700; font-size: 14px; }
.mascota-saludo .burbuja::before {
  content: '';
  position: absolute;
  left: -10px;
  bottom: 14px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid var(--ink);
}
.mascota-saludo .burbuja::after {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 15px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid white;
}
@media (max-width: 480px) {
  .mascota-icono { font-size: 34px; }
  .mascota-saludo .burbuja p { font-size: 13px; }
}

/* Confetti de celebración (ver assets/js/core/confeti.js) */
.confeti-contenedor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}
.confeti-pieza {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 13px;
  opacity: 0;
  animation: aprende-confeti-caer linear forwards;
}
@keyframes aprende-confeti-caer {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 1; transform: translateY(105vh) rotate(600deg); }
}

/* Estrellas en cascada + contadores de puntaje (pantalla de resultado y
   dashboard): cada estrella/número anima con animation-delay propio. */
.star-pop {
  display: inline-block;
  opacity: 0;
  transform: scale(.2) rotate(-15deg);
  animation: aprende-estrella-pop .45s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes aprende-estrella-pop {
  to { opacity: 1; transform: scale(1) rotate(0); }
}
.puntaje-total { display: inline-block; }
.puntaje-total.destacado { animation: aprende-puntaje-glow .9s ease; }
@keyframes aprende-puntaje-glow {
  0%, 100% { color: var(--ink); transform: scale(1); }
  35% { color: var(--yellow-deep); transform: scale(1.15); }
}

.selector-curso {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-width: 220px;
  max-width: 100%;
}
.selector-curso .flecha { font-size: 11px; }

.menu-desplegable { position: relative; display: inline-block; }
.menu-desplegable > summary { list-style: none; }
.menu-desplegable > summary.btn { border: none; }
.menu-desplegable > summary::-webkit-details-marker { display: none; }
.menu-desplegable[open] > summary { background: var(--cream); }
.menu-lista {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  min-width: 220px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard, 4px 4px 0 var(--ink));
  overflow: hidden;
}
.menu-lista a {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.menu-lista a:hover { background: var(--cream); }
.menu-lista > * + * { border-top: 2px solid var(--ink); }
.menu-lista-right { left: auto; right: 0; }
.menu-lista-header {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

dialog.modal {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}
dialog.modal::backdrop {
  background: rgba(35, 50, 77, .45);
}
dialog.modal.modal-lg {
  width: min(640px, calc(100% - 32px));
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 3px solid var(--ink);
}
.modal-header h3 { font-size: 16px; }
.modal-cerrar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: white;
  font-weight: 900;
  cursor: pointer;
}
.modal-body {
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.curso-opcion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 800 14px/1.2 'Baloo 2', sans-serif;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.curso-opcion:hover { background: #f5f7fb; }
.curso-opcion.active { background: var(--ink); color: white; }
.curso-opcion .cod { font: 900 11px/1 'Nunito'; color: var(--muted); }
.curso-opcion.active .cod { color: #cfd8ea; }

@media (max-width: 480px) {
  .brand h1 { font-size: 17px; }
  .card { padding: 15px; border-radius: 10px; }
  .btn { font-size: 14px; }
}

/* ===== Utilidades de layout (reemplazan estilos inline repetidos) ===== */
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.between.start { align-items: flex-start; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-18 { margin-bottom: 18px; }

/* Fila de metadatos (📅 Vence · 🎯 Meta · 🔁 Intentos) */
.meta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}
.meta-row.mt { margin-top: 12px; }

/* Bloques numéricos de resumen */
.stat { text-align: center; }
.stat-num { font-size: 26px; font-weight: 900; line-height: 1; }
.stat-num-lg { font: 800 26px/1 'Baloo 2', sans-serif; }
.stat-label { font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 4px; }

/* ===== Spinner / estado de carga ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(35, 50, 77, .2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: aprende-spin .7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }
.loading-box { text-align: center; padding: 24px 16px; }
.loading-box .spinner { margin-bottom: 12px; }
.loading-box p { font-weight: 800; color: var(--muted); margin: 0; }
@keyframes aprende-spin { to { transform: rotate(360deg); } }

/* ===== Splash de arranque (index.php, start_url del PWA) ===== */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--ink);
  z-index: 999;
}
.splash-logo {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  animation: splash-pulso 1.1s ease-in-out infinite;
}
.splash-nombre {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: #fff;
  letter-spacing: .5px;
}
.splash-btn {
  margin-top: 18px;
  min-width: 160px;
}
@keyframes splash-pulso {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .85; }
}

/* ===== Tabla responsive: se apila como tarjetas en móvil ===== */
@media (max-width: 640px) {
  table.table thead { display: none; }
  table.table, table.table tbody, table.table tr, table.table td { display: block; width: 100%; }
  table.table tr {
    border: 2px solid #d7dce6;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
  }
  table.table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
    border-bottom: 1px solid #f2f4f8;
    padding: 8px 0;
  }
  table.table td:last-child { border-bottom: 0; }
  table.table td.num { text-align: right; }
  table.table td::before {
    content: attr(data-label);
    font: 900 11px/1 'Nunito', sans-serif;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }
  table.table td[data-label=""]::before { content: none; }
}
