/*!
 * CRECE 10 · Matemáticas
 * © 2026 Dr. Yonatan Guerrero, creador y desarrollador de CRECE 10.
 * Todos los derechos reservados.
 */
/* ============================================================
   Proyecto CRECE 10 · Matemáticas
   Sistema de diseño: papel cálido, tinta verde, acento coral.
   Sin dependencias externas. Funciona offline.
   ============================================================ */

:root {
  --papel: #faf6ee;
  --papel-2: #f3ecdd;
  --blanco: #ffffff;
  --tinta: #14211f;
  --tinta-2: #3d504c;
  --tinta-3: #6b7c78;
  --linea: #ded4c3;
  --linea-2: #ece4d6;
  --verde: #0e6b63;
  --verde-oscuro: #0a4f49;
  --verde-claro: #e2f0ec;
  --coral: #c2412d;
  --coral-claro: #fbe8e3;
  --oro: #9a6b00;
  --oro-claro: #f7edcf;
  --azul: #3a4e8c;
  --azul-claro: #e8ecf8;
  --ciruela: #7a3e65;
  --ciruela-claro: #f4e6ef;
  --oliva: #3f6b2e;
  --oliva-claro: #e8f0e2;

  --fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fuente-titulo: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --fuente-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radio: 14px;
  --radio-sm: 9px;
  --sombra: 0 1px 2px rgba(20, 33, 31, .05), 0 12px 28px -18px rgba(20, 33, 31, .35);
  --sombra-alta: 0 2px 4px rgba(20, 33, 31, .06), 0 24px 48px -24px rgba(20, 33, 31, .35);
  --max: 1120px;
  --nav-h: 66px;
  --trans: 180ms cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--fuente-titulo); font-weight: 600; line-height: 1.15; margin: 0 0 .35em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); }
h3 { font-size: clamp(1.15rem, 1.7vw, 1.35rem); }
p { margin: 0 0 1em; }
a { color: var(--verde); text-underline-offset: 3px; }
a:hover { color: var(--verde-oscuro); }
strong { font-weight: 650; }
small { font-size: .84rem; }

:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: #d8e9e4; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--tinta); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top var(--trans);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ===================== Estructura ===================== */
.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.section { padding: clamp(38px, 6vw, 72px) 0; }
.section + .section { border-top: 1px solid var(--linea-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head p { max-width: 580px; color: var(--tinta-2); margin: .2em 0 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--verde); margin-bottom: 10px;
}

.muted { color: var(--tinta-2); }
.tiny { font-size: .82rem; color: var(--tinta-3); }
.center { text-align: center; }
.stack > * + * { margin-top: 14px; }
.nowrap { white-space: nowrap; }

/* ===================== Barra superior ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 238, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.topbar-inner {
  height: var(--nav-h); display: flex; align-items: center; gap: 26px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--tinta); flex: 0 0 auto; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--fuente-titulo); font-size: 1.06rem; letter-spacing: .01em; }
.brand-text span { font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-3); }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; color: var(--tinta-2); font-size: .93rem; font-weight: 550;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
  transition: background var(--trans), color var(--trans);
}
.nav a:hover { background: var(--papel-2); color: var(--tinta); }
.nav a[aria-current="page"] { color: var(--verde); background: var(--verde-claro); }

.top-actions { display: flex; gap: 6px; align-items: center; margin-left: 10px; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid var(--linea); background: var(--blanco);
  border-radius: 8px; cursor: pointer; color: var(--tinta-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--trans);
}
.icon-btn:hover { border-color: var(--tinta-3); color: var(--tinta); }
.icon-btn svg { width: 17px; height: 17px; }

.menu-toggle { display: none; }

/* ===================== Botones ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--fuente-texto); font-size: .95rem; font-weight: 650;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: transform var(--trans), background var(--trans), border-color var(--trans), box-shadow var(--trans);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--verde); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 8px 18px -12px rgba(14,107,99,.9); }
.btn-primary:hover { background: var(--verde-oscuro); color: #fff; }
.btn-secondary { background: var(--blanco); color: var(--tinta); border-color: var(--linea); }
.btn-secondary:hover { border-color: var(--tinta-3); background: #fff; }
.btn-ghost { background: transparent; color: var(--tinta-2); border-color: transparent; }
.btn-ghost:hover { background: var(--papel-2); color: var(--tinta); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: #a5361f; color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 8px; }
.btn-lg { padding: 15px 28px; font-size: 1.02rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ===================== Home ===================== */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 5vw, 56px); }
.hero-grid { display: grid; grid-template-columns: 1.32fr .68fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: .3em; font-size: clamp(2.05rem, 3.8vw, 3rem); }
.hero h1 em { font-style: normal; color: var(--verde); }

