/* =====================================================================
   MAIN · componentes de la interfaz del DTA
   ===================================================================== */

/* ---------- App shell ---------- */
/* Capa ambiental: halos muy sutiles para dar profundidad (evita el look plano) */
body::before {
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:
    radial-gradient(46% 40% at 100% -5%, rgba(239,51,64,.07), transparent 70%),
    radial-gradient(42% 38% at -5% 108%, rgba(43,50,58,.06), transparent 70%);
}
.app { min-height:100%; display:flex; flex-direction:column; }
.topbar {
  position:sticky; top:0; z-index:20; background:rgba(245,246,247,.82);
  backdrop-filter:saturate(1.4) blur(12px); border-bottom:1px solid var(--line);
  box-shadow:0 6px 24px rgba(21,23,27,.03);
}
.topbar-inner { max-width:1120px; margin:0 auto; padding:20px 36px; display:flex; align-items:center; gap:32px; }
.brand { display:flex; align-items:center; white-space:nowrap; padding-right:8px; }
.brandlogo { height:30px; width:auto; display:block; }

/* Phase rail */
.rail { display:flex; align-items:center; gap:14px; flex:1; min-width:0; overflow-x:auto; scrollbar-width:none; }
.rail::-webkit-scrollbar { display:none; }
.phase { display:flex; align-items:center; gap:8px; padding:6px 0; white-space:nowrap; color:var(--ink-3); }
.phase .pip { width:7px; height:7px; border-radius:50%; background:var(--line); flex:none; transition:.25s; }
.phase .plabel { font-size:13px; font-weight:600; letter-spacing:.005em; }
.phase.done .pip { background:var(--ink-3); }
.phase.active .pip { background:var(--accent); box-shadow:0 0 0 4px var(--accent-wash); }
.phase.active { color:var(--accent); }
.phase.done { color:var(--ink-2); }

/* Stage */
.stage { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; padding:56px 24px 120px; }
.view { max-width:760px; width:100%; animation:rise .45s cubic-bezier(.2,.7,.2,1) both; }
.view.narrow { max-width:600px; }
@keyframes rise { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }

.eyebrow {
  font-size:11.5px; font-weight:700; letter-spacing:.16em; text-transform:uppercase; color:var(--accent);
  display:flex; align-items:center; gap:10px;
}
.eyebrow.data { color:var(--data); }
h1, h2, h3, .qtext, .sval, .bp .n { font-family:var(--display); }
h1 { font-size:clamp(40px,6.2vw,64px); line-height:1.0; letter-spacing:-.03em; font-weight:500; margin:22px 0 0; text-wrap:balance; }
h2 { font-size:clamp(24px,3.6vw,34px); line-height:1.1; letter-spacing:-.02em; font-weight:500; margin:14px 0 0; text-wrap:balance; }
.lead { font-size:18px; color:var(--ink-2); max-width:46ch; margin:22px 0 0; line-height:1.6; }
.qtext { font-size:clamp(21px,2.7vw,27px); line-height:1.25; letter-spacing:-.015em; font-weight:500; margin:14px 0 0; text-wrap:balance; }
/* Enunciados largos (situaciones de los quiz del catálogo): «balance»
   igualaba las líneas y dejaba medio ancho vacío a la derecha. */
.qtext.caso { font-size:clamp(19px,2.2vw,22px); line-height:1.35; letter-spacing:-.01em; text-wrap:pretty; }
.hint { font-size:14px; color:var(--ink-3); margin-top:16px; }

/* Cover meta */
.metarow { display:flex; flex-wrap:wrap; gap:10px; margin-top:26px; }
.chip {
  display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line);
  border-radius:999px; padding:8px 14px; font-size:13px; font-weight:600; color:var(--ink-2); box-shadow:var(--shadow-s);
}
.chip b { color:var(--ink); font-weight:700; }
.chip .ic { width:7px; height:7px; border-radius:50%; background:var(--accent); flex:none; }

/* ---------- Portada a dos columnas (CTA sin scroll) ---------- */
.view.cover { max-width:1080px; display:grid; grid-template-columns:1.06fr .94fr; gap:64px; align-items:center;
  min-height:calc(100dvh - 210px); align-content:center; }
.cover-main { min-width:0; }
.cta-row { display:flex; align-items:center; gap:24px; margin-top:38px; flex-wrap:wrap; }
.metarow { margin-top:30px; }

.verseg { display:inline-flex; align-items:center; gap:6px; margin-top:24px; padding:5px; background:var(--surface);
  border:1px solid var(--line); border-radius:999px; box-shadow:var(--shadow-s); }
