/* Ultimate QC — the spreadsheet core's look (sheet_grid.js): the BHA table and the survey
   table. Theme tokens only (GR-16): every colour is a var() from theme.css, so both
   palettes follow. Numbers in IBM Plex Mono, right-aligned, so their digits line up (the
   tables are read column by column). The grid scrolls inside its own box: at 375 px the
   page never scrolls sideways (owner's design, 2026-10-08; a page that scrolled sideways
   hid the panel's other controls - the house rule in live.css, html/body overflow-x:
   clip). The header row and the row numbers stay in view while it scrolls. */
.sheet { position:relative; max-width:100%; min-width:0; }
/* the grid's focus: a hidden text field (sheet_grid.js says why), its focus shown on the
   grid's frame */
.sheet-sink { position:absolute; top:0; left:0; width:1px; height:1px; padding:0; border:0;
  min-height:0; opacity:0; resize:none; overflow:hidden; pointer-events:none; }
.sheet-sink:focus + .sheet-bar + .sheet-scroll { border-color:var(--accent); }
.sheet-bar { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 6px; }
.sheet-scroll { max-width:100%; max-height:480px; overflow:auto;
  border:1px solid var(--edge); border-radius:6px; background:var(--panel); }
/* the keys, said to a screen reader (the sink's aria-describedby); the page's hint says
   them to the eye */
.sheet-help { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%);
  white-space:nowrap; }
.sheet-t { border-collapse:separate; border-spacing:0; min-width:100%;
  font-size:12px; }
.sheet-t th, .sheet-t td { padding:3px 7px; border-bottom:1px solid var(--grid);
  border-right:1px solid var(--grid); white-space:nowrap; height:22px; }
/* a heading carries its unit, so it is not uppercased: 'KN·M²' and 'KG/M' read the m as
   mega (2026-10-08); the app's other tables (.tbl) keep their case too, and a page's own
   'th' rule (the free check uppercases its tables' headings) does not reach these */
.sheet-t thead th { position:sticky; top:0; z-index:1; background:var(--panel2);
  color:var(--muted); font-size:11px; font-weight:600; letter-spacing:.02em;
  text-transform:none; text-align:left; }
.sheet-t thead th.num { text-align:right; }
/* a column refused as a whole (its unit, a heading the intake refuses): the heading in the
   failure colour, its reason in its title and in the list under the table */
.sheet-t thead th.m-refused { color:var(--fail); box-shadow:inset 0 -2px 0 var(--fail); }
.sheet-t th.rn { position:sticky; left:0; z-index:1; background:var(--panel2);
  color:var(--muted); font-family:"IBM Plex Mono",Consolas,monospace; font-weight:500;
  text-align:right; min-width:28px; cursor:pointer; user-select:none; }
.sheet-t thead th.rn { z-index:2; cursor:default; }
.sheet-t th.rn.sel { background:var(--accent-dim); color:var(--ink); }
.sheet-t td { color:var(--ink); cursor:cell; min-width:56px; }
.sheet-t td.num { font-family:"IBM Plex Mono",Consolas,monospace; text-align:right; }
.sheet-t td.sel { background:var(--band); }
.sheet-t td.act { box-shadow:inset 0 0 0 2px var(--accent); }
/* a cell's mark: refused carries the failure colour and its reason in the tooltip (and a
   word in the list under the table, never the colour alone: interface-design 2); assumed
   and derived values are grey, assumed in italic (the owner's rule: assumed values grey
   italic), so a value the page supplied never reads as one the person typed; a note (a
   station kept without a UTC time) is a warning tint; -999.25, the null value, shows
   'null' grey italic */
.sheet-t td.m-refused { box-shadow:inset 0 -2px 0 var(--fail); color:var(--fail);
  background:var(--fail-soft); }
.sheet-t td.m-refused.act { box-shadow:inset 0 0 0 2px var(--fail); }
/* a marked cell inside the selection keeps its mark: the selection tint laid over it (a
   selected refused cell used to read as merely selected) */
.sheet-t td.m-refused.sel { background:color-mix(in srgb, var(--band) 50%, var(--fail-soft)); }
.sheet-t td.m-note { background:var(--warn-soft); }
.sheet-t td.m-note.sel { background:color-mix(in srgb, var(--band) 50%, var(--warn-soft)); }
.sheet-t td.m-assumed { color:var(--muted); font-style:italic; }
.sheet-t td.m-derived { color:var(--muted); }
.sheet-t td.m-null { color:var(--muted); font-style:italic; }
.sheet-t td.ph { color:var(--notrun); font-style:italic; }
/* ...a derived one (a blank set gauge's largest gauge, an EI from a stiffness OD/ID) grey
   but upright: italic is the assumed value's alone (the two read alike, 2026-10-08) */
.sheet-t td.ph.m-derived { font-style:normal; }
.sheet-t td.gut { padding:0 2px; text-align:center; min-width:0; cursor:default; }
.sheet-t tr.sheet-x > td { white-space:normal; background:var(--panel2); cursor:default;
  padding:8px 10px; }
.sheet-in { width:100%; min-width:60px; box-sizing:border-box; font:inherit;
  font-family:"IBM Plex Mono",Consolas,monospace; padding:1px 3px; margin:-2px 0;
  border:1px solid var(--accent); border-radius:3px; background:var(--panel2);
  color:var(--ink); }
@media (max-width:760px) {
  .sheet-scroll { max-height:60vh; }
}
/* the survey table's choices above it (survey_grid.js), one control height; the rows it
   holds and what a paste did, under it */
.sgrid-sel { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; margin:8px 0;
  font-size:12px; }
.sgrid-sel label { display:inline-flex; gap:6px; align-items:center; color:var(--muted); }
.sgrid-sel input.sgnum { width:78px; }
.sgrid-count { margin-left:auto; font-size:11.5px; color:var(--muted);
  font-family:"IBM Plex Mono",Consolas,monospace; }
.sgrid-msg { min-height:1em; margin-top:4px; font-size:11.5px; color:var(--muted); }
.sg-field-refused { box-shadow:0 0 0 1px var(--fail); background:var(--fail-soft); }
.sgrid-refused li { color:var(--fail); }
.sgrid-refused li.kept { color:var(--muted); }