/* Símbolo de paralelas (∥): app.js lo envuelve en .par. Con la letra del sistema
   se ve como dos rayitas diminutas; se agranda y se le da aire sin mover la línea.
   #vista sube la especificidad para ganarle a reglas como «.formula span». */
#vista .par {
  font-family: "Cambria Math", "STIX Two Math", "Segoe UI Symbol", "Apple Symbols", var(--fuente-texto);
  font-size: 1.18em; font-weight: 400; line-height: 0; margin: 0 .1em;
  vertical-align: -.04em; display: inline-block;
}
.lead { font-size: clamp(1.02rem, 1.6vw, 1.16rem); color: var(--tinta-2); max-width: 56ch; }
.hero .btn-row { margin-top: 26px; }
.hero-note { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 24px; font-size: .84rem; color: var(--tinta-3); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 15px; height: 15px; color: var(--verde); }

.route-card {
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 18px;
  padding: 26px; box-shadow: var(--sombra-alta); position: relative; overflow: hidden;
}
.route-card h3 { margin-bottom: 4px; }
.route-card .tiny { margin-bottom: 18px; }
.route-step {
  display: flex; gap: 13px; align-items: flex-start; padding: 12px 0; border-top: 1px dashed var(--linea-2);
}
.route-step:first-of-type { border-top: 0; }
.route-num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--verde-claro); color: var(--verde); font-size: .78rem; font-weight: 800;
  display: grid; place-items: center; margin-top: 2px;
}
.route-step b { display: block; font-size: .95rem; }
.route-step span { font-size: .86rem; color: var(--tinta-2); line-height: 1.45; display: block; }
.route-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linea-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--linea); border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; margin-top: clamp(34px, 5vw, 58px); }
.stat { background: var(--blanco); padding: 18px 20px; }
.stat b { display: block; font-family: var(--fuente-titulo); font-size: 1.55rem; line-height: 1; margin-bottom: 4px; }
.stat span { font-size: .8rem; color: var(--tinta-3); }

/* ===================== Tarjetas ===================== */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 24px; transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--sombra); border-color: #cdbfa9; }
.card h3 { margin-bottom: .3em; }
.card p:last-child { margin-bottom: 0; }
.card-top { display: flex; justify-content: space-between; gap: 8px 12px; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; }

.skill-card { position: relative; padding: 22px; display: flex; flex-direction: column; min-height: 210px; text-decoration: none; color: inherit; }
.skill-card::after { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, var(--verde)); opacity: .9; }
.skill-mono {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-family: var(--fuente-titulo); font-weight: 700; font-size: 1.05rem;
  background: color-mix(in srgb, var(--c, var(--verde)) 12%, white);
  color: var(--c, var(--verde)); border: 1px solid color-mix(in srgb, var(--c, var(--verde)) 22%, white);
}
.skill-card h3 { font-size: 1.16rem; margin: 12px 0 4px; }
.skill-card .tag { font-size: .73rem; color: var(--tinta-3); letter-spacing: .04em; text-transform: uppercase; font-weight: 650; }
.skill-card p { font-size: .88rem; color: var(--tinta-2); margin: 8px 0 14px; }
.skill-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.skill-foot .tiny { margin-left: auto; }

.bar { height: 6px; background: var(--linea-2); border-radius: 99px; overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; background: var(--c, var(--verde)); border-radius: 99px; transition: width .5s ease; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .73rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; background: var(--papel-2); color: var(--tinta-2);
  border: 1px solid var(--linea);
}
.chip.verde { background: var(--verde-claro); color: var(--verde-oscuro); border-color: #bfdcd5; }
.chip.coral { background: var(--coral-claro); color: #8f2c1a; border-color: #f0c6bc; }
.chip.oro { background: var(--oro-claro); color: #6d4a00; border-color: #e8d49c; }
.chip.azul { background: var(--azul-claro); color: #2b3b6d; border-color: #c9d2ee; }

/* ===================== Anillos y progreso ===================== */
.ring { --p: 0; --size: 62px; width: var(--size); height: var(--size); position: relative; flex: 0 0 auto; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--c, var(--verde)) calc(var(--p) * 1%), var(--linea-2) 0);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%);
  mask: radial-gradient(circle, transparent 56%, #000 57%);
}
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; font-family: var(--fuente-texto); color: var(--tinta); }

/* ===================== Callout / nota ===================== */
.callout {
  border-left: 3px solid var(--verde); background: var(--verde-claro);
  padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 18px 0;
  font-size: .93rem;
}
.callout.coral { border-color: var(--coral); background: var(--coral-claro); }
.callout.oro { border-color: var(--oro); background: var(--oro-claro); }
.callout b { display: block; margin-bottom: 3px; }
.callout p:last-child { margin: 0; }

/* ===================== Importar progreso ===================== */
.importar { cursor: pointer; position: relative; }
.importar:focus-within { outline: 3px solid var(--verde); outline-offset: 2px; }
.import-msg {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: .9rem;
  border-left: 3px solid var(--coral); background: var(--coral-claro);
}
.import-msg.ok { border-color: var(--verde); background: var(--verde-claro); }

/* ===================== Aprende ===================== */
.module-head { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.module-title { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.module-title .skill-mono { width: 52px; height: 52px; font-size: 1.3rem; border-radius: 14px; }
.module-title h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: 0; }
.module-side { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px; }
.module-side h4 { font-family: var(--fuente-texto); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--tinta-3); margin-bottom: 10px; }
.module-side ul { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--tinta-2); }
.module-side li + li { margin-top: 6px; }

