.op-resource-matrix{--rm-border:var(--border-color,#d7e1ec);--rm-muted:var(--muted-text,#50627a);display:grid;gap:1rem;min-width:0;max-width:100%;overflow-wrap:anywhere}
.op-resource-matrix *{box-sizing:border-box}
.op-resource-matrix h2,.op-resource-matrix h3,.op-resource-matrix h4,.op-resource-matrix p{margin:0}
.resource-matrix-toolbar,.resource-matrix-view-toggle,.resource-matrix-legend,.resource-matrix-card-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.resource-matrix-toolbar{justify-content:space-between;min-width:0}
.resource-matrix-view-toggle button,.op-resource-matrix button,.op-resource-matrix summary{min-height:44px;max-width:100%;white-space:normal}
.resource-matrix-view-toggle [aria-pressed=true]{background:var(--primary-color,#0964ed);color:#fff;border-color:var(--primary-color,#0964ed)}
.resource-matrix-actions-filter{display:flex;align-items:center;gap:.6rem;padding:.5rem 0;font:inherit;min-width:0}
.resource-matrix-actions-filter input{width:1.2rem;height:1.2rem;flex:none}
.resource-matrix-legend{padding:.8rem 1rem;border:1px solid var(--rm-border,#d7e1ec);border-radius:.65rem;background:var(--panel-background,#f8fbff);font-size:.9rem;color:var(--rm-muted,#50627a)}
.resource-matrix-legend>strong{color:inherit;margin-right:.6rem}
.resource-matrix-key{display:inline-flex;align-items:center;gap:.4rem}
.resource-matrix-dot{display:inline-block;width:.7rem;height:.7rem;border-radius:50%;background:#8391a5;flex:none}
.resource-matrix-key[data-state=current] .resource-matrix-dot{background:#16814b}
.resource-matrix-key[data-state=due_soon] .resource-matrix-dot{background:#ba8300}
.resource-matrix-key[data-state=overdue] .resource-matrix-dot,.resource-matrix-key[data-state=failed] .resource-matrix-dot{background:#c23232}
.resource-matrix-scroll{max-width:100%;min-width:0;overflow:auto;border:1px solid var(--rm-border,#d7e1ec);border-radius:.75rem;overscroll-behavior-inline:contain;scrollbar-gutter:stable}
.resource-matrix-table{border-collapse:separate;border-spacing:0;width:100%;min-width:50rem;background:var(--panel-background,#fff);font-size:.94rem}
.resource-matrix-table caption{padding:.75rem 1rem;text-align:left;font-size:.9rem;color:var(--rm-muted,#50627a);background:#f8fbff}
.resource-matrix-table th,.resource-matrix-table td{text-align:left;vertical-align:top;padding:.8rem;border-right:1px solid var(--rm-border,#d7e1ec);border-bottom:1px solid var(--rm-border,#d7e1ec);min-width:14rem;max-width:24rem}
.resource-matrix-table tr>:last-child{border-right:0}
.resource-matrix-table tbody tr:last-child>*{border-bottom:0}
.resource-matrix-table thead th{position:sticky;top:0;background:#edf3f9;color:#203b5b;z-index:3;font-weight:650}
.resource-matrix-table .resource-matrix-row-heading{position:sticky;left:0;min-width:13rem;max-width:18rem;background:var(--panel-background,#fff);z-index:2;font-weight:500}
.resource-matrix-table thead .resource-matrix-row-heading{background:#edf3f9;z-index:4}
.resource-matrix-row-heading strong{display:block;font-size:1rem;margin-bottom:.3rem}
.resource-matrix-cell{display:grid;gap:.7rem;min-width:0}
.resource-matrix-card{display:grid;gap:.55rem;min-width:0;padding:.8rem;border:1px solid #dce5ee;border-left:4px solid #8796aa;border-radius:.6rem;background:#f7f9fc;color:#17304d}
.resource-matrix-card[data-date-state=current]{background:#effaf3;border-color:#d2e9da;border-left-color:#16814b}
.resource-matrix-card[data-date-state=due_soon]{background:#fff9e9;border-color:#f1e5bf;border-left-color:#ba8300}
.resource-matrix-card[data-date-state=overdue],.resource-matrix-card[data-date-state=failed]{background:#fff2f2;border-color:#f0d4d4;border-left-color:#c23232}
.resource-matrix-card .resource-matrix-title{font-size:1rem;font-weight:700;padding:0;min-height:44px;display:flex;align-items:center;text-align:left;border:0;background:transparent;color:var(--link-color,#0758ce);text-decoration:underline;text-underline-offset:.15rem;line-height:1.4}
.resource-matrix-card-facts{display:grid;gap:.4rem;font-size:.88rem;line-height:1.45}
.resource-matrix-card-facts>div{display:grid;gap:.15rem;min-width:0}
.resource-matrix-card-facts .resource-matrix-fact-label{font-size:.78rem;color:var(--rm-muted,#50627a)}
.resource-matrix-restriction{display:block;padding:.3rem .5rem;background:#fff0f0;border:1px solid #efbcbc;color:#9c2525;border-radius:.4rem;font-size:.83rem;font-weight:650;line-height:1.4}
.resource-matrix-custody{padding:.25rem 0;font-size:.83rem;color:#526174}
.resource-matrix-card-actions{align-items:stretch;gap:.45rem}
.resource-matrix-card-actions button{font-size:.83rem;padding:.45rem .65rem;flex:1 1 5rem;min-width:0}
.resource-matrix-empty-cell{min-height:4rem;display:grid;place-content:center;text-align:center;color:var(--rm-muted,#50627a);font-size:.85rem;gap:.25rem}
.resource-matrix-empty-cell span:first-child{font-size:1.15rem}
.resource-matrix-summary,.resource-matrix-notice{border:1px solid var(--rm-border,#d7e1ec);border-radius:.65rem;padding:.85rem 1rem;line-height:1.5;min-width:0}
.resource-matrix-summary{background:#f1f7ff;color:#294767}
.resource-matrix-notice{background:#fff9ec;color:#634d25}
.resource-matrix-phone{display:none;gap:1rem;min-width:0}
.resource-matrix-person{display:grid;gap:.9rem;padding:1rem;border:1px solid var(--rm-border,#d7e1ec);border-radius:.75rem;min-width:0}
.resource-matrix-person>header{display:grid;gap:.3rem}
.resource-matrix-phone-type{display:grid;gap:.65rem;min-width:0}
.resource-matrix-phone-type h4{font-size:.92rem;color:#3c5470}
.resource-matrix-list-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,25rem),1fr));gap:1rem;min-width:0}
.resource-matrix-scroll:focus-visible,.op-resource-matrix button:focus-visible,.op-resource-matrix summary:focus-visible,.op-resource-matrix [tabindex]:focus-visible{outline:3px solid var(--focus-color,#3165ba);outline-offset:3px}
@media(max-width:680px){.resource-matrix-desktop{display:none}.resource-matrix-phone{display:grid}.resource-matrix-toolbar{align-items:stretch}.resource-matrix-view-toggle{width:100%}.resource-matrix-view-toggle button{flex:1 1 8rem}.resource-matrix-legend{gap:.5rem;font-size:.82rem}.resource-matrix-person{padding:.8rem}.resource-matrix-card-actions button{flex-basis:8rem}}
@media(prefers-reduced-motion:reduce){.resource-matrix-scroll{scroll-behavior:auto}}

/* Keep intrinsic table width inside its existing horizontal scroll region. */
.op-resource-matrix{grid-template-columns:minmax(0,1fr)}
.op-resource-matrix>[data-rmx-body],
.op-resource-matrix .resource-matrix-desktop,
.op-resource-matrix .resource-matrix-scroll{min-inline-size:0;inline-size:100%;max-inline-size:100%}

/* The inherited .op-card grid rule must not expose the recovery module's hidden receipt. */
[data-ani-slot] > [hidden], [data-ani-slot] > div:empty {display:none!important}
[data-ani-recovery-entry]:not(:has([data-ani-slot] > :not([hidden]):not(:empty))):not(:has([data-ani-slot]:not(:empty):not(:has(*)))) {display:none}
.op-scope :is(.asset-type-edit-v1,.asset-type-add-v1) fieldset{border:0;padding:0;margin:0;min-width:0}
.asset-type-pick-v1{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) auto;align-items:end;gap:12px}
.asset-type-add-v1{max-width:720px}.asset-type-add-v1 .asset-type-pick-v1{grid-template-columns:repeat(2,minmax(0,1fr))}
.asset-type-check-link-v1{justify-self:start;align-self:start}.asset-type-edit-v1 .asset-type-setting-group h2{margin:0}
.asset-type-edit-v1 [hidden],.asset-type-add-v1 [hidden]{display:none!important}
@media(max-width:700px){.asset-type-pick-v1,.asset-type-add-v1 .asset-type-pick-v1{grid-template-columns:1fr}.asset-type-pick-v1>.op-button{justify-self:start}}

/* Matrix density successor: local only, leaves existing register/detail pages alone. */
.resource-matrix-requirement-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:680px){.resource-matrix-requirement-label{position:static;width:auto;height:auto;overflow:visible;clip-path:none;font-weight:600}}
.resource-matrix-page{gap:.5rem!important;display:grid!important;grid-template-columns:minmax(0,1fr)}
.resource-matrix-page>.op-page-header{padding:.55rem 1rem!important;min-height:0}
.resource-matrix-page .op-title{font-size:1.5rem;line-height:1.3;margin:0}
.resource-matrix-page>details.op-panel{padding:.35rem 1rem!important;margin:0}
.resource-matrix-page>details.op-panel>summary{min-height:32px;display:list-item;align-content:center;cursor:pointer}
.resource-matrix-page>.op-resource-matrix{padding:.7rem!important;gap:.5rem}
.op-resource-matrix [data-rmx-body]{display:grid;gap:.35rem}
.op-resource-matrix .operations-asset-register-filter-grid{display:flex;flex-wrap:wrap;align-items:end;gap:.5rem}
.op-resource-matrix .operations-asset-register-filter-grid__search{flex:1 1 24rem;min-width:0}
.op-resource-matrix .operations-asset-register-filter-grid>details{flex:0 1 auto}
.op-resource-matrix .operations-asset-register-filter-grid>details[open]{flex-basis:100%}
.op-resource-matrix input[type=search],.op-resource-matrix select{min-height:36px!important;padding:.4rem .6rem!important}
.op-resource-matrix section[aria-label="Fleet matrix and list filters"]{gap:.35rem}
.op-resource-matrix section[aria-label="Fleet matrix and list filters"] .admin-form-grid{grid-template-columns:minmax(0,2fr) minmax(12rem,1fr);gap:.5rem}
.resource-matrix-toolbar,.resource-matrix-view-toggle{gap:.4rem}
.resource-matrix-actions-filter{padding:.1rem 0}
.op-resource-matrix .resource-matrix-summary,.op-resource-matrix .resource-matrix-notice{padding:.35rem .65rem;border-radius:.35rem;line-height:1.4;font-size:.9rem}
.op-resource-matrix .resource-matrix-summary p{display:inline;margin-left:.4rem}
.resource-matrix-legend{padding:.35rem .65rem;gap:.4rem .8rem;border-radius:.35rem;font-size:.85rem}
.resource-matrix-scroll{max-height:calc(100dvh - 24rem);min-height:12rem;scroll-padding-top:3rem}
.resource-matrix-table{font-size:.9rem}
.resource-matrix-table caption{padding:.35rem .6rem;font-size:.83rem}
.resource-matrix-table th,.resource-matrix-table td{padding:.4rem;min-width:13rem}
.resource-matrix-table .resource-matrix-row-heading{min-width:11rem;max-width:14rem}
.resource-matrix-row-heading .op-meta{display:block}
.resource-matrix-cell{gap:.35rem}
.resource-matrix-card{gap:.2rem;padding:.35rem .45rem;border-radius:.35rem;line-height:1.3;font-size:.875rem}
.resource-matrix-card .resource-matrix-title{font-size:.94rem;min-height:24px;line-height:1.25}
.resource-matrix-position,.resource-matrix-information,.resource-matrix-hidden-exceptions{font-size:.83rem;line-height:1.35}
.resource-matrix-information,.resource-matrix-hidden-exceptions{color:#77530d}
.resource-matrix-hidden-exceptions{background:#fff8e7;padding:.25rem .4rem;border-radius:.25rem}
.resource-matrix-restriction{padding:.15rem .3rem;font-size:.83rem}
.resource-matrix-card-actions{gap:.3rem;flex-wrap:wrap}
.resource-matrix-card-actions button{flex:0 1 auto;font-size:.83rem;padding:.2rem .4rem}
.resource-matrix-more{font-size:.85rem}
.resource-matrix-more>summary{cursor:pointer;font-weight:600;padding:.2rem;line-height:1.3}
.resource-matrix-more>.resource-matrix-cell{margin-top:.35rem}
.resource-matrix-more:not([open]) .resource-matrix-collapse-label,.resource-matrix-more[open] .resource-matrix-expand-label{display:none}
.resource-matrix-empty-cell{min-height:3rem;font-size:.8rem}
.resource-matrix-person{gap:.5rem;padding:.65rem}
.resource-matrix-phone-type{gap:.35rem}
@media(min-width:681px){
 .op-resource-matrix button,.op-resource-matrix summary{min-height:28px}
 .op-resource-matrix .resource-matrix-toolbar button{min-height:34px;padding:.35rem .6rem}
 .resource-matrix-page{grid-template-columns:minmax(0,1fr) auto}
 .resource-matrix-page>.op-page-header{grid-column:1;grid-row:1}
 .resource-matrix-page>details.op-panel{grid-column:2;grid-row:1;max-width:28rem}
 .resource-matrix-page>details.op-panel[open]{grid-column:1/-1;grid-row:2;max-width:none}
 .resource-matrix-page>.op-resource-matrix{grid-column:1/-1}
}
@media(max-width:680px){
 .resource-matrix-page>details.op-panel>summary,.op-resource-matrix button,.op-resource-matrix summary,.resource-matrix-card .resource-matrix-title{min-height:44px}
 .op-resource-matrix input[type=search],.op-resource-matrix select{min-height:44px!important}
 .op-resource-matrix section[aria-label="Fleet matrix and list filters"] .admin-form-grid{grid-template-columns:minmax(0,1fr)}
 .resource-matrix-card-actions button{flex:1 1 6rem}
 .resource-matrix-card{padding:.5rem}
 .resource-matrix-phone{gap:.6rem}
 .resource-matrix-page>.op-resource-matrix{padding:.5rem!important}
}

/* Owner-directed compact matrix presentation; existing application shell is retained. */
.resource-matrix-page .op-resource-matrix .resource-matrix-toolbar{display:grid;grid-template-columns:auto minmax(18rem,1fr) auto auto;align-items:center;gap:.5rem}
.resource-matrix-page .resource-matrix-register-filters{min-width:0}
.resource-matrix-page .resource-matrix-register-filters .operations-asset-register-filter-grid{display:flex!important;align-items:center;gap:.5rem}
.resource-matrix-page .resource-matrix-register-filters .operations-asset-register-filter-grid__search{flex:1 1 14rem}
.resource-matrix-page .resource-matrix-register-filters .operations-asset-register-filter-grid>details{flex:0 1 auto}
.resource-matrix-page .resource-matrix-register-filters .operations-asset-register-filter-grid>details[open]{flex-basis:100%}
.resource-matrix-page .resource-matrix-register-filters .admin-form-grid{display:grid!important;grid-template-columns:minmax(10rem,1.3fr) minmax(10rem,1fr)!important;gap:.5rem!important;align-items:center}
.resource-matrix-page .resource-matrix-register-filters .admin-form-grid label,.resource-matrix-page .resource-matrix-register-filters .operations-asset-register-filter-grid__search{margin:0!important;min-width:0}
.resource-matrix-page .resource-matrix-register-filters input,.resource-matrix-page .resource-matrix-register-filters select{width:100%;margin:0!important;font-size:.9rem}
.resource-matrix-control-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.resource-matrix-page .resource-matrix-actions-filter{font-size:.85rem;max-width:15rem;gap:.35rem}
.resource-matrix-page .resource-matrix-toolbar .op-button{white-space:nowrap}
.resource-matrix-summary{display:flex;flex-wrap:wrap;align-items:center;gap:.2rem .3rem}
.resource-matrix-asof{margin-left:auto;color:var(--rm-muted,#50627a);font-size:.8rem}
.resource-matrix-help{font-size:.83rem;color:var(--rm-muted,#50627a);justify-self:start}
.resource-matrix-help>summary{cursor:pointer}
.resource-matrix-help[open]{grid-column:1/-1;justify-self:stretch}
.resource-matrix-help p{padding:.35rem .5rem;max-width:65rem}
.resource-matrix-page .resource-matrix-legend{gap:.2rem .65rem;font-size:.8rem;padding:.25rem .5rem}
.resource-matrix-page .resource-matrix-card{padding:.45rem .55rem;gap:.15rem;border-left-width:3px}
.resource-matrix-page .resource-matrix-card .resource-matrix-title{color:#1459a6;text-decoration:none;font-size:.9rem;font-weight:650;min-height:24px}
.resource-matrix-page .resource-matrix-card .resource-matrix-title:hover{text-decoration:underline}
.resource-matrix-page .resource-matrix-position{font-size:.83rem}
.resource-matrix-entry-heading{display:flex;align-items:center;gap:.4rem}
.resource-matrix-entry-heading:before,.resource-matrix-requirement-entry>.resource-matrix-title:before{content:"";display:inline-block;width:.65rem;height:.65rem;border-radius:50%;background:#7e8da3;flex:none}
.resource-matrix-requirement-entry>.resource-matrix-title{gap:.4rem}
.resource-matrix-card[data-date-state=current]{background:#eaf8ef;border-color:#c5e6d0;border-left-color:#16814b}
.resource-matrix-card[data-date-state=current] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=current]>.resource-matrix-title:before{background:#16814b}
.resource-matrix-card[data-date-state=due_soon]{background:#fff6dd;border-color:#f0dfaa;border-left-color:#b47c00}
.resource-matrix-card[data-date-state=due_soon] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=due_soon]>.resource-matrix-title:before{background:#b47c00}
.resource-matrix-card[data-date-state=overdue],.resource-matrix-card[data-date-state=failed],.resource-matrix-card[data-date-state=missing]{background:#fff0f1;border-color:#efc6cb;border-left-color:#c23232}
.resource-matrix-card[data-date-state=overdue] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=failed] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=missing] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=overdue]>.resource-matrix-title:before,.resource-matrix-card[data-date-state=failed]>.resource-matrix-title:before,.resource-matrix-card[data-date-state=missing]>.resource-matrix-title:before{background:#c23232}
.resource-matrix-card[data-date-state=unknown]{background:#f0f3f8;border-color:#d8e0ec;border-left-color:#7e8da3}
.resource-matrix-card[data-date-state=not_required],.resource-matrix-card[data-date-state=not_applicable]{background:#f5f7fa;border-color:#e1e6ed;border-left-color:#a1abb8}
.resource-matrix-card[data-date-state=not_required] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=not_applicable] .resource-matrix-entry-heading:before,.resource-matrix-card[data-date-state=not_required]>.resource-matrix-title:before,.resource-matrix-card[data-date-state=not_applicable]>.resource-matrix-title:before{background:transparent;border:1px solid #768293}
.resource-matrix-page .resource-matrix-card-actions:empty{display:none}
.resource-matrix-page .resource-matrix-empty-cell{min-height:2.5rem;align-content:start;padding-top:.5rem;font-size:1rem}
.resource-matrix-page .resource-matrix-table caption{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.resource-matrix-page .resource-matrix-scroll{max-height:calc(100dvh - 22rem)}
.resource-matrix-page .resource-matrix-table th,.resource-matrix-page .resource-matrix-table td{padding:.45rem;min-width:12rem}
.resource-matrix-page .resource-matrix-table tbody>.resource-matrix-row-heading{padding:.6rem}
.resource-matrix-page .resource-matrix-table .resource-matrix-row-heading{min-width:11rem}
.resource-matrix-page .resource-matrix-hidden-exceptions{font-size:.8rem}
.resource-matrix-page .resource-matrix-restriction{font-size:.8rem}
@media(min-width:681px){
 .resource-matrix-page [data-rmx-body]{grid-template-columns:minmax(0,1fr) auto;grid-auto-flow:row dense;align-items:start;gap:.25rem .6rem}
 .resource-matrix-page [data-rmx-body]>.resource-matrix-summary,.resource-matrix-page [data-rmx-body]>.resource-matrix-information,.resource-matrix-page [data-rmx-body]>.resource-matrix-notice,.resource-matrix-page [data-rmx-body]>.resource-matrix-desktop,.resource-matrix-page [data-rmx-body]>.resource-matrix-list-cards{grid-column:1/-1}
 .resource-matrix-page [data-rmx-body]>.resource-matrix-legend{grid-column:1;grid-row:auto}
 .resource-matrix-page [data-rmx-body]>.resource-matrix-help{grid-column:2;grid-row:auto;justify-self:end}
 .resource-matrix-page [data-rmx-body]>.resource-matrix-help[open]{grid-column:1/-1;justify-self:stretch}
}
@media(min-width:681px) and (max-width:1250px){.resource-matrix-page .op-resource-matrix .resource-matrix-toolbar{grid-template-columns:auto minmax(0,1fr) auto}.resource-matrix-page .resource-matrix-register-filters{grid-row:2;grid-column:1/3}.resource-matrix-page .resource-matrix-actions-filter{grid-column:2;justify-self:end}.resource-matrix-page [data-rmx-refresh]{grid-column:3;grid-row:1/3}}
@media(max-width:680px){
 .resource-matrix-page .op-resource-matrix .resource-matrix-toolbar{grid-template-columns:minmax(0,1fr) auto}
 .resource-matrix-page .resource-matrix-view-toggle{grid-column:1/-1}
 .resource-matrix-page .resource-matrix-register-filters{grid-column:1/-1}
 .resource-matrix-page .resource-matrix-register-filters .admin-form-grid{grid-template-columns:minmax(0,1fr)!important}
 .resource-matrix-page .resource-matrix-actions-filter{max-width:none}
 .resource-matrix-page .resource-matrix-toolbar .op-button{white-space:normal}
 .resource-matrix-page .resource-matrix-card .resource-matrix-title{min-height:44px}
 .resource-matrix-asof{margin-left:0;flex-basis:100%}
 .resource-matrix-page .resource-matrix-empty-cell{min-height:44px}
}

/* Recorded prohibition is independent of checklist dates, defect counts and extra messages. */
.resource-matrix-page .resource-matrix-restriction-entry[data-driving-restriction="true"]{background:#fff0f1;border-color:#efb7be;border-left-color:#bb2637;color:#981d2b}
.resource-matrix-page .resource-matrix-restriction-entry[data-driving-restriction="true"] .resource-matrix-title,
.operations-vehicle-detail-page [data-vehicle-readiness-restriction][data-driving-restriction="true"]{background:#ffe4e8;color:#981d2b;border:1px solid #efa8b4;border-radius:.35rem;padding:.25rem .45rem;font-weight:700}

/* Both registers use the same tab row, independent of optional recovery tools. */
.resource-matrix-page > .resource-section-navigation-v1 { grid-column:1 / -1; grid-row:1; justify-content:flex-start; }
@media (min-width:681px) {
  .resource-matrix-page > .op-page-header { grid-row:2; }
  .resource-matrix-page > details.op-panel { grid-row:2; }
  .resource-matrix-page > details.op-panel[open] { grid-row:3; }
}

/* List view: one compact table row per source record on every screen size. */
.op-resource-matrix .resource-register-list-scroll{max-height:calc(100dvh - 20rem);min-height:10rem;overflow:auto;overscroll-behavior:contain;scroll-padding:3rem 1rem;isolation:isolate}
.resource-register-list-table{border-collapse:separate;border-spacing:0;table-layout:auto;width:100%;min-width:76rem;background:var(--panel-background,#fff);font-size:.875rem;line-height:1.35}
.resource-register-list-table caption{padding:.35rem .55rem;text-align:left;color:var(--muted-text,#50627a);font-size:.8rem;background:#f8fbff}
.resource-register-list-table th,.resource-register-list-table td{padding:.4rem .55rem;text-align:left;vertical-align:top;border-right:1px solid #d7e1ec;border-bottom:1px solid #d7e1ec;min-width:8rem;max-width:22rem;overflow-wrap:anywhere}
.resource-register-list-table thead th{position:sticky;top:0;z-index:3;background:#edf3f9;color:#203b5b;font-weight:650;vertical-align:middle}
.resource-register-list-table tbody th{position:sticky;left:0;z-index:1;background:var(--panel-background,#fff);font-weight:500;min-width:13rem;max-width:18rem}
.resource-register-list-table thead th:first-child{left:0;z-index:4}
.op-resource-matrix .resource-register-list-table thead button{display:flex;justify-content:space-between;gap:.35rem;width:100%;padding:.15rem 0;min-height:32px;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.op-resource-matrix .resource-register-list-table thead [aria-sort=ascending],.op-resource-matrix .resource-register-list-table thead [aria-sort=descending]{background:#dceafb}
.op-resource-matrix .resource-register-reference,.op-resource-matrix .resource-register-record-link{padding:0;min-height:24px;border:0;background:transparent;color:var(--link-color,#0758ce);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:.15rem;text-align:left;cursor:pointer}
.resource-register-fact,.resource-register-state,.resource-register-driving-status,.resource-register-unknown{display:block;margin-top:.12rem}
.resource-register-fact{font-size:.81rem;color:var(--muted-text,#50627a)}
.resource-register-unknown{font-size:.81rem;color:#77530d}
.resource-register-restriction{display:block;margin-top:.2rem;border-left:3px solid #bb2637;padding:.15rem .35rem;background:#fff0f1;color:#981d2b;font-size:.81rem;font-weight:650}
.resource-register-driving-status[data-driving-restriction=true]{border:1px solid #efa8b4;border-left:3px solid #bb2637;background:#ffe4e8;color:#981d2b;font-weight:700}
.resource-register-driving-status[data-driving-restriction=true] button{color:inherit}
.resource-register-state[data-state=overdue],.resource-register-state[data-state=failed],.resource-register-state[data-state=missing]{color:#981d2b;font-weight:650}
.resource-register-state[data-state=due_soon]{color:#77530d;font-weight:650}
.resource-register-state[data-state=unknown]{color:#77530d}
.resource-register-row-actions{display:flex;flex-wrap:wrap;gap:.15rem .55rem;margin-top:.2rem}
.op-resource-matrix .resource-register-row-actions .op-button{padding:0;min-height:24px;border:0;background:transparent;color:var(--link-color,#0758ce);font-size:.8rem;text-decoration:underline;text-align:left}
.resource-register-more{font-size:.81rem;margin-top:.2rem}
.op-resource-matrix .resource-register-more summary{min-height:24px;cursor:pointer}
.resource-register-more ul{margin:.25rem 0;padding-left:1.1rem}
.resource-register-list-table tbody tr:hover>*,.resource-register-list-table tbody tr:focus-within>*{background:#f1f7ff}
.resource-register-list-table tbody tr:hover .resource-register-driving-status[data-driving-restriction=true]{background:#ffe4e8}
@media(max-width:680px){.op-resource-matrix .resource-register-list-scroll{max-height:65dvh;min-height:12rem}.resource-register-list-table{min-width:72rem}.op-resource-matrix .resource-register-list-table button,.op-resource-matrix .resource-register-more summary{min-height:44px}.resource-register-list-table th,.resource-register-list-table td{padding:.4rem .5rem}}

.resource-matrix-page [data-rmx-body]>.resource-register-list-scroll{grid-column:1/-1}
@media(max-width:680px){.op-resource-matrix .resource-register-list-table thead button{min-height:44px}}

/* List density refinement: retain primary safety facts; secondary facts expand in the cell. */
.resource-register-list-table tbody th{width:17rem}
.op-resource-matrix .resource-register-list-table tbody th>.resource-register-reference{display:block;max-inline-size:17rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.resource-register-list-table tbody th>.resource-register-fact{max-inline-size:17rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.resource-register-list-table .resource-register-row-actions{flex-wrap:nowrap;gap:.15rem .6rem;white-space:nowrap}
.op-resource-matrix .resource-register-row-actions button{white-space:nowrap;flex:none}
.resource-register-critical{color:#981d2b;font-weight:650}
.resource-register-list-table .resource-register-more>ul{max-inline-size:24rem}

/* Phone List: leave a complete data column beside the sticky reference. */
@media(max-width:680px){
 .op-resource-matrix .resource-register-list-table{table-layout:fixed}
 [data-resource-matrix-root="assets"] .resource-register-list-table{width:69.5rem;min-width:69.5rem}
 [data-resource-matrix-root="vehicles"] .resource-register-list-table{width:59.5rem;min-width:59.5rem}
 .resource-register-list-table thead th:first-child,.resource-register-list-table tbody th{width:9.5rem;min-width:9.5rem;max-width:9.5rem}
 .op-resource-matrix .resource-register-list-table tbody th>.resource-register-reference,.resource-register-list-table tbody th>.resource-register-fact{max-inline-size:8.5rem}
 .resource-register-list-table .resource-register-row-actions{flex-wrap:wrap;white-space:normal;max-inline-size:8.5rem}
 .op-resource-matrix .resource-register-list-table tbody th>.resource-register-reference,.op-resource-matrix .resource-register-row-actions button{max-inline-size:8.5rem;min-height:44px}
 .op-resource-matrix .resource-register-row-actions button{white-space:normal;overflow-wrap:anywhere}
}

/* Phone List actions must outrank the earlier compact desktop .op-button rule. */
@media(max-width:680px){
 .op-resource-matrix .resource-register-list-table .resource-register-row-actions .op-button{min-height:44px}
}

/* Assets compact matrix only. List and Vehicles retain their accepted styling. */
.op-resource-matrix .asset-allocation-card {
 display:grid; width:100%; height:100%; box-sizing:border-box; text-align:left;
 font-family:inherit; align-content:start; cursor:pointer; overflow-wrap:anywhere;
}
.asset-allocation-reference {color:var(--link-color,#0758ce);font-weight:700;text-decoration:underline;text-underline-offset:.15rem}
.asset-allocation-card[data-date-state="missing"] {border-left-color:#c23232}
.asset-allocation-card[data-date-state="not_required"],.asset-allocation-card[data-date-state="not_applicable"] {border-left-style:dashed}
.amx-empty{display:block;min-height:48px;text-align:center;align-content:center;color:#5c6e84}
.amx-panel{position:fixed;inset:0 0 0 auto;margin:0;width:min(34rem,100vw);max-width:100vw;height:100dvh;max-height:100dvh;box-sizing:border-box;padding:0;border:0;border-left:1px solid #d7e1ec;background:#fff;color:#17304d;overflow:hidden}
.amx-panel[open]{display:flex;flex-direction:column}
.amx-panel::backdrop{background:#142b4666}
.amx-panel>header{display:flex;justify-content:space-between;gap:1rem;align-items:start;padding:1rem;border-bottom:1px solid #d7e1ec}
.amx-panel h2{font-size:1.15rem;line-height:1.35;margin:0}.amx-panel h3{font-size:1rem;line-height:1.4;margin:0 0 .4rem}
.amx-panel-scope{padding:.65rem 1rem;margin:0;font-size:.87rem;line-height:1.4;background:#f5f8fc}
.amx-panel-scroll{overflow:auto;min-height:0;flex:1;padding:1rem;overscroll-behavior:contain}
.amx-panel-asset{margin-bottom:1rem}.amx-panel .resource-matrix-card{padding:.65rem;gap:.4rem}
.op-resource-matrix .amx-panel button,.op-resource-matrix .amx-panel summary{min-height:44px}
@media(max-width:680px){.amx-panel>header{padding:.75rem}.amx-panel-scroll{padding:.75rem}.amx-panel{width:100vw}}

.op-resource-matrix .amx-panel .resource-matrix-card .resource-matrix-title,.op-resource-matrix .amx-panel .resource-matrix-card-actions .op-button{min-height:44px}

/* Personal matrix column order; no column visibility controls. */
.amx-column-order { margin: 0 0 10px; font-size: 13px; }
.amx-column-order > summary { cursor: pointer; font-weight: 600; width: fit-content; }
.amx-column-order > p { margin: 8px 0; }
.amx-column-order > ol { max-height: 280px; overflow: auto; max-width: 650px; padding: 0; list-style: none; border: 1px solid #d8dee7; border-radius: 6px; }
.amx-column-order li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border-bottom: 1px solid #e6eaf0; }
.amx-column-order li:last-child { border-bottom: 0; }
.amx-column-order li > span { overflow-wrap: anywhere; }
.amx-column-order li > div { display: flex; gap: 6px; flex-shrink: 0; }
.amx-column-order button { font-size: 12px; }
@media (max-width: 480px) { .amx-column-order li { flex-wrap: wrap; } }

/* Shared section header and read summary; row/cell rules remain unchanged. */
.resource-matrix-page > .op-page-header .op-page-header__top,.resource-overview-header{align-items:flex-start;gap:12px;position:relative}
.resource-header-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.resource-section-navigation-v1{display:flex;gap:6px;flex-wrap:wrap;margin:0!important;padding:0 0 8px!important;border-bottom:1px solid #d8dee7}
.resource-section-navigation-v1 button{min-height:44px;white-space:nowrap}
.resource-section-navigation-v1 [aria-pressed=true]{background:#173a57;color:white;border-color:#173a57}
.resource-header-actions{position:relative;align-self:flex-start;margin-left:auto;z-index:12}
.resource-header-actions>summary{cursor:pointer;border:1px solid #b8c5d1;border-radius:6px;padding:10px 12px;min-height:44px;font-weight:600;list-style:revert;background:#fff;white-space:nowrap}
.resource-header-actions-panel{position:absolute;right:0;top:100%;margin-top:6px;min-width:300px;width:min(580px,calc(100vw - 32px));max-height:65vh;overflow:auto;background:#fff;color:#172b3a;border:1px solid #b8c5d1;border-radius:8px;padding:14px;box-shadow:0 6px 22px #102b4233}
.resource-header-actions-panel .op-action-row{display:flex;flex-wrap:wrap;gap:8px}
.asset-record-actions-v1>.resource-header-actions-panel{width:min(20rem,calc(100vw - 64px));min-width:0;padding:10px;box-sizing:border-box}
.asset-record-actions-v1 [hidden]{display:none!important}
.asset-record-action-group{display:grid;gap:4px;padding:6px 0}
.asset-record-action-group+.asset-record-action-group{border-top:1px solid #dfe6ee}
.asset-record-action-group h3{margin:0;font-size:.875rem;color:#41576a}
.asset-record-action-group .op-button{width:100%;min-height:36px;justify-content:flex-start;text-align:left}
.asset-record-actions-v1 [role=status]:empty{display:none}
@media(max-width:540px){.asset-record-actions-v1{margin-left:0}.asset-record-actions-v1>.resource-header-actions-panel{left:0;right:auto}}
.resource-header-summary{margin:0 0 10px;border-bottom:1px solid #d8dee7;padding:8px 0;color:#263c4d;font-size:13px}
.resource-header-summary-line{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px}
.resource-header-summary-line>p{margin:0;flex:1 1 450px;line-height:1.6}
.resource-header-incomplete{color:#7b4600}
.resource-header-warning-details{flex:0 1 auto;max-width:100%}
.resource-header-warning-details>summary{cursor:pointer;text-decoration:underline;padding:6px 0;min-height:32px}
.resource-header-warning-details>div{max-width:850px;padding:8px 12px;background:#f5f7fa;border-radius:6px}
.resource-header-warning-details p{margin:5px 0}
.resource-header-warning-details ul{padding-left:20px;margin:4px 0}
.resource-header-asof{white-space:nowrap}
.resource-matrix-toolbar{gap:10px}
@media(max-width:600px){.resource-matrix-page>.op-page-header .op-page-header__top,.resource-overview-header{flex-wrap:wrap}.resource-header-actions-panel{min-width:0;width:min(420px,calc(100vw - 32px))}.resource-section-navigation-v1{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.resource-section-navigation-v1 button{width:100%;white-space:normal}.resource-header-summary-line{gap:4px 10px}.resource-header-summary-line>p{flex-basis:100%}.resource-header-warning-details>summary{min-height:44px}.resource-header-summary{font-size:13px}}

/* Header integration: supersede the former two-column register tools layout. */
.resource-matrix-page > .op-page-header{grid-column:1/-1;grid-row:1}
.resource-matrix-page > .resource-section-navigation-v1{grid-row:2}
.resource-matrix-page > .op-page-header .op-page-header__top{display:flex;align-items:center;flex-wrap:nowrap}
.resource-matrix-page > .op-page-header .op-page-header__copy{min-width:0;flex:1}
.resource-matrix-page [data-rmx-body] > .resource-header-summary{grid-column:1/-1;margin-bottom:4px}
.resource-matrix-page [data-rmx-body] > .amx-column-order{grid-column:1/-1;margin-bottom:0}
@media(max-width:600px){.resource-header-actions-panel{width:calc(100vw - 64px)}.resource-matrix-page > .op-page-header .op-page-header__top{gap:8px}.resource-header-actions>summary{padding:8px;font-size:13px}}

/* Personal display preference lives inside Actions, leaving the grid clear. */
.resource-header-actions-panel .amx-column-order{margin:0 0 12px}
.resource-header-actions-panel .amx-column-order>summary{min-height:44px;display:flex;align-items:center}
.resource-header-actions-panel .amx-column-order li{gap:6px;flex-wrap:wrap}
.resource-header-actions-panel .amx-column-order button{min-height:44px}

/* Honour tool readiness even when shared button styles set display. */
.resource-header-actions-panel [data-rmx-asset-reference-status][hidden],
.resource-header-actions-panel [data-rmx-asset-reference-retry][hidden]{display:none!important}

/* Vehicle menu: outstanding work stays visible without expanding the full queue. */
.resource-header-actions-panel .vehicle-action-work{margin-top:8px}
.resource-header-actions-panel .vehicle-action-work>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-weight:600}
.resource-header-actions-panel [data-dnr-compact] [hidden]{display:none!important}

/* Explicitly recorded calibration exemption is a positive requirement state.
   Other checks, restrictions and unknown-source warnings remain unchanged. */
.resource-matrix-asset-entry[data-date-state="not_required"],
.asset-allocation-card[data-date-state="not_required"] {
  background:#eaf8ef;
  border-color:#c5e6d0;
  border-left-color:#16814b;
  border-left-style:solid;
}
.resource-matrix-asset-entry[data-date-state="not_required"] .resource-matrix-entry-heading:before,
.resource-matrix-asset-entry[data-date-state="not_required"] > .resource-matrix-title:before {
  background:#16814b;
  border-color:#16814b;
}
/* Calibration exemption stays positive; independent restrictions dominate the card. */
.resource-matrix-card[data-operational-attention="restricted"] {background:#fff1f1;border-color:#e8b4b4;border-left-color:#b42318;border-left-style:solid}
.resource-matrix-card[data-operational-attention="attention"] {background:#fff8e8;border-color:#ead4a2;border-left-color:#996800;border-left-style:solid}
.resource-matrix-card[data-operational-attention="unknown"] {background:#f5f7fa;border-color:#cbd2dc;border-left-color:#697586;border-left-style:solid}

/* Compact vehicle cells share their status treatment in List and Matrix. */
[data-resource-matrix-root="vehicles"] .vehicle-register-cell {
  display:grid; gap:.18rem; min-width:0; align-content:start; line-height:1.3;
}
[data-resource-matrix-root="vehicles"] .vehicle-register-cell .resource-register-record-link {
  width:fit-content; min-height:24px;
}
[data-resource-matrix-root="vehicles"] .vehicle-register-identity .resource-register-reference {
  display:block; width:fit-content; max-width:100%; min-height:24px;
}
.vehicle-register-requirement-name {display:none}
.vehicle-register-cell-details {font-size:.8rem}
[data-resource-matrix-root="vehicles"] .vehicle-register-cell-details > summary {
  width:fit-content; min-height:24px; cursor:pointer; text-decoration:underline; text-underline-offset:.12rem;
}
.vehicle-register-cell-details ul {margin:.2rem 0; padding-inline-start:1.1rem}
.vehicle-register-requirement[data-state="overdue"],
.vehicle-register-requirement[data-state="failed"],
.vehicle-register-requirement[data-state="missing"] {color:#981d2b}
.vehicle-register-requirement[data-state="due_soon"] {color:#77530d}
.vehicle-register-requirement[data-state="unknown"],
.vehicle-register-requirement[data-state="not_required"],
.vehicle-register-requirement[data-state="not_applicable"] {color:#42536a}
.vehicle-register-restriction[data-restriction-kind] {
  padding:.2rem .35rem; border-radius:.3rem; border-inline-start:3px solid transparent;
}
.vehicle-register-restriction[data-restriction-kind="restricted"] {background:#fff0f1; color:#981d2b; border-color:#bb2637}
.vehicle-register-restriction[data-restriction-kind="attention"] {background:#fff7e6; color:#6d4700; border-color:#a97415}
.vehicle-register-restriction[data-restriction-kind="unknown"] {background:#f2f5f9; color:#42536a; border-color:#8291a5}
[data-resource-matrix-root="vehicles"] .vehicle-register-requirement[data-state] .resource-register-record-link,
[data-resource-matrix-root="vehicles"] .vehicle-register-restriction[data-restriction-kind] .resource-register-record-link {color:inherit}
.fleet-vehicle-register-controls > label, .fleet-vehicle-register-controls :is(input,select) {min-width:0}
.fleet-vehicle-register-controls :is(input,select) {width:100%}
@media (min-width:681px) {
  [data-resource-matrix-root="vehicles"] .resource-register-list-table {min-width:55rem}
  [data-resource-matrix-root="vehicles"] .resource-register-list-table tbody th {width:auto; min-width:10rem}
  [data-resource-matrix-root="vehicles"] .resource-matrix-table th,
  [data-resource-matrix-root="vehicles"] .resource-matrix-table td {min-width:8rem; padding:.38rem .48rem}
  [data-resource-matrix-root="vehicles"] .resource-matrix-table .resource-matrix-row-heading {min-width:10rem}
  .fleet-vehicle-register-controls {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:680px) {
  .resource-matrix-phone .vehicle-register-requirement-name {display:block; font-size:.85rem; font-weight:650}
  [data-resource-matrix-root="vehicles"] .vehicle-register-cell :is(button,summary) {min-height:44px}
  .fleet-vehicle-register-controls {grid-template-columns:minmax(0,1fr)}
}

/* Vehicle actions is a short disclosure. Queue work has its own modal surface. */
.fleet-vehicle-actions .resource-header-actions-panel {
  min-width:0; width:min(19rem,calc(100vw - 2rem)); max-height:none; overflow:visible;
}
.fleet-vehicle-actions .resource-header-actions-panel > button {justify-self:start}
.fleet-vehicle-work-dialog {
  box-sizing:border-box; width:min(62rem,calc(100vw - 2rem)); max-height:calc(100dvh - 2rem);
  overflow:auto; overscroll-behavior:contain; padding:clamp(.8rem,2vw,1.5rem);
  background:var(--panel-background,#fff); color:#172b3a; border:1px solid #b8c5d1; border-radius:.6rem;
}
.fleet-vehicle-work-dialog:not([open]) {display:none}
.fleet-vehicle-work-dialog::backdrop {background:#102b4260}
.fleet-vehicle-work-heading {justify-content:space-between; align-items:center; margin-bottom:.8rem}
.fleet-vehicle-work-heading h2 {margin:0}


/* Vehicle Matrix uses the existing requirement-card palette; List retains its compact cells. */
[data-resource-matrix-root="vehicles"] .vehicle-matrix-card {
  align-content:start; min-inline-size:0; overflow-wrap:anywhere;
}
[data-resource-matrix-root="vehicles"] .vehicle-matrix-card > :is(p,strong) {margin:0}
[data-resource-matrix-root="vehicles"] .vehicle-matrix-card .resource-matrix-title {
  width:fit-content; max-inline-size:100%; overflow-wrap:anywhere;
}
[data-resource-matrix-root="vehicles"] .vehicle-matrix-card .resource-matrix-position {
  color:inherit; font-variant-numeric:tabular-nums;
}
[data-resource-matrix-root="vehicles"] .vehicle-matrix-restrictions[data-operational-attention="restricted"] > .resource-matrix-title {
  color:#981d2b; font-weight:700;
}
@media(max-width:680px) {
  [data-resource-matrix-root="vehicles"] .vehicle-matrix-card .resource-matrix-title,
  [data-resource-matrix-root="vehicles"] .vehicle-matrix-card .vehicle-register-cell-details > summary {min-height:44px}
}

/* Assets Matrix allocation cells. Asset List and the detail drawer retain their existing styles. */
[data-resource-matrix-root="assets"] .asset-allocation-summary {
  display:grid; width:100%; min-width:0; min-height:44px; padding:.2rem .35rem;
  align-content:center; gap:.08rem; text-align:left; cursor:pointer; font:inherit; line-height:1.25;
  color:#203b5b; background:#f8fafc; border:1px solid #d7e1ec; border-radius:.35rem; overflow-wrap:anywhere;
}
[data-resource-matrix-root="assets"] .asset-allocation-summary:hover {background:#edf4fb;border-color:#7892ad}
.asset-allocation-status,.asset-allocation-counts>span,.asset-allocation-legend>li {display:flex;align-items:center;gap:.3rem}
.asset-allocation-counts {display:flex;flex-wrap:wrap;gap:.12rem .35rem}
.asset-allocation-counts>span {flex:none;white-space:nowrap}
.asset-allocation-dot {inline-size:.65rem;block-size:.65rem;border-radius:50%;flex:none;background:#617187}
.asset-allocation-dot[data-band="red"] {background:#b42318}
.asset-allocation-dot[data-band="amber"] {background:#946200}
.asset-allocation-dot[data-band="green"] {background:#16814b}
.asset-allocation-uncertainty {color:#42536a}
.asset-allocation-legend {
  display:flex; flex-wrap:wrap; gap:.25rem .9rem; list-style:none; margin:0 0 .45rem; padding:0; color:#42536a;
}
.asset-allocation-empty {min-height:0}
[data-resource-matrix-root="assets"] .asset-allocation-matrix th,
[data-resource-matrix-root="assets"] .asset-allocation-matrix td {padding:.23rem .4rem;vertical-align:middle}
[data-resource-matrix-root="assets"] .asset-allocation-matrix .resource-matrix-row-heading {padding:.25rem .55rem}
.asset-allocation-matrix .resource-matrix-row-heading strong {margin:0}

/* The Assets summary and legend share the table width, outside the scroller. */
[data-resource-matrix-root="assets"] [data-rmx-body] > :is([data-asset-count-scope], .asset-allocation-legend) {
  grid-column: 1 / -1;
  min-inline-size: 0;
}
