/* treatment.css -- Treatment & Records room. Tokens only; reuses base.css components.
   Prefix trx- (base.css already owns tx-* for transcripts). */

.trx-room { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.trx-head { flex: none; flex-wrap: wrap; column-gap: var(--s4); row-gap: 0; }
.trx-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; font-size: var(--fs-meta); min-width: 0; }
.trx-spec b { font-size: 15px; font-weight: 600; margin: 0 2px; }

.trx-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.trx-body.src-open { grid-template-columns: minmax(0, 1fr) minmax(420px, 40%); }
.trx-main { min-height: 0; overflow: auto; padding: var(--s3) var(--s5) var(--s8); display: flex; flex-direction: column; gap: var(--s5); }
.trx-main > * { flex: none; }
.trx-main > div:empty { display: none; }

/* ---------------------------------------------------------------- spine */
.trx-spine-wrap { overflow: hidden; padding-right: 4px; }
.src-open .trx-plot { --lane-w: 132px; }
.trx-plot { --lane-w: 156px; position: relative; min-width: 640px; }
.trx-axis, .trx-lane, .trx-flagrow { display: grid; grid-template-columns: var(--lane-w) minmax(0, 1fr); }
.trx-axis { height: 22px; align-items: end; }
.trx-axistrack, .trx-track, .trx-flagtrack { position: relative; }
.trx-axistrack { height: 22px; }
.trx-axislbl { align-self: center; }
/* round 7 (S16.12): the month is a 24 px target. The label does not move -- the box grows upward into
   the empty band above the axis, so the hit area meets the minimum without touching the chart. */
.trx-month { position: absolute; bottom: 4px; padding: 8px 4px 2px 5px; font-size: var(--fs-caption); line-height: 14px; color: var(--text-secondary); }
.trx-dollbl { position: absolute; top: 0; margin-left: 4px; font-size: var(--fs-micro); color: var(--text-secondary); line-height: 12px; }
.trx-lanes { position: relative; }
.trx-lane { height: 26px; align-items: center; }
.trx-lanename {
  height: 26px; padding: 0 10px 0 0; border: 0; background: none; text-align: left;
  font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
button.trx-lanename:hover { color: var(--text); }
.trx-lane.is-selected .trx-lanename { color: var(--text); font-weight: 600; }
.trx-track { height: 26px; }
.trx-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-subtle); }
/* one shape per kind of support (S8.4, S8.5); the legend names every one and the aria-label
   carries the same word, so shape and colour are never the only carriers */
