/* «Pruebas» section of an editorial prompt (public/prompt-tests.js). */
.prompt-test {
  margin: 24px 0;
  padding: 18px 20px;
  border: var(--borde-grueso);
  border-radius: var(--radio-tarjeta);
  background: var(--hoja);
  box-shadow: var(--sombra-dura-m);
}
.prompt-test h3 {
  margin: 0 0 8px;
  font-weight: 900;
}
.prompt-test h4 {
  margin: 18px 0 8px;
}
.test-summary {
  margin: 0 0 14px;
  color: var(--muted);
}
.test-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 10px;
  border: var(--borde-fino);
  border-radius: var(--radio-pildora);
  background: var(--seleccion);
  color: var(--tinta);
  font-weight: 800;
}
.test-badge.ok {
  background: var(--exito-suave);
}
.test-shot {
  margin: 0 0 14px;
}
.test-shot a {
  display: block;
  border: var(--borde-grueso);
  border-radius: var(--radio-mosaico);
  overflow: hidden;
  max-height: 420px;
}
.test-shot > a > img {
  display: block;
  width: 100%;
  height: auto;
}
.test-shot figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--font-small);
}
.test-block {
  margin: 10px 0;
  border: var(--borde-grueso);
  border-radius: var(--radio-mosaico);
  background: var(--panel);
}
.test-block summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 800;
}
.test-block > .prompt-body,
.test-block > .test-output {
  margin: 0;
  padding: 4px 16px 14px;
}
.test-block > .prompt-body {
  border: 0;
  background: transparent;
  white-space: pre-wrap;
}
.md h3,
.md h4,
.md h5,
.md h6 {
  margin: 14px 0 6px;
  font-size: var(--font-body);
}
.md p,
.md ul,
.md ol,
.md blockquote {
  margin: 6px 0;
}
.md ul,
.md ol {
  padding-left: 22px;
}
.md blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--acento);
  color: var(--tinta-2);
}
.md code {
  padding: 0 5px;
  border-radius: 6px;
  background: var(--seleccion);
  font-family: var(--f-prompt);
}
.md-table {
  overflow-x: auto;
  margin: 8px 0;
}
.md table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: var(--font-small);
}
.md th,
.md td {
  padding: 6px 8px;
  border: 1px solid var(--linea-fuerte);
  text-align: left;
  vertical-align: top;
}
.md th {
  background: var(--seleccion);
  font-weight: 800;
}
.test-checks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.test-checks li {
  display: flex;
  gap: 10px;
  margin: 8px 0;
}
.test-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: var(--borde-fino);
  border-radius: 50%;
  background: var(--exito);
  color: var(--sobre-tinta);
  font-weight: 800;
}
.test-checks .fail .test-mark {
  background: var(--peligro);
  color: var(--sobre-tinta);
}
@media (max-width: 600px) {
  .prompt-test {
    padding: 14px 12px;
  }
  .test-block > .prompt-body,
.test-block > .test-output {
    padding: 4px 10px 12px;
  }
}
/* Sections of a category in the catalog grid. */
.grid-group-title {
  grid-column: 1 / -1;
  margin: 12px 0 0;
  font-size: var(--font-body);
}
.grid-group-title:first-child {
  margin-top: 0;
}
/* Model picker: one radio per run; only the checked run is shown. */
.test-intro {
  margin: 0 0 12px;
  color: var(--muted);
}
.test-section {
  margin: 0 0 6px;
}
.test-models {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.test-models legend {
  margin-bottom: 6px;
  font-weight: 800;
}
.test-models label {
  display: grid;
  gap: 2px;
  min-width: 150px;
  min-height: 44px;
  padding: 8px 14px;
  border: var(--borde-grueso);
  border-radius: var(--radio-mosaico);
  background: var(--hoja);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.test-models label:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--sombra-dura-xs);
}
.test-models label span {
  color: var(--muted);
  font-size: var(--font-small);
}
.test-model-input:checked + label {
  border-color: var(--trazo);
  background: var(--seleccion);
  box-shadow: var(--sombra-dura-s);
  outline: 2px solid var(--indicador);
  outline-offset: -5px;
}
.test-model-input:focus-visible + label {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
}
.prompt-test.has-models .test-run {
  display: none;
}
.prompt-test:has(#test-model-0:checked) .test-run[data-run="0"],
.prompt-test:has(#test-model-1:checked) .test-run[data-run="1"],
.prompt-test:has(#test-model-2:checked) .test-run[data-run="2"],
.prompt-test:has(#test-model-3:checked) .test-run[data-run="3"],
.prompt-test:has(#test-model-4:checked) .test-run[data-run="4"],
.prompt-test:has(#test-model-5:checked) .test-run[data-run="5"] {
  display: block;
}
/* Visual prompts (Programación › Interfaces y visuales): the page each
   model's code draws, side by side, and the folded code of the answer. */
.test-compare {
  margin: 14px 0 18px;
}
.test-compare h4 {
  margin: 0 0 4px;
}
.test-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.test-compare-grid li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.test-compare-grid a {
  display: block;
  flex: 1 0 100%;
  border: var(--borde-grueso);
  border-radius: var(--radio-mosaico);
  overflow: hidden;
  box-shadow: var(--sombra-dura-s);
}
.test-compare-grid a:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
}
.test-compare-grid a > img {
  display: block;
  width: 100%;
  height: auto;
}
.test-compare-name {
  flex: 1;
  font-weight: 800;
}
.test-shot.is-visual a {
  max-height: none;
}
.md-code {
  margin: 8px 0;
  border: var(--borde-grueso);
  border-radius: var(--radio-campo);
  background: var(--hoja);
}
.md-code summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 12px;
  font-size: var(--font-small);
  font-weight: 800;
}
.md-code pre {
  overflow: auto;
  max-height: 420px;
  margin: 0;
  padding: 10px 12px;
  border-top: var(--separador);
  font-family: var(--f-prompt);
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre;
}
.md-code code {
  padding: 0;
  background: none;
}
@media (prefers-reduced-motion: reduce) {
  .test-models label {
    transition: none;
  }
  .test-models label:hover {
    transform: none;
  }
}

/* ---------- Administración › Pruebas (test-review-ui.js) ---------- */
.test-review { display: grid; gap: var(--s-4, 16px); }
.tr-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tr-summary li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 10px 12px;
  border: var(--borde-fino);
  border-radius: var(--radio-campo);
  background: var(--hoja);
}
.tr-summary .ui-icon { grid-row: span 2; width: 20px; height: 20px; }
.tr-summary strong { font: 800 1.375rem / 1 var(--letra-titulo); }
.tr-summary span { color: var(--tinta-2); font-size: 0.8125rem; }
.tr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tr-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.tr-toolbar .ui-icon { width: 18px; height: 18px; }
.tr-toolbar input,
.tr-toolbar select {
  min-height: 44px;
  padding: 0 12px;
  border: var(--borde-fino);
  border-radius: var(--radio-campo);
  background: var(--hoja);
  color: var(--tinta);
  font: inherit;
}
.tr-search { flex: 1 1 260px; }
.tr-search input { width: 100%; }
.tr-list { display: grid; gap: 10px; }
.tr-item {
  border: var(--borde-grueso);
  border-radius: var(--radio-tarjeta);
  background: var(--hoja);
}
.tr-item[open] { box-shadow: var(--sombra-dura-m); }
.tr-item > summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px 16px;
  cursor: pointer;
}
.tr-id { color: var(--tinta-3); font: 700 0.8125rem var(--letra-mono, monospace); }
.tr-title { font-weight: 800; }
.tr-cat { color: var(--tinta-2); font-size: 0.875rem; }
.tr-badges { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { display: inline-flex; align-items: center; gap: 4px; }
.tr-verdict {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: var(--borde-fino);
  border-radius: var(--radio-pildora);
  background: var(--seleccion);
  font: 700 0.75rem / 1.4 var(--letra-texto);
}
.tr-verdict .ui-icon { width: 13px; height: 13px; }
.tr-ok { background: var(--exito-suave); }
.tr-warn { background: #ffe8a8; color: #1c1917; border-color: #1c1917; }
.tr-bad { background: var(--peligro-suave); color: var(--peligro); border-color: var(--peligro); }
.tr-none { border-style: dashed; background: transparent; }
.tr-visual { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); }
.tr-item-body { display: grid; gap: 14px; padding: 0 16px 16px; }
.tr-asked pre { max-height: 320px; overflow: auto; white-space: pre-wrap; }
.tr-run { border-top: var(--separador); padding-top: 12px; }
.tr-run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-score, .tr-date { color: var(--tinta-2); font-size: 0.875rem; }
.tr-date { display: inline-flex; align-items: center; gap: 4px; }
.tr-date .ui-icon { width: 14px; height: 14px; }
.tr-run-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; margin-top: 10px; }
.tr-run h5, .tr-notes h5 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 6px;
  font: 800 0.875rem var(--letra-texto);
}
.tr-notes h5 .ui-icon { width: 16px; height: 16px; }
.tr-results, .tr-checks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tr-checks { padding-left: 1.2em; list-style: decimal; }
.tr-results li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.tr-results p { margin: 2px 0 0; color: var(--tinta-2); font-size: 0.875rem; }
.tr-mark .ui-icon { width: 20px; height: 20px; }
.tr-results .is-pass .tr-mark { color: var(--exito); }
.tr-results .is-fail .tr-mark { color: var(--peligro); }
.tr-trace {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: var(--borde-fino);
  border-radius: var(--radio-campo);
  background: var(--panel);
}
.tr-trace dt { display: flex; align-items: center; gap: 5px; color: var(--tinta-2); font-size: 0.75rem; font-weight: 700; }
.tr-trace dt .ui-icon { width: 14px; height: 14px; }
.tr-trace dd { margin: 2px 0 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.tr-trace-empty { display: flex; gap: 8px; align-items: flex-start; }
.tr-trace-empty p { margin: 0; font-size: 0.875rem; }
.tr-trace-empty .ui-icon { flex: none; width: 18px; height: 18px; }
.tr-shot { display: grid; gap: 6px; align-content: start; color: var(--tinta); font-size: 0.8125rem; font-weight: 700; }
.tr-shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 25 / 16;
  object-fit: cover;
  object-position: top;
  border: var(--borde-fino);
  border-radius: 8px;
}
.tr-shot span { display: inline-flex; align-items: center; gap: 4px; }
.tr-shot .ui-icon { width: 14px; height: 14px; }
.tr-output { margin-top: 10px; }
.tr-output .md { max-height: 480px; overflow: auto; padding: 10px 12px; border: var(--borde-fino); border-radius: var(--radio-campo); }
.tr-untested { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 700; }
.tr-untested .ui-icon { width: 18px; height: 18px; }
.tr-notes { border-top: var(--separador); padding-top: 10px; }
.tr-notes ul { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.tr-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: var(--borde-fino);
  border-radius: var(--radio-campo);
  font-size: 0.875rem;
}
.tr-note.is-abierta { border-color: var(--peligro); background: var(--peligro-suave); }
.tr-note.is-resuelta { color: var(--tinta-2); }
.tr-note p { margin: 4px 0 0; color: var(--tinta); }
.tr-note-state { font-weight: 800; }
.tr-note-form { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: end; }
.tr-note-form label { display: grid; gap: 4px; font-size: 0.8125rem; font-weight: 700; }
.tr-note-form select,
.tr-note-form textarea {
  min-height: 44px;
  padding: 8px 10px;
  border: var(--borde-fino);
  border-radius: var(--radio-campo);
  background: var(--hoja);
  color: var(--tinta);
  font: inherit;
}
.tr-note-form .form-error { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) {
  .tr-run-body, .tr-note-form { grid-template-columns: 1fr; }
}