.verseg-lbl { font-size:11.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); padding:0 10px 0 8px; }
.verseg-btn { border:none; background:transparent; font-family:inherit; font-size:13.5px; font-weight:600; color:var(--ink-2);
  padding:8px 16px; border-radius:999px; cursor:pointer; transition:.15s; }
.verseg-btn:hover { color:var(--ink); }
.verseg-btn.on { background:var(--ink); color:#fff; }

.cover-aside { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:16px 16px 8px; box-shadow:var(--shadow-l); }
.cover-aside::before { content:""; position:absolute; right:-34px; bottom:-38px; width:190px; height:190px; border-radius:50%;
  background:radial-gradient(circle, rgba(239,51,64,.16), transparent 68%); filter:blur(6px); z-index:-1; }
.bprow { display:flex; align-items:baseline; gap:14px; padding:14px 12px; border-radius:10px; transition:.15s; }
.bprow + .bprow { border-top:1px solid var(--line-2); }
.bprow:hover { background:var(--surface-2); }
.bprow-txt { flex:1; min-width:0; }
.bprow-txt h3 { margin:0 0 3px; font-family:var(--sans); font-size:15px; font-weight:600; letter-spacing:0; line-height:1.25; color:var(--ink); }
.bprow-txt span { font-size:12.5px; color:var(--ink-3); font-weight:500; }
.bprow-n { font-size:12.5px; font-weight:600; color:var(--ink-3); font-variant-numeric:tabular-nums; opacity:.65; flex:none; }
/* CTA y confidencialidad dentro del recorrido (columna derecha) */
.cover-aside .btn-block { margin:18px 6px 4px; width:calc(100% - 12px); }
.cover-aside .reassure { display:flex; justify-content:center; padding:6px 6px 8px; }

@media (max-width:900px) {
  .view.cover { grid-template-columns:1fr; gap:30px; }
}

.blocks-preview { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:32px; }
.bp {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-l); padding:20px;
  box-shadow:var(--shadow-s); position:relative; overflow:hidden; transition:.18s;
}
.bp:hover { box-shadow:var(--shadow-m); transform:translateY(-2px); }
.bp-top { display:flex; align-items:center; justify-content:space-between; }
.bp-icon { width:38px; height:38px; border-radius:10px; display:grid; place-items:center; color:var(--accent); background:var(--accent-wash); }
.bp.d .bp-icon { color:var(--data); background:var(--data-wash); }
.bp-icon svg { width:21px; height:21px; }
.bp .n { font-size:13px; font-weight:800; color:var(--ink-3); font-variant-numeric:tabular-nums; letter-spacing:.02em; }
.bp h3 { margin:14px 0 5px; font-size:17px; letter-spacing:-.015em; line-height:1.2; }
.bp p { margin:0; font-size:13.5px; color:var(--ink-2); line-height:1.45; }
.bp-meta { margin-top:12px; padding-top:12px; border-top:1px solid var(--line-2); font-size:12px; font-weight:600; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.bp .edge { position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--accent); }
.bp.d .edge { background:var(--data); }

.reassure { display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--ink-3); font-weight:600; }
.reassure .lock { width:15px; height:15px; opacity:.75; }

.timeline { display:inline-flex; align-items:center; gap:8px; margin-top:16px; font-size:13.5px; color:var(--ink-2); font-weight:600;
  background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:8px 15px; box-shadow:var(--shadow-s); }
.timeline b { color:var(--ink); font-variant-numeric:tabular-nums; }
.timeline .clock { width:16px; height:16px; color:var(--accent); }

@media (max-width:560px) { .blocks-preview { grid-template-columns:1fr; } }

