/* ═══════════════════════════════════════════════════════════════════════════
   dtx-4 · DISTRIBUTION TASK ▸ SHEET DATA — the spreadsheet layer   2026-09-06
   ---------------------------------------------------------------------------
   Loaded AFTER distribution_task.css and re-cuts the grid it declares. Nothing
   here reaches outside `.dtx-*`, and every colour is a --dt-* token, so this
   file is legible in BOTH ramps by construction rather than by inspection.

   ── THE FOUR THINGS THIS FILE IS RESPONSIBLE FOR ─────────────────────────
   1. GEOMETRY. `table-layout: fixed` plus a <colgroup> the JS owns. Widths are
      declared once, in one place, and the header, the filter row and every
      body cell are laid out from that same number. This is the fix for the
      misalignment in MACE's screenshot: the previous sheet set `min-width` on
      <th> only, inside an auto-layout table, which the browser is entitled to
      ignore — and did, truncating "(NZ) WW Stoke" to "(NZ) WW STOK".

   2. TWO STICKY ROWS, NOT ONE. The header sticks at 0 and the filter row
      sticks directly beneath it. Their heights are FIXED (34px / 30px) for
      exactly that reason: `top` for the second row has to be a real number,
      and a row whose height depends on its content cannot supply one.

   3. FROZEN COLUMNS. `position: sticky; left:` with the offset written inline
      by the JS. The z-index ladder below is what stops a frozen cell being
      painted over by the row it belongs to, or painting over the header.

   4. CONDITIONAL FORMATTING CO-EXISTENCE. CF writes `!important` inline
      styles. Every rule here that could fight it (hover, selection, the "mine"
      tint) is written so it loses gracefully: backgrounds that must sit under
      CF are applied to the <tr> via a token, never to the <td> as a literal.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --dt-hdr-h: 34px;
  --dt-fil-h: 30px;
  /* The row-highlight wash. A conditional-format row rule sets --dt-cf-row to
     the author's colour; this is the strength it is mixed in at, so a row
     highlight can never swallow the per-cell colours painted on top of it. */
  --dt-cf-row-mix: 26%;
}
html[data-dt-theme="dark"] { --dt-cf-row-mix: 34%; }

/* ══ 1 · THE SCROLLER ═════════════════════════════════════════════════════ */

.dtx-grid-wrap {
  position: relative;
  border: 1px solid var(--dt-line);
  border-radius: var(--dt-radius);
  background: var(--dt-panel);
  overflow: auto;
  max-height: calc(100vh - 268px);
  min-height: 220px;
  overscroll-behavior: contain;
}
.dtx-grid-wrap[data-empty] { min-height: 300px; }

.dtx-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  /* width is written inline by the JS from the sum of the colgroup. */
  table-layout: fixed;
}

/* ══ 2 · THE HEADER + FILTER ROWS ═════════════════════════════════════════ */

.dtx-grid thead th {
  position: sticky;
  z-index: 3;
  background: var(--dt-panel2);
  color: var(--dt-text2);
  font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  text-align: left;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--dt-line);
  border-right: 1px solid var(--dt-line);
  user-select: none;
}
.dtx-grid thead tr.dtx-hrow th { top: 0; height: var(--dt-hdr-h); cursor: pointer; }
.dtx-grid thead tr.dtx-frow th {
  top: var(--dt-hdr-h);
  height: var(--dt-fil-h);
  z-index: 3;
  padding: 0 4px;
  cursor: default;
  background: var(--dt-panel3);
  border-bottom: 2px solid var(--dt-line2);
}
.dtx-grid thead tr.dtx-hrow th:hover { color: var(--dt-text); background: var(--dt-panel3); }
.dtx-grid thead th[data-kind="chk"],
.dtx-grid thead th[data-kind="num"] { cursor: default; text-align: center; padding: 0; }
.dtx-grid thead th[data-kind="chk"]:hover { background: var(--dt-panel2); }

