/* Office admin — the colours come from Brand::styleTag() (the company's scheme);
   these are the fallbacks so the sheet is usable on its own. */
:root {
  /* WasteFriendly blue until a company picks its own (Brand::styleTag overrides these). */
  --brand:#1d4ed8; --brand-dark:#15389b; --brand-deeper:#0f276c; --brand-soft:#e8eefb; --brand-tint:#f6f8fe; --on-brand:#fff;
  --accent:#2e90fa; --accent-dark:#1d6fd0; --on-accent:#ffffff;
  --ink:#0f172a; --text:#0f172a; --muted:#5b6b7f; --line:#e3e8ef; --line-strong:#cbd5e1;
  --bg:#ffffff; --bg-alt:#f4f6f9;
  /* Chart segments, in the order the donuts use them: the brand colour first, then a spread that reads on white. */
  --chart-1:var(--brand); --chart-2:#0ea5e9; --chart-3:#f59e0b; --chart-4:#8b5cf6; --chart-5:#14b8a6; --chart-6:#ef4444; --chart-7:#64748b; --chart-8:#ec4899;
  --radius:12px; --radius-sm:9px;
  --shadow:0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --shadow-sm:0 1px 2px rgba(15,23,42,.05);
  --font:"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar-w:236px;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg-alt); color:var(--ink); font:15px/1.55 var(--font); }
a { color:var(--brand); }
h1,h2,h3 { line-height:1.2; margin:0 0 .5rem; letter-spacing:-.01em; }
h1 { font-size:1.45rem; font-weight:800; }
h2 { font-size:1.1rem; font-weight:700; }
code { font-size:.9em; background:var(--bg-alt); padding:.1em .35em; border-radius:5px; }
:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }

/* ------------------------------------------------------------- structure */
.shell { display:flex; min-height:100vh; }
.nav-toggle { position:absolute; opacity:0; width:0; height:0; }
.sidebar {
  width:var(--sidebar-w); flex:0 0 var(--sidebar-w); background:var(--brand-dark); color:#fff;
  padding:1rem 0 .75rem; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; overflow:auto;
}
.sidebar__brand { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.25rem 1rem 1rem; }
.sidebar__logo { display:flex; align-items:center; gap:.6rem; color:inherit; text-decoration:none; min-width:0; }
.sidebar__logo img { display:block; max-height:44px; max-width:180px; width:auto; height:auto; }
.sidebar__mark { flex:0 0 auto; width:38px; height:38px; border-radius:10px; background:var(--brand); color:var(--on-brand); display:grid; place-items:center; font-weight:800; font-size:1.05rem; box-shadow:inset 0 0 0 1px rgba(255,255,255,.15); }
.sidebar__name { font-weight:700; font-size:1rem; line-height:1.2; overflow:hidden; text-overflow:ellipsis; }
.nav-burger { display:none; }
.nav { display:flex; flex-direction:column; gap:2px; padding:0 .6rem; }
.nav a {
  display:flex; align-items:center; gap:.65rem; color:rgba(255,255,255,.78); text-decoration:none;
  padding:.5rem .7rem; border-radius:9px; font-weight:500; font-size:.93rem; transition:background .12s, color .12s;
}
.nav a:hover { background:rgba(255,255,255,.1); color:#fff; }
.nav a.is-active { background:rgba(255,255,255,.16); color:#fff; font-weight:600; box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
.nav__icon { width:18px; height:18px; flex:0 0 18px; opacity:.85; }
/* The menu in groups (views/layout.php $navGroups): a small heading over each. */
.nav__group { display:flex; flex-direction:column; gap:2px; }
.nav__group + .nav__group { margin-top:.55rem; }
.nav__head { margin:.3rem .7rem .15rem; font-size:.68rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:rgba(255,255,255,.55); }
.sidebar--light .nav__head { color:var(--muted); }
.nav a.is-active .nav__icon { opacity:1; }
.sidebar__foot { margin-top:auto; padding:.9rem 1rem 0; font-size:.8rem; color:rgba(255,255,255,.7); border-top:1px solid rgba(255,255,255,.1); }
.sidebar__user { display:flex; gap:.6rem; align-items:center; line-height:1.4; }
.sidebar__user strong { color:#fff; font-weight:600; }
.sidebar__user a { color:rgba(255,255,255,.8); }
.sidebar__avatar { flex:0 0 auto; width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.15); display:grid; place-items:center; font-weight:700; color:#fff; }
.sidebar__foot form { display:inline; }
.sidebar__foot button { background:none; border:0; color:rgba(255,255,255,.8); padding:0; cursor:pointer; text-decoration:underline; font:inherit; }
/* The folded menu's name, slid out beside the icon pointed at (nav-fly.js) */
.nav-fly {
  position:fixed; z-index:1000; display:flex; align-items:center; gap:.65rem; padding-right:1rem; border-radius:9px;
  background:var(--brand-dark); background-image:linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.14)); color:#fff;
  font-weight:600; font-size:.93rem; white-space:nowrap; pointer-events:none; box-shadow:0 6px 18px rgba(0,0,0,.28);
  clip-path:inset(0 calc(100% - var(--fly-from, 64px)) 0 0 round 9px); transition:clip-path .14s ease-out;
}
.nav-fly.is-out { clip-path:inset(0 0 0 0 round 9px); }
.nav-fly[hidden] { display:none; }
.nav-fly .nav__icon { opacity:1; }
body .nav-fly .nav__badge { position:static; margin-left:.25rem; font-size:.72rem; min-width:1.45rem; padding:.05rem .45rem; }
.nav-fly--light { background:var(--bg); background-image:linear-gradient(var(--bg-alt), var(--bg-alt)); color:var(--ink); box-shadow:0 6px 18px rgba(0,0,0,.14), inset 0 0 0 1px var(--line); }
.nav-fly--light.is-active { background-image:linear-gradient(var(--brand-soft), var(--brand-soft)); color:var(--brand-dark); }
@media (prefers-reduced-motion: reduce) { .nav-fly { transition:none; } }
/* Light sidebar option */
.sidebar--light { background:var(--bg); color:var(--ink); border-right:1px solid var(--line); }
.sidebar--light .nav a { color:var(--muted); }
.sidebar--light .nav a:hover { background:var(--bg-alt); color:var(--ink); }
.sidebar--light .nav a.is-active { background:var(--brand-soft); color:var(--brand-dark); box-shadow:none; }
.sidebar--light .sidebar__foot { color:var(--muted); border-top-color:var(--line); }
.sidebar--light .sidebar__user strong, .sidebar--light .sidebar__user a, .sidebar--light .sidebar__foot button { color:var(--ink); }
.sidebar--light .sidebar__avatar { background:var(--brand-soft); color:var(--brand-dark); }
.sidebar--light .sidebar__name { color:var(--ink); }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  background:var(--bg); border-bottom:1px solid var(--line); padding:.85rem 1.5rem; position:sticky; top:0; z-index:5;
}
.topbar h1 { margin:0; }
.content { padding:1.5rem; max-width:1200px; width:100%; }

/* ----------------------------------------------------------- components */
.card { background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:1.1rem 1.25rem; margin-bottom:1.25rem; box-shadow:var(--shadow-sm); }
.card > h2 { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
.card__empty { color:var(--muted); margin:.35rem 0 0; }
.grid { display:grid; gap:1.25rem; }
.grid--2 { grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); }
.stats { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px,1fr)); gap:1rem; margin-bottom:1.25rem; }
.stat { background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:.95rem 1.1rem; box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); border-radius:4px 0 0 4px; }
.stat b { display:block; font-size:1.7rem; line-height:1.1; font-weight:800; letter-spacing:-.02em; }
.stat span { color:var(--muted); font-size:.82rem; font-weight:500; }

table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:.6rem .65rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:.74rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:700; background:var(--bg-alt); }
thead th:first-child { border-radius:8px 0 0 8px; }
thead th:last-child { border-radius:0 8px 8px 0; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:var(--brand-tint); }
td.num, th.num { text-align:right; white-space:nowrap; }
.table-wrap { overflow-x:auto; }