.trx-mark {
  position: absolute; top: 50%; width: 2px; height: 12px; margin: -6px 0 0 -1px;
  background: var(--text-secondary); border-radius: 1px; cursor: pointer;
}
.trx-mark::after { content: ""; position: absolute; left: -5px; right: -5px; top: -6px; bottom: -6px; }
.trx-mark.is-key { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--text); }
.trx-mark.is-awaiting { width: 6px; margin-left: -3px; background: transparent; box-shadow: inset 0 0 0 1px var(--text-secondary); border-radius: 1px; }
.trx-mark.is-reported { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--bg-app); box-shadow: inset 0 0 0 1.5px var(--text-secondary); }
.trx-mark.is-scheduled { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 1px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-secondary); transform: rotate(45deg); }
.trx-mark.is-dup { height: 16px; margin-top: -8px; width: 3px; background: var(--text); }
.trx-mark.is-current { box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px var(--accent); background: var(--accent); }
.trx-mark.is-current.is-reported, .trx-mark.is-current.is-scheduled, .trx-mark.is-current.is-awaiting { background: var(--accent-soft); }
.trx-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.trx-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.trx-marklbl { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: var(--fs-micro); line-height: 12px; color: var(--text-secondary); white-space: nowrap; background: var(--bg-app); padding: 0 2px; }
.trx-mark.lbl-left .trx-marklbl { left: auto; right: 11px; }
.trx-referral { position: absolute; top: 50%; border-top: 1px dashed var(--text-secondary); }
.trx-referral.is-requested { border-top-style: solid; border-top-color: var(--line); }
.trx-overlay { position: absolute; top: 0; bottom: 0; left: var(--lane-w); right: 0; pointer-events: none; }
.trx-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-subtle); opacity: 0.7; }
.trx-dol { position: absolute; top: -6px; bottom: 0; border-left: 1px solid var(--text-secondary); opacity: 0.6; }
.trx-gap {
  position: absolute; top: 0; bottom: 0; pointer-events: none; padding: 0; border: 0;
  background: repeating-linear-gradient(135deg, var(--bg-hover) 0 4px, transparent 4px 9px);
  box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line);
}
.trx-gaplink { display: inline-flex; align-items: center; min-height: 24px; border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: 500; text-align: left; }
.trx-gaplink:hover { text-decoration: underline; }
.trx-gaplbl {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%); pointer-events: auto;
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg-app); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-caption); font-weight: 500; color: var(--text); white-space: nowrap;
}
.trx-gap.is-resolved .trx-gaplbl { color: var(--text-secondary); font-weight: 400; }
.trx-flagrow { margin-top: 2px; }
.trx-flagtrack { height: 54px; }
.trx-flag { position: absolute; padding-top: 4px; }
.trx-flag::before { content: ""; position: absolute; left: 0; top: -2px; height: 8px; border-left: 1px solid var(--text-secondary); }
.trx-flag.is-right::before { left: auto; right: 0; }
.trx-flagbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 6px 0 3px; margin-left: -3px;
  border: 0; border-radius: 4px; background: transparent; color: var(--text); font-size: var(--fs-meta); white-space: nowrap;
}
.trx-flag.is-right .trx-flagbtn { margin: 0 -3px 0 0; }
.trx-flagbtn:hover { background: var(--bg-hover); }
.trx-flag.is-active .trx-flagbtn { background: var(--accent-soft); }
.trx-flagcite { padding: 0 5px; height: 18px; display: inline-flex; align-items: center; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-micro); }
.trx-flag.is-resolved .trx-flagbtn { color: var(--text-secondary); }
div.trx-visits { max-height: 320px; overflow: auto; }
div.trx-visits thead th { position: sticky; top: 0; background: var(--bg-app); z-index: 1; }
div.trx-visits td { height: 32px; font-size: var(--fs-meta); }
div.trx-visits tr.is-selected td { background: var(--bg-pane); }

/* ------------------------------------------------------- provider table */
.trx-sechead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.trx-ptable td { height: 46px; font-size: var(--fs-body); }
.trx-ptable.is-wide { table-layout: fixed; }
/* table-layout: fixed takes every column width from the header row, so the widths live on the
   <th> alone. Putting one on td:first-child as well did nothing at desktop and, on a phone where
   the header is hidden and the rows stack, squeezed the specials foot into a 23 per cent gutter. */
.trx-ptable.is-wide th:first-child { width: 23%; }
.trx-ptable.is-wide th:nth-child(2) { width: 15%; }
.trx-ptable.is-wide th:nth-child(3) { width: 21%; }
.trx-ptable.is-wide th:nth-child(4) { width: 17%; }
.trx-ptable.is-wide th:nth-child(5) { width: 20%; }
.trx-ptable.is-wide th:last-child { width: 40px; }
.trx-ptable th:first-child, .trx-ptable td:first-child { padding-left: 8px; }
.trx-prow { cursor: pointer; }
.trx-prow:hover td { background: var(--bg-pane); }
.trx-prow.is-selected td { background: var(--bg-pane); }
.trx-prow.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.trx-prow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.trx-pname > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.trx-pdates { font-size: var(--fs-caption); line-height: 14px; }
/* round 4 (2.2): Visits never wraps; under 720 px it folds into the name cell's second line */
.trx-ptable td.trx-visits { white-space: nowrap; font-size: var(--fs-body); color: var(--text); }
.trx-pvis { display: none; }
.trx-billed { white-space: nowrap; }
.trx-billed .cite { margin-left: 6px; }
.trx-mini { height: 24px; padding: 0 8px; font-size: var(--fs-caption); margin-left: 6px; }
.trx-rowflag {
  min-height: 24px; padding: 2px 8px; border: 0; border-radius: 4px; background: transparent;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: var(--fs-meta); white-space: nowrap;
}
.trx-rowflag:hover { background: var(--bg-hover); }
.trx-ptable tfoot td { height: 38px; border-top: 1px solid var(--line); border-bottom: 0; }