.dtx-th-lbl { display: inline-block; vertical-align: middle; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dtx-grid thead th .dtx-sort { color: var(--dt-accent); margin-left: 5px; }

/* The operational block (assignment + progress) is the grid's own, not the
   sheet's. A hairline says so, which is what stops "Status" and "My Status"
   reading as two attempts at the same column. */
.dtx-grid thead th.dtx-th-op { border-left: 2px solid var(--dt-line2); }
.dtx-grid tbody td[data-key^="__"]:not([data-key="__chk"]):not([data-key="__rownum"]) { }

.dtx-th-tag {
  display: inline-block; margin-left: 5px; padding: 1px 5px;
  border-radius: 5px; font-size: 9px; font-weight: 800; letter-spacing: .3px;
  background: var(--dt-panel); color: var(--dt-text3);
  border: 1px solid var(--dt-line2); vertical-align: middle;
}
.dtx-th-tag--qb { background: var(--dt-info-fill); color: var(--dt-info-ink); border-color: transparent; }

/* ── the filter boxes ── */
.dtx-fin {
  width: 100%; height: 22px; padding: 0 6px;
  border: 1px solid var(--dt-line2); border-radius: 5px;
  background: var(--dt-panel); color: var(--dt-text);
  font: inherit; font-size: 11.5px; font-weight: 600; text-transform: none; letter-spacing: 0;
  outline: none;
}
.dtx-fin::placeholder { color: var(--dt-text3); font-weight: 500; }
.dtx-fin:focus { border-color: var(--dt-accent); box-shadow: 0 0 0 2px var(--dt-accent-soft); }
.dtx-fcell[data-on="1"] { background: var(--dt-accent-soft); }
.dtx-fcell[data-on="1"] .dtx-fin { border-color: var(--dt-accent); color: var(--dt-accent); }
.dtx-fglyph { display: block; text-align: center; color: var(--dt-text3); font-size: 9px; }

/* ══ 3 · FROZEN COLUMNS ═══════════════════════════════════════════════════
   The ladder, lowest to highest:
     1  an ordinary body cell
     2  a frozen body cell        — must cover cells that scroll under it
     3  an ordinary header cell   — must cover every body cell
     4  a frozen header cell      — the corner; covers both of the above
   Getting any pair the wrong way round produces text sliding through text,
   which is the whole reason the numbers are written down here. */
.dtx-grid tbody td[data-frozen="1"] {
  position: sticky;
  z-index: 2;
  background: var(--dt-panel);
}
.dtx-grid thead th[data-frozen="1"] { z-index: 4; }
.dtx-grid td[data-frozen="1"]:last-of-type,
.dtx-grid th[data-frozen="1"] + th:not([data-frozen="1"]) { }
.dtx-grid [data-frozen="1"] { box-shadow: 1px 0 0 var(--dt-line); }

/* ══ 4 · BODY CELLS ═══════════════════════════════════════════════════════ */

.dtx-grid tbody td {
  padding: 0;
  border-bottom: 1px solid var(--dt-line);
  border-right: 1px solid var(--dt-line);
  color: var(--dt-text);
  vertical-align: middle;
  overflow: hidden;
}
.dtx-grid tbody tr { background: var(--dt-panel); }

/* A conditional-format ROW rule paints here — on the <tr>, as a wash over the
   sheet's own ground, so per-cell rules stay readable on top of it. */
.dtx-grid tbody tr[data-cf-row] {
  background: color-mix(in srgb, var(--dt-cf-row) var(--dt-cf-row-mix), var(--dt-panel));
}
.dtx-grid tbody tr[data-cf-row] td[data-frozen="1"] {
  background: color-mix(in srgb, var(--dt-cf-row) var(--dt-cf-row-mix), var(--dt-panel));
}

.dtx-grid tbody tr:hover { background: var(--dt-panel2); }
.dtx-grid tbody tr:hover td[data-frozen="1"] { background: var(--dt-panel2); }
.dtx-grid tbody tr[data-sel="1"] { background: var(--dt-accent-soft); }
.dtx-grid tbody tr[data-sel="1"] td[data-frozen="1"] { background: var(--dt-accent-soft); }
.dtx-grid tbody tr[data-mine="1"] td:first-child { box-shadow: inset 3px 0 0 var(--dt-accent); }

.dtx-cell {
  display: block; width: 100%; height: 33px; padding: 0 10px;
  border: 0; background: transparent; color: inherit;
  font: inherit; font-size: 13px; outline: none;
  text-overflow: ellipsis;
}
.dtx-cell:focus {
  background: var(--dt-panel2);
  box-shadow: inset 0 0 0 2px var(--dt-accent);
  border-radius: 4px;
}
.dtx-cell[readonly] { color: var(--dt-text2); cursor: default; }
.dtx-cell--num { text-align: right; font-variant-numeric: tabular-nums; }

td[data-align="right"] .dtx-cell { text-align: right; font-variant-numeric: tabular-nums; }
td[data-align="center"] .dtx-cell { text-align: center; }
td[data-align="left"] .dtx-cell { text-align: left; }

.dtx-rownum {
  text-align: center; color: var(--dt-text3);
  font-size: 11px; font-variant-numeric: tabular-nums; user-select: none;
  cursor: context-menu;
}
.dtx-grid tbody tr:hover .dtx-rownum { color: var(--dt-text2); background: var(--dt-panel3); }
.dtx-chk { text-align: center; }
.dtx-chk input, .dtx-grid thead th[data-kind="chk"] input {
  accent-color: var(--dt-accent-fill); width: 15px; height: 15px; cursor: pointer; margin: 0;
}

.dtx-picker {
  width: 100%; height: 33px; padding: 0 6px; border-radius: 0;
  border: 0; background: transparent;
  color: var(--dt-text); font: inherit; font-size: 12.5px; cursor: pointer;
}
.dtx-picker:disabled { opacity: .6; cursor: not-allowed; }
.dtx-picker:focus-visible { outline: 2px solid var(--dt-accent); outline-offset: -2px; }

/* ── a cell a program owns (G5) ── */
.dtx-cell--qb { cursor: not-allowed; }
.dtx-cell[data-qb="linked"]  { color: var(--dt-info); font-weight: 600; }
.dtx-cell[data-qb="blank"]   { color: var(--dt-text3); }
.dtx-cell[data-qb="pending"] { color: var(--dt-text3); font-style: italic; }
.dtx-cell[data-qb="missing"] { color: var(--dt-warn); font-style: italic; font-size: 11.5px; }

/* ── a duplicated case number ── */
.dtx-cell[data-dup="1"] {
  background: var(--dt-warn-soft);
  color: var(--dt-warn);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--dt-warn);
  border-radius: 4px;
}

