/* The four statistics tools in the Desk: SAV, T-TEST, CHI-SQUARE and ALPHA.

   They take their panels, figures and tables from tool.css's ws- kit and
   their drop zone and segmented control from files.css. What is here is
   only what those do not have: columns of pasted numbers side by side, a
   results table whose figures line up, and the data grid of an SPSS file,
   which scrolls both ways with its header and case numbers held in place. */

.st-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.st-cols textarea.ws-area { min-height: 220px; }
textarea.st-one { min-height: 220px; }
.st-opts { margin-top: 4px; }

.st-table td, .st-table th { font-variant-numeric: tabular-nums; }
.st-table td.num, .st-table th.num { white-space: nowrap; }
.st-cap { font: 600 var(--text-sm) var(--font-sans); color: var(--ink); margin: 22px 0 6px; }
.ws-fig > strong { font-variant-numeric: tabular-nums; }
/* Six figures sit as two rows of three rather than five and an orphan. */
.st-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-figs4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* The report lines its columns up with spaces, so it scrolls rather than wraps. */
pre.st-report { white-space: pre; word-break: normal; overflow-x: auto; }

/* The sentence a write-up quotes, set apart from the working. */
.st-apa { font: var(--text-sm)/1.7 var(--font-sans); color: var(--ink); margin: 0 0 14px; }

/* SAV's grid: held header and case column, one line a cell. */
.sv-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-raised); }
.sv-wrap.sv-all { max-height: none; }
.sv-grid { width: auto; min-width: 100%; }
.sv-grid th, .sv-grid td { white-space: nowrap; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sv-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--paper-inset); text-transform: none; letter-spacing: 0; font: 600 var(--text-2xs) var(--font-mono); color: var(--ink); }
.sv-grid tbody th { position: sticky; left: 0; z-index: 1; background: var(--paper-inset); color: var(--ink-soft); font-weight: 500; }
.sv-grid thead th:first-child { left: 0; z-index: 3; }
.sv-grid td { font-family: var(--font-mono); font-size: var(--text-2xs); }
.sv-grid td.sv-miss { color: var(--ink-soft); text-decoration: underline dotted; text-underline-offset: 3px; }
.sv-vars td, .sv-vars th { font-variant-numeric: tabular-nums; }
.sv-vl { list-style: none; margin: 0; padding: 0; }
.sv-vl li { padding: 1px 0; }
.sv-v { font-family: var(--font-mono); color: var(--ink-soft); }
.sv-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent-strong); }
.sv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.sv-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; font: var(--text-sm) var(--font-sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sv-docs { font: var(--text-2xs)/1.6 var(--font-mono); white-space: pre-wrap; margin: 0; }
.status-line.is-bad { color: var(--danger); }

@media (max-width: 620px) {
  .st-cols { grid-template-columns: 1fr; }
  .st-figs, .st-figs4 { grid-template-columns: 1fr 1fr; }
  .sv-wrap { max-height: 60vh; }
}
