/* FleetRecord styles. Tokens live in theme.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 .9375rem/1.55 var(--font-ui); font-variant-ligatures: none; color: var(--ink-body); background: var(--paper); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.5rem; font-weight: 400; }
h2 { font-size: 1.0625rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--brand-text); }
img { max-width: 100%; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.muted { color: var(--ink-3); }
.sub { font-size: .8125rem; color: var(--ink-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.c-overdue { color: var(--overdue); } .c-soon { color: var(--soon); }
.boot, .loading { padding: 32px; color: var(--ink-3); }

/* ---- The pink banner: Alchemy's signature for main titles ---- */
.page-head h1, .auth-card h1, .banner {
  display: block; width: fit-content; max-width: 100%; padding: 4px 20px; color: var(--brand-ink); background: var(--brand);
  font-weight: 400; font-size: 1.5rem; line-height: 1.4; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere;
}
.page-head .head-vehicle h1, .head-vehicle h1 { display: block; padding: 0; background: none; text-transform: none; letter-spacing: 0; color: inherit; }
.logo { display: block; height: auto; max-width: 100%; }
.logo-text { font-weight: 700; font-size: 1.125rem; letter-spacing: -.01em; color: var(--ink); }

/* ---- Registration plate ---- */
.plate { position: relative; display: inline-block; vertical-align: middle; white-space: nowrap; padding: .2em .6em .1em 1.75em;
  font: 600 1.15rem/1.15 var(--font-plate); letter-spacing: .07em; text-transform: uppercase; color: var(--plate-ink);
  background: linear-gradient(to right, var(--plate-band) 0, var(--plate-band) 1.15em, var(--plate) 1.15em);
  border: 1.5px solid #151515; border-radius: 5px; }
.plate::before { content: "UK"; position: absolute; left: 0; bottom: .28em; width: 1.15em; text-align: center; color: #fff; font: 700 .42em/1 var(--font-ui); letter-spacing: .02em; }
.head-vehicle h1 .plate { font-size: 1.9rem; }
.plate-link { text-decoration: none; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; font: 400 .875rem/1.2 var(--font-ui);
  color: var(--ink); background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.btn:hover { background: #EFEFEF; color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-primary:hover { background: #000; border-color: #000; color: #fff; }
.btn-danger { color: #fff; background: var(--overdue); border-color: var(--overdue); }
.btn-danger:hover { background: #8F1D17; color: #fff; }
.btn-sm { min-height: 34px; padding: 5px 10px; font-size: .8125rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; text-underline-offset: 3px; }
.link:hover { color: var(--brand-text); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; background: none; border: 0; border-radius: var(--radius); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--quiet-bg); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.field.span-2 { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .8125rem; }
.req { color: var(--overdue); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; font: inherit; font-size: .875rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
.hint { margin: 0; font-size: .75rem; color: var(--ink-3); }
.form-error { margin: 12px 0 0; padding: 10px 12px; color: var(--overdue); background: var(--overdue-bg); border-radius: var(--radius); font-size: .875rem; }
.warn { margin: 12px 0 0; padding: 10px 12px; color: var(--soon); background: var(--soon-bg); border-radius: var(--radius); font-size: .875rem; }
.notice { padding: 10px 12px; background: var(--info-bg); color: var(--info); border-radius: var(--radius); font-size: .875rem; }
.check { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 400; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.check.small { font-size: .8125rem; align-items: center; }
.check.small input { margin-top: 0; }
fieldset { margin: 0 0 20px; padding: 18px 20px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
legend { padding: 0 6px; font-weight: 700; }
.page-form { max-width: 860px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.stack { display: grid; gap: 16px; }

/* ---- Signed-out screens ---- */
.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100dvh; }
.auth-side { display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 48px; color: #fff; background: var(--ink); }
.auth-banners { display: grid; gap: 8px; justify-items: start; }
.auth-banners .banner { font-size: 1.75rem; padding: 4px 20px; }
.auth-line { margin: 0; max-width: 34ch; font-size: .9375rem; line-height: 1.6; color: #e4e4e4; }
.auth-plates { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.auth-plates .plate { font-size: 1.6rem; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { width: 220px; margin-bottom: 28px; }
.auth-card h1 { margin-bottom: 20px; font-size: 1.25rem; }
.auth-alt { margin-top: 20px; font-size: .8125rem; color: var(--ink-2); line-height: 1.9; }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 16px; color: var(--ink); background: var(--surface); border-right: 1px solid var(--line); }
.side-brand { padding: 0 10px; min-height: 40px; }
.side-brand .logo { width: 190px; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--ink-3); font-size: .9375rem; letter-spacing: .04em; text-decoration: none; border-radius: var(--radius); }
.side-link:hover { color: var(--ink); background: var(--paper); }
.side-link[aria-current="page"] { color: var(--ink); font-weight: 700; background: var(--paper); box-shadow: inset 4px 0 0 var(--brand); }
.side-foot { margin-top: auto; padding: 0 10px; font-size: .8125rem; color: var(--ink-2); }
.side-user { display: grid; gap: 2px; margin: 0 0 10px; }
.side-email { overflow-wrap: anywhere; color: var(--ink); }
.side-role { color: var(--ink-3); }
.side-switch { display: grid; gap: 4px; margin-bottom: 12px; }
.side-switch select { min-height: 36px; font-size: .8125rem; }
.side-signout { padding: 0; font: inherit; color: var(--ink); text-decoration: underline; background: none; border: 0; cursor: pointer; text-underline-offset: 3px; }
.side-signout:hover { color: var(--brand-text); }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; font-size: .75rem; font-weight: 700; text-align: center; color: #fff; background: var(--overdue); border-radius: 99px; }
.badge[hidden] { display: none; }
.content { min-width: 0; }
main { padding: 28px 32px 28px; max-width: 1180px; }
main:focus { outline: none; }
.mobile-brand, .tabbar { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head .sub { margin: 6px 0 0; }
.crumb { margin: 0 0 8px; font-size: .8125rem; }
.head-actions { display: flex; gap: 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.filters input[type=search] { width: min(400px, 100%); }
.filters select { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg-btn { min-height: 40px; padding: 8px 14px; font: 400 .8125rem var(--font-ui); color: var(--ink); background: none; border: 0; border-right: 1px solid var(--line-strong); cursor: pointer; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: #EFEFEF; }
.seg-btn[aria-pressed="true"] { color: #fff; background: var(--ink); }
.summary { margin: 0 0 18px; font-size: 1rem; }
.summary strong { font-size: 1.25rem; }

/* ---- Tasks ---- */
.group { margin-bottom: 22px; }
.group-head { margin: 0 0 8px; font-size: 1rem; }
.group-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; font: 700 .9375rem var(--font-ui); color: var(--ink); background: none; border: 0; cursor: pointer; }
.group-toggle::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .12s; }
.group-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
.count { min-width: 24px; padding: 0 8px; font-size: .75rem; text-align: center; color: var(--ink-2); background: var(--quiet-bg); border-radius: 99px; }
.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.task { position: relative; display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) auto; align-items: center; gap: 8px 18px; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line); cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st, var(--line-strong)); }
.task:hover { background: #FAFAFA; }
.task-overdue { --st: var(--overdue); } .task-due_soon { --st: #D98A00; } .task-upcoming { --st: var(--ok); }
.task-no_date { --st: var(--info); } .task-snoozed, .task-dismissed { --st: var(--line-strong); }
.task-snoozed, .task-dismissed { opacity: .8; }
.task-title { padding: 0; font: 700 .9375rem/1.35 var(--font-ui); color: var(--ink); text-align: left; background: none; border: 0; cursor: pointer; }
.task-title:hover { text-decoration: underline; }
.task-main .tag { margin-left: 6px; }
.task-who { margin-top: 4px; font-size: .875rem; color: var(--ink-2); }
.task-date { font-size: .875rem; }
.task-rel { font-size: .8125rem; color: var(--ink-2); }
.task-overdue .task-rel { color: var(--overdue); font-weight: 700; }
.task-due_soon .task-rel { color: var(--soon); font-weight: 700; }
.tag { display: inline-block; padding: 0 7px; font-size: .6875rem; color: var(--ink-2); background: var(--quiet-bg); border-radius: 3px; vertical-align: middle; }
.pill { display: inline-block; padding: 1px 10px; font-size: .75rem; font-weight: 700; color: var(--quiet); background: var(--quiet-bg); border-radius: 99px; white-space: nowrap; }
.pill-overdue { color: var(--overdue); background: var(--overdue-bg); }
.pill-due_soon { color: var(--soon); background: var(--soon-bg); }
.pill-upcoming { color: var(--ok); background: var(--ok-bg); }
.pill-no_date { color: var(--info); background: var(--info-bg); }

/* ---- Tables ---- */
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .8125rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.grid th { padding: 10px 16px; font-size: .75rem; font-weight: 700; text-align: left; color: var(--ink-2); background: #FAFAFA; border-bottom: 1px solid var(--line); }
.grid td { padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.grid tr:last-child td { border-bottom: 0; }
.grid th.num { text-align: right; }
.sort-btn { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; align-items: center; gap: 4px; }
.sort-btn:hover { text-decoration: underline; }
.sort-btn:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; }
th[aria-sort="ascending"] .sort-btn::after { content: "\25B2"; font-size: .65em; }
th[aria-sort="descending"] .sort-btn::after { content: "\25BC"; font-size: .65em; }
.grid td.act { text-align: right; white-space: nowrap; }
.grid .sub { margin-top: 2px; }

/* ---- Detail pages ---- */
.tabs { display: flex; gap: 4px; margin: 0 0 22px; overflow-x: auto; border-bottom: 1px solid var(--line-strong); }
.tab { padding: 10px 14px; margin-bottom: -1px; font-size: .875rem; color: var(--ink-3); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.cols .span-all { grid-column: 1 / -1; }
.cols h2, #tab-body > h2 { margin-bottom: 12px; }
.cols h2::after, #tab-body > h2::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 6px; background: var(--accent); }
.facts { display: grid; gap: 10px; margin: 0; }
.facts > div { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-2); font-size: .8125rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: .8125rem; }
.history li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.chg { display: inline-block; margin: 2px 6px 0 0; padding: 1px 8px; font-size: .75rem; background: var(--quiet-bg); border-radius: 3px; }
.empty { padding: 40px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.empty h2 { margin-bottom: 6px; }
.empty p { max-width: 52ch; margin-left: auto; margin-right: auto; color: var(--ink-2); }
.empty-error h2 { color: var(--overdue); }

/* ---- Modal ---- */
.modal { width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink-body); background: var(--surface); border: 0; border-radius: var(--radius-lg); box-shadow: 0 18px 60px rgb(20 20 20 / .3); }
.modal::backdrop { background: rgb(20 20 20 / .5); }
.modal-wide { width: min(780px, calc(100vw - 24px)); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; border-top: 5px solid var(--brand); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.modal-head h2 { font-size: 1.125rem; padding-top: 4px; }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #FAFAFA; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel-who { margin-bottom: 14px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.panel-history { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-history h3 { margin-bottom: 8px; }
.menu-list { display: grid; gap: 4px; margin-bottom: 16px; }
.menu-link { display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--ink); text-decoration: none; border-radius: var(--radius); }
.menu-link:hover { background: var(--paper); }

/* ---- Toasts ---- */
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 20px; display: grid; gap: 8px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; font-size: .875rem; color: #fff; background: var(--ink); border-left: 5px solid var(--brand); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(20 20 20 / .3); }
.toast-error { background: var(--overdue); border-left-color: #fff; }

/* ---- Small screens ---- */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .mobile-brand .logo { height: 40px; width: auto; }
  main { padding: 18px 16px 20px; }
  .tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line-strong); }
  .tab-link { position: relative; display: grid; justify-items: center; gap: 2px; padding: 9px 4px 8px; font: 400 .6875rem var(--font-ui); color: var(--ink-3); text-decoration: none; background: none; border: 0; cursor: pointer; }
  .tab-link[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }
  .tab-link .badge { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0; min-width: 18px; padding: 0 5px; font-size: .6875rem; }
  .tab-link { min-width: 0; }
  .tab-link span { text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .auth { display: block; }
  .auth-side { padding: 28px 24px; gap: 18px; }
  .auth-banners .banner { font-size: 1.25rem; }
  .auth-plates { flex-direction: row; flex-wrap: wrap; }
  .auth-plates .plate { font-size: 1.15rem; }
  .auth-main { padding: 28px 20px 40px; }
  .form-grid, .cols { grid-template-columns: 1fr; }
  .task { grid-template-columns: 1fr; gap: 6px; padding-right: 14px; }
  .task-act { margin-top: 4px; }
  .grid thead { display: none; }
  .grid, .grid tbody { display: block; border: 0; background: none; }
  .grid tr { display: block; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
  .grid td { display: flex; justify-content: space-between; gap: 16px; padding: 9px 14px; text-align: right; }
  .grid td::before { content: attr(data-label); flex: none; color: var(--ink-2); font-size: .8125rem; text-align: left; }
  .grid td:not([data-label]) { justify-content: flex-end; }
  .grid td:not([data-label])::before { content: none; }
  .grid td.num { text-align: right; }
  .modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; }
  .modal-form { max-height: 92dvh; }
  .modal-head { border-radius: 12px 12px 0 0; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Additions: banners, documents, audit, totals ---- */
[hidden] { display: none !important; }
.banner-info, .banner-warn, .banner-danger { margin: 0 0 18px; padding: 12px 16px; font-size: .875rem; border-radius: var(--radius); border-left: 5px solid; }
.banner-info { color: var(--info); background: var(--info-bg); border-color: var(--info); }
.banner-warn { color: var(--soon); background: var(--soon-bg); border-color: #D98A00; }
.banner-danger { color: var(--overdue); background: var(--overdue-bg); border-color: var(--overdue); }
.banner-warn .plate, .banner-info .plate { font-size: 1rem; }
.spaced { margin: 28px 0 12px; }
.mono { font-family: var(--font-ui); letter-spacing: .04em; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.later { margin-top: 36px; }
.chips { margin-top: 2px; }
.subject { display: inline-flex; gap: 6px; align-items: center; margin: 0 4px; }
.subject .plate { font-size: .95rem; }
.presets { margin: -4px 0 18px; font-size: .8125rem; }
.presets .link { margin: 0 6px; }
.audit-filters, .inline-field { align-items: end; }
.inline-field { display: grid; gap: 2px; }
.inline-field label { font-size: .75rem; font-weight: 700; }
.inline-field input { min-height: 40px; }
.grid tfoot td { padding: 10px 16px; font-weight: 700; background: #FAFAFA; border-top: 1px solid var(--line); border-bottom: 0; }
.totals-label { color: var(--ink-2); }
.dropzone { margin-bottom: 20px; padding: 18px 20px; background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); }
.dropzone.over { background: #FFF3F8; border-color: var(--brand); }
.dropzone .field { max-width: 300px; margin-bottom: 10px; }
.doc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.upload-status { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: .8125rem; }
.upload-status .busy { color: var(--ink-2); }
.upload-status .done { color: var(--ok); }
.upload-status .failed { color: var(--overdue); }
.camera { display: block; width: 100%; max-height: 60vh; background: #111; border-radius: var(--radius); }
fieldset.pick { margin: 14px 0 0; display: grid; gap: 10px; max-height: 280px; overflow: auto; }
.btn[href] { text-decoration: none; }
@media (max-width: 860px) {
  .grid tfoot, .grid tfoot tr { display: block; }
  .grid tfoot td { display: flex; justify-content: space-between; padding: 9px 14px; }
}

/* ---- Dashboard, reports, availability ---- */
.brand-link { display: inline-block; text-decoration: none; color: inherit; }
.brand-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
/* The FleetRecord logo sits above the organisation's logo and takes its width: the organisation's logo sets the width,
   and the FleetRecord logo contributes none (width 0) until it stretches to fill it (min-width 100%). */
.brand-stack { display: inline-flex; flex-direction: column; align-items: stretch; gap: 10px; }
.logo-product { display: block; width: 0; min-width: 100%; height: auto; }
/* Phone header: the FleetRecord mark on the left and the organisation's logo beside it, both the same height. */
.brand-row { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark { display: block; height: 40px; width: auto; flex: none; }
.auth-card .brand-stack { margin-bottom: 28px; }
.auth-card .brand-stack .logo { margin-bottom: 0; }
.period { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; margin-bottom: 8px; }
.period .seg { flex-wrap: wrap; }
.period-note { margin: 4px 0 18px; font-size: .8125rem; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin-bottom: 26px; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.figures.small { margin-bottom: 18px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.figure { display: grid; align-content: start; gap: 2px; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; margin: 0 -1px -1px 0; }
a.figure:hover { background: #FAFAFA; }
a.figure:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.figure-value { font: 700 1.75rem/1.1 var(--font-ui); letter-spacing: -.01em; }
.figure-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.figure-sub { font-size: .75rem; color: var(--ink-3); }
.figure.tone-bad .figure-value { color: var(--overdue); }
.figure.tone-warn .figure-value { color: var(--soon); }
.figure.tone-good .figure-value { color: var(--ok); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; align-items: start; }
.dash-panel { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.dash-panel.wide { margin-bottom: 24px; }
.dash-panel h2 { margin: 0 0 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; }
.dash-panel h3 { margin: 16px 0 6px; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.dash-panel p { margin: 12px 0 0; font-size: .875rem; }
table.mini { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.mini th { padding: 6px 0; font-weight: 400; text-align: left; color: var(--ink-2); border-bottom: 1px solid var(--line); }
table.mini td { padding: 6px 0; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.mini tr.total th, table.mini tr.total td { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--line-strong); }
table.mini tr.bad th, table.mini tr.bad td { color: var(--overdue); font-weight: 700; }
table.mini.spaced { margin-top: 18px; }
ul.attn { list-style: none; margin: 0; padding: 0; }
ul.attn li { border-bottom: 1px solid var(--line); }
ul.attn a { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 8px 0; color: inherit; text-decoration: none; font-size: .875rem; }
ul.attn a:hover .attn-name { text-decoration: underline; }
.attn-due { text-align: right; white-space: nowrap; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .875rem; }
.grid.compact td, .grid.compact th { padding-top: 9px; padding-bottom: 9px; }
td.num a, td.num a:visited { font-weight: 700; text-decoration: none; }
td.num a.n-overdue { color: var(--overdue); }
td.num a.n-due_soon { color: var(--soon); }
.report-actions { display: flex; gap: 10px; margin: 0 0 18px; flex-wrap: wrap; }
.scroll { overflow-x: auto; border-radius: var(--radius); }
table.report { min-width: 980px; }
.tag-warn { background: var(--soon-bg); color: var(--soon); border-color: #D98A00; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.banner-warn p, .banner-info p, .banner-danger p { margin: 0; }
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .tabbar { grid-template-columns: repeat(5, 1fr) !important; }
}

/* ---- Phones: fit the screen with no sideways scrolling, and use the space well ---- */
.period-select { display: none; }
@media (max-width: 860px) {
  body { font-size: .875rem; }
  .shell, .content, main { min-width: 0; max-width: 100%; }
  main { padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); }
  p, li, dd, td, th, h2, h3 { overflow-wrap: break-word; }
  .page-head { flex-wrap: wrap; gap: 8px; }

  .period { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; margin-bottom: 4px; }
  .period .seg { display: none; }
  .period .period-select { display: block; grid-column: 1 / -1; width: 100%; }
  .period .inline-field { min-width: 0; }
  .period .inline-field input { width: 100%; min-width: 0; }
  .period-note { margin: 6px 0 12px; font-size: .75rem; }

  .figures, .figures.small { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
  .figure { min-width: 0; padding: 11px 12px; }
  .figure-value { font-size: 1.25rem; overflow-wrap: anywhere; }
  .figure-label, .figure-sub { font-size: .6875rem; }

  .dash-grid { gap: 14px; margin-bottom: 14px; }
  .dash-grid > *, .cols > * { min-width: 0; }
  .dash-panel { padding: 12px 14px; }
  .dash-panel.wide { margin-bottom: 14px; }
  ul.attn a { grid-template-columns: 1fr; gap: 3px; }
  .attn-due { text-align: left; white-space: normal; }

  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
  .filters > .seg, .filters > input[type="search"], .filters > .check { grid-column: 1 / -1; }
  .filters select, .filters input { width: 100%; min-width: 0; }
  .filters label.inline { min-width: 0; }
  .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg::-webkit-scrollbar { display: none; }
  .seg-btn { flex: none; }

  .facts > div { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 10px; padding: 7px 0; }

  /* tables that stay tables on a phone (reports, the driver summary) */
  .grid.keep { display: table; width: 100%; border: 0; background: var(--surface); }
  .grid.keep thead { display: table-header-group; }
  .grid.keep tbody { display: table-row-group; border: 0; background: none; }
  .grid.keep tfoot { display: table-footer-group; }
  .grid.keep tr { display: table-row; margin: 0; border: 0; border-radius: 0; overflow: visible; background: none; }
  .grid.keep th, .grid.keep td { display: table-cell; padding: 8px 10px; text-align: left; }
  .grid.keep td::before { content: none; }
  .grid.keep th.num, .grid.keep td.num { text-align: right; }
  .grid.keep thead th { font-size: .6875rem; }
  table.report.grid.keep { min-width: 900px; }
  .scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
}

/* ---- Availability chart ---- */
.avail-panel .drivers-note { margin: 0 0 10px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; font-size: .75rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(0, 0, 0, .18); }
.sw-un-van { background: #FF0066; }
.sw-un-hgv { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .4) 0 2px, transparent 2px 5px), #B3122E; }
.sw-av-van { background: #6CC24A; }
.sw-av-hgv { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .4) 0 2px, transparent 2px 5px), #1B7A3E; }
.avail-chart { width: 100%; min-height: 200px; }
.avail-chart svg { display: block; max-width: 100%; height: auto; }
.avail-chart .seg-un-van { fill: #FF0066; }
.avail-chart .seg-un-hgv { fill: #B3122E; }
.avail-chart .seg-av-van { fill: #6CC24A; }
.avail-chart .seg-av-hgv { fill: #1B7A3E; }
.avail-chart .seg-num { font-family: var(--font-ui); font-weight: 700; fill: #fff; pointer-events: none; paint-order: stroke; stroke-width: 3px; stroke-linejoin: round; }
.avail-chart .seg-un-van-num { stroke: #FF0066; }
.avail-chart .seg-un-hgv-num { stroke: #B3122E; }
.avail-chart .seg-av-van-num { fill: #10300A; stroke: #6CC24A; }
.avail-chart .seg-av-hgv-num { stroke: #1B7A3E; }
.avail-chart .grid-line { stroke: #E3E3E3; stroke-width: 1; }
.avail-chart .axis-text { font: 400 10px var(--font-ui); fill: #555; }
.avail-chart .bar { cursor: pointer; outline: none; }
.avail-chart .bar .hit { fill: transparent; }
.avail-chart .bar:hover .hit, .avail-chart .bar.selected .hit { fill: rgba(46, 46, 46, .08); }
.avail-chart .bar:focus-visible .hit { stroke: var(--brand); stroke-width: 2; fill: rgba(46, 46, 46, .06); }
.chart-detail { min-height: 2.8em; margin: 8px 0 0; font-size: .8125rem; color: var(--ink-2); }
.chart-summary { margin: 4px 0 0; font-size: .875rem; }
.chart-numbers { margin-top: 12px; }
.chart-numbers summary { cursor: pointer; font-size: .8125rem; font-weight: 700; padding: 4px 0; }
.chart-numbers .scroll { margin-top: 8px; }
@media (max-width: 860px) { .chart-legend { gap: 4px 12px; font-size: .6875rem; } .chart-detail { font-size: .75rem; } }

/* ---- Settings: vehicles needed ---- */
.settings-block { margin-bottom: 36px; }
.needs { display: grid; gap: 12px; margin-top: 12px; }
.needs-row { min-width: 0; margin: 0; padding: 10px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.needs-row legend { font-size: .875rem; }
.needs-row legend .muted { margin-left: 6px; font-size: .75rem; font-weight: 400; }
.needs-days { display: grid; grid-template-columns: repeat(7, minmax(0, 84px)); gap: 8px; }
.needs-day { display: grid; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.needs-day input { padding: 8px 4px; text-align: center; }
.needs-over { margin-top: 10px; color: var(--soon); }
.needs p { margin: 0; }
@media (max-width: 560px) { .needs-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- Planner ---- */
.planner-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 8px; }
.seg-btn[disabled] { opacity: .45; cursor: default; }
.seg-btn[disabled]:hover { background: none; }
.planner-legend { margin: 0 0 10px; }
.planner-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.planner-scroll:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
table.planner { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.planner th, .planner td { height: 32px; min-width: 30px; padding: 0; text-align: center; border-bottom: 1px solid var(--line); border-right: 1px solid #EFEFEF; }
.planner .wk { border-left: 1px solid var(--line-strong); }
.planner .pl-veh { position: sticky; left: 0; z-index: 2; width: 168px; min-width: 168px; padding: 2px 10px; font-weight: 400; text-align: left; white-space: nowrap; background: var(--surface); border-right: 1px solid var(--line-strong); }
.planner .pl-veh .plate { font-size: .8125rem; }
.planner thead th { font-weight: 700; color: var(--ink-2); background: #FAFAFA; }
.planner thead .pl-veh { z-index: 3; font-size: .75rem; background: #FAFAFA; }
.planner .pl-month { height: 24px; padding-left: 6px; font-size: .6875rem; text-align: left; white-space: nowrap; border-right: 1px solid var(--line-strong); }
.planner .pl-day { padding: 3px 0; font-weight: 400; line-height: 1.15; }
.planner .pl-day span { display: block; font-size: .625rem; color: var(--ink-3); }
.planner .pl-day b { font-size: .75rem; }
.planner .pl-day.is-today, .planner .pl-day.is-today span { color: #fff; background: var(--ink); }
.planner td.is-today { box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink); }
.planner .pl-group th, .planner .pl-group td { height: 26px; font-size: .6875rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); background: #F3F3F3; border-right: 0; }
.planner .pl-group .pl-veh { border-right: 0; }
.planner .pl-c { position: relative; }
.planner .pl-c[tabindex] { cursor: pointer; }
.planner .pl-c.s-out, .planner .pl-c.s-risk { border-right-color: transparent; }
.planner .pl-c.k-garage { color: #fff; background: #FF0066; }
.planner .pl-c.k-off_road, .planner .pl-c.k-no_record { color: #fff; background: #B3122E; }
.planner .pl-c.s-out.k-term { color: #fff; background: #4A4A4A; }
.planner .pl-c.s-risk { color: var(--soon); background: repeating-linear-gradient(45deg, #FFDFA0 0 3px, #FFF1D6 3px 7px); }
.planner .pl-c.s-none { background: repeating-linear-gradient(45deg, #E6E6E6 0 2px, #FAFAFA 2px 6px); }
.planner .pl-c.selected { outline: 2px solid var(--ink); outline-offset: -2px; }
.planner .pl-c:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.pl-code { position: absolute; left: 3px; top: 50%; z-index: 1; font-size: .625rem; font-weight: 700; white-space: nowrap; pointer-events: none; transform: translateY(-50%); }
.pl-mark { display: inline-block; width: 7px; height: 7px; background: var(--ink); box-shadow: 0 0 0 1.5px #fff; transform: rotate(45deg); }
.pl-mark.stat { background: var(--overdue); }
.planner .pl-mark { position: absolute; top: 4px; right: 4px; z-index: 1; pointer-events: none; }
.chart-legend .pl-mark { margin: 0 3px; }
.planner .pl-count th, .planner .pl-need th { font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-2); }
.planner .pl-count td { font-weight: 700; font-variant-numeric: tabular-nums; }
.planner .pl-count td.lvl-ok { color: var(--ok); background: var(--ok-bg); }
.planner .pl-count td.lvl-short { color: #fff; background: var(--overdue); }
.planner .pl-count td.lvl-risk { color: var(--soon); background: var(--soon-bg); }
.planner .pl-count td.lvl-none { color: var(--ink-3); }
.planner .pl-need td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.planner .pl-need th, .planner .pl-need td { border-bottom: 2px solid var(--line-strong); }
.planner tbody:last-child .pl-need th, .planner tbody:last-child .pl-need td { border-bottom: 0; }
.sw-pl-garage { background: #FF0066; }
.sw-pl-off { background: #B3122E; }
.sw-pl-term { background: #4A4A4A; }
.sw-pl-risk { background: repeating-linear-gradient(45deg, #FFDFA0 0 3px, #FFF1D6 3px 7px); }
.planner-lists { margin-top: 20px; }
.planner-lists li .plate { font-size: .8125rem; }
@media (max-width: 860px) { .planner .pl-veh { width: 144px; min-width: 144px; padding: 2px 6px; } .planner .pl-veh .plate { font-size: .75rem; } }

/* ---- Vehicle type icon beside the number plate ---- */
.veh { display: inline-flex; align-items: center; gap: .35em; vertical-align: middle; white-space: nowrap; }
.veh-ico { width: 24px; height: 24px; flex: none; fill: #7A7A7A; stroke: none; }
.veh-ico.veh-hgv { fill: #1F4F9C; }   /* lorries are blue, so they are never mistaken for a van */
.veh-ico.veh-forklift { fill: #B45309; }   /* forklifts are amber */
.head-vehicle h1 .veh-ico { width: 40px; height: 40px; }

/* ---- Vehicles list: availability ---- */
.avail { display: inline-block; padding: 1px 10px; font-size: .75rem; font-weight: 700; border-radius: 99px; white-space: nowrap; }
.avail-ok { color: var(--ok); background: var(--ok-bg); }
.avail-out { color: var(--soon); background: var(--soon-bg); }
.avail-bad { color: var(--overdue); background: var(--overdue-bg); }
.avail-quiet { color: var(--quiet); background: var(--quiet-bg); }

/* ---- Settings: users, invitations, date format ---- */
.spaced-top { margin-top: 36px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 12px; }
.inline-form .field { flex: 0 1 300px; }
.role-hints { display: grid; gap: 8px; margin: 16px 0 0; font-size: .8125rem; }
.role-hints dt { font-weight: 700; }
.role-hints dd { margin: 0; color: var(--ink-2); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.nw { white-space: nowrap; }

/* ---- Settings: users and access ---- */
.grid tr.row-off td { background: #FAFAFA; }
.grid tr.row-off td strong { font-weight: 400; color: var(--ink-2); }
.access-summary { margin-top: 18px; }
.access-summary summary { cursor: pointer; font-weight: 700; font-size: .875rem; padding: 4px 0; }
.access-summary .scroll { margin-top: 8px; }
.access-table th:not(:first-child), .access-table td:not(:first-child) { text-align: center; white-space: nowrap; }
.lvl { display: inline-block; min-width: 44px; padding: 1px 8px; font-size: .75rem; font-weight: 700; border-radius: 3px; text-align: center; }
.lvl-full { color: var(--ok); background: var(--ok-bg); }
.lvl-view { color: var(--info); background: var(--info-bg); }
.lvl-none { color: var(--ink-3); background: var(--quiet-bg); font-weight: 400; }

/* ---- Audit log links ---- */
a.tag-link { text-decoration: none; color: var(--ink); }
a.tag-link:hover { text-decoration: underline; }
.history-link { margin-left: 6px; font-size: .75rem; white-space: nowrap; }
.access-table th:first-child, .access-table td:first-child { min-width: 210px; overflow-wrap: normal; }

/* ---- Red / amber / green ---- */
/* Shape as well as colour, so it does not depend on telling red from green: a problem is a solid mark
   (red a disc, amber a diamond) and no problem is a hollow ring (green, or grey for a vehicle not in service). */
.rag { display: inline-block; flex: none; width: 11px; height: 11px; margin-right: 7px; vertical-align: middle; border-radius: 50%; box-sizing: border-box; }
.rag-red { background: #C5221F; }
.rag-amber { width: 10px; height: 10px; background: #E08A00; border-radius: 1px; transform: rotate(45deg); }
.rag-green { border: 2.5px solid #1D6B45; }
.rag-off { border: 2px solid #BDBDBD; }
.with-rag { display: inline-flex; align-items: center; }
.rag-line { margin: 8px 0 2px; font-size: .875rem; }
.rag-line:empty { display: none; }
.rag-word-red { color: #B3261E; } .rag-word-amber { color: #8A5300; } .rag-word-green { color: #1D6B45; } .rag-word-off { color: var(--ink-3); }
.rag-why { color: var(--ink-2); }
.rag-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rag-tile { display: grid; align-content: start; gap: 4px; padding: 14px 16px; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line-strong); border-left-width: 8px; border-radius: var(--radius-lg); }
.rag-tile:hover { background: #FAFAFA; }
.rag-tile:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.rag-tile-red { border-left-color: #C5221F; } .rag-tile-amber { border-left-color: #E08A00; } .rag-tile-green { border-left-color: #1D6B45; } .rag-tile-off { border-left-color: #BDBDBD; }
.rag-tile-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.rag-tile-level { display: flex; align-items: center; font: 700 1.375rem/1.2 var(--font-ui); }
.rag-tile-red .rag-tile-level { color: #B3261E; } .rag-tile-amber .rag-tile-level { color: #8A5300; } .rag-tile-green .rag-tile-level { color: #1D6B45; }
.rag-tile-level .rag { width: 14px; height: 14px; margin-right: 9px; }
.rag-tile-level .rag-amber { width: 12px; height: 12px; }
.rag-tile-why { font-size: .75rem; color: var(--ink-2); }
.attn-what { display: inline-flex; align-items: center; }
.planner .pl-veh .rag { margin-right: 5px; }
@media (max-width: 860px) { .rag-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .rag-tile { padding: 10px 12px; } .rag-tile-level { font-size: 1.125rem; } }

/* ---- Costs: total cost of ownership and fuel prices ---- */
.periods-line { margin: -6px 0 16px; font-size: .875rem; color: var(--ink-2); }
.tco-link { font-size: .875rem; }
table.tco td.strong, table.tco tfoot td { font-weight: 700; }
table.tco td .sub { font-weight: 400; }
.tco-flag { margin-left: 3px; color: var(--soon); font-weight: 700; cursor: help; }
.tco-notes { margin: 6px 0 0; padding-left: 18px; }
.tco-notes li { margin: 2px 0; }
table.tco-lines th { font-weight: 400; color: var(--ink); }
table.tco-lines th .sub { color: var(--ink-3); font-size: .75rem; }
table.tco-lines td.pct { width: 52px; color: var(--ink-3); font-size: .75rem; }
.fuel-table { max-width: 760px; }
.fuel-table th .sub { font-weight: 400; color: var(--ink-3); }
.fuel-assumptions { margin-top: 28px; max-width: 760px; }
.report-actions:last-child { margin-bottom: 0; }
.section-head .report-actions { margin: 0; }
table.tco { min-width: 1060px; font-size: .75rem; }
table.tco th, table.tco td { padding: 9px 9px; }
table.tco td.num, table.tco tfoot td { white-space: nowrap; overflow-wrap: normal; }
table.tco thead th { white-space: normal; vertical-align: bottom; }

/* ---- Version at the bottom of every screen, with the feedback link ---- */
.screen-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 14px; max-width: 1180px; padding: 0 32px 22px; font-size: .6875rem; color: var(--ink-3); }
.screen-foot .link { color: var(--ink-3); }
.screen-foot .link:hover, .screen-foot .link:focus-visible { color: var(--ink); }
.auth-version { margin: 28px 0 0; font-size: .6875rem; color: var(--ink-3); }
@media (max-width: 860px) { .screen-foot { justify-content: center; padding: 0 16px calc(84px + env(safe-area-inset-bottom)); } }

/* ---- Help link in the side menu ---- */
.side-help { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 8px 2px; color: var(--ink-2); text-decoration: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.side-help:hover { color: var(--ink); }
.side-help[aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ---- Help screen ---- */
.help-search input[type=search] { width: min(520px, 100%); }
.help-section { margin-bottom: 34px; }
.help-section[hidden], .help-topic[hidden], .help-basics[hidden] { display: none; }
.help-basics { max-width: 76ch; }
.help-steps { margin: 12px 0; padding-left: 22px; }
.help-steps li { margin-bottom: 6px; }
.help-topic { border-bottom: 1px solid var(--line); }
.help-topic:first-of-type { border-top: 1px solid var(--line); }
.help-topic > summary { padding: 12px 2px; cursor: pointer; }
.help-topic > summary:hover { background: var(--paper); }
.help-title { margin-right: 12px; font-weight: 700; }
.help-what { font-size: .875rem; }
.help-faq > summary { font-weight: 700; }
.help-body { max-width: 76ch; padding: 0 2px 14px 20px; }
.help-body ul { margin: 0 0 12px; padding-left: 20px; }
.help-body li { margin-bottom: 6px; }
.help-ver { margin-left: 8px; font-size: .75rem; }

/* ---- Feedback log ---- */
.fb-table td { vertical-align: top; }
.fb-text { max-width: 62ch; white-space: pre-wrap; overflow-wrap: anywhere; }
/* In the Settings log each item shows only a short summary: two lines for what was asked, one each for the result and
   the reply. Open shows everything. */
.fb-log .fb-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; }
.fb-log .fb-text.sub { -webkit-line-clamp: 1; line-clamp: 1; }
.fb-log tr.fb-open .fb-text { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; white-space: pre-wrap; }
.fb-status { display: inline-block; padding: 1px 8px; font-size: .75rem; font-weight: 700; border-radius: 3px; white-space: nowrap; color: var(--ink-2); background: var(--quiet-bg); }
.fb-new { color: var(--info); background: var(--info-bg); }
.fb-under_review, .fb-planned, .fb-in_progress { color: var(--soon); background: var(--soon-bg); }
.fb-done { color: var(--ok); background: var(--ok-bg); }
.fb-declined { font-weight: 400; }
.fb-pri-urgent { font-weight: 700; color: var(--overdue); }
.fb-pri-high { font-weight: 700; color: var(--soon); }
.fb-pri-low { color: var(--ink-3); }

/* ---- Settings: jump links and screen switches ---- */
.jump { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: -6px 0 24px; font-size: .875rem; }
.screen-switches { display: grid; gap: 10px; max-width: 76ch; }
.screen-switch { align-items: flex-start; }

/* ---- Dashboard: drivers panel count line ---- */
.drivers-count { margin: 0 0 6px; }
.drivers-count .link { margin-left: 8px; font-weight: 400; }
.fb-table td[data-label="Ref"], .fb-table td[data-label="Kind"], .fb-table td[data-label="Priority"], .fb-table td[data-label="Target date"], .fb-table td[data-label="Sent"] { white-space: nowrap; }
@media (min-width: 861px) { .fb-table td[data-label="Raised"] { min-width: 210px; } }
@media (max-width: 860px) { .fb-cell { min-width: 0; text-align: left; } .fb-table td[data-label="What"] { display: block; } .fb-table td[data-label="What"]::before { display: block; margin-bottom: 4px; } }

/* ---- Dashboard: a quieter look, with its sections in the order set in Settings ---- */
.dash { display: grid; gap: 20px; }
.dash > * { min-width: 0; }
.dash .dash-grid, .dash .dash-panel.wide, .dash .figures, .dash .rag-tiles { margin-bottom: 0; }
.dash .dash-grid { gap: 20px; }
.dash .dash-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }   /* a half-width panel with no neighbour takes the full width */
.dash .dash-panel h2 { margin-bottom: 10px; font-size: .875rem; letter-spacing: .04em; color: var(--ink-2); }
.dash .when { margin-left: 6px; font-size: .75rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.dash .rag-tile { gap: 2px; padding: 12px 14px; border: 1px solid var(--line); }
.dash .rag-tile .rag-tile-label { font-weight: 400; }
.dash .rag-tile .rag-tile-level { font-size: 1.0625rem; color: var(--ink); }
.dash .rag-tile .rag-tile-level .rag { width: 12px; height: 12px; margin-right: 8px; }
.dash .rag-tile-why { color: var(--ink-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.dash .figures { border-color: var(--line); }
.dash .figure { padding: 13px 16px; }
.dash .figure-value { font-size: 1.375rem; }
.dash .figure-label { font-weight: 400; }
/* needs attention: who or what and its status on one line, the task and when it is due on the next */
.dash ul.attn a { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; }
.dash .attn-name { color: var(--ink-2); }
.dash .attn-due, .dash .attn-when { text-align: right; white-space: nowrap; }
.dash .attn-when { font-size: .8125rem; }
.dash .dash-more { margin-top: 10px; font-size: .875rem; }
.dash .dash-more summary { cursor: pointer; color: var(--ink-2); }
.dash .dash-more table { margin-top: 6px; }
.dash p.more { margin-top: 6px; font-size: .8125rem; }
.dash .drivers-count { margin: 0 0 8px; font-size: .875rem; }
.dash .drivers-note { margin-top: 8px; font-size: .75rem; }
.dash .chart-numbers > p { margin: 8px 0; font-size: .8125rem; }
.period-note { margin-bottom: 14px; }
@media (max-width: 860px) { .dash, .dash .dash-grid { gap: 14px; } .dash .figure-value { font-size: 1.125rem; } }

/* ---- Settings: dashboard display ---- */
.dash-rows { display: grid; gap: 8px; max-width: 76ch; }
.dash-row { display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start; }
.dash-row.head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.dash-row input.seq { width: 58px; min-height: 36px; padding: 4px 6px; text-align: center; font-variant-numeric: tabular-nums; }
.dash-row .check { padding-top: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 861px) { .period { gap: 12px; } .period .seg-btn { padding: 8px 10px; } }
@media (min-width: 861px) { .dash .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