.dtx-cf-icon { display: inline-block; padding-left: 8px; font-size: 12px; vertical-align: middle; }

.dtx-emptyrow td { border-right: 0; }
.dtx-emptyrow .dtx-empty { position: sticky; left: 0; width: min(100%, 720px); }

/* ── the resize handle ── */
.dtx-resize {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.dtx-grid thead tr.dtx-hrow th { position: sticky; }
.dtx-grid thead tr.dtx-hrow th { /* the handle is absolutely placed inside */ }
.dtx-grid thead tr.dtx-hrow th { position: sticky; top: 0; }
.dtx-resize::after {
  content: ''; position: absolute; left: 2px; top: 20%; width: 2px; height: 60%;
  background: transparent; border-radius: 2px;
}
.dtx-resize:hover::after { background: var(--dt-accent); }
.dtx-resize-line {
  position: fixed; top: 0; width: 2px; height: 100vh;
  background: var(--dt-accent-fill); z-index: 2147483000; pointer-events: none;
  box-shadow: 0 0 8px var(--dt-accent);
}

/* ══ 5 · THE CONTEXT MENU ═════════════════════════════════════════════════ */

.dtx-ctx {
  position: fixed; z-index: 2147483000;
  min-width: 268px; max-width: 340px;
  padding: 8px 0 6px;
  background: var(--dt-panel);
  border: 1px solid var(--dt-line2);
  border-radius: var(--dt-radius-sm);
  box-shadow: var(--dt-shadow-lg);
  font-family: var(--dt-font); font-size: 13px; color: var(--dt-text);
}
.dtx-ctx-x {
  position: absolute; top: 5px; right: 6px;
  width: 22px; height: 22px; line-height: 1;
  border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--dt-text3); font-size: 12px;
}
.dtx-ctx-x:hover { background: var(--dt-panel3); color: var(--dt-text); }

