/* ═══ ROUND C — Aurora (reference) + Daylight (own palette). 2026-10-25.
   C1 table upgrades (sticky column headers · Compact density · hover row actions) · C2 the collapsible sidebar + live counts.
   Prefixes (build-time): the two-theme prefix → :root:root:is([data-theme="aurora"],[data-theme="daylight"]); "strong" adds an id-level
   hop (:is(#appShell,body)) to beat the page's own #view-dash rules; "rail" / "compact" = the two-theme root carrying
   [data-rail="icons"] / [data-density="compact"], then the id-level hop. The other five themes never see these selectors match. ═══ */

/* ── C1a sticky column headers. A table header can only stick to the window when no ancestor scrolls, so from 1180 px up (where every
   table fits its card) the table wrapper and its card clip instead of scrolling; below that the wrapper keeps today's sideways scroll.
   The header stops just under the pinned navigation bar (--pr-tb-ph = the bar's height, copied from page-topbar.js). ── */
@media (min-width:1180px){
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .tw{overflow-x:clip!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(.card,.sheets-card):has(>.tw),:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(.card,.sheets-card):has(>.dt){overflow:clip!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .tw>.dt>thead>tr>th,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .card>.dt>thead>tr>th{position:sticky!important;top:calc(var(--pr-tb-ph,56px) + 6px)!important;z-index:3;
    background:var(--pr-thead-solid,#f3f2fb)!important;box-shadow:0 1px 0 var(--thead-rule);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
  :root:root[data-theme="aurora"]{--pr-thead-solid:rgba(236,234,252,.96)}
  :root:root[data-theme="daylight"]{--pr-thead-solid:rgba(240,241,245,.96)}
}

/* ── C1b Compact density (Settings ▾ → "Compact rows"; html[data-density="compact"], per browser). Type stays on the Round A scale;
   only the room around it shrinks. ── */
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .main{padding:14px 18px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .stats{gap:10px!important;margin-bottom:12px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .stat{padding:12px 14px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .pr-attn{padding:7px 10px 7px 14px!important;margin-bottom:10px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .fbar{padding:8px 10px!important;gap:6px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .dt th{padding:7px 10px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .dt td{padding:5px 10px!important;height:auto!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) #view-dash .sheets-card .dt td{padding:5px 8px!important;height:auto!important}   /* the Dashboard cells carry a fixed height (42.5 px after the density pass) — let the content set it */
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .dt td .sub2{display:none}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) #drvBody td{padding:6px 10px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .sec-hdr{padding:10px 14px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .card{margin-bottom:12px!important}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .pr-nc-item{padding:6px 26px 6px 10px}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .pr-row-act button{width:24px;height:24px}
:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-density="compact"] :is(#appShell,body) .pr-row-act button svg{width:12px;height:12px}

/* ── C1c hover row actions on the Dashboard: a last column, empty header; Open · PDF · Message appear on hover or keyboard focus ── */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt th.pr-ra-th{width:118px;min-width:118px}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-row-act{display:inline-flex;align-items:center;gap:4px;opacity:0;transition:opacity .15s;vertical-align:middle}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt tr:hover .pr-row-act,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt tr:focus-within .pr-row-act{opacity:1}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-row-act button{width:30px;height:30px;border-radius:999px;border:1px solid var(--th-brd);background:var(--th-glass-hi);color:var(--txt-ctl);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;box-shadow:0 1px 0 #fff inset;transition:transform .35s cubic-bezier(.34,1.5,.64,1),background .2s,color .2s}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-row-act button:hover{background:var(--th-black);color:#fff;border-color:var(--th-black);transform:translateY(-1px)}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-row-act button svg{width:14px;height:14px}

/* ── C1e the actions column steps aside (office-round-c.js fitActions puts .pr-ra-off on the Dashboard card when, with the column, the table would be wider
   than its card — from 1,180 px Aurora/Daylight cut the table at the card edge, so the buttons and then the Status edge would be lost). Nothing here matches
   unless .pr-ra-off is on the card. The header band's rounded right end moves to Status, the new last cell (the same four properties th:last-child has). ── */
@media (min-width:1180px){
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .sheets-card.pr-ra-off .dt :is(th.pr-ra-th,td.pr-ra-td){display:none!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .sheets-card.pr-ra-off .tw>.dt>thead>tr>th:nth-last-child(2){border-right-width:1px!important;border-right-style:solid!important;border-top-right-radius:12px!important;border-bottom-right-radius:12px!important;box-shadow:none!important}
}

/* ── C2 the collapsible sidebar (desk only; on phones the rail stays the drawer it is). html[data-rail="icons"], per browser. ── */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-rail-toggle{display:none}
@media (min-width:861px){
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .sidebar{transition:width .25s cubic-bezier(.2,.8,.3,1)}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-rail-toggle{display:flex;align-items:center;gap:8px;margin:8px 4px 0;height:34px;padding:0 10px;border-radius:999px;border:1px solid var(--rail-line);background:transparent;color:var(--rail-dim);font:500 12px 'IBM Plex Sans',sans-serif;cursor:pointer;white-space:nowrap;overflow:hidden}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-rail-toggle:hover{background:rgba(255,255,255,.5);color:var(--rail-txt)}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-rail-toggle svg{flex:0 0 14px;transition:transform .25s}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .sidebar{width:64px!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .s-logo{padding:18px 0 14px!important;justify-content:center}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .s-logo>div:not(.s-mark){display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .s-nav{padding:8px 7px!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .s-nav-label{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .nav-btn{position:relative;justify-content:center;gap:0!important;padding:11px 0!important;font-size:0!important;line-height:0!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .nav-btn svg{width:18px!important;height:18px!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .nav-btn .msg-badge,:root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .nav-btn .pr-nav-count{position:absolute;top:3px;right:4px;margin:0;font-size:10px!important;line-height:1!important;min-width:16px;height:16px;padding:0 4px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .pr-rail-toggle{margin:8px auto 0;width:34px;padding:0;justify-content:center}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .pr-rail-toggle span{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"])[data-rail="icons"] :is(#appShell,body) .pr-rail-toggle svg{transform:rotate(180deg)}
}
/* the live counts next to Dashboard and Drivers & Brokers (the strip's own numbers): the same badge the page uses for Expenses */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-nav-count{margin-left:auto;background:var(--th-acc);color:#fff;font-size:10px;font-weight:700;border-radius:100px;min-width:18px;height:18px;padding:0 5px;display:none;align-items:center;justify-content:center;line-height:1;box-shadow:none}
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .nav-btn .pr-nav-count.on{display:inline-flex}

/* ── C3 phone layout (≤ 760 px): the bottom tab bar · tables as cards · 44 px targets. Phones keep the sidebar as the drawer it is
   (opened from "More"); ☰ and ⋯ leave the header because the bar carries the navigation. ── */
@media (max-width:760px){
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .main{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .menu-btn,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .gn-more{display:none!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .toast{bottom:calc(92px + env(safe-area-inset-bottom,0px))!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-undo{bottom:calc(140px + env(safe-area-inset-bottom,0px))}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-rail-toggle{display:none!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #portal-floating-actions .pr-floating-actions{bottom:calc(88px + env(safe-area-inset-bottom,0px))!important}   /* the floating + rises above the bar */
  /* the tab bar */
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tabs{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));z-index:950;display:flex;align-items:stretch;height:64px;padding:5px;border-radius:24px;background:var(--th-glass-hi);border:1px solid var(--th-brd);box-shadow:0 20px 40px -18px rgba(var(--th-shadow-rgb),.5),0 1px 0 #fff inset;-webkit-backdrop-filter:blur(22px) saturate(160%);backdrop-filter:blur(22px) saturate(160%)}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab{flex:1 1 0;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;background:transparent;border-radius:18px;color:var(--txt-dim);font:500 10.5px/1 'IBM Plex Sans',sans-serif;cursor:pointer;position:relative;padding:0 2px;transition:background .2s,color .2s}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab svg{width:20px;height:20px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab .lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab.on{background:var(--th-black);color:#fff}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab .n{position:absolute;top:5px;left:calc(50% + 4px);min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--th-acc);color:#fff;font:700 10px/16px 'IBM Plex Sans',sans-serif;text-align:center;display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab .n.on{display:block}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) .pr-tab.on .n{background:#fff;color:var(--th-black)}
  /* the Alerts panel as a sheet above the bar (round-c.js moves it out of the navigation pill on phones) */
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) body>.pr-nc{position:fixed;left:8px;right:8px;bottom:calc(80px + env(safe-area-inset-bottom,0px));z-index:960}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) body>.pr-nc .gn-item{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) body>.pr-nc .pr-nc-menu{position:static;width:auto;max-height:min(60vh,520px);margin:0;transform-origin:bottom center}
  /* tables become cards: the Dashboard trip sheets, the directory, the expenses */
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .tw{overflow-x:visible!important;background:none!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt{min-width:0!important;display:block;width:100%}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt thead{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody{display:flex;flex-direction:column;gap:10px;padding:8px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 12px;padding:12px 14px;border-radius:16px;background:var(--th-glass-hi);border:1px solid var(--th-brd);box-shadow:0 1px 0 #fff inset;height:auto!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody tr.voidrow{opacity:.6}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td{display:block;padding:0!important;height:auto!important;border:0!important;background:transparent!important;white-space:normal!important;min-width:0;position:static!important;text-align:left!important;font-size:13px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td[data-label]::before{content:attr(data-label);display:block;font:500 10px 'IBM Plex Sans',sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--txt-dim);margin-bottom:2px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td.pr-card-title{order:-2;grid-column:1;font-weight:600;font-size:14px;align-self:center}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td.pr-card-title::before{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td.pr-card-status{order:-1;grid-column:2;justify-self:end;align-self:center}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(#view-dash,#view-drivers,#view-expenses) .dt tbody td.pr-card-status::before{display:none}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt tbody td.pr-ra-td{grid-column:1/-1;display:flex;justify-content:flex-end;padding-top:4px!important}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt tbody td.pr-ra-td .pr-row-act{opacity:1}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) #view-dash .dt tbody td.grandc{font-weight:600}
  /* 44 px targets */
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .chip,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .kpi-seg-btn,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-attn-chip{min-height:40px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .pr-row-act button{width:38px;height:38px}
  :root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .nav-btn{min-height:44px}
}

/* ── C4 accessibility audit (qa/a11y-audit.cjs → A11Y-AUDIT.json): the texts under 4.5:1 in the two themes, and focus rings the audit
   found missing. Scoped to the two themes; the originals keep their colours. ── */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .kpi-fsc{color:#8a4b12!important}                                                   /* KPI "FSC —" chip: 3.96 → 6.5 */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .dh-lbl,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .dh-meta{color:var(--txt-dim)!important}                            /* Driver Hours labels: 2.45 → 5.4 */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .wtg-flag.wtg-warn,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .wtg-tag.wtg-k-unknown,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .wtg-status.wtg-st-pending,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .wtg-btn-glass.wtg-amber,:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .wtg-rstate.wtg-open{color:#8a4b12!important}   /* Waiting Time amber: 3.96 → 6.5 */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) .t-av{background:#4b5566!important;color:#fff!important}                            /* Messages avatars: 2.56 → 7.6 */
:root:root:is([data-theme="aurora"],[data-theme="daylight"]) :is(#appShell,body) :is(.py-button,.pr-view-save,.pr-tab,.pr-rail-toggle,.pr-row-act button,.pr-attn-chip,.pr-nc-item,.pr-nc-all,.pr-undo button,.pr-view-x):focus-visible{outline:2px solid var(--ring)!important;outline-offset:2px!important}
