/* Calcul déroulé et tableau des élèves.

   Les nombres sont en chasse fixe et alignés à droite, de sorte que les
   séparateurs décimaux d'une colonne sont alignés. La ligne de l'élève
   sélectionné porte le liseré de l'accent ; une ligne mal classée, un liseré
   cyan. */

/* Cadre en dégradé : le fond de bordure passe sous une bordure transparente. */
.worked {
  max-width: 62ch;
  margin: 1.2rem 0 0;
  padding: 0.8rem 1.1rem 0.9rem;
  background: linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box, var(--candy) border-box;
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  corner-shape: bevel;
}

.worked.is-detail { margin-top: 0.75rem; background: var(--sunk); border: 1px solid var(--line); }

.worked-head {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.worked-head b { font-family: var(--body); color: var(--ink); letter-spacing: normal; text-transform: none; font-size: var(--t-sm); }

.worked-line {
  margin: 0.15rem 0;
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
  color: var(--ink);
}
.worked-line b { color: var(--accent-text); font-weight: 600; }

.table-wrap {
  margin: 1.1rem 0 0;
  overflow-x: auto;
}

.students {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}

.students caption {
  padding: 0 0 0.45rem;
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.table-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin: 0 0 0.35rem;
  font-size: var(--t-xs);
}

.students th, .students td {
  padding: 0.3rem 0.6rem;
  text-align: right;
  white-space: nowrap;
}
.students thead th {
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--edge);
}
.students th:first-child, .students td:first-child { text-align: left; padding-left: 0.6rem; }

/* Largeur minimale des colonnes qui suivent l'itération. Un nombre qui gagne
   un chiffre au fil de la descente ne doit pas élargir sa colonne et décaler
   les autres. */
.students thead :is(th.col-z, th.col-p, th.col-loss, th.col-err, th.col-c0, th.col-c1, th.col-c2) { width: 5rem; }
.students thead th.col-y { width: 2.5rem; }
.students tbody tr { border-bottom: 1px solid var(--line); }
.students tbody tr:hover { background: var(--sunk); }

.students tr.miss td:first-child { box-shadow: inset 3px 0 0 var(--alert); }
.students tr.picked { background: var(--accent-soft); }
.students tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.pick {
  padding: 0;
  font: inherit;
  font-family: var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}
.pick:hover { color: var(--accent-text); text-decoration: underline; }
.pick[aria-pressed='true'] { font-weight: 600; }

.students tfoot th {
  padding-top: 0.35rem;
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 600;
  text-align: right;
  color: var(--ink-faint);
}
.students tfoot tr:first-child th, .students tfoot tr:first-child td { border-top: 1px solid var(--edge); }
.students tfoot td { color: var(--ink-soft); }
.students tfoot th.wrap { white-space: normal; text-align: left; font-weight: 400; }
.students tfoot tr.key th { color: var(--accent-text); }
.students tfoot tr.key td { color: var(--accent-text); font-weight: 600; }

.students .hole { color: var(--alert); font-weight: 600; }
.students .imputed .sym { color: var(--accent-text); }

.house.h0 { color: var(--house-0); }
.house.h1 { color: var(--house-1); }
.house.h2 { color: var(--house-2); }
.ko { margin-left: 0.3rem; color: var(--alert); font-weight: 600; }
.case.ko { margin-left: 0; }
.up { color: var(--accent-text); }
.down { color: var(--ink-soft); }

/* Matrice de confusion : une case d'erreur non vide est cerclée de cyan. Les
   colonnes ont une largeur fixe, car les comptes et les taux changent avec
   l'itération. */
.matrix-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.9rem 1.5rem;
  margin: 1.1rem 0 0;
}

.matrix {
  border-collapse: separate;
  border-spacing: 4px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.matrix caption {
  padding: 0 0 0.3rem 4px;
  white-space: nowrap;
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.matrix th, .matrix .corner {
  padding: 0.2rem 0.5rem;
  font-family: var(--body);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
}
.matrix .corner { color: var(--ink-faint); font-weight: 400; }
.matrix td:not(.corner) {
  width: 5.5rem;
  padding: 0.5rem 0.6rem;
  text-align: center;
  white-space: nowrap;
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  corner-shape: bevel;
}
.matrix td.err { border: 2px solid var(--alert); }
.matrix .count { font-size: var(--t-lg); font-weight: 600; color: var(--ink); }
.matrix .kase { font-size: var(--t-xs); color: var(--ink-faint); }
.matrix td.err .kase { color: var(--alert); }

.students.scores td:not(:first-child) { min-width: 5.5rem; }