.dtx-ctx-sec {
  padding: 8px 14px 4px; font-size: 9.5px; font-weight: 800;
  letter-spacing: .9px; text-transform: uppercase; color: var(--dt-text3);
}
.dtx-ctx-sep { height: 1px; margin: 5px 10px; background: var(--dt-line); }

.dtx-ctx-item {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px; cursor: pointer; line-height: 1.35;
}
.dtx-ctx-item:hover, .dtx-ctx-item:focus-visible { background: var(--dt-accent-soft); color: var(--dt-accent); outline: none; }
.dtx-ctx-item.is-off { opacity: .42; cursor: not-allowed; }
.dtx-ctx-item.is-off:hover { background: transparent; color: var(--dt-text); }
.dtx-ctx-item.is-bad { color: var(--dt-bad); }
.dtx-ctx-item.is-bad:hover { background: var(--dt-bad-soft); color: var(--dt-bad); }
.dtx-ctx-item[data-on="1"] { font-weight: 700; }
.dtx-ctx-ico { width: 18px; text-align: center; flex: 0 0 18px; font-size: 13px; }
.dtx-ctx-lbl { flex: 1; }
.dtx-ctx-badge {
  padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 800;
  background: var(--dt-accent-fill); color: var(--dt-accent-ink);
}
.dtx-ctx-arrow { color: var(--dt-text3); font-size: 14px; }

/* M2 — sideways, never down. */
.dtx-ctx-sub {
  display: none; position: absolute; left: 100%; top: -6px;
  min-width: 230px; padding: 6px 0;
  background: var(--dt-panel); border: 1px solid var(--dt-line2);
  border-radius: var(--dt-radius-sm); box-shadow: var(--dt-shadow-lg);
}
.dtx-ctx-item:hover > .dtx-ctx-sub { display: block; }
.dtx-ctx-sub.flip-left { left: auto; right: 100%; }

.dtx-ctx-rename { cursor: default; }
.dtx-ctx-rename:hover { background: transparent; color: var(--dt-text); }
.dtx-ctx-input {
  flex: 1; min-width: 0; height: 28px; padding: 0 8px;
  border: 1px solid var(--dt-accent); border-radius: 6px;
  background: var(--dt-panel2); color: var(--dt-text); font: inherit; font-size: 12.5px;
}
.dtx-ctx-input:focus { outline: 2px solid var(--dt-accent); outline-offset: 1px; }
.dtx-ctx-ok {
  width: 28px; height: 28px; flex: 0 0 28px; cursor: pointer;
  border: 0; border-radius: 6px;
  background: var(--dt-accent-fill); color: var(--dt-accent-ink); font-size: 13px;
}
.dtx-ctx-ok:disabled { opacity: .5; cursor: not-allowed; }

/* ══ 6 · THE DIALOGS (conditional formatting · QB picker · validation) ════ */

.dtx-cf-scrim {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--dt-scrim);
  font-family: var(--dt-font);
}
.dtx-cf-panel {
  display: flex; flex-direction: column;
  width: min(760px, 100%); max-height: min(86vh, 880px);
  background: var(--dt-panel); color: var(--dt-text);
  border: 1px solid var(--dt-line2); border-radius: var(--dt-radius);
  box-shadow: var(--dt-shadow-lg); overflow: hidden;
}
.dtx-qb-panel, .dtx-dv-panel { width: min(560px, 100%); }

.dtx-cf-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--dt-line);
  background: var(--dt-panel2);
}
.dtx-cf-head h3 { margin: 0 0 4px; font-size: 15px; }
.dtx-cf-head p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--dt-text2); max-width: 62ch; }
.dtx-cf-x {
  margin-left: auto; width: 30px; height: 30px; flex: 0 0 30px; cursor: pointer;
  border: 1px solid var(--dt-line2); border-radius: 8px;
  background: var(--dt-panel); color: var(--dt-text2); font-size: 13px;
}
.dtx-cf-x:hover { background: var(--dt-bad-soft); color: var(--dt-bad); border-color: var(--dt-bad); }

.dtx-cf-body { flex: 1; overflow: auto; padding: 16px 18px; display: grid; gap: 14px; }
.dtx-cf-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--dt-line); background: var(--dt-panel2);
}
.dtx-cf-sp { flex: 1; }

