/* The data table in a numerical prompt. Shared by the player and the Reasoning Clinic:
 * extracted from compass.html on 2026-10-01 alongside prompt_table.js, because the Clinic
 * shows the same prompts inside a lesson's worked example and a second copy would drift.
 */
/* A numerical item's data arrives as SPACE-ALIGNED TEXT, and .prompt renders in the
   proportional body font, so the columns do not line up — Stefano, 2026-09-27: "la tabella
   con i dati non é formattata bene, e a volte questo rende difficile la lettura... bisogna
   fare in modo che le righe e le colonne siano chiaramente divise da linee". All 49 live
   numerical items carry a table; no verbal or frmcq item does, so this only affects the
   skill that needs it. A real <table> rather than a monospace font: the grid is the ask,
   and alignment alone would still leave a wall of digits. */
.prompt-table {
  border-collapse: collapse;
  margin: var(--sp-3) 0;
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums;
  width: auto;
  max-width: 100%;
}
.prompt-table th, .prompt-table td {
  border: 1px solid var(--border);
  padding: var(--sp-2) var(--sp-3);
  text-align: right;
  white-space: nowrap;
}
/* The row label is the one column that reads as prose. */
.prompt-table th:first-child, .prompt-table td:first-child { text-align: left; }
.prompt-table thead th { background: var(--surface-sunken); font-weight: var(--weight-semibold); }
.prompt-caption { font-weight: var(--weight-semibold); margin-bottom: var(--sp-1); }
.prompt-source { font-size: var(--text-sm); color: var(--muted); margin-top: var(--sp-1); }
.prompt-wrap { overflow-x: auto; }
/* Too wide for its card, at any width (persona QA 2026-10-04 on phones, 2026-10-14 on a
   desktop card where a five-column table showed "53", "6(" for the Population column the
   question needed). Headers and row labels may wrap; figures never do ("1 420" split in two
   was the original complaint). What still overflows gets an edge shadow that says "scroll":
   the local/scroll background pair hides each shadow once that edge is reached. */
.prompt-table thead th, .prompt-table th:first-child, .prompt-table td:first-child {
  white-space: normal;
  min-width: 4.5em;
  hyphens: auto;
}
.prompt-wrap {
  background:
    linear-gradient(to right, var(--surface, #fff) 30%, transparent) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface, #fff) 30%, transparent) right / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,.18), transparent) left / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,.18), transparent) right / 10px 100% no-repeat scroll;
}
/* Phones: smaller type and padding so fewer tables need the scroll at all. */
@media (max-width: 560px) {
  .prompt-table { font-size: var(--text-xs); }
  .prompt-table th, .prompt-table td { padding: var(--sp-1) 6px; }
}
