:root{--ground:#F4F6F9;--surface:#FFFFFF;--ink:#0E1A2B;--text:#3B4657;--muted:#556072;--line:#D5DBE3;--line-soft:#E3E8EE;--line-faint:#EEF1F5;--sunk:#E6EAF0;--accent:#F5A623;--accent-text:#8F5A00;--ok:#2F7D4F;--error:#B42318;--error-bg:#FDF0EE;--plate:#F5A623;--sans:'Archivo',system-ui,-apple-system,'Segoe UI',sans-serif;--mono:'JetBrains Mono',ui-monospace,Menlo,monospace}
*{box-sizing:border-box}
/* The document canvas paints OS-owned safe areas in installed mobile apps.
   Keep it the same solid colour as the header; place light surfaces inside. */
html{-webkit-text-size-adjust:100%;background:var(--ink);--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);font-size:15px;line-height:1.5}
h1,h2,p{margin:0}
button{font:inherit;color:inherit}
a{color:var(--ink)}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px;box-shadow:0 0 0 6px var(--accent)}
[hidden]{display:none!important}
.wrap{max-width:1320px;margin:0 auto;padding-left:32px;padding-right:32px}
.muted{color:var(--muted);font-size:14px}
.mono{font-family:var(--mono)}

.topbar{background:var(--surface);border-bottom:1px solid var(--line)}
.topbar-inner{display:flex;align-items:center;gap:16px;min-height:60px}
.topbar-inner .privacy{margin-left:auto}
.brand{display:flex;align-items:center;text-decoration:none}
.brand img{display:block;height:22px;width:auto}
.privacy{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted)}
.privacy svg{color:var(--ok)}
.privacy-short{display:none}