.idea { padding: 18px 0; border-top: 1px solid var(--linea-2); }
.idea:first-child { border-top: 0; padding-top: 0; }
.idea h3 { font-size: 1.08rem; margin-bottom: .25em; }
.idea p { color: var(--tinta-2); font-size: .94rem; margin: 0; }

.formula-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.formula {
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 10px; padding: 14px 16px;
}
.formula b { display: block; font-family: var(--fuente-mono); font-size: .9rem; color: var(--verde-oscuro); margin-bottom: 4px; }
.formula span { font-size: .84rem; color: var(--tinta-2); display: block; line-height: 1.45; }

.worked { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; }
.worked-head { padding: 18px 22px; background: var(--papel-2); border-bottom: 1px solid var(--linea); }
.worked-head h3 { margin: 0; font-size: 1.1rem; }
.worked-body { padding: 20px 22px; }
.worked ol { margin: 0 0 14px; padding-left: 22px; }
.worked li { margin-bottom: 9px; color: var(--tinta-2); }
.worked .answer { font-weight: 700; color: var(--tinta); background: var(--verde-claro); padding: 10px 14px; border-radius: 8px; display: inline-block; }

.error-grid { display: grid; gap: 12px; }
.error-item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--linea-2); }
.error-item:first-child { border-top: 0; }
.error-x { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--coral-claro); color: var(--coral); display: grid; place-items: center; font-weight: 800; font-size: .8rem; margin-top: 2px; }
.error-item b { font-size: .92rem; display: block; }
.error-item span { font-size: .87rem; color: var(--tinta-2); }

