/* Menu-specific patterns: vehicle tabs, inspection form, maintenance board,
   accident, accounting queue, assignment timeline, work desk, dashboard,
   reports, print sheets, code, admin. */

.avatar { font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; flex: none; }
.nav-item.is-parent-current { background: rgba(255,255,255,.04); }

/* ---------- Vehicles: Lease & Return ---------- */
.date-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.date-card { position: relative; min-height: 104px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.date-card::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: 8px 8px 0 0; background: var(--dom-lease); opacity: .35; }
.date-card.urgent { border-color: var(--warning-line); } .date-card.urgent::before { background: var(--warning); opacity: 1; }
.date-card.overdue { border-color: var(--danger-line); } .date-card.overdue::before { background: var(--danger); opacity: 1; }
.date-card.done::before { background: var(--dom-lease); opacity: 1; }
.dc-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; }
.dc-date { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dc-date.muted { font-size: 16px; color: var(--text-3); font-weight: 600; padding: 4px 0 2px; }
.dc-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.date-card.urgent .dc-sub { color: var(--warning-text); font-weight: 600; }
.area-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.area { display: grid; grid-template-rows: auto 1fr auto; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel), inset 0 3px 0 var(--dom-lease); min-height: 230px; }
.area-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.area-head h3 { font-size: 15px; font-weight: 700; flex: 1; }
.area-head .icon-tile { width: 28px; height: 28px; }
.area-body .facts { gap: 8px 16px; }
.area-body .facts dd { font-size: 13.5px; }
.area-foot { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }

