/* R30 · Parts & Tools list / selected-record frame (js/m/parts-ptx.js) — the Fleet Status 360 pattern under .acc-entry.ptx.
 * Loaded after accident-entry.css: the Accident container rules give the frame height, the sticky record header and the
 * narrow one-column switch; these rules make the list full width before a selection, a narrow row set after it, and add
 * the draggable divider, the scope chips and the compact tables. Nothing here changes another module. */

/* ---------- Tabs: three equal areas, registers secondary ---------- */
.ptx-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; min-width: 0; }
.ptx-tabs > :first-child { flex: 1 1 auto; min-width: 0; }
.ptx-regs, .ptx-regnav { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 12.5px; color: var(--text-3); padding-bottom: 6px; }
.ptx-regs-l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; color: var(--text-3); }
.ptx-reg { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; color: var(--text-2); text-decoration: none; }
.ptx-reg:hover { background: var(--row-selected); color: var(--text); }
.ptx-reg[aria-current="page"] { background: var(--row-selected); color: var(--text); font-weight: 600; }
.ptx-reg .i { font-size: 13px; }
.ptx-regback { margin: 0; font-size: 13px; }
.acc-entry.ptx .ptx-bar .ptx-regnav { margin-left: auto; padding-bottom: 0; }

/* ---------- Scope chips: bounded, clickable counts with units ---------- */
.ptx-sums { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ptx-sum { display: inline-flex; align-items: baseline; gap: 6px; height: 38px; padding: 0 14px 0 12px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; align-items: center; }
.ptx-sum b { font-size: 19px; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.ptx-sum .ps-u { font-size: 12px; color: var(--text-3); }
.ptx-sum .i { font-size: 15px; color: var(--text-3); align-self: center; }
.ptx-sum:hover { border-color: var(--accent); }
.ptx-sum[aria-pressed="true"] { border-color: var(--accent); background: var(--row-selected); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.ptx-sum.t-warning:not(.t-zero) b { color: var(--warning-text, var(--text)); }
.ptx-sum.t-warning:not(.t-zero) .i { color: var(--warning-text, var(--text-3)); }
.ptx-sum.t-review .i { color: var(--review-text, var(--text-3)); }
.ptx-sum.t-zero b { color: var(--text-3); }
.ptx-sum:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- The split ---------- */
.acc-entry.ptx .ptx-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; }
.acc-entry.ptx .ptx-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; overflow: hidden; }
.acc-entry.ptx .ptx-listhead { display: block; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ptx-count { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 13px; color: var(--text-2); }
.ptx-count b { color: var(--text); font-size: 14px; }
.ptx-aside { margin-left: auto; font-size: 12px; color: var(--text-3); }
.acc-entry.ptx .ptx-tablewrap { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.acc-entry.ptx .ptx-tablewrap:focus { outline: none; }
.acc-entry.ptx .ptx-tablewrap .table-wrap { border: 0; border-radius: 0; overflow: visible; max-height: none; }
.acc-entry.ptx .ptx-tablewrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.ptx-outside { margin: 0; padding: 6px 12px; font-size: 12.5px; color: var(--text-2); background: var(--review-bg); display: flex; gap: 6px; align-items: center; }

/* rows: identity first, the quantity big enough to read across the row */
.ptx-rowlink { display: flex; flex-direction: column; gap: 1px; color: var(--text); text-decoration: none; min-width: 0; }
.ptx-rowlink b { font-weight: 600; overflow-wrap: anywhere; }
.ptx-rowlink .ptx-id { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.ptx-rowlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.acc-entry.ptx .vtable td .cell-sub { display: block; }
/* the base .vtable cell is nowrap (Fleet's fixed-height rows); here a cell wraps so the compact list fits its pane */
.acc-entry.ptx .ptx-tablewrap .vtable tbody td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; padding-top: 6px; padding-bottom: 6px; }
.acc-entry.ptx .ptx-tablewrap .vtable thead th { white-space: normal; }
.ptx-q { font-size: 15px; font-variant-numeric: tabular-nums; }
.ptx-q.is-zero { color: var(--warning-text, var(--text)); }
.acc-entry.ptx .vtable tbody tr[data-href] { cursor: pointer; }
.acc-entry.ptx .vtable tbody tr[data-href]:hover td { background: color-mix(in srgb, var(--row-selected) 55%, transparent); }
.acc-entry.ptx .vtable tbody tr.is-sel td, .acc-entry.ptx .vtable tbody tr.is-last td { background: var(--row-selected); }
.acc-entry.ptx .vtable tbody tr.is-sel td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.acc-entry.ptx .vtable td.c-act { white-space: nowrap; text-align: right; }

/* selected: the narrow row set — no horizontal scroll, the table fills the list width */
.acc-entry.ptx .ptx-split.has-sel .ptx-tablewrap { overflow-x: hidden; }
.acc-entry.ptx .ptx-split.has-sel .ptx-list .vtable { min-width: 0 !important; width: 100%; table-layout: fixed; }
.acc-entry.ptx .ptx-split.has-sel .ptx-list .vtable th:first-child, .acc-entry.ptx .ptx-split.has-sel .ptx-list .vtable td:first-child { width: 46%; }
.acc-entry.ptx .ptx-split.has-sel .ptx-list .vtable td { overflow-wrap: anywhere; vertical-align: top; }

/* divider: drag or ←/→ Home/End */
.ptx-div { position: relative; cursor: col-resize; display: flex; justify-content: center; touch-action: none; }
.ptx-div span { width: 2px; height: 100%; border-radius: 2px; background: transparent; transition: background .12s; }
.ptx-div:hover span, .ptx-div.is-drag span, .ptx-div:focus-visible span { background: var(--accent); }
.ptx-div:focus-visible { outline: none; }
.ptx-div::after { content: ''; position: absolute; top: 50%; left: 50%; width: 4px; height: 28px; margin: -14px 0 0 -2px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

/* the record */
.acc-entry.ptx .ptx-work { min-width: 0; }
.acc-entry.ptx .ptx-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); }
.acc-entry.ptx .ptx-head .ae-h1 { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: start; }
.acc-entry.ptx .ptx-head .aw-kick { display: block; grid-column: 1; grid-row: 1; font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.acc-entry.ptx .ptx-head .aw-ref h2 { grid-column: 1; grid-row: 2; font-size: 20px; }
.acc-entry.ptx .ptx-head .ae-sub { grid-column: 1 / -1; grid-row: 3; font-size: 13px; color: var(--text-2); }
.acc-entry.ptx .ptx-head .ae-sub { display: flex; flex-wrap: wrap; column-gap: 25px; row-gap: 2px; overflow: hidden; }
/* R31 · the separator hangs in the gap before each fact; at the start of a wrapped line it falls outside the box and is clipped */
.acc-entry.ptx .ptx-head .ae-sub span { position: relative; min-width: 0; }
.acc-entry.ptx .ptx-head .ae-sub span + span::before { content: '·'; position: absolute; left: -15px; color: var(--text-3); }
.acc-entry.ptx .ptx-head .ptx-close { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.acc-entry.ptx .ptx-head h2:focus { outline: none; }
.ptx-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.ptx-why { font-size: 12.5px; color: var(--text-2); }
.ptx-body { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.ptx-body .pt-fold .acc-task-b { padding: 4px 14px 12px; }
.ptx-body .pt-fold .acc-task-b > .list-toolbar.solo { padding: 0 0 8px; }
.ptx-body .table-wrap { max-width: 100%; overflow-x: auto; }
.ptx-body .vtable { min-width: 0 !important; width: 100%; }
.ptx-body tr.is-yard td { background: var(--row-selected); }
.ptx-figline { margin: 0 0 8px; }
.ptx-figline .cell-sub { display: inline; margin-left: 8px; }
.acc-entry.ptx .acc-back { display: none; }

/* ---------- Wide: list alone at full width before a selection; narrow rows + record after ---------- */
@container acc-entry (min-width: 860px) {
  .acc-entry.ptx .ptx-split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .acc-entry.ptx .ptx-split.has-sel { grid-template-columns: minmax(260px, var(--ptx-w)) 12px minmax(0, 1fr); }
  .acc-entry.ptx .ptx-split .acc-list { position: static; max-height: none; }
  .acc-entry.ptx .ptx-split.has-sel .ptx-work { padding-left: 2px; }
}
@container acc-entry (min-width: 860px) {
  @media (max-height: 559px) {
    .acc-entry.ptx .ptx-tablewrap { max-height: 70vh; }
  }
}
/* ---------- Narrow: one column — the list, or the record with “All …” ---------- */
@container acc-entry (max-width: 859px) {
  .acc-entry.ptx .ptx-split.has-sel .ptx-list, .acc-entry.ptx .ptx-split.has-sel .ptx-div { display: none; }
  .acc-entry.ptx .ptx-split.has-sel .acc-back { display: inline-flex; align-self: flex-start; margin-bottom: 6px; }
  .acc-entry.ptx .ptx-tablewrap { overflow-x: hidden; }
  .acc-entry.ptx .vtable { min-width: 0 !important; width: 100%; }
  .acc-entry.ptx .vtable .c-sec { display: none; }
  .acc-entry.ptx .vtable td { overflow-wrap: anywhere; vertical-align: top; }
  .ptx-aside { margin-left: 0; flex-basis: 100%; }
  .ptx-sum { height: 34px; padding: 0 10px; }
  .ptx-sum b { font-size: 17px; }
  .ptx-tabs { gap: 2px 8px; }
  .acc-entry.ptx .ptx-bar .ptx-regnav { margin-left: 0; flex-basis: 100%; }
}
@container acc-entry (max-width: 559px) {
  .acc-entry.ptx .vtable td.c-act .btn { padding-inline: 8px; }
  .acc-entry.ptx .ptx-head .aw-ref h2 { font-size: 18px; }
}
.acc-entry.ptx .ptx-tablewrap .vtable tbody td.c-act { white-space: nowrap; }
.acc-entry.ptx .ptx-body .vtable tbody td { white-space: normal; overflow-wrap: anywhere; }

/* R30 QA pass 2 · programmatic focus (tabindex=-1 targets after a route change) draws no ring; keyboard focus on controls still does */
.acc-entry.ptx [tabindex="-1"]:focus, .acc-entry.ptx [tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
/* codes and words do not split mid-token: wrap at spaces, break a token only when it cannot fit at all */
.acc-entry.ptx .ptx-tablewrap .vtable tbody td, .acc-entry.ptx .ptx-rowlink b, .acc-entry.ptx .ptx-rowlink .ptx-id { overflow-wrap: break-word; }
.acc-entry.ptx .vtable .mono, .acc-entry.ptx .ptx-head .mono { white-space: nowrap; }
.acc-entry.ptx .ptx-split.has-sel .vtable td .badge { max-width: 100%; white-space: normal; margin-bottom: 2px; }
.acc-entry.ptx .ptx-split.has-sel .vtable td + td { padding-left: 10px; }
.acc-entry.ptx .ptx-head .ae-sub a { overflow-wrap: anywhere; }
@container acc-entry (max-width: 859px) {
  /* the record alone: chips and toolbar return with the list */
  .acc-entry.ptx:has(.ptx-split.has-sel) .ptx-status, .acc-entry.ptx:has(.ptx-split.has-sel) .ptx-bar { display: none; }
}
@container acc-entry (max-width: 559px) {
  /* phone width: the column cannot grow, so a long token may break rather than push the table wider */
  .acc-entry.ptx .ptx-tablewrap .vtable tbody td, .acc-entry.ptx .ptx-rowlink b, .acc-entry.ptx .ptx-rowlink .ptx-id { overflow-wrap: anywhere; }
  .acc-entry.ptx .vtable .mono { white-space: normal; }
}
/* R30 QA pass 3 · record facts wrap inside the card; record tables let headers wrap; a code in the row sub-line keeps its hyphen */
.acc-entry.ptx .ptx-body .facts > div, .acc-entry.ptx .ptx-body .facts dd { min-width: 0; overflow-wrap: anywhere; }
.acc-entry.ptx .ptx-body .vtable thead th { white-space: normal; overflow: visible; text-overflow: clip; }
.acc-entry.ptx .ptx-rowlink .ptx-code { white-space: nowrap; }
/* R30 QA pass 4 · a wrapped badge stays readable; record links wrap; record tables size columns to their words; the report banner never covers the last lines */
.acc-entry.ptx .ptx-split.has-sel .vtable td .badge { height: auto; min-height: 22px; line-height: 1.25; padding-block: 2px; }
.acc-entry.ptx .ptx-body .facts, .acc-entry.ptx .ptx-body .facts a, .acc-entry.ptx .ptx-body .facts .ref-link { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.acc-entry.ptx .ptx-body .vtable { table-layout: auto; }
.acc-entry.ptx .ptx-body .vtable thead th { overflow-wrap: normal; word-break: normal; max-width: none; }
