/* =====================================================================
   Fox's Pallets - stylesheet
   Neutral corporate palette. Mobile first, desktop layered on top.
   Plain CSS, no build step. Fonts are self-hosted (CSP: font-src 'self').
   No inline styles anywhere (CSP: style-src 'self').

   Breakpoints: 640px (large phone), 768px (tablet), 1200px (sidebar), 1440px (desktop)
   ===================================================================== */

@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }

:root {
    /* Fox's brand: dark #233235, accent #34b067, light #eaebec */
    --brand-dark: #233235;
    --brand-accent: #34b067;
    --brand-light: #eaebec;

    --ink: #233235;
    --ink-2: #2d4044;
    --ink-3: #3b5358;
    --paper: #eaebec;
    --card: #ffffff;
    --well: #dfe2e4;
    --line: #dadee0;
    --line-2: #c3c9cc;
    --text: #233235;
    --muted: #53656a;
    --faint: #879397;
    --on-ink: #ffffff;
    --on-ink-muted: #a9b7ba;

    --accent: #34b067;
    --accent-hover: #43c276;
    --on-accent: #233235;

    --green: #1f7a47;
    --green-soft: #e5f5eb;
    --green-line: #b4e0c5;
    --red: #b42318;
    --red-soft: #fdf1ef;
    --red-line: #f3c7c1;
    --plate-blue: #1d4fa3;
    --focus: #2563eb;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 0 rgba(35, 50, 53, .04), 0 1px 3px rgba(35, 50, 53, .08);

    --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --fs-body: clamp(1rem, .97rem + .15vw, 1.0625rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-body);
    line-height: 1.5;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
button { font: inherit; }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: -.01em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: var(--on-ink); padding: .75rem 1rem; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------
   Brand mark and UK number plate
   --------------------------------------------------------------------- */
.mark {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--on-ink); color: var(--ink);
    font-family: var(--font-cond); font-weight: 700; font-size: 18px; letter-spacing: .02em;
}
.brand-name { font-family: var(--font-cond); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }

/* White front plate: a lorry reg drivers recognise at a glance */
.plate {
    display: inline-flex; align-items: stretch; overflow: hidden;
    background: #fff; color: #111; border: 1.5px solid #111; border-radius: 5px;
    font-family: var(--font-cond); font-weight: 700; letter-spacing: .06em; line-height: 1;
    font-size: 1rem; white-space: nowrap; vertical-align: middle;
}
.plate-gb { background: var(--plate-blue); color: #fff; font-size: .55em; letter-spacing: 0; display: flex; align-items: flex-end; padding: 0 3px 2px; }
.plate-reg { padding: 4px 7px; }
.plate--lg { font-size: 22px; }
.plate--lg .plate-reg { padding: 5px 9px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 48px; padding: 0 1.25rem;
    border-radius: var(--radius-sm); border: 1.5px solid var(--ink);
    background: var(--accent); color: var(--on-accent); border-color: var(--accent);
    font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
    touch-action: manipulation; transition: background-color 150ms ease, border-color 150ms ease;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--outline { background: var(--card); color: var(--text); border-color: var(--line-2); }
.btn--outline:hover { background: var(--paper); border-color: var(--muted); }
.btn--ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn--ghost:hover { background: var(--well); border-color: var(--well); color: var(--text); }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 .85rem; font-size: .9375rem; border-radius: 9px; }
.btn--lg {
    min-height: 64px; border-radius: var(--radius);
    font-family: var(--font-cond); font-weight: 700; font-size: 24px; letter-spacing: .02em;
}
.btn--danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; }