/* --------------------------------------------------------------- thread */
.trx-threadhead { align-items: center; gap: 6px 14px; }
.trx-threadhead .urg { font-size: var(--fs-meta); }
.trx-actions { margin-left: auto; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.trx-events { margin-top: 4px; }
.trx-ev {
  display: grid; grid-template-columns: 64px 72px minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
  padding: 6px 0; font-size: var(--fs-meta); line-height: var(--lh-meta);
}
.trx-ev + .trx-ev { border-top: 1px solid var(--line-subtle); }
.trx-evt { font-size: 12px; }
.trx-evwho { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trx-due .trx-evtext { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trx-empty { padding: 8px 0; }
.trx-threadcard { margin-top: var(--s2); }
.trx-threadcard:empty { display: none; }
.trx-callstrip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: var(--s2);
  padding: 8px 12px; border-radius: var(--r-card); background: var(--bg-pane);
}
.trx-callstrip .w500 { display: inline-flex; align-items: center; gap: 6px; }
.trx-calltime { font-size: var(--fs-meta); }

/* --------------------------------------------------------- source aside */
.trx-aside { min-height: 0; display: flex; flex-direction: column; background: var(--bg-pane); border-left: 1px solid var(--line); }
.trx-note { flex: 1 1 auto; min-height: 0; overflow: auto; padding: var(--rail-pad); }
.trx-pane { display: flex; flex-direction: column; height: 190px; margin: 0 0 12px; border: 1px solid var(--line-subtle); border-radius: var(--r-card); overflow: hidden; background: var(--bg-pane); }
.trx-pane .pane-head { height: 32px; padding-left: 10px; }
.trx-pane .pane-body { padding: var(--s1); }
.trx-pane .paper-pdf { padding: 16px 18px 20px; overflow-x: auto; }
.trx-pane .pdf-pre { white-space: pre; font-size: var(--fs-caption); width: max-content; min-width: 100%; }
div.trx-visits td { white-space: nowrap; }
.trx-notehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.trx-notelede { margin: 2px 0 10px; }
.trx-notetitle { font-size: 15px; line-height: 21px; font-weight: 600; margin: 2px 0 8px; }
.trx-quote {
  margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 2px solid var(--line);
  font-family: var(--font-doc); font-size: 15.5px; line-height: 24px; color: var(--text);
}
.trx-ai { margin: 0 0 12px; font-size: var(--fs-meta); line-height: 19px; color: var(--text); }
.trx-ailbl { font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary); margin-right: 2px; }
.trx-modeseg { margin-bottom: 10px; flex-wrap: wrap; }
.trx-cardhost .pcard { max-width: none; background: var(--bg-raised); }
/* The aside is narrower than a full-width card, so the card's label column is tightened here --
   but only where there is a label column to tighten. Below 721px base.css stacks .pline into
   "22px minmax(0,1fr)" and puts the value in column 2, so this override has to stop there or the
   value inherits a 64px column and wraps one word (or one character) per line. */
@media (min-width: 721px) {
  .trx-cardhost .pline { grid-template-columns: 22px 64px minmax(0, 1fr) auto; }
}
.trx-auditlist li + li { margin-top: 2px; }
.trx-audit {
  display: grid; gap: 1px; width: calc(100% + 16px); margin: 0 -8px; padding: 8px;
  border: 0; border-radius: var(--r-control); background: transparent; text-align: left; color: var(--text);
}
.trx-audit:hover { background: var(--bg-hover); }
.trx-auditkind { font-size: var(--fs-caption); font-weight: 500; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.trx-audittitle { font-size: var(--fs-body); font-weight: 500; }
.trx-audit.is-resolved .trx-audittitle { color: var(--text-secondary); font-weight: 400; }

/* ----------------------------------------------------------- status menu */
.trx-menu {
  position: fixed; z-index: 50; width: 220px; padding: 4px;
  background: var(--bg-raised); border: 1px solid var(--line-subtle); border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.trx-menuhead { padding: 4px 8px 2px; font-size: var(--fs-caption); }
.trx-menuitem {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 28px; padding: 0 8px;
  border: 0; border-radius: 4px; background: none; text-align: left; font-size: var(--fs-meta); color: var(--text);
}
.trx-menuitem:hover, .trx-menuitem:focus-visible { background: var(--bg-hover); outline: none; }
.trx-menuitem.is-current { font-weight: 500; }
.trx-menucheck { width: 14px; display: inline-flex; color: var(--text-secondary); }
.trx-menusep { height: 1px; margin: 4px 0; background: var(--line-subtle); }

/* ------------------------------------------------------------ batch card */
.trx-batchcard { max-width: none; }
.trx-batchtbl { margin: 12px calc(-1 * var(--card-pad)) 0; border-top: 1px solid var(--line-subtle); }
.trx-batchtbl th:first-child, .trx-batchtbl td:first-child { padding-left: var(--card-pad); }
.trx-batchtbl td { font-size: var(--fs-meta); }
.trx-batchtbl tr.is-off td { color: var(--text-secondary); }
.trx-chk { width: 34px; }
.trx-chk input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); vertical-align: middle; }
.trx-move { white-space: nowrap; }
.trx-move .ico { color: var(--text-secondary); }
.trx-from { color: var(--text-secondary); }
.trx-file { white-space: nowrap; }
.trx-file .ico { vertical-align: -2px; }

/* ---------------------------------------------------------- picker sheet */
.trx-sheet { width: 620px; }
.trx-sheetbody { padding-top: 12px; }
.trx-pmeta { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.trx-pmeta label { display: grid; gap: 2px; }
.trx-pmeta .input { width: 160px; }
.trx-pmeta .chip { align-self: center; }
/* round 7 (S18.1, S18.2): the label sits on its own line above its field, the provenance line and the
   validation message each take a whole row so neither is squeezed between two fields */
.trx-plbl { flex: 0 0 auto; align-self: flex-end; margin: 0; }
.trx-pfrom, .trx-perr { flex: 1 0 100%; margin: 0; }
.trx-why { flex: 1 0 100%; }
.trx-pgrp { border-top: 1px solid var(--line-subtle); }
.trx-pgrp:last-child { border-bottom: 1px solid var(--line-subtle); }
.trx-pgroup { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 46px; padding: 4px 8px 4px 4px; background: var(--bg-pane); }
.trx-caret .ico { transition: transform var(--t-press) var(--ease); }
.trx-caret.is-open .ico { transform: rotate(90deg); }
.trx-pcheck { display: inline-flex; align-items: center; gap: 10px; min-width: 190px; cursor: pointer; font-size: var(--fs-body); }
.trx-pcheck input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.trx-prow2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 42px; padding: 4px 8px 4px 42px; border-top: 1px solid var(--line-subtle); }
.trx-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.trx-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-raised);
  color: var(--text-secondary); font-size: var(--fs-caption); white-space: nowrap;
}
.trx-chip:hover { color: var(--text); border-color: var(--text-secondary); }
.trx-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trx-addtype { display: block; margin: 8px 0 10px 42px; }
.trx-addrow .input { max-width: 260px; }
.trx-sheetfoot { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-subtle); background: var(--bg-raised); }
.trx-sheetfoot > .meta { margin-right: auto; }