/* ---------- Inspection ---------- */
.due-inline { font-variant-numeric: tabular-nums; }
.insp-form > * + * { margin-top: 14px; }
.sec-jump { position: sticky; top: 0; z-index: 6; display: flex; gap: 4px; padding: 6px; overflow-x: auto; background: rgba(238,242,246,.94); backdrop-filter: blur(4px); border: 1px solid var(--border); border-radius: var(--r-panel); }
.sec-jump button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: none; font-size: 13px; font-weight: 600; color: var(--text-2); }
.sec-jump button:hover { background: var(--surface); color: var(--text); }
.walk { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.walk.view { grid-template-columns: 160px minmax(0, 1fr); }
.walk-diagram { position: sticky; top: 52px; }
.walk-side { display: grid; gap: 12px; align-content: start; }
.surface-seg { flex-wrap: wrap; }
.surface-seg button { min-height: 32px; }
.finding-list { display: grid; gap: 10px; }
.finding { padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: inset 3px 0 0 var(--dom-insp); }
.finding.is-prev { box-shadow: inset 3px 0 0 var(--neutral-line); background: var(--surface-sunken); }
.fd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fd-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.fd-n { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--dom-insp); color: #fff; font-size: 12px; font-weight: 800; flex: none; }
.fd-n.small { width: 20px; height: 20px; font-size: 11px; background: var(--text-2); }
.fd-photos { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fd-photos > .i { font-size: 14px; color: var(--text-3); }
.confirm-none { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.prev-wrap summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.prev-list { display: grid; gap: 6px; margin: 10px 0; }
.prev-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: var(--surface-sunken); font-size: 13px; }
.prev-list li > :last-child { margin-left: auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.thumb { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); font-size: 12px; }
.th-img { display: grid; place-items: center; height: 74px; background: linear-gradient(135deg, #dfe7ee, #eef2f6); color: #9fb0c0; }
.th-img .i { font-size: 26px; }
.th-name { display: block; padding: 6px 8px 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-state { display: flex; align-items: center; gap: 4px; padding: 2px 8px 8px; color: var(--text-2); }
.th-state .i { font-size: 12px; }
.thumb.saved .th-state { color: var(--success-text); }
.thumb.failed { border-color: var(--danger-line); }
.thumb.failed .th-img { background: var(--danger-bg); color: var(--danger); }
.thumb.uploading .th-state { color: var(--dom-tele); }
.eq-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; margin-bottom: 12px; }
.checks { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.checks li { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(0, 1.2fr); gap: 12px; align-items: center; min-height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.checks li:last-child { border-bottom: 0; }
.checks li.issue { background: var(--warning-bg); }
.checks li.none .ck-state { color: var(--text-3); font-style: italic; font-size: 12.5px; }
.ck-label { font-size: 13.5px; font-weight: 600; }
.segmented.sm button { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.segmented.sm button .i { font-size: 13px; }
.checks li.issue .segmented button[aria-pressed="true"] { color: var(--warning-text); }
.checks li.checked .segmented button[aria-pressed="true"] { color: var(--success-text); }
.checks.view li { grid-template-columns: minmax(180px, 1fr) auto minmax(0, 1.2fr); }
/* Inspection review: list of items still open (component-scoped; R4 — the former global .missing leaked into state classes). */
.insp-missing { display: grid; gap: 4px; margin: 12px 0 6px; padding: 10px 12px; border-radius: 8px; background: var(--warning-bg); border: 1px solid var(--warning-line); }
.insp-missing .btn-link { color: var(--warning-text); }
.finding-view { display: grid; gap: 10px; }
.finding-view li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; font-size: 13.5px; }
.fd-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rev-print { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Tractor schematic (proposed drawing) */
.tractor { width: 100%; max-width: 280px; display: block; margin: 0 auto; }
.tractor.sm { max-width: 150px; }
.tractor .zone { fill: transparent; stroke: transparent; cursor: pointer; }
.tractor .zone:hover { fill: rgba(8,127,140,.07); }
.tractor .zone.is-sel { fill: rgba(8,127,140,.12); stroke: var(--dom-insp); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tractor .body rect, .tractor .body circle { fill: #f3f6f9; stroke: #6f8396; stroke-width: 1.4; }
.tractor .body .glass { fill: #dceaf2; }
.tractor .body .tire { fill: #44566a; stroke: #2c3a48; }
.tractor .body .tank { fill: #e3e9ef; }
.tractor .body .rail { fill: #e9eef3; }
.tractor .body .fifth { fill: #e6ecf1; }
.tractor .body .flap { fill: #44566a; }
.tractor .zl { font-size: 10px; font-weight: 800; letter-spacing: .12em; fill: #5d7189; pointer-events: none; }
.tractor .mark circle { fill: var(--dom-insp); stroke: #fff; stroke-width: 2; }
.tractor .mark.prev circle { fill: #5d7189; }
.tractor .mark text { fill: #fff; font-size: 11px; font-weight: 800; pointer-events: none; }

/* ---------- Maintenance ---------- */
.lane + .lane { margin-top: 16px; }
.lane-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.board { display: grid; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.col { min-width: 150px; padding: 8px; border-radius: 8px; background: var(--surface-sunken); border: 1px solid var(--border); min-height: 86px; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.col-empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 10px 0; }
.card-mini { display: grid; gap: 4px; padding: 8px 10px; margin-bottom: 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(13,36,67,.05), inset 3px 0 0 var(--dom-maint); text-decoration: none; color: inherit; font-size: 12.5px; }
.card-mini:hover { border-color: var(--dom-maint); }
.cm-top { display: flex; justify-content: space-between; gap: 6px; }
.cm-top b { color: var(--key-link); }
.cm-veh { font-weight: 700; }
.cm-title { line-height: 1.3; color: var(--text); }
.cm-foot { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.cm-block { display: inline-flex; align-items: center; gap: 3px; color: var(--warning-text); font-weight: 700; font-size: 11.5px; }
.cm-block .i { font-size: 11px; }
.blocker { display: inline-flex; align-items: center; gap: 4px; max-width: 190px; color: var(--warning-text); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blocker .i { font-size: 12px; flex: none; }
.line-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.line-table th { text-align: left; font-size: 12px; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border-strong); }
.line-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.line-table td .input, .line-table td .select { width: 100%; height: 32px; }
.line-table tfoot td { border-bottom: 0; padding-top: 10px; }
.line-table .c-num, .amt-table td { text-align: right; font-variant-numeric: tabular-nums; }
.doc-preview { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.doc-preview > .i { font-size: 30px; color: var(--text-2); }
.sum-line { margin-top: 10px; font-size: 13.5px; color: var(--text-2); text-align: right; }
.sum-line b { color: var(--text); }
.amt-table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.amt-table th { font-size: 12px; color: var(--text-2); text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.amt-table td { padding: 8px 10px; font-size: 15px; font-weight: 700; }

/* ---------- Accident ---------- */
.ob-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.ob-list li:last-child { border-bottom: 0; }
.ob-text { font-weight: 600; font-size: 13.5px; }
.ob-list .cell-sub { grid-column: 1; }
.ob-list .btn { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.pick { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 7px; cursor: pointer; position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick b { color: var(--key-link); }
.pick small { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.on { border-color: var(--danger); background: var(--danger-bg); box-shadow: 0 0 0 1px var(--danger); }
.pick:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.disp-list li { display: grid; grid-template-columns: minmax(0, 1fr) 190px 140px 140px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* ---------- Accounting ---------- */
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.queue-card { display: grid; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); text-decoration: none; color: inherit; }
.queue-card:hover { border-color: var(--accent); }
.qc-top { display: flex; justify-content: space-between; align-items: center; }
.qc-top b { color: var(--key-link); font-size: 15px; }
.qc-payee { font-size: 15px; font-weight: 700; }
.qc-warn { display: flex; align-items: center; gap: 5px; color: var(--warning-text); font-size: 12.5px; font-weight: 600; }
.qc-warn .i { font-size: 13px; }

/* ---------- Parts ---------- */
.vtable.matrix td.zero { color: var(--text-3); }

/* ---------- Daily Assignment ---------- */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav .icon-btn { border-color: var(--border); background: var(--surface); }
.import-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; background: var(--dom-tele-bg); color: var(--dom-tele); font-size: 13px; }
.import-line.warn { background: var(--neutral-bg); color: var(--text-2); }
.tl-grid { display: grid; min-width: 820px; }
.panel.pad:has(.tl-grid) { overflow-x: auto; }
.tl-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 46px; border-bottom: 1px solid var(--border); align-items: center; }
.tl-row.tl-head { min-height: 28px; border-bottom: 1px solid var(--border-strong); font-size: 12px; font-weight: 700; color: var(--text-2); }
.tl-row.conflict { background: var(--danger-bg); }
.tl-truck { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 4px 8px 4px 0; }
.tl-track { position: relative; height: 100%; min-height: 40px; }
.tl-hour { position: absolute; top: 6px; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.tl-line { position: absolute; top: 0; bottom: 0; width: 1px; background: #e8edf2; }
.seg-bar { position: absolute; top: 7px; bottom: 7px; display: flex; flex-direction: column; justify-content: center; padding: 0 8px; border: 0; border-radius: 6px; background: var(--dom-fleet); color: #fff; text-align: left; overflow: hidden; font-size: 11.5px; line-height: 1.15; white-space: nowrap; }
.seg-bar b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.seg-bar span { opacity: .8; }
.seg-bar:hover { background: var(--frame-selected); }
.seg-bar.bad { background: var(--danger); }
.legs { padding-left: 20px; list-style: decimal; font-size: 13.5px; display: grid; gap: 4px; }
.vtable tbody tr.is-conflict td { background: var(--danger-bg); }

/* ---------- Work Desk ---------- */
.wd-group + .wd-group { margin-top: 18px; }
.wd-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--neutral-line); }
.dot.danger { background: var(--danger); } .dot.warning { background: var(--warning); } .dot.info { background: var(--dom-tele); }
.task-list { display: grid; gap: 6px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px 110px auto; gap: 14px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
/* R39 · Work Desk rows: next step · reference · due or waiting · owner · open */
.wd-row, .wd-cols { grid-template-columns: 34px minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(130px, .8fr) minmax(110px, .6fr) 116px; }
.wd-cols { display: grid; gap: 14px; padding: 0 15px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.wd-row { padding: 8px 14px; }
.wd-row .tk-meta { margin-top: 0; }
.wd-kinds { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.wd-kinds .metric { min-height: 64px; padding: 8px 10px; }
.wd-kinds .metric-icon, .wd-kinds .icon-tile { display: none; }
.wd-row .tk-owner small, .wd-row .tk-wait { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); }
.wd-row .tk-act { justify-content: flex-end; }
.wd-row .ref-link { overflow-wrap: anywhere; min-width: 0; white-space: normal; }
.wd-row .tk-act .btn { white-space: nowrap; }
.tk-sub { margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.wd-result { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.wd-result > div { flex: 1; min-width: 0; }
.wd-result.done > .i { color: var(--success); } .wd-result.unconfirmed > .i { color: var(--warning); }
.step-line { flex: 1; min-width: 0; font-size: 13px; }
.step-note { display: block; color: var(--warning-text); font-weight: 600; }
.step-note:empty { display: none; }
.step-target { outline: 2px solid var(--accent); outline-offset: 3px; }
.task:hover { border-color: var(--border-strong); }
.task.is-hl { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tk-title { font-size: 14.5px; font-weight: 700; color: var(--text); text-decoration: none; }
.tk-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.tk-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.kind-label { font-weight: 700; color: var(--text-2); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; }
.tk-stage { padding: 1px 7px; border-radius: 4px; background: var(--surface-sunken); border: 1px solid var(--border); }
.tk-block { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: 12.5px; color: var(--warning-text); font-weight: 600; }
.tk-block .i { font-size: 13px; }
.tk-owner { font-size: 13px; }
.tk-due { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tk-due small { font-size: 11.5px; font-weight: 700; }
.tk-due.overdue { color: var(--danger-text); } .tk-due.today { color: var(--warning-text); }
.tk-act { display: flex; gap: 6px; }

/* ---------- Dashboard ---------- */
.dash-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; align-items: stretch; }
.dash-hero .kpi-row { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-avail { padding: 18px 20px; display: grid; gap: 14px; align-content: start; box-shadow: var(--shadow-panel), inset 0 3px 0 var(--success); }
.ha-top { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ha-label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.ha-num { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--success-text); margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.ha-num span { font-size: 26px; margin-left: 2px; }
.ha-trend { flex: 1 1 260px; max-width: 320px; }
.ha-tlabel { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.spark { width: 100%; height: auto; }
.spark polyline { fill: none; stroke: var(--success); stroke-width: 2.4; stroke-linejoin: round; }
.spark circle { fill: #fff; stroke: var(--success); stroke-width: 2; }
.spark text { font-size: 9px; fill: var(--text-2); }
.stack { display: flex; height: 30px; border-radius: 7px; overflow: hidden; gap: 2px; }
.stack-seg { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; text-decoration: none; min-width: 26px; }
.stack-seg.ok { background: var(--success); } .stack-seg.pending { background: var(--dom-lease); } .stack-seg.review { background: var(--review); } .stack-seg.danger { background: var(--danger); } .stack-seg.neutral { background: var(--neutral-line); }
.stack-seg:hover { filter: brightness(1.1); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.stack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stack-legend .ok { background: var(--success); } .stack-legend .pending { background: var(--dom-lease); } .stack-legend .review { background: var(--review); } .stack-legend .danger { background: var(--danger); }
.heat th[scope="row"] { font-size: 13px; font-weight: 700; text-align: left; padding: 0 10px; background: var(--surface); border-bottom: 1px solid var(--table-row-border); position: static; height: var(--row-h); }
.heat-cell { display: inline-grid; place-items: center; min-width: 44px; height: 28px; padding: 0 10px; border-radius: 6px; font-weight: 800; text-decoration: none; }
.heat-cell.danger { background: var(--danger-bg); color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-line); }
.heat-cell.warning { background: var(--warning-bg); color: var(--warning-text); box-shadow: inset 0 0 0 1px var(--warning-line); }
.heat-cell.info { background: var(--dom-tele-bg); color: var(--dom-tele); }
.heat-cell.neutral { background: var(--neutral-bg); color: var(--text); }
.heat-cell.unknown { background: var(--surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--control-border); border: 0; }
.heat-cell:hover { filter: brightness(.96); text-decoration: underline; }
.heat-zero { color: var(--text-3); }
.alert-list { display: grid; gap: 8px; }
.alert-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.alert-list .icon-tile { width: 28px; height: 28px; }

/* ---------- Reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.report-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); text-decoration: none; color: inherit; }
.report-card:hover { border-color: var(--accent); }
.report-card b { font-size: 15px; }
.report-card p { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.report-card > .i { color: var(--text-3); margin-top: 6px; }
.sum-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); overflow: hidden; }
.sum-item { padding: 12px 14px; border-right: 1px solid var(--border); }
.sum-item:last-child { border-right: 0; }
.sum-item span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); }
.sum-item b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum-item.warning b { color: var(--warning-text); } .sum-item.info b { color: var(--dom-tele); } .sum-item.success b { color: var(--success-text); }

/* ---------- Print preview ---------- */
.print-bar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.print-bar .grow { flex: 1; }
.pb-title { font-weight: 700; font-size: 13.5px; }
.print-note { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; padding: 8px 12px; border-radius: 8px; background: var(--info-bg); color: var(--info-text); font-size: 13px; }
.sheets { display: grid; gap: 24px; justify-content: center; padding-bottom: 24px; }
.sheet { position: relative; width: 8.5in; min-height: 11in; padding: .5in .55in .7in; background: #fff; color: #111; box-shadow: 0 2px 12px rgba(13,36,67,.18); font-size: 11px; line-height: 1.35; }
.sh-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid #1c3a50; margin-bottom: 12px; }
.sh-head.small { border-bottom-width: 1px; }
.sh-logo { width: auto; height: 26px; max-width: 160px; object-fit: contain; }
.sh-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sh-sub { font-size: 10.5px; color: #555; }
.sh-rec { margin-left: auto; text-align: right; font-size: 10.5px; }
.sh-info, .sh-equip, .sh-checks, .sh-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.sh-info th, .sh-equip th { width: 14%; text-align: left; font-weight: 700; background: #f1f4f7; }
.sh-info th, .sh-info td, .sh-equip th, .sh-equip td, .sh-checks th, .sh-checks td, .sh-table th, .sh-table td { border: 1px solid #b9c4cf; padding: 5px 7px; vertical-align: top; }
.sh-checks th, .sh-table th { background: #f1f4f7; text-align: left; }
.sh-checks td.iss { font-weight: 800; color: #8a1c13; }
.sh-walk { display: grid; grid-template-columns: 2.3in 1fr; gap: 16px; margin-bottom: 12px; }
.sh-diagram .tractor { max-width: 2.2in; }
.sh-diagram .tractor .zone { display: none; }
.sh-cap { font-size: 9px; color: #666; text-align: center; }
.sh-findings h3 { font-size: 12px; margin-bottom: 6px; }
.sh-findings ol { display: grid; gap: 5px; list-style: none; padding: 0; }
.sh-sign { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 16px; margin-top: 18px; }
.sh-sign div { font-size: 10px; color: #444; }
.sh-sign span { display: block; height: 22px; border-bottom: 1px solid #333; }
.sheet-foot { position: absolute; left: .55in; right: .55in; bottom: .35in; display: flex; justify-content: space-between; font-size: 9.5px; color: #555; border-top: 1px solid #ccd; padding-top: 5px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.photo-grid figure { margin: 0; }
.photo-grid .ph { height: 1.7in; background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 8px, #e4e9ee 8px, #e4e9ee 16px); border: 1px solid #c8d0d8; }
.photo-grid figcaption { font-size: 9.5px; margin-top: 3px; }
.sh-note { font-size: 9.5px; color: #666; margin-top: 12px; }
.placard { display: grid; place-items: center; }
.pl-box { width: 6in; padding: .4in; border: 4px solid #1c3a50; border-radius: 10px; text-align: center; }
.pl-k { font-size: 18px; font-weight: 800; letter-spacing: .12em; }
.pl-code { font-size: 96px; font-weight: 900; line-height: 1.05; }
.pl-row { font-size: 20px; margin-top: 6px; }
.pl-row.small { font-size: 12px; color: #555; }
.sh-filters { font-size: 10.5px; color: #444; margin-bottom: 8px; }
.sh-filters { display: flex; flex-wrap: wrap; gap: 3px 12px; } .sh-filters .shc small { color: #777; text-transform: uppercase; letter-spacing: .04em; font-size: 8.5px; }
.sh-sum { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid #b9c4cf; }
.sh-sum div { flex: 1; padding: 6px 8px; border-right: 1px solid #b9c4cf; }
.sh-sum div:last-child { border-right: 0; }
.sh-sum span { display: block; font-size: 9.5px; color: #555; }
.sh-sum b { font-size: 14px; }
.sh-table { font-size: 10px; }
.sh-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media print {
  @page { size: letter portrait; margin: 0; }
  body { background: #fff; }
  .app.is-print { display: block; height: auto; }
  .is-print .sidebar, .is-print .topbar, .is-print .tabs, .print-bar, .print-note, .toast-region, .preview-chip { display: none !important; }
  .is-print .main-col, .is-print .main { display: block; overflow: visible; height: auto; }
  .is-print .page { padding: 0; }
  .sheets { display: block; padding: 0; }
  .sheet { box-shadow: none; page-break-after: always; break-after: page; margin: 0; }
  /* No blank page after the last sheet */
  .sheets > .sheet:last-child { page-break-after: auto; break-after: auto; }
  /* Multi-page reports flow over real pages: header row repeats, rows are not cut, pages are numbered */
  .sheet.report { page: report; min-height: 0; width: auto; padding: 0; }
  /* Single-record sheets that can grow (service record, requisition, accident summaries) number their real pages too */
  .sheet.flow { page: record; min-height: 0; width: auto; padding: 0; }
  .sheet.flow .sheet-foot { position: static; }
  .sheet.report.is-sample { page: report-sample; }
  .sheet.flow.is-sample { page: record-sample; }
  /* min-height 11in + padding ran past the letter page (blank second page); border-box keeps one page, longer content still flows */
  .sheet:not(.report):not(.flow) { box-sizing: border-box; min-height: 11in; }
  .sh-table thead { display: table-header-group; }
  .sh-table tr { break-inside: avoid; page-break-inside: avoid; }
  .screen-only { display: none !important; }
}
@page record { size: letter portrait; margin: 0.45in 0.5in 0.6in;
  @bottom-left { content: "GD Trans M&R record"; font: 8pt sans-serif; color: #555; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt sans-serif; color: #555; } }
@page report { size: letter portrait; margin: 0.4in 0.4in 0.55in;
  @bottom-left { content: "GD Trans M&R report"; font: 8pt sans-serif; color: #555; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt sans-serif; color: #555; } }
/* Sample / synthetic sheets: the page footer of every printed page carries the marker too. */
@page record-sample { size: letter portrait; margin: 0.45in 0.5in 0.6in;
  @bottom-left { content: "GD Trans M&R record · sample / demo data — not an NC business record"; font: 8pt sans-serif; color: #555; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt sans-serif; color: #555; } }
@page report-sample { size: letter portrait; margin: 0.4in 0.4in 0.55in;
  @bottom-left { content: "GD Trans M&R report · sample / demo data — not an NC business record"; font: 8pt sans-serif; color: #555; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt sans-serif; color: #555; } }
.sh-prov { margin: -4px 0 10px; padding: 4px 8px; border: 1px dashed #8a99a8; font-size: 8.5pt; line-height: 1.35; color: #333; }
.sh-limit { margin-top: 8px; font-size: 8.5pt; color: #555; font-style: italic; }
.ph.ph-missing { display: grid; place-items: center; font-size: 9pt; color: #777; background: repeating-linear-gradient(45deg, #f4f4f4 0 6px, #fff 6px 12px); }

/* ---------- Code ---------- */
.source-strip { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 12px; padding: 9px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.source-strip > span { display: inline-flex; align-items: center; gap: 6px; }
.source-strip .i { font-size: 14px; }
.source-strip b { color: var(--text); }
.ss-sync { margin-left: auto; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.split.has-pane { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); }
.split-pane { position: sticky; top: 8px; padding: 14px 16px; max-height: calc(100vh - 120px); overflow: auto; }
.pane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pane-head > div:first-child { flex: 1; min-width: 0; }
.pane-head h2 { font-size: 22px; font-weight: 800; }
.pane-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.compare { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.compare th, .compare td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { font-size: 12px; color: var(--text-2); }
.compare tbody th { font-size: 12.5px; color: var(--text-2); font-weight: 600; width: 34%; }
.compare tr.diff td:last-child { background: var(--dom-insp-bg); font-weight: 700; }
.compare tr.diff td:nth-child(2) { color: var(--text-2); text-decoration: line-through; text-decoration-color: #9fb0c0; }
.drop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 24px; border: 2px dashed var(--border-strong); border-radius: 10px; background: var(--surface-sunken); }
.drop > .i { font-size: 28px; color: var(--text-2); }
.drop > div { flex: 1 1 260px; }
.conflict-card { padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow-panel), inset 4px 0 0 var(--warning); }
.cc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.cc-head .badge { margin-left: auto; }
.cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.cc-val { padding: 10px 12px; border-radius: 8px; background: var(--surface-sunken); border: 1px solid var(--border); }
.cc-val span { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.cc-val b { font-size: 15px; overflow-wrap: anywhere; }
.cc-val.mnr { border-color: #a8d8dc; background: var(--dom-insp-bg); }
.cc-val.tms { border-color: #c4cdf0; background: var(--dom-maint-bg); }
.cc-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.master { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; align-items: start; }
.cat-list { display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); position: sticky; top: 8px; }
.cat { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: none; font-size: 13.5px; font-weight: 600; color: var(--text-2); text-align: left; }
.cat .seg-count { margin-left: auto; }
.cat .i { font-size: 13px; color: var(--text-3); }
.cat:hover { background: var(--surface-sunken); color: var(--text); }
.cat.on { background: var(--accent-tint); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.master-main > * + * { margin-top: 12px; }
/* Master Code: 7 management areas → their groups (v06 register). Only the open area lists its groups. */
.mc-areas { gap: 1px; max-height: calc(100vh - 120px); overflow-y: auto; }
.mc-area { display: grid; gap: 1px; }
.mc-area-btn { font-weight: 700; color: var(--text); }
.mc-area-btn .mc-chev { flex: none; transition: transform var(--motion); }
.mc-area-btn[aria-expanded="true"] .mc-chev { transform: rotate(90deg); }
.mc-groups { display: grid; gap: 1px; }
.mc-groups[hidden] { display: none; }
.mc-area-btn { height: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.mc-aname { display: grid; gap: 1px; min-width: 0; }
.mc-cur { font-size: 11.5px; font-weight: 600; color: var(--accent); white-space: normal; }
.mc-area-btn.on-area { background: var(--surface-sunken); }
.mc-group { height: 32px; padding-left: 30px; font-weight: 500; font-size: 13px; }
.mc-gname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mc-group-head h2 { margin: 0; font-size: 16px; }
.rel-list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 10px; row-gap: 2px; }
.rel-list dt { grid-column: 1; color: var(--text-3); font-size: 12.5px; }
.rel-list dd { grid-column: 2; margin: 0; }
.rel-list dt + dd { grid-row: auto; }
.is-policy-pending { opacity: .55; cursor: not-allowed; }
.ref-ident { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 10px; padding: 6px 10px; border: 1px dashed var(--border); border-radius: 6px; font-size: 12.5px; color: var(--text-2); }
.ref-ident .i { flex: none; color: var(--text-3); }
.sh-ident { margin-top: 4px; font-size: 9pt; line-height: 1.35; }
.is-policy-pending:hover { filter: none; }
.code-plain { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; }

/* ---------- Admin ---------- */
.role-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pg { display: grid; gap: 1px; padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); }
.pg b { font-size: 13px; }
.pg span { font-size: 12px; font-weight: 700; }
.pg small { font-size: 11px; color: var(--text-2); }
.pg.edit { box-shadow: inset 3px 0 0 var(--success); } .pg.edit span { color: var(--success-text); }
.pg.view { box-shadow: inset 3px 0 0 var(--dom-tele); } .pg.view span { color: var(--dom-tele); }
.pg.none { background: var(--surface-sunken); } .pg.none span, .pg.none b { color: var(--text-3); }
.perm-table-wrap { position: relative; overflow-x: auto; }
.perm-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.perm-table th { text-align: left; font-size: 12px; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border-strong); }
.perm-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.perm-table tr.ov td { background: var(--accent-tint); }
.ov-tag { font-weight: 800; font-size: 12px; }
.ov-tag.grant { color: var(--success-text); } .ov-tag.deny { color: var(--danger-text); }
.op-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; }
.op-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; align-items: center; padding: 5px 0; font-size: 13px; color: var(--text-3); }
.op-list li .i { font-size: 15px; grid-row: 1 / 3; }
.op-list li small { font-size: 11px; color: var(--text-3); grid-column: 2; }
.op-list li.on { color: var(--text); }
.op-list li.on .i { color: var(--success); }
.role-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-pick .chk small { color: var(--text-3); }
/* Work permissions grouped by business area (Group Roles, Edit role) */
.perm-area { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.perm-area > h4, .perm-area > legend { margin: 0 0 4px; padding: 0; font-size: 12px; font-weight: 700; color: var(--text-2); }
.perm-list .op-main { display: grid; min-width: 0; }
.perm-list .op-main small { grid-column: auto; }
.perm-list li { align-items: start; }
.perm-list li .i { grid-row: 1 / 3; margin-top: 2px; }
.op-who { font-size: 11px; color: var(--text-3); }
.perm-area .perm-opt { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 4px; font-size: 13px; }
.perm-area .perm-opt input { margin-top: 3px; }
.perm-area .perm-opt span { display: grid; gap: 1px; min-width: 0; }
.perm-area .perm-opt small { font-size: 11.5px; color: var(--text-3); }
.perm-area.is-na .perm-opt, .perm-area.is-na li { opacity: .65; }
.role-impact .notice { margin-top: 6px; }
.impact { padding: 10px 12px; border-radius: 8px; background: var(--surface-sunken); border: 1px solid var(--border); font-size: 13px; display: grid; gap: 4px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.int-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.int-head { display: flex; align-items: center; gap: 10px; }
.int-head h2 { font-size: 16px; flex: 1; }
.int-card > p { font-size: 13px; color: var(--text-2); }
.int-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 44px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ---------- Process-integrity additions (REVIEW F1–F9) ---------- */
.same-rec { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.same-rec .i { font-size: 13px; }
.calc-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 3px; font-size: 10px; font-weight: 800; letter-spacing: .04em; background: var(--dom-insp-bg); color: var(--dom-insp); vertical-align: 1px; }
.sh-super { margin: -4px 0 10px; padding: 5px 8px; border: 1px dashed #8a1c13; color: #8a1c13; font-size: 10.5px; font-weight: 700; }
.fu-list { display: grid; gap: 8px; }
.fu-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.fu-list li .icon-tile { width: 28px; height: 28px; }
.fu-list li.overdue { border-color: var(--danger-line); box-shadow: inset 3px 0 0 var(--danger); }
.fu-list li.urgent { border-color: var(--warning-line); box-shadow: inset 3px 0 0 var(--warning); }
.fu-list li.done { background: var(--surface-sunken); color: var(--text-2); }
.action-bar.done { background: var(--success-bg); border-color: var(--success-line); }
.action-bar.done .i { color: var(--success); vertical-align: -2px; }
.doc-preview.details, .doc-preview.missing { border-color: var(--warning-line); background: var(--warning-bg); }
.doc-preview.details > .i, .doc-preview.missing > .i { color: var(--warning-text); }
.doc-preview > .btn { margin-left: auto; }
.ver-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.ver-card.pub { box-shadow: inset 3px 0 0 var(--success); }
.ver-card.pend { box-shadow: inset 3px 0 0 var(--review); background: var(--review-bg); }
.vc-head { font-size: 12px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.pend-list li { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pend-list li:last-child { border-bottom: 0; }
.now-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-left: 2px; }
.stack-legend .neutral { background: var(--neutral-line); }

/* ---------- NC form map (original 30 Day figure, requisition, catalog) ---------- */
.nc-figure { position: relative; width: 100%; max-width: 520px; margin: 0 auto; user-select: none; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.nc-figure img { display: block; width: 100%; height: auto; }
.nc-figure[data-act] { cursor: crosshair; }
.nc-figure.sm { max-width: 300px; }
.nc-figure.print { max-width: none; border: 0; border-radius: 0; }
.nc-figure.is-placing { box-shadow: 0 0 0 3px var(--dom-insp); }
.fig-zone { position: absolute; border: 2px dashed var(--dom-insp); background: rgba(8,127,140,.06); border-radius: 6px; pointer-events: none; }
.fig-mark { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #c0271b; color: #fff; font-size: 12px; font-weight: 800; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.fig-mark.auto { background: #c0271b; opacity: .82; border-style: dashed; }
.fig-mark.prev { background: #5d7189; }
.fig-pending { position: absolute; transform: translate(-50%, -50%); width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--dom-insp); color: var(--dom-insp); display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.85); pointer-events: none; }
.fig-missing { display: none; }
.nc-figure.is-missing img { display: none; }
.nc-figure.is-missing { min-height: 160px; background: var(--warning-bg); }
.nc-figure.is-missing .fig-missing { display: flex; gap: 8px; align-items: flex-start; padding: 14px; font-size: 12.5px; color: var(--warning-text); }
.nc-figure.is-missing .fig-mark { display: none; }
.walk { grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); }
.walk.view { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
.sh-walk { grid-template-columns: 3.6in 1fr; }
.sh-copy { display: inline-block; padding: 1px 6px; border: 1.5px solid #1c3a50; font-weight: 800; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.sh-info.pr th { width: 22%; }
.pr-lines td, .pr-lines th { text-align: left; }
.sh-sign.pr { grid-template-columns: repeat(3, 1fr); margin-top: 28px; }
.sh-sign.pr span { font-size: 10.5px; color: #111; padding-top: 6px; }
.report-card.wide { display: grid; margin-bottom: 12px; }

/* ---------- Role flows & handoffs (ROLE-FLOWS-5) ---------- */
.guarded { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 280px; }
.guarded small { font-size: 11px; line-height: 1.3; color: var(--text-3); }
.guarded .btn[disabled] { opacity: .55; cursor: not-allowed; }
.next-owner { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-tint); color: var(--accent); font-size: 13px; }
.next-owner b { color: var(--text); }
.menu-group { padding: 8px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.menu-item.is-on { background: var(--accent-tint); color: var(--accent); }
.check-list .is-info .i { color: var(--info-text); }
.check-list .is-todo .i { color: var(--text-3); }
.check-list li > .btn, .check-list li > .ref-link { margin-left: auto; flex: none; }
.chk.inline { min-height: 0; margin-right: 6px; font-weight: 700; }
.acting-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13.5px; }
.acting-bar .grow { flex: 1; }
.chip-btn { height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 15px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; margin-top: 12px; }
.flow-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.flow-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.flow-card header h2 { font-size: 16px; font-weight: 800; }
.flow-card header .badge { margin-left: auto; }
.flow-card header p { flex-basis: 100%; }
.ref-link.plain { font-size: 12.5px; font-weight: 700; }
.flow-steps { display: grid; gap: 2px; counter-reset: fs; }
.flow-steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.flow-steps li > .i { font-size: 16px; margin-top: 1px; color: var(--text-3); }
.flow-steps li.done { color: var(--text); }
.flow-steps li.done > .i { color: var(--success); }
.flow-steps li.now { background: var(--accent-tint); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.flow-steps li.now > .i { color: var(--accent); }
.flow-steps li.bad > .i { color: var(--danger); }
.flow-steps li a.small { font-size: 12px; }
.flow-act { margin-top: 6px; }
.track-list { display: grid; gap: 4px; }
.track-list li { display: grid; grid-template-columns: 18px 160px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--surface-sunken); font-size: 13px; }
.track-list li.open > .i { color: var(--warning-text); }
.track-list li.done > .i { color: var(--success); }
.pack-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pack-col h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: 6px; }

/* ---------- Invoice intake: original beside extraction candidates ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; margin: 12px 0; }
.intake-orig { position: sticky; top: 8px; padding: 12px; max-height: calc(100vh - 120px); overflow: auto; }
.intake-fields { padding: 14px 16px; display: grid; gap: 10px; }
.io-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; }
.io-head .cell-sub { margin-left: auto; }
.inv-paper { padding: 22px 24px; background: #fff; border: 1px solid #cfd6de; box-shadow: 0 2px 6px rgba(0,0,0,.08); font: 12.5px/1.45 Georgia, 'Times New Roman', serif; color: #222; }
.inv-paper.photo { transform: rotate(-1.2deg); filter: contrast(.92) brightness(.97) sepia(.08); box-shadow: 0 6px 16px rgba(0,0,0,.18); margin: 8px; }
.ip-banner { margin: -10px -12px 14px; padding: 5px 8px; border: 1px dashed #8a1c13; color: #8a1c13; font: 700 10.5px/1.3 system-ui, sans-serif; }
.ip-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid #222; }
.ip-head > div { text-align: right; }
.ip-ref { margin: 8px 0 12px; font-size: 12px; }
.ip-lines { width: 100%; border-collapse: collapse; }
.ip-lines th, .ip-lines td { padding: 5px 4px; border-bottom: 1px solid #ddd; text-align: left; }
.ip-lines td:nth-child(n+2), .ip-lines th:nth-child(n+2) { text-align: right; }
.ip-tot { display: flex; justify-content: flex-end; gap: 16px; margin-top: 10px; }
.inv-img { display: block; width: 100%; height: auto; border-radius: 6px; }
.inv-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 6px; }
.cand-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cand-table th, .cand-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.cand-table thead th { font-size: 12px; color: var(--text-2); }
.cand-table tbody th { width: 26%; font-weight: 600; color: var(--text-2); }
.cand-table td:nth-child(2) { width: 30%; }
.cand-table.totals tbody th { width: 26%; }
.cand { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--info-bg); color: var(--info-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.cand.none { background: var(--warning-bg); color: var(--warning-text); font-family: inherit; font-style: italic; }
.edit-mark { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--warning-text); }
tr.edited > td:last-child, tr.edited > td:first-child .input { background: var(--warning-bg); }
.form-foot.slim { padding: 10px 0 0; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.ff-state { font-size: 12.5px; color: var(--text-2); }
.w-num { width: 90px; text-align: right; }

/* ---------- Vehicle frame navigation ---------- */
.return-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--accent-tint); }
.return-bar .cell-sub { flex: 1; }
.scoped-view > .rec-head.scoped { margin-top: 2px; }
.rec-head.scoped .rh-title { font-size: 18px; }
.rh-ref { font-weight: 800; color: var(--text-2); margin-right: 4px; }
.alert-list { display: grid; gap: 8px; }
.alert-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.alert-list .icon-tile { width: 28px; height: 28px; }
/* Command scope, data source chip, samples entry, TMS file import */
.drawer-blocked { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: var(--warning-bg); border: 1px solid var(--warning-line); color: var(--warning-text); font-size: 13px; }
.preview-chip.sample { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-line); }
.preview-chip.off { background: var(--surface-sunken); color: var(--text-3); }
.sample-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; max-width: 760px; }
.sample-entry > .i { font-size: 28px; color: var(--accent); }
.sample-entry h2 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.sample-entry p { margin-bottom: 8px; }
.import-panel { margin-bottom: 12px; display: grid; gap: 10px; }
.imp-head { display: flex; align-items: center; gap: 8px; }
.imp-head .cell-sub { flex: 1; }
.drop.slim { padding: 12px 14px; }
.pv-wrap { max-height: 420px; overflow: auto; }
.pv-table th, .pv-table td { white-space: nowrap; font-size: 12.5px; }
/* Workflow scenarios layered on NC source vehicles */
.scenario-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; padding: 9px 12px; border: 1px dashed var(--warning-line); border-radius: 8px; background: var(--warning-bg); color: var(--warning-text); font-size: 12.5px; }
.scenario-tag { display: inline-block; padding: 0 6px; margin-right: 4px; border-radius: 4px; background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-line); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; vertical-align: 1px; }
.yard-check { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; font-weight: 700; white-space: nowrap; }
.yard-check.ok { color: var(--success-text); } .yard-check.bad { color: var(--danger-text); }
/* Data contract state panel (js/data/adapter.js) */
.data-state { padding: 16px 18px; }
.ds-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ds-head h2 { font-size: 16px; font-weight: 800; }
.ds-list { display: grid; gap: 6px; }
.ds-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 6px; background: var(--surface-sunken); font-size: 13px; }
.ds-row.ds-warning > .i { color: var(--warning-text); } .ds-row.ds-error > .i { color: var(--danger); } .ds-row.ds-info > .i { color: var(--info-text); } .ds-row.ds-neutral > .i { color: var(--text-3); }
/* Section-level state (kit.gateSection): one section of a workspace, the rest of the page stays usable */
.section-state { margin: 0 0 14px; }
.section-state .data-state { padding: 12px 14px; box-shadow: none; }
.section-state .ds-head h2 { font-size: 14px; }
.section-state .fld-hint { margin-top: 8px; }
.two-col > .section-state, .fld > .section-state { margin: 0; }
.section-state + .blk, .blk + .section-state, .section-state + .two-col, .two-col + .section-state, .kpi-row + .section-state { margin-top: 14px; }
.data-state[aria-busy="true"] .ds-head .i { animation: ds-spin 1.2s linear infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .data-state[aria-busy="true"] .ds-head .i { animation: none; } }
/* KPI whose register is not connected: a dash, never 0 */
.metric.t-unknown { --tone: #c3cfda; --tone-bg: var(--surface-sunken); --tone-num: var(--text-3); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .dash-hero { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: 1fr; }
  .date-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split.has-pane { grid-template-columns: 1fr; }
  .split-pane { position: static; max-height: none; }
  .task { grid-template-columns: auto minmax(0, 1fr) auto; }
  .wd-cols { display: none; }
  .task.wd-row { grid-template-columns: 34px minmax(0, 1fr) minmax(120px, .6fr) auto; }
  .wd-row .tk-main, .wd-row .tk-meta { grid-column: 2; }
  .wd-row .tk-due { grid-column: 3; grid-row: 1; }
  .wd-row .tk-owner { grid-column: 3; grid-row: 2; }
  .wd-row .tk-act { grid-column: 4; grid-row: 1 / span 2; }
  .wd-row .icon-tile { grid-row: 1 / span 2; }
}
@media (max-width: 900px) {
  .walk, .walk.view { grid-template-columns: 1fr; }
  .walk-diagram { position: static; max-width: 260px; }
  .checks li, .checks.view li { grid-template-columns: 1fr; gap: 6px; }
  .eq-row { grid-template-columns: 1fr; }
  .cc-grid, .cc-choice { grid-template-columns: 1fr; }
  .master { grid-template-columns: 1fr; }
  .cat-list { position: static; grid-auto-flow: column; overflow-x: auto; }
  .disp-list li { grid-template-columns: 1fr; }
  .intake { grid-template-columns: 1fr; }
  .intake-orig { position: static; max-height: none; }
  .pack-grid { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .track-list li { grid-template-columns: 18px minmax(0, 1fr); }
  .track-list li > span { grid-column: 2; }
}
@media (max-width: 760px) {
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task .tk-due, .task .tk-act { grid-column: 2; }
  .task.wd-row { grid-template-columns: 34px minmax(0, 1fr); gap: 6px 12px; }
  .wd-row .tk-main, .wd-row .tk-meta, .wd-row .tk-due, .wd-row .tk-owner, .wd-row .tk-act { grid-column: 2; grid-row: auto; }
  .wd-row .tk-act { justify-content: flex-start; }
  .wd-row .icon-tile { grid-row: 1; }
  .date-row { grid-template-columns: 1fr; }
  .role-pick { grid-template-columns: 1fr; }
  .insp-form .form-foot { padding: 10px; }
  .sheet { width: 100%; min-height: 0; transform: none; }
}
@media (pointer: coarse) { .sec-jump button, .segmented.sm button, .surface-seg button { min-height: 44px; } }
/* Dashboard alerts grouped by cause: count = records in the linked list */
.alert-groups { display: grid; gap: 10px; }
.alert-groups > li { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.alert-groups > li.danger { border-left: 3px solid var(--danger); } .alert-groups > li.review { border-left: 3px solid var(--warning-line); }
.alert-groups > li.warning { border-left: 3px solid var(--warning-line); } .alert-groups > li.info { border-left: 3px solid var(--accent); }
.ag-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.ag-head .icon-tile { width: 28px; height: 28px; }
.ag-items { margin: 6px 0 0 38px; display: grid; gap: 4px; font-size: 13px; }
/* Dashboard rows: panels in one row share the row height (aligned top and bottom); content grows, never clips */
.two-col.dash-row { align-items: stretch; }
.two-col.dash-row > .blk, .two-col.dash-row > .section-state { height: 100%; margin: 0; }
.two-col.dash-row + .two-col.dash-row { margin-top: 14px; }
.ha-formula { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
/* Alerts: collapsed row = cause · count; ▸ toggles the basis and records (separate from the list link) */
.alert-groups > li { padding: 8px 10px; }
.ag-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.ag-title { color: inherit; text-decoration: none; min-width: 0; }
.ag-title:hover b, .ag-title:focus-visible b { text-decoration: underline; }
.ag-toggle { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; color: var(--text-2); }
.ag-toggle .i { transform: rotate(-90deg); transition: transform .15s; }
.ag-toggle[aria-expanded="true"] .i { transform: rotate(0deg); }
.ag-detail { margin: 6px 0 0 38px; }
.ag-detail .ag-items { margin: 4px 0 0; }
@media (prefers-reduced-motion: reduce) { .ag-toggle .i { transition: none; } }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; padding: 8px 12px; border: 1px dashed var(--warning-line); border-radius: 8px; background: var(--warning-bg); font-size: 13px; }
.demo-bar > span { flex: 1 1 320px; }
/* English date field (js/datefield.js): MM/DD/YYYY text + calendar, ISO kept in the hidden original input */
.date-field { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.date-field .date-text { width: 8.6em; }
.date-field .time-text { width: 4.6em; }
.date-field.is-invalid .date-text, .date-field.is-invalid .time-text { border-color: var(--danger); }
.date-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-2); cursor: pointer; flex: none; }
.date-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; width: 248px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.dp-head button, .dp-foot button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-days span { font-size: 11px; color: var(--text-3); text-align: center; padding: 2px 0; }
.dp-grid button { border: 0; background: none; border-radius: 6px; padding: 5px 0; font-size: 12.5px; cursor: pointer; }
.dp-grid button:hover, .dp-grid button:focus-visible { background: var(--accent-tint); }
.dp-grid button.on { background: var(--accent); color: #fff; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; }
/* Narrow widths: wrap instead of pushing past the viewport (scroll strips stay only for tables / kanban) */
.two-col > * { min-width: 0; }
@media (max-width: 1100px) {
  .sec-head { flex-wrap: wrap; }
  .sec-head .sec-end { flex-wrap: wrap; min-width: 0; }
  .segmented { flex-wrap: wrap; max-width: 100%; }
  .sec-tabs { flex-wrap: wrap; overflow: visible; }
}
@media (max-width: 760px) {
  .yard-chips { flex-wrap: wrap; overflow: visible; }
  .list-toolbar, .list-toolbar .toolbar-group { flex-wrap: wrap; min-width: 0; }
  .list-toolbar .toolbar-group > * { min-width: 0; max-width: 100%; }
}
.yard-strip, .yard-strip > * { min-width: 0; }
@media (max-width: 1100px) { .yard-chips { flex-wrap: wrap; overflow: visible; } }
/* Daily Assignment timeline keeps its hour scale and scrolls inside its panel */
.panel.pad:has(> .tl-grid) { overflow-x: auto; }
.date-field { flex-wrap: wrap; }
.date-err { flex-basis: 100%; font-size: 12px; color: var(--danger-text, var(--danger)); margin-top: 2px; }
/* English file picker (js/filefield.js): native input kept for forms, visually hidden */
.file-field { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; flex-wrap: wrap; }
.file-field .file-name { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.file-native { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.pg-edit { display: grid; gap: 4px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.row-list li.sub { padding-left: 18px; }

/* ---------- Accident workspace (R2): counted views, identity-first cards, one case with nine tasks ----------
 * One status language everywhere (number circle, 9-segment strip, badge, counts):
 *   completed green · in progress blue · external wait amber · not started grey · N/A / archived hatched grey ·
 *   follow-up violet · red ONLY for overdue / immediate items. Expansion is shown by the arrow and a dark left border. */
:root {
  --st-done: #1f8a4c; --st-done-bg: #e9f7ee; --st-done-line: #a9d6b9;
  --st-prog: #2457c5; --st-prog-bg: #e8effc; --st-prog-line: #b9cbf2;
  --st-wait: #b97800; --st-wait-bg: #fff4d6; --st-wait-line: #e6c56f;
  --st-todo: #8a9bb0; --st-todo-bg: #f1f4f8; --st-todo-line: #c3cfdb;
  --st-follow: #6a43a0; --st-follow-bg: #f3edff;
  --st-late: #c0271c; --st-late-bg: #fff0ee;
  --st-ink: #1c3a50;
  --st-hatch: repeating-linear-gradient(135deg, #dfe6ee 0 3px, #f6f8fb 3px 6px);
}
.acc-split { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
/* R4 navigation order (8fd32174 · 5): the filter tabs + search stay fixed; ONLY the card list scrolls (no forced scrollbar
   for a short list); the right work pane scrolls on its own with the page. */
.acc-list { position: sticky; top: 0; max-height: calc(100dvh - var(--header-h) - var(--tabs-h) - 28px); display: flex; flex-direction: column; overflow: hidden; padding: 0; background: #f7f9fc; }
.acc-list-head { flex: none; position: relative; z-index: 2; background: var(--surface); padding: 10px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.acc-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.acc-view { --vc: var(--st-ink); display: grid; gap: 4px; text-align: left; padding: 8px 10px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-sunken); color: var(--text-2); cursor: pointer; font: inherit; min-width: 0; }
.acc-view.v-process { --vc: var(--st-prog); } .acc-view.v-closed { --vc: var(--st-done); }
.acc-view .av-top { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-view .av-top .i { font-size: 14px; color: var(--vc); flex: none; }
.acc-view .av-n { font-size: 26px; line-height: 1; font-weight: 800; color: var(--text); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.acc-view:hover { border-color: #9fb3c8; }
.acc-view.on { background: var(--surface); color: var(--vc); border-color: var(--vc); box-shadow: inset 0 0 0 1px var(--vc), 0 3px 10px rgba(13, 36, 67, .1); }
.acc-view.on .av-n { color: var(--vc); }
.acc-find { display: flex; gap: 6px; align-items: center; }
.acc-find .search { flex: 1; min-width: 0; }
.acc-cards { list-style: none; margin: 0; padding: 10px; display: grid; gap: 10px; align-content: start; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.acc-card { display: grid; gap: 7px; padding: 11px 12px 12px; border: 1px solid var(--border); border-left: 4px solid transparent; border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 1px 0 rgba(13, 36, 67, .04); transition: box-shadow .12s, border-color .12s; }
.acc-card:hover { border-color: #9fb3c8; box-shadow: 0 3px 10px rgba(13, 36, 67, .09); }
.acc-card.on { background: #f2f6ff; border-color: var(--st-prog-line); border-left-color: var(--accent); box-shadow: 0 3px 12px rgba(36, 84, 189, .14); }
.acc-card:focus-visible { box-shadow: var(--focus-ring); }
.ac-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; min-width: 0; }
.ac-ref { font-size: 15.5px; font-weight: 800; letter-spacing: .01em; color: var(--text); font-variant-numeric: tabular-nums; }
.ac-date { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ac-unit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ac-truck { box-sizing: border-box; display: inline-flex; flex: none; gap: 6px; align-items: center; justify-content: flex-start; height: var(--truck-h); min-width: var(--truck-min-w); max-width: 100%; padding: 0 9px 0 7px; border-radius: 6px; background: var(--st-ink); color: #fff; font-size: 13.5px; line-height: 1; font-variant-numeric: tabular-nums; }
/* Icon frame is fixed (never shrinks with the code); the outline grows only for genuinely longer codes. */
.ac-truck .i { width: var(--ic-truck); height: var(--ic-truck); flex: 0 0 var(--ic-truck); font-size: var(--ic-truck); } .ac-truck b { font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.ac-truck.none { background: var(--surface-sunken); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--border); } .ac-truck.none b { font-weight: 600; }
.ac-drv { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--text); font-weight: 600; }
.ac-drv .i { font-size: 13px; color: var(--text-3); }
.ac-title { font-size: 13px; color: var(--text-2); font-weight: 500; line-height: 1.35; }
.acc-strip { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.acc-strip .sg { display: block; height: 6px; border-radius: 3px; background: var(--st-todo-bg); box-shadow: inset 0 0 0 1px var(--st-todo-line); }
.acc-strip .sg.st-done { background: var(--st-done); box-shadow: none; }
.acc-strip .sg.st-progress { background: var(--st-prog); box-shadow: none; }
.acc-strip .sg.st-wait { background: var(--st-wait); box-shadow: none; }
.acc-strip .sg.st-transferred { background: var(--st-follow); box-shadow: none; }
.acc-strip .sg.st-na, .acc-strip .sg.st-archived { background: var(--st-hatch); box-shadow: none; }
.acc-strip .sg.is-late { box-shadow: 0 0 0 2px var(--st-late); }
.acc-strip.lg .sg { height: 10px; border-radius: 4px; }
.ac-reason { display: grid; gap: 8px; justify-items: start; }
.ac-rtext { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acc-empty, .acc-note { margin: 0; padding: 14px 12px; font-size: 12.5px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }
.acc-note { background: var(--surface-sunken); border-bottom: 1px solid var(--border); display: block; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.acc-ws { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.acc-ws-empty { display: flex; gap: 14px; align-items: center; padding: 32px 24px; }
.acc-ws-empty p { display: grid; gap: 2px; margin: 0; }
/* Incident header */
.acc-wshead { position: sticky; top: 0; z-index: 3; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--st-prog); border-radius: 12px; padding: 8px 14px 12px; display: grid; gap: 8px; box-shadow: 0 3px 12px rgba(13, 36, 67, .09); }
.acc-wshead.v-open { border-top-color: var(--st-ink); } .acc-wshead.v-closed { border-top-color: var(--st-done); }
.aw-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.aw-l1 .grow, .task-foot .grow { flex: 1; }
.aw-id { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.aw-ref { min-width: 0; display: grid; gap: 2px; }
.aw-kick { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.aw-ref h2 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.aw-ref h2 .ref-link { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--st-prog-line); font-variant-numeric: tabular-nums; }
.aw-ref h2 .ref-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.aw-title { font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.aw-unit { display: flex; gap: 9px; align-items: center; padding: 7px 14px 7px 10px; border-radius: 10px; background: var(--st-ink); color: #fff; }
.aw-unit > .i { font-size: 24px; }
.aw-unit b { display: block; font-size: 19px; font-weight: 800; line-height: 1.05; }
.aw-unit small { display: flex; gap: 4px; align-items: center; font-size: 12px; color: #d4e1ec; }
.aw-state .badge { font-size: 13px; padding: 4px 10px; }
.aw-l2 { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); align-items: center; }
.aw-l2 > span { display: inline-flex; gap: 5px; align-items: center; }
.aw-l2 > span > .i { color: var(--text-3); }
.aw-int { margin-left: auto; font-size: 11.5px; color: var(--text-3) !important; }
.aw-prog { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.aw-counts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.aw-counts li { display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.aw-counts li::before { content: ""; width: 9px; height: 9px; border-radius: 3px; align-self: center; background: var(--st-todo-bg); box-shadow: inset 0 0 0 1px var(--st-todo-line); }
.aw-counts b { font-size: 19px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.aw-counts .ct-done::before { background: var(--st-done); box-shadow: none; } .aw-counts .ct-done b { color: var(--st-done); }
.aw-counts .ct-progress::before { background: var(--st-prog); box-shadow: none; } .aw-counts .ct-progress b { color: var(--st-prog); }
.aw-counts .ct-wait::before { background: var(--st-wait); box-shadow: none; } .aw-counts .ct-wait b { color: var(--st-wait); }
.aw-counts .ct-na::before, .aw-counts .ct-archived::before { background: var(--st-hatch); box-shadow: none; }
.aw-counts .ct-follow::before { background: var(--st-follow); box-shadow: none; }
.aw-reasons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.aw-ext { font-size: 12px; color: var(--st-wait); font-weight: 600; white-space: nowrap; } .aw-ext b { font-size: 15px; font-weight: 800; }
.acc-back { display: none; }
/* Task sections */
.acc-tasks { display: grid; gap: 7px; }
.acc-task { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid transparent; border-radius: 10px; scroll-margin-top: 200px; }
.acc-task.is-open { border-color: #9fb3c8; border-left-color: var(--st-ink); box-shadow: 0 4px 16px rgba(13, 36, 67, .1); }
.acc-task-h { margin: 0; }
/* R4 closure amendment · 1: every task row uses the same tracks — number | title | summary | required-count slot | state |
   disclosure. The count slot is always present (empty when a task has no count) so summary, state and chevron line up. */
.acc-task-btn { width: 100%; display: grid; grid-template-columns: 30px minmax(170px, 1.05fr) minmax(0, 1.35fr) 96px 178px 16px; align-items: center; gap: 6px 12px; padding: 10px 12px; border: 0; border-radius: 9px; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.acc-task-btn:hover { background: var(--surface-sunken); }
.acc-task.is-open > .acc-task-h .acc-task-btn { border-radius: 9px 9px 0 0; }
.at-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--st-todo-bg); color: #5d7189; box-shadow: inset 0 0 0 2px var(--st-todo-line); }
.st-done .at-n { background: var(--st-done); color: #fff; box-shadow: none; }
.st-progress .at-n { background: var(--st-prog); color: #fff; box-shadow: none; }
.st-wait .at-n { background: var(--st-wait); color: #fff; box-shadow: none; }
.st-transferred .at-n { background: var(--st-follow-bg); color: var(--st-follow); box-shadow: inset 0 0 0 2px var(--st-follow); }
.st-na .at-n, .st-archived .at-n { background: var(--st-hatch); color: #6c7f94; box-shadow: inset 0 0 0 1px var(--st-todo-line); }
.is-late .at-n { box-shadow: 0 0 0 3px var(--st-late-bg), 0 0 0 5px var(--st-late); }
.at-t { display: grid; min-width: 0; }
.at-t b { font-size: 14px; font-weight: 700; }
.at-t small { font-size: 11.5px; color: var(--text-3); }
.at-s { min-width: 0; font-size: 12.5px; line-height: 1.35; color: var(--text-2); overflow-wrap: anywhere; text-align: left; }
.at-c { display: flex; justify-content: flex-start; min-width: 0; }
.at-st { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-start; min-width: 0; }
.at-st .badge { flex: none; max-width: 100%; white-space: normal; }
.at-req { flex: none; font-size: 11.5px; color: var(--text-2); white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); }
.at-req b { color: var(--text); font-size: 13px; }
.at-req.is-full { background: var(--st-done-bg); border-color: var(--st-done-line); color: var(--st-done); }
.at-req.is-full b { color: var(--st-done); }
.at-chev { justify-self: end; font-size: 16px; color: var(--text-2); transition: transform .15s; }
.acc-task-btn[aria-expanded="true"] .at-chev { transform: rotate(90deg); color: var(--text); }
.acc-task-b[hidden] { display: none; }
.acc-task-b { min-width: 0; padding: 4px 14px 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.task-h { margin: 8px 0 0; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.task-h .cell-sub { text-transform: none; letter-spacing: 0; font-weight: 500; }
.task-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-panel > .task-foot { padding-top: 10px; border-top: 1px solid var(--border); }
/* R4 closure amendment · 5: the readiness / missing-condition notice sits on its own line ABOVE one aligned row of
   equal-height buttons; the notice area is reserved (two lines) so the buttons do not move as it changes. */
.task-foot.tf-main { display: grid; gap: 8px; align-items: stretch; }
.tf-note { margin: 0; min-height: calc(2 * 1.4em); font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.tf-note.is-block { color: var(--warning-text); }
.tf-note.is-ready { color: var(--st-done); }
.tf-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tf-row > .btn, .tf-row > .done-chip { height: 32px; box-sizing: border-box; margin: 0; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
/* Normal Closed header (R4 closure amendment · 4) and the archived-before-completion notice */
.aw-closed { display: grid; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--st-done-bg); border: 1px solid var(--st-done-line); }
.awc-head { display: flex; gap: 10px; align-items: center; }
.awc-ic { color: var(--st-done); font-size: 22px; display: inline-flex; }
.awc-head b { display: block; font-size: 16px; font-weight: 800; color: var(--st-done); }
.awc-facts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.awc-facts dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.awc-facts dd { margin: 2px 0 0; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.awc-facts dd .cell-sub { display: block; }
.awc-foot { margin: 0; font-size: 12px; color: var(--text-2); }
.aw-arch, .hx-arch { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--review-bg); color: var(--review-text); border: 1px solid var(--review-line); font-size: 12.5px; line-height: 1.4; }
.req-na, .req-legacy { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 12.5px; line-height: 1.4; }
.req-legacy { color: var(--review-text); }
.cr-na { display: block; color: var(--text-3); font-size: 11.5px; }
.cr-ic { font-size: 12px; }
.close-req li { align-items: flex-start; }
.acc-disp.na-only li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.task-lock { margin: 0; font-size: 12.5px; color: var(--text-2); }
.done-chip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 11px; border-radius: 999px; background: var(--st-done-bg); color: var(--st-done); font-weight: 700; font-size: 12.5px; border: 1px solid var(--st-done-line); }
/* Required-field panel */
.req-panel { display: grid; gap: 10px; padding-top: 10px; min-width: 0; }
.req-head { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border); }
.req-head.st-done { background: var(--st-done-bg); border-color: var(--st-done-line); }
.req-ring { --p: 0; flex: none; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--st-prog) calc(var(--p) * 1%), #dfe6ee 0); position: relative; }
.req-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.req-ring > * { position: relative; }
.req-ring b { font-size: 18px; font-weight: 800; }
.req-ring small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.req-ring.is-full { background: conic-gradient(var(--st-done) 100%, #dfe6ee 0); }
.req-ring.is-full b { color: var(--st-done); }
.req-txt { display: grid; gap: 5px; min-width: 0; }
.req-txt > b { font-size: 14.5px; }
.req-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; align-content: flex-start; align-items: flex-start; }
/* Jump chip: one fixed component box for every state (state = colour only; same height, margin, alignment). */
.jump-chip { box-sizing: border-box; display: inline-flex; align-items: center; height: var(--chip-h); margin: 0; padding: 0 10px; max-width: 100%; border: 1px solid #9fb3c8; background: var(--surface); color: var(--text); border-radius: var(--r-pill); font: 600 12px/1 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; vertical-align: top; }
.jump-chip:hover { border-color: var(--accent); color: var(--accent); }
.jump-chip.jc-missing { border-style: solid; }
.jump-chip.jc-invalid { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger-text); }
.req-hist { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.rq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.rq { display: grid; gap: 5px; align-content: start; padding: 9px 11px 10px 12px; border-radius: 8px; border: 1px solid var(--border); border-left: 3px solid var(--st-todo-line); background: var(--surface); min-width: 0; scroll-margin-top: 220px; }
.rq.wide { grid-column: 1 / -1; }
.rq-ok { border-left-color: var(--st-done); }
.rq-missing { border-left-color: #6c7f94; background: #fbfcfe; }
.rq-invalid { border-left-color: var(--st-late); background: var(--st-late-bg); }
.rq-na { border-left-style: dashed; background: #f7f9fb; }
.rq-na .rq-ctl { opacity: .7; }
.rq-later { border-left-color: var(--st-prog); }
.rq-opt { border-left-color: var(--border); }
.rq-label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.rq-label .req, .req-txt .req { color: var(--danger); margin-left: 2px; }
.rq-cond { margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--review-text); background: var(--review-bg); padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }
.rq-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.rq-ctl > .input, .rq-ctl > .select, .rq-ctl > .textarea { width: 100%; }
.rq-ctl > .with-unit { flex: 1 1 140px; }
.rq-ctl .textarea { min-height: 56px; }
.rq-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.rq-pair.many { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rq-res { padding: 4px 8px; border-radius: 6px; background: var(--surface-sunken); border: 1px dashed var(--border); }
.rq-res b { font-size: 13px; } .rq-res em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.rq-part { display: grid; gap: 2px; min-width: 0; }
.rq-part small { font-size: 11px; color: var(--text-3); }
.rq-val { font-size: 13px; }
.rq-files, .rq-rows { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.rq-files .file-chip small { margin-left: 4px; color: var(--text-3); }
.rq-st { display: flex; gap: 4px; align-items: center; font-size: 11.5px; font-weight: 700; }
.rq-st .i { font-size: 13px; flex: none; }
.rq-ok .rq-st { color: var(--st-done); }
.rq-missing .rq-st { color: #4b6480; }
.rq-invalid .rq-st { color: var(--st-late); }
.rq-na .rq-st, .rq-opt .rq-st { color: var(--text-3); font-weight: 500; }
.rq-later .rq-st { color: var(--st-prog); }
.rq.is-flash { animation: rqflash 1.2s ease; }
@keyframes rqflash { 0%, 45% { box-shadow: 0 0 0 3px var(--frame-indicator); } 100% { box-shadow: none; } }
.acc-more { border: 1px dashed var(--border); border-radius: 8px; padding: 7px 11px; margin-top: 10px; }
.acc-more summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.acc-more[open] summary { margin-bottom: 8px; }
.tow-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.tow-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.inv-table { width: 100%; }
/* Task tables: each long table scrolls in its own container, its column headings stay on top. */
.acc-tscroll { max-height: min(55vh, 480px); overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.acc-tscroll > table { width: 100%; min-width: 540px; margin: 0; border-collapse: separate; border-spacing: 0; }
.acc-tscroll > table thead th, .acc-task-b .table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-sunken); box-shadow: inset 0 -1px 0 var(--border); }
.acc-task-b .table-wrap { max-height: min(55vh, 480px); overflow: auto; }
.close-req { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.close-req li { display: flex; gap: 8px; align-items: center; }
.cr-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--st-todo-bg); color: #5d7189; box-shadow: inset 0 0 0 2px var(--st-todo-line); }
.close-req .st-progress .cr-n { background: var(--st-prog); color: #fff; box-shadow: none; }
.close-req .st-wait .cr-n { background: var(--st-wait); color: #fff; box-shadow: none; }
.ob-list li.is-late { background: var(--st-late-bg); }
.acc-disp li { grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) auto auto; }
.help-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.help-list.states li { display: flex; gap: 8px; align-items: baseline; }
.help-list.states i { flex: none; width: 11px; height: 11px; border-radius: 3px; background: var(--st-todo-bg); box-shadow: inset 0 0 0 1px var(--st-todo-line); }
.help-list .st-done i { background: var(--st-done); box-shadow: none; } .help-list .st-progress i { background: var(--st-prog); box-shadow: none; }
.help-list .st-wait i { background: var(--st-wait); box-shadow: none; } .help-list .st-na i { background: var(--st-hatch); }
.help-list .st-late i { background: var(--st-late); box-shadow: none; }
/* Separate accident output window */
body.print-window { background: #e6ecf2; margin: 0; }
.pw-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 2px 8px rgba(13, 36, 67, .08); }
.pw-logo { height: 26px; width: auto; }
.pw-bar .grow { flex: 1; }
.pw-id { display: grid; gap: 1px; min-width: 0; }
.pw-id b { font-size: 17px; font-weight: 800; }
.pw-id span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.pw-id small { font-size: 11.5px; color: var(--text-3); }
.pw-warn { margin: 12px 18px 0; padding: 9px 12px; border-radius: 8px; background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-line); font-size: 13px; }
.pw-main { padding: 18px; }
.sh-h { margin: 12px 0 6px; font-size: 11.5px; font-weight: 700; color: #1c3a50; }
.sh-req th { width: 42%; text-align: left; font-weight: 600; }
.sh-req tr.pr-missing td, .sh-req tr.pr-invalid td { color: #8a2a1f; }
@media print { .pw-bar, .pw-warn { display: none !important; } .pw-main { padding: 0; } body.print-window { background: #fff; } }
@media (max-width: 1100px) {
  .acc-split { grid-template-columns: minmax(0, 1fr); }
  .acc-list { position: static; max-height: none; overflow: visible; }
  .acc-cards { overflow: visible; }
  .acc-split.has-sel .acc-list { display: none; }
  .acc-split.has-sel .acc-back { display: inline-flex; }
  .aw-id { grid-template-columns: minmax(0, 1fr) auto; }
  .aw-state { grid-column: 1 / -1; }
  .aw-prog { grid-template-columns: minmax(0, 1fr); }
  .aw-reasons { justify-content: flex-start; }
  .acc-disp li { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .acc-wshead { padding: 6px 10px 10px; position: static; }
  .aw-id { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .aw-unit { justify-self: start; }
  .aw-ref h2 { font-size: 20px; }
  .aw-int { margin-left: 0; }
  .rq-grid { grid-template-columns: minmax(0, 1fr); }
  .rq-pair { grid-template-columns: minmax(0, 1fr); }
  .acc-task-btn { padding: 10px; grid-template-columns: 30px 88px minmax(0, 1fr) 16px; grid-template-areas: 'n t t chev' '. s s s' '. c st st'; gap: 4px 10px; }
  .acc-task-btn > .at-n { grid-area: n; } .acc-task-btn > .at-t { grid-area: t; } .acc-task-btn > .at-s { grid-area: s; }
  .acc-task-btn > .at-c { grid-area: c; } .acc-task-btn > .at-st { grid-area: st; } .acc-task-btn > .at-chev { grid-area: chev; }
  .awc-facts { grid-template-columns: minmax(0, 1fr); }
  .tf-note { min-height: calc(3 * 1.4em); }
  .req-head { flex-direction: column; gap: 8px; }
  .acc-task { scroll-margin-top: 8px; }
}

/* ---------- R3 · A — Accident file: six-document shelf (2 columns × 3 rows of equal cards) ---------- */
.drawer-form.has-shelf .drawer-body { grid-template-rows: minmax(0, 1fr); align-content: stretch; }
.doc-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(196px, 1fr)); gap: 12px; min-height: 100%; }
.doc-card { --dc: var(--st-ink); --dc-bg: #eef3f8; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 12px; border: 1px solid var(--border); border-top: 3px solid var(--dc); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 0 rgba(13, 36, 67, .04); }
.doc-card:hover { box-shadow: 0 4px 14px rgba(13, 36, 67, .1); border-color: #9fb3c8; border-top-color: var(--dc); }
.doc-card.dt-inspection { --dc: #0f766e; --dc-bg: #e6f4f2; } .doc-card.dt-investigation { --dc: #3f51b5; --dc-bg: #ebeefb; }
.doc-card.dt-determination { --dc: #8a5a14; --dc-bg: #f7efe2; } .doc-card.dt-tracking { --dc: #4a5f78; --dc-bg: #edf1f5; } .doc-card.dt-cost { --dc: #0e6e8a; --dc-bg: #e5f3f7; }
.dc-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.dc-ic { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--dc-bg); color: var(--dc); }
.dc-ic .i { font-size: 22px; }
.dc-id { display: grid; gap: 3px; min-width: 0; }
.dc-title { font-size: 16px; font-weight: 800; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.dc-form { font-size: 12px; font-weight: 600; color: var(--text-3); }
.dc-st { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.dc-tasks { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.dc-tasks .at-n { width: 22px; height: 22px; font-size: 11px; font-style: normal; }
.dc-live { gap: 5px; font-size: 12px; color: var(--text-2); font-weight: 600; } .dc-live .i { color: var(--text-3); }
.dc-state { min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--text-2); line-height: 1.3; overflow-wrap: anywhere; }
.dc-state.is-final { color: var(--st-done); } .dc-state.is-progress { color: var(--st-prog); } .dc-state.is-todo, .dc-state.is-na { color: #5d7189; }
.dc-meta { font-size: 12.5px; color: var(--text-2); line-height: 1.4; min-width: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-bar { height: 6px; border-radius: 3px; background: #e3e9f0; overflow: hidden; }
.dc-bar > i { display: block; height: 100%; width: calc(var(--p) * 1%); background: var(--st-prog); border-radius: 3px; }
.fs-final .dc-bar > i { background: var(--st-done); }
.drawer-error[hidden] { display: none; }
.dc-foot { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.dc-foot .btn { justify-content: center; width: 100%; min-width: 0; }
@media (max-width: 640px) {
  .drawer-form.has-shelf .drawer-body { grid-template-rows: none; align-content: start; }
  .doc-shelf { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; }
}
/* Draft / live-log marking on the output itself (screen and paper) */
.sh-draft { display: flex; gap: 10px; align-items: baseline; margin: 6px 0 8px; padding: 6px 10px; border: 2px solid #9a5b00; border-radius: 4px; color: #6b3f00; background: #fff6e0; font-size: 10.5px; }
.sh-draft b { font-size: 12px; letter-spacing: .08em; white-space: nowrap; }
.sh-dtag { display: inline-block; margin-right: 8px; padding: 1px 7px; border: 1.5px solid #9a5b00; border-radius: 3px; color: #6b3f00; font-size: .62em; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; vertical-align: .2em; }
.sheet.is-draft::after { content: attr(data-out-tag); text-transform: uppercase; white-space: nowrap; position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-size: 96px; font-weight: 900; letter-spacing: .12em; color: rgba(154, 91, 0, .07); pointer-events: none; }
.pw-st { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.pw-st.is-draft { background: #fff4d6; color: #7a4a00; border: 1px solid #e6c56f; } .pw-st.is-final { background: var(--st-done-bg); color: var(--st-done); border: 1px solid var(--st-done-line); }
.aw-cnt { margin-left: 2px; padding: 0 6px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--text-2); }

/* ---------- R3 · B — Business History (header drawer + task 9 latest) ---------- */
.hx-ctx { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border); }
.hx-ctx > b { font-size: 17px; font-weight: 800; } .hx-ctx > span:not(.ac-truck):not(.badge) { font-size: 13px; color: var(--text-2); font-weight: 600; }
.hx-ctl { position: sticky; top: -16px; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: space-between; align-items: center; padding: 8px 0; background: var(--surface); border-bottom: 1px solid var(--border); }
.hx-cats, .hx-order { display: flex; flex-wrap: wrap; gap: 5px; }
.hx-chip { --hc: var(--st-ink); display: inline-flex; gap: 5px; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.hx-chip b { font-size: 11px; color: var(--text-3); }
.hx-chip:hover { border-color: #9fb3c8; }
.hx-chip.on { border-color: var(--hc); color: var(--hc); background: color-mix(in srgb, var(--hc) 8%, #fff); box-shadow: inset 0 0 0 1px var(--hc); }
.hx-chip.on b { color: inherit; }
.hc-report { --hc: #1c3a50; } .hc-evidence { --hc: #3f51b5; } .hc-tasks { --hc: #1f8a4c; } .hc-vehicle { --hc: #4a5f78; } .hc-tow { --hc: #8a5a14; }
.hc-repair { --hc: #0f766e; } .hc-insurance { --hc: #2457c5; } .hc-cost { --hc: #0e6e8a; } .hc-payment { --hc: #6a43a0; } .hc-followup { --hc: #5d7189; } .hc-closure { --hc: #263238; }
.hx { display: grid; gap: 12px; }
.hx-dh { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--text-2); letter-spacing: .02em; }
.hx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hx-it { display: grid; grid-template-columns: 64px 26px minmax(0, 1fr); gap: 10px; align-items: start; position: relative; padding-bottom: 10px; }
.hx-it::before { content: ""; position: absolute; left: 76px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.hx-it:last-child::before { display: none; }
.hx-time { font-size: 12px; font-weight: 700; color: var(--text-2); text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.hx-time small { font-weight: 600; color: var(--text-3); font-size: 10.5px; }
.hx-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--hc) 12%, #fff); color: var(--hc); box-shadow: inset 0 0 0 1.5px var(--hc); }
.hx-dot .i { font-size: 13px; }
.hx-body { min-width: 0; padding: 3px 0 0; }
.hx-top { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.hx-top b { font-size: 13.5px; }
.hx-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--hc); }
.hx-text { font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; margin-top: 1px; }
.hx-by { display: flex; gap: 4px; align-items: center; font-size: 11.5px; color: var(--text-3); margin-top: 2px; } .hx-by .i { font-size: 12px; }
@media (max-width: 600px) { .hx-it { grid-template-columns: 48px 24px minmax(0, 1fr); gap: 8px; } .hx-it::before { left: 59px; } }

/* ---------- R4 · Reports: one direct-use workspace ----------
 * compact business tabs (fixed height; More when they do not fit) + searchable report picker (current name always shown)
 * → conditions (date basis · period · basic, “More conditions” on the same screen) beside fixed commands → applied
 * conditions → summary → results that scroll on their own with sticky column headings. */
.rp-ws { display: grid; gap: 10px; min-width: 0; }
.rp-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 2px 8px rgba(13, 36, 67, .06); }
.rp-tabs { display: flex; gap: 2px; align-items: center; min-width: 0; padding: 3px; border-radius: 9px; background: var(--surface-sunken); }
.rp-tab { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 700; line-height: 1; color: var(--text-2); text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
.rp-tab::-webkit-details-marker { display: none; }
.rp-tab .i { width: 1em; height: 1em; flex: none; font-size: 15px; }
.rp-tab .seg-count { flex: none; }
.rp-tab:hover { color: var(--text); background: rgba(255, 255, 255, .7); }
.rp-tab.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(13, 36, 67, .14), 0 0 0 1px var(--border-strong); }
.rp-tab.is-locked { color: var(--text-3); cursor: not-allowed; }
.rp-more, .rp-picker { position: relative; }
.rp-nav > .rp-picker { margin-inline-start: auto; }
.rp-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 280px; padding: 6px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); }
.rp-cur { box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: pointer; list-style: none; max-width: 100%; }
.rp-cur::-webkit-details-marker { display: none; }
.rp-cur:hover, .rp-picker[open] .rp-cur { border-color: var(--accent); }
.rp-cur-k { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rp-cur b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rp-cur-n { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.rp-cur > .i { flex: none; width: 1em; height: 1em; font-size: 14px; color: var(--text-2); }
.rp-list { width: min(420px, 86vw); max-height: min(60vh, 460px); overflow: auto; }
.rp-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rp-find { display: flex; align-items: center; gap: 6px; padding: 0 4px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.rp-find .i { width: 1em; height: 1em; flex: none; color: var(--text-3); }
.rp-find .input { width: 100%; }
.rp-opt { display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 7px; text-decoration: none; color: var(--text); }
.rp-opt > .i { width: 1em; height: 1em; font-size: 16px; color: var(--text-3); }
.rp-opt span { display: grid; gap: 1px; min-width: 0; } .rp-opt b { font-size: 13px; } .rp-opt small { font-size: 11.5px; color: var(--text-3); }
.rp-opt:hover { background: var(--accent-tint); }
.rp-opt.on { background: var(--accent-tint); box-shadow: inset 3px 0 0 var(--accent); } .rp-opt.on > .i:last-child { color: var(--accent); }
.rp-opt.is-locked { color: var(--text-3); cursor: not-allowed; }
.rp-none { margin: 6px 8px; font-size: 12.5px; color: var(--text-3); }
.rp-forms { display: flex; gap: 6px; align-items: center; margin-top: 4px; padding: 8px 8px 4px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.rp-forms .i { width: 1em; height: 1em; flex: none; }
.rp-forms:hover { color: var(--accent); }
.rp-head { position: sticky; top: 58px; z-index: 4; display: grid; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; box-shadow: 0 2px 8px rgba(13, 36, 67, .06); }
.rp-head.adv-open { position: relative; top: auto; }
.rp-head.is-pending { border-left-color: var(--st-wait); }
.rp-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.rp-id { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 320px; }
.rp-idt { display: grid; gap: 2px; min-width: 0; }
.rp-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.rp-basis { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); } .rp-basis .i { flex: none; width: 1em; height: 1em; color: var(--text-3); }
.rp-cmds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; flex: 0 1 auto; }
.rp-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.rp-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px 12px; align-items: end; min-width: 0; }
.rp-filters .field { display: grid; gap: 3px; min-width: 0; } .rp-filters .field.is-wide { grid-column: span 2; }
.rp-filters .field-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.rp-filters .input, .rp-filters .select { width: 100%; min-width: 0; }
.rp-dates { grid-column: span 3; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 6px 8px; margin: -6px -8px; border-radius: 8px; background: var(--surface-sunken); }
.rp-dates .date-field { display: flex; flex-wrap: nowrap; width: 100%; min-width: 0; }
.rp-dates .date-field .date-text { flex: 1 1 0; width: 0; min-width: 0; }
.rp-dates .date-text[readonly] { opacity: .55; }
.rp-chk { align-self: center; font-size: 12.5px; }
.rp-advbar { display: flex; align-items: center; gap: 8px; }
.rp-advbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px dashed var(--border-strong); border-radius: 7px; background: none; font: 600 12.5px/1 var(--font); color: var(--text-2); cursor: pointer; }
.rp-advbtn .i { width: 1em; height: 1em; flex: none; font-size: 13px; }
.rp-advbtn .rp-chev { transition: transform var(--motion); }
.rp-advbtn[aria-expanded="true"] { border-style: solid; color: var(--accent); border-color: var(--accent); }
.rp-advbtn[aria-expanded="true"] .rp-chev { transform: rotate(90deg); }
.rp-adv { padding-top: 8px; border-top: 1px dashed var(--border); }
.rp-adv[hidden] { display: none; }
.rp-pend { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--warning-text); }
.rp-pend:empty { display: none; }
.rp-applied { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-ac { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }
.rp-ac small { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.rp-ac.is-agg { background: var(--surface-sunken); }
.rp-sum { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rs-item { flex: 1 1 150px; display: grid; gap: 2px; align-content: start; padding: 12px 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.rs-item span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.rs-item b { font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); white-space: normal; overflow-wrap: anywhere; }
.rs-item.v-open b { color: var(--st-ink); } .rs-item.v-process b { color: var(--st-prog); } .rs-item.v-closed b { color: var(--st-done); } .rs-item.v-risk b { color: var(--rk-high); }
.rs-item.is-prov { background: #fffaf0; }
.rs-item.is-warn b { color: var(--st-wait); }
.rp-results.table-wrap { max-height: max(300px, calc(100vh - 420px)); border-radius: 12px; }
.rp-results .vtable thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-sunken); }
.rp-results .vtable td .ref-link { font-weight: 700; }
.rp-results .c-act { width: 1%; white-space: nowrap; }
.rp-results .c-vin, .rp-results td .mono { white-space: nowrap; }
.rp-rowact { white-space: nowrap; }
.rp-legend { margin: 0; }
@media (max-width: 1100px) {
  .rp-nav, .rp-head { position: static; }
  .rp-results.table-wrap { max-height: 70vh; }
  .rp-dates { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .rp-tabs { flex-wrap: wrap; }
  .rp-cmds { justify-content: flex-start; }
  .rp-filters .field.is-wide { grid-column: auto; }
  .rp-dates { grid-template-columns: minmax(0, 1fr); }
  .rp-cur-n { display: none; }
}

/* ---------- Reports · Fleet Status design code (scoped to .rp-ws; the Fleet Status screens are not touched) ----------
 * Compact identity (round tone icon · classification kicker · title · basis) with commands, a subtle tone rail on each
 * framed region, a framed conditions region, compact metric tiles with a 3px tone rail, and a spreadsheet-style result
 * grid (sticky header, cell rules) under its own result bar. Tone = the report's own tone (data-tone on .rp-ws). */
.rp-ws { --rp-tone: var(--accent); --rp-tone-bg: var(--accent-tint); --rp-r: var(--r-panel, 10px); gap: 12px; }
.rp-ws[data-tone="insp"] { --rp-tone: var(--dom-insp, #0f766e); --rp-tone-bg: var(--dom-insp-bg, #e6f4f1); }
.rp-ws[data-tone="maint"] { --rp-tone: var(--dom-maint, #b45309); --rp-tone-bg: var(--dom-maint-bg, #fdf1e3); }
.rp-ws[data-tone="danger"] { --rp-tone: var(--danger); --rp-tone-bg: var(--danger-bg); }
.rp-ws[data-tone="lease"] { --rp-tone: var(--dom-lease, #6d28d9); --rp-tone-bg: var(--dom-lease-bg, #f1ebfd); }
.rp-ws[data-tone="info"] { --rp-tone: var(--dom-info, #0369a1); --rp-tone-bg: var(--dom-info-bg, #e6f1fa); }
.rp-ws .rp-nav { border-radius: var(--rp-r); box-shadow: var(--shadow-panel, 0 1px 2px rgba(13, 36, 67, .06)); }
.rp-ws .rp-tab.on { color: var(--rp-tone); }
.rp-ws .rp-head { gap: 8px; padding: 10px 12px 10px 14px; border-left: 3px solid var(--rp-tone); border-radius: var(--rp-r); box-shadow: var(--shadow-panel, 0 1px 2px rgba(13, 36, 67, .06)); }
.rp-ws .rp-head.is-pending { border-left-color: var(--st-wait); }
.rp-ws .rp-head.is-error { border-left-color: var(--danger); }
.rp-ws .rp-head.is-error .rp-pend { color: var(--danger-text); }
.rp-ws .rp-id { gap: 10px; }
.rp-ws .rp-id .icon-tile { width: 36px; height: 36px; flex: none; border-radius: 50%; }
.rp-ws .rp-idt { gap: 1px; }
.rp-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; line-height: 1.2; text-transform: uppercase; color: var(--rp-tone); }
.rp-ws .rp-title { font-size: 18px; font-weight: 700; letter-spacing: -.015em; overflow-wrap: anywhere; }
.rp-ws .rp-basis { font-size: 12px; font-weight: 500; flex-wrap: wrap; }
.rp-cond { display: grid; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.rp-ws .rp-filters { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px 10px; }
.rp-ws .rp-filters .input, .rp-ws .rp-filters .select { background-color: var(--surface); }
.rp-ws .rp-dates { margin: 0; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border); }
.rp-ws .rp-advbtn { background: var(--surface); }
.rp-ws .rp-adv { border-top-color: var(--border-strong); }
/* Period: Month / Custom switch + month, or From – To (Driver Assignment Report). */
.rp-period { grid-column: span 2; }
.rp-period .field-label small { font-size: inherit; font-weight: 600; color: var(--text-3); }
.rp-period-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.rp-ws .rp-period-in .input { flex: 1 1 128px; width: auto; min-width: 0; }
.rp-pm { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); }
.rp-pm-o { position: relative; display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.rp-pm-o input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rp-pm-o.on { background: var(--rp-tone-bg); color: var(--rp-tone); }
.rp-pm-o:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.rp-to { flex: none; font-size: 12px; color: var(--text-3); }
/* Searchable truck picker: find box + list of matching trucks (All trucks first). */
.rp-vpick-in { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr); gap: 6px; min-width: 0; }
.rp-vfind-n { font-size: 11.5px; color: var(--text-3); } .rp-vfind-n:empty { display: none; }
/* Applied conditions: one framed strip. */
.rp-ws .rp-applied { align-items: center; gap: 5px; padding: 7px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--rp-r); }
.rp-reg-k { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }
.rp-reg-k .i { width: 1em; height: 1em; flex: none; color: var(--rp-tone); }
.rp-ws .rp-ac { padding: 3px 8px; font-size: 12px; background: var(--surface-sunken); border-color: transparent; overflow-wrap: anywhere; }
.rp-ws .rp-ac.is-agg { background: var(--rp-tone-bg); }
/* Summary: compact metric tiles (Fleet Status .metric rail), figures large, prose values readable. */
.rp-ws .rp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; background: none; border: 0; border-radius: 0; overflow: visible; }
.rp-ws .rs-item { position: relative; padding: 10px 12px 8px; border: 1px solid var(--border); border-radius: var(--rp-r); background: var(--surface); box-shadow: var(--shadow-panel, none); overflow: hidden; }
.rp-ws .rs-item::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rp-tone); }
.rp-ws .rs-item span { font-size: 11.5px; line-height: 1.25; }
.rp-ws .rs-item b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.rp-ws .rs-item.is-text b { font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.rp-ws .rs-item.v-open::before { background: var(--st-ink); } .rp-ws .rs-item.v-process::before { background: var(--st-prog); } .rp-ws .rs-item.v-closed::before { background: var(--st-done); }
.rp-ws .rs-item.v-risk::before { background: var(--rk-high); } .rp-ws .rs-item.is-warn::before { background: var(--st-wait); }
.rp-ws .rs-item.is-zero::before { background: #c3cfda; } .rp-ws .rs-item.is-zero b { color: var(--text-2); }
/* Results: result bar + spreadsheet grid with sticky headings and cell rules. */
.rp-res { display: grid; min-width: 0; }
.rp-res-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 38px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--rp-r) var(--rp-r) 0 0; box-shadow: inset 3px 0 0 var(--rp-tone); }
.rp-res-t { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; } .rp-res-t .i { width: 1em; height: 1em; flex: none; color: var(--rp-tone); }
.rp-res-h .rp-legend { margin: 0 0 0 auto; font-size: 12px; color: var(--text-2); }
.rp-ws .rp-results.table-wrap { border-radius: 0 0 var(--rp-r) var(--rp-r); max-height: max(320px, calc(100vh - 380px)); }
.rp-ws .rp-results .vtable { font-size: 12.5px; }
.rp-ws .rp-results .vtable thead th { z-index: 2; background: var(--table-head-bg, var(--surface-sunken)); box-shadow: inset 0 -1px 0 var(--table-head-border, var(--border)); border-right: 1px solid var(--table-row-border, var(--border)); }
.rp-ws .rp-results .vtable tbody td { padding-top: 5px; padding-bottom: 5px; border-right: 1px solid var(--table-row-border, var(--border)); white-space: normal; max-width: 360px; overflow-wrap: anywhere; vertical-align: top; }
.rp-ws .rp-results .vtable tbody td:first-child, .rp-ws .rp-results td.c-num, .rp-ws .rp-results td.c-vin, .rp-ws .rp-results td.c-act { white-space: nowrap; }
.rp-ws .rp-results .vtable tbody tr { cursor: default; }
/* Pinned header stays pinned with More conditions open when the report has few of them and the window is tall enough. */
@media (min-width: 1101px) and (min-height: 760px) { .rp-ws .rp-head.adv-open.adv-few { position: sticky; top: 58px; } }
@media (max-width: 900px) { .rp-period, .rp-ws .rp-filters .rp-vpick { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .rp-res-h .rp-legend { margin-left: 0; flex-basis: 100%; }
  .rp-vpick-in { grid-template-columns: minmax(0, 1fr); }
  .rp-ws .rp-id .icon-tile { width: 30px; height: 30px; }
}

/* ---------- R4 · Accident risk grade (own colour family; not validation red, not injury) ---------- */
:root { --rk-low: #1f7a46; --rk-low-bg: #e8f6ee; --rk-low-line: #9fd0b2; --rk-high: #b3261e; --rk-high-bg: #fdecea; --rk-high-line: #f0a9a3; --rk-und: #8a6100; --rk-und-bg: #fff6d6; --rk-und-line: #e9cf7a; }
.risk-chip { box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; height: var(--badge-h); padding: 0 8px 0 6px; flex: none; border-radius: var(--r-pill); border: 1px solid; font-size: 12px; line-height: 1; white-space: nowrap; }
.risk-chip .i { font-size: var(--ic-badge); width: 1em; height: 1em; flex: none; stroke-width: 2.2; }
.risk-chip .rk-k { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }
.risk-chip b { font-weight: 800; }
.risk-chip.rk-low { color: var(--rk-low); background: var(--rk-low-bg); border-color: var(--rk-low-line); }
.risk-chip.rk-high { color: #fff; background: var(--rk-high); border-color: var(--rk-high); }
.risk-chip.rk-und { color: var(--rk-und); background: var(--rk-und-bg); border-color: var(--rk-und-line); }
.risk-chip.sm .rk-k { display: none; }
.risk-box { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
/* Grade WARNING — a separate warning mark (triangle) + short label, distinct from the yellow Undetermined shield. Its
 * concrete cause and resolution (.rw-pop) open on hover, keyboard focus and click / touch (aria-expanded). */
:root { --rw-ink: #9a3412; --rw-line: #c2410c; }
.risk-warn-wrap { position: relative; display: inline-flex; flex: none; }
.risk-warn { box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; height: var(--badge-h); padding: 0 8px 0 6px; border-radius: 6px; background: #fff; color: var(--rw-ink); border: 1px solid var(--rw-line); font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; }
button.risk-warn { cursor: help; }
button.risk-warn:focus-visible { outline: 2px solid var(--rw-line); outline-offset: 2px; }
.risk-warn .i { font-size: var(--ic-badge); width: 1em; height: 1em; flex: none; stroke-width: 2.2; }
.rw-pop { display: none; position: absolute; z-index: 40; top: calc(100% + 6px); left: var(--rw-dx, 0px); width: max-content; max-width: var(--rw-w, min(340px, calc(100vw - 16px))); overflow-wrap: anywhere; padding: 9px 11px; border-radius: 8px; background: #fff; color: var(--text-1, #1b1b1b); border: 1px solid var(--rw-line); box-shadow: 0 6px 20px rgba(0,0,0,.14); font-size: 12.5px; font-weight: 500; line-height: 1.45; white-space: normal; text-align: left; }
.rw-pop.rw-up { top: auto; bottom: calc(100% + 6px); }
.rw-pop b { color: var(--rw-ink); }
.rw-pop .rw-fix { display: block; margin-top: 5px; color: var(--text-2); }
.risk-warn-wrap:hover .rw-pop, button.risk-warn:focus-visible + .rw-pop, button.risk-warn[aria-expanded="true"] + .rw-pop, .acc-card:focus-visible .rw-pop { display: block; }
.risk-warn-wrap.in-link { margin-left: 2px; }
.rk-warnbox { display: grid; justify-items: start; gap: 6px; }
.rk-saved { margin: 0; font-size: 13px; color: var(--text-2); }
.rk-opt.is-off { opacity: .55; }
.rk-opt.is-off input { cursor: not-allowed; }
.risk-law.is-active { color: var(--rk-high); }
.risk-law { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.risk-law .i { width: 1em; height: 1em; flex: none; }
.aw-risk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.risk-pick { border: 0; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.rk-opt b { display: inline-flex; align-items: center; gap: 6px; }
.rk-opt b .i { width: 1em; height: 1em; flex: none; }
.rk-opt.rk-low b { color: var(--rk-low); } .rk-opt.rk-high b { color: var(--rk-high); } .rk-opt.rk-und b { color: var(--rk-und); }
.ac-top .risk-chip { margin-left: 2px; }
.hc-risk { --hc: #b3261e; }
.ac-veh { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ac-vin { padding-left: 2px; }
.aw-unit .aw-vin { display: flex; } .aw-unit .vin-k { color: rgba(255, 255, 255, .7); } .aw-unit .vin-v { color: #fff; } .aw-unit .vin.is-unregistered .vin-v, .aw-unit .vin.is-not_supplied .vin-v, .aw-unit .vin.is-unavailable .vin-v { color: rgba(255, 255, 255, .78); }
.pick .pick-vin { font-size: 10.5px; } .pick .pick-vin .vin-v { font-size: 10.5px; }
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.sh-vin-note { font-size: 8pt; color: #666; }

.insp-mini { width: 100%; } .insp-mini td, .insp-mini th { font-size: 12.5px; }
.card-mini .cm-vin { display: flex; font-size: 10.5px; } .card-mini .cm-vin .vin-v { font-size: 10.5px; }

/* ---------- R4 role editor · shared permission editor (Group Roles = basic unit; a person = individual exceptions) ----------
 * One left baseline per column: the cell padding (8px) + the box padding (6px) puts every checkbox, “—” and lock at 14px
 * from the cell's left edge, and the column heading starts there too. Labels follow the box and may wrap; they never
 * move the box. Combined cells (one key covering Create & Edit) span both columns from the Create baseline. */
.role-ed .cat { text-decoration: none; min-height: 36px; height: auto; padding: 6px 10px; }
.role-ed .cat-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.role-ed .cat .seg-count { flex: none; }
.mx { display: grid; gap: 10px; min-width: 0; }
.mx-bar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; box-shadow: 0 2px 8px rgba(13, 36, 67, .08); }
.mx-bar.is-user { border-left-color: var(--review); }
.mx-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.mx-kind { box-sizing: border-box; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.mx-kind .i { width: 13px; height: 13px; flex: 0 0 13px; } .mx-kind.is-user { background: var(--review-bg); color: var(--review-text); }
.mx-name { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.2; }
.mx-roles { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.mx-members { position: relative; }
.mx-members > summary { box-sizing: border-box; list-style: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.mx-members > summary::-webkit-details-marker { display: none; } .mx-members > summary .i { width: 14px; height: 14px; flex: 0 0 14px; }
.mx-members[open] > summary { border-color: var(--accent); color: var(--accent); }
.mx-pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-height: 300px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(13, 36, 67, .16); }
.mx-pop ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; } .mx-pop li { display: grid; padding: 6px 8px; border-radius: 6px; } .mx-pop li:hover { background: var(--accent-tint); }
.mx-pop a { font-weight: 700; color: var(--text); text-decoration: none; } .mx-pop small { font-size: 11.5px; color: var(--text-3); }
.mx-reason { display: grid; gap: 3px; flex: 1 1 220px; min-width: 200px; } .mx-reason .field-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.mx-sum { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; font-size: 12.5px; }
.mx-sum-t { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-2); } .mx-sum-t .i { width: 1em; height: 1em; flex: none; }
.mx-sum-t.is-dirty { color: var(--warning-text); }
.mx-sum-l { color: var(--text); } .mx-sum-l .pos, .mx-dlg-list .pos { color: var(--success-text); } .mx-sum-l .neg, .mx-dlg-list .neg { color: var(--danger-text); }
.mx-cmds { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.mx-cmds .btn { min-width: 112px; justify-content: center; }
.mx-ro { display: flex; align-items: center; gap: 6px; margin: -2px 0 0; font-size: 12.5px; color: var(--text-2); } .mx-ro .i { width: 14px; height: 14px; flex: 0 0 14px; }
.mx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12px; color: var(--text-2); }
.mx-legend > span { display: inline-flex; align-items: center; gap: 6px; } .mx-legend .i { width: 1em; height: 1em; flex: none; }
.mx-lg { box-sizing: border-box; display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1.5px solid var(--control-border); font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; }
.mx-lg.lg-on { background: var(--accent); border-color: var(--accent); } .mx-lg.lg-ns { border: 0; color: var(--text-3); } .mx-lg.lg-pol { border-style: dashed; border-color: var(--review); }
.mx-lg.lg-exg { background: var(--accent); border-color: var(--success-text); color: #fff; box-shadow: 0 0 0 2px var(--success-bg); } .mx-lg.lg-exd { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.mx-help { position: relative; margin-left: auto; }
.mx-help > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 6px; font-weight: 700; color: var(--accent); cursor: pointer; }
.mx-help > summary::-webkit-details-marker { display: none; } .mx-help > summary:hover { background: var(--accent-tint); }
.mx-help > ul { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: min(440px, 80vw); margin: 0; padding: 10px 12px 10px 28px; display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(13, 36, 67, .16); font-size: 12.5px; color: var(--text); line-height: 1.4; }
/* position: relative makes the matrix's own scroll area the containing block of its visually hidden cell labels (.sr-only),
 * so they scroll inside it instead of widening the document. */
.mx-scroll { position: relative; max-height: max(360px, calc(100vh - 300px)); overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mx-table { width: 100%; min-width: 980px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mx-col-tree { width: 28%; } .mx-col-view { width: 8%; } .mx-col-create, .mx-col-edit { width: 12.5%; } .mx-col-confirm { width: 9%; } .mx-col-output { width: 8%; } .mx-col-special { width: 22%; }
.mx-table thead th { position: sticky; top: 0; z-index: 3; height: var(--head-h); padding: 0 8px 0 14px; background: var(--surface-sunken); box-shadow: inset 0 -1px 0 var(--border); font-size: 12px; font-weight: 700; color: var(--text-2); text-align: left; white-space: nowrap; }
.mx-table thead th.mx-tree { left: 0; z-index: 4; padding: 0 10px; }
.mx-table th.mx-tree { position: sticky; left: 0; z-index: 2; padding: 0 10px; text-align: left; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); font-weight: 400; }
.mx-th { display: flex; align-items: center; gap: 8px; }
.mx-all { box-sizing: border-box; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 11.5px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.mx-all .i { width: 12px; height: 12px; flex: 0 0 12px; transition: transform var(--motion); } .mx-all[data-v="close"] .i { transform: rotate(180deg); } .mx-all:hover { border-color: var(--accent); color: var(--accent); }
.mx-table td, .mx-table tbody th { border-bottom: 1px solid var(--border); }
.mx-g th.mx-tree, .mx-g td { background: var(--surface-sunken); }
.mx-gh { display: flex; align-items: center; gap: 8px; height: 40px; }
.mx-gh > .i { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-2); }
.mx-gh b { font-size: 13.5px; }
.mx-tog { box-sizing: border-box; display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--text-2); cursor: pointer; }
.mx-tog .i { width: 14px; height: 14px; transition: transform var(--motion); } .mx-tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.mx-tog:hover { background: var(--surface); } .mx-tog:disabled { opacity: .3; cursor: default; background: none; }
.mx-branch, .mx-box input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.mx-box input:disabled { cursor: default; }
.mx-bx-sp { width: 16px; flex: 0 0 16px; }
.mx-fh { display: grid; gap: 1px; padding: 6px 0 6px 56px; min-height: 30px; align-content: center; }
.mx-fh b { font-weight: 600; } .mx-fh small { font-size: 11.5px; color: var(--text-3); }
.mx-st { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2) !important; } .mx-st .i { width: 1em; height: 1em; flex: none; }
.mx-st.pol { color: var(--review-text) !important; }
.mx-c { height: 40px; padding: 4px 8px; text-align: left; vertical-align: middle; }
.mx-in { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 28px; }
.mx-box { box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 28px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.mx-box:hover { background: var(--accent-tint); }
.mx-slot { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: 0 0 16px; margin-left: 6px; color: var(--text-3); }
.mx-slot .i { width: 14px; height: 14px; }
.mx-in > .mx-note { padding-left: 6px; }
.mx-ns { color: var(--text-3); }
.mx-ni .mx-sp { color: var(--text-3); padding-left: 2px; }
.mx-note { font-size: 11.5px; color: var(--text-3); }
.mx-sp { min-width: 0; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--text-2); overflow-wrap: anywhere; }
.mx-both .mx-sp { color: var(--text); }
.mx-c.is-on .mx-sp { color: var(--text); }
.mx-c.is-policy .mx-box { outline: 1.5px dashed var(--review-line); outline-offset: -1px; }
.mx-c.is-changed .mx-box { background: var(--warning-bg); box-shadow: inset 0 0 0 1px var(--warning-line); }
.mx-c.is-ro .mx-box { cursor: default; opacity: .75; }
.mx-ex { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; color: #fff; }
.mx-c.ex-grant .mx-ex { background: var(--success-text); } .mx-c.ex-deny .mx-ex { background: var(--danger); }
.mx-c.ex-deny .mx-box { background: var(--danger-bg); }
.mx-derived { color: var(--text-3); }
.mx-inh { box-sizing: border-box; display: inline-grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; margin-left: auto; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.mx-inh .i { width: 12px; height: 12px; } .mx-inh:hover { border-color: var(--accent); color: var(--accent); }
.mx-stale { align-items: center; flex-wrap: wrap; } .mx-stale-cmds { display: flex; gap: 8px; margin-left: auto; }
.mx-dlg-list { margin: 6px 0; padding-left: 18px; display: grid; gap: 2px; }
.perm-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.ex-list small { grid-column: 2; font-size: 11.5px; color: var(--text-3); }
.perm-ed { margin-top: 12px; }
@media (max-width: 900px) { .mx-bar { position: static; } .mx-cmds { margin-left: 0; } .mx-help { margin-left: 0; } }
@media (max-width: 1100px) { .role-ed .cat { flex: none; white-space: nowrap; } .role-ed .cat-name { overflow-wrap: normal; } }

/* ---------- R4 integrated addendum · dispatcher-forwarded accident intake ---------- */
.acc-intake { display: grid; gap: 12px; }
.acc-intake .form-grid { gap: 10px 14px; }
.ai-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 8px 12px; border-radius: 10px; background: var(--surface-sunken); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.ai-auto .i { width: 14px; height: 14px; flex: 0 0 14px; color: var(--text-3); }
.ai-auto > span + span::before { content: '·'; margin-right: 16px; color: var(--text-3); }
.ai-same { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.opt { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: none; }
.ai-pick { position: relative; box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px dashed var(--control-border); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.ai-pick .i { width: 14px; height: 14px; flex: 0 0 14px; }
.ai-pick { justify-self: start; width: auto; }
.acc-intake .ai-pick input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.acc-intake > .rec-head, .acc-intake > .ai-auto, .acc-intake > .panel, .acc-intake > details { margin: 0; }
.ai-pick:focus-within { box-shadow: var(--focus-ring); }
.ai-files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-files li { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12.5px; }
.ai-files li > .i { width: 14px; height: 14px; flex: 0 0 14px; color: var(--text-3); } .ai-files small { margin-left: 6px; color: var(--text-3); }
.ai-more { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ai-more > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 700; cursor: pointer; list-style: none; } .ai-more > summary::-webkit-details-marker { display: none; }
.ai-more > summary .i { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-3); }
.ai-more-b { padding: 0 14px 14px; }
/* Vehicle search: results + short selected rows (never the whole fleet) */
.vs-fld { margin: 10px 0; }
.vs { display: grid; gap: 8px; }
.vs-search { position: relative; display: block; max-width: 520px; } .vs-search .i { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--text-3); pointer-events: none; } .vs-search .input { width: 100%; padding-left: 34px; }
.vs-hint, .vs-empty { margin: 0; font-size: 12.5px; color: var(--text-3); }
.vs-results, .vs-sel { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 860px; }
.vs-row, .vs-sel li { display: grid; grid-template-columns: minmax(210px, 300px) minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 4px 6px 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.vs-row.is-on { background: var(--accent-tint); border-color: var(--st-prog-line, var(--border)); }
.vs-sel li { border-left: 3px solid var(--st-ink); } .vs-sel li.is-pending { border-left-color: var(--review); background: var(--review-bg); }
.vs-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .vs-code { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.vs-id .vin { font-size: 11.5px; } .vs-id .vin-v { overflow-wrap: anywhere; }
.vs-meta { display: grid; gap: 1px; min-width: 0; font-size: 12.5px; color: var(--text-2); } .vs-meta small { font-size: 11.5px; color: var(--text-3); }
.vs-added { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--accent); } .vs-added .i { width: 14px; height: 14px; }
.vs-row .btn, .vs-added { min-width: 76px; justify-content: center; }
.vs-rm { width: 30px; height: 30px; flex: 0 0 30px; }
.vs-none { display: grid; gap: 6px; justify-items: start; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; } .vs-none > span { display: inline-flex; align-items: center; gap: 6px; } .vs-none .i { width: 14px; height: 14px; } .vs-none small { color: var(--text-3); }
.vs-keep:empty { display: none; }
@media (max-width: 760px) { .vs-row, .vs-sel li { grid-template-columns: minmax(0, 1fr) auto; } .vs-row .vs-meta, .vs-sel .vs-meta { grid-column: 1; } }
/* Received information (task 1) */
.ri { margin-bottom: 12px; }
.ri-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.ri-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; font-size: 13px; } .ri-row.span { grid-column: 1 / -1; }
.ri-k { color: var(--text-3); font-weight: 600; font-size: 12px; padding-top: 1px; }
.ri-memo { margin: 0; padding: 8px 12px; border-left: 3px solid var(--border); background: var(--surface-sunken); border-radius: 0 8px 8px 0; white-space: pre-wrap; font-size: 13px; }
@media (max-width: 900px) { .ri-grid { grid-template-columns: 1fr; } .ri-row { grid-template-columns: 120px minmax(0, 1fr); } }
/* One evidence set: thumbnails reopen the actual selected file */
.ev-item { align-items: flex-start; } .ev-main { display: grid; gap: 4px; min-width: 0; flex: 1; }
.ev-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-file { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 40px; max-width: 240px; padding: 0 10px 0 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; color: var(--text); cursor: pointer; }
.ev-file:hover { border-color: var(--accent); } .ev-file > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ev-file img, .ev-doc { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 6px; object-fit: cover; background: var(--surface-sunken); }
.ev-doc { display: inline-grid; place-items: center; color: var(--text-3); } .ev-doc .i { width: 16px; height: 16px; }
.ev-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ev-gallery figure { margin: 0; display: grid; gap: 4px; } .ev-gallery img { width: 100%; max-height: 220px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.ev-gallery figcaption { font-size: 12px; overflow-wrap: anywhere; } .ev-doc.lg { width: 100%; height: 120px; }
/* Pending association + related work */
.aw-pend { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--review-bg); color: var(--review-text); font-size: 12px; font-weight: 700; } .aw-pend .i { width: 13px; height: 13px; flex: 0 0 13px; }
.rel-list li.is-pending { background: var(--review-bg); }
.rl-basis { display: block; margin-top: 2px; }
.rw-open { margin-left: 6px; font-size: 12px; font-weight: 700; }
.rw-sub td:first-child { padding-left: 26px; }
td .rw-vin { font-size: 11px; }
.pr-src { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--text); font-size: 13px; } .pr-src .i { width: 16px; height: 16px; flex: 0 0 16px; color: var(--danger); }

/* ---------- R4 user addendum · vehicle windows (js/workspace.js) ---------- */
/* A linked vehicle in an accident opens in its own window: same chip, plus a fixed 13px “opens a window” mark. */
button.veh-chip { font: inherit; text-align: left; cursor: pointer; color: inherit; }
.veh-chip.veh-win .vc-top .i { width: 13px; height: 13px; flex: none; align-self: center; color: var(--key-link); }
.vs-win { width: 30px; height: 30px; flex: 0 0 30px; color: var(--key-link); }
/* The vehicle window: no app menu or open tabs (one truck only); a fixed bar says what this window is. */
[data-vw] .app { grid-template-columns: 0 minmax(0, 1fr) !important; }
[data-vw] .sidebar, [data-vw] .tabs { display: none !important; }
[data-vw] .main-col { grid-template-rows: var(--header-h) minmax(0, 1fr); }
.vw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--st-prog-line, #b7c7ee); border-radius: 8px; background: #f2f6ff; }
.vw-bar > .i { width: 16px; height: 16px; flex: none; color: var(--accent); }
.vw-bar .vw-id { display: inline-flex; align-items: center; gap: 8px; }
/* Truck information form: the version it edits, and the comparison when another save came first. */
.ti-base { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 12px; font-size: 12.5px; color: var(--text-2); }
.ti-base .i { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.drawer-error .ti-cmp { margin: 8px 0; width: 100%; }
.drawer-error [data-ti-reapply] { margin-top: 4px; }
.ti-cmp tr.is-mine td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- R4 · Admin visual system (Users & Access, person, Group Roles, Security & Audit, Integrations) ----------
 * Reuses the Accident-detail hierarchy: icon tile + title → key state/value → supporting context → action. Status facts
 * lead; longer explanations sit in optional help (.ad-help). Warning colours are kept for genuine warnings only. */
.ad-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 14px; padding: 9px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--dom-fleet); border-radius: var(--r-panel); font-size: 13px; }
.ad-strip > .i { width: 16px; height: 16px; flex: none; color: var(--dom-fleet); }
.ad-strip b { margin-right: 4px; }
.ad-help { font-size: 12.5px; color: var(--text-2); }
.ad-strip .ad-help { margin-left: auto; }
.ad-help > summary { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.ad-help > summary::-webkit-details-marker { display: none; }
.ad-help > summary .i { width: 14px; height: 14px; flex: none; }
.ad-help[open] > summary { margin-bottom: 4px; }
.ad-help > p { margin: 0 0 6px; max-width: 72ch; line-height: 1.45; }
.ad-strip .ad-help[open] { flex-basis: 100%; margin-left: 0; }
.ex-count { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--dom-fleet); }
.ex-count .i { width: 13px; height: 13px; flex: none; }
/* Person: roles & scope → effective permissions → personal exceptions → secondary sign-in / activity. */
.eff-blk .blk-body { display: grid; gap: 10px; }
.eff-table { min-width: 720px; table-layout: fixed; }
.eff-table col, .eff-table th:nth-child(1) { width: 190px; } .eff-table th:nth-child(2) { width: 150px; }
.eff-table tbody th { font-weight: 700; text-align: left; vertical-align: top; }
.eff-table tbody th > * { vertical-align: middle; } .eff-table tbody th .i { width: 15px; height: 15px; margin-right: 7px; color: var(--dom-fleet); }
.vtable.eff-table td, .vtable.eff-table th { vertical-align: top; }
.lvl { display: inline-block; font-weight: 700; } .lvl.l0 { color: var(--text-3); font-weight: 600; } .lvl.l2 { color: var(--dom-fleet); }
.eff-table td small { display: block; color: var(--text-3); font-size: 11.5px; }
.eff-ops { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.eff-ops li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.eff-ops li > .i { width: 14px; height: 14px; flex: none; color: var(--st-done, #216c46); }
.eff-ops li.is-denied > span:first-of-type { text-decoration: line-through; color: var(--text-3); } .eff-ops li.is-denied > .i { color: var(--text-3); }
.eo { font-size: 11.5px; color: var(--text-3); } .eo.ex-grant { color: var(--dom-fleet); font-weight: 700; } .eo.ex-deny { color: var(--text-2); font-weight: 700; }
.ad-secondary { margin-top: 14px; }
/* Group Roles: assigned membership with its account states (never shown as “active”). */
.role-count { margin-left: auto; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.1; flex: none; }
.role-count b { font-size: 13px; } .role-count small { font-size: 10.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.role-ed .cat { height: auto; min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
.mx-members > summary small { font-weight: 600; color: var(--text-3); }
.mx-pop li .badge { margin-left: 6px; }
/* Security & Audit: status rows lead; the access log keeps its header while the body scrolls. */
.st-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; }
.st-list li { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; align-items: center; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.st-list li:last-child { border-bottom: 0; }
.st-k { font-size: 12.5px; color: var(--text-2); } .st-v { font-size: 14px; font-weight: 700; color: var(--text); }
.st-list small { grid-column: 2; font-size: 12px; color: var(--text-3); }
.table-wrap.dt.log-scroll { max-height: 440px; overflow: auto; }
.table-wrap.log-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-sunken); box-shadow: inset 0 -1px 0 var(--border); }
/* Integrations: status + two connection facts + optional detail; actions on the shared footer baseline. */
.int-card .facts { margin: 0; }
.int-more { border-top: 1px dashed var(--border); padding-top: 6px; }
.int-more .facts { margin-top: 6px; }
@media (max-width: 1100px) { .two-col.eq { grid-template-columns: minmax(0, 1fr); } .ad-strip .ad-help { margin-left: 0; } }
@media (max-width: 760px) { .st-list li { grid-template-columns: 1fr; } .st-list small { grid-column: 1; } }

/* ---------- R4 · Adjustable column widths (js/col-widths.js) ----------
 * A thin handle on each header's right edge, separate from the sort button. Visible on header hover / keyboard focus;
 * 8px hit area, 2px line. Widths are a display preference; the header and body share one table, so they stay aligned. */
.table-wrap.has-colw thead th { position: relative; }
.table-wrap.has-colw thead th .th-l { display: inline-block; padding-right: 4px; }
.col-rs { position: absolute; top: 0; right: 0; z-index: 3; width: 9px; height: 100%; cursor: col-resize; touch-action: none; outline: none; }
.col-rs::after { content: ""; position: absolute; top: 20%; bottom: 20%; right: 0; width: 2px; border-radius: 1px; background: var(--border-strong, #91a7bb); opacity: .55; transition: opacity var(--motion), background var(--motion); }
.vtable thead th:hover .col-rs::after { opacity: 1; }
.col-rs:hover::after, .col-rs.is-drag::after { opacity: 1; background: var(--accent); top: 8%; bottom: 8%; }
.col-rs:focus-visible::after { opacity: 1; background: var(--accent); top: 4%; bottom: 4%; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
table.colw-measure th, table.colw-measure td { white-space: nowrap !important; }
.table-wrap.has-colw td { overflow-wrap: anywhere; }
.list-toolbar .grow { flex: 1 1 auto; }
.colw-reset[disabled] { opacity: .55; cursor: default; }
/* Truck Code follows its observed TMS original: headers and data centred, the row number at the start. */
.vtable th.c-start, .vtable td.c-start { text-align: left; }
.vtable th.c-center .sort-btn { margin: 0 auto; }
.vw-bar .vw-acts { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.eff-src { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 13px; color: var(--text-2); } .eff-src .i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--dom-fleet); } .eff-asg > summary { flex-wrap: wrap; } .eff-asg[open] .table-wrap { margin-top: 6px; }
/* R4 navigation order (8fd32174 · 4/6): three-way unsaved-changes choice, kept intake draft note, report window bar */
.dlg-foot.dlg-choices { justify-content: flex-end; flex-wrap: wrap; }
.ai-kept { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--review-bg); color: var(--review-text); border: 1px solid var(--review-line); font-size: 12.5px; line-height: 1.4; }
/* R4 resume (e323d962): archive status line on a Closed accident, kept drawer draft, report-window read-only record */
.awc-arch { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0; padding-top: 8px; border-top: 1px solid var(--st-done-line); font-size: 12.5px; color: var(--text-2); }
.awc-arch > span { display: flex; gap: 6px; align-items: flex-start; flex: 1 1 320px; }
.awc-arch.is-archived { color: var(--review-text); }
.drw-kept { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--review-bg); color: var(--review-text); border: 1px solid var(--review-line); font-size: 12.5px; }
.drw-kept > span { flex: 1 1 240px; }
.ro-acc { display: grid; gap: 10px; }
/* FIX2 (F2-3): an archived accident opened by a direct link shows read-only in the detail pane (no task workspace). */
.acc-ro .ro-head { display: grid; gap: 6px; padding: 10px 14px; border-top: 4px solid var(--st-done); }
.acc-ro .ro-head h2 { margin: 0; font-size: 22px; font-weight: 800; }

/* ---------- R5 · Accident integrated meaning / completion (scoped) ---------- */
/* A16 — assigned person · permission saving needs · current person (same guard as the commands) */
.req-perm { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.req-perm .icon { flex: none; margin-top: 2px; }
.req-perm.is-blocked { color: var(--review-text); }
/* A06 — parties grouped: people & organizations · damaged property · not classified yet */
.pt-h { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: none; }
/* A09 — earlier name-only evidence */
.ev-missing { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
/* A01 — corrective action rows: ended rows stay visible, muted */
.ca-acts { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
tr.is-ended td { color: var(--text-3); }
/* A03 — corrections of the report facts */
.ri-corr .ob-list { margin-top: 6px; }
/* R5 · Reports entry — “View archived accidents” in the Accident Closed view only */
.acc-arch-entry { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0 2px; }
/* R5 · Terra 420 footer fix: the task panel and its footer grid are bound to the panel width (an implicit auto track grew to
 * the footer note's content width and pushed “Close accident…” past MAIN). Same 32px buttons, same row and baseline. */
.req-panel, .task-foot.tf-main { grid-template-columns: minmax(0, 1fr); }
.req-panel > *, .task-foot.tf-main > * { min-width: 0; }
.req-txt { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 600px) { .req-head > .req-txt { align-self: stretch; } }

/* ---------- R5 · task-state N/A correction (user-approved) ----------
 * A CONFIRMED “Not applicable” has its own neutral exclusion marker (white, slate ring, circle-with-slash) on every task-state
 * surface — number circle, 9-segment strip, counts, badge, document cards, read-only lists, help key. It is never the green
 * Completed check and never the pale Not started fill. The hatch stays for legacy “archived” marks only. */
:root { --st-na: #4f6478; --st-na-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='%23fff' stroke='%234f6478' stroke-width='3'/%3E%3Cpath d='M5.5 18.5L18.5 5.5' stroke='%234f6478' stroke-width='3'/%3E%3C/svg%3E"); }
.acc-strip .sg.st-na { background: #fff; box-shadow: inset 0 0 0 1.5px var(--st-na); }
.aw-counts .ct-na::before { background: #fff; box-shadow: inset 0 0 0 1.5px var(--st-na); }
.help-list.states .st-na i { background: #fff; box-shadow: inset 0 0 0 1.5px var(--st-na); }
.st-na .at-n, .st-na .cr-n { position: relative; background: #fff; color: var(--st-na); box-shadow: inset 0 0 0 2px var(--st-na); }
.st-na .at-n::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border-radius: 50%; background: var(--st-na-icon) center / 14px no-repeat; }
.badge.na { background: #fff; color: var(--st-na); border-color: var(--st-na); }
.na-chip { background: #fff; color: var(--st-na); border-color: var(--st-na); }
.tf-note.is-na { color: var(--st-na); }
.na-facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 6px 0 0; color: var(--text); }
.na-facts dt { display: flex; gap: 6px; align-items: center; font-weight: 700; color: var(--st-na); }
.na-facts dd { margin: 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
.na-facts .nf-k { color: var(--text-3); }
/* R5 · A13: a task whose required values are recorded but that still has issues (validation / linked work) is never shown
 * as a full “1/1”: amber issue count in the row slot (same fixed slot), amber ring in the head. */
.at-req.has-issue { display: inline-flex; gap: 4px; align-items: center; background: var(--st-wait-bg); border-color: var(--st-wait-line); color: var(--warning-text); }
.at-req.has-issue b { color: var(--warning-text); }
.at-req.has-issue .i { width: 12px; height: 12px; flex: none; }
.req-ring.has-issue { box-shadow: 0 0 0 2px var(--st-wait-line); }

/* ---------- R6 · Code / MnR Master Code workspace (one tree → list → single detail) ----------
 * Ownership tint only identifies who owns a value (MnR managed = teal domain token; TMS / system / other source = neutral
 * slate with a lock). Blue stays for selection and actions; danger is not used for ownership. Same icon-tile / badge / button
 * slots as Admin and the final Accident workspace. */
.mc-ws { --own-mnr: var(--dom-insp); --own-mnr-bg: var(--dom-insp-bg); --own-ro: #4f6478; --own-ro-bg: #eef2f6; }
.mc-ws .master-main > * + * { margin-top: 10px; }
.own-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; vertical-align: middle; }
.own-badge .i { width: 13px; height: 13px; flex: none; }
.own-badge.own-managed { color: var(--own-mnr); background: var(--own-mnr-bg); border-color: #9fd3d8; }
.own-badge.own-tms, .own-badge.own-system, .own-badge.own-external { color: var(--own-ro); background: var(--own-ro-bg); border-color: #c9d3de; }
.own-badge.sm { height: 20px; font-size: 11.5px; }
.badge.mnr { background: var(--own-mnr-bg, var(--dom-insp-bg)); color: var(--own-mnr, var(--dom-insp)); border-color: #9fd3d8; }
.badge.sm { font-size: 11px; padding: 0 6px; }
.icon-tile.mnr { background: var(--dom-insp-bg); color: var(--dom-insp); }
.icon-tile.neutral { background: #eef2f6; color: #4f6478; }
.mc-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--own-ro); border-radius: var(--r-panel); }
.mc-head.own-managed { border-left-color: var(--own-mnr); }
.mc-head-id { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.mc-head-id h2 { margin: 2px 0 4px; font-size: 18px; line-height: 1.25; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mc-head-id p { margin: 0; line-height: 1.5; }
.mc-count { font-size: 13px; font-weight: 700; color: var(--text-2); padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken); }
.mc-meta { color: var(--text-3); }
.mc-head-act { flex: none; display: flex; gap: 8px; align-items: center; min-height: 32px; }
.mc-deny { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; font-size: 12.5px; color: var(--review-text); }
.mc-deny .i { flex: none; margin-top: 2px; }
.mc-group .mc-lock { width: 12px; height: 12px; flex: none; color: #8a9bb0; margin-left: auto; }
.mc-group .mc-lock + .seg-count { margin-left: 4px; }
.mc-group.on { box-shadow: inset 3px 0 0 var(--accent); }
.mc-pane .pane-head h2 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mc-dname { font-size: 14px; font-weight: 600; color: var(--text-2); }
.mc-pane.own-managed { border-top: 3px solid var(--own-mnr); }
.mc-pane.own-tms, .mc-pane.own-system, .mc-pane.own-external { border-top: 3px solid var(--own-ro); }
.mc-dstate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.mc-src { margin-top: 10px; font-size: 12.5px; }
.mc-src summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
tr.is-inactive td { color: var(--text-3); }
/* R6 · Code list / detail owner rule (only Code uses .split-list): fixed column heads over an independently scrolling body;
 * the single detail pane (.split-pane, already sticky) scrolls on its own. Column resize handles stay inside the sticky head. */
.split-list .table-wrap.dt { max-height: max(320px, calc(100dvh - 330px)); overflow: auto; }
.split-list .table-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-sunken); box-shadow: inset 0 -1px 0 var(--border); }
/* R6 · Code workspace at narrow widths: tree, list and the single detail stack in one column (no MAIN horizontal overflow);
 * the list keeps its own horizontal scroll inside its wrapper. */
@media (max-width: 900px) {
  .master.mc-ws { grid-template-columns: minmax(0, 1fr); }
  .master.mc-ws .cat-list { position: static; }
  .split.has-pane { grid-template-columns: minmax(0, 1fr); }
  .split.has-pane > .split-pane { position: static; max-height: none; }
  .mc-head { flex-wrap: wrap; }
}
.mc-pane .pre-line { white-space: pre-line; }
.mc-joblist li { display: flex; gap: 8px; align-items: baseline; }

/* R6 · Truck Swap (Vehicles › Truck Swap + Truck Details › Truck number). Reuses the Code list/detail owner rule (.split /
 * .split-list / .split-pane / kit table, fixed head) and the shared badge / button / field slots; only the number flow,
 * the period list, the identity card and the form review are defined here. Blue = direction / selection; amber = review
 * or scheduled; red only for a real conflict. */
.sw-flow { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw-flow > svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.sw-num { display: inline-block; min-width: 4.4em; padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); font-weight: 700; text-align: center; color: var(--text-2); }
.sw-num.is-new { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.pane-head h2 .sw-flow { font-size: 18px; }
.pane-head h2 .sw-flow > svg { width: 18px; height: 18px; }
.sw-count { margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.sw-deny { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12.5px; color: var(--review); }
.sw-deny > svg, .sw-stays > svg, .sw-ok > svg, .sw-bad > svg { width: 15px; height: 15px; flex: none; }
.sw-deny.small { margin: 0; }
.list-toolbar .sw-date { width: 150px; }
.sw-idcard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 14px; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.sw-idcard > div { min-width: 0; display: grid; gap: 2px; }
.sw-idcard small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sw-idcard b { font-size: 14px; overflow-wrap: anywhere; }
.sw-facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 4px; font-size: 13px; }
.sw-facts dt { color: var(--text-2); font-weight: 600; }
.sw-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sw-periods { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.sw-periods li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; }
.sw-periods li.is-cur { border-color: var(--accent); }
.sw-periods li.is-sel { box-shadow: inset 3px 0 0 var(--accent); background: var(--row-selected); }
.sw-i { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-sunken); color: var(--text-2); }
.sw-pv { min-width: 0; overflow-wrap: anywhere; }
.sw-pd { white-space: nowrap; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.sw-stays { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-sunken); font-size: 12.5px; color: var(--text-2); }
.sw-rec { margin: 8px 0 0; font-size: 11.5px; color: var(--text-3); }
.sw-vblock { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.sw-vhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sw-vhead .drw-h { margin: 0; }
.sw-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sw-hist li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.sw-hist li.is-sel { background: var(--row-selected); box-shadow: inset 3px 0 0 var(--accent); }
.sw-hm { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.sw-picks { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.sw-pick { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .8fr); gap: 4px 10px; align-items: center; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; font: inherit; font-size: 13px; cursor: pointer; }
.sw-pick:hover { background: var(--row-hover); }
.sw-pick:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.sw-pick .cell-sub { grid-column: 2 / -1; }
.sw-review { display: grid; gap: 6px; }
.sw-rv { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.sw-ok, .sw-bad { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.sw-ok { background: var(--surface-sunken); color: var(--text); }
.sw-ok > svg { color: var(--success); }
.sw-bad { border: 1px solid var(--danger); color: var(--danger); background: var(--surface); }
.sw-bad.is-review { border-color: var(--warning); color: var(--text); }
.sw-bad.is-review > svg { color: var(--warning); }
@media (max-width: 900px) {
  .sw-idcard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-pick { grid-template-columns: 64px minmax(0, 1fr); }
  .sw-pick > span:nth-of-type(n+3) { grid-column: 2; }
  .list-toolbar .sw-date { width: 100%; }
}
.sw-pane .sw-idcard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sw-pane .pane-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* R7 · Truck Swap — vehicle-centric list, vertical number history, current status, record-count bars, source review.
 * Same shared table / split / badge / status-chip slots. The green bar mirrors the workbook's D data bar (#63C384): it
 * compares record counts only and is never a status colour. Source colours are shown as small swatches, not cell fills. */
.sw-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.sw-strip > svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.sw-strip .sw-deny { margin: 0; }
.sw-strip .sw-deny > svg { width: 14px; height: 14px; }
.sw-tools .field-label { white-space: nowrap; }
.sw-countrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 10px; }
.sw-countrow .sw-count { margin: 0; flex: 1 1 420px; }
.sw-help { font-size: 12.5px; color: var(--text-2); }
.sw-help > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--accent); list-style: none; }
.sw-help > summary::-webkit-details-marker { display: none; }
.sw-help > summary > svg { width: 14px; height: 14px; }
.sw-help[open] { flex-basis: 100%; }
.sw-help p { margin: 6px 0 0; max-width: 860px; padding: 8px 10px; border-radius: 8px; background: var(--surface-sunken); }
.sw-cnt { display: inline-grid; grid-template-columns: 2ch minmax(48px, 1fr); align-items: center; gap: 8px; width: 100%; max-width: 150px; font-variant-numeric: tabular-nums; }
.sw-cnt > b { text-align: right; }
.sw-bar { height: 10px; border-radius: 2px; background: transparent; }
.sw-bar > i { display: block; height: 100%; min-width: 3px; border-radius: 2px; background: linear-gradient(90deg, #63C384, #63C384cc 70%, #63C38433); }
th.sw-rc, td.sw-rc { width: 150px; }
.sw-vin { font-size: 12.5px; white-space: nowrap; }
.sw-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.sw-st-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sw-st-r { flex: 1 1 200px; min-width: 0; color: var(--text-2); overflow-wrap: anywhere; }
.drw-h.sw-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sw-tl { list-style: none; margin: 4px 0 12px; padding: 0; position: relative; }
.sw-tp { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 0 0 10px; }
.sw-tp:not(:last-child)::before { content: ''; position: absolute; left: 12px; top: 24px; bottom: 0; width: 2px; background: var(--border); }
.sw-tdot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-sunken); color: var(--text-2); border: 1px solid var(--border); position: relative; z-index: 1; }
.sw-tp.is-cur .sw-tdot { background: var(--accent); border-color: var(--accent); color: #fff; }
.sw-tp.is-sched .sw-tdot { border-style: dashed; border-color: var(--warning); color: var(--warning-text); background: var(--warning-bg); }
.sw-tbody { min-width: 0; display: grid; gap: 3px; padding: 2px 8px 6px; border-radius: 8px; }
.sw-tp.is-sel .sw-tbody { background: var(--row-selected); box-shadow: inset 3px 0 0 var(--accent); }
.sw-ttop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.sw-trange { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw-tev { display: block; font-size: 12.5px; color: var(--text-2); text-decoration: none; overflow-wrap: anywhere; }
a.sw-tev:hover { color: var(--accent); text-decoration: underline; }
a.sw-tev[aria-current] { color: var(--text); font-weight: 600; }
.sw-tev.is-fix { color: var(--text-3); }
.sw-tev.is-fix::before { content: '✎ '; }
.sw-tev.is-plain:empty { display: none; }
.sw-evcard { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.sw-evhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sw-evk { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); flex-basis: 100%; }
.sw-evcard .sw-facts { margin-bottom: 0; }
.sw-pane .sw-idcard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sw-idcard .sw-idvin { grid-column: span 2; }
.sw-idcard .status-chip { font-size: 12px; }
.sw-pane .sw-idcard .sw-idvin { grid-column: 1 / -1; }
.sw-srcload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 10px; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 8px; font-size: 13px; }
.sw-srcload > svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.sw-srcload > div { flex: 1 1 380px; display: grid; gap: 2px; min-width: 0; }
.sw-srcload > div > span { color: var(--text-2); }
.sw-srcfile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; font-size: 12.5px; color: var(--text-2); }
.sw-srcfile > svg { width: 15px; height: 15px; flex: none; }
.sw-srcfile > span { flex: 1 1 320px; }
.sw-swatch { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .18); vertical-align: -2px; }
.sw-btext { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.sw-btext > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sw-dupA { padding: 0 4px; border-radius: 3px; }
.sw-mk { display: inline-block; margin: 0 4px 2px 0; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: 12px; font-family: var(--mono, ui-monospace, monospace); }
.sw-cells { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.sw-cells th, .sw-cells td { padding: 3px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.btn.is-busy { opacity: .7; pointer-events: none; }
@media (max-width: 900px) {
  .sw-idcard .sw-idvin { grid-column: 1 / -1; }
  .sw-cnt { max-width: none; }
}
/* R7 · Reports: the picker lists the selected classification only. */
.rp-scope { display: flex; align-items: center; gap: 6px; margin: 6px 2px 0; font-size: 11.5px; color: var(--text-3); }
.rp-scope > svg { width: 13px; height: 13px; flex: none; }
/* R7 · Master Code: compact group head (name · count · small ownership badge first), one shared Ownership help,
 * Reset column widths as a quiet secondary action. */
.mc-ws .mc-head { padding: 8px 12px; align-items: center; }
.mc-ws .mc-head-id h2 { margin: 0; font-size: 17px; align-items: center; }
.mc-ws .mc-head-id .ph-kicker { margin-bottom: 1px; }
.mc-common { margin: 3px 0 0; font-size: 12.5px; color: var(--text-2); }
.mc-ws .mc-deny { margin-top: 3px; }
.mc-help { position: relative; font-size: 12.5px; }
.mc-help > summary { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; cursor: pointer; color: var(--text-2); list-style: none; border-radius: 6px; }
.mc-help > summary::-webkit-details-marker { display: none; }
.mc-help > summary:hover { background: var(--surface-sunken); }
.mc-help > summary > svg { width: 14px; height: 14px; }
.mc-help > dl { position: absolute; right: 0; top: 34px; z-index: 20; width: min(420px, 80vw); margin: 0; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop, 0 8px 24px rgba(16, 24, 40, .14)); }
.mc-help dd { margin: 0; color: var(--text-2); line-height: 1.45; }
.mc-ws .colw-reset { font-size: 12px; color: var(--text-3); font-weight: 500; padding: 0 6px; }
/* R7 · Code directories (Truck / Chassis / Driver / Trailer): the Code key column stays in view while the long TMS row
 * scrolls sideways (detail open or closed); same selected / hover row colours. */
.code-dir .vtable tbody td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); }
.code-dir .vtable tbody tr:hover td:nth-child(2) { background: var(--row-hover); }
.code-dir .vtable tbody tr.is-last td:nth-child(2) { background: var(--row-selected); }
.code-dir .vtable thead th:nth-child(2) { left: 0; z-index: 3; box-shadow: inset 0 -1px 0 var(--border), inset -1px 0 0 var(--border); }
/* R7 · Source formula provenance: a shared-formula follower reads as a reference to its master, not as its own text. */
.sw-fx { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.sw-fx[title] { text-decoration: underline dotted var(--border-strong); text-underline-offset: 2px; cursor: help; }
.sw-cells th:first-child, .sw-cells td:first-child { white-space: nowrap; }

/* R8 · Truck Swap movements — compact truck list (left) + wide movement stage (right). Every movement row has the same
 * slots: date · [yard + number before] → [yard + number after] · tag. Only the current position is emphasised; a scheduled
 * position is dashed. Yard names truncate inside a fixed block so the arrow and numbers never move. */
.mv-ws { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 14px; align-items: start; }
.mv-side { padding: 10px; display: grid; gap: 8px; min-width: 0; }
.mv-side .split-list .table-wrap.dt { max-height: max(300px, calc(100dvh - 330px)); }
.mv-tools { display: grid; gap: 8px; }
.mv-tools .search { width: 100%; }
.mv-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv-filters .field, .mv-morefil .field { display: grid; gap: 3px; min-width: 0; }
.mv-filters .select, .mv-morefil .select, .mv-morefil .input { width: 100%; }
.mv-morefil > summary { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12.5px; color: var(--text-2); list-style: none; }
.mv-morefil > summary::-webkit-details-marker { display: none; }
.mv-morefil > summary > svg { width: 14px; height: 14px; }
.mv-morefil-body { display: grid; gap: 8px; margin-top: 8px; }
.mv-side .sw-count { margin: 0; }
.mv-stage { padding: 14px 16px; min-width: 0; position: sticky; top: 8px; max-height: calc(100dvh - 120px); overflow: auto; }
.mv-id { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.mv-id-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.mv-id-main h2 { margin: 0; font-size: 22px; color: var(--text); }
.mv-id-main .status-chip { align-self: center; font-size: 12px; }
.mv-vin { font-size: 12.5px; }
.mv-yards { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; font-size: 12.5px; }
.mv-yards > div { display: flex; gap: 6px; align-items: baseline; }
.mv-yards dt { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.mv-yards dd { margin: 0; font-weight: 600; }
.mv-id-act { display: flex; flex-wrap: wrap; gap: 8px; }
.drw-h.mv-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; }
.mv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mv-row { border: 1px solid transparent; border-radius: 10px; }
.mv-row.is-open { border-color: var(--border); background: var(--surface-sunken); }
.mv-hit { display: grid; grid-template-columns: 92px 200px 34px 200px 92px 18px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: inherit; text-decoration: none; }
a.mv-hit:hover { background: var(--row-hover); }
a.mv-hit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mv-date { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv-blk { display: grid; gap: 2px; min-width: 0; height: 56px; align-content: center; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.mv-yard { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--text); }
.mv-yard > svg { width: 13px; height: 13px; flex: none; color: var(--text-3); }
.mv-yard > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-yard.is-none { font-weight: 500; color: var(--text-3); font-style: italic; }
.mv-num { font-size: 19px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mv-arrow { display: grid; place-items: center; color: var(--text-3); }
.mv-arrow > svg { width: 22px; height: 22px; }
.mv-blk.is-to.is-now { border: 2px solid var(--accent); background: var(--accent-tint); }
.mv-blk.is-to.is-sched { border: 1.5px dashed var(--warning); }
.mv-row.is-now .mv-arrow { color: var(--accent); }
.mv-tag { min-width: 0; }
.mv-chev { color: var(--text-3); transition: transform var(--motion); }
.mv-chev > svg { width: 14px; height: 14px; }
.mv-row.is-open .mv-chev { transform: rotate(180deg); }
.mv-more { padding: 2px 12px 10px 110px; }
.mv-more .sw-facts { margin: 4px 0 0; }
.mv-fixes { list-style: none; margin: 0; padding: 0 8px 6px 110px; }
.mv-fixhit { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.mv-fixhit > svg { width: 13px; height: 13px; }
a.mv-fixhit:hover { color: var(--accent); text-decoration: underline; }
.mv-fix .mv-more { padding-left: 20px; }
.mv-empty { display: flex; align-items: center; gap: 12px; }
.mv-empty .mv-blk { width: 200px; }
.mv-review { border-color: var(--border); background: var(--surface-sunken); }
.mv-review .mv-hit { grid-template-columns: 92px minmax(0, 1fr) 34px minmax(0, 1fr) auto; }
.sw-vblock .mv-hit { grid-template-columns: 92px 190px 34px 190px 92px 18px; }
@media (max-width: 1180px) {
  .mv-ws { grid-template-columns: minmax(0, 1fr); }
  .mv-stage { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .mv-hit, .sw-vblock .mv-hit, .mv-review .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px 8px; }
  .mv-hit .mv-date { grid-column: 1 / 3; }
  .mv-hit .mv-tag { grid-column: 3; grid-row: 1; justify-self: end; }
  .mv-hit .mv-chev { display: none; }
  .mv-more, .mv-fixes { padding-left: 10px; }
  .mv-blk { padding: 4px 8px; }
}
.mv-ws { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
.mv-side { overflow: hidden; }
.mv-side .split-list { min-width: 0; }
.mv-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mv-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mv-pick .status-chip { font-size: 11.5px; }
.mv-tools .search, .mv-tools .search .input { width: 100%; }
/* R8 · inside the half-width Truck Details card the movement blocks share the width (same slots, flexible blocks). */
.sw-vblock .mv-hit { grid-template-columns: 84px minmax(0, 1fr) 28px minmax(0, 1fr) 64px 16px; gap: 8px; }
.sw-vblock .mv-more, .sw-vblock .mv-fixes { padding-left: 100px; }
.sw-vblock .mv-num { font-size: 17px; }
@media (max-width: 760px) {
  .sw-vblock .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px 8px; }
  .sw-vblock .mv-more, .sw-vblock .mv-fixes { padding-left: 10px; }
}
@media (max-width: 1180px) {
  .mv-ws { grid-template-columns: minmax(0, 1fr); }
  .mv-stage { position: static; max-height: none; }
}
/* R8 amendment · incomplete truck profile + yard confirmation line */
.mv-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0; padding: 8px 12px; border: 1px solid var(--warning-line); border-radius: 8px; background: var(--warning-bg); font-size: 12.5px; color: var(--warning-text); }
.mv-gap > svg { width: 15px; height: 15px; flex: none; }
.mv-gap > span { flex: 1 1 260px; }
.mv-base { margin: 0 0 6px; padding: 2px 8px; }
.mv-base.is-open { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-sunken); }
.mv-base .mv-more { padding-left: 20px; }

/* R8 layout followup — compact identity line; panels about 1 : 2 with a readable maximum width; every movement row shares
 * ONE grid: fixed date · equal flexible from-block · fixed arrow · equal flexible to-block · fixed tag · fixed toggle. The
 * blocks take the row's width (no empty right area); long yard names truncate inside, so no axis moves. */
.mv-ws { grid-template-columns: minmax(340px, 1fr) minmax(0, 2fr); max-width: 1560px; }
.mv-id { gap: 4px; padding-bottom: 8px; margin-bottom: 8px; }
.mv-id-main { align-items: center; gap: 4px 14px; }
.mv-id-main h2 { font-size: 20px; }
.mv-opyard { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mv-opyard > svg { width: 14px; height: 14px; color: var(--text-3); }
.mv-opk { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.mv-opyard b { color: var(--text); }
.mv-id-main .mv-id-act { display: inline-flex; gap: 8px; margin-left: auto; }
.mv-stage .mv-hit { grid-template-columns: 96px minmax(0, 1fr) 40px minmax(0, 1fr) 96px 24px; gap: 10px; }
.mv-stage .mv-blk { width: auto; min-width: 0; }
.mv-stage .mv-tag { justify-self: start; }
.mv-stage .mv-chev { justify-self: center; }
.mv-stage .mv-more, .mv-stage .mv-fixes { padding-left: 114px; }
.mv-stage .mv-more .sw-facts { grid-template-columns: 112px minmax(0, 1fr); max-width: 760px; }
@media (max-width: 1180px) {
  .mv-ws { grid-template-columns: minmax(0, 1fr); max-width: none; }
}
@media (max-width: 760px) {
  .mv-stage .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px 8px; }
  .mv-stage .mv-hit .mv-date { grid-column: 1 / 3; }
  .mv-stage .mv-hit .mv-tag { grid-column: 3; grid-row: 1; justify-self: end; }
  .mv-stage .mv-more, .mv-stage .mv-fixes { padding-left: 10px; }
  .mv-id-main .mv-id-act { margin-left: 0; }
}
/* R8 layout · the date and tag slots are full column boxes (an empty tag keeps its slot). */
.mv-stage .mv-date, .mv-stage .mv-tag { justify-self: stretch; display: flex; align-items: center; min-width: 0; }
@media (max-width: 760px) { .mv-stage .mv-hit .mv-tag { justify-self: stretch; justify-content: flex-end; } }

/* R9 · Truck Swap vertical workspace — truck list on top (bounded box: filters + column heads fixed, rows scroll inside),
 * collapsible to a one-line selected-truck bar; the selected truck's movements below at a readable width. Replaces the
 * R8 side-by-side 1 : 2 layout for Swap only (other screens keep their own layout). */
.sw9 { display: grid; gap: 12px; max-width: 1080px; }
.sw9-top { padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.sw9-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.sw9-tools .search { flex: 1 1 260px; min-width: 200px; max-width: 360px; }
.sw9-tools .search .input { width: 100%; }
.sw9-tools .field { display: grid; gap: 3px; }
.sw9-tools .mv-morefil { align-self: center; }
.sw9-tools .mv-morefil[open] { flex-basis: 100%; }
.sw9-tools .mv-morefil-body { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 6px; }
.sw9-listhead { display: flex; align-items: center; gap: 8px 12px; }
.sw9-listhead .sw-count { margin: 0; flex: 1 1 auto; }
.sw9-list .table-wrap.dt { max-height: min(312px, 42dvh); overflow: auto; }
.sw9-vin { font-size: 12.5px; white-space: nowrap; }
.sw9-selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--text-2); }
.sw9-selbar > svg { width: 16px; height: 16px; color: var(--text-3); }
.sw9-selk { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sw9-selcode { font-size: 17px; color: var(--text); }
.sw9-stage.mv-stage { position: static; max-height: none; overflow: visible; }
.sw9-empty { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: var(--text-2); font-size: 13.5px; }
.sw9-empty > svg { width: 18px; height: 18px; color: var(--text-3); }
@media (max-width: 760px) {
  .sw9-tools .search { max-width: none; flex-basis: 100%; }
  .sw9-tools .field { flex: 1 1 140px; }
  .sw9-list .table-wrap.dt { max-height: min(300px, 46dvh); }
}
/* R9 · the Swap list box keeps its bounded height under the local-source list rule too. */
.sw9 .sw9-list .table-wrap.dt, [data-nc-local] .sw9 .sw9-list .table-wrap.dt { max-height: min(312px, 42dvh); }
@media (max-width: 760px) { .sw9 .sw9-list .table-wrap.dt, [data-nc-local] .sw9 .sw9-list .table-wrap.dt { max-height: min(300px, 46dvh); } }
/* R9 · the list table scrolls sideways inside its own box on narrow screens (the grid track never takes its min-width). */
.sw9 { grid-template-columns: minmax(0, 1fr); }
.sw9 > *, .sw9-list { min-width: 0; }
.sw9-selbar .grow { flex: 1 1 auto; }
/* R9 fix1 · a movement block never grows past its slot: one shrinkable track, clipped; long yard and number truncate
 * with an ellipsis (full value in the tooltip) instead of running into the arrow or the next block. */
.mv-blk { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.mv-num { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-yard, .mv-yard > span { min-width: 0; }

/* R9 width followup — the Swap workspace uses the available content width (top filters / list, collapsed bar and the lower
 * panel); only the movement graphics are bounded inside the panel for reading (same block size as accepted R9). */
.sw9 { max-width: none; }
.sw9-stage .mv-list, .sw9-stage .mv-base, .sw9-stage .mv-empty { max-width: 1040px; }
/* R9 width · composition: the lower panel keeps the full width of the list above, and its whole content — identity line,
 * heading, profile note, movement rows with their details — is ONE centered column of the bounded reading width, so the
 * rows are not left-clustered under a full-width identity line (blocks keep the accepted size). */
.sw9-stage > .mv-id, .sw9-stage > .mv-h, .sw9-stage > .mv-list, .sw9-stage > .mv-base, .sw9-stage > .mv-empty { width: 100%; max-width: 1040px; margin-inline: auto; }
.sw9-stage > .mv-h { margin-bottom: 8px; }
.sw9-empty { justify-content: center; }

/* R9 infographic rebuild — compact selector · one identity bar · journey (rail) + side panel. Swap only. */
/* 1 · compact selector: natural height for a few rows (no local-source min-height strip); about 5½ rows for many. */
.sw9 .sw9-list .table-wrap.dt, [data-nc-local] .sw9 .sw9-list .table-wrap.dt { min-height: 0; max-height: min(286px, 34dvh); }
.sw9-top { gap: 6px; padding: 8px 12px 10px; }
.sw9-tools { gap: 6px 12px; }
/* 2 · identity once, slim */
.sw9-idbar { padding: 8px 14px; }
.sw9-idbar .mv-id { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.sw9-idbar .mv-gap { margin-top: 6px; }
/* 3 · body: journey + side panel on the list's left edge */
.sw9-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 12px; align-items: start; }
.sw9-journey.sw9-stage { padding: 12px 16px 14px; }
.sw9-stage.sw9-journey > .mv-h, .sw9-stage.sw9-journey > .mv-list, .sw9-stage.sw9-journey > .mv-base, .sw9-stage.sw9-journey > .mv-empty { max-width: none; margin-inline: 0; }
/* journey rows: rail · date · departure (quiet) · arrow · arrival (emphasised) · tag · toggle */
.sw9-journey .mv-list { gap: 6px; }
.sw9-journey .mv-row { position: relative; padding-left: 26px; border: 0; }
.sw9-journey .mv-row::after { content: ''; position: absolute; left: 3px; top: 21px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); box-sizing: border-box; z-index: 1; }
.sw9-journey .mv-row:not(:last-child)::before { content: ''; position: absolute; left: 8px; top: 27px; bottom: -33px; width: 2px; background: var(--border); }
.sw9-journey .mv-row.is-now::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.sw9-journey .mv-row.is-sched::after { border-style: dashed; border-color: var(--warning); }
.sw9-journey .mv-row.is-open { background: transparent; border: 0; }
.sw9-journey .mv-row.is-open > .mv-hit { background: var(--row-selected); box-shadow: inset 3px 0 0 var(--accent); }
.sw9-journey .mv-hit { grid-template-columns: 92px minmax(0, 360px) 30px minmax(0, 360px) 84px 20px; gap: 10px; padding: 3px 8px; justify-content: start; }
.sw9-journey .mv-blk { height: 48px; padding: 3px 10px; border-radius: 8px; }
.sw9-journey .mv-blk.is-from { background: var(--surface-sunken); border-color: transparent; }
.sw9-journey .mv-blk.is-from .mv-num { font-size: 16px; font-weight: 700; color: var(--text-2); }
.sw9-journey .mv-blk.is-from .mv-yard { font-weight: 600; color: var(--text-2); }
.sw9-journey .mv-blk.is-to { background: var(--surface); border: 1px solid var(--border-strong); }
.sw9-journey .mv-blk.is-to .mv-num { font-size: 18px; }
.sw9-journey .mv-row:not(.is-now):not(.is-sched) .mv-date { color: var(--text-3); font-weight: 500; }
.sw9-journey .mv-row.is-now .mv-date { color: var(--text); }
.sw9-journey .mv-row.is-sched .mv-date { color: var(--warning-text); }
.sw9-journey .mv-fixes { padding-left: 110px; }
.sw9-journey .mv-base { margin: 0 0 6px; padding: 0; }
/* side panel */
.sw9-side { padding: 12px 14px; display: grid; gap: 12px; }
.sw9-side-sec h4 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sw9-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sw9-now .mv-blk { width: 220px; height: 48px; padding: 3px 10px; }
.sw9-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.sw9-plan li { display: flex; gap: 10px; align-items: baseline; }
.sw9-side-sec.is-sel { border-top: 1px solid var(--border); padding-top: 10px; }
.sw9-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sw9-side-head h4 { margin: 0; }
.sw9-selflow { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 6px; margin: 8px 0 4px; }
.sw9-selflow .mv-blk { height: 46px; padding: 3px 10px; }
.sw9-side .mv-more { padding: 0; }
.sw9-side .mv-more .sw-facts { grid-template-columns: 100px minmax(0, 1fr); margin-top: 6px; max-width: none; }
.sw9-side-hint { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--text-3); }
.sw9-side-hint > svg { width: 14px; height: 14px; }
@media (max-width: 1180px) {
  .sw9-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sw9-journey .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px 8px; }
  .sw9-journey .mv-row { padding-left: 22px; }
  .sw9-journey .mv-row::after { top: 4px; }
  .sw9-journey .mv-row:not(:last-child)::before { top: 10px; bottom: -10px; }
  .sw9-journey .mv-fixes { padding-left: 10px; }
  .sw9-now .mv-blk { width: 100%; }
}
/* R9 infographic · balance: the journey takes its row content width (no inner blank), the side panel the rest; on wide
 * screens the side panel's sections (Now · Planned · Selected) sit side by side instead of leaving an empty tall card. */
.sw9-body { grid-template-columns: minmax(0, 1060px) minmax(380px, 1fr); }
.sw9-side { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; column-gap: 20px; }
.sw9-side-sec.is-sel { border-top: 0; padding-top: 0; }
.sw9-side-sec.is-sel, .sw9-side-hint { grid-column: span 1; }
.sw9-selflow { grid-template-columns: minmax(0, 240px) 28px minmax(0, 240px); justify-content: start; }
@media (max-width: 1180px) { .sw9-body { grid-template-columns: minmax(0, 1fr); } }
/* R9 infographic · the tag slot fits “Scheduled” without touching the toggle. */
.sw9-journey .mv-hit { grid-template-columns: 92px minmax(0, 360px) 30px minmax(0, 360px) 104px 20px; }
.sw9-body { grid-template-columns: minmax(0, 1080px) minmax(380px, 1fr); }
@media (max-width: 1180px) { .sw9-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .sw9-journey .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); } }
/* R9 infographic date fix · the Now card's recorded date facts stack as separate lines. */
.sw9-now > .cell-sub { display: grid; gap: 2px; }

/* ===== Maintenance R4 — Work list (one row per job), job sheet (current work + sections), Inspections =====
   Replaces the R3 block. Same tokens, type, status colours, icons and buttons. Colour points: blue = a step you can do,
   amber = waiting on someone, violet = invoice & accounting, red = the truck is restricted, teal = inspections.
   Container queries size the parts to their own width (phone, tablet with the sidebar open). */
.mx { display: grid; gap: 10px; min-width: 0; container: mx / inline-size; }
.kind-tag.insp { background: var(--dom-insp-bg); color: var(--dom-insp); }
.mw-dl { display: none; }
/* In-page switch: two work entries; Records is a quiet link */
.mx-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.mx-switch { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-panel); }
.mx-sw { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: 8px; color: var(--text-2); font-weight: 650; text-decoration: none; }
.mx-sw:hover { background: var(--surface-sunken); color: var(--text); }
.mx-sw[aria-current="page"] { background: var(--dom-maint); color: #fff; box-shadow: 0 2px 6px rgba(61, 85, 184, .28); }
.mx-sw:focus-visible, .mx-rec:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.mx-swn { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--dom-insp-bg); color: var(--dom-insp); white-space: nowrap; }
.mx-sw[aria-current="page"] .mx-swn { background: rgba(255, 255, 255, .22); color: #fff; }
.mx-rec { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--text-2); text-decoration: none; }
.mx-rec small { font-weight: 500; color: var(--text-3); }
.mx-rec:hover { background: var(--surface-sunken); color: var(--text); }
.mx-rec[aria-current="page"] { color: var(--dom-maint); background: var(--dom-maint-bg); }
.mx-nav + .sec-tabs { margin-top: -4px; }
/* Summary: four figures, each says job or truck */
.mx-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mx-tile { --tc: var(--dom-maint); --tb: var(--dom-maint-bg); display: grid; gap: 2px; align-content: start; min-width: 0; padding: 9px 12px 10px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: 10px; cursor: pointer; }
.mx-tile:hover { background: var(--tb); }
.mx-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mx-tile[aria-pressed="true"] { background: var(--tb); box-shadow: inset 0 0 0 2px var(--tc); }
.mx-tl { display: flex; gap: 6px; align-items: flex-start; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--text-2); line-height: 1.25; }
.mx-tl > .i { flex: none; margin-top: 1px; color: var(--tc); }
.mx-tv { display: flex; align-items: baseline; gap: 6px; }
.mx-tn { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--tc); font-variant-numeric: tabular-nums; }
.mx-tu { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.mx-tf { display: block; min-width: 0; font-size: 11.5px; line-height: 1.3; color: var(--text-3); }
.mx-tf > .i { vertical-align: -2px; margin-right: 3px; }
.mx-tile.is-zero .mx-tn { color: var(--text-3); }
.mx-tile.t-act { --tc: var(--st-prog); --tb: var(--st-prog-bg); }
.mx-tile.t-danger { --tc: var(--danger); --tb: var(--danger-bg); }
.mx-tile.t-warn { --tc: var(--warning-text); --tb: var(--warning-bg); }
.mx-tile.t-money { --tc: var(--review); --tb: var(--review-bg); }
/* Find: search, yard, owner, state; more filters folded */
.mx-find { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.mx-find > .search { flex: 1 1 260px; max-width: 380px; }
.mx-find .field .select { min-width: 150px; }
.mx-morefilters { flex: 1 1 100%; }
.mx-morefilters > summary { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--text-2); list-style: none; }
.mx-morefilters > summary::-webkit-details-marker { display: none; }
.mx-morefilters[open] > summary { color: var(--text); }
.mx-mf { display: flex; flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; }
.mx-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); }
.mx-cond .grow { flex: 1 1 0; }
/* The job list: one row per job; the row opens the job, the truck button opens the truck summary */
.mx-lhead, .mx-row { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(190px, 1.35fr) minmax(170px, 1.1fr) minmax(190px, 1.25fr) minmax(110px, .7fr) auto; gap: 6px 14px; align-items: center; }
.mx-lhead { padding: 0 14px 0 18px; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.mx-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-panel); overflow: hidden; container: mxlist / inline-size; }
.mx-row { position: relative; padding: 9px 14px 9px 18px; border-top: 1px solid var(--table-row-border); }
.mx-row:first-child { border-top: 0; }
.mx-row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--neutral-line); }
.mx-row.t-act::before { background: var(--st-prog); } .mx-row.t-wait::before { background: var(--st-wait); } .mx-row.t-money::before { background: var(--review); }
.mx-row:hover { background: var(--row-hover); }
.mx-row.is-last { background: var(--row-selected); }
.mx-row > div { min-width: 0; }
.mx-jt { font-size: 14.5px; font-weight: 700; color: var(--text); text-decoration: none; }
.mx-jt::after { content: ""; position: absolute; inset: 0; }
.mx-jt:focus-visible { outline: none; }
.mx-jt:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.mx-row:hover .mx-jt { color: var(--accent); text-decoration: underline; }
.mx-vbtn, .mx-ref, .mx-rv, .mx-rg .btn { position: relative; z-index: 1; }
.mx-jsub { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--text-2); }
.mx-ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-3); letter-spacing: .01em; user-select: all; }
.mx-rl { display: none; }
.mx-ro, .mx-rp, .mx-rw { display: grid; gap: 2px; justify-items: start; font-size: 12.5px; }
.mx-rsub { display: inline-flex; gap: 4px; align-items: baseline; line-height: 1.3; color: var(--text-2); }
.mx-rsub > .i { flex: none; align-self: center; }
.mx-rsub.t-danger { color: var(--danger-text); } .mx-rsub.t-info { color: var(--info-text); } .mx-rsub.t-neutral { color: var(--text-3); }
.mx-rsub.k-wait { color: var(--warning-text); font-weight: 600; } .mx-rsub.k-block { color: var(--danger-text); font-weight: 600; }
.mx-rsub.k-act { color: var(--st-prog); font-weight: 650; } .mx-rsub.k-money { color: var(--review-text); font-weight: 600; }
.mx-stage { font-weight: 650; color: var(--text); }
.btn.mx-open { white-space: nowrap; }
/* Truck button: identity in one block (code · full VIN · Unit · Yard), clearly a separate target */
.mx-vbtn { display: inline-grid; gap: 1px; justify-items: start; max-width: 100%; padding: 5px 10px 6px 8px; font: inherit; text-align: left; color: var(--text); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.mx-vbtn:hover { border-color: var(--accent); background: var(--surface); }
.mx-vbtn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mx-vtop { display: inline-flex; gap: 6px; align-items: center; }
.mx-vtop b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mx-vtop > .i { color: var(--text-3); }
.mx-vgo { display: inline-flex; gap: 3px; align-items: center; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--surface); border: 1px solid var(--border); }
.mx-vbtn .mx-vin { font-size: 11.5px; overflow-wrap: anywhere; }
.mx-vbtn small { font-size: 11.5px; color: var(--text-3); }
.mx-vbtn.big { padding: 8px 14px 9px 10px; }
.mx-vbtn.big .mx-vtop b { font-size: 21px; }
.veh-chip.mx-vchip { font: inherit; text-align: left; cursor: pointer; }
@container mxlist (max-width: 1020px) {
  .mx-row { grid-template-columns: minmax(140px, auto) minmax(0, 1fr) auto; }
  .mx-rv { grid-row: 1 / span 2; align-self: start; }
  .mx-rj { grid-column: 2; }
  .mx-rg { grid-column: 3; grid-row: 1; }
  .mx-ro, .mx-rp { grid-column: 2 / -1; }
  .mx-rw { grid-column: 2 / -1; grid-auto-flow: column; justify-content: start; gap: 10px; }
  .mx-ro, .mx-rp { grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
  .mx-rl { display: block; grid-row: 1 / span 3; font-size: 11px; font-weight: 700; color: var(--text-3); min-width: 74px; }
  .mx-rw .mx-rl { display: none; }
}
@container mxlist (max-width: 560px) {
  .mx-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px 12px 16px; }
  .mx-rv { grid-row: auto; grid-column: 1; }
  .mx-rj, .mx-ro, .mx-rp, .mx-rw { grid-column: 1 / -1; }
  .mx-rg { grid-column: 2; grid-row: 1; align-self: start; }
  .mx-rl { min-width: 64px; }
}
/* Truck summary drawer */
.mx-vp { display: grid; gap: 8px; }
.mx-vp .drw-h { margin: 8px 0 0; }
.mx-vp-st { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.mx-vp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mx-vp-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.mx-vp-list li > div { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.mx-vp-list li.is-here { border-color: var(--accent); background: var(--st-prog-bg); }
.mx-here { font-size: 12px; font-weight: 700; color: var(--accent); }
.mx-start { display: grid; gap: 8px; }
.mx-start-o { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--dom-maint); border-radius: 10px; }
.mx-start-o:hover { background: var(--dom-maint-bg); }
.mx-start-o > .i { flex: none; margin-top: 2px; font-size: 20px; color: var(--dom-maint); }
.mx-start-o span { display: grid; gap: 2px; } .mx-start-o small { color: var(--text-2); }
.mx-start-o.quiet { border-left-color: var(--dom-insp); } .mx-start-o.quiet > .i { color: var(--dom-insp); }
.mx-ip-types { display: grid; gap: 6px; }
.mx-ip-types .radio-card { display: flex; gap: 10px; align-items: center; }
.mx-ip-types .radio-card > span { flex: none; }
.mx-ip-types .radio-card > span:nth-child(2) { flex: 1; min-width: 0; }
.mx-ipt { width: 100%; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.mx-ipt:hover { background: var(--surface-sunken); }
.mx-ipt:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mx-ipt[aria-pressed="true"] { border-color: var(--dom-insp); background: var(--dom-insp-bg); box-shadow: inset 0 0 0 1px var(--dom-insp); }
.mx-ipt-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); }
.mx-ipt[aria-pressed="true"] .mx-ipt-dot { border-color: var(--dom-insp); box-shadow: inset 0 0 0 3px var(--surface); background: var(--dom-insp); }
.mx-ipt small { display: block; color: var(--text-2); }
/* Job sheet */
.mx-sheet { display: grid; gap: 12px; min-width: 0; container: mxsheet / inline-size; }
.mx-hero { display: grid; gap: 10px; padding: 8px 16px 14px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--dom-maint); border-radius: 12px; box-shadow: 0 3px 12px rgba(13, 36, 67, .08); }
.mx-hero.k-repair { border-top-color: var(--dom-lease); }
.mx-hero.is-closed { border-top-color: var(--st-done); }
.mx-h1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mx-h1 .grow { flex: 1; }
.mx-hid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center; }
.mx-kick { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dom-maint); }
.mx-hero.k-repair .mx-kick { color: var(--dom-lease); }
.mx-title { margin: 2px 0 5px; font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; color: var(--text); }
.mx-title:focus { outline: none; }
.mx-hmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.mx-ref.big { padding: 1px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-sunken); font-size: 12.5px; font-weight: 700; color: var(--text); }
.mx-copy { margin-left: -8px; font-size: 12px; }
.mx-hero .mw-axes { margin: 0; }
.mw-axes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mw-axis { display: grid; gap: 3px; align-content: start; min-width: 0; padding: 8px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 9px; }
.mw-axis .metric-label { display: inline-flex; gap: 5px; align-items: center; }
.mw-axis-main { font-size: 14.5px; font-weight: 750; color: var(--text); }
.mw-axis.t-danger { border-left-color: var(--danger); } .mw-axis.t-warning { border-left-color: var(--warning); } .mw-axis.t-success { border-left-color: var(--success); } .mw-axis.t-progress { border-left-color: var(--accent); }
.mx-h3 { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 15px; font-weight: 800; color: var(--text); }
.mx-h3 .cell-sub { font-weight: 500; }
.mx-h4 { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; font-weight: 800; color: var(--text); }
.mx-h4 .cell-sub { font-weight: 500; }
.mx-now { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.mx-do, .mx-wait { display: grid; gap: 10px; align-content: start; min-width: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.mx-do { border-left: 5px solid var(--st-prog); }
.mx-wait { border-left: 5px solid var(--st-wait); }
.mx-do .mx-h3 > .i { color: var(--st-prog); } .mx-wait .mx-h3 > .i { color: var(--st-wait); }
.mx-pri { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.btn.mx-big { height: 42px; padding: 0 18px; font-size: 15px; font-weight: 700; }
.mx-help { font-size: 12.5px; color: var(--text-2); }
.mx-acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mx-acts li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mx-do .btn, .mx-wo-a .btn, .mx-rows .btn, .mx-secacts .btn { max-width: 100%; height: auto; min-height: var(--btn-sm-h); white-space: normal; text-align: left; line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
.mx-do .btn.mx-big { min-height: 42px; }
.mx-elsewhere { display: flex; gap: 6px; align-items: center; margin: 0; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--text-3); }
.mx-none { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; color: var(--text-2); }
.mx-none > .i { flex: none; color: var(--success); }
.mx-wait .mx-none > .i { color: var(--st-wait); }
.mx-do .mx-none > .i.i-clock, .mx-do .mx-none > svg { color: var(--st-wait); }
.mx-wl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mx-wl li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 9px; background: var(--st-wait-bg); }
.mx-wl li > .i { margin-top: 2px; color: var(--st-wait); }
.mx-wl li.k-money { background: var(--review-bg); } .mx-wl li.k-money > .i { color: var(--review); }
.mx-wl li.k-blocker { background: var(--danger-bg); } .mx-wl li.k-blocker > .i { color: var(--danger); }
.mx-wl li.k-role { background: var(--surface-sunken); } .mx-wl li.k-role > .i { color: var(--text-3); }
.mx-wl li > div { display: grid; gap: 1px; min-width: 0; }
.mx-why { display: inline-flex; gap: 4px; align-items: baseline; margin-top: 2px; font-size: 11.5px; color: var(--text-3); }
.mx-why > .i { flex: none; align-self: center; }
.mx-who { max-width: 210px; font-size: 12px; font-weight: 700; color: var(--text); text-align: right; }
/* Sections: open where the work is, folded elsewhere — never a serial wizard */
.mx-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-jl { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--text-2); text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.mx-jl:hover { color: var(--text); border-color: var(--border-strong); }
.mx-jl:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mx-secs { display: grid; gap: 10px; }
.mx-sec { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-panel); scroll-margin-top: 12px; }
.mx-sec > summary { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 11px 14px; cursor: pointer; list-style: none; }
.mx-sec > summary::-webkit-details-marker { display: none; }
.mx-sec > summary > .i { color: var(--dom-maint); }
.mx-sec > summary > b { font-size: 14px; }
.mx-sec > summary .cell-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 160px; }
.mx-sec[open] > summary { border-bottom: 1px solid var(--border); }
.mx-sec[open] > summary .cell-sub { white-space: normal; }
.mx-sec > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 12px; }
.mx-sec > summary::after { content: "Show"; margin-left: auto; font-size: 12px; font-weight: 650; color: var(--accent); }
.mx-sec[open] > summary::after { content: "Hide"; }
.mx-secnow { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; color: var(--st-prog); background: var(--st-prog-bg); }
.mx-secn { padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-sunken); border: 1px solid var(--border); }
.mx-sec-b { display: grid; gap: 10px; padding: 12px 14px 14px; }
.mx-sec-b > .panel, .mx-sec-b > .block, .mx-sec-b .two-col { margin: 0; }
.mx-secacts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.mx-msum { margin: 0; font-size: 12.5px; color: var(--text-2); }
.mx-same > summary > .i { color: var(--text-3); }
.mx-sibs { list-style: none; margin: 0; padding: 10px 14px 14px; display: grid; gap: 6px; }
.mx-sibs li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-left: 4px solid var(--neutral-line); border-radius: 9px; }
.mx-sibs li > div { display: grid; gap: 2px; flex: 1 1 240px; min-width: 0; }
.mx-sibs li.t-act { border-left-color: var(--st-prog); } .mx-sibs li.t-wait { border-left-color: var(--st-wait); }
.mx-sib-n { display: flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 650; color: var(--st-prog); }
.mx-sibs li.t-wait .mx-sib-n { color: var(--warning-text); } .mx-sibs li.t-none .mx-sib-n { color: var(--text-3); }
.mx-wos, .mx-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.mx-wo { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(140px, .8fr) minmax(160px, 1fr) auto; gap: 6px 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--table-row-border); }
.mx-wo:first-child, .mx-rows li:first-child { border-top: 0; }
.mx-wo-main { display: grid; gap: 2px; min-width: 0; }
.mx-wo-t { font-weight: 700; }
.mx-wo-m { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--text-2); }
.mx-wo-st { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.mx-wo-x { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.mx-flag { display: inline-flex; gap: 5px; align-items: center; max-width: 100%; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--neutral-bg); color: var(--neutral-text); }
.mx-flag > span { white-space: normal; }
.mx-flag > .i { flex: none; }
.mx-flag.k-parts { background: var(--st-wait-bg); color: var(--warning-text); }
.mx-flag.k-money { background: var(--review-bg); color: var(--review-text); }
.mx-wo-a { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mx-rows li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--table-row-border); }
.mx-rows li > .i { flex: none; color: var(--text-3); }
.mx-rows li > div { display: grid; gap: 2px; flex: 1 1 200px; min-width: 0; }
.mx-ar { display: inline-flex; gap: 6px; align-items: center; }
.mx-restr { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.mx-restr li { display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 12.5px; color: var(--danger-text); }
.mx-restr li > .i { flex: none; align-self: center; }
.mx-restr .cell-sub { color: var(--text-2); }
.mx-vfacts { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mx-vfacts > div { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); font-size: 12.5px; }
.mx-vfacts dt { display: inline-flex; gap: 5px; align-items: center; font-weight: 700; color: var(--text); }
.mx-vfacts dt > .i { color: var(--text-3); }
.mx-vfacts dd { margin: 0; color: var(--text-2); }
.mx-vfacts > .done { background: var(--st-done-bg); border-color: var(--st-done-line); } .mx-vfacts > .done dt > .i { color: var(--st-done); }
@container mxsheet (max-width: 900px) {
  .mx-now { grid-template-columns: minmax(0, 1fr); }
  .mx-vfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mx-wo { grid-template-columns: minmax(0, 1fr) auto; }
  .mx-wo-st, .mx-wo-x { grid-column: 1 / -1; }
  .mx-wo-a { grid-column: 2; grid-row: 1; }
}
@container mxsheet (max-width: 640px) {
  .mx-hid, .mw-axes { grid-template-columns: minmax(0, 1fr); }
  .mw-axes { gap: 4px; }
  .mw-axis { grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 6px 10px; }
  .mw-axis .metric-label { grid-row: 1; } .mw-axis-main { grid-row: 1; font-size: 13.5px; } .mw-axis > .cell-sub { grid-column: 1 / -1; font-size: 12px; }
  .mx-hveh { justify-self: start; }
  .mx-title { font-size: 21px; }
  .mx-wo { grid-template-columns: minmax(0, 1fr); }
  .mx-wo-a { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .mx-wl li { grid-template-columns: 18px minmax(0, 1fr); }
  .mx-who { grid-column: 2; text-align: left; max-width: none; }
  .btn.mx-big { width: 100%; justify-content: center; }
  .mx-vfacts { grid-template-columns: minmax(0, 1fr); }
  .mx-sec > summary .cell-sub { flex-basis: 100%; order: 5; }
}
/* Inspections: drafts lead; the due list turns into cards when narrow */
.mx-drafts { display: grid; gap: 8px; margin: 0 0 12px; }
.mx-dlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.mx-draft { flex: 0 0 auto; display: grid; gap: 1px; min-width: 190px; padding: 9px 12px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--dom-insp); border-radius: 10px; }
.mx-draft:hover { background: var(--dom-insp-bg); }
.mx-draft b { font-size: 17px; }
.mx-draft-go { display: flex; gap: 5px; align-items: center; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--dom-insp); }
.mx-ictx { flex-wrap: wrap; gap: 8px 12px; }
.mx-itype { font-size: 13px; color: var(--text-2); } .mx-itype b { color: var(--dom-insp); }
.mx-iother { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.mx-ilist { min-width: 0; container: mxil / inline-size; }
.mx-ilist .vtable td:last-child { width: 1%; white-space: nowrap; }
.mx-lr-dl { display: none; }
@container mxil (max-width: 760px) {
  .mx-ilist .vtable { min-width: 0 !important; width: 100%; }
  .mx-ilist .vtable thead { display: none; }
  .mx-ilist .vtable tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--table-row-border); }
  .mx-ilist .vtable tbody td { display: block; height: auto; padding: 0; border: 0; min-width: 0 !important; white-space: normal; background: transparent !important; box-shadow: none !important; }
  .mx-ilist .vtable tbody tr:nth-child(even) { background: var(--table-stripe); }
  .mx-ilist .vtable tbody td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .mx-ilist .vtable tbody td:nth-child(2) { grid-column: 2; text-align: right; }
  .mx-ilist .vtable tbody td:nth-child(5) { grid-column: 2; justify-self: end; }
  .mx-ilist .vtable tbody td:nth-child(3), .mx-ilist .vtable tbody td:nth-child(6) { display: none; }
  /* A non-completing latest result must stay visible in card mode, labelled apart from the last completed cycle. */
  .mx-ilist .vtable tbody td:nth-child(3):has(.mx-lr) { display: block; grid-column: 1 / -1; font-size: 12.5px; }
  .mx-ilist .mx-lr-dl { display: inline; color: var(--text-2); }
  .mx-ilist .vtable tbody td:nth-child(4) { grid-column: 1; font-size: 12.5px; }
  .mx-ilist .vtable tbody td:nth-child(7) { grid-column: 1 / -1; justify-self: end; width: auto; }
  .mx-ilist .vtable tbody tr.empty-row { display: block; }
}
/* Width steps of the Work page (its own width: a tablet with the sidebar open behaves like a narrow screen) */
@container mx (max-width: 1020px) { .mx-lhead { display: none; } }
@container mx (max-width: 760px) {
  .mx-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mx-tile { padding: 7px 10px 8px; } .mx-tn { font-size: 21px; } .mx-tf { display: none; }
  .mx-find > .search { flex-basis: 100%; max-width: none; }
  .mx-find > .field { flex: 1 1 140px; } .mx-find .field .select { min-width: 0; width: 100%; }
  .mx-cond .cell-sub { display: none; }
}
@media (max-width: 560px) {
  .mx-hide-sm { display: none !important; }
  .mx-nav { gap: 6px; }
  .mx-switch { display: flex; flex-wrap: nowrap; width: 100%; } .mx-sw { flex: 1 1 0; min-width: 0; height: auto; min-height: 40px; flex-wrap: wrap; justify-content: center; row-gap: 1px; padding: 4px 8px; text-align: center; }
  .mx-swn { font-size: 10.5px; padding: 0 6px; }
  .mx-rec small { display: none; }
}

/* ---------- R5 · invoice evidence versions, spend, invoice entry reasons ---------- */
.inv-ev { margin-top: 10px; }
.inv-vers { margin-top: 8px; }
.inv-vers > summary { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.inv-vers .row-list li { flex-wrap: wrap; }
.mx-why { display: block; max-width: 40ch; white-space: normal; }
.pr-spend td:nth-child(2) { min-width: 220px; }
.pr-spend td:nth-child(5) { min-width: 150px; }
/* R5 · unit 2 · inspection photos with real bytes (this tab) */
.thumbs .thumb.has-img .th-photo { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-2, #f3f4f6); }
.thumbs .thumb { position: relative; }
.thumbs .thumb .icon-btn { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); }
.photo-grid img.ph { width: 100%; height: auto; max-height: 220px; object-fit: contain; }

/* ---------- R5 · unit 4 · responsive work UI (M07 · M08 · items 15–18) ---------- */
/* M07 · Invoice intake: the fields column is bounded (an implicit auto column let the candidates table size to its
   content and push inputs, checks and Save off-screen at 1024); two columns only where both fit beside the sidebar. */
.intake > * { min-width: 0; }
.intake-fields { grid-template-columns: minmax(0, 1fr); }
.intake-fields > * { grid-column: 1 / -1; min-width: 0; } /* a span-2 field must not create an implicit second track */
.intake-fields > .fld[class*="span"] { grid-column: 1 / -1; }
.cand-table { table-layout: fixed; }
.cand-table td .input, .cand-table td .select, .cand-table .with-unit { width: 100%; min-width: 0; }
.cand-table .cand { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.inv-paper { overflow-x: auto; }
.intake-fields .form-foot.slim { position: sticky; bottom: 0; z-index: 3; background: var(--surface); padding: 10px 0; border-top: 1px solid var(--border); }
@media (max-width: 1280px) {
  .intake { grid-template-columns: minmax(0, 1fr); }
  .intake-orig { position: static; max-height: 70vh; }
}
@media (max-width: 560px) {
  .cand-table thead { display: none; }
  .cand-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .cand-table tbody th, .cand-table tbody td { width: auto !important; padding: 0; border: 0; }
  .cand-table tbody th { grid-column: 1 / -1; }
  .intake-fields .line-table thead { display: none; }
  .intake-fields .line-table tbody tr { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .intake-fields .line-table tbody td { padding: 0; border: 0; }
  .intake-fields .line-table tbody td:nth-child(1) { grid-column: 1 / -1; }
  .intake-fields .line-table tbody td:nth-child(4)::before { content: "Amount "; color: var(--text-3); font-size: 11px; }
  .intake-fields .line-table tbody td:nth-child(5) { grid-column: 1 / -2; text-align: left; }
  .intake-fields .line-table tbody td:nth-child(5)::before { content: "Candidate "; color: var(--text-3); font-size: 11px; }
}
/* OCR line editor · follows the width the fields panel ACTUALLY has, not the viewport: beside the original at 1347 the panel
   is too narrow for six columns (description 70px, Qty 23px), so below 720px each line becomes a labelled card —
   description full width, then Qty · Unit $ · Amount, then the candidate. Same inputs, names and checks. */
.intake-fields { container: infields / inline-size; }
@container infields (max-width: 720px) {
  .intake-fields .line-table thead { display: none; }
  .intake-fields .line-table, .intake-fields .line-table tbody { display: block; }
  .intake-fields .line-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 34px; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .intake-fields .line-table tbody td { display: grid; gap: 2px; align-content: start; padding: 0; border: 0; text-align: left; min-width: 0; }
  .intake-fields .line-table tbody td::before { color: var(--text-2); font-size: 11px; }
  .intake-fields .line-table tbody td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .intake-fields .line-table tbody td:nth-child(1)::before { content: "Description"; }
  .intake-fields .line-table tbody td:nth-child(2)::before { content: "Qty"; }
  .intake-fields .line-table tbody td:nth-child(3)::before { content: "Unit $"; }
  .intake-fields .line-table tbody td:nth-child(4) { align-self: stretch; }
  .intake-fields .line-table tbody td:nth-child(4)::before { content: "Amount"; }
  .intake-fields .line-table tbody td:nth-child(5) { grid-column: 1 / -1; }
  .intake-fields .line-table tbody td:nth-child(5)::before { content: "Candidate on the original"; }
  .intake-fields .line-table tbody td:nth-child(6) { grid-column: 4; grid-row: 1; align-self: end; }
  .intake-fields .line-table tbody td:nth-child(6)::before { content: none; }
  .intake-fields .line-table .input, .intake-fields .line-table .w-num { width: 100%; min-width: 0; }
  .intake-fields .line-table td .cand { white-space: normal; }
}
@container infields (min-width: 721px) {
  .intake-fields .line-table th:nth-child(2), .intake-fields .line-table th:nth-child(3) { width: 120px; }
  .intake-fields .line-table th:nth-child(4) { width: 100px; }
  .intake-fields .line-table th:nth-child(6) { width: 44px; }
}
@container infields (max-width: 300px) {
  .intake-fields .line-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)) 34px; }
  .intake-fields .line-table tbody td:nth-child(1) { grid-column: 1 / 3; }
  .intake-fields .line-table tbody td:nth-child(4) { grid-column: 1 / -1; }
  .intake-fields .line-table tbody td:nth-child(6) { grid-column: 3; }
}
/* The Remove button is 34px; its card column is 34px so it ends inside the row (a 32px column let it run 2px past the form). */
.intake-fields .line-table tbody td:nth-child(6) .btn { max-width: 100%; }
/* Intake opened inside a desk / workspace pane: the pane's grid children kept min-width:auto, so the five-step stepper
   (5 × 96px minimum) widened the whole intake to ~514px inside a 358px pane at 390 and pushed the form, line table, Remove
   and Save past the pane's visible edge (the page itself did not overflow, so scrollWidth hid it). Children are bounded to
   the pane, and in a narrow pane the steps share its width and their labels wrap. */
.ws-pane > * { min-width: 0; }
@container wspane (max-width: 560px) { .ws-pane .stepper .st { min-width: 0; padding: 0 2px; } }
/* M08 · Inspection on a tablet (767 portrait with the sidebar, 1024 landscape): identity wraps instead of overlapping,
   section names wrap instead of clipping, three input columns become two, and a hidden helper field stays hidden. */
.insp-form .fixed-val, .page-form .fixed-val { height: auto; min-height: var(--control-h); flex-wrap: wrap; row-gap: 2px; padding: 6px 10px; }
.insp-form .fixed-val .vin, .page-form .fixed-val .vin { white-space: normal; flex-wrap: wrap; }
.fld.odo-note[hidden] { display: none; }
@media (max-width: 1100px) {
  .insp-form .sec-jump { flex-wrap: wrap; overflow-x: visible; }
  .insp-form .form-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insp-form .sec-head { flex-wrap: wrap; }
}
/* Item 17 · Work-order lines on a phone: one line per card — description full width, then Type · Qty · Unit $. */
@media (max-width: 560px) {
  .page-form .line-table thead { display: none; }
  .page-form .line-table tbody tr { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr) 32px; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .page-form .line-table tbody td { padding: 0; border: 0; }
  .page-form .line-table tbody td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .page-form .line-table tbody td:nth-child(1) { grid-row: 2; grid-column: 1; }
  .page-form .line-table tbody td:nth-child(3) { grid-row: 2; grid-column: 2; }
  .page-form .line-table tbody td:nth-child(4) { grid-row: 2; grid-column: 3; }
  .page-form .line-table tbody td:nth-child(6) { grid-row: 2; grid-column: 4; }
  .page-form .line-table tbody td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; text-align: right; }
  .page-form .line-table tbody td:nth-child(5)::before { content: "Amount "; color: var(--text-3); font-size: 11px; }
  .page-form .line-table tfoot td[colspan] { display: none; }
  .page-form .line-table tfoot tr { display: flex; justify-content: flex-end; gap: 8px; }
  .page-form .line-table tfoot td:not([colspan]):not(:last-child)::before { content: "Estimate "; font-weight: 600; }
  .page-form .line-table tbody td:nth-child(1)::before, .page-form .line-table tbody td:nth-child(3)::before, .page-form .line-table tbody td:nth-child(4)::before { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
  .page-form .line-table tbody td:nth-child(1)::before { content: "Type"; }
  .page-form .line-table tbody td:nth-child(3)::before { content: "Qty"; }
  .page-form .line-table tbody td:nth-child(4)::before { content: "Unit $"; }
  .page-form .line-table tbody td:nth-child(6) { align-self: end; }
}
/* Items 15–16 · Job sheet: Current work is as wide as its content (no large empty box beside the waits), both boxes keep
   their own height, waits are compact rows; the open / current work section reads as selected (icon tile, accent rule,
   tinted header). Data, actions and permissions are unchanged — only their presentation. */
.mx-now { grid-template-columns: fit-content(48%) minmax(0, 1fr); align-items: start; }
.mx-now > :only-child { grid-column: 1 / -1; }
.mx-do, .mx-wait { gap: 8px; padding: 10px 12px; }
.mx-wl li { padding: 6px 10px; }
.mx-sec > summary > .mx-secic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-sunken); color: var(--dom-maint); flex: none; }
.mx-sec[open] { border-left: 4px solid var(--dom-maint); }
.mx-sec[open] > summary { background: var(--surface-sunken); border-radius: 11px 11px 0 0; }
.mx-sec.is-current { border-left-color: var(--st-prog); box-shadow: 0 0 0 1px var(--st-prog-bg), var(--shadow-panel); }
.mx-sec.is-current > summary { background: var(--st-prog-bg); }
.mx-sec.is-current > summary > .mx-secic { background: var(--surface); color: var(--st-prog); }
@media (max-width: 900px) { .mx-now { grid-template-columns: minmax(0, 1fr); } }
.intake-fields .line-table .cand { white-space: nowrap; }
/* M08 · Print preview on a tablet: the Letter sheet (8.5 in) is scaled on SCREEN to the space beside the sidebar instead
   of being clipped on both sides; the printed page is unchanged (print media keeps 8.5 in). */
@media screen {
  .sheets { container-type: inline-size; justify-content: safe center; }
  @container (max-width: 860px) { .sheets > .sheet { zoom: .88; } }
  @container (max-width: 760px) { .sheets > .sheet { zoom: .76; } }
  @container (max-width: 660px) { .sheets > .sheet { zoom: .64; } }
  @container (max-width: 560px) { .sheets > .sheet { zoom: .56; } }
}
.mx-bizno { font-size: 11.5px; color: var(--text-3); padding: 1px 8px; border: 1px dashed var(--border-strong); border-radius: 999px; }
/* R5 · next batch · inline required-field errors (M06 submit / confirm), photo failure reason, review queue */
.fld.has-err .fld-label { color: var(--danger); }
.fld-err { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--danger); }
.sec-err { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 12.5px; font-weight: 600; }
.th-err { display: block; color: var(--danger); white-space: normal; }
.mx-review { border-left: 4px solid var(--review, var(--st-wait)); }

/* R6-03 · in-page original viewer (PDF pages drawn from the file, images at their size) */
.fv-wrap { display: grid; gap: 10px; }
.fv-pages { display: grid; gap: 12px; justify-items: center; }
.fv-pages .pdf-page { width: 100%; max-width: 760px; height: auto; border: 1px solid var(--line, #d6dbe3); box-shadow: 0 1px 3px rgba(0,0,0,.08); background: #fff; }
.fv-img { max-width: 100%; height: auto; border: 1px solid var(--line, #d6dbe3); image-rendering: auto; min-width: 160px; }
.fv-frame { width: 100%; height: 70vh; border: 1px solid var(--line, #d6dbe3); }
.fv-native summary { cursor: pointer; font-size: 13px; color: var(--muted, #5b6472); }
.doc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.doc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.file-chip.is-bad { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.danger-text { color: var(--danger, #c0392b); }

/* R6-09 · confirmed 30 Day walk-around at tablet widths: the finding text keeps the width of its block — the figure
 * stacks above the list when the block is narrow, and each finding's actions sit under its text (not beside it). */
.blk-body:has(> .walk.view) { container-type: inline-size; }
@container (max-width: 820px) {
  .walk.view { grid-template-columns: 1fr; }
  .walk.view .walk-diagram { position: static; max-width: 280px; }
}
.finding-view li { grid-template-columns: auto minmax(0, 1fr); }
.finding-view li > .fd-act { grid-column: 2; justify-content: flex-start; }
.finding-view li > div:not(.fd-act) { overflow-wrap: anywhere; }
#sec-walk { container-type: inline-size; }
@container (max-width: 900px) {
  #sec-walk .walk { grid-template-columns: 1fr; }
  #sec-walk .walk-diagram { position: static; max-width: 320px; }
}

/* R6 · RF02 · narrow screens: a form footer's state line, secondary and primary actions never run past the edge. The
 * footer wraps (shared .form-foot contract): the state takes its own line, the actions share the next line and each
 * action wraps to its own line when they do not fit — full labels, same buttons, same order. */
.form-foot { flex-wrap: wrap; }
@media (max-width: 600px) {
  .form-foot > .ff-state, .form-foot > .cell-sub { flex: 1 1 100%; }
  .form-foot > .grow { display: none; }
  .form-foot > .btn, .form-foot > a.btn { flex: 1 1 auto; justify-content: center; }
}

/* ======================= Maintenance R7 · one workspace =======================
 * Top summary / find / conditions; left = case list with its OWN scroll (sticky); right = the selected case. Narrow
 * widths (< 900px): list OR pane, with a "Case list" button that returns to the same list position. */
.ws { display: grid; gap: 10px; min-width: 0; }
.ws-top { display: grid; gap: 8px; }
.ws-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ws-fig { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.ws-fig .ws-fl { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); }
.ws-fig b { font-size: 22px; line-height: 1.15; }
.ws-fig .ws-fu { color: var(--text-2); font-size: 13px; }
.ws-fig .ws-fs { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }
.ws-fig.t-danger b { color: var(--danger-text); }
.ws-find { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ws-find > .search { flex: 1 1 260px; min-width: 200px; }
.ws-cond { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.ws-split { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; }
.ws-list { position: sticky; top: 8px; max-height: calc(100dvh - 150px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.ws-rows { list-style: none; margin: 0; padding: 0; }
.ws-grp { position: sticky; top: 0; z-index: 1; display: flex; gap: 6px; align-items: center; padding: 6px 12px; font-weight: 600; font-size: 12px; background: var(--surface-sunken); border-top: 1px solid var(--border); }
.ws-row { border-top: 1px solid var(--border); }
.ws-row:first-child { border-top: 0; }
.ws-ra { display: grid; gap: 3px; padding: 9px 12px 9px 14px; color: inherit; text-decoration: none; position: relative; }
.ws-ra::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 3px 3px 0; background: transparent; }
.ws-row.k-repair .ws-ra::before { background: var(--warning-line); }
.ws-row.k-service .ws-ra::before { background: var(--st-todo-line); }
.ws-ra:hover { background: var(--surface-sunken); }
.ws-ra:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus-ring); }
.ws-row.is-sel .ws-ra { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }
.ws-row.is-closed .ws-rn { color: var(--text-2); }
.ws-rt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-code { font-size: 15px; }
.ws-rn { font-weight: 600; overflow-wrap: anywhere; }
.ws-rs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-2); align-items: center; }
.ws-rx { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--text-2); }
.ws-rx.t-act { color: var(--accent); font-weight: 600; }
.ws-rx svg, .ws-rt svg { width: 14px; height: 14px; flex: none; }
.ws-pane { min-width: 0; display: grid; gap: 10px; align-content: start; }
.ws-back { display: none; justify-self: start; }
.ws-none { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 40px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-panel); color: var(--text-2); }
.ws-none.small { padding: 18px; }
.ws-none.is-out { border-style: solid; background: var(--warning-bg); color: var(--text); }
.ws-ctx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); border-top: 4px solid var(--dom-maint); }
.ws-ctx.k-repair { border-top-color: var(--warning); }
.ws-ctx.is-closed { border-top-color: var(--st-na); }
.ws-ch { min-width: 0; grid-column: 1; }
.ws-cv { grid-column: 2; grid-row: 1 / span 2; }
.ws-title { margin: 2px 0 4px; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ws-cs { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; }
.ws-steps { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 8px; border-top: 1px solid var(--border); }
.ws-step { display: grid; gap: 2px; max-width: 360px; }
.ws-step small { color: var(--text-3); font-size: 12px; }
.ws-outnote { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--warning-text); display: flex; gap: 4px; align-items: center; }
.ws-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 10px; align-items: start; container: wsbody / inline-size; }
.ws-main { display: grid; gap: 10px; min-width: 0; }
.ws-jobs { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); padding: 8px 10px; }
.ws-jh { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.ws-jl { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.ws-j a { display: grid; gap: 4px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; height: 100%; box-sizing: border-box; }
.ws-j a:hover { border-color: var(--border-strong); }
.ws-j a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--focus-ring); }
.ws-j.is-sel a { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 3px 0 var(--accent); }
.ws-j.is-cancel a { opacity: .7; }
.ws-j.is-cancel .ws-jt { text-decoration: line-through; }
.ws-jt { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.ws-jm { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.ws-job { min-width: 0; }
.ws-jobcard { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--r-panel); background: var(--surface); }
.ws-jobcard.is-cancel { border-color: var(--border-strong); }
.ws-jch { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: start; }
.ws-jtitle { margin: 2px 0; font-size: 17px; overflow-wrap: anywhere; }
.ws-jst { display: grid; gap: 2px; justify-items: end; }
.ws-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-h { margin: 6px 0 0; font-size: 13px; display: flex; gap: 6px; align-items: center; color: var(--text-2); }
.ws-h svg { width: 15px; height: 15px; }
.ws-ccc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.ws-ccc dt { font-size: 12px; color: var(--text-3); }
.ws-ccc dd { margin: 0; overflow-wrap: anywhere; }
.ws-na { display: flex; gap: 6px; align-items: flex-start; margin: 0; color: var(--text-2); font-size: 13px; }
.ws-na svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ws-vi { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.ws-vih { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ws-vit { width: 100%; border-collapse: collapse; font-size: 13px; }
.ws-vit th, .ws-vit td { padding: 4px 6px; border-top: 1px solid var(--border); text-align: left; }
.ws-vit .c-num { text-align: right; white-space: nowrap; }
.ws-vit tr.is-here td { background: var(--accent-tint); }
.ws-vit tr.is-warn td { color: var(--warning-text); font-weight: 600; }
.ws-side { display: grid; gap: 10px; min-width: 0; }
.ws-sec { border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); padding: 8px 10px; min-width: 0; }
.ws-sec .mx-vfacts { margin: 4px 0; }
.ws-hist summary { cursor: pointer; font-weight: 600; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.ws-tl { max-height: 320px; overflow: auto; }
.line-table.compact td { padding: 3px 6px; font-size: 13px; }
.page-form.in-pane { margin: 0; }
.ws-linkinfo:empty { display: none; }
@container wsbody (max-width: 760px) { .ws-ccc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1279px) { .ws-body { grid-template-columns: minmax(0, 1fr); } .ws-side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
@media (max-width: 1099px) { .ws-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-split { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); } }
@media (max-width: 899px) {
  .ws-split { grid-template-columns: minmax(0, 1fr); }
  .ws-list { position: static; max-height: none; overflow: visible; }
  .ws.has-sel .ws-list, .ws.has-sel .ws-top { display: none; }
  .ws:not(.has-sel) .ws-pane { display: none; }
  .ws-back { display: inline-flex; }
  .ws-ctx { grid-template-columns: minmax(0, 1fr); }
  .ws-cv { grid-column: 1; grid-row: auto; }
  .ws-side { grid-template-columns: minmax(0, 1fr); }
  .ws-jl { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) { .ws-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .ws-fig b { font-size: 18px; } .ws-step { max-width: none; } }
.ws-side .mx-vfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-list { scroll-padding: 8px; }
/* R7 · where a candidate is on the original (page · line · position · OCR confidence); a low-confidence value is marked */
.cand-at { display: block; margin-top: 2px; font-size: 11px; color: var(--text-2); overflow-wrap: anywhere; }
.cand-at.low { color: var(--warning-text); font-weight: 600; }
/* R7 · CONTRACT_REVIEW 7 · a failed photo's reason wraps under Retry / Replace inside its card (it was clipped at the right edge) */
.thumb .th-state { flex-wrap: wrap; row-gap: 2px; }
.thumb .th-err { flex: 1 0 100%; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
/* R7 · a form open in the pane uses its full width; case-common sections follow below */
.ws-body.is-form { grid-template-columns: minmax(0, 1fr); }
.ws-body.is-form .ws-side { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* R7 · the value a person saves is shown whole (a corrected vendor name is not cut to its first words) */
.cand-table:not(.totals) td:nth-child(3) > .input, .cand-table:not(.totals) td:nth-child(3) > .select { width: 100%; min-width: 0; }
/* Correction 1 · a fixed value shown in a form (source, invoice identity of a source-bound request) */
.input-static { padding: 7px 10px; border: 1px dashed var(--border); border-radius: 6px; background: var(--surface-2, #f6f7f9); font-size: 13px; overflow-wrap: anywhere; }
.line-table tr.is-warn td { background: var(--warning-bg); }
/* Correction 1 · a request's line table never widens the page on a narrow screen: it scrolls inside its own panel */
.blk-body:has(> .line-table.view) { overflow-x: auto; }
/* TECH3 · manual-review note read back as saved (exact text, version, who / when, truck basis); card / requisition invoice originals */
.rv-note { display: grid; gap: 2px; margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--border-strong, var(--border)); background: var(--surface-sunken); border-radius: 0 6px 6px 0; min-width: 0; }
.rv-note .rv-k { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.rv-note .rv-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pr-invdoc { display: block; overflow-wrap: anywhere; }
.pr-invdoc .file-ctl, .pr-invdoc .file-chip { white-space: normal; }
.cc-inv { white-space: normal; min-width: 240px; max-width: 320px; overflow-wrap: anywhere; }
.cc-inv .file-chip, .pr-invdoc .file-chip { max-width: 100%; height: auto; min-height: 26px; padding-block: 3px; overflow-wrap: anywhere; }
/* ===== R8 · maintenance areas, case-common band, new-maintenance form, summary filters (writer 43b83df4) ===== */
/* item 1 · a job's areas: each a bordered, lightly shaded section with an icon, a bold title, when it is used, and its own actions */
.ws-body { grid-template-columns: minmax(0, 1fr); }
.ws-body.is-form { grid-template-columns: minmax(0, 1fr); }
.ws-jobcard { gap: 10px; padding: 12px 14px 14px; border: 1px solid var(--border-strong); border-top: 4px solid var(--accent); }
.ws-jch { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ws-jsec { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-area { border: 1px solid var(--border); border-left: 4px solid var(--dom-maint); border-radius: 8px; background: var(--surface-sunken); min-width: 0; }
.ws-area.a-record { border-left-color: var(--dom-insp); }
.ws-area.a-parts { border-left-color: var(--dom-fleet); }
.ws-area.a-lines { border-left-color: var(--neutral-line); }
.ws-area.a-invoice { border-left-color: var(--success-line); }
.ws-ah { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface); border-radius: 0 7px 0 0; }
.ws-ah h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.ws-ah small { color: var(--text-2); font-size: 12px; flex: 1 1 220px; min-width: 0; }
.ws-aic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--dom-maint-bg); color: var(--dom-maint); flex: none; }
.ws-area.a-record .ws-aic { background: var(--dom-insp-bg); color: var(--dom-insp); }
.ws-area.a-parts .ws-aic { background: var(--dom-fleet-bg); color: var(--dom-fleet); }
.ws-area.a-lines .ws-aic { background: var(--neutral-bg); color: var(--neutral-text); }
.ws-area.a-invoice .ws-aic { background: var(--success-bg); color: var(--success-text); }
.ws-aic svg { width: 15px; height: 15px; }
.ws-aacts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.ws-ab { padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.ws-ab > .form-grid { margin: 0; }
.ws-jobfacts { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; }
.ws-jsteps { display: inline-flex; gap: 8px; align-items: center; }
.ws-ccc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ws-done { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin: 0; padding-top: 8px; border-top: 1px dashed var(--border-strong); }
.ws-done dt { font-size: 12px; color: var(--text-3); }
.ws-done dd { margin: 0; overflow-wrap: anywhere; }
.ws-parts li { align-items: start; }
.ws-racts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ws-stockinfo:empty, .pr-stockinfo:empty { display: none; }
@container wsbody (max-width: 640px) { .ws-ccc, .ws-done { grid-template-columns: minmax(0, 1fr); } }
/* item 1 · case header: state, truck and NOW on top */
.ws-now { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--accent-tint); border: 1px solid var(--accent); }
.ws-now.is-wait { background: var(--surface-sunken); border-color: var(--border); }
.ws-now-k { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.ws-now small { color: var(--text-2); font-size: 12px; flex: 1 1 240px; }
.ws-now svg { width: 15px; height: 15px; }
.mx-num { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px; border: 1px dashed var(--border-strong); border-radius: var(--r-pill); font-size: 12px; color: var(--text-2); }
.mx-num-k { font-weight: 650; color: var(--text); }
.mx-rid { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--text-3); }
/* item 6 · the case-common band: one labelled place below the job, same in view and edit */
.ws-common { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border-strong); border-radius: var(--r-panel); background: var(--canvas); min-width: 0; }
.ws-ch3 { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 15px; }
.ws-ch3 small { font-weight: 400; color: var(--text-2); font-size: 12px; }
.ws-ch3 svg { width: 16px; height: 16px; }
.ws-cgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; align-items: start; }
.ws-cgrid > .ws-hist { grid-column: 1 / -1; }
.ws-src { margin: 2px 0 6px; font-size: 12px; color: var(--text-3); }
.ws-sec .ws-h { margin-top: 0; color: var(--text); font-size: 14px; }
.ws-kv { display: grid; gap: 4px; margin: 0 0 6px; }
.ws-kv > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-kv dt { min-width: 52px; font-size: 12px; color: var(--text-3); }
.ws-kv dd { margin: 0; }
.mx-rlist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.mx-rlist li { display: flex; gap: 6px; align-items: start; padding: 6px 8px; border-radius: 6px; background: var(--danger-bg); }
.mx-rlist li.is-done { background: var(--surface-sunken); color: var(--text-2); }
.mx-rlist li > div { display: grid; gap: 1px; min-width: 0; }
.mx-rlist svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
/* item 10 · summary figures that filter the list */
.ws-tile { --tc: var(--dom-maint); --tb: var(--dom-maint-bg); display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; row-gap: 1px; min-width: 0; padding: 8px 12px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tc); border-radius: var(--r-panel); cursor: pointer; }
.ws-tile.t-danger { --tc: var(--danger); --tb: var(--danger-bg); }
.ws-tile.t-warn { --tc: var(--warning); --tb: var(--warning-bg); }
.ws-tile.t-money { --tc: var(--success); --tb: var(--success-bg); }
.ws-tile:hover { background: var(--tb); }
.ws-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ws-tile[aria-pressed="true"] { background: var(--tb); box-shadow: inset 0 0 0 2px var(--tc); }
.ws-tic { grid-row: 1 / span 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--tb); color: var(--tc); }
.ws-tic svg { width: 18px; height: 18px; }
.ws-tl { font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.ws-tv { font-size: 13px; color: var(--text-2); }
.ws-tv b { font-size: 22px; line-height: 1.1; color: var(--text); }
.ws-tile.t-danger:not(.is-zero) .ws-tv b { color: var(--danger-text); }
.ws-tile.is-zero .ws-tv b { color: var(--text-3); }
.ws-tf { font-size: 12px; color: var(--text-3); display: inline-flex; gap: 4px; align-items: center; }
.ws-tile[aria-pressed="true"] .ws-tf { color: var(--text); font-weight: 600; }
.ws-tf svg { width: 13px; height: 13px; }
/* item 10 · More filters sit right of the search box and take height only while open (a popover) */
.ws-find { align-items: end; }
.ws-find .ws-more { flex: 0 0 auto; position: relative; align-self: end; }
.ws-find .ws-more > summary { height: var(--control-h, 36px); padding: 0 12px; border: 1px solid var(--control-border, var(--border)); border-radius: var(--r-control, 6px); background: var(--surface); }
.ws-find .ws-more[open] > .mx-mf { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(620px, calc(100vw - 32px)); display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); }
.ws-grp { justify-content: flex-start; }
.ws-grp .grow { flex: 1; }
/* item 2 / 8 · New maintenance */
.nw-form { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-panel); background: var(--surface); }
.nw-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 6px 0 0; font-size: 15px; }
.nw-h small { font-weight: 400; color: var(--text-2); font-size: 12px; }
.nw-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.nw-why { margin: 0; font-size: 13px; }
.nw-opts { display: grid; gap: 6px; }
.nw-where { align-items: start; }
.nw-where.is-on { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.nw-where small { display: block; }
.nw-jobs { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.nw-truck { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nw-src { display: grid; gap: 4px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-sunken); }
/* item 11 · same inspection cycle shown on the due list */
.mx-cyc { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; font-size: 12px; white-space: nowrap; }
.mx-cyc svg { width: 13px; height: 13px; }
.insp-cycle-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
@media (max-width: 899px) { .ws-cgrid { grid-template-columns: minmax(0, 1fr); } .ws-ah small { flex-basis: 100%; } .ws-aacts { margin-left: 0; } .ws-ccc, .ws-done { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1099px) { .ws-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ws-tile { padding: 6px 8px; } .ws-tic { width: 28px; height: 28px; } .ws-tv b { font-size: 18px; } .ws-find .ws-more { flex: 1 1 100%; } .ws-find .ws-more > summary { width: 100%; } }
.ws-list { scroll-padding-top: 34px; }
.ws-grp { box-shadow: 0 1px 0 var(--border); }
/* R8 · item 10 · the title keeps its words whole; the figures next to it wrap below instead of overlapping it */
.page-head { flex-wrap: wrap; row-gap: 4px; }
.page-head .ph-text { min-width: min-content; }
.page-head .page-meta { min-width: 0; flex: 0 1 auto; }

/* ===== R9 · plan A · Maintenance entry (truck-grouped list · header with short facts · full-width details) ===== */
.ws-rows, .ws-gl { list-style: none; margin: 0; padding: 0; }
.ws-g + .ws-g { border-top: 6px solid var(--canvas); }
.ws-grp { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 7px 12px; font-weight: 400; font-size: 13px; background: var(--surface-sunken); border-top: 0; }
.ws-gcode { display: inline-flex; gap: 5px; align-items: center; }
.ws-gcode b { font-size: 16px; letter-spacing: .01em; }
.ws-gcode svg { width: 16px; height: 16px; color: var(--text-2); }
.ws-gn { font-size: 12px; color: var(--text-2); }
.ws-gn b { color: var(--text); }
.ws-gl > .ws-row { border-top: 1px solid var(--border); }
.ws-rn { font-size: 14px; line-height: 1.3; }
.ws-rs { gap: 2px 10px; }
.ws-rstep { font-weight: 600; color: var(--text); }
.ws-rhold { display: inline-flex; gap: 3px; align-items: center; color: var(--danger); font-weight: 600; }
.ws-rhold svg { width: 12px; height: 12px; }
.ws-rclosed { color: var(--warning-text); font-weight: 600; }
.ws-rx.t-wait { color: var(--warning-text); }
.ws-rx.t-money { color: var(--text-2); }
.ws-none.is-filter { border-style: solid; border-color: var(--accent); background: var(--accent-tint); }

.ws-pane { container: wspane / inline-size; }
.ws-ctx { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ws-ch { display: grid; gap: 6px; align-content: start; }
.ws-idl { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ws-truck { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-sunken); color: var(--text); font: inherit; cursor: pointer; }
.ws-truck b { font-size: 20px; line-height: 1.1; }
.ws-truck svg { width: 18px; height: 18px; color: var(--text-2); }
.ws-truck:hover { border-color: var(--accent); }
.ws-truck:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ws-ch .ws-title { margin: 0; font-size: 22px; line-height: 1.2; }
.ws-stepl { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 0; font-size: 14px; color: var(--text-2); }
.ws-stepl b { color: var(--text); font-size: 15px; }
.ws-ch .ws-now { grid-column: auto; }

.ws-facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; min-width: 0; }
.ws-f { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 16px; grid-template-areas: "ic k a ch" "ic v v ch"; gap: 0 8px; align-items: center; width: 100%; padding: 6px 8px 6px 10px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 8px; cursor: pointer; min-width: 0; }
.ws-f:hover { background: var(--surface-sunken); }
.ws-f:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.ws-f.is-on { background: var(--accent-tint); border-color: var(--accent); }
.ws-f.t-danger { border-left-color: var(--danger); }
.ws-f.t-wait { border-left-color: var(--warning); }
.ws-f.t-money { border-left-color: var(--warning-line); }
.ws-f.t-progress, .ws-f.t-info { border-left-color: var(--accent); }
.ws-f.t-ok { border-left-color: var(--success); }
.ws-fic { grid-area: ic; display: inline-flex; color: var(--text-2); }
.ws-fic svg { width: 16px; height: 16px; }
.ws-f.t-danger .ws-fic { color: var(--danger); }
.ws-fk { grid-area: k; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.ws-fv { grid-area: v; display: grid; min-width: 0; }
.ws-fv b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.ws-fv small { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.ws-f.t-danger .ws-fv b { color: var(--danger); }
.ws-fa { grid-area: a; font-size: 11px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.ws-fchev { grid-area: ch; display: inline-flex; color: var(--text-2); transition: transform .15s; }
.ws-fchev svg { width: 14px; height: 14px; }
.ws-f.is-on .ws-fchev { transform: rotate(180deg); }

.ws-fdet { display: grid; gap: 8px; min-width: 0; }
.ws-fd { padding: 10px 12px; border: 1px solid var(--accent); border-radius: var(--r-panel); background: var(--surface); min-width: 0; }
.ws-fdh { display: flex; gap: 8px; align-items: center; margin: -2px 0 6px; }
.ws-fdh h4 { margin: 0; font-size: 15px; }
.ws-fdh svg { width: 16px; height: 16px; }
.ws-fd .ws-src { margin: 0 0 6px; font-size: 12px; color: var(--text-2); }
.ws-fd .mx-rlist, .ws-fd .mx-wl, .ws-fd .mx-money { margin: 4px 0; }
.ws-fd .ws-acts { margin-top: 8px; }
.ws-body { grid-template-columns: minmax(0, 1fr); }
.ws-hist > summary .cell-sub { margin-left: 6px; }
.ws-hist .mx-hmeta { margin: 8px 0; }

/* wide pane: facts beside the header (short status column); narrower: short rows under it, two per line when there is room */
@container wspane (min-width: 620px) {
  .ws-ctx { grid-template-columns: minmax(0, 1fr) minmax(228px, 36%); align-items: start; }
  .ws-ctx > .ws-outnote { grid-column: 1 / -1; }
}
@container wspane (min-width: 480px) and (max-width: 619.98px) {
  .ws-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) { .ws-grp { position: static; } }
.ws-part > div { display: grid; gap: 2px; min-width: 0; }
.ws-pt { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ws-eta { font-size: 13px; }
.ws-eta.muted { color: var(--text-2); }
/* R9 · MICRO02-F01 · wide report sheet: landscape page, columns kept inside it */
.sheet.report .sh-table { table-layout: auto; }
.sheet.report .sh-table th, .sheet.report .sh-table td { overflow-wrap: break-word; }
.sheet.report .nb { white-space: nowrap; }
.sheet.report .rid { display: block; min-width: 64px; overflow-wrap: anywhere; }
/* R44 · many columns: every record is a block of labelled cells at reading size (same table, same cells, same order) */
.sheet.report.dense .sh-table, .sheet.report.dense .sh-table tbody { display: block; border: 0; }
.sheet.report.dense .sh-table thead { display: none; }
.sheet.report.dense .sh-table tr { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid #8fa0b0; margin-bottom: 8px; break-inside: avoid; }
.sheet.report.dense .sh-table td { border: 0; border-right: 1px solid #d9e0e7; border-bottom: 1px solid #d9e0e7; min-width: 0; overflow-wrap: anywhere; }
.sheet.report.dense .sh-table td::before { content: attr(data-l); display: block; font-size: 8.5px; color: #51606e; }
.sheet.report.wide { width: 11in; }
.sheet.report.wide .sh-table { font-size: 10px; }
.sheet.report.wide .sh-table th, .sheet.report.wide .sh-table td { padding: 4px 4px; }
@media print { .sheet.report.wide { page: report-wide; width: auto; } }
@page report-wide { size: letter landscape; margin: .4in; }

/* ---------- Chassis Swap (Vehicles › Truck Swap with the Chassis equipment selected) ---------- */
.sw-eqbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; }
.sw-eqbar .segmented button { height: 32px; padding: 0 16px; font-weight: 600; }
.ch-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin: 0; }
.ch-facts > div { min-width: 0; }
.ch-facts dt { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ch-facts dd { margin: 1px 0 0; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.mv-kind { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); line-height: 1.25; }
.mv-list.is-compact { gap: 2px; }
.mv-list.is-compact .mv-hit { padding: 4px 8px; }
.mv-start { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 4px 8px; font-size: 12.5px; color: var(--text-2); border-left: 2px dashed var(--border); margin-left: 8px; }
.mv-start .mv-date { font-size: 12px; }
.sw-first { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); }
.sw-first > svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.ch-scope { display: flex; gap: 6px; align-items: flex-start; }
.is-chassis .sw9-tools .field .select { min-width: 0; }
@media (max-width: 760px) {
  .is-chassis .sw9-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .is-chassis .sw9-tools .search, .is-chassis .sw9-tools .mv-morefil { grid-column: 1 / -1; }
  .is-chassis .sw9-tools .grow { display: none; }
  .is-chassis .sw9-tools .field .select { width: 100%; }
}
@media (max-width: 480px) {
  .ch-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sw-eqbar .segmented { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
}
/* Chassis timeline: the kind of change sits under the date and may wrap; it never runs into the "before" block. */
.is-chassis .sw9-journey .mv-hit { grid-template-columns: 118px minmax(0, 340px) 30px minmax(0, 340px) 84px 20px; }
.is-chassis .mv-date { white-space: normal; min-width: 0; }
.is-chassis .mv-kind { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .is-chassis .sw9-journey .mv-hit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); }
  .is-chassis .mv-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  .is-chassis .sw9-tools .mv-morefil { grid-column: auto; align-self: end; padding-bottom: 8px; }
  .is-chassis .sw9-tools .mv-morefil[open] { grid-column: 1 / -1; }
  .is-chassis .sw9-tools > .btn { grid-column: 1 / -1; justify-self: end; margin-top: -4px; }
  .is-chassis.has-sel .sw9-list .table-wrap.dt { max-height: min(196px, 30dvh); }
}

/* Chassis pair correction: Chassis number (Chassis Code) shown with its VIN + Unit No pair everywhere. */
.ch-pair { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; font-size: 12.5px; min-width: 0; }
.ch-pair > span { display: inline-flex; gap: 5px; align-items: baseline; min-width: 0; }
.ch-pair small { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ch-pair b { font-weight: 700; overflow-wrap: anywhere; }
.ch-id h2 .ch-k { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); line-height: 1.1; }
.ch-id .mv-id-main { flex-wrap: wrap; row-gap: 6px; }
.sw-idcard .sw-idpair.is-bad { border-radius: 6px; outline: 2px solid var(--danger, #c0392b); outline-offset: 2px; background: color-mix(in srgb, var(--danger, #c0392b) 7%, transparent); }
.sw-idcard .sw-idbad { display: flex; gap: 4px; align-items: flex-start; font-size: 12px; font-weight: 600; color: var(--danger, #c0392b); }
.sw-idcard .sw-idbad svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.sw-revid { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 0 0 8px; font-size: 13px; }
.sw-revid > small { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.sw-errlist { margin: 6px 0; padding-left: 18px; }
.sw-facts .ch-pair { display: flex; }
/* Form review: the yard names (incl. “Yard not recorded”) wrap instead of being clipped on narrow screens. */
.mv-review .mv-yard > span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.mv-review .mv-blk { height: auto; min-height: 56px; }
.sw-idcard .sw-idpair.is-bad { padding: 4px 6px; }
.drawer-error [data-ch-repair], .drawer-error [data-ch-reload] { white-space: normal; max-width: 100%; height: auto; min-height: 30px; text-align: left; }
.is-chassis .sw9-journey .mv-date, .mv-review .mv-date { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.is-chassis .sw9-journey .mv-kind, .mv-review .mv-kind { margin: 0; white-space: normal; }

/* ---------- SWAP-FLEET-LAYOUT · Truck / Chassis Swap on the Fleet Status frame (.acc-entry.f360.swf) ---------- */
.acc-entry.f360.swf .swf-tools { gap: 8px; }
.acc-entry.f360.swf .swf-tools .seg { flex: none; }
.acc-entry.f360.swf .swf-show { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.acc-entry.f360.swf .swf-show .field-label { margin: 0; }
.acc-entry.f360.swf .swf-show .select { height: 30px; min-width: 130px; }
.acc-entry.f360.swf .swf-deny { margin: 0; }
.acc-entry.f360.swf .swf-table .vin-row { display: block; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.acc-entry.f360.swf .swf-table .cell-sub.small { display: block; }
.acc-entry.f360.swf .f360-split.is-wide { grid-template-columns: minmax(0, 1fr) !important; }
.acc-entry.f360.swf .f360-split.is-wide > .f360-list, .acc-entry.f360.swf .f360-split.is-wide > .f360-div { display: none !important; }
/* Selected-asset header: number + labelled VIN / Unit + operating yard in one compact block; actions wrap, never overflow. */
.acc-entry.f360.swf .swf-head .ae-h1 { flex-wrap: wrap; row-gap: 6px; }
.acc-entry.f360.swf .swf-head .aw-ref { min-width: 0; flex: 1 1 260px; }
.acc-entry.f360.swf .swf-idline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 2px; }
.acc-entry.f360.swf .swf-pair { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.acc-entry.f360.swf .swf-idline small { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }
.acc-entry.f360.swf .swf-idline b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.acc-entry.f360.swf .swf-yardnow { display: inline-flex; align-items: center; gap: 4px; }
.acc-entry.f360.swf .swf-yardnow .i { width: 14px; height: 14px; color: var(--accent); }
.acc-entry.f360.swf .swf-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
.acc-entry.f360.swf .swf-panel { display: grid; gap: 10px; padding-top: 10px; }
/* Section headers (Fleet 360 accordion) with hover / focus affordance. */
.acc-entry.f360.swf .swf-sec .acc-task-btn { cursor: pointer; border-radius: 8px; transition: background var(--motion, .12s); }
.acc-entry.f360.swf .swf-sec .acc-task-btn:hover { background: var(--row-hover); }
.acc-entry.f360.swf .swf-sec .acc-task-btn:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.acc-entry.f360.swf .swf-sec .at-n .i { color: var(--accent); }
.acc-entry.f360.swf .swf-sec .at-s { color: var(--text-2); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.acc-entry.f360.swf .swf-facts { margin: 0; }
/* Movement rail: subtle left rail, date | before | → | after aligned in columns; one row per event. */
.swf .swr-cols, .swf .swr-hit { display: grid; grid-template-columns: 104px minmax(0, 1fr) 20px minmax(0, 1fr) 6rem 16px; gap: 2px 10px; align-items: center; }
.swf .swr-cols { padding: 0 10px 4px 22px; font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.swf .swr { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--border); display: grid; gap: 4px; }
.swf .swr > li { position: relative; }
.swf .swr-row::before { content: ""; position: absolute; left: -16px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.swf .swr-row.is-now::before { background: var(--success); border-color: var(--success); }
.swf .swr-row.is-sched::before { background: var(--surface); border-color: var(--warning-text, #b35c00); border-style: dashed; }
.swf .swr-hit { padding: 7px 10px; border: 1px solid transparent; border-radius: 8px; color: inherit; text-decoration: none; }
.swf .swr-hit:hover { background: var(--row-hover); border-color: var(--border); }
.swf .swr-hit:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 1px; }
.swf .swr-row.is-now > .swr-hit { background: var(--success-bg); }
.swf .swr-row.is-open > .swr-hit { border-color: var(--accent); background: var(--accent-tint); }
.swf .swr-date { display: grid; gap: 2px; min-width: 0; }
.swf .swr-date b { font-variant-numeric: tabular-nums; font-weight: 600; }
.swf .swr-date small { display: flex; align-items: center; gap: 3px; color: var(--text-2); font-size: 11px; line-height: 1.25; }
.swf .swr-cue { display: inline-flex; } .swf .swr-cue .i { width: 12px; height: 12px; }
.swf .swr-cue.t-num .i { color: var(--accent); } .swf .swr-cue.t-yard .i { color: var(--dom-fleet, var(--accent)); }
.swf .swr-blk { display: grid; gap: 1px; min-width: 0; }
.swf .swr-num { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.swf .swr-yard { display: inline-flex; align-items: flex-start; gap: 3px; font-size: 12px; color: var(--text-2); min-width: 0; }
.swf .swr-yard > span { overflow-wrap: anywhere; }
.swf .swr-yard .i { width: 12px; height: 12px; flex: none; margin-top: 2px; }
.swf .swr-yard.is-none { font-style: italic; }
.swf .swr-blk.is-from { color: var(--text-2); }
.swf .swr-num.is-chg, .swf .swr-yard.is-chg { color: var(--accent); }
.swf .swr-yard.is-chg { font-weight: 600; }
.swf .swr-arrow .i { width: 14px; height: 14px; color: var(--text-2); }
.swf .swr-chev .i { width: 12px; height: 12px; color: var(--text-2); transition: transform .12s; }
.swf .swr-row.is-open > .swr-hit .swr-chev .i { transform: rotate(180deg); }
.swf .swr .mv-more { margin: 4px 0 6px 10px; }
.swf .swr-fixes { list-style: none; margin: 2px 0 0 114px; padding: 0; display: grid; gap: 2px; }
.swf .swr-fixhit { display: flex; align-items: flex-start; gap: 6px; padding: 4px 8px; border-radius: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.swf a.swr-fixhit:hover { background: var(--row-hover); }
.swf .swr-fixhit .i { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.swf .swr-fix.is-open > .swr-fixhit, .swf .swr-start.is-open > .swr-fixhit { background: var(--accent-tint); color: var(--text); }
.swf .swr-start { margin-bottom: 2px; }
.swf .sw-first { margin-top: 8px; }
@container acc-entry (max-width: 859px) { .acc-entry.f360.swf .swf-wide { display: none; } }
@media (max-width: 859px) { .acc-entry.f360.swf .swf-wide { display: none; } }
@media (max-width: 559px) {
  .acc-entry.f360.swf .swf-show { flex: 1 1 100%; }
  .acc-entry.f360.swf .swf-show .select { flex: 1; }
  .swf .swr-cols { display: none; }
  .swf .swr-hit { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 14px; }
  .swf .swr-date { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .swf .swr-tag { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .swf .swr-fixes { margin-left: 8px; }
  .acc-entry.f360.swf .swf-acts .btn { flex: 1 1 auto; }
}

.acc-entry.f360.swf .swf-head .f360-close {display:inline-flex;align-items:center;gap:4px}
.acc-entry.f360.swf .swf-work,.acc-entry.f360.swf .swf-ws {min-width:0}
.acc-entry.f360.swf .f360-div::before {content:'';position:absolute;inset:0 -4px;cursor:col-resize}
.acc-entry.f360.swf .f360-div>span::after {content:'';position:absolute;top:48%;left:50%;transform:translateX(-50%);width:8px;height:36px;border-radius:5px;background:var(--muted);pointer-events:none}
@container acc-entry (max-width:859px){.acc-entry.f360.swf .swf-head .f360-close{display:none}}
/* Unified Truck / Chassis roster: latest change as before → after (number and/or yard) */
.acc-entry.f360.swf .swf-chg { display: grid; gap: 2px; min-width: 0; }
.acc-entry.f360.swf .swf-chg-l { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.acc-entry.f360.swf .swf-chg-l > .i { width: 12px; height: 12px; color: var(--text-2); flex: none; }
.acc-entry.f360.swf .swf-chg-l b { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.acc-entry.f360.swf .swf-chg-n, .acc-entry.f360.swf .swf-chg-y { color: var(--text-2); overflow-wrap: anywhere; }
.acc-entry.f360.swf .swf-chg-y { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.acc-entry.f360.swf .swf-chg-y .i { width: 11px; height: 11px; }
.acc-entry.f360.swf .swf-chg .cell-sub .i { width: 11px; height: 11px; vertical-align: -1px; margin-right: 2px; }
.acc-entry.f360.swf .swf-table td { white-space: normal; vertical-align: top; }
/* SWAP · Fleet 360 visual design for the detail workspace (Truck and Chassis). Same tokens and treatment as
   vehicles.css "Lower disclosure rows"; bound to #swf-s-* so the Fleet Status 360 screen is untouched. */
.acc-entry.f360.swf #swf-s-id   { --dc: var(--dom-fleet); --dc-bg: var(--dom-fleet-bg); }
.acc-entry.f360.swf #swf-s-hist { --dc: var(--dom-tele);  --dc-bg: var(--dom-tele-bg); }
.acc-entry.f360.swf .swf-sec:not(.t-danger):not(.t-warning) { border-left-color: color-mix(in srgb, var(--dc) 40%, transparent); }
.acc-entry.f360.swf .swf-sec .f360-sec-btn > .at-n { background: var(--dc-bg); color: var(--dc); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dc) 45%, transparent); transition: background .15s, color .15s, box-shadow .15s; }
.acc-entry.f360.swf .swf-sec .f360-sec-btn > .at-n .i { color: inherit; }
.acc-entry.f360.swf .swf-sec .f360-sec-btn:hover > .at-n { box-shadow: inset 0 0 0 2px var(--dc); }
.acc-entry.f360.swf .swf-sec .f360-sec-btn:active > .at-n,
.acc-entry.f360.swf .swf-sec .f360-sec-btn[aria-expanded="true"] > .at-n { background: var(--dc); color: #fff; box-shadow: none; }
.acc-entry.f360.swf .swf-sec .f360-sec-btn[aria-expanded="true"] .at-t b { color: var(--dc); }
.acc-entry.f360.swf .swf-sec .f360-sec-btn:focus-visible { outline: 2px solid var(--dc); outline-offset: -2px; }
.acc-entry.f360.swf .swf-sec .acc-task-b .f360-facts dt { color: color-mix(in srgb, var(--dc) 55%, var(--text-2)); }
.acc-entry.f360.swf .swf-sec .acc-task-b .f360-facts dd { color: var(--text); }
.acc-entry.f360.swf .swf-sec .acc-task-b > .cell-sub { color: var(--text-3); margin: 6px 0 0; }
/* Compact sticky header: status stays a small chip (no hero-size badge) */
.acc-entry.f360.swf .swf-head .aw-state .badge { font-size: 12px; line-height: 1.3; padding: 2px 8px; font-weight: 650; border-radius: 6px; }
.acc-entry.f360.swf .swf-head .aw-state .badge svg { width: 13px; height: 13px; }
.acc-entry.f360.swf .swf-idline b { color: var(--text); }
/* History rail: date first, before muted, after accented; rail dots take the section colour */
.acc-entry.f360.swf #swf-b-hist .swr { border-left-color: color-mix(in srgb, var(--dc) 35%, var(--border)); }
.acc-entry.f360.swf #swf-b-hist .swr-date b { color: var(--text); }
.acc-entry.f360.swf #swf-b-hist .swr-row.is-open > .swr-hit { border-color: var(--dc); }
/* Narrow detail panel (split view or 420px): same stacked layout as the phone rule, driven by the panel width */
@container f360p (max-width: 560px) {
  .swf .swr-cols { display: none; }
  .swf .swr-hit { grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 14px; padding: 6px 8px; }
  .swf .swr-date { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .swf .swr-tag { grid-column: 1 / -1; grid-row: 1; justify-self: end; }
  .swf .swr-fixes { margin-left: 8px; }
  .acc-entry.f360.swf .swf-sec .f360-facts { grid-template-columns: minmax(0, 1fr); }
}

.acc-entry.swf .f360-split:not(.has-sel) .swf-table { min-width: 100%; }

/* Parts & Tools · Inventory: the catalog spans the full width; a selected item (#parts/item/<id>) keeps the table on the
   left and opens its detail on the right (the Fleet Status split). A narrow container shows the selected item alone. */
.pt-inv { container: pt-inv / inline-size; }
.pt-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pt-split .pt-list, .pt-split .pt-work { min-width: 0; }
.pt-split .pt-list .vtable tr.is-sel td { background: var(--row-selected); }
.pt-split .pt-list .vtable tr.is-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.pt-work > * + *, .pt-work .pt-detail > * + * { margin-top: 12px; }
@container pt-inv (min-width: 980px) {
  .pt-split.has-sel { grid-template-columns: minmax(0, 46%) minmax(0, 1fr); }
  .pt-split.has-sel .pt-work { position: sticky; top: 0; max-height: calc(100vh - var(--header-h, 52px) - var(--tabs-h, 32px) - 24px); overflow-y: auto; overscroll-behavior: contain; }
}
@container pt-inv (max-width: 979px) {
  .pt-split.has-sel:not(.is-folded) .pt-list { display: none; }
  .sp-w { display: none; }
}
/* 2026-11-22 · shared split controls (js/m/split-pane.js) · Parts › Inventory and Code › Job Codes */
@container pt-inv (min-width: 980px) {
  .pt-split.has-sel.w-list { grid-template-columns: minmax(0, 62%) minmax(0, 1fr); }
  .pt-split.has-sel.w-detail { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
}
.pt-split.has-sel.is-folded { grid-template-columns: minmax(0, 1fr); }
.pt-split.has-sel.is-folded .pt-work { order: -1; position: static; max-height: none; overflow: visible; }
.sp-pane { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.sp-h { margin: 0; font-size: inherit; }
.sp-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px 8px 0 0; }
.sp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sp-btn .sp-chev { flex: none; transition: transform .15s; }
.sp-pane.is-open .sp-btn .sp-chev { transform: rotate(90deg); }
.sp-btn .sp-t { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.sp-btn .sp-s, .sp-btn .sp-st { color: var(--text-2); font-size: 12px; }
.sp-tools { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 0 12px 10px; }
.sp-w { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.sp-w .btn.is-on { background: var(--row-selected); border-color: var(--accent); }
.sp-b { padding: 0 12px 12px; min-width: 0; overflow-wrap: anywhere; }
.sp-b > * + * { margin-top: 12px; }
.sp-b .rec-head, .sp-b .rh-actions { flex-wrap: wrap; }
.pt-list .jc-desc { display: block; min-width: 14rem; max-width: 32rem; white-space: normal; color: var(--text-2); }

/* R27 · Parts purchasing / tools split: inline receipt entry on the selected request, error in place, narrow screens stack */
.pt-rcv-inline { display: grid; gap: 10px; }
.pt-rcv-inline .form-err:empty { display: none; }
.pt-rcv-inline .form-err { color: var(--danger, #b42318); font-size: 13px; margin: 0; }
.pt-detail .rh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) {
  .pt-split.has-sel .pt-work { position: static; max-height: none; }
  .list-toolbar.solo { flex-wrap: wrap; }
}

/* R62 · truck finder candidates (current / earlier number with VIN and unit) */
.rp-vfind-c { margin: 4px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--text-2); } .rp-vfind-c:empty { display: none; }