.link { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.link:hover { text-decoration-color: var(--text); }

/* ---------------------------------------------------------------------
   Messages
   --------------------------------------------------------------------- */
.notice {
    padding: .8rem 1rem; margin-bottom: 1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line); border-left-width: 4px; background: var(--card);
    font-size: 1rem; font-weight: 500;
}
.notice--success { background: var(--green-soft); border-color: var(--green-line); border-left-color: var(--green); color: #0f3d20; }
.notice--error { background: var(--red-soft); border-color: var(--red-line); border-left-color: var(--red); color: #5c130d; }

.alert {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    background: var(--red-soft); border: 1px solid var(--red-line); border-left: 4px solid var(--red);
    border-radius: 12px; padding: .8rem 1rem; font-size: 1rem;
}
.alert b { font-weight: 700; }
.alert-act { margin-left: auto; font-weight: 700; color: var(--red); text-decoration: none; white-space: nowrap; }
.alert-act:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
   Cards and labels
   --------------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 1.1rem 1.15rem; }
.label { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.empty { padding: 2rem 1.25rem; text-align: center; color: var(--muted); }
.empty h2 { font-size: 1.25rem; color: var(--text); margin-bottom: .35rem; }

/* State badges */
.state { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--well); color: var(--muted); }
.state--assigned, .state--collected, .state--weighed, .state--transferred { background: #e7e5e4; color: var(--ink); }
.state--complete, .state--submitted { background: var(--green-soft); color: var(--green); }
.state--late { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field-label { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.field-help { font-size: 14px; color: var(--muted); margin: .4rem 0 0; }
.opt { font-weight: 500; color: var(--muted); }
.input {
    display: block; width: 100%; min-height: 52px; padding: .7rem .9rem;
    font: inherit; font-size: 1.0625rem; color: var(--text);
    background: var(--card); border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
}
.input:hover { border-color: var(--faint); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input--xl { min-height: 72px; font-family: var(--font-cond); font-weight: 700; font-size: 34px; letter-spacing: .02em; }
select.input {
    appearance: none; padding-right: 2.5rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) center, calc(100% - 14px) center;
    background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.input-unit { position: relative; }
.input-unit .input { padding-right: 3.5rem; }
.input-unit span { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); font-size: 1.1rem; }
.req { color: var(--red); }

/* Tick-box tiles, big enough for gloves */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tile { position: relative; display: flex; align-items: center; gap: .6rem; min-height: 54px; padding: .6rem .8rem; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); background: var(--card); font-weight: 600; cursor: pointer; }
.tile input { width: 22px; height: 22px; accent-color: var(--ink); flex-shrink: 0; }
.tile:has(input:checked) { border-color: var(--ink); background: var(--paper); }
.tile--wide { grid-column: 1 / -1; }

/* Declaration box */
.declare { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--card); cursor: pointer; font-size: 1.0625rem; font-weight: 500; }
.declare input { width: 26px; height: 26px; margin-top: 2px; accent-color: var(--ink); flex-shrink: 0; }
.declare:has(input:checked) { border-color: var(--ink); }

/* Signature pad */
.sig { border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.sig-canvas { display: block; width: 100%; height: 220px; touch-action: none; background: #fff; cursor: crosshair; }
.sig-foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: .35rem .5rem .35rem 1rem; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Office and customer shell: sidebar on desktop, top bar on mobile
   --------------------------------------------------------------------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.side { background: var(--ink); color: var(--on-ink); }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.side-brand .sub { font-size: 13px; color: var(--on-ink-muted); margin-top: 3px; }
.nav { display: flex; gap: 2px; padding: 0 10px 10px; overflow-x: auto; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #d3dcde; font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--ink-3); color: #fff; font-weight: 600; }
.nav .count { margin-left: auto; min-width: 24px; text-align: center; font-size: 13px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 20px; padding: 1px 8px; }
.side-foot { display: none; }
.main { padding: 1.25rem 1rem 3rem; min-width: 0; }

@media (min-width: 1200px) {
    .shell { display: grid; grid-template-columns: 248px 1fr; }
    .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; }
    .side-brand { padding: 26px 20px 26px; }
    .nav { flex-direction: column; padding: 0 12px; overflow: visible; }
    .nav a[aria-current="page"]::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
    .side-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--ink-3); }
    .side-foot .who { font-size: 15px; font-weight: 600; line-height: 1.2; }
    .side-foot .role { font-size: 13px; color: var(--on-ink-muted); }
    .side-foot form { margin-left: auto; }
    .side-foot .btn--ghost { color: var(--on-ink-muted); padding: 0 .6rem; }
    .side-foot .btn--ghost:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
    .side .nav-out { display: none; }
    .main { padding: 26px 32px 40px; }
}
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--ink-3); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; border: 1.5px solid #4a4541; flex-shrink: 0; }

.top { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.top h1 { font-family: var(--font-cond); font-weight: 700; font-size: clamp(30px, 2.2vw + 18px, 40px); }
.top .date { font-size: 17px; color: var(--muted); margin-bottom: 4px; }
.top-actions { margin-left: auto; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.search { display: flex; gap: .5rem; }
.search .input { width: min(340px, 60vw); min-height: 48px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.stat .n { font-family: var(--font-cond); font-weight: 700; font-size: 36px; line-height: 1; }
.stat .l { font-size: 15px; color: var(--muted); margin-top: 4px; }
.stat--warn .n { color: var(--red); }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

/* Board: loads move left to right, the same way the pallets do */
.board { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1600px) { .board { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.col { background: var(--well); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; min-width: 0; }
@media (min-width: 1600px) { .col { min-height: 420px; } }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col-h b { font-size: 16px; font-weight: 700; }
.col-h .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.col-h .dot--ink { background: var(--ink); }
.col-h .dot--red { background: var(--red); }
.col-h .dot--green { background: var(--green); }
.col-h .c { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--card); border-radius: 20px; padding: 1px 9px; }
.col-empty { font-size: 14px; color: var(--faint); padding: 4px; }

.job { min-width: 0; overflow-wrap: break-word; display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
a.job:hover { border-color: var(--faint); }
.job-r1 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.job-ref { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.job-time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.job-site { font-size: 18px; font-weight: 700; line-height: 1.15; }
.job-waste { font-size: 14px; color: var(--muted); }
.job-r3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.job .btn { white-space: normal; text-align: center; line-height: 1.2; padding-top: .45rem; padding-bottom: .45rem; height: auto; }
.drv { min-width: 0; }
.drv > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-r3 > :last-child { margin-left: auto; }
.job .plate { font-size: 13px; }
.job .plate-reg { padding: 3px 6px; }
.drv { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.drv .av { width: 24px; height: 24px; font-size: 11px; background: var(--ink); border: 0; }
.kg { font-family: var(--font-cond); font-weight: 700; font-size: 20px; white-space: nowrap; }
.job--late { border-color: var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }
.flag { font-size: 12.5px; font-weight: 700; color: var(--red); background: var(--red-soft); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.signed { font-size: 14px; font-weight: 600; color: var(--green); }
.more { text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); padding: 4px; text-decoration: none; }
.more:hover { color: var(--text); text-decoration: underline; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--paper); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f5f6f7; }
.table .num { text-align: right; }
.table td.strong { font-weight: 700; }
@media (min-width: 1024px) { .table { font-size: 16px; } .table th, .table td { padding: 14px 16px; } }

/* Office forms */
.form-card { max-width: 44rem; }
.form-section { padding: 1.25rem; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { font-size: 1.125rem; margin-bottom: .25rem; }
.form-section > p { color: var(--muted); font-size: 15px; margin-bottom: 1rem; }
.form-foot { padding: 1rem 1.25rem; background: var(--paper); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.codes { display: flex; gap: 1.5rem; align-items: baseline; flex-wrap: wrap; padding: .9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.codes b { font-family: var(--font-mono); font-weight: 500; font-size: 1.05rem; }

/* Detail pages (office and customer) */
.facts-row { display: grid; grid-template-columns: repeat(2, 1fr); }
.facts-row > div { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.facts-row > div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts-row dd { margin: 6px 0 0; font-size: 18px; font-weight: 700; }
.facts-row dt { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 1024px) {
    .facts-row { grid-template-columns: repeat(4, 1fr); }
    .facts-row > div { border-bottom: 0; border-right: 1px solid var(--line); }
    .facts-row > div:last-child { border-right: 0; }
}

.trace { list-style: none; margin: 0; padding: 0; }
.trace li { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.trace li:first-child { border-top: 0; }
.trace .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line-2); color: var(--faint); flex-shrink: 0; }
.trace li.is-done .num { background: var(--green); border-color: var(--green); color: #fff; }
.trace .t { font-size: 17px; font-weight: 700; }
.trace .s { font-size: 14px; color: var(--muted); }
.trace li:not(.is-done) .t { color: var(--faint); }
.trace .go { margin-left: auto; }

.split { display: grid; gap: 18px; }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 26rem; }
.auth-head { background: var(--ink); color: var(--on-ink); padding: 1.25rem; border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 12px; }
.auth-body { padding: 1.5rem 1.25rem 1.25rem; }
.auth-body h1 { font-family: var(--font-cond); font-weight: 700; font-size: 32px; margin-bottom: .25rem; }
.auth-body > p { color: var(--muted); margin-bottom: 1.25rem; }
.auth .card { overflow: hidden; }

/* ---------------------------------------------------------------------
   Driver app: phone first, centred column on bigger screens
   --------------------------------------------------------------------- */
.d-body { background: var(--paper); }
.d-head { background: var(--ink); color: var(--on-ink); }
.d-head-in { max-width: 560px; margin: 0 auto; padding: 14px 20px 18px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.d-head-top { display: flex; align-items: center; gap: 10px; }
.d-head-top form { margin-left: auto; }
.d-head-top .btn--ghost { color: var(--on-ink-muted); min-height: 40px; padding: 0 .75rem; }
.d-head-top .btn--ghost:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.d-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .25rem; margin-left: -.25rem; color: var(--on-ink); font-weight: 600; font-size: 17px; text-decoration: none; }
.d-back:hover { text-decoration: underline; }
.d-hello { margin-top: 14px; font-size: 16px; color: var(--on-ink-muted); }
.d-title { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.d-title h1 { font-family: var(--font-cond); font-weight: 700; font-size: 30px; letter-spacing: .01em; }
.pips { display: flex; gap: 5px; margin-left: auto; }
.pip { width: 22px; height: 6px; border-radius: 3px; background: var(--ink-3); }
.pip--done { background: var(--accent); }
.pip--now { background: #fff; }

.d-main { max-width: 560px; margin: 0 auto; padding: 16px 16px 150px; display: flex; flex-direction: column; gap: 12px; }
.d-main--plain { padding-bottom: 40px; }

.where { padding: 18px 18px 16px; }
.where .site { font-family: var(--font-cond); font-weight: 700; font-size: 32px; line-height: 1.05; margin: 6px 0 2px; }
.where .addr { font-size: 17px; color: var(--muted); }
.what { display: flex; flex-direction: column; margin-top: 14px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.what b { font-size: 18px; }
.what span { font-size: 14px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.two .btn { min-height: 52px; font-size: 17px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; }
.fact { padding: 14px 18px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact .v { margin-top: 6px; font-size: 20px; font-weight: 700; }
.fact .plate { margin-top: 6px; }

.track { padding: 14px 16px 16px; }
.track .label { padding: 0 2px 12px; }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.track ol::before { content: ''; position: absolute; top: 18px; left: 16.6%; right: 16.6%; height: 3px; background: var(--line); border-radius: 2px; }
.track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.track .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; border: 2px solid var(--line-2); color: var(--faint); background: #fff; }
.track b { font-size: 18px; margin-top: 4px; color: var(--faint); }
.track small { font-size: 13px; color: var(--muted); font-weight: 500; }
.track li.is-now .num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 5px var(--well); }
.track li.is-now b { color: var(--text); }
.track li.is-now small { color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.track li.is-done .num { background: var(--green); border-color: var(--green); color: #fff; }
.track li.is-done b { color: var(--green); }

/* Job list */
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.job-card { display: block; padding: 16px 18px; text-decoration: none; color: inherit; }
.job-card:hover { border-color: var(--faint); }
.job-card .site { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.1; }
.job-card .addr { color: var(--muted); font-size: 16px; }
.job-card .row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.job-card .next { margin-left: auto; font-weight: 700; font-size: 16px; white-space: nowrap; }
.job-card--now { border: 2px solid var(--accent); }

/* Fixed action bar in the thumb zone */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line); }
.dock::before { content: ''; position: absolute; left: 0; right: 0; top: -24px; height: 24px; background: linear-gradient(to top, var(--paper), rgba(234, 235, 236, 0)); pointer-events: none; }
.dock-in { max-width: 560px; margin: 0 auto; padding: 12px 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.dock-row { display: flex; gap: 10px; }
.dock-row .btn--lg { flex: 1; }
.dock-row .btn--back { flex: 0 0 auto; min-width: 96px; font-family: var(--font); font-size: 17px; font-weight: 600; }
.help { display: block; margin-top: 10px; text-align: center; font-size: 16px; font-weight: 600; color: var(--muted); text-decoration: none; }
.help:hover { color: var(--text); text-decoration: underline; }

/* Step-by-step notes */
.wiz-head { display: flex; align-items: center; gap: 10px; }
.wiz-head .label { flex: 1; }
.wiz-bar { display: flex; gap: 4px; margin-top: 8px; }
.wiz-bar span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.wiz-bar span.is-done { background: var(--accent); }
.step { display: flex; flex-direction: column; gap: 12px; }
.step + .step { margin-top: 28px; }
.js-wizard .step + .step { margin-top: 0; }
.js-wizard .step:not(.is-active) { display: none; }
.step h2 { font-family: var(--font-cond); font-weight: 700; font-size: 30px; line-height: 1.1; }
.step h2:focus { outline: none; }
.step .lead { font-size: 17px; color: var(--muted); margin: -4px 0 0; }
.step-error { display: none; }
.step-error.is-on { display: block; }

.kv { margin: 0; }
.kv > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 15px; font-weight: 500; }
.kv dd { margin: 0; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.kv dd:empty::before { content: 'Not given'; font-weight: 500; color: var(--faint); }
.confirm-edit { padding: 16px 18px 4px; }
.change-link { display: block; width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 16px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); }
.change-link:hover { background: var(--paper); }

.line-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; margin-bottom: 8px; }

.net { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 18px; }
.net .v { font-family: var(--font-cond); font-weight: 700; font-size: 34px; }
.net .is-warn { color: var(--red); font-size: 20px; }

.fixed { padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 15px; color: var(--muted); }
.fixed b { color: var(--text); }

/* Job done: a clear finish */
.done { text-align: center; padding: 34px 20px 28px; }
.done-tick { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--green); position: relative; }
.done-tick::after { content: ''; position: absolute; left: 30px; top: 18px; width: 20px; height: 38px; border: solid #fff; border-width: 0 7px 7px 0; transform: rotate(45deg); }
.done h1 { font-family: var(--font-cond); font-weight: 700; font-size: 38px; }
.done p { font-size: 18px; color: var(--muted); margin: 6px 0 0; }

/* Header link on driver screens, and sign out on phones */
.d-top-link { margin-left: auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 .85rem; border-radius: 9px; border: 1.5px solid var(--ink-3); color: var(--on-ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.d-top-link:hover { background: var(--ink-2); }
.d-head-top .d-top-link + form { margin-left: 8px; }
.nav-out { margin-left: auto; display: flex; align-items: center; }
.nav-out .btn--ghost { color: #d3dcde; }
.nav-out .btn--ghost:hover { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

/* Step progress only makes sense once the steps are split up */
.wiz-progress { display: none; }
.js-wizard .wiz-progress { display: block; margin-bottom: 14px; }
.js-wizard .dock-row .btn--lg { flex: 1; }
.fact .v.mono { font-size: 17px; white-space: nowrap; }
.btn { white-space: nowrap; }
.side-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 96px; }
.js-wizard .dock-row .btn--back { flex: 0 0 30%; }
.sig-canvas { height: 180px; }
@media (min-height: 800px) { .sig-canvas { height: 210px; } }

/* =====================================================================
   September 2026 update: logos, locked job details, load check,
   job form, document views
   ===================================================================== */

/* Logos: white version on dark backgrounds, full colour on light */
.logo { display: block; height: auto; }
.logo--side { width: 140px; }
.logo--auth { width: 170px; }
.logo--driver { width: 104px; }
.side-brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.side-brand .sub { margin-top: 0; color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .03em; }
@media (max-width: 1199px) {
    .side-brand { flex-direction: row; align-items: center; gap: 12px; }
    .logo--side { width: 112px; }
}
.auth-head { justify-content: space-between; }
.auth-sub { font-size: 14px; color: var(--on-ink-muted); }

/* Driver header: logo left, way back and Sign out always on the right */
.d-logo { display: inline-flex; align-items: center; min-height: 44px; }
.d-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.d-head-actions form { margin: 0; }
/* Header buttons: always outlined, never filled (a <button> would
   otherwise pick up the browser's default light fill) */
.d-head .d-top-link {
    -webkit-appearance: none; appearance: none;
    margin: 0; background: transparent; color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .28); border-radius: 9px;
    min-height: 40px; padding: 0 .85rem; display: inline-flex; align-items: center;
    font-family: var(--font); font-weight: 600; font-size: 15px; line-height: 1;
    text-decoration: none; cursor: pointer; white-space: nowrap;
}
.d-head .d-top-link:hover { background: var(--ink-2); border-color: rgba(255, 255, 255, .5); }
.d-head .d-top-link--out { color: #d3dcde; }
.d-head-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.d-head-actions { margin-left: auto; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px; }
@media (max-width: 360px) { .logo--driver { width: 84px; } .d-top-link { padding: 0 .6rem; font-size: 14px; } }

/* Locked details the driver confirms */
.locked { font-size: 15px; color: var(--muted); margin: 0; padding-left: 26px; position: relative; }
.locked::before { content: ''; position: absolute; left: 4px; top: 5px; width: 12px; height: 9px; border: 2px solid var(--muted); border-radius: 2px; }
.locked::after { content: ''; position: absolute; left: 7px; top: -1px; width: 6px; height: 7px; border: 2px solid var(--muted); border-bottom: 0; border-radius: 4px 4px 0 0; }
.kv dd .plate { font-size: 15px; }

/* Check the load */
.card-pad--tight { padding: 14px 18px 10px; }
.job-waste-line { font-size: 18px; font-weight: 700; margin-top: 4px; }
.small { font-size: 14px; }
.expect { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.expect li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 10px; align-items: baseline; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 17px; }
.expect li:first-child { border-top: 0; }
.expect-q { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1; }
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.tile--big { min-height: 64px; font-size: 19px; }
.tile--warn:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.tiles--1 { grid-template-columns: 1fr; }
.diff { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid var(--red-line); border-radius: var(--radius); background: var(--card); }
.diff-h { font-weight: 700; font-size: 17px; margin: 0; }
.diff-row { display: grid; grid-template-columns: 1fr 6.5rem; gap: 10px; align-items: center; }
.diff-l { font-weight: 600; font-size: 16px; }
.input--area { min-height: 96px; resize: vertical; line-height: 1.4; }

/* Job screen extras */
.what-lines { list-style: none; margin: 6px 0 6px; padding: 0; font-size: 16px; }
.what-lines li { padding: 2px 0; }
.what-lines b { display: inline-block; min-width: 2.5rem; font-size: 17px; }
.office-note { margin-top: 12px; padding: 10px 14px; border-left: 4px solid var(--ink); background: var(--paper); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 16px; }
.office-note .label { display: block; margin-bottom: 2px; }

/* Office job form */
.form-card--wide { max-width: 56rem; }
.subcard { padding: 1rem 1rem .25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.load-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.load-lines-head, .load-line { display: grid; grid-template-columns: 7rem 1fr auto; gap: 8px; align-items: center; }
.load-lines-head span { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.field--gap { margin-top: 1.25rem; }
.tiles--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .tiles--4 { grid-template-columns: repeat(4, 1fr); } }
.tile--sm { min-height: 46px; font-size: 15px; }
.tile--sm input { width: 20px; height: 20px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }

/* Office load detail */
.card-pad--row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.job-grid { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
@media (min-width: 1024px) { .job-grid { grid-template-columns: 1fr 1fr; } .job-grid > .kv + .kv { border-left: 1px solid var(--line); } }
.job-grid .kv > div:first-child { border-top: 0; }
@media (max-width: 1023px) { .job-grid > .kv + .kv > div:first-child { border-top: 1px solid var(--line); } }
.table-wrap--flat { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
.table td.is-diff { color: var(--red); font-weight: 700; }
.t-link { text-decoration: none; }
.t-link:hover { text-decoration: underline; }
.trace .go { display: flex; gap: 8px; }
.alert > div { flex: 1 1 18rem; }

/* Document view: the digital copy of each paper form */
.doc-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.doc-tabs a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); text-decoration: none; font-weight: 600; white-space: nowrap; }
.doc-tabs a:hover { border-color: var(--faint); }
.doc-tabs a[aria-current="page"] { border: 2px solid var(--ink); padding: 9px 13px; }
.doc-tab-s { font-size: 13px; font-weight: 500; color: var(--faint); }
.doc-tab-s.is-signed { color: var(--green); }
.doc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.doc-sheet { width: 210mm; max-width: none; margin: 0 auto; padding: 12mm; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 2px rgba(35, 50, 53, .06), 0 8px 24px rgba(35, 50, 53, .08); }
@media (max-width: 860px) { .doc-sheet { padding: 8mm; } }

@media print {
    @page { size: A4; margin: 10mm; }
    body { background: #fff; }
    .side, .top, .doc-tabs, .skip-link { display: none !important; }
    .shell { display: block; }
    .main { padding: 0; }
    .doc-scroll { overflow: visible; }
    .doc-sheet { width: auto; padding: 0; border: 0; box-shadow: none; }
}

/* =====================================================================
   Brand update: login screen and watermarks
   ===================================================================== */

/* Login: the Fox's yard behind a glass sign-in card.
   Landscape screens get the full yard, centred. Portrait screens get a
   crop of the left of the yard, pinned left, so the lorry stays in shot. */
.auth-page { background: var(--ink); color: #fff; min-height: 100vh; min-height: 100dvh; }
.auth-bg {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    background-color: var(--ink);
    background-size: cover; background-repeat: no-repeat;
    background-position: left center;
    background-image: url('../img/login/fox-yard-portrait-1200.webp');
    background-image: image-set(url('../img/login/fox-yard-portrait-1200.webp') 1x, url('../img/login/fox-yard-portrait-1920.webp') 2x, url('../img/login/fox-yard-portrait-2880.webp') 3x);
}
@media (orientation: portrait) and (min-width: 900px) {
    .auth-bg {
        background-image: url('../img/login/fox-yard-portrait-1920.webp');
        background-image: image-set(url('../img/login/fox-yard-portrait-1920.webp') 1x, url('../img/login/fox-yard-portrait-2880.webp') 2x);
    }
}
@media (orientation: landscape) {
    .auth-bg {
        background-position: center center;
        background-image: url('../img/login/fox-yard-1280.webp');
        background-image: image-set(url('../img/login/fox-yard-1280.webp') 1x, url('../img/login/fox-yard-2560.webp') 2x);
    }
}
@media (orientation: landscape) and (min-width: 1281px) {
    .auth-bg {
        background-image: url('../img/login/fox-yard-1920.webp');
        background-image: image-set(url('../img/login/fox-yard-1920.webp') 1x, url('../img/login/fox-yard-3840.webp') 2x);
    }
}
@media (orientation: landscape) and (min-width: 1921px) {
    .auth-bg {
        background-image: url('../img/login/fox-yard-2560.webp');
        background-image: image-set(url('../img/login/fox-yard-2560.webp') 1x, url('../img/login/fox-yard-3840.webp') 2x);
    }
}
@media (orientation: landscape) and (min-width: 2561px) {
    .auth-bg { background-image: url('../img/login/fox-yard-3840.webp'); }
}
/* Tint, then the logo tiled edge to edge (bleeding past every edge), diagonal like the dashboards */
.auth-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35, 50, 53, .25), rgba(35, 50, 53, .55)); }
.auth-bg::after {
    content: ''; position: absolute; inset: -35%; width: 170%; height: 170%;
    background-image: url('../img/watermark-white.svg');
    background-repeat: repeat; background-size: 190px auto; background-position: -40px -30px;
    transform: rotate(-24deg);
    opacity: .1;
}

.auth-page .auth { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem 1rem; }
.auth-page .auth-card {
    width: 100%; max-width: 27rem; overflow: hidden;
    background: rgba(35, 50, 53, .55);
    -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.auth-page .auth-head {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
    background: transparent; padding: 1.75rem 1.25rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .14); border-radius: 0;
}
.auth-page .logo--auth { width: 200px; margin: 0 auto; }
.auth-page .auth-sub { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.auth-page .auth-body { padding: 1.5rem 1.5rem 1.6rem; }
.auth-page .auth-body h1 { color: #fff; }
.auth-page .auth-body > p { color: #d3dcde; }
.auth-page .field-label { color: #fff; }
.auth-page .input { background: rgba(255, 255, 255, .94); border-color: rgba(255, 255, 255, .5); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-page .auth-card { background: rgba(35, 50, 53, .9); }
}

/* Dashboards: the Fox's logo, tiled diagonally at a whisper */
.app-page, .d-body { position: relative; }
.app-page::before, .d-body::before {
    content: ''; position: fixed; z-index: 0; pointer-events: none;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: url('../img/watermark.svg');
    background-repeat: repeat; background-size: 230px auto;
    transform: rotate(-24deg);
    opacity: .045;
}
.app-page .shell, .d-body .d-head, .d-body .d-main { position: relative; z-index: 1; }
@media print { .app-page::before, .d-body::before { display: none; } }

/* Job form: code field and load lines spacing */
.input--code { font-family: var(--font-mono); letter-spacing: .04em; }
#code-readout .grid-2 { align-items: start; }
.load-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.load-lines-head, .load-line { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.load-lines-head span { display: block; }
@media (max-width: 639px) {
    .load-lines-head, .load-line { grid-template-columns: 5.5rem minmax(0, 1fr) auto; column-gap: 8px; }
}

/* Office set-up pages: customers, drivers, lorries */
.nav-group { display: block; padding: 16px 12px 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-ink-muted); }
@media (max-width: 1199px) { .nav-group { display: none; } }
.manage { display: grid; gap: 18px; align-items: start; }
@media (min-width: 1200px) { .manage { grid-template-columns: minmax(0, 1fr) 22rem; } }
.manage-add { max-width: none; }
.inline-form { padding: 1.1rem 1.15rem 1.25rem; border-top: 1px solid var(--line); background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); }
.inline-form h3 { font-size: 1.0625rem; margin-bottom: .75rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .grid-4 { grid-template-columns: 1fr 1.6fr .8fr 1fr; } }
.declare--sm { padding: .75rem 1rem; font-size: 1rem; align-items: center; }
.declare--sm input { width: 22px; height: 22px; margin-top: 0; }
.field--check { display: flex; align-items: flex-end; }
@media (min-width: 640px) { .field--check { padding-top: 1.85rem; } }

/* Analytics: stage duration bars, weekly trend line, daily volume bars */
.chart-bars { padding: .5rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: 14px; }
.chart-bar-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 9rem; gap: 14px; align-items: center; }
.chart-bar-label { font-size: .9rem; color: var(--ink-2); line-height: 1.25; }
.chart-bar-track { height: 14px; background: var(--well); border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 999px; min-width: 4px; }
.chart-bar-value { font-size: .9rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 767px) {
    .chart-bar-row { grid-template-columns: 1fr; gap: 4px; }
    .chart-bar-value { font-weight: 600; }
}

.trend-svg, .vol-svg { width: 100%; height: auto; display: block; }
.trend-axis { stroke: var(--line); stroke-width: 1; }
.trend-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.trend-axis-label { font-size: 10px; fill: var(--ink-3); font-family: var(--font); }
.trend-line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-dot { fill: var(--card); stroke: var(--accent); stroke-width: 2; }
.trend-dot:hover { fill: var(--accent); }
.trend-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: .8rem; color: var(--on-surface-muted, var(--ink-3)); }

.vol-bar-rect { fill: var(--accent); }
.vol-bar-rect:hover { fill: var(--accent-hover); }

/* ===== Client amendments (October 2026) ===== */
.load-lines-head, .load-line.load-line--desc, .load-line--desc { grid-template-columns: minmax(0, 1fr) auto; }
.input--locked { background: var(--well); color: var(--ink); display: flex; align-items: center; min-height: 48px; cursor: default; }
.unit-list { display: flex; flex-direction: column; gap: 8px; padding: 0 1.15rem 1rem; }
.unit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.unit-row .declare { margin: 0; }
@media (max-width: 639px) { .unit-row { grid-template-columns: minmax(0, 1fr) auto; } .unit-row .unit-active { grid-column: 1 / -1; } }
.what-lines--plain li { padding: 2px 0; }
.what-lines--plain li::before { content: "\2022"; margin-right: 8px; color: var(--muted); }
.expect--plain li { grid-template-columns: 1fr; }
.field-label--big { font-size: 19px; font-weight: 700; }
.input--big { min-height: 60px; font-size: 20px; font-weight: 600; }
.big-num { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.1; }
.weigh-sum .weigh-net { background: var(--green-soft); }
.weigh-sum .weigh-net dt { font-weight: 700; color: var(--ink); }
.yard-panel { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.dob { border: 0; padding: 0; margin: 0 0 1rem; }
.dob-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.dob-l { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.auth-page .dob-l, .auth-page .dob legend { color: #fff; }
.auth-alt { margin: 1rem 0 0; text-align: center; font-size: 15px; }
.auth-page .auth-alt .link { color: #fff; }
.req-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.req-head, .req-row { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 6rem auto; gap: 8px; align-items: center; }
.req-head span { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 639px) {
    .req-head { display: none; }
    .req-row { grid-template-columns: 1fr 5rem; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
    .req-row input[type="date"] { grid-column: 1 / -1; }
}
.req-total { font-weight: 700; margin: .5rem 0 0; }
.req-lines { list-style: none; margin: 0; padding: 0 1.15rem 1rem; }
.req-lines li { padding: 4px 0; }
.req-lines b { display: inline-block; min-width: 6.5rem; }
.table-total td { font-weight: 700; border-top: 2px solid var(--line-2); }
.apply-all { margin-bottom: .5rem; }
.accept-rows { display: flex; flex-direction: column; gap: 8px; }
.accept-head, .accept-row { display: grid; grid-template-columns: 2rem 10.5rem minmax(0, 1fr) minmax(0, 1fr) 9rem; gap: 8px; align-items: center; }
.accept-head span { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.accept-n { font-weight: 700; color: var(--muted); }
.accept-mat { font-weight: 600; }
@media (max-width: 899px) {
    .accept-head { display: none; }
    .accept-row { grid-template-columns: 2rem 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
    .accept-row .accept-n { grid-column: 1; grid-row: 1 / span 3; align-self: start; padding-top: .9rem; }
    .accept-row > input[type="date"] { grid-column: 2 / -1; grid-row: 1; }
    .accept-row .accept-mat { grid-column: 2 / -1; grid-row: 2; }
    .accept-row > select:nth-of-type(1) { grid-column: 2; grid-row: 3; }
    .accept-row > select:nth-of-type(2) { grid-column: 3; grid-row: 3; }
}
.rebook { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.rebook-in { display: flex; gap: 8px; align-items: center; }
.rebook-in .input { min-width: 11rem; }
.input--qty { width: 6.5rem; text-align: right; margin-left: auto; }
.bd-table td { vertical-align: middle; }
.send-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; border-top: 1px solid var(--line); background: var(--green-soft); border-radius: 0 0 var(--radius) var(--radius); }
.send-bar p { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line-2); }
.tabs a { padding: 10px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a[aria-current="page"] { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.rate-list { display: flex; flex-direction: column; gap: 8px; padding: 0 1.15rem 1.15rem; }
.rate-head, .rate-row { display: grid; grid-template-columns: minmax(0, 1fr) 8rem 4.5rem auto; gap: 8px; align-items: center; }
.rate-row--mat { grid-template-columns: minmax(0, 1fr) 6.5rem auto; }
.rate-head span { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.rate-active { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 14px; }
.rate-active input { width: 22px; height: 22px; }
.rate-row.is-off .input { color: var(--faint); text-decoration: line-through; }
.rate-row--new { padding-top: 8px; border-top: 1px dashed var(--line-2); }
@media (max-width: 639px) { .rate-head { display: none; } .rate-row { grid-template-columns: 1fr 6rem; } .rate-row--mat { grid-template-columns: 1fr auto; } }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.contacts { margin-top: 14px; }
.contact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.btn--danger { background: var(--card); color: var(--red); border: 1.5px solid var(--red-line); }
.btn--danger:hover { background: var(--red-soft); border-color: var(--red); }
.delete-form { display: inline; margin: 0; }
.danger-zone { border: 1.5px solid var(--red-line); }
.danger-zone .form-foot { justify-content: flex-start; }
.rate-head, .rate-row { grid-template-columns: minmax(0, 1fr) 8rem 4.5rem auto auto; }
.rate-row--mat { grid-template-columns: minmax(0, 1fr) 6.5rem auto auto; }
.unit-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
@media (max-width: 639px) { .rate-row { grid-template-columns: 1fr 6rem; } .rate-row--mat, .unit-row { grid-template-columns: 1fr auto; } }
.stack + .stack { margin-top: 14px; }
.rate-row--contact { grid-template-columns: minmax(0, 1fr) 11rem 4.5rem auto auto; }
@media (max-width: 639px) { .rate-row--contact { grid-template-columns: 1fr 9rem; } }
.reassign { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.reassign-t { display: flex; flex-direction: column; gap: 2px; max-width: 34rem; }
.reassign-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reassign-in .input { min-width: 11rem; }

/* ===== Layout fixes (October 2026): no sideways scrolling anywhere ===== */
/* clip, not hidden: hidden would turn the page into a scroll box and stop the side menu staying in place */
html, body { overflow-x: clip; }

/* Side menu: scrolls on laptops when it's taller than the screen */
@media (min-width: 1200px) {
    .side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
    .side .nav { flex: 1 0 auto; }
    .nav-toggle { display: none; }
}
/* Phones and tablets: "Menu" button opens the menu as a list */
@media (max-width: 1199px) {
    .side { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .side-brand { grid-column: 1; grid-row: 1; }
    .nav-toggle { grid-column: 2; grid-row: 1; margin-right: 14px; background: transparent; color: #fff; border: 1px solid var(--ink-3); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
    .side .nav { grid-column: 1 / -1; display: none; flex-direction: column; overflow: visible; padding: 0 10px 12px; }
    .side.is-open .nav { display: flex; }
    .side .nav a { white-space: normal; }
    .side .nav-out { margin: 8px 0 0; }
}

/* Tables wrap at spaces (never mid-word). If a table is still wider than its
   card, it scrolls sideways inside the card rather than pushing the page. */
.table th, .table td { white-space: normal; overflow-wrap: normal; word-break: normal; }
.table td.num, .table td.mono, .table .plate, .table td a.link, .table td .btn, .table td .state { white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Phones and tablets in portrait: each table row becomes a card, column name on the left */
@media (max-width: 1023px) {
    .table--cards thead { display: none; }
    .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
    .table--cards tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .table--cards tbody tr:last-child { border-bottom: 0; }
    .table--cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
    .table--cards td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
    .table--cards td[data-label=""]::before { display: none; }
    .table--cards td[data-label=""] { justify-content: flex-end; }
    .table--cards td[colspan] { justify-content: flex-start; text-align: left; }
    .table--cards td.num { text-align: right; }
    .table--cards .input--qty { margin-left: 0; }
    .table--cards tr.table-total { background: var(--paper); }
    .table--cards td.mono { white-space: normal; overflow-wrap: break-word; min-width: 0; }
}

/* Set-up pages: the add form sits under the table until there's room */
@media (min-width: 1200px) { .manage { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1600px) { .manage { grid-template-columns: minmax(0, 1fr) 22rem; } }

/* Load facts: one row on laptops, however many there are */
@media (min-width: 1024px) {
    .facts-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
}
.facts-row dd { overflow-wrap: anywhere; }

/* Load page: collection date and change driver side by side */
.load-actions { display: grid; gap: 14px; }
@media (min-width: 1200px) { .load-actions { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.load-actions > * { margin: 0; }
.load-actions .rebook, .load-actions .reassign { flex-direction: column; align-items: stretch; justify-content: space-between; }
.load-actions .rebook > div, .load-actions .reassign > div { flex: 0 0 auto; }
.load-actions .rebook-in, .load-actions .reassign-in { flex-wrap: wrap; }
.load-actions .reassign-in .input, .load-actions .rebook-in .input { flex: 1 1 10rem; min-width: 0; }

/* Full-width form card; checkboxes line up with the fields */
.form-card--full { max-width: none; }
.field--check { align-items: flex-start; }

/* Documents: no sideways scroll, the sheet shrinks to fit */
.doc-scroll { overflow: hidden; }
@media (min-width: 1200px) { .side { overflow-x: hidden; } }
.doc-tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 767px) { .doc-tabs { flex-direction: column; } .doc-tabs a { width: 100%; } }
.job-r3 { flex-wrap: wrap; row-gap: 6px; }
.job { min-width: 0; }
.reassign.is-locked { background: var(--paper); }
.reassign.is-locked .input { background: var(--well); color: var(--muted); cursor: not-allowed; }
.lock-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: var(--well); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.dock .is-disabled { opacity: .45; pointer-events: none; }

/* No coloured left-edge accent bars anywhere: plain even borders */
.notice { border-left-width: 1px; }
.notice--success { border-left-color: var(--green-line); }
.notice--error { border-left-color: var(--red-line); }
.alert { border-left: 1px solid var(--red-line); }
.office-note { border-left: 0; border-radius: var(--radius-sm); }
.nav a[aria-current="page"]::before { display: none; }

/* Fox's confirm box: centred over a blurred page */
.fmodal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
    background: rgba(35, 50, 53, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .15s ease; }
.fmodal.is-on { opacity: 1; }
.fmodal-box { width: 100%; max-width: 26rem; background: var(--card); border-radius: var(--radius); padding: 22px 22px 18px;
    box-shadow: 0 24px 60px rgba(35, 50, 53, .35); transform: translateY(8px) scale(.98); transition: transform .15s ease; }
.fmodal.is-on .fmodal-box { transform: none; }
.fmodal-box--danger .fmodal-title { color: var(--red); }
.fmodal-title { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.15; margin: 0 0 8px; color: var(--ink); }
.fmodal-msg { margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.45; }
.fmodal-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.fmodal-label b { color: var(--red); font-family: var(--font-mono); font-weight: 700; }
.fmodal-input { width: 100%; margin-bottom: 16px; }
.fmodal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.fmodal-actions .btn { min-width: 7rem; }
.btn--danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn--danger-solid:hover { background: #941c13; border-color: #941c13; color: #fff; }
.btn--danger-solid:disabled { opacity: .4; }
html.fmodal-open { overflow: hidden; }
@media (max-width: 479px) { .fmodal-actions .btn { flex: 1 1 0; } }

/* A button that has been tapped and is waiting for the server. */
.btn.is-busy, button.is-busy { opacity: .6; cursor: progress; }
.input--code { font-family: var(--mono, 'JetBrains Mono', monospace); letter-spacing: .12em; text-transform: uppercase; font-size: 1.25rem; }
.verify-facts { margin: 0 0 1rem; display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; font-size: .95rem; }
.verify-facts dt { color: var(--ink-2, #555); }
.verify-facts dd { margin: 0; word-break: break-all; }

/* System page (developer view). */
.sys-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sys-tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line, #d3dcde); text-decoration: none; color: inherit; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.sys-tab.is-active { background: var(--ink, #233235); color: #fff; border-color: var(--ink, #233235); }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.sys-kv td:first-child { color: var(--ink-2, #555); width: 55%; }
.sys-log { margin: 0; padding: 12px 16px; font: 12px/1.5 var(--mono, 'JetBrains Mono', monospace); white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto; background: #161616; color: #e6e6e6; border-radius: 0 0 12px 12px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------------
   Safe areas: notch, Dynamic Island, rounded corners, home bar.
   Every page uses viewport-fit=cover and a translucent iOS status bar,
   so content must keep clear of them itself. env() is 0 wherever there
   is nothing to avoid (desktop, Safari in portrait with its own bars),
   so these rules are harmless outside the Home Screen app.
   --------------------------------------------------------------------- */
:root {
    --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);
}

/* A dark strip behind the clock and battery that stays put while the
   page scrolls, so white status-bar text never sits on light content. */
body::after {
    content: ''; position: fixed; z-index: 1001; top: 0; left: 0; right: 0;
    height: var(--safe-top); background: var(--ink); pointer-events: none;
}
@media print { body::after { display: none; } }

/* Office and customer: the top bar (phones) and sidebar (iPad, desktop). */
.side { padding-top: var(--safe-top); padding-left: var(--safe-left); }
@media (max-width: 1199px) {
    .side { padding-right: var(--safe-right); }
    .main { padding-left: max(1rem, var(--safe-left)); padding-right: max(1rem, var(--safe-right)); padding-bottom: calc(3rem + var(--safe-bottom)); }
}
@media (min-width: 1200px) {
    /* iPad Home Screen app: the right-hand column also starts under the status bar. */
    .main { padding-top: calc(1.25rem + var(--safe-top)); padding-right: max(1rem, var(--safe-right)); padding-bottom: calc(3rem + var(--safe-bottom)); }
}

/* Driver screens: top already handled on .d-head-in; add the sides. */
.d-head-in { padding-left: max(20px, var(--safe-left)); padding-right: max(20px, var(--safe-right)); }
.dock-in { padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); }
.d-main { padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); }

/* Sign-in, forgotten password, reset and document check pages. */
.auth-page .auth {
    padding-top: calc(1.25rem + var(--safe-top));
    padding-bottom: calc(1.25rem + var(--safe-bottom));
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
}

/* Pop-up boxes: never under the island or the home bar. */
.fmodal { padding-top: max(16px, var(--safe-top)); padding-bottom: max(16px, var(--safe-bottom)); }

/* ---------------------------------------------------------------------
   Touch screens (phones, iPads): every tap target at least 44px tall.
   Mouse and trackpad users keep the compact desktop sizes.
   --------------------------------------------------------------------- */
@media (pointer: coarse) {
    .btn--sm { min-height: 44px; }
    .table td a.link, .t-link, .more, a.job-ref { display: inline-flex; align-items: center; min-height: 44px; }
    .rate-row input[type="checkbox"], .declare input[type="checkbox"], .table input[type="checkbox"] { width: 24px; height: 24px; }
    .sys-tab { min-height: 44px; }
    .nav a { min-height: 44px; }
}

.sys-uptime-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sys-outages { margin: .5rem 0 0; padding-left: 1.1rem; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