.dtx-cf-list { display: grid; gap: 12px; }
.dtx-cf-rule {
  display: grid; gap: 9px; padding: 12px;
  border: 1px solid var(--dt-line); border-radius: var(--dt-radius-sm);
  background: var(--dt-panel2);
}
.dtx-cf-rule-top, .dtx-cf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dtx-cf-row--opts { gap: 16px; }
.dtx-cf-lbl { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--dt-text3); }
.dtx-cf-and { font-size: 12px; color: var(--dt-text3); }
.dtx-cf-note { margin: 0; font-size: 12px; line-height: 1.55; color: var(--dt-text2); }

.dtx-cf-sel, .dtx-cf-in {
  height: 30px; padding: 0 8px; border-radius: 6px;
  border: 1px solid var(--dt-line2); background: var(--dt-panel);
  color: var(--dt-text); font: inherit; font-size: 12.5px;
}
.dtx-cf-sel--wide { min-width: 190px; }
.dtx-cf-in { min-width: 130px; flex: 1; }
.dtx-cf-sel:focus, .dtx-cf-in:focus { outline: 2px solid var(--dt-accent); outline-offset: 1px; }

.dtx-cf-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.dtx-cf-toggle input { accent-color: var(--dt-accent-fill); width: 15px; height: 15px; cursor: pointer; }

.dtx-cf-mini {
  width: 26px; height: 26px; cursor: pointer;
  border: 1px solid var(--dt-line2); border-radius: 6px;
  background: var(--dt-panel); color: var(--dt-text2); font-size: 12px;
}
.dtx-cf-mini:hover:not(:disabled) { background: var(--dt-panel3); color: var(--dt-text); }
.dtx-cf-mini:disabled { opacity: .35; cursor: not-allowed; }
.dtx-cf-mini--bad:hover:not(:disabled) { background: var(--dt-bad-soft); color: var(--dt-bad); border-color: var(--dt-bad); }