.badge { display:inline-block; padding:.15rem .55rem; border-radius:999px; font-size:.74rem; font-weight:600; white-space:nowrap; letter-spacing:.01em; }
.badge--grey   { background:#eef2f6; color:#475569; }
.badge--blue   { background:#e0edfb; color:#1d4ed8; }
.badge--green  { background:var(--brand-soft); color:var(--brand-dark); }
.badge--amber  { background:#fef3c7; color:#92400e; }
.badge--purple { background:#ede9fe; color:#5b21b6; }
.badge--red    { background:#fee2e2; color:#b91c1c; }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:.4rem; border:1px solid var(--brand); background:var(--brand); color:var(--on-brand);
  padding:.5rem .95rem; border-radius:var(--radius-sm); font-weight:600; font-size:.9rem; cursor:pointer;
  text-decoration:none; line-height:1.3; transition:background .12s, border-color .12s, transform .06s, box-shadow .12s; box-shadow:var(--shadow-sm);
}
.btn:hover { background:var(--brand-dark); border-color:var(--brand-dark); }
.btn:active { transform:translateY(1px); box-shadow:none; }
.btn--ghost { background:var(--bg); color:var(--brand-dark); border-color:var(--line-strong); }
.btn--ghost:hover { background:var(--brand-tint); border-color:var(--brand); }
.btn--accent { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.btn--accent:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
.btn--sm { padding:.3rem .65rem; font-size:.8rem; }
.actions { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }

.flash { padding:.75rem 1rem; border-radius:var(--radius-sm); margin-bottom:1rem; font-weight:500; border:1px solid transparent; }
.flash--success { background:var(--brand-soft); color:var(--brand-dark); border-color:color-mix(in srgb, var(--brand) 25%, transparent); }
.flash--error   { background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.flash--info    { background:#e0edfb; color:#1e3a8a; border-color:#bfdbfe; }
/* Needs attention: something to finish, not something that failed. Amber so it
   is plainly not the red of a failure, and plainly not nothing either. */
.flash--warn    { background:#fef3c7; color:#92400e; border-color:#fde68a; }
/* Test mode, and anything else that is a state of the system rather than news
   about this page. */
.flash--test    { background:#eef2ff; color:#3730a3; border-color:#c7d2fe; border-left:4px solid #6366f1; }
/* public/assets/keep-typed.js: typing kept across a reload, said above its form,
   and a button that has gone, waiting for the page (not greyed out like "can't"). */
.keep-note { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem .6rem; width:100%; box-sizing:border-box; margin:0 0 .6rem; padding:.5rem .75rem; border-radius:var(--radius-sm); background:#fef3c7; color:#92400e; border:1px solid #fde68a; font-size:.88rem; font-weight:600; }
.keep-note > span { flex:1 1 12rem; }
.btn.is-sending, .btn.is-sending:disabled { opacity:.75; cursor:progress; }
.btn.is-sending[aria-busy="true"]::after { content:"…"; }
.btn.is-saving[aria-busy="true"]::after { content:none; }

/* --------------------------------------------------------------- forms */
form.stack { display:grid; gap:1rem; max-width:760px; }
.fields { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); }
/* The hidden attribute wins over any display rule: a box marked hidden (the new-customer boxes on the job form until "New customer" is picked) stays out of sight. */
[hidden] { display:none !important; }
.field { display:flex; flex-direction:column; gap:.3rem; }
.field--wide { grid-column:1 / -1; }
.field label { font-weight:600; font-size:.85rem; }
.field input, .field select, .field textarea {
  font:inherit; padding:.55rem .7rem; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--bg); color:var(--ink);
  transition:border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline:0; border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field textarea { min-height:90px; resize:vertical; }
.field .hint { color:var(--muted); font-size:.8rem; }
.field .err { color:#b91c1c; font-size:.8rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color:#b91c1c; }
.filters { display:flex; flex-wrap:wrap; gap:.6rem; align-items:flex-end; margin-bottom:1rem; }
.filters .field { gap:.2rem; }

.dl { display:grid; grid-template-columns:minmax(120px,180px) 1fr; gap:.45rem 1rem; margin:0; }
.dl dt { color:var(--muted); font-size:.85rem; }
.dl dd { margin:0; }
.muted { color:var(--muted); }
.right { text-align:right; }
.nowrap { white-space:nowrap; }

/* ---------------------------------------------------------- login page */
.login { min-height:100vh; display:grid; place-items:center; align-content:center; grid-auto-rows:max-content; padding:1.5rem;
  background:radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--brand) 55%, var(--brand-dark)) 0%, var(--brand-dark) 55%, var(--brand-deeper) 100%); }
.login .card { width:100%; max-width:400px; margin:0; box-shadow:var(--shadow); padding:1.5rem 1.5rem 1.35rem; }
.login__logo { display:flex; justify-content:center; margin-bottom:1rem; }
.login__logo img { max-height:64px; max-width:220px; }
.login__mark { width:56px; height:56px; border-radius:14px; background:var(--brand); color:var(--on-brand); display:grid; place-items:center; font-weight:800; font-size:1.4rem; }

/* -------------------------------------------------- printable transfer note */
.sheet { background:#fff; max-width:820px; margin:1.5rem auto; padding:2rem; border:1px solid var(--line); }
.sheet h1 { font-size:1.35rem; margin-bottom:.15rem; }
.sheet__head { display:flex; justify-content:space-between; gap:2rem; border-bottom:2px solid var(--ink); padding-bottom:1rem; margin-bottom:1.25rem; }
.sheet__sig { display:grid; grid-template-columns:1fr 1fr; gap:2rem; margin-top:2rem; }
.sheet__sig div { border-top:1px solid var(--ink); padding-top:.4rem; font-size:.85rem; }
.sheet section { margin-bottom:1.25rem; }
.sheet h2 { font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:.4rem; }

.btn--big { display:block; width:100%; text-align:center; padding:.9rem 1rem; font-size:1.05rem; border-radius:12px; margin-top:.6rem; }
.btn--amber { background:var(--accent); border-color:var(--accent); color:#3b2500; }
.btn--amber:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
.btn--red { background:#b91c1c; border-color:#b91c1c; }
.btn--red:hover { background:#991b1b; border-color:#991b1b; }

/* ------------------------------------------------------------ driver app */
body.drv { background:var(--bg-alt); font-size:16px; }
.drv__top { display:flex; align-items:center; gap:.75rem; background:var(--brand-dark); color:#fff; font-family:var(--font); padding:.75rem 1rem; padding-top:max(.75rem, env(safe-area-inset-top)); }
.drv__brand { color:#fff; font-weight:700; text-decoration:none; flex:1; }
.drv__who { font-size:.9rem; opacity:.85; }
.drv__link { background:none; border:0; color:#dbeae1; text-decoration:underline; font:inherit; font-size:.9rem; cursor:pointer; padding:0; }
.drv__shift { background:#fff; border-bottom:1px solid var(--line); padding:.6rem 1rem; font-size:.9rem; }
.drv__shift form { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.drv__shift.is-on { background:var(--brand-soft); }
.drv__shift .dot { display:inline-block; width:.6rem; height:.6rem; border-radius:50%; background:var(--brand); margin-right:.3rem; animation:pulse 1.6s infinite; }
.drv__locstatus { display:block; margin-top:.3rem; color:var(--muted); font-size:.8rem; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.35 } }
.drv__main { padding:1rem; max-width:640px; margin:0 auto; }
.drv__h1 { font-size:1.35rem; margin:.25rem 0 .75rem; }
.drv__h2 { font-size:1rem; margin:1.5rem 0 .5rem; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.drv__card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:1rem 1.1rem; margin-bottom:1rem; }
.drv__card .stack { max-width:none; }
.drv__job { display:block; background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:.9rem 1rem; margin-bottom:.6rem; color:var(--ink); text-decoration:none; }
.drv__job:active { background:var(--brand-soft); }
.drv__job-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:.2rem; }
.drv__job-name { font-weight:700; font-size:1.05rem; }
.drv__job-addr { margin-top:.25rem; }
.drv__big { font-size:1.05rem; margin:.25rem 0 .75rem; }
.drv__addr { font-size:1.1rem; font-weight:600; margin:.5rem 0; }
.drv__notes { white-space:pre-wrap; background:var(--bg-alt); border-radius:9px; padding:.6rem .8rem; }
.drv__back { display:inline-block; margin-bottom:.6rem; text-decoration:none; font-weight:600; }
/* The driver's job screen in the order of the job, and "Do the job here" on the office job page:
   numbered steps, a tick on each one done, the next one lit up (owner, 23 Oct 2026). */
.steps { counter-reset:step; }
.step { counter-increment:step; }
.step__h { display:flex; align-items:center; gap:.55rem; }
.step__h::before { content:counter(step); flex:none; width:1.8rem; height:1.8rem; border-radius:50%; display:inline-grid; place-items:center;
  font-size:.85rem; font-weight:700; letter-spacing:0; background:var(--bg-alt); color:var(--muted); border:1px solid var(--line-strong); }
.step.is-done .step__h::before { content:"✓"; background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.step.is-next { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.step.is-next .step__h::before { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.drv__job--done { background:var(--bg-alt); }
.drv__details { margin-top:1rem; border-top:1px solid var(--line); padding-top:.75rem; }
.drv__details summary { cursor:pointer; font-weight:600; color:#b91c1c; padding:.4rem 0; }
.drv .field input, .drv .field select { font-size:16px; padding:.7rem .75rem; } /* stops iOS zooming on focus */

/* ---------------------------------------------------------- tracking */
.track { display:grid; grid-template-columns:320px 1fr; gap:1rem; min-height:calc(100vh - 140px); }
.track__map { border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; min-height:520px; }
#map { width:100%; height:100%; min-height:520px; }
.track__row { display:block; padding:.6rem .2rem; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; }
.track__row:last-child { border-bottom:0; }
.track__row:hover, .track__row.is-selected { background:var(--brand-soft); margin:0 -.5rem; padding-left:.7rem; padding-right:.7rem; border-radius:8px; }
.track__row-top { display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.track__job { font-size:.85rem; margin-top:.2rem; }
.track__actions { margin-top:.4rem; }
.pin { transform:translate(-50%, -100%); background:#fff; border:2px solid var(--brand); color:var(--brand-dark); font-weight:700; font-size:.8rem; padding:.2rem .5rem; border-radius:999px; white-space:nowrap; box-shadow:var(--shadow); position:relative; }
.pin::after { content:""; position:absolute; left:50%; bottom:-7px; width:10px; height:10px; background:#fff; border-right:2px solid var(--brand); border-bottom:2px solid var(--brand); transform:translateX(-50%) rotate(45deg); }
.pin--live { border-color:var(--brand); }
.pin--stale { border-color:var(--accent); color:#92400e; }
.pin--stale::after { border-color:var(--accent); }
.pin--off { border-color:#94a3b8; color:#475569; opacity:.7; }
.pin--off::after { border-color:#94a3b8; }
@media (max-width:900px) { .track { grid-template-columns:1fr; } .track__map, #map { min-height:380px; } }

/* ------------------------------------------------- vehicle check form */
.check__list { display:grid; gap:.5rem; margin:.75rem 0; }
.check__item { border:1px solid var(--line); border-radius:10px; padding:.6rem .75rem; margin:0; }
.check__item legend { font-weight:600; padding:0 .2rem; }
.check__opts { display:flex; gap:.5rem; margin:.4rem 0; }
.check__opt { flex:1; text-align:center; padding:.55rem; border:1px solid var(--line); border-radius:9px; cursor:pointer; font-weight:600; }
.check__opt input { margin-right:.35rem; }
.check__opt--ok:has(input:checked) { background:var(--brand-soft); border-color:var(--brand); color:var(--brand-dark); }
.check__opt--bad:has(input:checked) { background:#fee2e2; border-color:#b91c1c; color:#b91c1c; }
.check__note { width:100%; font:inherit; padding:.45rem .6rem; border:1px solid var(--line); border-radius:8px; }
.check__item:not(:has(.check__opt--bad input:checked)) .check__note { display:none; }

/* ----------------------------------------------- consignment notes */
.cn-line { border:1px solid var(--line); border-radius:10px; padding:.75rem 1rem; margin-bottom:.75rem; }
.cn-line legend { font-weight:700; padding:0 .3rem; }
.cn-line--spare { opacity:.75; }
.line-remove { border:1px solid var(--line); background:#fff; color:#b91c1c; border-radius:999px; width:1.5rem; height:1.5rem; line-height:1; font-size:1rem; cursor:pointer; vertical-align:middle; margin-left:.3rem; }
.line-remove:hover { background:#fee2e2; border-color:#b91c1c; }
.add-line { margin-right:.5rem; }
.extra-lines:empty { display:none; }
.cn-hp { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:.25rem .75rem; }
.cn-hp__opt { font-size:.85rem; }
.cn-sheet { page-break-after:always; font-size:.85rem; }
.cn-sheet h2 { margin-top:.5rem; }
.cn-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:.75rem; }
.cn-sigbox { border:1px solid var(--ink); padding:.4rem; min-height:80px; }
.cn-table { font-size:.78rem; }
.cn-table th, .cn-table td { border:1px solid var(--line); padding:.3rem .4rem; }

@media print {
  .no-print { display:none !important; }
  body { background:#fff; }
  .sheet { border:0; margin:0; max-width:none; padding:0; }
}

@media (max-width:780px) {
  .shell { flex-direction:column; }
  .sidebar { width:auto; flex:none; position:static; height:auto; padding:.6rem 0; }
  .sidebar__brand { padding:.25rem .9rem .35rem; }
  .nav-burger { display:flex; flex-direction:column; gap:4px; padding:.5rem; cursor:pointer; border-radius:8px; }
  .nav-burger span { display:block; width:22px; height:2px; background:currentColor; border-radius:2px; }
  .nav, .sidebar__foot { display:none; }
  .nav-toggle:checked ~ .sidebar .nav { display:flex; }
  .nav-toggle:checked ~ .sidebar .sidebar__foot { display:block; }
  .nav a { padding:.6rem .8rem; }
  .topbar { position:static; padding:.75rem 1rem; flex-wrap:wrap; }
  .topbar__search { order:3; flex-basis:100%; max-width:none; }
  .topbar__search kbd { display:none; }
  .content { padding:1rem; }
  .dl { grid-template-columns:1fr; gap:.15rem .5rem; }
  .dl dd { margin-bottom:.5rem; }
}

/* ------------------------------------------------- job photos (before/after) */
.photos { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.photos__h { font-size:.85rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); margin:0 0 .5rem; }
.photos__grid { display:flex; flex-wrap:wrap; gap:.5rem; }
.photos__thumb { position:relative; display:inline-block; border:1px solid var(--line); border-radius:9px; overflow:hidden; background:var(--bg-alt); text-decoration:none; }
.photos__thumb img { display:block; max-height:140px; width:auto; max-width:100%; }
.photos__when { display:block; font-size:.7rem; color:var(--muted); padding:.2rem .4rem; }
.photos__del { position:absolute; top:.3rem; right:.3rem; width:1.7rem; height:1.7rem; border:0; border-radius:50%; background:rgba(0,0,0,.6); color:#fff; font-size:.9rem; line-height:1.7rem; cursor:pointer; }
.photos__add label { cursor:pointer; }
.photos__hint { color:#b45309; font-size:.9rem; margin:.5rem 0 0; }
.btn[disabled], .btn:disabled { opacity:.45; cursor:not-allowed; }
.override { display:inline-block; }
.override summary { list-style:none; display:inline-block; }
.override summary::-webkit-details-marker { display:none; }
.override__form { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; margin-top:.5rem; padding:.6rem .75rem; border:1px solid var(--line); border-radius:9px; background:var(--bg-alt); }
.override__form label { flex-basis:100%; font-size:.9rem; }
.override__form input { flex:1; min-width:220px; }
@media (max-width:520px) { .photos { grid-template-columns:1fr; } }

/* "Do the job here" on the office job page (views/partials/job-here.php): the job's steps, on the office's
   own phone, every button big enough for a thumb (44px and up). */
.here__step { border-top:1px solid var(--line); padding:.85rem 0 .9rem; }
.here__step.is-next { border:1px solid var(--accent); border-radius:var(--radius-sm); padding:.85rem .75rem .9rem; margin:.35rem 0; }
.here__h { font-size:1rem; margin:0 0 .5rem; }
.here .btn { min-height:44px; }
.here .btn--big { margin-top:.5rem; }
.here .photos__del { width:2.75rem; height:2.75rem; line-height:2.75rem; font-size:1rem; }
.here .photos__thumb img { max-height:120px; }
.here__more summary, .here .drv__details summary { display:flex; align-items:center; min-height:44px; cursor:pointer; font-weight:600; color:var(--brand-dark); }
.here .drv__details { margin-top:.25rem; border-top:0; padding-top:0; }
.here .sig .stack { max-width:none; }

/* Settings sub-navigation and the getting-started checklist */
.subnav { display:flex; flex-wrap:wrap; gap:.25rem; margin:-.25rem 0 1rem; border-bottom:1px solid var(--line); }
.subnav a { padding:.5rem .8rem; border-bottom:2px solid transparent; color:var(--muted); text-decoration:none; font-weight:600; }
.subnav a:hover { color:var(--text); }
.subnav a.is-active { color:var(--brand-dark); border-bottom-color:var(--brand); }
.checklist { list-style:none; margin:0; padding:0; }
.checklist li { display:flex; gap:.75rem; align-items:flex-start; padding:.55rem 0; border-top:1px solid var(--line); }
.checklist li:first-child { border-top:0; }
.checklist__mark { flex:0 0 1.4rem; height:1.4rem; border-radius:50%; border:2px solid var(--line); text-align:center; line-height:1.2rem; font-weight:800; color:#fff; }
.checklist li.is-done .checklist__mark { background:var(--brand); border-color:var(--brand); }
.checklist li.is-done a { color:var(--muted); text-decoration:line-through; }

/* Plain-language choices (radio with a description) */
.choice { display:flex; gap:.6rem; align-items:flex-start; padding:.6rem .75rem; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.choice:has(input:checked) { border-color:var(--brand); background:var(--bg-alt); }
.choice input { margin-top:.3rem; }

/* Public enquiry page */
.public { max-width:560px; margin:0 auto; padding:1rem 1rem 2.5rem; font-size:17px; }
.public--embed { padding-top:.25rem; }
.public__head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem 1rem; padding:.5rem 0 1rem; }
.public__head h1 { font-size:1.35rem; margin:0; color:var(--brand-dark); }
.public__phone { display:inline-block; font-weight:700; text-decoration:none; color:var(--brand-dark); background:var(--brand-soft); border-radius:999px; padding:.45rem .9rem; }
.public__card { background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:1.25rem 1.25rem 1.5rem; box-shadow:var(--shadow); }
.public__title { font-size:1.4rem; margin:0 0 .35rem; }
.public__lead { margin:0 0 1rem; color:var(--muted); }
.public__form { display:grid; gap:1rem; }
.public__form .field label { font-size:1rem; }
.public__form .field input, .public__form .field select, .public__form .field textarea {
  font-size:17px; padding:.85rem .9rem; border-radius:11px; border:1.5px solid #cbd5e1; min-height:3.1rem;
}
.public__form .field select { appearance:none; -webkit-appearance:none;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right .8rem center; padding-right:2.4rem; }
.public__form .field textarea { min-height:120px; }
.public__form .field .hint, .public__form .field .err { font-size:.9rem; }
.public__form .field .err { font-weight:600; }
.public__send { font-size:1.15rem; padding:1rem; margin-top:.25rem; }
.public__foot { margin:1.25rem 0 0; text-align:center; }
.public__done { text-align:center; }
.public__tick { width:3.2rem; height:3.2rem; line-height:3.2rem; margin:.25rem auto .9rem; border-radius:50%; background:var(--brand); color:var(--on-brand); font-size:1.8rem; font-weight:700; }
.public__ref { font-size:1.1rem; margin:.5rem 0 0; }
/* Honeypot: off-screen, never hidden with display:none so bots still fill it. */
/* Packages on Settings → Plan. */
.packages { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:1rem; margin-top:.5rem; }
.package { border:1px solid var(--line); border-radius:var(--radius); padding:1rem; display:flex; flex-direction:column; gap:.5rem; }
.package--current { border-color:var(--brand); border-width:2px; background:var(--brand-soft); }
.package h3 { margin:0; font-size:1.15rem; }
.package__price { margin:0; font-size:1.4rem; }
.package__blurb { margin:0; color:var(--muted); font-size:.92rem; }
.package__list { margin:0; padding-left:1.1rem; font-size:.92rem; display:grid; gap:.25rem; }
.package form { margin-top:auto; }
.package .btn { width:100%; justify-content:center; }

/* Skip board: tighter tiles, the drop-off menu and one-line forms. */
.stats--tight { margin-bottom:1rem; }
.inline-form { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.inline-form label { font-weight:600; font-size:.9rem; }
.inline-form select, .inline-form input { padding:.45rem .6rem; border:1px solid var(--line); border-radius:8px; font:inherit; max-width:100%; }
.drop { position:relative; display:inline-block; }
.drop summary { list-style:none; cursor:pointer; }
.drop summary::-webkit-details-marker { display:none; }
.drop__menu { position:absolute; right:0; z-index:5; margin-top:.3rem; padding:.7rem; width:min(22rem, 80vw); display:grid; gap:.4rem; text-align:left;
  background:var(--bg); border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); }
.drop__menu label { font-size:.85rem; font-weight:600; }
.drop__menu select { padding:.45rem .5rem; border:1px solid var(--line); border-radius:8px; font:inherit; max-width:100%; }

/* "Next: price it" on an enquiry with no quote yet. */
.next-step { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.75rem 1rem; margin:.25rem 0 1.1rem; padding:.9rem 1rem; border-radius:var(--radius); background:var(--brand-soft); border:1px solid var(--brand); }
.next-step strong { display:block; font-size:1.05rem; color:var(--brand-dark); }
.next-step span { color:var(--muted); font-size:.92rem; }
.next-step > div { flex:1 1 240px; }

/* Price list (Settings) and the picker on quote/invoice lines. */
.price-rows { display:grid; gap:.4rem; margin-bottom:.75rem; }
.price-row { display:grid; grid-template-columns:minmax(0, 1fr) 9rem auto; gap:.5rem; align-items:start; }
.price-row .field { margin:0; min-width:0; }
.price-row input { width:100%; min-width:0; }
.price-row__price { position:relative; }
.price-row__price input { padding-left:1.6rem; }
.price-row__pound { position:absolute; left:.65rem; top:.6rem; color:var(--muted); pointer-events:none; }
.price-row--empty .price-row__price input { border-color:#f59e0b; background:#fffbeb; }
.price-row__remove { margin-top:.55rem; }
.price-pick-field { grid-column:1 / -1; }
.price-pick-field select { font-weight:600; }
.price-save { display:inline-flex; align-items:center; gap:.4rem; font-size:.85rem; color:var(--muted); margin-top:.35rem; cursor:pointer; font-weight:400; }
.price-save[hidden] { display:none; }
@media (max-width:560px) { .price-row { grid-template-columns:minmax(0, 1fr) 6.5rem auto; } }

/* Photo picker: a big "Add photos" button and previews of what was chosen. */
.photo-pick { display:grid; gap:.5rem; }
.photo-pick__btn { position:relative; display:flex; align-items:center; justify-content:center; gap:.5rem; padding:.9rem 1rem; border:2px dashed var(--brand); border-radius:var(--radius); background:var(--brand-soft); color:var(--brand-dark); font-weight:700; font-size:1.05rem; cursor:pointer; text-align:center; }
.photo-pick__btn:focus-within { outline:3px solid var(--brand); outline-offset:2px; }
.photo-pick__btn input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; }
.photo-pick__list { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; }
.photo-pick__list:empty { display:none; }
.photo-pick__item { width:64px; height:64px; border-radius:8px; overflow:hidden; background:var(--bg-alt); border:1px solid var(--line); font-size:.7rem; display:flex; align-items:center; justify-content:center; word-break:break-all; }
.photo-pick__item img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-pick__count { flex-basis:100%; font-size:.9rem; color:var(--muted); }
/* Enquiry photos in the office: square tiles, click for the full picture. */
.qphotos { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:.6rem; margin:.25rem 0 0; }
.qphotos__tile { position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden; border:1px solid var(--line); background:var(--bg-alt); }
.qphotos__tile a { display:block; width:100%; height:100%; }
.qphotos__tile img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .15s; }
.qphotos__tile a:hover img { transform:scale(1.04); }
.qphotos__tag { position:absolute; left:.35rem; bottom:.35rem; font-size:.7rem; background:rgba(15,23,42,.72); color:#fff; border-radius:999px; padding:.1rem .5rem; pointer-events:none; }
.qphotos__tile .photos__del { top:.35rem; right:.35rem; }
.public__hp { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
@media (max-width:480px) {
  .public { padding:.5rem .6rem 2rem; }
  .public__card { padding:1rem .9rem 1.25rem; border-radius:10px; }
  .public__head { padding-top:.25rem; }
}

/* Look settings page */
.swatches { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:.6rem; }
.swatch { display:flex; align-items:center; gap:.6rem; padding:.5rem .6rem; border:1px solid var(--line); border-radius:10px; cursor:pointer; background:var(--bg); }
.swatch:has(input:checked) { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.swatch input { position:absolute; opacity:0; }
.swatch__dot { width:28px; height:28px; border-radius:8px; flex:0 0 auto; position:relative; overflow:hidden; }
.swatch__dot i { position:absolute; right:0; bottom:0; width:40%; height:40%; border-radius:6px 0 0 0; }
.swatch span { font-weight:600; font-size:.9rem; }
.look-preview { border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; display:flex; min-height:190px; box-shadow:var(--shadow-sm); }
.look-preview__side { width:120px; padding:.8rem; color:#fff; background:var(--pv-dark); font-size:.75rem; display:flex; flex-direction:column; gap:.35rem; }
.look-preview__side.is-light { background:#fff; color:#0f172a; border-right:1px solid var(--line); }
.look-preview__side b { display:block; margin-bottom:.4rem; }
.look-preview__side i { display:block; height:8px; border-radius:4px; background:rgba(255,255,255,.25); width:80%; }
.look-preview__side i.on { background:rgba(255,255,255,.5); width:90%; }
.look-preview__side.is-light i { background:#e3e8ef; }
.look-preview__side.is-light i.on { background:var(--pv-soft); }
.look-preview__main { flex:1; padding:.9rem; background:var(--bg-alt); font-size:.8rem; }
.look-preview__btn { display:inline-block; padding:.35rem .7rem; border-radius:7px; background:var(--pv); color:var(--pv-on); font-weight:700; margin-right:.4rem; }
.look-preview__btn.alt { background:var(--pv-accent); color:var(--pv-on-accent); }
.look-preview__card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:.6rem; margin-top:.6rem; }
.look-preview__badge { display:inline-block; padding:.05rem .45rem; border-radius:999px; background:var(--pv-soft); color:var(--pv-dark); font-size:.7rem; font-weight:700; }
input[type=color] { width:64px; height:40px; padding:2px; border:1px solid var(--line-strong); border-radius:8px; background:#fff; cursor:pointer; }
.logo-box { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.logo-box img { max-height:56px; max-width:220px; background:repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0/16px 16px; border:1px solid var(--line); border-radius:8px; padding:.3rem; }

/* Companies House lookup under a customer's name (assets/company-lookup.js) */
.ch-list { position:absolute; top:calc(100% - .2rem); left:0; right:0; z-index:30; background:var(--card, #fff); border:1px solid var(--line); border-radius:10px;
  box-shadow:0 10px 30px rgba(15, 23, 42, .14); max-height:340px; overflow:auto; }
.ch-list[hidden], .ch-note[hidden] { display:none; }
.ch-item { padding:.55rem .75rem; cursor:pointer; border-bottom:1px solid var(--line); }
.ch-item small { display:block; color:var(--muted); font-size:.8rem; margin-top:.1rem; }
.ch-item[aria-selected="true"], .ch-item:hover { background:var(--brand-soft); }
.ch-status { margin-left:.4rem; vertical-align:1px; }
.ch-empty { padding:.6rem .75rem; color:var(--muted); font-size:.85rem; }
.ch-foot { padding:.35rem .75rem; color:var(--muted); font-size:.72rem; text-align:right; }
.ch-note { margin-top:.35rem; padding:.55rem .7rem; border-radius:8px; background:var(--brand-soft); color:var(--brand-dark); font-size:.82rem; display:grid; gap:.2rem; }
.ch-note--error { background:#fef3c7; color:#92400e; }
.ch-note--warn { background:#fee2e2; color:#7f1d1d; border-left:4px solid #b91c1c; }
/* The postcode address finder (address.js): Find beside the postcode, the addresses to pick from under it. */
.addr-row { display:flex; gap:.4rem; align-items:stretch; }
.addr-row input { flex:1 1 auto; min-width:0; }
.addr-find { flex:0 0 auto; white-space:nowrap; }
.addr-out[hidden] { display:none; }
.addr-pick-label { display:block; font-size:.8rem; color:var(--muted); margin:.35rem 0 .15rem; }
.addr-pick { width:100%; }
.addr-note { margin-top:.35rem; padding:.5rem .7rem; border-radius:8px; background:var(--brand-soft); color:var(--brand-dark); font-size:.82rem; }
.addr-note--error { background:#fef3c7; color:#92400e; }
.ch-note .ch-warn { color:#b91c1c; font-weight:600; }

/* The search box in the top bar (assets/search.js): results drop down as you type */
.topbar__search { position:relative; flex:1; max-width:34rem; margin:0; display:flex; align-items:center; }
.topbar__search input { width:100%; padding:.5rem 2.4rem .5rem .85rem; border:1px solid var(--line); border-radius:999px; background:var(--card, #fff); font:inherit; font-size:.92rem; color:var(--ink); }
.topbar__search input:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.topbar__search input::-webkit-search-cancel-button { -webkit-appearance:none; }
.topbar__search kbd { position:absolute; right:.7rem; top:50%; transform:translateY(-50%); font:600 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; color:var(--muted); border:1px solid var(--line); border-radius:5px; padding:.15rem .35rem; background:var(--bg); pointer-events:none; }
.topbar__search input:focus ~ kbd { display:none; }
.qs-list { position:absolute; top:calc(100% + .35rem); left:0; right:0; z-index:40; background:var(--card, #fff); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 14px 40px rgba(15, 23, 42, .18); max-height:min(70vh, 540px); overflow:auto; padding:.3rem 0; text-align:left; }
.qs-list[hidden] { display:none; }
.qs-group { padding:.5rem .85rem .2rem; font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.qs-item, .qs-more { display:block; padding:.45rem .85rem; color:var(--ink); text-decoration:none; line-height:1.3; }
.qs-item strong { font-weight:600; }
.qs-item small { display:block; color:var(--muted); font-size:.8rem; margin-top:.1rem; }
.qs-item .qs-badge { margin-left:.5rem; vertical-align:middle; font-size:.7rem; }
.qs-more { font-size:.85rem; color:var(--brand); padding-top:.3rem; }
.qs-item[aria-selected="true"], .qs-more[aria-selected="true"], .qs-item:hover, .qs-more:hover { background:var(--brand-soft); }
.qs-empty { padding:.7rem .85rem; color:var(--muted); font-size:.85rem; }
/* "Pick an existing customer" on a blank invoice (assets/customer-pick.js) */
.cust-pick { background:var(--bg-alt); border:1px solid var(--line); border-radius:var(--radius); padding:.8rem .9rem; min-width:0; }
.cust-pick[hidden], .cust-pick [hidden] { display:none !important; }
.cust-pick label { display:block; font-weight:600; font-size:.85rem; margin-bottom:.3rem; }
.cust-pick__box { position:relative; }
.cust-pick__q { width:100%; padding:.65rem .85rem; border:1px solid var(--line-strong); border-radius:var(--radius-sm); background:var(--card, #fff); color:var(--ink); font:inherit; font-size:16px; /* 16px: a phone does not zoom in */ }
.cust-pick__q:focus { outline:0; border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cust-pick__list { position:absolute; top:calc(100% + .3rem); left:0; right:0; z-index:40; background:var(--card, #fff); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 14px 40px rgba(15, 23, 42, .18); max-height:min(60vh, 420px); overflow-y:auto; overflow-x:hidden; padding:.3rem 0; text-align:left; -webkit-overflow-scrolling:touch; }
.cust-pick__item { padding:.55rem .85rem; min-height:44px; line-height:1.3; cursor:pointer; overflow-wrap:anywhere; }
.cust-pick__item strong { font-weight:600; }
.cust-pick__item small { display:block; color:var(--muted); font-size:.8rem; margin-top:.1rem; }
.cust-pick__badge { margin-left:.5rem; vertical-align:middle; font-size:.7rem; }
.cust-pick__item[aria-selected="true"], .cust-pick__item:hover { background:var(--brand-soft); }
.cust-pick__empty { padding:.7rem .85rem; color:var(--muted); font-size:.85rem; }
.cust-pick .hint { display:block; color:var(--muted); font-size:.8rem; margin-top:.35rem; }
.cust-pick__status { margin:.5rem 0 0; color:#92400e; font-size:.85rem; }
.cust-pick__chosen { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin:0; padding:.55rem .75rem; background:var(--card, #fff); border:1px solid var(--brand); border-radius:var(--radius-sm); min-width:0; }
.cust-pick__search:not([hidden]) ~ .cust-pick__chosen { margin-top:.65rem; }
.cust-pick__who { min-width:0; overflow-wrap:anywhere; }
.cust-pick__sub { display:block; color:var(--muted); font-size:.8rem; }
.cust-pick__clear { flex:none; display:inline-flex; align-items:center; min-height:44px; padding:0 .4rem; font-weight:600; }
.search-results { list-style:none; margin:0; padding:0; }
.search-results li { border-top:1px solid var(--line); }
.search-results li:first-child { border-top:0; }
.search-results a { display:block; padding:.6rem .25rem; color:var(--ink); text-decoration:none; border-radius:8px; }
.search-results a:hover { background:var(--brand-soft); }
.search-results .badge { margin-left:.5rem; vertical-align:middle; }

/* Bar charts on Reports and the Today page (views/partials/charts.php): plain HTML, no script */
.bars { display:grid; gap:.45rem; }
.bar-row { display:grid; grid-template-columns:minmax(6rem, 11rem) 1fr auto; gap:.6rem; align-items:center; font-size:.9rem; }
.bar-row .bar-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bar-row .bar-label a { color:inherit; text-decoration:none; }
.bar-row .bar-label a:hover { text-decoration:underline; }
.bar { height:1.1rem; background:var(--brand-soft); border-radius:6px; overflow:hidden; }
.bar i { display:block; height:100%; background:linear-gradient(90deg, var(--brand) 0%, var(--brand-dark, var(--brand)) 100%); border-radius:6px; transition:width .4s ease; }
.bar-row .bar-val { font-variant-numeric:tabular-nums; color:var(--muted); font-size:.85rem; white-space:nowrap; min-width:3.2rem; text-align:right; }
.cols { display:flex; align-items:flex-end; gap:.35rem; height:170px; padding-top:.4rem; }
.col { flex:1; min-width:0; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; gap:.2rem; font-size:.68rem; color:var(--muted); }
.col i { display:block; width:100%; background:var(--brand); border-radius:5px 5px 0 0; min-height:2px; }
.col:hover i { background:var(--brand-dark, var(--brand)); }
.col b { font-size:.7rem; color:var(--ink); font-variant-numeric:tabular-nums; white-space:nowrap; min-height:.9rem; }
.col span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.charts { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:1.25rem 1.5rem; }
.chart-title { font-size:.74rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 .5rem; font-weight:700; }
/* Donuts: a ring of conic-gradient segments (--chart-1 … --chart-8), a hole in the page colour with the total, and a legend beside it */
.donut { display:flex; align-items:center; gap:1rem 1.25rem; flex-wrap:wrap; container-type:inline-size; }
.donut-ring { position:relative; flex:0 0 auto; width:150px; height:150px; border-radius:50%; box-shadow:inset 0 0 0 1px rgba(15,23,42,.05); -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.donut-hole { position:absolute; inset:23%; border-radius:50%; background:var(--bg); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; line-height:1.1; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.donut-hole b { font-size:1rem; font-variant-numeric:tabular-nums; max-width:94%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.donut-hole b.is-long { font-size:.82rem; }
.donut-hole span { font-size:.62rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-top:.15rem; }
.donut-legend { list-style:none; margin:0; padding:0; flex:1 1 10rem; min-width:0; display:grid; gap:.3rem; font-size:.88rem; align-content:center; }
.donut-legend li { display:grid; grid-template-columns:auto minmax(0, 1fr) auto auto; gap:.5rem; align-items:center; }
.donut-swatch { display:block; width:.8rem; height:.8rem; border-radius:3px; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.donut-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.donut-legend b { font-variant-numeric:tabular-nums; white-space:nowrap; }
.donut-legend small { color:var(--muted); font-size:.8rem; font-variant-numeric:tabular-nums; white-space:nowrap; min-width:2.4rem; text-align:right; }
/* Too narrow for the legend beside the ring (a phone, or three across on a small screen): ring in the middle, legend under it */
@container (max-width:339px) { .donut-ring { margin:0 auto; } .donut-legend { flex-basis:100%; } }
/* Three charts across on a desktop, two on a tablet, one on a phone; their headings put the note on its own line */
.charts-3 { grid-template-columns:repeat(3, minmax(0, 1fr)); }
.charts-3 .donut-ring { width:136px; height:136px; }
.charts-3 .card > h2 { display:block; }
.charts-3 .card > h2 > .muted { display:block; margin-top:.1rem; }
@media (max-width:1000px) { .charts-3 { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:640px) { .charts-3 { grid-template-columns:1fr; } }
@media print { .bar i, .col i, .donut-ring, .donut-hole, .donut-swatch { -webkit-print-color-adjust:exact; print-color-adjust:exact; } .charts-3 { grid-template-columns:repeat(2, minmax(0, 1fr)); } .card { break-inside:avoid; } }

/* Weighbridge register: one line per waste line, the description cut short */
.wb-waste div { max-width:13rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* The maker's mark: WasteFriendly in the sidebar foot and under the sign-in card */
.sidebar__wf { display:flex; align-items:center; gap:.45rem; margin-top:.8rem; padding-top:.7rem; border-top:1px solid rgba(255,255,255,.1); color:rgba(255,255,255,.7); text-decoration:none; font-size:.78rem; font-weight:600; letter-spacing:.01em; }
.sidebar__wf img { width:18px; height:18px; border-radius:5px; }
.sidebar__wf b { font-weight:800; color:#8fc2ff; }
.sidebar__wf:hover { color:#fff; }
.sidebar--light .sidebar__wf { border-top-color:var(--line); color:var(--muted); }
.sidebar--light .sidebar__wf b { color:#1d4ed8; }
.wf-foot { display:flex; align-items:center; justify-content:center; gap:.4rem; margin:1rem 0 0; font-size:.82rem; font-weight:600; color:var(--muted); }
.wf-foot img { width:20px; height:20px; border-radius:6px; }
.wf-foot b { font-weight:800; color:#1d4ed8; }
.wf-foot__by { font-weight:400; }
.wf-foot__by::before { content:"·"; margin-right:.4rem; }
@media print { .sidebar__wf, .wf-foot { display:none; } }
/* "Powered by WasteFriendly" under the pages a company's customers see. */
.wf-powered { display:flex; align-items:center; justify-content:center; gap:.35rem; margin:1.25rem 0 0; font-size:.78rem; color:var(--muted); }
.wf-powered a { display:inline-flex; align-items:center; gap:.35rem; color:inherit; text-decoration:none; }
.wf-powered img { width:16px; height:16px; border-radius:4px; }
.wf-powered b { font-weight:800; color:#1d4ed8; }
.share .enquire-link { word-break:break-all; font-weight:600; }
@media print { .wf-powered { display:none; } }
/* What the firm does (Trades): tick boxes on the sign-up form and in Settings → Company. */
.trades-pick { border: 0; padding: 0; margin: .6rem 0 1rem; }
.trades-pick legend { padding: 0; margin-bottom: .5rem; }
.trades-pick legend .muted { display: block; font-size: .88rem; margin-top: .15rem; }
.trades { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .55rem; }
.trade { display: block; border: 2px solid #dbe3f5; border-radius: 12px; padding: .7rem .8rem; background: #fff; cursor: pointer; line-height: 1.3; }
.trade input { margin-right: .35rem; }
.trade .muted { display: block; font-size: .84rem; margin-top: .2rem; }
.trade:has(input:checked) { border-color: var(--brand, #1d4ed8); box-shadow: 0 0 0 3px var(--brand-soft, #e0e9fd); }
/* "Copy to" box beside a Send button (CopyTo): who else gets this email. */
.copy-to { display: inline-flex; align-items: center; gap: .4rem; margin: 0 .4rem .3rem 0; font-size: .88rem; color: var(--muted, #475569); }
.copy-to input { font: inherit; min-width: 15rem; padding: .4rem .6rem; border: 1px solid var(--line-strong, #cbd5e1); border-radius: var(--radius-sm, 6px); }
.field .copy-to { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; }
/* The enquiry form's QR code (views/partials/enquiry-qr.php). */
.enquiry-qr { display: flex; gap: 1.1rem; align-items: flex-start; flex-wrap: wrap; }
.enquiry-qr__code { width: 150px; height: 150px; flex: 0 0 150px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; overflow: hidden; background: #fff; }
.enquiry-qr__code svg { width: 100%; height: 100%; display: block; }
.enquiry-qr__text { flex: 1 1 240px; }

/* The paper trail's fold-away forms (PaperTrail): on the job page and the driver's screen. */
.pt-more { margin-top:.6rem; }
.pt-more summary { cursor:pointer; font-weight:600; color:var(--brand-dark, var(--brand)); padding:.35rem 0; }
.pt-row { display:flex; flex-wrap:wrap; gap:.5rem; align-items:flex-end; }
.pt-row .field { flex:1 1 8rem; }

/* ======================================================================
   Driver web pages, the app's look (owner, 11 Nov 2026: "the one on my phone
   looks diff to the internet one" ... "green completed blue scheduled").
   The phone app's colours, sizes, cards, buttons and status pills (driver app
   src/theme.ts, src/ui.tsx, src/JobSteps.tsx), for the pages a driver opens in
   a browser (views/layout-driver.php puts class "drv" on <body>). Everything
   here is under body.drv, so no office page changes. Everything tappable is
   at least 56px tall; text is dark on light for sunlight.
   ====================================================================== */
body.drv {
  --a-bg:#f2f4f1; --a-card:#fff; --a-text:#111827; --a-muted:#4b5563; --a-line:#e5e7eb;
  --a-red:#b91c1c; --a-red-tint:#fee2e2; --a-green:#15803d; --a-green-tint:#dcfce7;
  --a-blue:#1d4ed8; --a-blue-tint:#dbeafe; --a-amber-ink:#92400e; --a-amber-tint:#fef3c7; --a-purple:#6d28d9;
  /* The app uses the phone's own font, not the office's. */
  font:16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:var(--a-bg); color:var(--a-text); overflow-x:hidden;
}
body.drv h1, body.drv h2, body.drv h3 { letter-spacing:0; }
body.drv a { color:var(--brand-dark); }
body.drv img { max-width:100%; }
body.drv .muted { color:var(--a-muted); }

/* The bar at the top: the company's colour, as the app's header. */
body.drv .drv__top { min-height:60px; background:var(--brand); color:var(--on-brand); padding:.25rem .75rem .25rem 1rem; padding-top:max(.25rem, env(safe-area-inset-top)); gap:.5rem; }
body.drv .drv__brand { color:var(--on-brand); font-size:18px; font-weight:700; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.drv .drv__who { font-size:14px; opacity:.9; max-width:30vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.drv .drv__link { display:inline-flex; align-items:center; min-height:56px; padding:0 .25rem; color:var(--on-brand); text-decoration:none; font-size:15px; font-weight:700; }
body.drv .drv__link > span { display:inline-block; padding:.45rem .8rem; border-radius:999px; background:rgba(255,255,255,.2); }
/* On shift / off shift, under the bar. */
body.drv .drv__shift { background:var(--a-card); border-bottom:1px solid var(--a-line); padding:.5rem 1rem; font-size:16px; font-weight:600; }
body.drv .drv__shift.is-on { background:var(--a-green-tint); }
body.drv .drv__shift .dot { background:var(--a-green); }
body.drv .drv__shift form { flex-wrap:wrap; }
body.drv .drv__shift .btn { min-height:56px; padding:0 1.1rem; font-size:17px; margin:0; }
body.drv .drv__main { padding:12px 12px 32px; max-width:640px; }
body.drv .drv__back { display:inline-flex; align-items:center; min-height:56px; margin:0 0 4px; font-size:17px; font-weight:700; color:var(--brand-dark); }

/* Card (src/ui.tsx Card). */
body.drv .drv__card, body.drv .a-card { background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; padding:16px; margin-bottom:12px; box-shadow:none; }
body.drv .drv__h1 { font-size:26px; font-weight:800; color:var(--brand-dark); margin:4px 0 12px; line-height:1.2; }
body.drv .drv__h2, body.drv .a-h2 { font-size:22px; font-weight:700; color:var(--a-text); text-transform:none; letter-spacing:0; margin:0 0 6px; line-height:1.25; }

/* Buttons (src/ui.tsx Button): 56px, the main one on a step 64px. */
body.drv .btn { min-height:56px; border-radius:12px; padding:.5rem 1rem; font-size:18px; font-weight:700; line-height:1.25; box-shadow:none; border:2px solid var(--brand); background:var(--brand); color:var(--on-brand); text-align:center; }
body.drv .btn:hover { background:var(--brand-dark); border-color:var(--brand-dark); }
body.drv .btn--big { display:flex; width:100%; min-height:64px; font-size:20px; font-weight:800; margin-top:12px; }
body.drv .btn--ghost, body.drv .btn--ghost:hover { background:var(--a-card); color:var(--brand-dark); border-color:var(--brand); }
body.drv .btn--plain, body.drv .btn--plain:hover { background:var(--a-line); color:var(--a-text); border-color:var(--a-line); }
body.drv .btn--amber, body.drv .btn--accent { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
body.drv .btn--amber:hover, body.drv .btn--accent:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
body.drv .btn--red, body.drv .btn--red:hover { background:var(--a-red); border-color:var(--a-red); color:#fff; }
body.drv .btn--sm { min-height:56px; font-size:16px; padding:.4rem .8rem; }
body.drv .btn[disabled], body.drv .btn:disabled { opacity:.45; }
body.drv label.btn { cursor:pointer; }

/* Messages (src/ui.tsx Notice). */
body.drv .flash { border-radius:12px; padding:12px; margin-bottom:12px; font-size:16px; line-height:22px; font-weight:500; border:0; }
body.drv .flash--success { background:var(--a-green-tint); color:var(--a-green); }
body.drv .flash--error { background:var(--a-red-tint); color:var(--a-red); }
body.drv .flash--warn { background:var(--a-amber-tint); color:var(--a-amber-ink); }
body.drv .flash--info { background:var(--a-blue-tint); color:var(--a-blue); }

/* Forms: as tall as a thumb, 16px so the phone does not zoom. */
body.drv .field label, body.drv .a-label { font-size:15px; font-weight:700; color:var(--a-text); }
body.drv .field input, body.drv .field select, body.drv .field textarea, body.drv .a-input,
body.drv form input:not([type=radio]):not([type=checkbox]):not([type=file]):not([type=hidden]), body.drv form select, body.drv form textarea {
  font-size:16px; min-height:56px; padding:.6rem .75rem; border:1px solid #cbd5e1; border-radius:12px; background:#fff; color:var(--a-text); max-width:100%; box-sizing:border-box;
}
body.drv form textarea { min-height:80px; }
body.drv form input[type=radio], body.drv form input[type=checkbox] { width:22px; height:22px; accent-color:var(--brand); vertical-align:middle; }
body.drv details > summary { display:flex; align-items:center; min-height:56px; cursor:pointer; font-size:17px; font-weight:700; }
body.drv .pt-more summary { color:var(--brand-dark); }
body.drv .drv__details summary { color:var(--a-red); }

/* Status pills (src/theme.ts statusTone): scheduled blue, on site amber, completed green. */
body.drv .a-pill { display:inline-block; flex:none; border-radius:999px; padding:4px 12px; font-size:14px; font-weight:700; line-height:1.3; white-space:nowrap; background:var(--a-line); color:var(--a-text); }
body.drv .a-pill--booked { background:#e5e7eb; color:#374151; }
body.drv .a-pill--scheduled { background:var(--a-blue-tint); color:var(--a-blue); }
body.drv .a-pill--on_site { background:var(--a-amber-tint); color:var(--a-amber-ink); }
body.drv .a-pill--completed { background:var(--a-green-tint); color:var(--a-green); }
body.drv .a-pill--incomplete, body.drv .a-pill--cancelled, body.drv .a-pill--red { background:var(--a-red-tint); color:var(--a-red); }
body.drv .a-pill--invoiced { background:#ede9fe; color:var(--a-purple); }
body.drv .a-pill--amber { background:var(--a-amber-tint); color:var(--a-amber-ink); }

/* The Jobs list (app/(tabs)/index.tsx): a section per day, a row per job with the stop number big at the left. */
body.drv .a-section { font-size:22px; font-weight:800; color:var(--brand-dark); margin:12px 0 8px; line-height:1.25; }
body.drv .a-section--sub { font-size:18px; color:var(--a-text); margin-top:8px; }
body.drv .a-section__hint { font-size:14px; color:var(--a-muted); margin:-4px 0 8px; }
body.drv .a-empty { font-size:16px; color:var(--a-muted); margin:0 0 12px; }
body.drv .a-row { display:flex; background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; margin-bottom:8px; min-height:72px; overflow:hidden; color:var(--a-text); text-decoration:none; }
body.drv .a-row:active { background:var(--brand-soft); }
body.drv .a-row__slot { flex:0 0 56px; width:56px; background:var(--brand); color:var(--on-brand); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
body.drv .a-row__slot--done { background:var(--a-green); color:#fff; }
body.drv .a-row__stop { font-size:30px; font-weight:800; line-height:34px; }
body.drv .a-row__slotsm { font-size:14px; font-weight:700; opacity:.9; }
body.drv .a-row__slottext { font-size:16px; font-weight:800; }
body.drv .a-row__body { flex:1; min-width:0; padding:12px; display:flex; flex-direction:column; gap:2px; }
body.drv .a-row__customer { font-size:18px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.drv .a-row__when { font-size:16px; font-weight:700; color:var(--brand-dark); }
body.drv .a-row__service { font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.drv .a-row__addr { font-size:16px; color:var(--a-muted); overflow-wrap:anywhere; }
body.drv .a-row__toadd { font-size:16px; font-weight:700; color:var(--a-amber-ink); }
body.drv .a-row__foot { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:4px; }
body.drv .a-row__ref { font-size:14px; font-weight:600; color:var(--a-muted); }
body.drv .a-later { border-top:1px solid var(--a-line); margin-top:8px; }
body.drv .a-later > summary { justify-content:space-between; list-style:none; }
body.drv .a-later > summary::-webkit-details-marker { display:none; }
body.drv .a-later > summary .a-section { margin:0; }
body.drv .a-later > summary::after { content:"Show"; color:var(--brand-dark); font-size:16px; font-weight:700; padding:0 8px; }
body.drv .a-later[open] > summary::after { content:"Hide"; }
/* What goes above the list: the vehicle check, read and sign, the red crash button, the office's changes. */
body.drv .a-banner { display:block; background:var(--a-card); border:1px solid var(--accent); border-radius:12px; padding:12px; margin-bottom:8px; min-height:56px; color:var(--a-text); text-decoration:none; }
body.drv .a-banner__title { display:block; font-size:16px; font-weight:700; }
body.drv .a-banner__text { display:block; font-size:14px; color:var(--a-muted); margin-top:2px; }
body.drv .a-tosign { display:flex; align-items:center; min-height:64px; background:var(--a-card); border:2px solid var(--brand); border-radius:12px; padding:12px; margin-bottom:12px; color:var(--a-text); text-decoration:none; }
body.drv .a-tosign__body { flex:1; min-width:0; }
body.drv .a-tosign__title { display:block; font-size:22px; font-weight:800; color:var(--brand-dark); }
body.drv .a-tosign__hint { display:block; font-size:16px; color:var(--a-muted); margin-top:2px; }
body.drv .a-chev { font-size:34px; font-weight:700; color:var(--brand); padding:0 8px; line-height:1; }
body.drv .a-report { display:flex; align-items:center; gap:12px; min-height:64px; background:var(--a-red); border-radius:12px; padding:8px 16px; margin-bottom:12px; color:#fff !important; text-decoration:none; font-size:18px; font-weight:800; }
body.drv .a-report__mark { flex:none; width:34px; height:34px; border-radius:50%; background:#fff; color:var(--a-red); text-align:center; font-size:24px; line-height:34px; font-weight:900; }
body.drv .a-confirm { background:var(--a-card); border:2px solid var(--brand) !important; border-radius:12px; padding:12px; margin-bottom:12px; }
body.drv .a-confirm__title { font-size:22px; font-weight:800; color:var(--brand-dark); margin:0; }
body.drv .a-confirm__hint { font-size:16px; color:var(--a-muted); margin:2px 0 0; }
body.drv .a-confirm__item { border-top:1px solid var(--a-line) !important; margin-top:12px; padding:12px 0 0 !important; }
body.drv .a-confirm__what { font-size:18px; font-weight:700; }
body.drv .a-confirm__body { font-size:16px; line-height:23px; margin:4px 0; white-space:pre-line; }

/* The job, as the app's guided job screen (app/jobs/[id].tsx). */
body.drv .a-strip { background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; padding:12px; margin-bottom:8px; }
body.drv .a-strip__top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
body.drv .a-strip__customer { flex:1; min-width:0; font-size:22px; font-weight:800; margin:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.25; }
body.drv .a-strip__what { font-size:16px; margin-top:2px; }
body.drv .a-strip__when { font-size:16px; font-weight:700; color:var(--brand-dark); margin-top:2px; }
body.drv .a-strip__refs { font-size:14px; margin-top:2px; }
body.drv .a-strip__ref { font-size:14px; font-weight:600; color:var(--a-muted); }
body.drv .a-sub { margin-top:8px; padding:8px; border-radius:8px; background:var(--a-blue-tint); color:var(--a-blue); }
body.drv .a-sub b { display:block; font-size:22px; font-weight:800; }
/* The progress strip (src/JobSteps.tsx ProgressStrip): a segment per step, ticked when done, this one lit. */
body.drv .a-prog { margin:4px 0 12px; }
body.drv .a-prog__segs { display:flex; gap:4px; align-items:flex-start; }
body.drv .a-prog__seg { flex:1; min-width:0; height:22px; border-radius:6px; background:var(--a-line); color:var(--on-brand); font-size:12px; font-weight:800; line-height:22px; text-align:center; overflow:hidden; text-decoration:none; }
body.drv .a-prog__seg.is-done { background:var(--brand); }
body.drv .a-prog__seg.is-done::before { content:"✓"; }
body.drv .a-prog__seg.is-now { background:var(--accent); height:26px; margin-top:-2px; }
body.drv .a-prog__seg.is-now::before { content:""; }
body.drv .a-stephead { margin:0 0 12px; }
body.drv .a-stephead__of { display:block; font-size:14px; font-weight:700; color:var(--a-muted); text-transform:uppercase; letter-spacing:.5px; margin-top:8px; }
body.drv .a-stephead__title { display:block; font-size:26px; font-weight:800; color:var(--a-text); margin:2px 0 0; line-height:1.2; }
body.drv .a-stephead__next { display:block; font-size:14px; color:var(--a-muted); margin-top:2px; }
/* One step at a time: with the page's script on, only the step on screen shows. Without it (an old phone), every step shows, one under the other. */
html.js body.drv .gsteps:not(.is-all) > .gstep:not(.is-current) { display:none; }
html.js body.drv .gsteps.is-all .a-nav, html.js body.drv .gsteps.is-all .a-undo--again,
html:not(.js) body.drv .a-undo--again, html:not(.js) body.drv .a-only-js { display:none; }
html:not(.js) body.drv .gstep { border-top:3px solid var(--a-line); padding-top:4px; margin-top:12px; }
html:not(.js) body.drv .gstep.is-current { border-top-color:var(--accent); }
body.drv .gsteps.is-all .gstep { border-top:3px solid var(--a-line); padding-top:4px; margin-top:12px; }
body.drv .gsteps:not(.is-all) .a-all-only { display:none; }
html:not(.js) body.drv .gsteps .a-all-only { display:block; }
body.drv .a-lead { font-size:18px; line-height:25px; margin:0 0 8px; }
body.drv .a-hint { font-size:14px; color:var(--a-muted); line-height:20px; margin:8px 0 0; }
body.drv .a-addr { font-size:22px; font-weight:700; line-height:28px; margin:4px 0; overflow-wrap:anywhere; }
body.drv .a-big { font-size:18px; font-weight:700; line-height:24px; }
body.drv .a-label { display:block; font-size:14px; color:var(--a-muted); font-weight:600; margin:8px 0 4px; }
body.drv .gstep .drv__card { border-color:var(--a-line); padding:12px; margin:12px 0 0; }
body.drv .gstep .drv__card:first-child { margin-top:0; }
/* Back and Skip under the step (src/JobSteps.tsx StepNav), and the links under them. */
body.drv .a-nav { display:flex; gap:8px; margin-top:12px; }
body.drv .a-nav__btn { flex:1; min-width:0; min-height:56px; display:flex; align-items:center; justify-content:center; padding:0 8px; border:2px solid var(--a-line); border-radius:12px; background:var(--a-card); color:var(--a-text) !important; font-size:18px; font-weight:700; text-decoration:none; text-align:center; }
body.drv .a-nav__gap { flex:1; }
body.drv .a-link { display:flex; min-height:56px; align-items:center; justify-content:center; margin-top:8px; font-size:16px; font-weight:700; color:var(--brand-dark) !important; text-decoration:none; text-align:center; background:none; border:0; width:100%; cursor:pointer; font-family:inherit; }
body.drv .a-link--red, body.drv details.a-incomplete > summary { color:var(--a-red) !important; }
body.drv details.a-incomplete > summary { justify-content:center; list-style:none; font-size:16px; }
body.drv details.a-incomplete > summary::-webkit-details-marker { display:none; }
body.drv details.a-incomplete[open] { background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; padding:4px 16px 16px; margin-top:8px; }
body.drv .a-undo { margin:0 0 12px; }
body.drv .a-undo .btn { width:100%; min-height:56px; }
/* "On my way": the minutes, then "Send it" (a text cannot be unsent). */
body.drv .a-omw { display:flex; gap:8px; margin-top:12px; }
body.drv .a-omw .btn { flex:1; min-width:0; min-height:64px; margin:0; padding:0 4px; background:var(--a-card); color:var(--brand-dark); border:2px solid var(--brand); font-size:22px; font-weight:800; }
body.drv .a-sheet { margin-top:12px; padding:12px; border-radius:12px; background:var(--a-amber-tint); }
body.drv .a-sheet__title { font-size:18px; font-weight:700; line-height:24px; margin:0; }
/* Photos (src/JobParts.tsx PhotoColumn). */
body.drv .a-photocol__title { font-size:16px; font-weight:700; color:var(--brand-dark); margin:12px 0 4px; }
body.drv .a-photocol__none { font-size:14px; color:var(--a-muted); margin:0 0 4px; }
body.drv .a-thumbs { display:flex; flex-wrap:wrap; gap:8px; }
body.drv .a-thumb { position:relative; width:96px; height:96px; }
body.drv .a-thumb img { width:96px; height:96px; object-fit:cover; border-radius:8px; background:var(--a-line); display:block; }
body.drv .a-thumb form { position:absolute; top:-8px; right:-8px; margin:0; }
body.drv .a-thumb__x { width:40px; height:40px; border-radius:50%; border:2px solid #fff; background:var(--a-red); color:#fff; font-size:16px; font-weight:800; cursor:pointer; padding:0; }
body.drv .a-row2 { display:flex; gap:8px; }
body.drv .a-row2 > * { flex:1; min-width:0; }
body.drv .a-row2 form, body.drv .a-row2 label { margin:0; }
body.drv .photos__add { margin:0; }
body.drv .photos__thumb img { max-height:120px; }
body.drv .photos__del { width:40px; height:40px; line-height:40px; background:var(--a-red); font-size:16px; }
body.drv .photos__hint { color:var(--a-amber-ink); font-size:16px; }
/* The Complete step: what the job has, what is missing, and the confirm before "Completed" (it cannot be undone). */
body.drv .a-checklist { display:grid; gap:4px; margin:0 0 8px; padding:0; list-style:none; }
body.drv .a-checklist li { font-size:18px; font-weight:700; color:var(--a-green); }
body.drv .a-checklist li.is-no { color:var(--a-muted); font-weight:600; }
body.drv .a-missing { margin-top:8px; padding:12px; border-radius:12px; background:var(--a-amber-tint); color:var(--a-amber-ink); font-size:16px; line-height:22px; }
body.drv .a-missing .btn { margin-top:8px; width:100%; }
body.drv .a-reasons { display:grid; gap:8px; margin:4px 0 8px; }
body.drv .a-reason { display:flex; align-items:center; gap:10px; min-height:56px; padding:0 12px; border:2px solid var(--a-line); border-radius:12px; background:var(--a-card); font-size:16px; cursor:pointer; }
body.drv .a-reason:has(input:checked) { border-color:var(--a-red); background:var(--a-red-tint); color:var(--a-red); font-weight:700; }
/* The Done screen. */
body.drv .a-done { text-align:center; }
body.drv .a-done__mark { width:72px; height:72px; border-radius:50%; margin:0 auto; background:var(--a-green); color:#fff; font-size:40px; font-weight:800; line-height:72px; }
body.drv .a-done__title { font-size:34px; font-weight:800; margin:8px 0 0; }
body.drv .a-done__sub { font-size:16px; color:var(--a-muted); margin:2px 0 8px; }
body.drv .a-next__name { font-size:22px; font-weight:800; margin:2px 0 0; }
/* Skips on the job (src/JobParts.tsx JobSkips). */
body.drv .a-skipref { font-size:22px; font-weight:800; color:var(--brand-dark); }
/* What was logged on the job so far, the camera for the next skip's photo, and the app's Swap (views/driver/job.php skips box). */
body.drv .a-skipdone { margin:4px 0; font-size:18px; font-weight:700; color:var(--a-green); }
body.drv .a-skipphoto { margin:4px 0 8px; padding:12px; border-radius:12px; background:var(--a-amber-tint); }
body.drv .a-skipphoto .a-lead { color:var(--a-amber-ink); font-weight:700; }
body.drv .a-swap { margin-top:8px; }
body.drv .a-swap > summary { justify-content:center; list-style:none; border:2px solid var(--a-line); border-radius:12px; background:var(--a-card); color:var(--brand-dark); }
body.drv .a-swap > summary::-webkit-details-marker { display:none; }
body.drv .a-swap[open] > summary { border-color:var(--brand); }
/* The vehicle check (app/checks/[period].tsx): each item its own card, big OK / Defect. */
body.drv .check__list { gap:12px; }
body.drv .check__item { background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; padding:16px; }
body.drv .check__item legend { float:left; width:100%; padding:0; font-size:16px; font-weight:700; }
body.drv .check__opts { clear:both; gap:8px; margin:8px 0; }
body.drv .check__opt { display:flex; align-items:center; justify-content:center; min-height:56px; border-radius:12px; font-size:16px; font-weight:700; }
body.drv .check__opt--ok:has(input:checked) { background:var(--brand-soft); border-color:var(--brand); color:var(--brand-dark); }
body.drv .check__note { min-height:56px; font-size:16px; border-radius:12px; }
body.drv .check__danger { display:flex !important; align-items:center; gap:10px; min-height:56px; font-size:16px !important; font-weight:600; }
body.drv .check__danger:has(input:checked) { color:var(--a-red); }
body.drv .a-slot { border-top:1px solid var(--a-line); padding-top:8px; margin-top:8px; }
body.drv .a-slot__head { display:flex; justify-content:space-between; align-items:center; font-size:16px; font-weight:700; }
body.drv .a-slot__need { font-size:14px; font-weight:700; color:var(--a-amber-ink); }
body.drv .a-slot__ok { font-size:16px; font-weight:800; color:var(--brand); }
/* Read and sign (app/documents): a row per paper, the kind above the title. */
body.drv .a-doc { display:flex; align-items:center; min-height:72px; background:var(--a-card); border:1px solid var(--a-line); border-radius:12px; padding:12px; margin-bottom:8px; color:var(--a-text); text-decoration:none; }
body.drv .a-doc--todo { border:2px solid var(--brand); }
body.drv .a-doc--late { border:2px solid var(--a-red); }
body.drv .a-doc__body { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
body.drv .a-doc__kind { font-size:14px; font-weight:700; color:var(--a-muted); }
body.drv .a-doc__title { font-size:18px; font-weight:800; }
body.drv .a-doc__line { font-size:16px; font-weight:700; color:var(--brand-dark); }
body.drv .a-doc__line--late { color:var(--a-red); }
body.drv .a-doc__line--done { color:var(--a-green); font-weight:600; }
body.drv .a-kind { display:block; font-size:14px; font-weight:700; color:var(--a-muted); margin-top:4px; }
/* Report a crash: the answer tiles as big as the app's. */
body.drv .inc-tile { min-height:64px; display:flex; flex-direction:column; justify-content:center; }
@media (max-width:360px) {
  body.drv .a-omw .btn { font-size:19px; }
  body.drv .a-strip__customer, body.drv .a-tosign__title { font-size:20px; }
  body.drv .a-stephead__title, body.drv .drv__h1 { font-size:24px; }
}
/* A paper-trail part that is a step of the job on its own (views/driver/paper-trail.php $ptBare): the step has the heading. */
body.drv .pt-bare > .drv__h2:first-child { display:none; }
body.drv .pt-part > p:first-of-type { margin-top:0 !important; }
/* The signing pad as a step: no fold line; the pad's buttons as wide as the step's. */
body.drv .sig--step .drv__details { margin-top:0; border-top:0; padding-top:0; }
body.drv .sig--step .sig__again > summary.btn { display:flex; justify-content:center; width:100%; color:var(--brand-dark); margin-top:8px; }
body.drv .gstep__card > .btn, body.drv .gstep__card > a.btn, body.drv .gstep .photos__add > label.btn { display:flex; width:100%; }
body.drv .gstep__card > .btn--plain { margin-top:12px; }
body.drv .gstep .photos__add > label.btn:not(.btn--big) { margin-top:8px; }
body.drv .a-row2 .photos__add > label.btn { margin-top:0; }
/* "Dangerous" is asked once a defect is picked, as in the app (the note already works this way). */
body.drv .check__item:not(:has(.check__opt--bad input:checked)) .check__danger:not(:has(input:checked)) { display:none !important; }
body.drv .drv__brand { display:inline-flex; align-items:center; min-height:56px; }
body.drv .sig--step .actions { display:block; }
body.drv .sig--step .actions .btn { width:100%; }
/* Choices as the app's plain tiles: the round radio is hidden only where the browser can colour the picked tile (:has); older phones keep it. */
@supports selector(:has(*)) {
  body.drv .check__opt, body.drv .a-reason { position:relative; }
  body.drv .check__opt input[type=radio], body.drv .a-reason input[type=radio] { position:absolute; opacity:0; width:1px; height:1px; margin:0; }
  body.drv .check__opt:has(input:focus-visible), body.drv .a-reason:has(input:focus-visible) { outline:3px solid var(--brand); outline-offset:2px; }
}
/* A form's one column never grows past the phone (the signing pad's canvas is 640 wide inside). */
body.drv form.stack { grid-template-columns:minmax(0, 1fr); }
body.drv canvas { max-width:100%; }

/* ======================================================================
   Office pages on a phone (phone review 14 Nov 2026): 16px text in every
   box, so an iPhone does not zoom in when one is tapped; buttons and form
   taps at least 44px high; and the top search box on its own row at full
   width. Last in the sheet on purpose: the search box's own rule above
   (flex:1; max-width:34rem) came after the phone rule and undid it, which
   squashed the box to "Fir" on pages with a short title. Nothing here
   changes a computer-sized screen. The driver pages (body.drv) and the
   quote desk (desk.css) have their own, bigger sizes already.
   ====================================================================== */
@media (max-width:780px) {
  /* :is() takes the weight of its strongest choice, so the select and textarea here beat ".field select" and the like too.
     A box made bigger on purpose (the desk's money box) keeps its size: those use !important. */
  :is(.shell, .login, .help-panel, .ticket-panel) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]), select, textarea) { font-size:16px; }
  /* Boxes styled in the page itself ("font:inherit" picks up a small label's size): 16px all the same. */
  .shell :is(input, select, textarea):is([style*="font:inherit"], [style*="font: inherit"]):not([type=checkbox]):not([type=radio]):not([type=file]) { font-size:16px !important; }
  :is(.shell, .login) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]), select) { min-height:44px; }
  .btn, .btn--sm, button.btn, label.btn { min-height:44px; min-width:44px; }
  .btn--sm { padding:.45rem .8rem; font-size:.88rem; }
  input[type=checkbox], input[type=radio] { width:1.25rem; height:1.25rem; }
  /* A tick box or a choice inside its words: the whole line is the tap, 44px high. */
  .shell label:has(> input[type=checkbox]):not(.swatch):not(.trade):not(.btn),
  .shell label:has(> input[type=radio]):not(.swatch):not(.trade):not(.btn) { min-height:44px; display:inline-flex; align-items:center; gap:.45rem; }
  .line-remove { width:44px; height:44px; font-size:1.25rem; }
  .override summary, .pt-more summary { min-height:44px; display:flex; align-items:center; }
  .subnav a { display:inline-flex; align-items:center; min-height:44px; }
  .topbar { gap:.6rem .75rem; }
  .topbar h1 { flex:1 1 auto; min-width:0; }
  .topbar__search { order:3; flex:1 1 100%; max-width:none; }
  .topbar__search input { font-size:16px; padding:.6rem 2.4rem .6rem .9rem; }
  /* The menu (☰): each group two across, every link a 44px tap, so it is about one screen, not two. */
  .nav { padding:0 .6rem .4rem; }
  .nav__group { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:4px; }
  .nav__head { grid-column:1 / -1; margin:.45rem .2rem .1rem; }
  .nav a { min-height:44px; padding:.45rem .55rem; gap:.5rem; font-size:.9rem; line-height:1.2; }
  .nav a > span:not(.nav__badge) { min-width:0; overflow-wrap:anywhere; }
  .sidebar__foot button, .sidebar__user a { display:inline-flex; align-items:center; min-height:44px; }
}

/* Wide tables as cards on a phone (public/assets/table-cards.js gives each cell its column's name as
   data-label): a card per row, the name beside each value, nothing off the side of the screen. A
   computer or tablet sees the tables as before. */
@media screen and (max-width:600px) {
  .table-wrap:has(> table.t-cards) { overflow-x:visible; }
  table.t-cards { min-width:0 !important; width:100% !important; }
  table.t-cards thead { display:none; }
  table.t-cards, table.t-cards tbody, table.t-cards tfoot, table.t-cards tr { display:block; width:100%; }
  table.t-cards tbody tr { border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--bg); padding:.2rem .75rem; margin:0 0 .6rem; box-shadow:var(--shadow-sm); }
  table.t-cards tbody tr:hover { background:var(--bg); }
  table.t-cards td, table.t-cards tbody th, table.t-cards tfoot th { display:block; padding:.45rem 0; border-bottom:1px solid var(--line); text-align:left; white-space:normal; background:none; }
  table.t-cards tbody tr > :last-child { border-bottom:0; }
  table.t-cards [data-label] { display:grid; grid-template-columns:minmax(5.5rem, 36%) minmax(0, 1fr); gap:.2rem .75rem; align-items:start; }
  table.t-cards [data-label]::before { content:attr(data-label); font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); line-height:1.3; padding-top:.2rem; overflow-wrap:anywhere; }
  table.t-cards .t-val { min-width:0; overflow-wrap:anywhere; }
  table.t-cards td.num, table.t-cards td.right { text-align:left; }
  table.t-cards tbody tr > :first-child .t-val { font-weight:600; }
  table.t-cards tfoot tr { padding:.2rem .75rem; }
  /* A table with no headings that is a list (the Day plan's "No driver yet"): each row's cells one under the other. */
  table.t-stack, table.t-stack tbody, table.t-stack tr, table.t-stack td { display:block; width:100%; }
  table.t-stack tr { padding:.5rem 0; border-bottom:1px solid var(--line); }
  table.t-stack td { padding:.15rem 0; border:0; text-align:left; }
  table.t-stack td.num .btn { margin-top:.35rem; }
  /* The quote desk's queue tabs wrap onto a second row instead of scrolling sideways. */
  .dq-tabs { flex-wrap:wrap !important; overflow-x:visible !important; margin:0 0 .55rem !important; padding:0 !important; }
}
