/* Redesigned Compliance screen (redesign track S6). Scope every rule under .screen[data-screen="<page id>"] and use --rt-* tokens only. */
/* Tabs: Drivers / Truck paperwork / Maintenance (#app in front so the older "#app button" rule does not win). */
#app .screen[data-screen="compliance"] .cmp-tabs{display:flex;gap:2px;flex-wrap:wrap;margin:0 0 16px;border-bottom:1px solid var(--rt-line)}
#app .screen[data-screen="compliance"] .cmp-tabs button{min-height:var(--rt-touch);padding:8px 16px;border:0;border-bottom:3px solid transparent;border-radius:var(--rt-r-sm) var(--rt-r-sm) 0 0;background:none;color:var(--rt-muted);font-size:calc(var(--v2-size,16px)*.9375);font-weight:600;cursor:pointer;margin-bottom:-1px}
#app .screen[data-screen="compliance"] .cmp-tabs button:hover{background:var(--rt-brand-tint);color:var(--rt-ink)}
#app .screen[data-screen="compliance"] .cmp-tabs button[aria-selected=true]{color:var(--rt-brand-ink);border-bottom-color:var(--rt-brand)}
#app .screen[data-screen="compliance"] .cmp-tabs button:focus-visible{outline:3px solid var(--rt-focus);outline-offset:2px}
/* Panels: "Do these first" and maintenance. */
.screen[data-screen="compliance"] .cmp-firsts,.screen[data-screen="compliance"] .cmp-panel{margin:0 0 20px;padding:4px 0}
.screen[data-screen="compliance"] .cmp-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 16px}
.screen[data-screen="compliance"] .cmp-panel-head h2{margin:0;font-size:var(--rt-title-card,17px)}
.screen[data-screen="compliance"] .cmp-note{margin:0;padding:6px 16px 12px}
.screen[data-screen="compliance"] .cmp-small{font-size:var(--rt-text-sm,13px)}
.screen[data-screen="compliance"] .cmp-todos{list-style:none;margin:0;padding:0}
.screen[data-screen="compliance"] .cmp-todo{display:grid;grid-template-columns:auto 1fr auto auto;gap:12px;align-items:center;padding:10px 16px;border-top:1px solid var(--rt-line-soft)}
.screen[data-screen="compliance"] .cmp-when{min-width:118px}
.screen[data-screen="compliance"] .cmp-what b{font-weight:650}
/* The tables. */
.screen[data-screen="compliance"] .cmp-matrix-wrap{overflow-x:auto;margin:0 0 20px}
.screen[data-screen="compliance"] .cmp-panel .cmp-matrix-wrap{margin:0;padding:0 12px 12px}
.screen[data-screen="compliance"] .cmp-matrix{width:100%;border-collapse:separate;border-spacing:0;background:var(--rt-panel);border:1px solid var(--rt-line);border-radius:var(--rt-r)}
.screen[data-screen="compliance"] .cmp-matrix thead th{position:sticky;top:0;text-align:left;font-size:calc(var(--v2-size,16px)*.8125);font-weight:600;color:var(--rt-muted);padding:10px 12px;border-bottom:1px solid var(--rt-line);background:var(--rt-paper);white-space:nowrap}
.screen[data-screen="compliance"] .cmp-matrix tbody :is(td,th){padding:10px 12px;border-bottom:1px solid var(--rt-line-soft);vertical-align:top;text-align:left;font-weight:400}
.screen[data-screen="compliance"] .cmp-matrix tbody tr:last-child :is(td,th){border-bottom:0}
.screen[data-screen="compliance"] .cmp-matrix tbody th{min-width:190px}
.screen[data-screen="compliance"] .cmp-matrix tbody tr:hover{background:var(--rt-brand-tint)}
.screen[data-screen="compliance"] .cmp-sub{display:block;font-size:calc(var(--v2-size,16px)*.75);color:var(--rt-muted);margin-top:3px}
.screen[data-screen="compliance"] .cmp-label{display:block;font-size:calc(var(--v2-size,16px)*.75);color:var(--rt-muted);margin-bottom:3px}
.screen[data-screen="compliance"] .cmp-docs{display:flex;margin-top:5px}
.screen[data-screen="compliance"] a.ui-doc.have{text-decoration:none}
.screen[data-screen="compliance"] a.ui-doc.have:hover{text-decoration:underline}
.screen[data-screen="compliance"] .cmp-cell-btn{margin-top:6px}
.screen[data-screen="compliance"] .cmp-act{text-align:right;white-space:nowrap}
.screen[data-screen="compliance"] .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* A phone: each row becomes a card and every cell says which column it is. */
@media(max-width:760px){
 .screen[data-screen="compliance"] .ui-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
 .screen[data-screen="compliance"] .cmp-todo{grid-template-columns:1fr;gap:6px}
 .screen[data-screen="compliance"] .cmp-matrix,.screen[data-screen="compliance"] .cmp-matrix tbody,.screen[data-screen="compliance"] .cmp-matrix tr,.screen[data-screen="compliance"] .cmp-matrix tbody :is(td,th){display:block;width:100%}
 .screen[data-screen="compliance"] .cmp-matrix{border:0;background:none}
 .screen[data-screen="compliance"] .cmp-matrix thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .screen[data-screen="compliance"] .cmp-matrix tbody tr{margin:0 0 12px;border:1px solid var(--rt-line);border-radius:var(--rt-r);background:var(--rt-panel)}
 .screen[data-screen="compliance"] .cmp-matrix tbody td[data-label]::before{content:attr(data-label);display:block;font-size:calc(var(--v2-size,16px)*.75);font-weight:600;color:var(--rt-muted);margin-bottom:3px}
 .screen[data-screen="compliance"] .cmp-matrix tbody th{min-width:0}
 .screen[data-screen="compliance"] .cmp-act{text-align:left}
}
