/* Nexo — estilo elegido el 15-sep-2026 (docs/DISENO.md): base de tarjetas y
   anillos con un tono por módulo, rótulos estrechos, tablas tranquilas de
   filas grandes, oscuro. En el móvil, barra de abajo; en el PC, lateral. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-400-800.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --suelo: #0d0e10;
  --lateral: #121316;
  --panel: #18191d;
  --panel-2: #26282e;
  --campo: #111215;
  --borde: #1f2126;
  --borde-2: #2f323a;
  --texto: #f2f2f4;
  --texto-2: #c3c5cb;
  --texto-3: #9a9ca3;
  --texto-4: #7d8088;
  --acento: #86aaff;
  --acento-fondo: #243052;
  --sobre: #0d0e10;
  --ok: #62d49c;
  --mal: #f08f8f;
  --mal-fondo: #3a2224;
  --ok-fondo: #2b3d33;
  --aviso: #e8c95e;
  --aviso-fondo: #403719;
  --r-tarjeta: 20px;
  --r-pieza: 14px;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --estrecha: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--suelo);
  color: var(--texto);
  font: 15px/1.5 var(--sans);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
b { font-weight: 700; }

/* ── Armazón ────────────────────────────────────────────────────────── */
.lateral { display: none; }
.contenido {
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px 16px 116px; max-width: 640px; margin: 0 auto;
}
.contenido.suelto { padding-bottom: 40px; }

.inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; justify-items: center;
  height: calc(84px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(13, 14, 16, 0.94); backdrop-filter: blur(12px); border-top: 1px solid var(--borde);
}
.inferior a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; min-height: 48px; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--texto-4);
}
.inferior a:hover { text-decoration: none; }
.inferior a.activo { color: var(--texto); }
.inferior a.central span {
  width: 52px; height: 52px; border-radius: 26px; background: var(--acento); color: var(--sobre);
  display: flex; align-items: center; justify-content: center;
}
.inferior a.central.activo span { background: var(--texto); }