/* ------------------------------------------------ round 3: shared words */
.trx-mt { margin-top: var(--s3); }
.trx-tabs { align-self: stretch; }
.trx-reviewbtn { height: 26px; padding: 0 10px; font-size: var(--fs-meta); white-space: nowrap; }
.trx-rb { font-size: var(--fs-body); white-space: nowrap; }
.trx-billword { color: var(--accent-text); }
.trx-open { margin: 2px 0 10px; font-size: var(--fs-meta); line-height: 19px; color: var(--text); }
.trx-pane-tall { height: 60vh; min-height: 280px; }
.trx-generic .trx-strip .meta { margin-left: 4px; }

/* --------------------------------------------------------- bills sub-view */
.trx-bbody, .trx-bbody.src-open { grid-template-columns: 264px minmax(0, 1fr) minmax(340px, 28%); }
.trx-blist { min-height: 0; overflow: hidden auto; padding: var(--rail-pad); border-right: 1px solid var(--line-subtle); }
.trx-blisthead { margin-bottom: 8px; }
/* what the segment counts below are counts of (S9.5) */
.trx-bscope { margin: -4px 0 8px; }
.trx-bseg { flex-wrap: wrap; margin-bottom: 10px; }
.trx-bseg .seg-btn { font-size: var(--fs-caption); padding: 0 8px; }
.trx-brows { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; }
.trx-brow {
  display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--text); text-align: left; box-shadow: inset 2px 0 0 transparent;
}
button.trx-brow:hover { background: var(--bg-hover); }
.trx-brow.is-sel { background: var(--bg-pane); box-shadow: inset 2px 0 0 var(--accent); }
.trx-brow { min-width: 0; }
.trx-brow1 .num { white-space: nowrap; flex: none; }
.trx-brow1 { display: flex; min-width: 0; justify-content: space-between; gap: 8px; align-items: baseline; }
.trx-bprov { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.trx-brow2, .trx-brow3 { font-size: var(--fs-caption); line-height: 16px; }
.trx-brow3 { display: inline-flex; align-items: center; gap: 4px; }
.trx-brow.is-unavail .trx-bprov { color: var(--text-secondary); }
.trx-brow.is-retiring { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px; }
.trx-brow-open { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; color: var(--text-secondary); font-size: var(--fs-meta); text-align: left; }
.trx-bwork { gap: var(--s3); }
.trx-bchooser { display: none; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.trx-bchoose { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.trx-bchoose select { max-width: 320px; }
.trx-bprevnext { display: inline-flex; gap: 6px; }
.trx-bh1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.trx-btitle { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; }
.trx-bprov.meta { display: block; margin: 2px 0 0; font-size: 12.5px; line-height: 18px; white-space: normal; overflow: visible; }
.trx-bcheck { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; font-size: var(--fs-body); }
.trx-bcheck.is-bad { font-weight: 500; }
.trx-bglyph { display: inline-flex; align-items: center; justify-content: center; min-width: 14px; font-weight: 600; color: var(--text); }
.trx-bcheck .trx-bglyph { color: var(--text-secondary); }
.trx-bcheck.is-bad .trx-bglyph { color: var(--text); }
.trx-bt td { font-size: var(--fs-body); height: 34px; white-space: nowrap; }
.trx-bt .trx-bg { width: 22px; padding-right: 0; text-align: center; }
.trx-bt .trx-bdesc { white-space: normal; min-width: 110px; }
.trx-bt .trx-bchk { color: var(--text-secondary); white-space: normal; min-width: 150px; }
.trx-bchktext { margin-right: 6px; }
.trx-bt .trx-bacts { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; margin: 2px 0; }
.trx-bt .trx-bacts .trx-mini { margin-left: 0; }
.trx-bt td { padding-left: 6px; padding-right: 6px; }
.trx-bt th { padding-left: 6px; padding-right: 6px; }
.trx-bt tr.is-differs .trx-bchk, .trx-bt tr.is-unlocated .trx-bchk, .trx-bt tr.is-pending .trx-bchk { color: var(--text); }
.trx-bt tr[data-step] { cursor: pointer; }
.trx-bt tr[data-row]:hover td { background: var(--bg-pane); }
.trx-bt tr.is-cur td { background: var(--accent-soft); }
.trx-bt tr.is-cur td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.trx-bt tr[data-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.trx-bt tr.is-disputed td { color: var(--text-secondary); }
.trx-bt .trx-new { font-weight: 600; }
.trx-btotals { margin-top: 4px; }
.trx-bfold td { color: var(--text-secondary); background: var(--bg-pane); }
.trx-bfold .ico { color: var(--text-secondary); }
/* the line is the keys and their words together: base.css hides a <kbd> until its host is used, so
   the words go with it rather than standing alone as "/ step use source value edit open flag" */
.trx-bkeys { margin: 6px 0 0; font-size: 12px; visibility: hidden; }
#trxBTable:is(:hover, :focus-within) .trx-bkeys { visibility: visible; }
#trxBTable:is(:hover, :focus-within) .trx-bkeys kbd { display: inline-flex; }
.trx-bkeys kbd { font-family: var(--font-mono); font-size: var(--fs-micro); padding: 0 4px; border: 1px solid var(--line); border-radius: 3px; }
.trx-bcard .pcard { max-width: none; }
.trx-bextra:empty { display: none; }
.trx-bunacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--s2); }
.trx-bunacts .btn .ico { margin-right: 6px; }
.trx-baside { padding: 0; }
.trx-pane-full { flex: 1 1 auto; height: auto; min-height: 0; margin: 0; border: 0; border-radius: 0; }
.trx-bnosrc { padding: 20px; display: grid; gap: 6px; }

/* 1280-1439 (and beside the Ask sheet): the list folds to a one-line chooser */
@media (max-width: 1439px) {
  .trx-bbody, .trx-bbody.src-open { grid-template-columns: minmax(0, 1fr) minmax(340px, 38%); }
  .trx-bbody .trx-blist { display: none; }
  .trx-bchooser { display: flex; }
}
.shell.ask-open .trx-bbody { grid-template-columns: minmax(0, 1fr) minmax(320px, 36%); }
.shell.ask-open .trx-bbody .trx-blist { display: none; }
.shell.ask-open .trx-bchooser { display: flex; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .trx-body, .trx-body.src-open { grid-template-columns: minmax(0, 1fr) 320px; }
  .trx-body.src-open { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (max-width: 900px) {
  .trx-spine-wrap { overflow-x: auto; }
  .trx-room { height: auto; }
  .trx-body, .trx-body.src-open { display: block; }
  .trx-main { overflow: visible; padding: var(--s3) var(--s3) var(--s5); }
  .trx-aside { border-left: 0; border-top: 1px solid var(--line); }
  .trx-note { overflow: visible; }
  .trx-ptable td { height: auto; padding-top: 6px; padding-bottom: 6px; }
  .trx-billed { white-space: normal; }
  .trx-ev { grid-template-columns: 64px minmax(0, 1fr); }
  .trx-ev .trx-evwho { display: none; }
  .trx-ev > span:last-child { grid-column: 2; }
  .trx-actions { margin-left: 0; }
  .trx-sheet { width: 100vw; }
  .trx-prow2 { padding-left: 16px; }
  .trx-addtype { margin-left: 16px; }
  .trx-bbody .trx-blist { display: block; border-right: 0; border-bottom: 1px solid var(--line-subtle); overflow: visible; }
  .trx-bchooser { display: flex; }
  .trx-baside { min-height: 0; }
  .trx-pane-full { height: 70vh; }
  .trx-bchoose select { max-width: 100%; }
  .trx-bt td { height: auto; padding-top: 6px; padding-bottom: 6px; }
}
@media (max-width: 720px) {
  .trx-ptable .trx-visits { display: none; }
  .trx-pvis { display: inline; }
  /* the folded line is the whole value: let it size the cell rather than ellipsize mid-phrase */
  .trx-ptable .trx-pname > span { max-width: none; }
  .trx-bt thead { display: none; }
  .trx-bt, .trx-bt tbody { display: block; }
  .trx-bt tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-subtle); }
  .trx-bt td { display: block; height: auto; padding: 1px 0; border: 0; white-space: normal; }
  .trx-bt td:empty { display: none; }
  .trx-bt .trx-bdesc { min-width: 0; flex: 1 1 40%; }
  .trx-bt .trx-bchk { flex: 1 1 100%; min-width: 0; padding-left: 22px; }
  .trx-bt .trx-bg { width: 14px; }
  .trx-bt tr.is-cur td { background: transparent; }
  .trx-bt tr.is-cur { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
  .trx-bfold td[colspan] { flex: 1 1 auto; }
}

/* ===================================================== round 7 (Treatment lane) */

/* timeline region head: range, counts, legend, chart / list */
.trx-tlhead { align-items: baseline; gap: 4px 12px; }
.trx-tlhead .trx-tlacts { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.trx-tlrange, .trx-tlcount { white-space: nowrap; }
.trx-legend { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; margin: 0; }
.trx-legend dt { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; }
.trx-legend dd { margin: 0; color: var(--text-secondary); }
.trx-legend .trx-mark { position: static; margin: 0; flex: none; }
.trx-legend .trx-mark.lg { top: auto; }
.trx-legend .trx-mark.is-scheduled { transform: rotate(45deg); }
.lg-referral { display: inline-block; width: 18px; border-top: 1px dashed var(--text-secondary); }
.lg-gap { display: inline-block; width: 18px; height: 12px; background: repeating-linear-gradient(135deg, var(--bg-hover) 0 4px, transparent 4px 9px); box-shadow: inset 0 0 0 1px var(--line); }
.lg-dol { display: inline-block; width: 2px; height: 14px; background: var(--text-secondary); }

/* provider table: one column per axis */
/* one axis per cell: the word on its own line, the qualifier under it, never a compound phrase */
.trx-axcell { font-size: var(--fs-body); white-space: normal; vertical-align: top; padding-top: 10px; padding-bottom: 8px; }
.trx-axcell .st { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: baseline; white-space: normal; }
.trx-axcell .st > .ico { grid-row: 1; }
.trx-axcell .st .st-w { grid-column: 2; }
.trx-axcell .st .st-meta { grid-column: 2; margin-left: 0; }
.trx-axcell .st:not(.st-g-check):not(.st-g-half):not(.st-g-ring):not(.st-g-missing):not(.st-g-x):not(.st-g-alert):not(.st-g-clock) { grid-template-columns: minmax(0, 1fr); }
.trx-axcell .st:not(.st-g-check):not(.st-g-half):not(.st-g-ring):not(.st-g-missing):not(.st-g-x):not(.st-g-alert):not(.st-g-clock) .st-w,
.trx-axcell .st:not(.st-g-check):not(.st-g-half):not(.st-g-ring):not(.st-g-missing):not(.st-g-x):not(.st-g-alert):not(.st-g-clock) .st-meta { grid-column: 1; }
.trx-axcell > .disc { display: inline-block; margin-top: 2px; margin-left: 16px; }
.trx-billcell .money { display: block; text-align: left; }
.trx-bline2 { display: block; margin-top: 2px; }
.trx-pname-link { font-weight: 500; }
.trx-ptable.is-wide .trx-pvis { display: inline; }
.trx-pname.is-billing { padding-left: 24px; }
.trx-pname.is-billing::before { content: ""; position: absolute; left: 12px; top: 14px; width: 8px; border-top: 1px solid var(--line); }
.trx-ptable td.trx-pname { position: relative; }
.trx-pmore { width: 40px; text-align: right; }
.trx-rowmore { opacity: 0; }
.trx-prow:hover .trx-rowmore, .trx-rowmore:focus-visible, .trx-prow:focus-within .trx-rowmore, .trx-rowmore[aria-expanded="true"] { opacity: 1; }
.trx-prownote td { padding-top: 0; height: auto; border-top: 0; }
.trx-prownote .trx-rowflag { display: inline-flex; align-items: center; gap: 6px; }
.trx-ptable tfoot td { height: auto; padding-top: 10px; padding-bottom: 10px; }
.trx-foot1 { display: block; }
.trx-foot1 .money { font-size: 15px; margin: 0 4px; }
.trx-foot2 { display: block; margin-top: 2px; }
.trx-ptable tfoot .fresh-notice { margin: 4px 0 0; }
.trx-follow.urg { display: inline-flex; }
.trx-reqscope { margin: 2px 0 6px; }
.trx-vrecs { display: block; }
.trx-visits td { vertical-align: top; }
.trx-batchrow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px;
  border: 1px solid var(--line-subtle); border-radius: var(--r-card); background: var(--bg-pane); font-size: var(--fs-meta);
}
.trx-batchrow > span { flex: 1 1 auto; min-width: 0; }
.trx-batchnote { margin: 8px 0 0; font-size: var(--fs-meta); color: var(--text-secondary); }

/* round 7: the bulk card's scope bar (S18.9, S18.11) and its partial-failure list (S18.10, S19.11).
   One row above the table: the filter, then the sentence that says what "Record N" will touch. */
.trx-batchbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.trx-batchscope { flex: 1 1 260px; min-width: 0; }
.trx-batchwhy { flex: 1 0 100%; }
.trx-batchfails { margin-top: 12px; padding: 12px var(--card-pad); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg-raised); }
.trx-batchfail-head { margin: 0 0 8px; font-size: var(--fs-meta); }
.trx-batchfail-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.trx-batchfail-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.trx-batchfail-name { flex: 1 1 200px; min-width: 0; font-size: var(--fs-meta); }
@media (max-width: 720px) { .trx-batchscope { flex-basis: 100%; } }
/* Fable R1: the phone form of the batch. Seven columns inside 400 px is a horizontal scroller, and the
   column the batch changes was the one off the right edge -- the reader met "Record 7 bills" before ever
   seeing what recording them would do. Each row folds to a card: provider on the first line, then
   "Overall status (derived)" directly under it, then the rest. Same cells, same order in the DOM, no
   extra markup: the labels are the data-bax attributes the desktop table ignores. */
@media (max-width: 720px) {
  .trx-batchtbl { margin-left: 0; margin-right: 0; }
  .trx-batchtbl table, .trx-batchtbl tbody { display: block; }
  .trx-batchtbl thead { display: none; }
  .trx-batchtbl tr {
    display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(0, auto);
    gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-subtle);
  }
  .trx-batchtbl td { display: block; height: auto; padding: 0; border: 0; }
  .trx-batchtbl td.trx-chk { grid-column: 1; grid-row: 1; padding-left: 0; }
  .trx-batchtbl td.trx-bprov { grid-column: 2 / -1; grid-row: 1; font-weight: 500; }
  .trx-batchtbl td.trx-bstatus { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
  .trx-batchtbl td[data-bax="Matter"] { grid-column: 2 / -1; grid-row: 3; }
  .trx-batchtbl td[data-bax="Bill"] { grid-column: 2; grid-row: 4; white-space: normal; }
  .trx-batchtbl td[data-bax="Amount"] { grid-column: 3; grid-row: 4; text-align: right; }
  .trx-batchtbl td[data-bax="Invoice"] { grid-column: 2 / -1; grid-row: 5; }
  .trx-batchtbl td[data-bax]::before {
    content: attr(data-bax); display: block; margin-bottom: 1px;
    font-size: var(--fs-caption); line-height: 15px; color: var(--text-secondary);
  }
}
.trx-menunote { margin: 0 8px 6px; font-size: var(--fs-caption); line-height: 15px; color: var(--text-secondary); }
.trx-menuwhy { margin-left: auto; }

/* audit aside */
.trx-bounded { margin: 0 0 8px; font-size: var(--fs-body); line-height: var(--lh-body); }
.trx-scope { margin: 0 0 10px; }
.trx-dupcmp { margin: 0 0 8px; }
.trx-dupcmp td, .trx-dupcmp th { font-size: var(--fs-meta); height: 28px; }
.trx-dupcmp tbody th { font-weight: 500; text-align: left; color: var(--text-secondary); }
.trx-dupcmp .trx-cmp { color: var(--text-secondary); }
.trx-note .claim { margin-bottom: 10px; }

/* phone: the timeline folds to its summary row; the provider table becomes cards */
@media (max-width: 720px) {
  .trx-tlhead .trx-tlacts { margin-left: 0; }
  .trx-ptable, .trx-ptable tbody, .trx-ptable tfoot { display: block; }
  .trx-ptable thead { display: none; }
  /* a row is a card, not a wrapped line of cells: the name owns the first line and each axis sits
     in its own labelled box, so the Follow-up word can never land between a bill amount and its
     bill state and two "Received" words can never sit side by side unlabelled */
  .trx-ptable tr.trx-prow { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-subtle); position: relative; }
  .trx-ptable tr.trx-prownote { display: block; border: 0; }
  .trx-ptable td { display: block; height: auto; padding: 0; border: 0; }
  .trx-ptable td.trx-pname { grid-column: 1 / -1; padding-right: 36px; }
  .trx-ptable td.trx-pmore { position: absolute; right: 0; top: 8px; }
  .trx-ptable .trx-rowmore { opacity: 1; }
  .trx-ptable td[data-axis]::before {
    content: attr(data-axis); display: block; margin-bottom: 1px;
    font-size: var(--fs-caption); line-height: 15px; color: var(--text-secondary);
  }
  .trx-ptable td.trx-axcell { padding-top: 0; padding-bottom: 0; }
  .trx-ptable td.trx-billed { text-align: left; white-space: normal; }
  /* the specials foot is the page's headline figure: a full-width block under the cards, not a
     cell that keeps a column's share of a row that is no longer a table row */
  .trx-ptable tfoot tr { display: block; padding: 10px 0 0; border: 0; }
  .trx-ptable tfoot td { display: block; width: auto; }
  .trx-legend { grid-template-columns: minmax(0, 1fr); }
  .trx-legend dd { margin-bottom: 4px; }
}
.trx-bgroup td { font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary); background: var(--bg-pane); height: 26px; }
button.trx-month { border: 0; background: none; cursor: pointer; }
button.trx-month:hover, button.trx-month:focus-visible { color: var(--text); text-decoration: underline; }
.trx-zoom { white-space: nowrap; }
/* uncertainty (hatched) and a recorded, confirmed absence (solid) are never the same mark */
.trx-gap.is-resolved { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--line); }
.lg-gap.is-confirmed { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--line); }
.trx-gaplbl .st { font-size: var(--fs-caption); }