main.wrap{padding-top:40px;padding-bottom:72px}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border-radius:8px;font-size:15px;font-weight:500;text-decoration:none;cursor:pointer;border:1px solid transparent;white-space:nowrap}
.btn-primary{background:var(--ink);color:#fff;font-weight:600}
.btn-primary:hover{background:#1C2B40}
.btn-outline{background:var(--surface);border-color:var(--ink);color:var(--ink)}
.btn-outline:hover{background:var(--ground)}
.btn-quiet{background:var(--surface);border-color:#C3CBD6;color:var(--ink);font-size:14px;padding:0 14px}
.btn-quiet:hover{border-color:var(--ink)}
.btn-lg{min-height:54px;padding:0 28px;font-size:16px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.link-btn{min-height:44px;padding:0 8px;border:0;background:none;color:var(--muted);font-size:14px;font-weight:500;text-decoration:underline;cursor:pointer}

.notice{margin-bottom:24px;padding:14px 18px;border-radius:8px;background:var(--surface);border:1px solid var(--line);color:var(--text);font-size:14px;display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.notice.error{background:var(--error-bg);border-color:#F1C4BE;color:var(--error)}
.notice a{font-weight:600}

/* Upload */
.upload-layout{display:flex;flex-wrap:wrap;gap:48px;align-items:flex-start;padding-top:16px}
.upload-main{flex:1 1 620px;min-width:0;display:flex;flex-direction:column;gap:28px}
.upload-aside{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:20px}
.eyebrow{display:flex;align-items:center;gap:8px;font-family:var(--mono);font-size:13px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:-12px}
.eyebrow i{width:8px;height:8px;border-radius:2px;background:var(--accent)}
h1,h2,.results-head h1,.upload-main h1{font-weight:700}
.upload-main h1{font-size:48px;line-height:1.08;font-weight:600;letter-spacing:-.02em;max-width:680px}
.lede{font-size:18px;line-height:1.55;color:var(--text);max-width:640px;margin-top:-12px}
.dropzone{background:var(--surface);border:2px dashed #A9B3C1;border-radius:10px;padding:44px 32px;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.dropzone:hover,.dropzone.drag{border-color:var(--ink);background:#FAFBFD}
.dropzone strong{font-size:21px;font-weight:600}
.dropzone .btn{margin-top:6px;pointer-events:none}
.drop-icon{width:56px;height:56px;border-radius:12px;background:var(--ground);display:flex;align-items:center;justify-content:center}
.dropzone[aria-disabled=true]{opacity:.6;cursor:progress}
.card{background:var(--surface);border:1px solid var(--line);border-radius:10px}
.card-quiet{border:1px solid var(--line);border-radius:10px;padding:20px 24px;display:flex;flex-direction:column;gap:8px}
.card-quiet p{font-size:14px;color:var(--text)}
.label{font-family:var(--mono);font-size:12px;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.file-card{overflow:hidden}
.card-head{display:flex;align-items:center;justify-content:space-between;padding:8px 12px 8px 20px;border-bottom:1px solid var(--line-soft)}
.file-row{display:flex;align-items:center;gap:14px;padding:8px 8px 8px 20px;border-bottom:1px solid var(--line-faint)}
.file-row:last-child{border-bottom:0}
.file-row svg{flex:none;color:var(--muted)}
.file-text{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.file-name{font-family:var(--mono);font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-meta{font-size:13px;color:var(--muted)}
.file-state{font-size:13px;font-weight:500;color:var(--ok)}
.icon-btn{width:44px;height:44px;flex:none;border:1px solid transparent;background:none;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--muted)}
.icon-btn:hover{background:var(--ground);color:var(--ink)}
.icon-btn:disabled{opacity:.35;cursor:not-allowed;background:none}
.action-row{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.steps{padding:24px;display:flex;flex-direction:column;gap:22px}
.step{display:flex;gap:14px}
.step-no{font-family:var(--mono);font-size:14px;font-weight:600;color:var(--accent-text)}
.step b{display:block;font-weight:600;margin-bottom:4px}
.step p{font-size:14px;color:var(--text)}

/* Results */
.results-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-bottom:28px}
.results-head h1{font-size:36px;line-height:1.1;font-weight:600;letter-spacing:-.02em;margin-bottom:10px}
.check-line{display:flex;align-items:flex-start;gap:8px;color:var(--text)}
.check-line svg{margin-top:3px}
.check-line svg{color:var(--ok);flex:none}
.head-actions{display:flex;gap:12px;flex-wrap:wrap}
.head-actions .btn{min-height:48px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:28px}
.stat{background:var(--surface);padding:18px 22px;display:flex;flex-direction:column;gap:6px;min-width:0}
.stat strong{font-family:var(--mono);font-size:24px;font-weight:600;letter-spacing:-.01em;overflow-wrap:anywhere}
.split{display:flex;gap:24px;flex-wrap:wrap;align-items:flex-start}
.truck-col{flex:1 1 340px;max-width:420px;min-width:0;display:flex;flex-direction:column;gap:10px}
.truck-list{display:flex;flex-direction:column;gap:10px}
.truck{width:100%;min-height:76px;padding:14px 16px;border-radius:10px;border:1px solid var(--line);background:var(--surface);display:flex;align-items:center;gap:14px;text-align:left;cursor:pointer}
.truck:hover{border-color:#8D98A8}
.truck[aria-pressed=true]{border:2px solid var(--ink);padding:13px 15px}
.truck-meta{flex:1 1 auto;min-width:0;font-size:13px;color:var(--muted)}
.truck-pay{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.truck-pay strong{font-family:var(--mono);font-size:16px;font-weight:600}
.truck-pay small{font-size:12px;color:var(--muted)}
.plate{font-family:var(--mono);font-size:15px;font-weight:600;letter-spacing:.06em;background:var(--plate);color:var(--ink);border:1px solid var(--ink);border-radius:4px;padding:4px 9px;white-space:nowrap}
.plate-lg{font-size:20px;border-width:1.5px;border-radius:5px;padding:5px 12px}
.fine{font-size:13px;color:var(--muted);margin:6px 4px 0}
.panel{flex:2 1 640px;min-width:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;display:flex;flex-direction:column}
.panel-head{padding:20px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;border-bottom:1px solid var(--line-soft)}
.panel-id{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.panel-id strong{display:block;font-size:15px;font-weight:600}
.panel-id .mono{display:block;font-size:13px;color:var(--text)}
.period{display:block;font-size:13px;color:var(--muted)}
.panel-actions{display:flex;gap:8px;flex-wrap:wrap}
.panel-bar{padding:0 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--line-soft)}
.tabs{display:flex;gap:4px}
.tab{min-height:48px;padding:0 12px;border:0;border-bottom:3px solid transparent;background:none;font-size:14px;font-weight:500;color:var(--muted);cursor:pointer}
.tab[aria-selected=true]{border-bottom-color:var(--accent);color:var(--ink);font-weight:600}
.pager{display:flex;align-items:center;gap:6px;flex:0 1 auto;min-width:0}
.pager-select{flex:1 1 auto;min-width:0}
.pager .icon-btn{border-color:#C3CBD6;color:var(--ink)}
.pager-select{min-height:44px;max-width:290px;padding:0 10px;border:1px solid #C3CBD6;border-radius:8px;background:var(--surface);font-family:var(--mono);font-size:13px;color:var(--ink)}
tfoot td{background:#F2F4F8;font-weight:600;border-top:1px solid var(--line);position:sticky;bottom:0}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.panel-body{padding:24px;background:var(--sunk);border-radius:0 0 10px 10px}
.sheet{background:#fff;box-shadow:0 1px 3px rgba(14,26,43,.18)}
.sheet svg{display:block;width:100%;height:auto}
/* Truck invoices: the open invoice stays on screen, and the truck list scrolls with however many trucks there are. */
body.app:has(#view-trucks:not([hidden])){height:100dvh;overflow:hidden}
body.app:has(#view-trucks:not([hidden])) .main{height:100dvh;min-height:0;overflow:hidden}
body.app:has(#view-trucks:not([hidden])) .content{flex:1 1 auto;min-height:0;overflow:hidden;padding-bottom:16px}
#view-trucks:not([hidden]){flex:1 1 auto;min-height:0;overflow:hidden}
#view-trucks .split{flex:1 1 auto;flex-wrap:nowrap;align-items:stretch;height:100%;min-height:0;overflow:hidden}
#view-trucks .truck-col{flex:0 0 360px;width:360px;max-width:360px;max-height:100%;min-width:0;min-height:0;overflow:hidden}
#view-trucks .truck-list{flex:1 1 auto;min-height:0;min-width:0;overflow-y:auto;overscroll-behavior:contain}
/* A short list area must not squash a card: the name would paint over the next truck and the invoice. */
#view-trucks .truck{flex:0 0 auto;min-width:0;max-width:100%;align-items:flex-start}
#view-trucks .truck-pay{flex:none}
#view-trucks .truck-meta{overflow-wrap:anywhere}
#view-trucks .fine{flex:none}
#view-trucks .panel{flex:1 1 auto;min-width:0;min-height:0;max-height:100%;overflow:hidden}
#view-trucks .panel-head,#view-trucks .panel-bar{flex:none}
#view-trucks .panel-body{flex:1 1 auto;min-height:0;overflow:auto;display:flex;flex-direction:column}
#view-trucks .panel-body:has(.zoom-view){padding:0;overflow:hidden}
.zoom-view{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
.zoom-stage{position:absolute;left:0;top:0;transform-origin:0 0}
.zoom-stage .sheet{width:100%;height:100%}
.zoom-stage .sheet svg{width:100%;height:100%}
.zoom-view.is-zoomed{cursor:grab}
.zoom-view.is-panning{cursor:grabbing}
.zoom-toolbar{display:flex;align-items:center;gap:6px;padding:8px 14px;background:#fff;border-bottom:1px solid var(--line);flex:none;flex-wrap:wrap}
.zoom-toolbar .icon-btn{width:40px;height:40px;min-width:40px;border:1px solid var(--line);border-radius:8px}
.zoom-toolbar .icon-btn:disabled{opacity:.35;cursor:not-allowed}
.zoom-select{height:40px;min-width:110px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);padding:0 8px;font:inherit;font-size:14px}
.zoom-status{font:12px var(--mono);color:var(--muted);min-width:42px;margin-left:4px}
.zoom-help{margin-left:auto;color:var(--muted);font-size:11px}
.zoom-view{background:#e6eaf0;overscroll-behavior:contain}
.zoom-view:focus-visible{outline-offset:-3px;box-shadow:none}
@media(max-width:600px){.zoom-toolbar{padding:8px;gap:4px}.zoom-toolbar .icon-btn{width:44px;height:44px}.zoom-select{height:44px;font-size:16px}.zoom-help{display:none}}
.table-wrap{background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:auto;max-height:640px}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{padding:9px 10px;text-align:left;border-bottom:1px solid var(--line-faint);white-space:nowrap;vertical-align:top}
th{position:sticky;top:0;background:#F2F4F8;font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border-bottom:1px solid var(--line)}
td.num,th.num{text-align:right;font-family:var(--mono)}
td.desc{white-space:normal;min-width:220px}
.empty-panel{padding:48px 24px;text-align:center;color:var(--muted)}

/* Dialogs */
dialog{border:0;border-radius:12px;padding:0;width:min(1120px,calc(100vw - 32px));max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));box-shadow:0 24px 64px rgba(14,26,43,.3);color:var(--ink);font-family:var(--sans);overflow:hidden}
/* Header and footer stay in view; only the middle scrolls. */
dialog[open]{display:flex;flex-direction:column}
dialog::backdrop{background:rgba(14,26,43,.5)}
.dialog-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line-soft);background:var(--surface,#fff)}
.dialog-head h2{font-size:18px;font-weight:600;flex:1;min-width:0}
.dialog-back{display:none;gap:4px;padding:0 12px 0 6px;min-height:44px}
.dialog-x{border-color:#C3CBD6;color:var(--ink)}
.dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px;display:flex;flex-direction:column;gap:14px}
.dialog-foot{flex:none;display:flex;justify-content:flex-end;gap:10px;padding:12px 20px;border-top:1px solid var(--line-soft);background:var(--surface,#fff)}
.dialog-foot .btn{min-height:44px}
.dialog-body p{color:var(--text);font-size:14px}
.print-dialog iframe{width:100%;flex:none;height:min(60dvh,760px);border:1px solid var(--line);border-radius:8px;background:var(--sunk)}
.share-dialog{width:min(520px,calc(100vw - 32px))}
.share-steps{display:flex;gap:10px;flex-wrap:wrap}

@media (max-width:760px){
 .wrap{padding-left:16px;padding-right:16px}
 main.wrap{padding-top:24px}
 .privacy-long{display:none}.privacy-short{display:inline}
 .upload-main h1{font-size:34px}
 .lede{font-size:16px}
 .dropzone{padding:32px 20px}
 .results-head h1{font-size:28px}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .stat strong{font-size:19px}
 .truck-col{max-width:none}
 #view-trucks .split{flex-direction:column;height:100%;min-height:0}
 #view-trucks .panel{order:1;flex:1 1 58%;min-height:0;max-height:none;position:relative;top:auto}
 #view-trucks .truck-col{order:2;flex:1 1 42%;width:auto;max-width:none;max-height:none;min-height:120px}
 #view-trucks .zoom-view{min-height:0;height:auto}
 .panel-head,.panel-bar{padding-left:16px;padding-right:16px}
 .panel-body{padding:12px}
 .head-actions{position:fixed;left:0;right:0;bottom:0;z-index:5;background:var(--surface);border-top:1px solid var(--line);padding:12px 16px calc(12px + var(--safe-bottom))}
 .head-actions .btn{flex:1 1 auto}
 #results-view{padding-bottom:150px}
}
@media print{.topbar,.notice{display:none}}

.inv-table th,.inv-table td{padding:8px 6px}
.inv-table td:nth-child(4){white-space:normal;min-width:110px}
.inv-link{min-height:32px;padding:0 2px;border:0;background:none;font-family:var(--mono);font-size:13px;font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.inv-link:hover{color:var(--accent-text)}
.table-hint{font-size:13px;color:var(--muted);margin:0 0 10px}

/* Sign in */
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:32px 16px}
.login-wrap{width:100%;max-width:420px;display:flex;flex-direction:column;align-items:stretch;gap:20px}
.login-brand{display:flex;flex-direction:column;align-items:center;gap:10px}
.login-brand img{display:block;width:min(328px,80vw);height:auto}
.tagline{font-family:var(--mono);font-size:13px;font-weight:600;letter-spacing:.32em;text-transform:uppercase;color:var(--muted);padding-left:.32em}
.hazard{height:8px;margin:-32px -32px 10px;border-radius:10px 10px 0 0;background:repeating-linear-gradient(-45deg,var(--ink) 0 10px,var(--accent) 10px 20px)}
@media (max-width:760px){.hazard{margin:-24px -24px 6px}}
.login-card{padding:32px;display:flex;flex-direction:column;gap:14px;overflow:hidden}
.login-card h1{font-size:30px;line-height:1.1;font-weight:600;letter-spacing:-.02em;margin-top:8px}
.login-card .eyebrow{margin-bottom:0}
.login-card .notice{margin:4px 0 0}
.login-form{display:flex;flex-direction:column;gap:16px;margin-top:6px}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:600}
.field input{min-height:48px;padding:0 14px;border:1px solid #A9B3C1;border-radius:8px;background:var(--surface);font:inherit;font-size:16px;color:var(--ink)}
.field input:focus-visible{outline:2px solid var(--ink);outline-offset:0;box-shadow:0 0 0 5px var(--accent);border-color:var(--ink)}
.login-form .btn{width:100%;margin-top:4px}
.login-foot{display:flex;align-items:center;justify-content:center;gap:8px;font-size:13px;color:var(--muted);text-align:center}
.login-foot svg{color:var(--ok);flex:none}
.signout{display:flex;align-items:center;gap:12px}
.signout form{margin:0}
.who{font-size:14px;color:var(--muted)}
@media (max-width:760px){.who{display:none}.login-card{padding:24px}}

/* ---------- Dashboard shell ---------- */
.skip{position:absolute;left:-999px;top:8px;z-index:50;background:var(--surface);padding:10px 14px;border-radius:8px}
.skip:focus{left:8px}
html.app-shell{height:100%;overflow:hidden;overscroll-behavior:none}
body.app{background:var(--ink);display:block;height:100vh;height:100dvh;min-height:0;overflow:hidden;overscroll-behavior:none}
.sidebar{position:fixed;inset:0 auto 0 0;width:256px;background:var(--ink);color:#C9D2DE;display:flex;flex-direction:column;padding:24px 16px 20px;z-index:30;overflow-y:auto;overscroll-behavior:contain}
.sidebar>*{flex-shrink:0}
.side-brand{display:flex;flex-direction:column;gap:8px;padding:4px 0 20px;text-decoration:none;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:16px}
.sidebar-truck{display:block;width:100%;height:auto;margin-top:0;overflow:hidden}
.side-brand img{width:164px;height:auto;display:block}
.side-brand .tagline{color:#8E9BAE;font-size:11px;padding-left:0}
.side-nav{display:flex;flex-direction:column;gap:4px}
.side-nav a{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:8px;color:#C9D2DE;text-decoration:none;font-weight:500;font-size:15px;position:relative}
.side-nav a:hover{background:rgba(255,255,255,.06);color:#fff}
.side-nav a[aria-current=page]{background:rgba(245,166,35,.14);color:#fff}
.side-nav a[aria-current=page]::before{content:"";position:absolute;left:-16px;top:8px;bottom:8px;width:4px;border-radius:0 4px 4px 0;background:var(--accent)}
.side-nav a[aria-current=page] svg{color:var(--accent)}
.nav-count{margin-left:auto;font-family:var(--mono);font-size:12px;font-weight:600;background:rgba(255,255,255,.1);color:#fff;border-radius:999px;padding:2px 8px}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:14px;padding-top:20px;border-top:1px solid rgba(255,255,255,.08)}
.side-privacy{display:flex;gap:8px;font-size:12px;line-height:1.45;color:#8E9BAE;padding:0 4px}
.side-privacy svg{flex:none;margin-top:2px;color:#6FCF97}
.side-user{display:flex;align-items:center;gap:14px;min-height:88px;padding:14px 12px;border:1px solid rgba(255,255,255,.12);border-radius:14px;background:rgba(255,255,255,.045);text-decoration:none;color:inherit}
.side-user:hover{background:rgba(255,255,255,.09);border-color:rgba(245,166,35,.45)}
.side-user .avatar{width:56px;height:56px;font-size:22px;box-shadow:0 0 0 3px rgba(245,166,35,.14)}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--accent);color:var(--ink);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;flex:none}
.side-user-text{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}
.side-user-text strong{color:#fff;font-size:18px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
.side-user-text small{color:#B3BFD0;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-signout{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0 12px;border-radius:8px;border:1px solid rgba(255,255,255,.14);background:none;color:#C9D2DE;font-weight:500;cursor:pointer}
.side-signout:hover{background:rgba(255,255,255,.06);color:#fff}
.sidebar :focus-visible{outline-color:var(--accent);box-shadow:none}
.main{background:var(--ground);margin-left:256px;height:100%;min-height:0;min-width:0;overflow:hidden;display:flex;flex-direction:column}
.pagebar{position:relative;flex-shrink:0;z-index:10;background:var(--ground);backdrop-filter:none;-webkit-backdrop-filter:none;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:16px 32px;min-height:76px}
.pagebar-title{min-width:0}
.crumb{font-family:var(--mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.pagebar h1{font-size:24px;line-height:1.2;font-weight:700;letter-spacing:-.01em}
.pagebar-actions{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap}
.menu-btn{display:none;color:var(--ink);border-color:var(--line)}
.content{padding:28px 32px 64px;display:flex;flex:1;min-height:0;flex-direction:column;gap:24px;max-width:1440px;width:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;outline:none}
.content>*{flex-shrink:0}
.content .notice{margin-bottom:0}
.view{display:flex;flex-direction:column;gap:24px}
.view[hidden]{display:none!important}
.card{padding:0}
.card.steps{padding:24px}
.card-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:18px 22px 12px;flex-wrap:wrap}
.card-title h2{font-size:16px;font-weight:700}
.card-sub{font-size:13px;color:var(--muted)}
.link{font-size:14px;font-weight:600;color:var(--ink);text-underline-offset:3px}
.table-wrap.flat{border:0;border-radius:0 0 10px 10px;border-top:1px solid var(--line-soft);max-height:none}
.table-wrap.tall{max-height:calc(100vh - 290px);border-radius:10px;border-top:0}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}

/* KPI tiles */
.kpis{display:grid;grid-template-columns:1.4fr repeat(4,minmax(0,1fr));gap:16px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:18px 20px;display:flex;flex-direction:column;gap:6px;min-width:0}
.kpi strong{font-family:var(--mono);font-size:24px;font-weight:600;letter-spacing:-.01em;line-height:1.15;overflow-wrap:anywhere}
.kpi small{font-size:13px;color:var(--muted)}
.kpi-hero{background:var(--ink);border-color:var(--ink);color:#fff;position:relative;overflow:hidden}
.kpi-hero .label{color:#AFC0D4}
.kpi-hero strong{font-size:30px;color:#fff}
.kpi-hero small{color:#C9D2DE}
.kpi-hero::after{content:"";position:absolute;left:0;right:0;bottom:0;height:6px;background:repeating-linear-gradient(-45deg,var(--ink) 0 8px,var(--accent) 8px 16px)}

/* Charts: single series, Haul Navy marks, text in text tokens */
.chart-card{display:flex;flex-direction:column}
.hbars{list-style:none;margin:0;padding:6px 22px 22px;display:flex;flex-direction:column;gap:12px}
.hbar{display:grid;grid-template-columns:92px minmax(0,1fr) 96px;align-items:center;gap:12px;position:relative;border-radius:6px;outline-offset:4px}
.hbar .plate{font-size:12px;padding:2px 6px;justify-self:start}
.hbar-track{height:16px;position:relative}
.hbar-fill{position:absolute;left:0;top:0;bottom:0;background:var(--ink);border-radius:0 4px 4px 0;min-width:2px}
.hbar-value{font-family:var(--mono);font-size:13px;font-weight:600;text-align:right}
.hbar:hover .hbar-fill,.hbar:focus .hbar-fill,.col:hover .col-fill,.col:focus .col-fill{background:#2A4466}
.tip{position:absolute;z-index:5;pointer-events:none;background:var(--ink);color:#fff;border-radius:8px;padding:10px 12px;font-size:13px;line-height:1.45;box-shadow:0 8px 24px rgba(14,26,43,.25);opacity:0;transform:translateY(4px);transition:opacity .12s,transform .12s;white-space:nowrap}
.tip b{font-family:var(--mono)}
.tip-row{display:flex;justify-content:space-between;gap:16px}
.tip-row span:last-child{font-family:var(--mono)}
.hbar .tip{left:104px;bottom:calc(100% + 6px)}
.hbar:hover .tip,.hbar:focus .tip,.col:hover .tip,.col:focus .tip{opacity:1;transform:none}
.cols{position:relative;height:240px;margin:6px 22px 22px 64px}
.cols-grid{position:absolute;inset:0 0 28px 0}
.gridline{position:absolute;left:0;right:0;border-top:1px solid var(--line-faint)}
.gridline span{position:absolute;right:calc(100% + 10px);top:-8px;font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap}
.gridline.base{border-top-color:var(--line)}
.cols-row{position:absolute;inset:0 0 0 0;display:flex;align-items:stretch;justify-content:space-around;gap:2px}
.col{flex:1 1 0;max-width:96px;display:flex;flex-direction:column;align-items:center;position:relative;outline-offset:2px;border-radius:6px}
.col-plot{flex:1 1 auto;width:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;margin-bottom:28px;position:relative}
.col-value{font-family:var(--mono);font-size:12px;font-weight:600;margin-bottom:6px}
.col-fill{width:min(56px,70%);background:var(--ink);border-radius:4px 4px 0 0;min-height:2px}
.col-label{position:absolute;bottom:4px;font-family:var(--mono);font-size:12px;color:var(--muted);white-space:nowrap}
.col .tip{bottom:calc(100% - 20px);left:50%;transform:translate(-50%,4px)}
.col:hover .tip,.col:focus .tip{transform:translate(-50%,0)}
/* The first and last weeks' tooltips line up with the chart edge so they never push the page sideways. */
.col:first-child .tip{left:0;transform:translateY(4px)}.col:last-child .tip{left:auto;right:0;transform:translateY(4px)}
.col:first-child:hover .tip,.col:first-child:focus .tip,.col:last-child:hover .tip,.col:last-child:focus .tip{transform:none}

/* Tables on cards */
.data-table td,.data-table th{padding:10px 14px}
.data-table tbody tr:hover{background:#F7F9FB}
.data-table .plate{font-size:12px;padding:2px 6px}
.row-actions{display:flex;gap:6px;justify-content:flex-end}
.btn-xs{min-height:34px;padding:0 10px;font-size:13px;border-radius:6px}

/* Empty states */
.empty-state{padding:40px 32px;display:flex;flex-direction:column;align-items:flex-start;gap:14px;overflow:hidden}
.empty-state h2{font-size:24px;font-weight:700}
.empty-state p{color:var(--text);max-width:560px}
.empty-state .hazard{margin:-40px -32px 18px;width:calc(100% + 64px);border-radius:0}
.steps-row{list-style:none;margin:18px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;width:100%}
.steps-row li{display:flex;flex-direction:column;gap:4px;border-top:1px solid var(--line-soft);padding-top:14px}
.steps-row li span:last-child{font-size:14px;color:var(--text)}

/* Charges filters */
.filters{display:flex;align-items:flex-end;gap:16px;padding:16px 20px;flex-wrap:wrap}
.filters .field{flex:1 1 240px}
.filters .field:nth-child(2){flex:0 1 200px}
.filters input,.filters select{min-height:44px;padding:0 12px;border:1px solid #A9B3C1;border-radius:8px;background:var(--surface);font:inherit;font-size:15px;color:var(--ink)}
.filter-summary{font-size:14px;color:var(--text);min-height:44px;display:flex;align-items:center;margin-left:auto}

/* Upload hero inside the shell */
.upload-layout{padding-top:0}
.upload-main h2.hero{font-size:40px;line-height:1.08;font-weight:700;letter-spacing:-.02em;max-width:680px}
/* Split by truck stays on this screen. The file list can grow without pushing the button away. */
#view-upload{padding-bottom:112px}
#view-upload .action-row{position:fixed;z-index:8;left:256px;right:0;bottom:0;margin:0;flex-wrap:nowrap;padding:12px 32px;background:var(--ground);border-top:1px solid var(--line);box-shadow:0 -8px 24px rgba(14,26,43,.06)}
#view-upload .action-row .muted{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-scrim{position:fixed;inset:0;background:rgba(14,26,43,.45);z-index:25}

@media (max-width:1180px){.kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.kpi-hero{grid-column:1/-1}.grid-2{grid-template-columns:minmax(0,1fr)}}
@media (max-width:1024px){
 .sidebar{transform:translateX(-100%);transition:transform .2s;box-shadow:0 0 40px rgba(14,26,43,.35)}
 body.nav-open .sidebar{transform:none}
 body.nav-open .content{overflow-y:hidden}
 .main{margin-left:0}
 .menu-btn{display:inline-flex}
 .pagebar{padding:calc(12px + var(--safe-top)) max(16px,var(--safe-right)) 12px max(16px,var(--safe-left));min-height:64px;background:var(--ink);color:#fff;border-bottom-color:rgba(255,255,255,.12);backdrop-filter:none;-webkit-backdrop-filter:none}
 .pagebar .crumb{color:#B3BFD0}
 .pagebar :is(.icon-btn,.btn-outline){color:#fff;background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.2)}
 .pagebar :is(.icon-btn,.btn-outline):hover:not(:disabled){color:#fff;background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.4)}
 .pagebar :focus-visible{outline-color:#fff}
 .pagebar-actions{flex-wrap:nowrap}
 .pagebar-title .crumb,.pagebar-title h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .pagebar h1{font-size:20px}
 .pagebar-actions .btn span{display:none}
 .pagebar-actions .btn{padding:0 12px}
 .content{padding:20px max(16px,var(--safe-right)) calc(48px + var(--safe-bottom)) max(16px,var(--safe-left))}
 .steps-row{grid-template-columns:minmax(0,1fr)}
 .upload-main h2.hero{font-size:30px}
 #view-upload .action-row{left:0;padding:8px max(16px,var(--safe-right)) calc(6px + var(--safe-bottom)) max(16px,var(--safe-left))}
 .cols{margin-left:56px}
 .hbar{grid-template-columns:84px minmax(0,1fr) 84px}
 #results-view{padding-bottom:0}
}
@media (prefers-reduced-motion:reduce){.sidebar,.tip{transition:none}}

/* ---------- Sign-in: split screen ---------- */
body.auth{min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:minmax(380px,46%) minmax(0,1fr);background:var(--ground)}
.auth-side{position:relative;background:var(--ink);color:#C9D2DE;padding:48px 56px 0;display:flex;flex-direction:column;gap:40px;overflow:hidden}
.auth-side::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 85% 10%,rgba(245,166,35,.16),transparent 45%);pointer-events:none}
.auth-brand{display:flex;flex-direction:column;gap:10px;position:relative}
.auth-brand img{width:210px;height:auto;display:block}
.auth-brand .tagline{color:#8E9BAE;padding-left:0}
.auth-pitch{position:relative;display:flex;flex-direction:column;gap:18px;max-width:460px;margin-top:auto}
.auth-pitch h2{font-size:44px;line-height:1.05;font-weight:700;letter-spacing:-.02em;color:#fff}
.auth-pitch p{font-size:17px;line-height:1.55;color:#C9D2DE}
.auth-points{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:18px}
.auth-points li{display:flex;gap:14px;align-items:flex-start}
.auth-points b{display:block;color:#fff;font-weight:600;margin-bottom:2px}
.auth-points span:last-child{font-size:14px;line-height:1.5;color:#AFC0D4}
.auth-icon{width:36px;height:36px;flex:none;border-radius:10px;background:rgba(245,166,35,.14);color:var(--accent);display:flex;align-items:center;justify-content:center}
.auth-truck{position:relative;width:100%;max-width:520px;height:auto;margin-top:auto;display:block}
.auth-stripe{height:12px;margin:0 -56px;background:repeating-linear-gradient(-45deg,var(--ink) 0 12px,var(--accent) 12px 24px)}
.auth-main{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:48px 24px}
.auth-card{width:100%;max-width:420px;display:flex;flex-direction:column;gap:14px}
.auth-card h1{font-size:36px;line-height:1.1;font-weight:700;letter-spacing:-.02em;margin-top:6px}
.auth-card .eyebrow{margin-bottom:0}
.auth-card .notice{margin:4px 0 0}
.auth-card .btn-lg{width:100%;margin-top:6px}
.auth-help{font-size:14px;color:var(--muted);margin-top:4px}
.password-field{position:relative}
.password-field input{width:100%;padding-right:76px}
.show-password{position:absolute;right:6px;top:50%;transform:translateY(-50%);min-height:36px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.show-password:hover{background:var(--ground)}
.show-password:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.text-link{border:0;background:none;padding:0;font:inherit;font-weight:600;color:var(--ink);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.text-link:hover{color:var(--accent-text)}
.password-form{display:flex;flex-direction:column;gap:14px}
.password-form h3{margin:8px 0 0;font-size:16px}
.settings-body .password-field input{padding-right:76px}
.auth-foot{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.auth-foot svg{color:var(--ok)}
.auth-logo-mobile{display:none;width:200px;height:auto;margin-bottom:12px}
@media (max-width:1024px){
 body.auth{grid-template-columns:minmax(0,1fr);background:var(--ink)}
 .auth-main{background:var(--ground)}
 body:is(.app,.auth)::before{content:"";position:fixed;inset:0 0 auto;height:var(--safe-top);background:var(--ink);z-index:40;pointer-events:none}
 .auth-side{display:none}
 .auth-logo-mobile{display:block}
 .auth-main{justify-content:flex-start;padding-top:calc(40px + var(--safe-top));padding-left:max(24px,var(--safe-left));padding-right:max(24px,var(--safe-right));border-top:8px solid transparent;border-image:repeating-linear-gradient(-45deg,var(--ink) 0 10px,var(--accent) 10px 20px) 8}
}
@media (max-height:760px) and (min-width:1025px){.auth-truck{display:none}.auth-pitch{margin-bottom:40px}}
.hbars{flex:1 1 auto;justify-content:space-evenly}
.col .tip{top:12px;bottom:auto}

/* Keep me signed in */
.check{display:flex;align-items:flex-start;gap:12px;cursor:pointer;padding:4px 0;min-height:44px}
.check input{position:absolute;opacity:0;width:1px;height:1px}
.check-box{flex:none;width:22px;height:22px;margin-top:1px;border:1.5px solid #A9B3C1;border-radius:6px;background:var(--surface);display:flex;align-items:center;justify-content:center;color:transparent;transition:background .12s,border-color .12s}
.check input:checked+.check-box{background:var(--ink);border-color:var(--ink);color:var(--accent)}
.check input:focus-visible+.check-box{outline:2px solid var(--ink);outline-offset:2px;box-shadow:0 0 0 5px var(--accent)}
.check-text{display:flex;flex-direction:column;gap:2px}
.check-text b{font-size:14px;font-weight:600}
.check-text small{font-size:13px;color:var(--muted)}

/* Check invoices */
.review-intro{padding:28px 28px 22px;display:flex;flex-direction:column;gap:8px;overflow:hidden}
.review-intro .hazard{margin:-28px -28px 12px;width:calc(100% + 56px);border-radius:0}
.review-intro h2{font-size:20px;font-weight:700}
.review-list{display:flex;flex-direction:column;gap:20px}
.review-body{padding:0 22px 20px;display:flex;flex-direction:column;gap:14px}
.review-issue{display:flex;gap:10px;align-items:flex-start;background:#FFF7E8;border:1px solid #F3D7A0;border-radius:8px;padding:10px 12px;color:#5C3D00;font-size:14px}
.review-issue svg{flex:none;margin-top:2px;color:#8F5A00}
.review-body select{min-height:40px;padding:0 10px;border:1px solid #A9B3C1;border-radius:8px;background:var(--surface);font:inherit;font-size:14px}
.tag-warn{display:inline-block;margin-left:6px;font-size:11px;font-weight:600;color:#5C3D00;background:#FFF0D1;border-radius:999px;padding:1px 8px}

/* Profile menu (top right) */
.bar-tools{display:flex;align-items:center;gap:4px;flex:none;padding:4px;background:#F0F3F7;border:1px solid #E3E8EF;border-radius:14px}
.bar-logout{margin:0;display:flex}
.bar-icon{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:44px;min-width:44px;height:40px;padding:0;border:1px solid transparent;border-radius:10px;background:transparent;color:#48576A;text-decoration:none;font:inherit;font-size:13px;font-weight:600;white-space:nowrap}
.bar-icon:hover{border-color:#D8DFE8;background:#fff;color:var(--ink)}
.bar-icon[aria-current=page]{background:#fff;border-color:#E3E8EF;color:var(--ink);box-shadow:0 1px 3px rgba(14,26,43,.08)}
.bar-icon[aria-current=page] svg{color:#AD700B}
#bar-logout{color:#A23D36}
#bar-logout:hover{background:#FFF0EE;border-color:#F3D2CD;color:#892C26}
@media(max-width:480px){.bar-icon span{display:none}.bar-icon{padding:0;width:40px}.bar-tools{gap:2px}}
.user-menu{position:relative}
.user-btn{display:flex;align-items:center;gap:8px;min-height:44px;padding:4px 10px 4px 4px;border:1px solid var(--line);border-radius:999px;background:var(--surface);cursor:pointer;font:inherit;font-weight:600;font-size:14px;color:var(--ink)}
.user-btn:hover{border-color:#8D98A8}
.user-btn .chev{color:var(--muted)}
.user-name{max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.avatar{overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-lg{width:44px;height:44px;font-size:18px}
.avatar-xl{width:96px;height:96px;font-size:36px}
.menu{position:absolute;right:0;top:calc(100% + 8px);z-index:20;width:280px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 16px 40px rgba(14,26,43,.18);padding:8px}
.menu-head{display:flex;align-items:center;gap:12px;padding:10px 10px 14px;border-bottom:1px solid var(--line-soft);margin-bottom:6px}
.menu-id{display:flex;flex-direction:column;min-width:0}
.menu-id strong{font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu-id small{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu form{margin:0}
.menu-item{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0 10px;border:0;border-radius:8px;background:none;font:inherit;font-size:14px;font-weight:500;color:var(--ink);text-decoration:none;cursor:pointer}
.menu-item:hover,.menu-item:focus-visible{background:var(--ground)}
.menu-item svg{color:var(--muted)}
/* Settings */
.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:24px;align-items:start}
.settings-body{padding:4px 22px 22px;display:flex;flex-direction:column;gap:16px}
.settings-body input,.settings-body textarea{min-height:44px;padding:10px 12px;border:1px solid #A9B3C1;border-radius:8px;background:var(--surface);font:inherit;font-size:15px;color:var(--ink);width:100%}
.settings-body textarea{resize:vertical}
.field-label{font-size:14px;font-weight:600}
.photo-row{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.photo-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.photo-actions label{cursor:pointer}
.photo-actions p{flex-basis:100%}
@media (max-width:1024px){.user-name,.user-btn .chev{display:none}.user-btn{padding:4px}}

/* Sign-in truck: drives in, then keeps running (wheels spin, road and speed lines rush past). */
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .truck-all{animation:hs-drive-in 1.6s cubic-bezier(.2,.8,.2,1) both}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .truck-body{animation:hs-bounce .9s ease-in-out infinite}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .wheel{transform-box:fill-box;transform-origin:center;animation:hs-spin .55s linear infinite}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .road-dash{animation:hs-road .55s linear infinite}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .speed line{opacity:0;animation:hs-speed .8s linear infinite}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .speed line:nth-child(2){animation-delay:.2s}:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .speed line:nth-child(3){animation-delay:.4s}:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .speed line:nth-child(4){animation-delay:.6s}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .puff{opacity:0;transform-box:fill-box;transform-origin:center;animation:hs-puff 1.8s ease-out infinite}
:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .puff:nth-child(2){animation-delay:.6s}:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .puff:nth-child(3){animation-delay:1.2s}
@keyframes hs-drive-in{from{transform:translateX(-110%)}to{transform:none}}
@keyframes hs-bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-1.5px)}}
@keyframes hs-spin{to{transform:rotate(360deg)}}
@keyframes hs-road{to{stroke-dashoffset:50}}
@keyframes hs-speed{0%{opacity:0;transform:translateX(12px)}30%{opacity:.6}100%{opacity:0;transform:translateX(-26px)}}
@keyframes hs-puff{0%{opacity:.5;transform:translate(0,0) scale(.6)}100%{opacity:0;transform:translate(-34px,-18px) scale(1.9)}}
@media (prefers-reduced-motion:reduce){:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) *{animation:none!important}:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .speed line,:is(.auth-truck,.sidebar-truck,.dashboard-road-truck) .puff{opacity:0}}

.back-btn{border-color:var(--line);background:var(--surface);color:var(--ink)}
.back-btn:hover:not(:disabled){background:var(--sunk);border-color:#A9B3C1}
.back-btn:disabled{opacity:.35;cursor:default}
@media(max-width:480px){.pagebar{gap:8px}}

/* Mobile portal: keep navigation reachable and content within the viewport. */
.view,.settings-card,.chart-card,.field,.review-list{min-width:0}
.settings-grid{grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr))}
.table-wrap{max-width:100%;overscroll-behavior-x:contain}
.sidebar-close{display:none}
@media(max-width:1024px){
 .sidebar{width:min(288px,calc(100vw - 48px));padding-top:calc(48px + var(--safe-top));padding-bottom:calc(20px + var(--safe-bottom))}
 .sidebar-close{display:inline-flex;position:absolute;right:12px;top:calc(8px + var(--safe-top));color:#fff;background:rgba(255,255,255,.08)}
 .side-brand{max-width:224px;width:100%;align-self:center}
 .side-nav a{min-height:48px}
 .content{padding-bottom:calc(32px + var(--safe-bottom))}
 .settings-body input,.settings-body textarea,.filters input,.filters select,.review-body select,.pager-select{font-size:16px}
 .btn-xs,.inv-link,.show-password{min-height:44px}
 .bar-icon{height:44px}
 body.app:has(#view-trucks:not([hidden])) .content{overflow-y:auto}
 #view-trucks:not([hidden]){flex:none;overflow:visible}
 #view-trucks .split{height:auto;overflow:visible;flex-direction:column;gap:16px}
 #view-trucks .truck-col{order:0;flex:none;width:100%;max-width:none;min-height:0;overflow:visible}
 #view-trucks .truck-list{flex:none;flex-direction:row;overflow-x:auto;overflow-y:hidden;padding:3px 2px 12px;scroll-snap-type:x proximity;gap:12px}
 #view-trucks .truck{flex:0 0 min(280px,85vw);display:grid;grid-template-columns:1fr auto;gap:8px;scroll-snap-align:start}
 #view-trucks .truck .plate{justify-self:start}
 #view-trucks .truck-meta{grid-row:2;grid-column:1/-1}
 #view-trucks .truck-pay{grid-column:2;grid-row:1}
 #view-trucks .fine{margin-top:0}
 #view-trucks .panel{order:1;flex:none;max-height:none;min-height:0;width:100%}
 #view-trucks .panel-body{flex:none;height:55dvh;min-height:320px;max-height:680px}
 #view-trucks .zoom-view{height:100%;min-height:0}
 .panel-id>div{min-width:0;overflow-wrap:anywhere}
 .panel-actions{width:100%}.panel-actions .btn{flex:1;padding:0 10px}
 .panel-bar{gap:8px;padding-top:4px;padding-bottom:4px}
 .pager{width:100%;padding-bottom:6px}.pager-select{max-width:none}
}
@media(max-width:600px){
 .pagebar{display:grid;grid-template-columns:44px 44px minmax(0,1fr);gap:6px 8px;padding:calc(8px + var(--safe-top)) max(12px,var(--safe-right)) 10px max(12px,var(--safe-left));min-height:0}
 .menu-btn{grid-column:1;grid-row:1}.back-btn{grid-column:2;grid-row:1}
 .pagebar-actions{grid-column:3;grid-row:1;justify-self:end;gap:6px;margin:0;align-items:center}
 .pagebar-title{grid-column:1/-1;grid-row:2;padding:2px 2px 0}
 .pagebar-title .crumb{display:none}.pagebar h1{font-size:20px;white-space:normal}
 .pagebar-actions .btn{width:44px;min-width:44px;padding:0}
 .bar-tools{padding:0;border:0;background:none;gap:2px}.bar-icon{width:44px;min-width:44px}
 .content{padding:16px max(12px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(12px,var(--safe-left));gap:16px;scrollbar-gutter:auto}
 .view,.grid-2,.settings-grid{gap:16px}
 .settings-grid{grid-template-columns:minmax(0,1fr)}
 .card-title{padding:16px 16px 12px;gap:4px}.settings-body{padding:4px 16px 20px}
 .photo-row{gap:14px}.photo-actions{min-width:0;flex:1 1 150px}.avatar-xl{width:72px;height:72px;font-size:28px}
 .settings-card p,.card-sub,.review-issue,.notice{overflow-wrap:anywhere}
 .settings-card .btn,.settings-card .text-link{white-space:normal}
 #settings-save{width:100%}
 .upload-layout{gap:20px}.upload-main{gap:22px;flex-basis:100%}.upload-aside{flex-basis:100%}
 .upload-main h2.hero{font-size:28px}.lede{font-size:16px}.eyebrow{font-size:11px;letter-spacing:.05em}
 .dropzone{padding:24px 16px}.dropzone strong{font-size:20px}.dropzone .btn{width:100%}
 .card.steps,.card-quiet{padding:20px}.step>div{min-width:0}
 #view-upload{padding-bottom:150px}
 #view-upload .action-row{flex-direction:column;align-items:stretch;gap:6px;padding:8px max(12px,var(--safe-right)) calc(6px + var(--safe-bottom)) max(12px,var(--safe-left))}
 #view-upload .action-row .muted{order:-1;font-size:12px;white-space:normal;line-height:1.4;overflow:visible}
 #process{width:100%;min-height:48px}
 .file-row{gap:8px;padding-left:12px}.file-name{font-size:12px}.file-state{max-width:70px;overflow-wrap:anywhere}
 .kpis{gap:10px}.kpi{padding:14px 12px}.kpi strong{font-size:20px}.kpi-hero strong{font-size:28px}.kpi .label{font-size:10px;letter-spacing:.04em}
 .hbars{padding:4px 12px 16px}.hbar{grid-template-columns:82px minmax(0,1fr) 82px;gap:6px}.hbar-value{font-size:12px}
 .cols{margin-right:12px}.col-label,.col-value{font-size:10px}
 .tip{max-width:calc(100vw - 40px);white-space:normal}.hbar .tip{left:0}
 .empty-state{padding:24px 20px}.empty-state .hazard{margin:-24px -20px 12px;width:calc(100% + 40px)}
 .empty-state h2{font-size:22px}.empty-state>.btn{width:100%}
 .filters{padding:14px;gap:12px}.filters .field,.filters .field:nth-child(2){flex:1 1 100%;min-width:0}.filters input,.filters select{width:100%;min-width:0}.filter-summary{margin:0;min-height:24px}
 .table-wrap.tall{max-height:65dvh}.table-wrap:focus-visible{outline-offset:-3px}
 .panel-head{padding:14px 12px;gap:12px}.panel-id{gap:8px}.panel-id .mono{font-size:12px;white-space:normal}.period{font-size:12px}
 .panel-bar{padding-left:8px;padding-right:8px}.tab{padding:0 10px}
 .review-intro{padding:24px 16px 16px}.review-intro .hazard{margin:-24px -16px 12px;width:calc(100% + 32px)}
 .review-body{padding:0 14px 16px}.review-body select{max-width:220px;min-height:44px}
 #view-review>.action-row{align-items:stretch;gap:10px}#view-review>.action-row .btn{width:100%;white-space:normal}
 /* Phones: pop-ups fill the screen below the notch and status bar, with Back, Close and Cancel always visible. */
 dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
 .dialog-head{padding:calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));gap:8px}.dialog-back{display:inline-flex}.dialog-head h2{text-align:center}
 .dialog-foot{padding:10px calc(14px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(14px + var(--safe-left))}.dialog-foot .btn{width:100%}.dialog-head h2{font-size:16px}.dialog-body{padding:14px}.share-steps .btn{width:100%}
 .auth-main{padding:calc(28px + var(--safe-top)) max(20px,var(--safe-right)) calc(24px + var(--safe-bottom)) max(20px,var(--safe-left))}.auth-card h1{font-size:30px}.auth-help,.auth-foot{overflow-wrap:anywhere}
}
@media(max-width:360px){.pagebar{column-gap:4px;padding-left:max(8px,var(--safe-left));padding-right:max(8px,var(--safe-right))}.pagebar-actions{gap:4px}.kpi strong{font-size:18px}.hbar{grid-template-columns:78px minmax(0,1fr) 78px}}
.dashboard-welcome{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:4px 0 24px;min-width:0}
.dashboard-welcome>div{min-width:0}
.welcome-eyebrow{color:var(--accent-text);font-size:11px;font-weight:700;letter-spacing:1.5px;margin-bottom:6px}
#dashboard-greeting{font-size:clamp(24px,3vw,32px);line-height:1.2;letter-spacing:-.7px;overflow-wrap:anywhere}
.welcome-caption{color:var(--muted);margin-top:8px;font-size:14px}
.welcome-date{color:var(--muted);font-size:13px;flex-shrink:0}
@media(max-width:600px){.dashboard-welcome{align-items:flex-start;flex-direction:column;gap:12px;padding-bottom:20px}.welcome-date{font-size:12px}}
#dash-data{display:flex;flex-direction:column;gap:24px}
@media(max-width:1024px){
 .sidebar{visibility:hidden;transition:transform .2s,visibility .2s}
 body.nav-open .sidebar{visibility:visible}
}
@media(max-width:600px){
 #dash-data{gap:16px}
}
@media(max-width:600px){
 .review-body .table-wrap{max-height:none;overflow:visible}
 .review-body .data-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .review-body .data-table,.review-body .data-table tbody{display:block;width:100%}
 .review-body .data-table tr{display:grid;grid-template-columns:minmax(0,1fr);padding:8px;border-bottom:1px solid var(--line)}
 .review-body .data-table td{display:block;min-width:0;padding:6px;border:0;white-space:normal;text-align:left}
 .review-body .data-table td.num{font-weight:700}
 .review-body .data-table .sr-only{position:static;display:block;width:auto;height:auto;clip:auto;overflow:visible;white-space:normal;margin-bottom:6px;font-size:13px;font-weight:600}
 .review-body .data-table select{width:100%;max-width:none}
}

/* Staff management remains available only to administrators. */
.staff-section{margin-bottom:24px;overflow:hidden}
.staff-section .card-title{align-items:center;gap:12px}
.staff-section h3{font-size:16px;margin:0}
.staff-badge{color:var(--accent-text);background:#fff4dd;padding:5px 10px;border-radius:999px;font-size:12px;white-space:nowrap;font-weight:600}
.staff-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)}
.staff-members{border-left:1px solid var(--line)}
.staff-list-heading,.staff-member{display:flex;align-items:center;justify-content:space-between;gap:12px}
.staff-member{padding:16px 0;border-bottom:1px solid var(--line-soft);flex-wrap:wrap}
.staff-member>div{min-width:0;flex:1}.staff-member strong,.staff-member small{display:block;overflow-wrap:anywhere}
.staff-member small{color:var(--muted);margin-top:3px}
.staff-member .staff-state{font-size:12px;color:var(--ok)}.staff-member .staff-state.inactive{color:var(--muted)}
.staff-member button{min-height:44px}
@media(max-width:1024px){.staff-layout{grid-template-columns:1fr}.staff-members{border-left:0;border-top:1px solid var(--line)}}

/* Account-scoped welcome tour. Native modal keeps keyboard focus in the tour. */
.portal-tour{width:min(520px,calc(100vw - 32px));padding:24px;max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));overflow-y:auto;border:1px solid var(--line);border-radius:20px}
.portal-tour::backdrop{background:rgba(14,26,43,.72);backdrop-filter:blur(3px)}
.tour-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.tour-label{font-size:11px;font-weight:700;letter-spacing:1.5px;color:var(--muted)}
.tour-close{font-size:28px;background:var(--ground);color:var(--ink)}
.tour-progress{display:flex;gap:6px;margin:16px 0 24px}.tour-progress span{flex:1;height:4px;background:var(--line);border-radius:4px}.tour-progress .is-done{background:var(--accent)}
.tour-step{display:flex;align-items:center;justify-content:center;width:64px;height:64px;background:var(--ink);color:var(--accent);font:700 24px var(--mono);border-radius:16px;margin-bottom:20px}
.tour-count{font-size:12px;color:var(--muted);margin-bottom:6px}.portal-tour h2{font-size:26px;line-height:1.2;margin-bottom:14px;letter-spacing:-.5px}
#tour-copy{font-size:16px;line-height:1.65;color:var(--text)}.tour-note{font-size:12px;color:var(--muted);margin-top:18px}
.tour-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px;border-top:1px solid var(--line-soft);padding-top:20px}.tour-actions>div{display:flex;gap:8px}.tour-actions .text-link{min-height:44px}
@media(max-width:600px){.portal-tour{padding:20px;width:calc(100vw - 24px)}.portal-tour h2{font-size:24px}.tour-actions{flex-wrap:wrap}.tour-actions>div{margin-left:auto}.tour-actions .btn{padding:0 14px}}

/* Completed invoice batches, stored per account on this device. */
.history-list{display:flex;flex-direction:column;gap:16px}.history-body{padding:20px;display:flex;flex-direction:column;gap:12px}.history-body p{overflow-wrap:anywhere}.history-card .card-title{align-items:flex-start;flex-wrap:wrap}.history-card h2{overflow-wrap:anywhere;min-width:0;flex:1;font-size:16px}.history-totals{display:flex;flex-wrap:wrap;gap:12px 24px;font-size:14px}.history-actions{display:flex;gap:10px;flex-wrap:wrap}.history-intro input{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;font:inherit;background:var(--surface);color:var(--ink)}.history-intro label{font-weight:600}.history-trucks{font-family:var(--mono);font-size:13px}.history-intro #history-status{font-size:13px;color:var(--muted)}
@media(max-width:600px){.history-body{padding:16px}.history-intro input{font-size:16px}.history-actions .btn{flex:1}.history-totals{gap:8px 16px}}

/* Compact truck travels along the dashboard divider without widening the page. */
.dashboard-road{position:relative;align-self:stretch;height:40px;flex-shrink:0;margin:-20px 0 12px;overflow:hidden;border-bottom:2px solid var(--line);background:linear-gradient(to right,var(--accent) 50%,transparent 0) bottom/20px 2px repeat-x}
.dashboard-road-truck{position:absolute;bottom:0;left:0;width:104px;height:36px;animation:dashboard-truck-drive 20s linear infinite}
.dashboard-truck-body{animation:dashboard-truck-bounce .8s ease-in-out infinite;transform-origin:center}
@keyframes dashboard-truck-drive{0%{left:-104px}100%{left:100%}}
@keyframes dashboard-truck-bounce{50%{transform:translateY(-.6px)}}
@media(max-width:600px){.dashboard-road{height:34px;margin:-8px 0 6px}.dashboard-road-truck{width:88px;height:30px}}
@media(prefers-reduced-motion:reduce){.dashboard-road-truck,.dashboard-truck-body{animation:none}.dashboard-road-truck{left:12px}}
/* Printing a truck invoice from a computer: only the invoice pages are printed, one per sheet,
   whatever page of the app is open (the app's fixed-height layout is released while printing). */
#print-root{display:none}
@media print{
 html.printing,html.printing body{background:#fff!important;height:auto!important;min-height:0!important;overflow:visible!important;display:block!important;margin:0!important;padding:0!important}
 html.printing body>*:not(#print-root){display:none!important}
 html.printing #print-root{display:block}
 #print-root .sheet{margin:0 auto;break-after:page;page-break-after:always;overflow:hidden}
 #print-root .sheet:last-child{break-after:auto;page-break-after:auto}
 #print-root svg{display:block}
}
