/* Evaluaciones interactivas (/evaluaciones/<evaluación>/): misma maqueta que las prácticas (css/practice-workbench.css)
   y los criterios de desarrollo/docs/guia-estilo.md. Naranja = destino u opción, azul = selección,
   turquesa = acierto. Las zonas de respuesta no se ven ni cambian el cursor: no revelan la solución. */

.assess-run .scene__labels { display: none; }

/* ---------- Modo test: se distingue de las prácticas ---------- */
/* Alfombrilla del mismo color que la de las prácticas (css/practice-workbench.css), con puntos en vez de cuadrícula. */
.assess-run .workbench::before { background-image: radial-gradient(#a5ced440 1.5px, transparent 1.9px); background-size: 18px 18px; }
/* Etiqueta «Test» (cabecera y panel). */
.as-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #F2B33D; color: #17324D; font-size: .62em; font-weight: 800; letter-spacing: .08em; line-height: 1.5; text-transform: uppercase; vertical-align: .2em; }
.topbar__practice h1 .as-badge { margin-right: 4px; }
/* Cabecera del panel: número y título de la pregunta y puntos acumulados. Debajo, las rayitas de avance de las
   prácticas (.panel__head::before de css/practice-workbench.css), una por pregunta. */
.assess-run .panel__head.as-head { padding: 12px 16px 16px; }
/* Dos filas: arriba la etiqueta y los puntos; debajo, el título a todo el ancho (los largos pasan a otra línea
   sin empujar nada). */
.as-head__top { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "badge . points" "title title title"; align-items: center; gap: 6px 10px; margin: 0; }
.as-head__top .as-badge { grid-area: badge; justify-self: start; font-size: 11px; vertical-align: 0; }
.as-head__top .step__title { grid-area: title; min-width: 0; margin: 0; color: #000; font-size: 18px; font-weight: 700; line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; outline: none; }
.as-head__points { grid-area: points; position: relative; margin: 0; color: var(--navy); font-size: 14px; font-weight: 800; white-space: nowrap; }
/* Al acertar: «+0,5» sube y se desvanece, y el total late. */
.as-head__points.is-bump { animation: as-bump .5s ease-out; }
.as-gain { position: absolute; right: 0; top: -2px; color: #0a8a9a; font-size: 15px; font-weight: 800; pointer-events: none; opacity: 0; animation: as-gain 1.3s ease-out; }
@keyframes as-bump { 40% { transform: scale(1.18); color: #0a8a9a; } }
@keyframes as-gain { 0% { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-22px); } }
/* Desplegable «Qué incluye el test» de la presentación. */
.as-more p { margin: 8px 0 0; }
.as-more__list { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 22px; }
.as-more__list li::marker { color: var(--blue); font-weight: 700; }
.as-more__pts { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #EEF4F8; color: var(--navy); font-size: 12.5px; font-weight: 700; }
/* Aviso de revisión (pregunta ya respondida). */
.as-review { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 10px; background: #EEF4F8; color: var(--navy); font-size: 14px; line-height: 1.45; }
.as-review .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Zonas sobre la placa ---------- */
.as-layer { position: absolute; inset: 0; z-index: 115; pointer-events: none; }
/* Con zonas ocultas, toda la placa tiene el mismo cursor: no se nota dónde hay una respuesta. */
.as-layer.is-answers { pointer-events: auto; cursor: crosshair; }
.as-zone { position: absolute; z-index: 1; translate: -50% -50%; min-width: 40px; min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: inherit; pointer-events: auto; touch-action: manipulation; }
.as-zone:disabled { cursor: default; }
.as-zone--answer:focus-visible { outline: 3px dashed var(--blue); outline-offset: 2px; background: rgb(var(--blue-rgb) / 12%); }
.as-zone--answer.is-found { outline: 2.5px solid #3CC9D9; background: rgb(60 201 217 / 18%); }
.as-zone--answer.is-answer { outline: 2.5px dashed #3CC9D9; background: rgb(60 201 217 / 14%); }

/* Rótulo de una zona acertada o de la solución (qué es cada cosa). En los soportes, encima del círculo. */
.as-zone[data-tag]::after { content: attr(data-tag); position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 2px 7px; border-radius: 6px; background: #17324D; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.as-zone--choice[data-tag]::after { top: -4px; translate: -50% -100%; }

/* Destino visible donde se coloca la pieza (respira, como en las prácticas). */
.as-zone--target { border: 2.5px solid #ffb248; background: rgb(255 178 72 / 18%); box-shadow: 0 0 0 5px rgb(255 178 72 / 40%); cursor: pointer; animation: as-breathe 2.4s ease-in-out infinite; }
.as-zone--target:hover, .as-zone--target:focus-visible { background: rgb(255 178 72 / 32%); }
/* Destino que no debe tapar lo que hay debajo (la llave de la ranura de RAM). */
.as-zone--target.as-zone--outline, .as-zone--target.as-zone--outline:hover { background: transparent; }
@keyframes as-breathe { 50% { box-shadow: 0 0 0 5px rgb(255 178 72 / 15%); } }

/* Opciones visibles (ranuras, soportes): todas iguales; la elegida, en azul. */
.as-zone--choice { border: 1.6px solid #ffb248; background: rgb(255 178 72 / 10%); cursor: pointer; }
.as-zone--choice:hover, .as-zone--choice:focus-visible { background: rgb(255 178 72 / 26%); }
.as-zone--choice[aria-pressed="true"] { border: 2.5px solid #8FBBDB; background: rgb(143 187 219 / 38%); box-shadow: 0 0 0 3px rgb(27 84 128 / 55%); }
.as-zone--choice[data-slot]::after { content: attr(data-slot); position: absolute; left: 50%; top: -2px; translate: -50% -100%; padding: 2px 6px; border-radius: 6px; background: #17324D; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; }
.as-zone--choice:not([data-slot]) { border-radius: 50%; }
/* Soportes: sin mínimo táctil, para que no se solapen (el toque en pantallas táctiles se confirma; ver standoff()). */
.as-zone--standoff { min-width: 0; min-height: 0; }
/* Franja táctil que elige el soporte más cercano (standoffBand()); los círculos solo se ven y se usan con teclado. */
.as-band { position: absolute; z-index: 0; pointer-events: auto; touch-action: manipulation; }
.as-layer.has-band .as-zone--standoff { pointer-events: none; }
.as-zone--choice.is-found { border: 2.5px solid #3CC9D9; background: rgb(60 201 217 / 35%); box-shadow: none; }

/* Silueta de la pieza sobre su ranura (preview()): gira con la de la tarjeta. */
.as-preview { position: absolute; z-index: 0; display: block; translate: -50% -50%; opacity: .6; pointer-events: none; rotate: calc(var(--turn, 0deg) + var(--base, 0deg)); transition: rotate .25s ease; filter: drop-shadow(0 4px 8px rgb(0 0 0 / 45%)); }

/* ---------- Placa a todo el ancho y pieza en el panel ---------- */
/* Sin la columna de la mesa de las prácticas: la placa ocupa toda la zona de trabajo. */
.assess-run .workbench { --parts-width: 0px; }
/* El zoom va en la esquina inferior derecha, sobre la placa: no hace falta reservarle una franja abajo. Mismo margen
   arriba que abajo, para que la placa ocupe el máximo alto. */
.assess-run .workbench .workspace { padding: 6px 12px; }
/* En tablet y móvil la altura de la zona de trabajo sale del ancho (placa 1240 × 1269); sin la franja del zoom ni la
   columna de la mesa, basta con el margen de la alfombrilla (css/practice-workbench.css reserva más). */
@media (max-width: 960px) {
  .assess-run .workbench .workspace { padding: 6px 7px; }
  .assess-run .workbench { height: max(320px, min(calc((100vw - 32px) * 1.024 + 26px), calc(100svh - 70px))); }
}
@media (max-width: 600px) {
  .assess-run .workbench .workspace { padding: 3px 2px; }
  .assess-run .workbench { height: max(320px, min(calc((100vw - 22px) * 1.024 + 15px), calc(100svh - 70px))); }
}
/* Bandeja de la pieza, bajo la instrucción: tarjeta con puntos, del color de la alfombrilla y, debajo, el botón. */
.as-tray { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.as-tray:empty { display: none; }
.as-piece { position: relative; display: grid; justify-items: center; padding: 14px 12px; border: 1px solid #2e5661; border-radius: 14px; background-color: #3e737f; background-image: radial-gradient(#a5ced440 1.5px, transparent 1.9px); background-size: 18px 18px; box-shadow: inset 0 0 0 1px #c2e1e665; }
.as-piece__figure { display: grid; place-items: center; width: 100%; min-height: 120px; margin: 0; }
.as-piece__figure img { display: block; max-width: 78%; max-height: 190px; height: auto; rotate: var(--turn, 0deg); transition: rotate .25s ease; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 40%)); }
/* Módulo de RAM en vertical, como la ranura: así se compara su muesca con la llave de la ranura. */
.as-piece--dimm .as-piece__figure { height: 300px; overflow: hidden; }
.as-piece--dimm .as-piece__figure img { width: 290px; max-width: none; max-height: none; rotate: calc(var(--turn, 0deg) + 90deg); }
.as-turn { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--blue); cursor: pointer; }
.as-turn .icon { width: 22px; height: 22px; }
.as-turn:hover { border-color: var(--blue); background: var(--blue-soft); }
.as-turn:disabled, .as-piece__action .btn:disabled { opacity: .5; cursor: default; }
.as-piece__action { list-style: none; }
.as-piece__action .btn { width: 100%; white-space: normal; }

/* ---------- Panel ---------- */
.as-prep { margin: -4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.as-prep a { color: var(--blue); font-weight: 600; text-underline-offset: 3px; }
.as-facts { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
.as-facts li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; align-items: center; }
.as-facts .icon { width: 20px; height: 20px; color: var(--blue); }
.as-name { display: grid; gap: 6px; }
.as-name label { font-weight: 700; color: var(--navy); }
.as-name input { min-height: 44px; padding: 8px 12px; border: 1px solid #A8B1B7; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; }
.as-name input:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.as-name input[aria-invalid="true"] { border-color: var(--err); }
.as-name__note { color: var(--muted); font-size: 13px; line-height: 1.45; }
.as-name__error { color: var(--err); font-size: 13.5px; font-weight: 600; }
.as-name .btn { margin-top: 8px; }
.as-instruction { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #000; font-size: 15px; line-height: 1.5; }
.as-answers { display: flex; gap: 8px; margin-top: 12px; }
.as-answers .btn { min-width: 88px; min-height: 44px; }
/* Opciones de texto largo (una por fila). */
.as-choices { display: grid; gap: 8px; margin-top: 12px; }
.as-choices .btn { min-height: 44px; white-space: normal; text-align: left; font-weight: 400; color: var(--ink); }
.as-actions { display: flex; justify-content: flex-start; }
.as-link { padding: 6px 0; border: 0; background: none; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.as-link:hover { color: var(--blue); }
.as-outcome { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #F4F7F9; }
.as-outcome--2 { border-color: #9EDDE6; background: #E9F8FA; }
.as-outcome--1 { border-color: var(--hint-line); background: var(--hint-soft); }
.as-outcome__points { color: var(--navy); font-size: 22px; font-weight: 800; line-height: 1.2; }
.as-outcome__why { color: var(--muted); font-size: 14px; font-weight: 600; }
.as-outcome__explain { font-size: 14.5px; line-height: 1.55; }
.as-outcome .btn { margin-top: 4px; }

/* ---------- Resultado (pensado para capturarlo y entregarlo) ---------- */
.as-result { padding: 20px 16px 40px; }
.is-result .workbench, .is-result .panel { display: none; }
.is-result .app { display: block; height: auto; min-height: 0; }
.as-result__card { display: grid; gap: 8px; width: min(620px, 100%); margin: 0 auto; padding: 22px 28px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.as-result__brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--navy); font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.as-result__brand img { width: 40px; height: 40px; }
.as-result__name { margin-top: 6px; color: var(--blue); font-size: 26px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.as-result h2 { color: var(--navy); font-size: 18px; outline: none; }
.as-result__date { color: var(--muted); font-size: 14px; }
.as-result__grade { justify-self: center; display: grid; place-items: center; gap: 2px; width: 150px; height: 150px; margin: 4px 0 2px; border: 8px solid #D7E0E5; border-radius: 50%; background: #fff; }
.as-result__grade.is-pass { border-color: #3CC9D9; }
.as-result__value { color: var(--navy); font-size: 58px; font-weight: 800; line-height: 1; }
.as-result__max { color: var(--muted); font-size: 24px; font-weight: 700; }
/* Notas con decimales (7,75): más pequeñas para que quepan en el círculo. */
.as-result__value.is-long { font-size: 42px; letter-spacing: -.02em; }
.as-result__value.is-long + .as-result__max { font-size: 20px; }
.as-result__passed { margin-top: -22px; color: var(--muted); font-size: 12.5px; font-weight: 600; max-width: 130px; line-height: 1.3; }
.as-result__list { display: grid; gap: 5px; margin: 6px 0 0; padding: 0; list-style: none; text-align: left; counter-reset: reto; }
.as-result__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; counter-increment: reto; }
.as-result__list li span:first-child::before { content: counter(reto) ". "; color: var(--muted); font-weight: 700; }
.as-result__points { flex: none; min-width: 48px; padding: 2px 10px; border-radius: 999px; background: #F1F4F6; color: #45505A; font-weight: 700; text-align: center; }
.as-result__points--2 { background: #E1F7FA; color: #0a5d6b; }
.as-result__points--1 { background: var(--hint-soft); color: var(--hint-ink); }
.as-result__message { margin-top: 6px; color: var(--ink); font-size: 15.5px; line-height: 1.5; }
.as-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(620px, 100%); margin: 16px auto 0; }
.as-result__actions .btn { gap: 8px; min-height: 44px; }

@media (max-width: 640px) {
  .as-piece__figure { min-height: 96px; }
  .as-piece__figure img { max-height: 130px; }
  .as-piece--dimm .as-piece__figure { height: 230px; }
  .as-piece--dimm .as-piece__figure img { width: 220px; max-height: none; }
  .as-result { padding: 16px 12px 32px; }
  .as-result__card { padding: 20px 16px 22px; }
  .as-result__name { font-size: 22px; }
  .as-result__grade { width: 148px; height: 148px; }
  .as-result__value { font-size: 54px; }
  .as-result__value.is-long { font-size: 40px; }
  .as-result__actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .as-zone--target, .as-head__points.is-bump, .as-gain { animation: none; } .as-piece__figure img, .as-preview { transition: none; } }

/* Test de solo preguntas (sin placa): el panel ocupa el centro de la página, en una columna. */
.assess-quiz:not(.is-result) .app { height: auto; min-height: 100vh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top" "right"; }
.assess-quiz .panel--step { justify-self: center; align-self: start; width: min(680px, 100%); margin-top: 16px; }
.assess-quiz .as-head__top .as-badge { display: none; }
.as-order .btn:disabled { opacity: 1; border-color: #3CC9D9; background: #E1F7FA; color: var(--ink); }
.as-order__n { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; background: #0a8a9a; color: #fff; font-size: 13px; font-weight: 800; }
.as-more-btn { display: block; width: 100%; font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); text-align: left; cursor: pointer; }
.as-more-btn::before { content: "\25B8"; margin-right: 6px; }
.as-info { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); overflow: hidden; }
.as-info[open] { display: flex; flex-direction: column; }
.as-info::backdrop { background: rgb(var(--navy-rgb) / 45%); }
.as-info__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.as-info__head h2 { margin: 0; color: var(--navy); font-size: 18px; }
.as-info__close { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #000; cursor: pointer; }
.as-info__close:hover { background: var(--blue-soft); color: var(--blue); }
.as-info__close .icon { width: 20px; height: 20px; }
.as-info__body { overflow-y: auto; padding: 4px 20px 20px; font-size: 14.5px; line-height: 1.5; }
.as-info__body p { margin: 10px 0 0; }
.as-info__body .as-more__list { margin-top: 10px; }
.as-seo { width: min(680px, calc(100% - 32px)); margin: 8px auto 0; padding: 0 0 48px; color: var(--ink); font-size: 15px; line-height: 1.55; }
.as-seo h2 { margin: 0 0 8px; color: var(--navy); font-size: 18px; }
.as-seo h3 { margin: 16px 0 6px; color: var(--navy); font-size: 15px; }
.as-seo ul { margin: 0; padding-left: 22px; }
.as-seo p { margin: 10px 0 0; }
.as-seo a { color: var(--blue); font-weight: 600; }
.is-result .as-seo { display: none; }