/* Buttons */
.btn {
  appearance:none; border:1px solid transparent; border-radius:999px; font-family:inherit; font-size:15px; font-weight:600;
  padding:13px 24px; cursor:pointer; transition:.18s; display:inline-flex; align-items:center; gap:10px;
}
.btn:focus-visible { outline:3px solid var(--accent-wash); outline-offset:2px; }
.btn-primary { background:var(--accent); color:#fff; box-shadow:0 1px 2px rgba(239,51,64,.28); }
.btn-primary:hover { background:var(--accent-deep); transform:translateY(-1px); }
.btn-primary:disabled { background:#F3C3C7; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-lg { font-size:16.5px; padding:17px 34px; border-radius:999px; }
.btn-block { width:100%; justify-content:center; }
.btn-ghost { background:transparent; color:var(--ink-2); border-color:var(--line); }
.btn-ghost:hover { background:var(--surface); color:var(--ink); border-color:var(--ink-3); }
.btn-ghost:disabled { opacity:.4; cursor:not-allowed; }
.btn .arw { font-size:17px; line-height:1; }

/* ---------- Progreso por secciones (arriba, en la topbar) ---------- */
.sprogress { flex:1; min-width:0; display:flex; align-items:center; gap:14px; }
.sp-segs { flex:1; min-width:0; display:flex; gap:6px; max-width:420px; }
.sp-seg { flex:1; height:6px; background:var(--line); border-radius:999px; overflow:hidden; }
.sp-seg .sp-fill { display:block; height:100%; width:0; background:var(--ink-3); border-radius:999px; transition:width .4s cubic-bezier(.2,.7,.2,1); }
.sp-seg.active .sp-fill { background:var(--accent); }
.sp-seg.done .sp-fill { background:var(--accent); }
.sp-label { font-size:12.5px; font-weight:600; color:var(--ink-2); white-space:nowrap; }

/* ---------- Footer de navegación (modelo B2C) ---------- */
.footer { position:fixed; left:0; right:0; bottom:0; z-index:15; background:linear-gradient(to top,var(--ground) 60%,transparent); padding:16px 24px; }
.footer[hidden] { display:none; }
.footer-inner { max-width:760px; margin:0 auto; display:flex; flex-direction:row-reverse; align-items:center; justify-content:center; gap:18px; }
.btn-back { background:transparent; border:none; color:var(--ink-3); font-family:inherit; font-size:14px; font-weight:600;
  cursor:pointer; padding:8px 10px; border-radius:8px; text-decoration:underline; text-underline-offset:3px; transition:.15s; }
.btn-back:hover { color:var(--ink); }
.btn-back:disabled { opacity:.35; cursor:not-allowed; text-decoration:none; }

/* ---------- Form fields ---------- */
.fieldgrid { display:grid; grid-template-columns:1fr 1fr; gap:16px 18px; margin-top:26px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field.full { grid-column:1/-1; }
.field label { font-size:13px; font-weight:650; color:var(--ink); }
.field label .req { color:var(--accent); margin-left:3px; }
.field .sub { font-size:12px; color:var(--ink-3); font-weight:500; }
.field input[readonly] { background:var(--ground); color:var(--ink-2); cursor:default; }
input, select, textarea {
  font-family:inherit; font-size:15px; color:var(--ink); background:var(--surface);
  border:1px solid var(--line); border-radius:10px; padding:12px 13px; width:100%; transition:.15s;
}
input::placeholder { color:var(--ink-3); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-wash); }
select {
  appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A9099' stroke-width='2.4'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:38px;
}

/* Choice cards (radio single) */
.choices { display:flex; flex-direction:column; gap:11px; margin-top:26px; }
.choice {
  display:flex; align-items:center; gap:14px; padding:15px 16px; background:var(--surface); border:1.5px solid var(--line);
  border-radius:13px; cursor:pointer; transition:.15s; text-align:left; font-family:inherit; font-size:15.5px; color:var(--ink); width:100%;
}
.choice:hover { border-color:var(--ink-3); transform:translateX(2px); }
.choice .key {
  width:26px; height:26px; flex:none; border-radius:7px; border:1.5px solid var(--line); display:grid; place-items:center;
  font-size:12px; font-weight:700; color:var(--ink-3); background:var(--surface-2);
}
.choice.sel { border-color:var(--accent); background:var(--accent-wash); }
.choice.sel .key { background:var(--accent); border-color:var(--accent); color:#fff; }
.choice .ctext { flex:1; line-height:1.35; }

/* Likert */
.likert { margin-top:34px; }
.likert-scale { display:flex; align-items:stretch; gap:10px; justify-content:center; }
.lk {
  flex:1; max-width:96px; border:1.5px solid var(--line); background:var(--surface); border-radius:13px;
  padding:16px 8px; cursor:pointer; transition:.15s; display:flex; flex-direction:column; align-items:center; gap:10px; font-family:inherit;
}
.lk:hover { border-color:var(--ink-3); transform:translateY(-2px); }
.lk .rng { width:var(--sz); height:var(--sz); border-radius:50%; border:2px solid var(--line); transition:.15s; background:var(--surface); }
.lk .lknum { font-size:12px; font-weight:700; color:var(--ink-3); }
.lk.sel { border-color:var(--accent); background:var(--accent-wash); }
.lk.sel .rng { background:var(--accent); border-color:var(--accent); }
.lk.sel .lknum { color:var(--accent-deep); }
.likert-ends { display:flex; justify-content:space-between; margin-top:14px; font-size:12.5px; font-weight:600; color:var(--ink-3); letter-spacing:.01em; text-transform:uppercase; }

/* ---------- Maze engine ---------- */
.mazewrap { display:flex; flex-wrap:wrap; gap:28px; margin-top:26px; align-items:flex-start; }
.maze { --cell:52px; background:#0E1420; border-radius:16px; padding:14px; box-shadow:var(--shadow-m); position:relative; align-self:flex-start; }
.maze.wide { --cell:46px; }
@media (max-width:640px) {
  .mazewrap { gap:20px; }
  .maze { --cell:44px; padding:11px; }
  .maze.wide { --cell:40px; }
  .builder { width:100%; }        /* el editor ocupa todo el ancho al apilarse */
}
@media (max-width:380px) {
  .maze { --cell:38px; }
  .maze.wide { --cell:34px; }
}
@media (max-width:340px) {
  .maze { --cell:34px; }
  .maze.wide { --cell:30px; }
}
.maze-grid { display:grid; gap:4px; position:relative; }
.cell { width:var(--cell); height:var(--cell); border-radius:8px; background:#1B2432; position:relative; }
.cell.path { background:#26334a; }
/* casilla de inicio: anillo para dejar claro dónde arranca Pac-Man */
.cell.startcell { box-shadow:inset 0 0 0 2px rgba(255,255,255,.4); }
.cell.goalcell::after { content:"👻"; position:absolute; inset:0; display:grid; place-items:center; font-size:26px; }
.pac {
  position:absolute; width:var(--cell); height:var(--cell); display:grid; place-items:center;
  transition:transform .32s cubic-bezier(.4,.1,.2,1); z-index:3; pointer-events:none; left:0; top:0;
}
/* Pac-Man: círculo amarillo con una cuña transparente = boca abierta (a la
   derecha). El conic-gradient conserva la forma redonda; ::after = el ojo. */
.pac .body {
  position:relative;
  width:78%; height:78%; border-radius:50%;
  background:conic-gradient(#FFC400 0 67deg, transparent 67deg 113deg, #FFC400 113deg 360deg);
  filter:drop-shadow(0 0 9px rgba(255,196,0,.45));
}
.pac .body::after {
  content:""; position:absolute; top:21%; left:47%;
  width:11%; height:11%; min-width:3px; min-height:3px; border-radius:50%; background:#141b26;
}

/* ---------- Retos de Pac-Man (tablero por mapa + programa en bloques) ---------- */
/* «marked»: camino señalado en violeta sobre casillas apagadas.
   «open»: camino claro (por donde se puede ir) entre paredes apagadas. */
.maze.marked .cell.path { background:#7B61C9; }
.maze.open .cell.path { background:#CBD5E4; }
.maze .cell.startcell { box-shadow:inset 0 0 0 2px rgba(255,255,255,.4); }
.cell.tile-red    { background:#E5383B !important; }
.cell.tile-blue   { background:#3B6FE0 !important; }
.cell.tile-purple { background:#9A6FD6 !important; }
.cell .sprite { position:absolute; inset:0; display:grid; place-items:center; font-size:calc(var(--cell) * .5); line-height:1; }
.cell .sprite.fruit sub { position:absolute; right:3px; bottom:2px; font-size:11px; font-weight:800; color:#1F2A3C; font-family:var(--display); }
/* Tableros de 8 columnas: casilla menor para que quepan en el móvil. */
.maze.xwide { --cell:44px; }
@media (max-width:640px) { .maze.xwide { --cell:34px; } }
@media (max-width:380px) { .maze.xwide { --cell:30px; } }
@media (max-width:340px) { .maze.xwide { --cell:27px; } }
.cell.goalcell::after { font-size:calc(var(--cell) * .5); }
.pac.static { transition:none; }
.pac.face-up .body    { transform:rotate(-90deg); }
.pac.face-down .body  { transform:rotate(90deg); }
.pac.face-left .body  { transform:scaleX(-1); }

/* Programa: bloques tipo Scratch. Acción = azul claro, bucle = amarillo,
   condición = naranja. La «C» de los bloques contenedores la dibujan la
   cabecera, el borde izquierdo del cuerpo y el pie. */
.pg-panel { background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:14px; margin:8px 0 18px; box-shadow:var(--shadow-s); overflow-x:auto; }
.pg-seq { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.pg-b { --c:#CFE0FA; --ink-c:#1F2A3C; font-size:14.5px; font-weight:600; color:var(--ink-c); line-height:1.25; }
.pg-b.act, .pg-b.chip { background:var(--c); border-radius:8px; padding:7px 12px; }
.pg-b.loop { --c:#F6CF57; }
.pg-b.cond { --c:#FF9A5C; }
.pg-b.loop, .pg-b.cond { display:flex; flex-direction:column; }
.pg-h { background:var(--c); border-radius:8px 8px 8px 0; padding:7px 12px; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pg-body { border-left:14px solid var(--c); padding:4px 0 4px 6px; min-height:12px; }
.pg-body + .pg-h { border-radius:0 8px 8px 0; }
.pg-foot { background:var(--c); height:12px; width:56px; border-radius:0 0 8px 8px; }
.pg-b.chip { display:inline-block; }
.pg-gap {
  display:inline-grid; place-items:center; min-width:24px; height:24px; padding:0 6px; border-radius:6px;
  background:#fff; border:1.5px dashed var(--ink-3); color:var(--ink); font-weight:800;
}
.pg-b.gap { background:#EEF3FB; border:1.5px dashed var(--ink-3); }
.pg-arrows { display:flex; flex-wrap:wrap; gap:6px; }
.pg-arrow {
  width:34px; height:34px; border-radius:8px; display:grid; place-items:center;
  background:#E5484D; color:#fff; font-size:19px; font-weight:700;
}
.pg-arrow.gap { background:#fff; color:var(--ink); border:1.5px dashed var(--ink-3); }
.pg-ghost { font-size:16px; }
.pg-swatch { display:inline-block; width:18px; height:18px; border-radius:5px; vertical-align:middle; }
.pg-swatch.red { background:#E5383B; } .pg-swatch.blue { background:#3B6FE0; } .pg-swatch.purple { background:#9A6FD6; }
.pg-colorlabel { display:inline-flex; align-items:center; gap:10px; }
.pg-choices { margin-top:8px; }
.pg-choices .choice .ctext { overflow-x:auto; }
.pg-choices .pg-b { font-size:13.5px; }
.pg-choices .pg-arrow { width:30px; height:30px; font-size:17px; }

/* Ejemplos resueltos: opción correcta marcada y explicación debajo. */
.choice:disabled { cursor:default; opacity:.55; transform:none; }
.choice.solved { opacity:1; border-color:#12B886; background:#E7F8F0; }
.choice.solved .key { background:#12B886; border-color:#12B886; color:#fff; }
.solved-tag { font-size:12.5px; font-weight:700; color:#087A4B; white-space:nowrap; }
.example-note {
  margin:22px 0 0; padding:14px 16px; border-radius:12px; background:var(--surface-2); border:1px solid var(--line);
  font-size:15px; line-height:1.5; color:var(--ink-2);
}

/* Explicación de un bloque nuevo: el bloque suelto, centrado. */
.concept-demo {
  display:flex; justify-content:center; margin:18px 0; padding:22px 16px; border-radius:14px;
  background:var(--surface-2); border:1px solid var(--line);
}
.concept-demo .pg-seq { min-width:0; }
.view.concept .lead { max-width:none; }

.builder { flex:1; min-width:260px; }
.builder h4 { margin:0 0 4px; font-size:13px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-3); }
.palette { display:flex; flex-wrap:wrap; gap:9px; margin:14px 0; }
.cmd {
  width:52px; height:52px; border-radius:12px; border:1.5px solid var(--line); background:var(--surface); cursor:pointer;
  font-size:22px; display:grid; place-items:center; transition:.15s; box-shadow:var(--shadow-s); color:var(--ink);
}
.cmd:hover { border-color:var(--accent); color:var(--accent); transform:translateY(-2px); }
.program {
  min-height:60px; background:var(--surface-2); border:1.5px dashed var(--line); border-radius:12px; padding:12px;
  display:flex; flex-wrap:wrap; gap:8px; align-content:flex-start;
}
.program:empty::before { content:"Pulsa las órdenes para construir la secuencia…"; color:var(--ink-3); font-size:13.5px; }
.pgm-chip {
  background:var(--ink); color:#fff; border-radius:9px; height:38px; min-width:38px; padding:0 10px; display:inline-flex;
  align-items:center; gap:6px; font-size:18px; font-weight:600; animation:pop .2s ease both;
}
.pgm-chip .idx { font-size:11px; opacity:.55; font-weight:700; }
@keyframes pop { from { transform:scale(.6); opacity:0; } to { transform:scale(1); opacity:1; } }
.runrow { display:flex; gap:10px; margin-top:14px; flex-wrap:wrap; }
.runmsg { margin-top:14px; font-size:14px; font-weight:600; padding:10px 14px; border-radius:10px; display:none; }
.runmsg.ok { display:block; background:#E7F8F0; color:#087A4B; border:1px solid #B6ECD2; }
.runmsg.no { display:block; background:#FFEFEC; color:var(--accent-deep); border:1px solid #FBD3CD; }

/* ---------- Figuras visuales de CI (enunciado + opciones) ---------- */
.figstim-wrap {
  margin:24px 0 0; padding:20px; display:flex; justify-content:center;
  background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-s);
}
.figstim { height:170px; width:auto; max-width:100%; }
.figimg { max-width:100%; height:auto; border-radius:8px; }

.figoptions { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-top:22px; }
.figcard {
  position:relative; background:var(--surface); border:1.5px solid var(--line); border-radius:14px;
  padding:16px 10px 12px; cursor:pointer; transition:.15s; display:flex; flex-direction:column; align-items:center; gap:8px;
  font-family:inherit; box-shadow:var(--shadow-s);
}
.figcard:hover { border-color:var(--ink-3); transform:translateY(-2px); }
.figcard.sel { border-color:var(--accent); background:var(--accent-wash); box-shadow:0 0 0 3px var(--accent-wash); }
.figkey {
  position:absolute; top:8px; left:8px; width:22px; height:22px; border-radius:6px; border:1.5px solid var(--line);
  display:grid; place-items:center; font-size:11px; font-weight:700; color:var(--ink-3); background:var(--surface-2);
}
.figcard.sel .figkey { background:var(--accent); border-color:var(--accent); color:#fff; }
.figbox { display:grid; place-items:center; width:100%; height:88px; margin-top:6px; }
.figbox .figsvg { max-height:88px; max-width:100%; width:auto; height:auto; }

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

/* ---------- Constructor de bloques (Inteligencia Computacional) ---------- */
.bk { --loop:#3B5BDB; --until:#0CA678; --while:#6D4AFF; --cond:var(--accent);
  display:flex; flex-direction:column; gap:12px; }
.bk-pal { display:flex; flex-wrap:wrap; gap:8px; }
.bk-add { font-family:inherit; font-weight:700; border-radius:9px; cursor:pointer; transition:.14s; padding:9px 12px;
  border:1.5px solid var(--line); background:var(--surface); color:var(--ink); font-size:13px; }
.bk-add:hover { border-color:var(--ink-3); transform:translateY(-1px); }
.bk-add.dir { width:44px; height:44px; padding:0; font-size:20px; }
.bk-add.ctrl { color:#fff; border:none; }
.bk-add.loop { background:var(--loop); } .bk-add.until { background:var(--until); }
.bk-add.while { background:var(--while); } .bk-add.cond { background:var(--cond); }
.bk-budget { font-size:12.5px; color:var(--ink-3); font-weight:600; }
.bk-budget b { color:var(--ink); }

.bk-canvas { min-height:60px; }
.bk-body { border:1.5px dashed var(--line); border-radius:12px; padding:10px; display:flex; flex-wrap:wrap; gap:8px;
  align-items:center; align-content:flex-start; transition:.15s; }
.bk-body.root { background:var(--surface-2); }
.bk-body.nested { border-style:solid; border-left:8px solid var(--c,var(--line)); background:var(--surface); width:100%; }
.bk-body.active { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-wash); }
.bk-drop { border:1px dashed var(--line); background:transparent; color:var(--ink-3); font-size:12px; font-weight:700; cursor:pointer;
  padding:5px 11px; border-radius:8px; transition:.14s; }
.bk-drop:hover { border-color:var(--ink-3); color:var(--ink); }
.bk-drop.active { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 0 0 3px var(--accent-wash); }
.bk-help { font-size:12.5px; color:var(--ink-3); line-height:1.45; }

.bk-chip { position:relative; height:40px; min-width:40px; padding:0 12px; border-radius:9px; background:var(--ink); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size:19px; font-weight:600; }
.bk-del { position:absolute; top:-7px; right:-7px; width:18px; height:18px; border-radius:50%; border:none; cursor:pointer;
  background:var(--ink-2); color:#fff; font-size:12px; line-height:1; display:grid; place-items:center; opacity:0; transition:.12s; }
.bk-chip:hover .bk-del, .cblk:hover > .head > .bk-del { opacity:1; }

.cblk { width:100%; border-radius:12px; overflow:hidden; box-shadow:var(--shadow-s); border:1px solid var(--line); }
.cblk.loop { --c:var(--loop); } .cblk.until { --c:var(--until); }
.cblk.while { --c:var(--while); } .cblk.cond { --c:var(--cond); }
.cblk > .head { position:relative; background:var(--c); color:#fff; padding:9px 12px; font-weight:700; font-size:14px;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cblk > .foot { height:10px; background:var(--c); }
.cblk .bk-body.nested { margin:0; border-radius:0; border-top:none; border-bottom:none; }
.cblk-else { background:var(--c); color:#fff; padding:6px 12px; font-weight:700; font-size:13px; }
.bk-else { align-self:flex-start; margin:8px 12px; border:1.5px dashed var(--c); color:var(--c); background:transparent;
  border-radius:8px; padding:5px 10px; font-weight:700; font-size:12.5px; cursor:pointer; }
.bk-t { font-weight:700; }
.bk-sel { background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.5); color:#fff; border-radius:7px;
  padding:3px 6px; font-family:inherit; font-size:14px; font-weight:700; }
.bk-sel option { color:var(--ink); }
.bk .count { display:inline-flex; align-items:center; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.5);
  border-radius:7px; overflow:hidden; }
.bk .count button { border:none; background:transparent; color:#fff; font-size:16px; font-weight:800; width:26px; height:26px; cursor:pointer; }
.bk .count button:hover { background:rgba(255,255,255,.2); }
.bk .count .n { min-width:22px; text-align:center; font-weight:800; font-variant-numeric:tabular-nums; }
.bk-run { display:flex; gap:10px; flex-wrap:wrap; }

/* placeholder visual para ítems CI basados en imagen */
.visualph {
  margin-top:24px; border:1.5px dashed var(--line); border-radius:14px; background:var(--surface-2);
  padding:30px; display:flex; flex-direction:column; align-items:center; gap:10px; color:var(--ink-3); text-align:center;
}
.visualph .ph-ic { font-size:30px; }
.visualph code, .disclaimer code {
  background:var(--surface); border:1px solid var(--line); padding:2px 7px; border-radius:6px; font-size:12px; color:var(--ink-2);
}

/* ---------- Pantalla final ---------- */
.finalmark { color:var(--accent); display:block; }
.finalmark svg { width:56px; height:56px; }

/* ---------- Results (informe interno · ?report=1) ---------- */
.scoregrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin-top:28px; }
.scard {
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-m); padding:18px; box-shadow:var(--shadow-s);
  position:relative; overflow:hidden;
}
.scard .slabel { font-size:11.5px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--ink-3); }
.scard .sval { font-size:38px; font-weight:800; letter-spacing:-.03em; margin-top:8px; font-variant-numeric:tabular-nums; line-height:1; }
.scard .sunit { font-size:16px; color:var(--ink-3); font-weight:600; margin-left:2px; }
.scard .sdesc { font-size:12.5px; color:var(--ink-2); margin-top:8px; line-height:1.4; }
.scard .track { height:5px; background:var(--line); border-radius:99px; margin-top:14px; overflow:hidden; }
.scard .fill { height:100%; border-radius:99px; }

.resultblock { margin-top:40px; }
.resultblock > .eyebrow { margin-bottom:6px; }
.radar-row { display:flex; flex-wrap:wrap; gap:32px; align-items:center; margin-top:22px; }
.radar { flex:none; max-width:100%; }
.radar svg { display:block; width:320px; max-width:100%; height:auto; }
@media (max-width:640px) { .radar { width:100%; } }
.traits { flex:1; min-width:280px; display:flex; flex-direction:column; gap:16px; }
.trait .th { display:flex; justify-content:space-between; align-items:baseline; font-size:14px; }
.trait .th b { font-weight:700; }
.trait .th .tv { font-variant-numeric:tabular-nums; font-weight:700; color:var(--ink); }
.trait .th .tv small { color:var(--ink-3); font-weight:600; }
.trait .meter { height:9px; background:var(--line-2); border-radius:99px; margin-top:7px; position:relative; overflow:hidden; }
.trait .meter .mf { height:100%; border-radius:99px; background:linear-gradient(90deg,var(--data),#4A535E); }
.trait .thr { position:absolute; top:-3px; bottom:-3px; width:2px; background:var(--ink-3); opacity:.45; }
.trait .tdesc { font-size:12.5px; color:var(--ink-2); margin-top:6px; }

.disclaimer {
  margin-top:40px; padding:16px 18px; background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  font-size:13px; color:var(--ink-2); line-height:1.5;
}

.kbdhint { font-size:12px; color:var(--ink-3); margin-top:20px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
kbd { background:var(--surface); border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; padding:1px 7px; font-size:11px; font-family:var(--sans); font-weight:600; color:var(--ink-2); }

/* ---------- Barra de modo pruebas (DEV, solo local) ---------- */
.devbar {
  position:fixed; left:16px; bottom:16px; z-index:40; width:260px;
  background:#0E1420; color:#E7EAF0; border:1px solid #26304a; border-radius:14px;
  box-shadow:var(--shadow-l); font-size:12.5px; overflow:hidden;
}
.devbar-head { display:flex; align-items:center; gap:8px; padding:10px 12px; border-bottom:1px solid #26304a; }
.devbadge { font-size:10px; font-weight:800; letter-spacing:.1em; background:var(--accent); color:#fff; padding:2px 6px; border-radius:5px; }
.devtitle { font-weight:600; color:#AEB7C7; }
.devflash { margin-left:auto; font-size:11px; color:#7FE3B0; opacity:0; transition:.2s; white-space:nowrap; }
.devflash.show { opacity:1; }
.devx { margin-left:auto; background:transparent; border:1px solid #26304a; color:#AEB7C7; width:22px; height:22px; border-radius:6px; cursor:pointer; line-height:1; font-size:15px; }
.devflash.show + .devx { margin-left:8px; }
.devbar-body { padding:12px; display:flex; flex-direction:column; gap:9px; }
.devbar.collapsed .devbar-body { display:none; }
.devrow { display:flex; flex-wrap:wrap; gap:6px; }
.devbar button[data-act] {
  background:#1B2432; color:#D5DBE6; border:1px solid #2C374F; border-radius:8px; padding:7px 9px;
  font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; transition:.14s;
}
.devbar button[data-act]:hover { background:#26334a; border-color:var(--accent); color:#fff; }
.devchip { flex:1; min-width:0; text-align:center; }
.devfill { background:var(--accent) !important; border-color:var(--accent) !important; color:#fff !important; flex:1; }
.devfill:hover { background:var(--accent-deep) !important; }

@media (max-width:640px) {
  .devbar { display:none; }
  .fieldgrid { grid-template-columns:1fr; }
  .topbar-inner { padding:12px 16px; gap:12px; }
  .brand small { display:none; }
  .phase .plabel { display:none; }
  .stage { padding:32px 16px 120px; }
  .likert-scale { gap:6px; }
  .lk { padding:12px 4px; }
  .likert-ends { font-size:11px; }
  /* footer: botón principal a lo ancho, enlace «Atrás» centrado debajo */
  .footer { padding:12px 16px; }
  .footer-inner { flex-direction:column; gap:8px; }
  .footer-inner .btn-primary { width:100%; justify-content:center; }
  .btn { padding:12px 18px; }
  /* progreso por secciones: etiqueta oculta, segmentos a lo ancho */
  .sp-label { display:none; }
  .sp-segs { max-width:none; }
}

/* ---------- Selección múltiple (bloque de adopción de IA) ----------
   Reutiliza .choice para que las casillas se vean como el resto de
   opciones del test; lo propio es el cuadro, el tope y el «otra». */
.multi { display:flex; flex-direction:column; gap:8px; margin-top:4px; }
.multi .mopt { text-align:left; }
.multi .mopt .mbox {
  flex:0 0 auto; width:18px; height:18px; border-radius:5px;
  border:1.5px solid var(--line); background:var(--surface);
  display:inline-block; position:relative; transition:all .12s ease;
}
.multi .mopt.sel .mbox { background:var(--accent); border-color:var(--accent); }
.multi .mopt.sel .mbox::after {
  content:""; position:absolute; left:5px; top:1.5px; width:5px; height:10px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg);
}
.multi .mopt[disabled] { opacity:.45; cursor:not-allowed; }
.multi .mopt[disabled]:hover { border-color:var(--line); background:var(--surface); }
.multi-max { font-size:12.5px; color:var(--accent-deep); min-height:1.1em; }
.multi-other { margin-top:2px; }
.multi-other input {
  width:100%; padding:11px 13px; font:inherit; font-size:15px;
  border:1px solid var(--line); border-radius:var(--r-s);
  background:var(--surface); color:var(--ink);
}
.multi-other input:focus { outline:2px solid var(--accent); outline-offset:1px; border-color:transparent; }

/* ---------- Tarjetas (kind «cards»: perfil y área de AI Maturity) ---------- */
.choices.perfiles .choice { align-items:flex-start; padding:17px 16px; }
.choice .csub { display:block; margin-top:4px; font-size:13px; color:var(--ink-3); line-height:1.4; }
.choices.perfiles .choice .key { margin-top:2px; }