@media (min-width: 900px) {
  .armazon { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
  .lateral {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: 26px 16px; background: var(--lateral); border-right: 1px solid var(--borde);
  }
  .inferior, .solo-movil { display: none !important; }
  .contenido { max-width: 1180px; margin: 0; padding: 32px 40px 60px; gap: 20px; }
  .contenido.suelto { margin: 0 auto; }
}
.marca { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--texto); padding: 0 10px 18px; }
.marca:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--texto-2);
}
.nav a:hover { background: var(--panel); text-decoration: none; }
.nav a.activo { background: #1d1f24; color: var(--texto); font-weight: 700; }
.nav a.tenue { color: var(--texto-4); font-weight: 500; }
/* Asignaturas en curso bajo Estudios, en la lateral del PC. */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 18px; padding-left: 8px; border-left: 1px solid var(--borde); min-width: 0; }
.nav-sub a { font-size: 13px; padding: 5px 8px; color: var(--texto-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sub a.activo { background: none; color: var(--texto); font-weight: 600; }
.lateral { overflow-y: auto; }
.sin-cortar { white-space: nowrap; }
button.chip { border: 0; font: inherit; cursor: pointer; }
/* Grafo de dependencias (vis-network dibuja en un canvas). */
.grafo { height: 70vh; min-height: 420px; border-radius: var(--r-pieza); background: #111215; }
.grafo-leyenda { display: flex; gap: 14px; font-size: 12px; color: var(--texto-3); }
.grafo-leyenda span { display: flex; align-items: center; gap: 6px; }
.grafo-leyenda i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid; }
.grafo-leyenda .a1 { background: #1e2a44; border-color: #86aaff; }
.grafo-leyenda .a2 { background: #1d3328; border-color: #62d49c; }
.grafo-leyenda .a3 { background: #3a3319; border-color: #e8c95e; }
.grafo-leyenda .a4 { background: #3a2224; border-color: #f08f8f; }
div.vis-tooltip { background: var(--panel-2); color: var(--texto); border: 1px solid var(--borde); border-radius: 8px; padding: 6px 10px; font: 12px/1.4 system-ui, sans-serif; white-space: pre-line; }
.nav-rotulo { padding: 18px 12px 6px; }
.punto { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.yo {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  color: var(--texto-2); font-weight: 600; font-size: 14px;
}
.yo:hover, .yo.activo { background: var(--panel); text-decoration: none; color: var(--texto); }

/* ── Tipografía y piezas ────────────────────────────────────────────── */
.cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 0 4px; }
.antetitulo { font-size: 13px; font-weight: 500; color: var(--texto-3); }
a.antetitulo:hover { color: var(--texto-2); }
.sub { font-size: 14px; color: var(--texto-3); max-width: 62ch; }
.rotulo {
  font-family: var(--estrecha); font-size: 15px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--texto-3);
}
.rotulo-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 4px 0; }
.enlace-tenue { font-size: 13px; font-weight: 600; color: var(--texto-3); }
/* Editar y borrar quedan a un toque, fuera de la vista normal. */
.editar > summary { list-style: none; cursor: pointer; padding: 10px 4px; font-size: 13px; font-weight: 600; color: var(--texto-3); }
.editar > summary::-webkit-details-marker { display: none; }
.editar[open] > summary { color: var(--texto); }
.editar[open] { display: flex; flex-direction: column; gap: 12px; }
.tenue { color: var(--texto-3); }
.pequeno { font-size: 12px; }
.crece { flex: 1 1 auto; min-width: 0; }
.pila { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pila-corta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.en-linea { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.tarjeta { background: var(--panel); border-radius: var(--r-tarjeta); padding: 16px; color: var(--texto); }
a.tarjeta:hover { text-decoration: none; background: #1c1d22; }
.tarjeta.nota { background: var(--acento-fondo); color: var(--texto); }
.vacio { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; color: var(--texto-2); }

.avatar {
  width: 32px; height: 32px; border-radius: 16px; flex: none; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--texto); font-size: 13px; font-weight: 700;
}
.cabecera .avatar { width: 40px; height: 40px; border-radius: 20px; font-size: 15px; }

/* ── Botones y formularios ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; background: var(--panel-2); color: var(--texto);
}
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn.primario { background: var(--acento); color: var(--sobre); }
.btn.claro { background: var(--texto); color: var(--sobre); }
.btn.peligro { background: var(--mal-fondo); color: var(--mal); }
.btn.grande { width: 100%; min-height: 56px; border-radius: 18px; font-size: 16px; font-weight: 800; }
.borrar {
  min-width: 40px; min-height: 40px; border: 0; background: none; cursor: pointer; border-radius: 20px;
  font: inherit; font-size: 22px; line-height: 1; color: var(--texto-4);
}
.borrar:hover { color: var(--mal); background: var(--mal-fondo); }

input, select, textarea {
  font: inherit; font-size: 16px; color: var(--texto); background: var(--campo);
  border: 1px solid var(--borde-2); border-radius: var(--r-pieza); min-height: 48px; padding: 10px 14px; width: 100%; min-width: 0;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-fondo); }
input[type="date"], input[type="time"] { color-scheme: dark; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; padding: 0; flex: none; accent-color: var(--acento); }
.check-fila { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--texto-2); }
.formulario.linea input[type="date"] { flex: 0 1 170px; }
.formulario.linea select { flex: 0 1 150px; width: auto; }
.campo.en-fila { flex-direction: row; align-items: center; gap: 10px; }
input.corto { width: 96px; }
.formulario { display: flex; flex-direction: column; gap: 14px; }
.formulario.linea { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.formulario.linea input { flex: 1 1 220px; width: auto; }
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--texto-2); min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.desliza { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.chips.desliza::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--texto-2); font: inherit; font-size: 13px; font-weight: 600;
}
.chip:hover { text-decoration: none; background: var(--panel-2); }
.chip.activo { background: var(--texto); color: var(--sobre); font-weight: 700; }

.interruptor {
  --tono: var(--acento);
  width: 50px; height: 30px; border-radius: 15px; border: 0; padding: 3px; cursor: pointer; flex: none;
  background: var(--panel-2); display: flex; align-items: center; transition: background 0.15s;
}
.interruptor span { width: 24px; height: 24px; border-radius: 12px; background: var(--texto-4); transition: transform 0.15s, background 0.15s; }
.interruptor.encendido { background: var(--tono); }
.interruptor.encendido span { background: var(--sobre); transform: translateX(20px); }

/* ── Listas ─────────────────────────────────────────────────────────── */
.lista { list-style: none; margin: 0; background: var(--panel); border-radius: var(--r-tarjeta); padding: 4px 16px; }
.lista .fila { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--panel-2); }
.lista .fila:last-child { border-bottom: 0; }
.lista a { color: var(--texto); }
.fecha { min-width: 76px; font-size: 13px; }
/* Fila con campo (una meta de mejora en Apuntar): el formulario baja a su
   propia línea, alineado con el texto, en vez de estrujar el título. */
.lista .fila.con-campo { flex-wrap: wrap; }
.fila.con-campo form { flex: 1 0 100%; padding-left: 46px; }
.fila.con-campo form input { flex: 1 1 auto; width: auto; }

/* ── Metas ──────────────────────────────────────────────────────────── */
.anillo { flex: none; display: block; }
/* scroll-padding: sin él, el imán del carrusel pega la primera tarjeta al borde de la pantalla. */
.fila-metas { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-padding-inline: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fila-metas::-webkit-scrollbar { display: none; }
.tarjeta-meta { flex: none; width: 156px; display: flex; flex-direction: column; gap: 8px; padding: 14px; scroll-snap-align: start; }
.cifra-meta { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.cifra-meta small { font-size: 13px; font-weight: 600; color: var(--texto-3); }
.titulo-meta { font-size: 14px; font-weight: 700; color: var(--texto); line-height: 1.3; }
.tarjeta-meta .titulo-meta { font-size: 13px; font-weight: 500; color: var(--texto-2); }
.detalle-meta { font-size: 12px; color: var(--texto-3); }
.lista-metas { display: flex; flex-direction: column; gap: 10px; }
.fila-meta { display: flex; align-items: center; gap: 14px; padding: 14px; }
.fila-meta-texto { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fila-meta .cifra-meta { font-size: 17px; }
.meta-grande { display: flex; align-items: center; gap: 20px; padding: 20px; }
.cifra-grande { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.cifra-grande small { font-size: 15px; font-weight: 600; color: var(--texto-3); }

.rejilla-tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tipo { display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.tipo b { font-size: 16px; font-weight: 800; }
.tipo-muestra { font-size: 24px; font-weight: 800; }
.puntos { display: flex; gap: 4px; }
.puntos i { width: 18px; height: 18px; border-radius: 9px; border: 2px solid #4a3322; }
.puntos i.lleno { background: #f4a765; border-color: #f4a765; }

/* ── Módulos ────────────────────────────────────────────────────────── */
.rejilla-modulos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modulo-mini { display: flex; align-items: center; gap: 12px; min-height: 68px; color: var(--texto); }
.modulo-mini:hover { text-decoration: none; }
.bola { flex: none; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
.bola span { width: 12px; height: 12px; border-radius: 6px; }
.lista-modulos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.modulo-ajuste { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.modulo-ajuste.apagado .modulo-mini { opacity: 0.55; }
.interruptores { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.interruptor-fila { display: flex; align-items: center; gap: 10px; margin: 0; }
@media (min-width: 900px) { .lista-modulos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Amigos, enlaces, perfil ────────────────────────────────────────── */
.enlace { display: flex; align-items: center; gap: 8px; }
.enlace input { flex: 1 1 auto; font-size: 14px; min-height: 44px; }
.perfil { display: flex; align-items: center; gap: 14px; }
.perfil .avatar { width: 48px; height: 48px; border-radius: 24px; font-size: 18px; }

/* ── Entrar ─────────────────────────────────────────────────────────── */
.entrar { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.marca-grande { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; }
.separador { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--texto-4); }
.separador::before, .separador::after { content: ""; flex: 1; height: 1px; background: var(--borde-2); }
input.codigo { font-size: 26px; font-weight: 700; letter-spacing: 0.3em; text-align: center; }

/* ── Composición en el PC ───────────────────────────────────────────── */
.portada, .dos-columnas { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 900px) {
  .portada { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
  .dos-columnas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .fila-metas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .tarjeta-meta { width: auto; }
  .chips.desliza { flex-wrap: wrap; margin: 0; padding: 0; }
  h1 { font-size: 36px; }
}

/* ── Estados y piezas comunes de los módulos ────────────────────────── */
.pastilla {
  flex: none; display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--panel-2); color: var(--texto-2);
}
.pastilla.urgente, .pastilla.suspensa { background: var(--mal-fondo); color: var(--mal); }
.pastilla.pronto { background: var(--aviso-fondo); color: var(--aviso); }
.pastilla.en-curso { background: var(--acento-fondo); color: var(--acento); }
.pastilla.aprobada { background: var(--ok-fondo); color: var(--ok); }
/* Novedades: qué clase de cambio es. */
.pastilla.nuevo { background: var(--acento-fondo); color: var(--acento); }
.pastilla.mejorado { background: var(--ok-fondo); color: var(--ok); }
.pastilla.arreglado { background: var(--aviso-fondo); color: var(--aviso); }
.pastilla.nuevo, .pastilla.mejorado, .pastilla.arreglado, .pastilla.fija-ancho { min-width: 84px; text-align: center; flex-shrink: 0; }
.ok-t { color: var(--ok); }
.aviso-t { color: var(--aviso); }
.mal-t { color: var(--mal); }
.cifra-fila { flex: none; font-size: 17px; font-weight: 800; }
.meta-cabeza { display: flex; align-items: center; gap: 16px; }
.cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cifra-caja { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.cifra-caja .rotulo { font-size: 13px; }
.rejilla-secciones { display: flex; flex-direction: column; gap: 20px; }
.subnav { margin-top: -4px; }
.notas-largas { min-height: 150px; }
.tono-estudios { color: #86aaff; }

/* Casilla de hecho: el botón mide 40 px para el dedo; la caja que se ve, 24. */
.casilla {
  flex: none; position: relative; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
}
.casilla::before { content: ""; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--borde-2); box-sizing: border-box; }
.casilla:hover::before { border-color: var(--texto-4); }
.casilla.marcada::before { background: var(--ok); border-color: var(--ok); }
.casilla.marcada::after {
  content: ""; position: absolute; left: 16px; top: 11px; width: 7px; height: 12px;
  border: solid var(--sobre); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.fila.hecha .crece > span:first-child { color: var(--texto-3); text-decoration: line-through; }

.segmento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 0; background: var(--panel); border-radius: 18px; }
.segmento button {
  min-height: 44px; border: 0; border-radius: 14px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--texto-3);
}
.segmento button:hover { color: var(--texto); }
.segmento button.activo { background: var(--panel-2); color: var(--texto); }

/* Minutos a elegir: radios con forma de chip. */
.elegir { border: 0; margin: 0; padding: 0; min-width: 0; }
.elegir legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--texto-2); }
.elegir .chip { position: relative; }
.elegir .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; pointer-events: none; }
.elegir .chip:has(input:checked) { background: var(--texto); color: var(--sobre); font-weight: 700; }
.elegir .chip:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
.elegir input.otros { width: 96px; min-height: 38px; padding: 6px 14px; font-size: 14px; border-radius: 19px; }

.bloque-mod { display: flex; flex-direction: column; gap: 10px; color: var(--texto); }
.pronto { gap: 10px; }
.trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.insignia {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: auto; border-radius: 9px; background: var(--acento); color: var(--sobre); font-size: 11px; font-weight: 800;
}
.inferior a { position: relative; }
.inferior .insignia { position: absolute; top: 2px; right: 8px; margin: 0; }
.fila-aviso { display: flex; align-items: center; gap: 12px; }
.fila-aviso:hover { text-decoration: none; }
.chip.fijo { gap: 8px; cursor: inherit; background: var(--panel-2); color: var(--texto-2); }
.bloque-cifras { display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* ── Estudios ───────────────────────────────────────────────────────── */
.hora { flex: none; min-width: 46px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.fila.pasada { opacity: 0.55; }
.estado-punto { flex: none; width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--texto-4); }
.estado-punto.en-progreso { border-color: var(--acento); background: linear-gradient(90deg, var(--acento) 50%, transparent 50%); }
.estado-punto.completado { border-color: var(--ok); background: var(--ok); }

/* En el móvil el recuento de intentos se esconde (lo dice el título del
   número): así los tres botones y deshacer caben en una línea. */
.fila.ejercicio { gap: 8px; }
@media (max-width: 520px) { .fila.ejercicio .veces { display: none; } }
.cifras.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.num-ej {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; background: var(--panel-2); color: var(--texto-2);
}
.num-ej.bien { background: var(--ok-fondo); color: var(--ok); }
.num-ej.repasar { background: var(--aviso-fondo); color: var(--aviso); }
.num-ej.mal { background: var(--mal-fondo); color: var(--mal); }
.resultados { display: flex; gap: 6px; margin: 0 0 0 auto; }
.res {
  min-height: 36px; padding: 0 10px; border: 0; border-radius: 18px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; background: var(--panel-2); color: var(--texto-2);
}
.res.bien:hover, .res.bien.activo { background: var(--ok-fondo); color: var(--ok); }
.res.repasar:hover, .res.repasar.activo { background: var(--aviso-fondo); color: var(--aviso); }
.res.mal:hover, .res.mal.activo { background: var(--mal-fondo); color: var(--mal); }

.calor-desliza { overflow-x: auto; display: flex; flex-direction: column; gap: 4px; }
.calor, .calor-meses { display: grid; grid-template-columns: repeat(26, minmax(9px, 1fr)); gap: 3px; min-width: 312px; }
.calor { grid-template-rows: repeat(7, auto); grid-auto-flow: column; }
.calor-meses span { font-size: 11px; color: var(--texto-4); white-space: nowrap; }
.celda { aspect-ratio: 1; border-radius: 3px; background: var(--panel-2); }
.celda.n1 { background: #2b3a5e; }
.celda.n2 { background: #3d5590; }
.celda.n3 { background: #5f80d0; }
.celda.n4 { background: #86aaff; }
.celda.futuro { background: transparent; }
/* Días de la semana a la izquierda del mapa y leyenda debajo (del prototipo). */
.calor-meses { margin-left: 19px; }
.calor-fila { display: flex; gap: 5px; }
.calor-fila .calor { flex: 1; }
.calor-dias { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; width: 14px; flex: none; font-size: 10px; line-height: 1; color: var(--texto-3); }
.calor-dias span { display: flex; align-items: center; }
.calor-leyenda { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; color: var(--texto-3); }
.calor-leyenda .celda { width: 11px; }
.barra-fila .pila-corta { gap: 6px; }
.barra { display: block; height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.barra span { display: block; height: 100%; border-radius: 4px; background: var(--acento); }

.dia-horario.hoy > .rotulo { color: var(--acento); }
.fila-bloque { flex-wrap: wrap; }
.fila-bloque > details[open] { flex-basis: 100%; }
/* Rejilla semanal (del prototipo): cada clase en su hora. Solo en PC; en el
   móvil, la lista por días de debajo. */
.rs-caja { display: none; overflow-x: auto; background: var(--panel); border-radius: var(--r-tarjeta); padding: 8px 8px 12px; }
.rs { display: grid; grid-template-columns: 52px repeat(7, minmax(96px, 1fr)); min-width: 760px; }
.rs-cab { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); }
.rs-dia { border-left: 1px solid var(--borde); }
.rs-dia.hoy .rs-cab { color: var(--acento); }
.rs-hora { height: var(--px-hora); padding: 0 8px 0 0; text-align: right; font-size: 11px; color: var(--texto-3); transform: translateY(-7px); }
.rs-cuerpo { position: relative; height: var(--alto); background-image: repeating-linear-gradient(to bottom, var(--borde) 0 1px, transparent 1px var(--px-hora)); }
.rs-bloque { position: absolute; left: 4px; right: 4px; overflow: hidden; padding: 4px 8px; line-height: 1.25; font-size: 12px; background: var(--acento-fondo); border-left: 3px solid var(--acento); border-radius: 8px; color: var(--texto); }
.rs-bloque b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-bloque small { display: block; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tabla-envoltorio { overflow-x: auto; }
/* Tabla fija: la parte se lleva el ancho que sobra y los tres números, 64 px:
   cabe en el móvil sin desplazarse de lado. */
table.calc { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0 6px; }
table.calc th:not(:first-child), table.calc td:not(:first-child) { width: 68px; }
table.calc th {
  padding: 0 4px; text-align: left; font-family: var(--estrecha); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--texto-3);
}
table.calc td { padding: 0 4px; }
table.calc input { min-height: 44px; padding: 8px 10px; }
.resultado { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.pomo { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 26px 16px; }
.pomo-reloj { position: relative; width: min(260px, 70vw); max-width: 100%; aspect-ratio: 1; }
.pomo-anillo { display: block; width: 100%; height: 100%; }
.pomo-anillo circle { fill: none; stroke-width: 12; }
.pomo-anillo .pista { stroke: var(--acento-fondo); }
.pomo-anillo .arco { stroke: var(--acento); stroke-linecap: round; transition: stroke-dashoffset 0.9s linear; }
.pomo.descanso .pomo-anillo .pista { stroke: var(--ok-fondo); }
.pomo.descanso .pomo-anillo .arco { stroke: var(--ok); }
.pomo-centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pomo-tiempo { font-size: 56px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.acciones.centro { justify-content: center; }
.pomo-mini {
  position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 45;
  padding: 10px 16px; border-radius: 20px; background: var(--acento); color: var(--sobre);
  font-size: 13px; font-weight: 800; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.pomo-mini:hover { text-decoration: none; }
.pomo-mini.descanso { background: var(--ok); }

@media (min-width: 900px) {
  .cifras { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  /* Columnas en vez de rejilla: un curso de 2 asignaturas al lado de uno de 5
     ya no deja un hueco debajo. */
  .rejilla-secciones { display: block; columns: 2; column-gap: 22px; }
  .rejilla-secciones > * { break-inside: avoid; margin-bottom: 22px; }
  .rs-caja { display: block; }
  .dias-bloques { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px 22px; align-items: start; }
  .pomo-mini { right: 24px; bottom: 24px; }
}

/* ── Aviso ──────────────────────────────────────────────────────────── */
.aviso {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 100; max-width: min(92vw, 480px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--texto); color: var(--sobre); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }
.aviso.mal { background: var(--mal); color: var(--sobre); }
@media (min-width: 900px) { .aviso { bottom: 32px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