.dtx-cf-swatches { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dtx-cf-sw {
  width: 20px; height: 20px; cursor: pointer; padding: 0;
  border: 1px solid var(--dt-line2); border-radius: 5px;
}
.dtx-cf-sw[data-on="1"] { outline: 2px solid var(--dt-accent); outline-offset: 1px; }
.dtx-cf-sw--none { background: var(--dt-panel); color: var(--dt-text2); font-size: 10px; font-weight: 800; }
.dtx-cf-color {
  width: 28px; height: 22px; padding: 0; cursor: pointer;
  border: 1px solid var(--dt-line2); border-radius: 5px; background: var(--dt-panel);
}

.dtx-cf-empty {
  display: grid; gap: 5px; padding: 18px;
  border: 1px dashed var(--dt-line2); border-radius: var(--dt-radius-sm);
  color: var(--dt-text2); font-size: 12.5px; line-height: 1.55; text-align: center;
}
.dtx-cf-empty strong { color: var(--dt-text); font-size: 13.5px; }

.dtx-cf-preview h4 {
  margin: 0 0 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .6px; text-transform: uppercase; color: var(--dt-text3);
}
.dtx-cf-pvlist { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dtx-cf-pvcell {
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--dt-line); background: var(--dt-panel2); color: var(--dt-text);
  max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── the QuickBase field picker ── */
.dtx-qb-search { width: 100%; height: 34px; }
.dtx-qb-list {
  max-height: 46vh; overflow: auto;
  border: 1px solid var(--dt-line); border-radius: var(--dt-radius-sm);
  background: var(--dt-panel2);
}
.dtx-qb-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; cursor: pointer; text-align: left;
  border: 0; border-bottom: 1px solid var(--dt-line);
  background: transparent; color: var(--dt-text); font: inherit; font-size: 12.5px;
}
.dtx-qb-row:hover { background: var(--dt-accent-soft); color: var(--dt-accent); }
.dtx-qb-row[data-on="1"] { background: var(--dt-accent-soft); font-weight: 700; }
.dtx-qb-id {
  flex: 0 0 52px; font-family: var(--dt-mono); font-size: 11px;
  color: var(--dt-text3); font-weight: 700;
}
.dtx-qb-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtx-qb-type { font-size: 10px; color: var(--dt-text3); text-transform: uppercase; letter-spacing: .4px; }
.dtx-qb-on {
  padding: 1px 6px; border-radius: 5px; font-size: 10px; font-weight: 800;
  background: var(--dt-ok-fill); color: var(--dt-ok-ink);
}
.dtx-qb-loading { padding: 16px; font-size: 12.5px; color: var(--dt-text2); text-align: center; }
.dtx-qb-err {
  display: grid; gap: 5px; padding: 18px; text-align: center;
  font-size: 12.5px; line-height: 1.55; color: var(--dt-text2);
}
.dtx-qb-err strong { color: var(--dt-bad); font-size: 13.5px; }

/* ── data validation ── */
.dtx-dv-area {
  width: 100%; padding: 10px; resize: vertical;
  border: 1px solid var(--dt-line2); border-radius: var(--dt-radius-sm);
  background: var(--dt-panel2); color: var(--dt-text);
  font-family: var(--dt-mono); font-size: 12.5px; line-height: 1.65;
}
.dtx-dv-area:focus { outline: 2px solid var(--dt-accent); outline-offset: 1px; }

/* ══ 7 · THE TOOLBAR ══════════════════════════════════════════════════════ */

.dtx-tbgroup {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border: 1px solid var(--dt-line); border-radius: 8px;
  background: var(--dt-panel2);
}
.dtx-tbgroup .dtx-btn { border: 0; background: transparent; }
.dtx-tbgroup .dtx-btn:hover:not(:disabled) { background: var(--dt-panel3); }

.dtx-autosave {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border: 1px solid var(--dt-line); border-radius: 8px;
  background: var(--dt-panel2); font-size: 11.5px; font-weight: 700; cursor: pointer;
  color: var(--dt-text2);
}
.dtx-autosave input { position: absolute; opacity: 0; width: 0; height: 0; }
.dtx-autosave-track {
  position: relative; width: 32px; height: 17px; border-radius: 999px;
  background: var(--dt-line2); transition: background .14s ease; flex: 0 0 32px;
}
.dtx-autosave-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--dt-panel); transition: transform .14s ease;
}
.dtx-autosave input:checked + .dtx-autosave-track { background: var(--dt-ok-fill); }
.dtx-autosave input:checked + .dtx-autosave-track::after { transform: translateX(15px); }
.dtx-autosave input:focus-visible + .dtx-autosave-track { outline: 2px solid var(--dt-accent); outline-offset: 2px; }
.dtx-autosave[data-on="1"] { color: var(--dt-ok); border-color: var(--dt-ok); }

/* `hidden` IS THE WEAKEST RULE IN THE CASCADE, and this file is where MUMS
   paid for that again (memory: overlay-hidden-property-lie). The UA sheet says
   `[hidden] { display: none }` at ZERO specificity, so `.dtx-btn { display:
   flex }` — one class — beats it outright: `<button hidden>` for "Clear
   filters" sat on the toolbar permanently, offering to clear filters nobody
   had set. Every toolbar control that is toggled by the `hidden` PROPERTY
   needs a rule that actually wins. */
.dtx-toolbar [hidden] { display: none !important; }

.dtx-tbnote {
  font-size: 11.5px; font-weight: 700; color: var(--dt-text3);
  font-variant-numeric: tabular-nums;
}
.dtx-tbnote b { color: var(--dt-text); }

/* ══ 8 · THE HIDDEN-COLUMNS PANEL ═════════════════════════════════════════ */

.dtx-cols-list { display: grid; gap: 4px; }
.dtx-cols-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--dt-line);
  border-radius: var(--dt-radius-sm); background: var(--dt-panel2);
}
.dtx-cols-row[data-hidden="1"] { opacity: .62; }
.dtx-cols-row .dtx-cols-name { flex: 1; font-size: 12.5px; font-weight: 600; }
.dtx-cols-meta { font-size: 11px; color: var(--dt-text3); }

@media (max-width: 780px) {
  .dtx-grid-wrap { max-height: calc(100vh - 300px); }
  .dtx-cf-panel { max-height: 92vh; }
}