/* ===================== Práctica: configuración ===================== */
.setup { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.setup-list { display: grid; gap: 10px; }
.setup-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; font: inherit; color: inherit;
  transition: var(--trans);
}
.setup-item:hover { border-color: #c6b79f; }
.setup-item[aria-pressed="true"] { border-color: var(--verde); background: var(--verde-claro); box-shadow: 0 0 0 2px rgba(14,107,99,.12); }
.setup-item .skill-mono { width: 34px; height: 34px; font-size: .9rem; border-radius: 9px; }
.setup-item b { display: block; font-size: .95rem; }
.setup-item span { display: block; font-size: .8rem; color: var(--tinta-3); }
.setup-item .check { margin-left: auto; color: var(--verde); opacity: 0; }
.setup-item[aria-pressed="true"] .check { opacity: 1; }

.seg { display: inline-flex; background: var(--papel-2); border: 1px solid var(--linea); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 600;
  padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--tinta-2);
}
.seg button[aria-pressed="true"] { background: var(--blanco); color: var(--tinta); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ===================== Motor de preguntas ===================== */
.quiz { max-width: 820px; margin-inline: auto; }
.quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.quiz-head .tiny { margin-left: auto; white-space: nowrap; }
.quiz-head [data-action="flag"][aria-pressed="true"] { color: var(--oro); background: var(--oro-claro); }
@media (max-width: 520px) {
  /* En el celular caben Salir, ruta, contador, voz y bandera en una línea */
  .quiz-head { gap: 4px; }
  .quiz-head .btn-sm { padding-inline: 8px; }
  .quiz-head .chip { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.progress-line { height: 5px; background: var(--linea-2); border-radius: 99px; overflow: hidden; margin-bottom: 26px; }
.progress-line i { display: block; height: 100%; background: var(--verde); transition: width .35s ease; }

.q-card { background: var(--blanco); border: 1px solid var(--linea); border-radius: 18px; padding: clamp(20px, 3.4vw, 34px); box-shadow: var(--sombra); }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.q-stem { font-size: 1.08rem; line-height: 1.65; }
.q-stem p:last-child { margin-bottom: 0; }
.q-stem strong { background: linear-gradient(transparent 62%, var(--oro-claro) 62%); }
.figure { margin: 20px 0; background: #fdfcf9; border: 1px solid var(--linea-2); border-radius: 12px; padding: 14px; text-align: center; }
.figure svg { width: 100%; max-width: 460px; height: auto; }
.figure figcaption { font-size: .78rem; color: var(--tinta-3); margin-top: 6px; }

.choices { display: grid; gap: 9px; margin: 22px 0 6px; }
.choice {
  display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--linea); border-radius: 11px; padding: 13px 15px;
  font: inherit; font-size: .97rem; color: var(--tinta); cursor: pointer;
  transition: var(--trans);
}
.choice:hover:not(:disabled) { border-color: #bfae94; background: #fffdf8; }
.choice .key {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--linea); display: grid; place-items: center;
  font-size: .78rem; font-weight: 800; color: var(--tinta-3); background: var(--papel);
}
.choice[aria-pressed="true"] { border-color: var(--verde); background: var(--verde-claro); }
.choice[aria-pressed="true"] .key { background: var(--verde); color: #fff; border-color: var(--verde); }
.choice.correct { border-color: #2f7d4f; background: #e8f5ec; }
.choice.correct .key { background: #2f7d4f; color: #fff; border-color: #2f7d4f; }
.choice.wrong { border-color: #b5452f; background: #fbeae6; }
.choice.wrong .key { background: #b5452f; color: #fff; border-color: #b5452f; }
.choice:disabled { cursor: default; }
.choice .mark { margin-left: auto; font-size: .9rem; font-weight: 700; }

.num-entry { display: flex; gap: 10px; align-items: center; margin: 20px 0 6px; flex-wrap: wrap; }
.num-entry input[type="text"] {
  font: inherit; font-size: 1.1rem; padding: 12px 14px; width: 190px;
  border: 1px solid var(--linea); border-radius: 10px; background: #fff; color: var(--tinta);
}
.num-entry input[type="text"]:focus { border-color: var(--verde); outline: 3px solid rgba(14,107,99,.15); }
.num-entry .unit { color: var(--tinta-2); font-size: .95rem; }

textarea.open {
  width: 100%; min-height: 130px; font: inherit; font-size: .96rem; line-height: 1.55;
  padding: 14px; border: 1px solid var(--linea); border-radius: 10px; resize: vertical; background: #fff;
}
textarea.open:focus { border-color: var(--verde); outline: 3px solid rgba(14,107,99,.15); }
/* Opciones que son figuras: cuadrícula 2 × 2 en pantallas anchas */
.choices.figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.figs .choice { align-items: flex-start; }
.choice-fig { flex: 1; display: block; background: #fdfcf9; border-radius: 8px; }
.choice-fig svg { width: 100%; height: auto; display: block; max-height: 170px; }
@media (max-width: 520px) { .choices.figs { grid-template-columns: 1fr; } }

/* Repaso: la idea de la ruta que explica el ítem */
.repaso { margin-top: 10px; background: var(--blanco); border: 1px solid var(--linea); border-left: 3px solid var(--verde); border-radius: 8px; padding: 10px 12px; }
.repaso summary { cursor: pointer; font-size: .9rem; color: var(--tinta-2); }
.repaso summary b { color: var(--verde-oscuro); }
.repaso p { margin: 8px 0 6px; font-size: .9rem; color: var(--tinta); }
.repaso .btn { padding-left: 0; }
.idea.resaltado, .formula.resaltado { outline: 3px solid var(--oro); outline-offset: 4px; border-radius: 10px; background: var(--oro-claro); transition: background 1s; }

/* Plan de 4 semanas: avance por ruta */
.plan-rutas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.plan-rutas .chip.ok { background: var(--verde-claro); color: var(--verde-oscuro); border-color: #bfdcd5; }
.plan-auto { font-size: .78rem; color: var(--verde-oscuro); font-weight: 600; margin-top: 6px; }
.plan-falta { margin-top: 4px; text-align: left; white-space: normal; }

/* Resultado: nivel aproximado */
.nivel { margin-top: 14px; }

/* Demostración de dos columnas */
.proof { margin: 18px 0; border: 1px solid var(--linea); border-radius: 12px; background: #fdfcf9; padding: 14px 16px; }
.proof > p { margin: 0 0 6px; font-size: .95rem; }
.proof > p b { color: var(--verde-oscuro); }
.proof-scroll { overflow-x: auto; margin-top: 10px; }
.proof table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.proof th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tinta-3); padding: 6px 8px; border-bottom: 2px solid var(--linea); }
.proof td { padding: 8px; border-bottom: 1px solid var(--linea-2); vertical-align: top; }
.proof td:first-child { width: 3em; color: var(--tinta-3); font-variant-numeric: tabular-nums; }
.proof tr.gap td { background: var(--oro-claro); }
.proof-q { display: inline-grid; place-items: center; min-width: 2em; height: 1.7em; border: 2px dashed var(--oro); border-radius: 6px; font-weight: 700; color: var(--oro); }
@media (max-width: 520px) {
  .proof { padding: 12px; }
  .proof table { font-size: .84rem; }
  .proof td, .proof th { padding: 6px 5px; }
}
body.alto-contraste .proof tr.gap td { background: #fff3c4; }

.rubric { background: var(--papel); border: 1px dashed var(--linea); border-radius: 10px; padding: 14px 18px; margin: 16px 0; }
.rubric b { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tinta-3); display: block; margin-bottom: 6px; }
.rubric ul { margin: 0; padding-left: 18px; font-size: .9rem; color: var(--tinta-2); }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.actions .spacer { flex: 1; }

.feedback { border-radius: 12px; border: 1px solid var(--linea); border-left-width: 4px; padding: 18px 20px; margin-top: 20px; animation: rise .28s ease both; }
.feedback.ok { border-color: #2f7d4f; background: #f0f8f2; }
.feedback.no { border-color: #b5452f; background: #fdf1ee; }
.feedback h4 { font-family: var(--fuente-texto); font-size: .95rem; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.feedback p { font-size: .92rem; margin: 0 0 8px; color: var(--tinta-2); }
.feedback p:last-child { margin-bottom: 0; }
.feedback .why { background: rgba(255,255,255,.65); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.feedback .why b { color: var(--tinta); }
.feedback ul { margin: 6px 0 0; padding-left: 20px; font-size: .9rem; color: var(--tinta-2); }
.feedback li { margin-bottom: 4px; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ===================== Simulacro ===================== */
.exam-bar {
  position: sticky; top: var(--nav-h); z-index: 20; background: var(--papel);
  border-bottom: 1px solid var(--linea-2); padding: 10px 0; margin-bottom: 22px;
}
.exam-bar-inner { display: flex; align-items: center; gap: 16px; }
.timer { font-family: var(--fuente-mono); font-size: 1.02rem; font-weight: 700; background: var(--blanco); border: 1px solid var(--linea); padding: 7px 13px; border-radius: 8px; }
.timer.low { color: var(--coral); border-color: #e8b8ac; background: var(--coral-claro); }
.exam-bar .bar { max-width: 260px; }
.qmap { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.qmap button {
  width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--linea);
  background: #fff; font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; color: var(--tinta-2);
}
.qmap button.answered { background: var(--verde-claro); border-color: #a9cfc6; color: var(--verde-oscuro); }
.qmap button.flagged { box-shadow: inset 0 0 0 2px var(--oro); }
.qmap button.current { border-color: var(--tinta); background: var(--tinta); color: #fff; }

.result-hero { text-align: center; padding: 40px 20px 26px; }
.result-score { font-family: var(--fuente-titulo); font-size: clamp(3rem, 8vw, 5rem); line-height: 1; color: var(--verde); margin: 8px 0; }
.result-score small { font-size: 1.2rem; color: var(--tinta-3); }

/* ===================== Progreso ===================== */
.mastery-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--linea-2); }
.mastery-row:first-child { border-top: 0; }
.mastery-row .name { flex: 0 0 220px; font-size: .92rem; font-weight: 600; }
.mastery-row .bar { height: 8px; }
.mastery-row .pct { flex: 0 0 44px; text-align: right; font-size: .85rem; font-weight: 700; color: var(--tinta-2); }

.history { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history th, .history td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linea-2); }
.history th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tinta-3); font-weight: 700; }
.history td:last-child, .history th:last-child { text-align: right; }

/* ===================== Herramientas ===================== */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--linea); margin-bottom: 24px; }
.tab {
  border: 0; background: transparent; font: inherit; font-size: .93rem; font-weight: 600;
  padding: 11px 15px; color: var(--tinta-3); cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--verde); border-bottom-color: var(--verde); }

.calc { max-width: 340px; background: var(--blanco); border: 1px solid var(--linea); border-radius: 16px; padding: 16px; box-shadow: var(--sombra); }
.calc-display {
  background: var(--tinta); color: #f5f1e6; font-family: var(--fuente-mono); font-size: 1.5rem;
  text-align: right; padding: 18px 14px; border-radius: 10px; min-height: 66px; overflow-x: auto; margin-bottom: 12px;
}
.calc-display small { display: block; font-size: .7rem; color: #9fb0ab; min-height: 14px; font-family: var(--fuente-texto); }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.calc-keys button {
  border: 1px solid var(--linea); background: #fff; border-radius: 8px; padding: 12px 0;
  font: inherit; font-size: 1rem; cursor: pointer; color: var(--tinta);
}
.calc-keys button:hover { background: var(--papel-2); }
.calc-keys button.op { background: var(--papel); font-weight: 700; }
.calc-keys button.eq { background: var(--verde); color: #fff; border-color: var(--verde); }
.calc-keys button.wide { grid-column: span 2; }

.glossary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gloss { background: #fff; border: 1px solid var(--linea); border-radius: 10px; padding: 14px 16px; }
.gloss b { display: block; font-family: var(--fuente-titulo); font-size: 1rem; margin-bottom: 3px; }
.gloss span { font-size: .86rem; color: var(--tinta-2); line-height: 1.45; }

.search {
  width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--linea);
  border-radius: 10px; background: #fff; margin-bottom: 16px;
}

/* ===================== Estados vacíos ===================== */
.empty { text-align: center; padding: 40px 20px; color: var(--tinta-2); }
.empty svg { width: 42px; height: 42px; color: var(--linea); margin-bottom: 10px; }

/* ===================== Footer ===================== */
.site-foot { border-top: 1px solid var(--linea); padding: 34px 0; margin-top: 30px; background: var(--papel-2); }
.foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: .84rem; color: var(--tinta-3); }
.foot-grid b { color: var(--tinta); font-family: var(--fuente-titulo); font-size: 1rem; }

/* ===================== Responsive ===================== */
/* El menú completo necesita unos 960 px; por debajo se usa el botón de menú */
@media (max-width: 980px) {
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0; background: var(--papel);
    border-bottom: 1px solid var(--linea); flex-direction: column; align-items: stretch;
    padding: 10px 16px 16px; gap: 2px; display: none; box-shadow: var(--sombra);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; }
  .menu-toggle { display: inline-flex; }
  .top-actions { margin-left: auto; }
}

/* Celulares pequeños: que quepan la marca y los tres botones (letra, contraste, menú) */
@media (max-width: 420px) {
  .topbar-inner { gap: 12px; }
  .brand { gap: 8px; }
  .brand-text span { display: none; }
  .top-actions { gap: 4px; }
}

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .route-card { max-width: 520px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .module-head { grid-template-columns: 1fr; }
  .setup { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --nav-h: 60px; }
  body { font-size: 16px; }
  html, body { overflow-x: hidden; }
  .hero h1 { font-size: 2.05rem; }
  .hero .btn-row { flex-direction: column; align-items: stretch; }
  .hero .btn-row .btn { width: 100%; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .formula-list, .glossary { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .mastery-row { flex-wrap: wrap; }
  .mastery-row .name { flex: 1 0 100%; }
  .q-card { padding: 18px; border-radius: 14px; }
  .exam-bar .bar { display: none; }
  .history { font-size: .82rem; }
  .history th:nth-child(2), .history td:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Modo letra grande */
body.letra-grande { font-size: 19px; }
body.letra-grande .q-stem { font-size: 1.18rem; }
body.letra-grande .choice { font-size: 1.02rem; }

/* Modo alto contraste */
body.alto-contraste {
  --papel: #ffffff; --papel-2: #f0f0f0; --linea: #767676; --linea-2: #d0d0d0;
  --tinta: #000; --tinta-2: #1a1a1a; --tinta-3: #333;
  --verde: #005a52; --verde-oscuro: #003d37; --verde-claro: #e3f2ee;
  --coral: #9b2c18; --coral-claro: #fdeae5;
}
body.alto-contraste .card,
body.alto-contraste .q-card { box-shadow: none; }

@media print {
  .topbar, .site-foot, .actions, .exam-bar, .qmap, .tabs { display: none !important; }
  body { background: #fff; }
  .q-card, .card { box-shadow: none; border: 1px solid #999; }
}

/* ===================== Cuenta de la escuela ===================== */
/* Sin haber entrado, solo se ve la marca y los botones de letra y contraste. */
body.sin-sesion .nav,
body.sin-sesion .menu-toggle,
body.sin-sesion .cuenta-chip { display: none !important; }
body.sin-sesion .top-actions { margin-left: auto; }

.entrar { padding-top: clamp(36px, 6vw, 72px); }
.entrar-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.entrar-card { display: grid; gap: 8px; padding: 26px; box-shadow: var(--sombra-alta); }
.entrar-card label { font-weight: 650; font-size: .92rem; margin-top: 6px; }
.entrar-card input {
  font: inherit; font-size: 1.15rem; letter-spacing: .04em; padding: 12px 14px; width: 100%;
  border: 1px solid var(--linea); border-radius: 10px; background: #fff; color: var(--tinta);
}
.entrar-card input:focus { border-color: var(--verde); outline: 3px solid rgba(14,107,99,.18); }
#entCodigo { text-transform: uppercase; font-family: var(--fuente-mono); }
#entError:empty { display: none; }
.entrar-card .btn-lg { margin-top: 10px; justify-content: center; }
@media (max-width: 760px) { .entrar-grid { grid-template-columns: 1fr; } }

.cuenta-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta);
  font-size: .84rem; text-decoration: none; white-space: nowrap; max-width: 220px;
}
.cuenta-chip[hidden] { display: none; }
.cuenta-chip:hover { border-color: var(--verde); }
.cuenta-nombre { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.cuenta-codigo { font-family: var(--fuente-mono); color: var(--tinta-3); font-size: .78rem; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #2f7d4f; }
.sync-enviando .sync-dot { background: var(--oro); animation: latido 1s ease-in-out infinite; }
.sync-pendiente .sync-dot { background: var(--oro); }
.sync-sinconexion .sync-dot { background: transparent; border: 2px solid var(--tinta-3); }
.sync-expirada .sync-dot,
.sync-desactivada .sync-dot { background: var(--coral); }
@keyframes latido { 50% { opacity: .35; } }

.cuenta-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.cuenta-datos dt { font-size: .76rem; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .06em; }
.cuenta-datos dd { margin: 2px 0 0; font-weight: 600; }

/* En celular la píldora muestra solo el punto y el código. */
@media (max-width: 560px) {
  .cuenta-nombre { display: none; }
  .cuenta-chip { padding: 6px 9px; }
}
@media (max-width: 360px) {
  .cuenta-codigo { display: none; }
}

/* ── Ruta Base (preparación) ── */
.base-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  margin-bottom: 18px; padding: 18px 20px; border-radius: 14px;
  background: var(--papel-2); border: 1px dashed var(--c, var(--linea));
}
.base-card h3 { margin: 4px 0 4px; font-size: 1.1rem; }
.base-card p { margin: 0; font-size: .92rem; color: var(--tinta-2); }
.base-acciones { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 760px) {
  .base-card { grid-template-columns: auto 1fr; }
  .base-acciones { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }
}
.base-aviso { border-color: var(--c, #4A5A6A); }

/* ── Pistas por pasos ── */
.pasos-pista { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 10px; }
.pasos-pista li { counter-increment: paso; display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; }
.pasos-pista li::before {
  content: counter(paso); grid-row: 1 / span 2; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--verde); color: #fff;
}
.pasos-pista li b { display: block; margin: 0; }
.pasos-pista li span { font-size: .93rem; }
.pasos-pista li:focus { outline: 2px solid var(--verde); outline-offset: 4px; border-radius: 4px; }
.pistas-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--linea-2); }

/* Opción descartada por una pista o por el primer intento: con texto, no solo color. */
.choice.descartada { opacity: .55; background: var(--papel-2); }
.choice.descartada > span:not(.key) { text-decoration: line-through; }
.choice.descartada .key { background: transparent; }

/* ── Segundo intento ── */
.reintento { margin: 14px 0 0; }
.reintento:focus { outline: 2px solid var(--coral); outline-offset: 2px; }

/* ── Explicación de cada opción ── */
.opciones-exp { margin-top: 12px; }
.opciones-exp > b { display: block; font-size: .9rem; margin-bottom: 6px; }
.opciones-exp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opciones-exp li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .92rem; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.6); border: 1px solid var(--linea-2); }
.opciones-exp li.elegida { border-color: #f0c6bc; background: var(--coral-claro); }
.opciones-exp .key { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; border: 1px solid var(--linea); background: var(--blanco); }
.opciones-exp .chip { margin-right: 4px; }

/* ── Destrezas y niveles (v1.4) ──
   El nivel siempre va con texto (chip o lista); el color solo acompaña. */
:root { --nv1: #e9dfc8; --nv1-b: #c9b48a; --nv2: #a9d3cb; --nv3: #23786e; --nv4: #0a4f49; }
.cuadro { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--linea); background: transparent; flex: none; }
.cuadro.n1 { background: var(--nv1); border-color: var(--nv1-b); }
.cuadro.n2 { background: var(--nv2); border-color: #7fbab0; }
.cuadro.n3 { background: var(--nv3); border-color: var(--nv3); }
.cuadro.n4 { background: var(--nv4); border-color: var(--nv4); box-shadow: inset 0 0 0 2px #fff; }
.cuadritos { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 10px; }
.cuadritos.grande .cuadro { width: 18px; height: 18px; }
.dz-fila { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.dz-fila .cuadritos { margin-top: 0; }
.leyenda-niveles { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--tinta-2); margin: 6px 0 14px; }
.leyenda-niveles span { display: inline-flex; align-items: center; gap: 6px; }
.nivel-chip { border-color: transparent; }
.nivel-chip.n0 { background: var(--papel-2); color: var(--tinta-2); }
.nivel-chip.n1 { background: var(--nv1); color: #5a4416; }
.nivel-chip.n2 { background: #d6ece8; color: #0b4b45; }
.nivel-chip.n3 { background: var(--nv3); color: #fff; }
.nivel-chip.n4 { background: var(--nv4); color: #fff; }

.dz-grid { margin-top: 4px; }
.dz-card { display: flex; flex-direction: column; gap: 8px; }
.dz-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dz-cab h3 { margin: 0; font-size: 1.05rem; }
.dz-card p { margin: 0; font-size: .9rem; }
.dz-medidor { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.dz-medidor i { height: 6px; border-radius: 3px; background: var(--linea-2); }
.dz-medidor i.lleno.n1 { background: var(--nv1-b); }
.dz-medidor i.lleno.n2 { background: #7fbab0; }
.dz-medidor i.lleno.n3 { background: var(--nv3); }
.dz-medidor i.lleno.n4 { background: var(--nv4); }
.dz-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }

/* Ronda en curso */
.ronda-info { display: grid; gap: 8px; margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 12px; background: var(--blanco); }
.ronda-info .chip { margin-left: 6px; }
.ronda-puntos { display: flex; gap: 6px; }
.ronda-puntos .punto { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--linea); display: grid; place-items: center; }
.ronda-puntos .punto.actual { border-color: var(--verde); }
.ronda-puntos .punto.si { background: #2f7d4f; border-color: #2f7d4f; color: #fff; }
.ronda-puntos .punto.no { background: var(--coral-claro); border-color: #e0a99c; color: #8f2c1a; }
.ronda-puntos .punto svg { width: 14px; height: 14px; }
.ronda-resultado .ronda-niveles { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 8px 0 4px; }
.ronda-resultado .btn-row { margin-top: 14px; }
.enlace-paso { padding: 0; margin-top: 4px; min-height: 0; }

/* Progreso por destreza */
.dz-prog-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.dz-conteo { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; }
.dz-ruta { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--linea-2); }
.dz-ruta-nombre { font-weight: 650; color: var(--tinta); text-decoration: none; }
.dz-ruta-nombre:hover { text-decoration: underline; }
.dz-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.dz-lista li { display: flex; align-items: center; gap: 8px; }
.dz-enlace { all: unset; cursor: pointer; font-size: .9rem; flex: 1; min-width: 0; }
.dz-enlace:hover { text-decoration: underline; }
.dz-enlace:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 3px; }
@media (max-width: 620px) { .dz-ruta { grid-template-columns: 1fr; gap: 6px; } }
.result-hero[hidden] { display: none; }
.ronda-info { margin-bottom: 14px; }
@media (max-width: 520px) {
  /* La píldora de la ruta se recorta con «…» en vez de montarse sobre «Pregunta 1 de 4». */
  .quiz-head .chip { display: block; flex: 0 1 auto; min-width: 0; }
  .quiz-head > a { white-space: nowrap; flex: none; }
}

/* ── Cuestionario de ruta (v1.5) ── */
.cuest-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 16px; border-left: 3px solid var(--nv4); }
.cuest-card h3 { margin: 0 0 4px; }
.cuest-card p { margin: 0; font-size: .92rem; }
.cuest-card .btn { flex: none; }
@media (max-width: 760px) { .cuest-card { flex-direction: column; align-items: flex-start; } }
.ronda-info.cuestionario { border-left: 3px solid var(--nv4); }
.cuest-cambios { list-style: none; margin: 14px auto 0; padding: 0; max-width: 620px; text-align: left; display: grid; gap: 6px; }
.cuest-cambios li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--linea-2); border-radius: 10px; background: var(--blanco); }
.cuest-nombre { font-weight: 600; font-size: .92rem; }
.cuest-niveles { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 560px) {
  .cuest-cambios li { grid-template-columns: 1fr auto; }
  .cuest-niveles { grid-column: 1 / -1; }
}

/* ── Videos cortos por idea (v1.6) ── */
.videos { display: grid; gap: 6px; margin-top: 10px; }
.videos.compacto { margin-top: 8px; }
.video-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linea); background: var(--blanco);
  color: var(--verde-oscuro); font-weight: 600; font-size: .86rem; line-height: 1.3; max-width: 100%;
}
.video-btn:hover { border-color: var(--verde); background: var(--verde-claro); }
.video-btn:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }
.video-btn[aria-expanded="true"] { background: var(--verde-claro); border-color: var(--verde); }
.video-btn svg { flex: none; }
.video-caja { margin-top: 8px; max-width: 640px; }
.video-marco { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; }
.video-marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-pie { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 6px; font-size: .84rem; }
.video-pie a { color: var(--verde-oscuro); font-weight: 600; }
.formula .videos { margin-top: 8px; }
