/* Plant Hub
   Status colours follow safety sign meanings (BS EN ISO 7010): red circle = prohibition (do not use),
   yellow triangle = warning, green square = safe condition, blue circle = action needed.
   Fleet numbers are set in a condensed bold face, like the numbers painted on plant. */

:root {
  --ink: #172024;
  --ink-2: #4b585e;
  --ink-3: #6f7b80;
  --line: #d3d8da;
  --line-2: #e4e8e9;
  --page: #edefee;
  --paper: #ffffff;
  --field-border: #a9b3b7;
  --blue: #1b4f8a;
  --blue-ink: #133c6a;
  --blue-wash: #e7eef7;
  --green: #1e7a4c;
  --green-wash: #e4f2ea;
  --red: #a8201a;
  --red-wash: #fbe8e6;
  --amber: #e5a000;
  --amber-ink: #5f4300;
  --amber-wash: #fff3d4;
  --plate: #f2b300;
  --radius: 6px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Arial Narrow", "Barlow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--page); }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-ink); }
h1, h2, h3 { font-family: var(--font-cond); line-height: 1.15; margin: 0; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(27, 79, 138, .45); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 1rem; }
.stack > * + * { margin-top: .75rem; }

/* ---------------------------------------------------------------- shell */

.topbar { display: flex; align-items: center; gap: 1rem; min-height: 56px; padding: 0 20px; background: var(--ink); color: #fff; }
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-cond); font-weight: 700; font-size: 1.4rem; color: #fff; text-decoration: none; letter-spacing: .01em; }
.topbar .brand img { display: block; }
.topbar .company { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .18); }
.topbar .company { color: #b9c3c7; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: #d5dcdf; }
.topbar .avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--plate); color: var(--ink); font-weight: 700; font-size: .8rem; letter-spacing: .02em; }
.topbar .who-name { margin-right: .4rem; color: #fff; font-weight: 500; }
.topbar .topbtn { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 11px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; background: transparent; color: #fff; font: inherit; font-size: .88rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.topbar .topbtn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .45); color: #fff; }
.topbar form { margin: 0; }
.topbar .linkish { background: none; border: 0; color: #fff; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; }

.viewas { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .5rem 20px; background: var(--plate); color: var(--ink); font-weight: 600; }
.viewas form { margin: 0 0 0 auto; }

.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidenav { background: var(--paper); border-right: 1px solid var(--line); padding: 18px 10px; }
.sidenav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 2px; border-radius: 4px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-left: 3px solid transparent; }
.sidenav .ico { width: 19px; height: 19px; flex-shrink: 0; color: var(--ink-3); }
.sidenav a:hover .ico, .sidenav a[aria-current="page"] .ico { color: currentColor; }
.sidenav a:hover { background: var(--page); color: var(--ink); }
.sidenav a[aria-current="page"] { background: var(--blue-wash); color: var(--blue-ink); font-weight: 600; border-left-color: var(--blue); border-radius: 0 4px 4px 0; }
.sidenav .count { margin-left: auto; font-size: .8rem; font-weight: 600; background: var(--amber-wash); color: var(--amber-ink); border-radius: 999px; padding: 0 7px; }
.main { padding: 28px 32px 64px; max-width: 1280px; width: 100%; }

@media (max-width: 860px) {
  /* minmax(0, ...) so a wide table or map scrolls inside its own box instead of widening the page */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 14px; gap: .6rem; }
  .topbar .who-name { display: none; }
  .sidenav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidenav a { white-space: nowrap; margin: 0; border-left: 0; border-bottom: 3px solid transparent; border-radius: 4px 4px 0 0; }
  .sidenav a[aria-current="page"] { border-bottom-color: var(--blue); border-radius: 4px 4px 0 0; }
  .sidenav .count { margin-left: 4px; }
  .sidenav .ico { width: 17px; height: 17px; }
  .main { padding: 20px 16px 56px; }
  .topbar .company { display: none; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--ink-2); margin: .3rem 0 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .5rem; font-size: .9rem; }

/* ---------------------------------------------------------------- panels */

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel.flush { padding: 0; }
.panel.flush .panel-head { padding: 18px 20px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-2); }
.empty p { margin-bottom: 1rem; }

/* tally board: the five figures across the top of the overview */
.tally { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.tally a { display: block; padding: 16px 18px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line-2); }
.tally a:first-child { border-left: 0; }
.tally a:hover { background: #f7f8f8; }
.tally .figure { display: flex; align-items: center; gap: .55rem; font-family: var(--font-cond); font-weight: 700; font-size: 2.3rem; line-height: 1; }
.tally .what { color: var(--ink-2); font-size: .92rem; margin-top: .35rem; }
@media (max-width: 860px) {
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally a { border-left: 0; border-top: 1px solid var(--line-2); }
  .tally a:nth-child(-n+2) { border-top: 0; }
  .tally a:nth-child(even) { border-left: 1px solid var(--line-2); }
  .tally a:last-child { grid-column: span 2; border-left: 0; }
}

/* ---------------------------------------------------------------- signs and chips */

.sign { display: inline-block; flex-shrink: 0; width: 11px; height: 11px; }
.sign-stop { background: var(--red); border-radius: 50%; }
.sign-warn { background: var(--amber); width: 13px; height: 12px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.sign-ok { background: var(--green); }
.sign-info { background: var(--blue); border-radius: 50%; }
.sign-off { background: var(--ink-3); border-radius: 2px; }
.figure .sign { width: 14px; height: 14px; }
.figure .sign-warn { width: 16px; height: 14px; }

.chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; line-height: 1.2; padding: 3px 9px 3px 7px; border-radius: 4px; white-space: nowrap; }
.chip-stop { background: var(--red-wash); color: var(--red); }
.chip-warn { background: var(--amber-wash); color: var(--amber-ink); }
.chip-ok { background: var(--green-wash); color: var(--green); }
.chip-info { background: var(--blue-wash); color: var(--blue-ink); }
.chip-off { background: var(--line-2); color: var(--ink-2); }

.fleet { font-family: var(--font-cond); font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; color: var(--ink); line-height: 1.1; }
a.fleet { text-decoration: none; }
a.fleet:hover { text-decoration: underline; color: var(--blue-ink); }
.fleet-xl { font-family: var(--font-cond); font-weight: 700; font-size: 3rem; line-height: .95; letter-spacing: .005em; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--ink-2); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tbody tr:hover { background: #f7f8f8; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .sub { display: block; color: var(--ink-2); font-size: .875rem; }
.table td.check { width: 36px; }
.panel.flush .table th:first-child, .panel.flush .table td:first-child { padding-left: 20px; }
.panel.flush .table th:last-child, .panel.flush .table td:last-child { padding-right: 20px; }
.row-stop td:first-child { box-shadow: inset 4px 0 0 var(--red); }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius); background: var(--blue); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--blue-ink); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--field-border); }
.btn-secondary:hover { background: var(--page); color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #861a15; }
.btn-ok { background: var(--green); }
.btn-ok:hover { background: #17603c; }
.btn-small { min-height: 32px; padding: 4px 11px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkbtn.danger { color: var(--red); }

/* ---------------------------------------------------------------- forms */

.form { max-width: 640px; }
.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; color: var(--ink-2); font-size: .9rem; margin: -2px 0 6px; font-weight: 400; }
.field .opt { color: var(--ink-3); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--field-border); border-radius: 4px; font: inherit; color: var(--ink); background: #fff; min-height: 42px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(27, 79, 138, .3); outline-offset: 0; border-color: var(--blue); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.error-text { color: var(--red); font-weight: 600; font-size: .92rem; margin: 6px 0 0; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.checkbox input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.filters .field { margin: 0; min-width: 150px; flex: 1; }
.filters .field.grow { flex: 2.5; min-width: 220px; }
.filters label { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; display: block; }
.filters input, .filters select { min-height: 38px; padding: 6px 9px; }

/* segmented control for the check-in question settings */
.seg { display: inline-flex; border: 1px solid var(--field-border); border-radius: 4px; overflow: hidden; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 6px 11px; font-size: .9rem; font-weight: 500; border-left: 1px solid var(--line); white-space: nowrap; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--blue); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid rgba(27, 79, 138, .45); outline-offset: -3px; }
.matrix td { vertical-align: middle; }
.matrix .q-name { font-weight: 600; }

/* ---------------------------------------------------------------- messages */

.flash { padding: 12px 16px; margin-bottom: 18px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: var(--radius); font-weight: 500; }
.flash-error { border-left-color: var(--red); }
.notice { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px; background: var(--amber-wash); color: var(--amber-ink); border: 1px solid #f0d18a; }
.notice strong { color: var(--ink); }
.defect { display: grid; gap: .5rem; padding: 16px 18px; border-radius: var(--radius); background: var(--red-wash); border: 1px solid #efc3be; border-left: 6px solid var(--red); margin-bottom: 20px; }
.defect h2 { color: var(--red); display: flex; align-items: center; gap: .5rem; }
.code-box { display: block; padding: 10px 12px; background: var(--page); border: 1px solid var(--line); border-radius: 4px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; word-break: break-all; user-select: all; }

/* ---------------------------------------------------------------- maps, QR, photos */

.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); background: #dfe4e5; overflow: hidden; }
.map.short { height: 240px; }
.map-msg { display: flex; align-items: center; justify-content: center; height: 100%; padding: 1rem; text-align: center; color: var(--ink-2); margin: 0; }
.map-pop { font-family: var(--font); font-size: .9rem; min-width: 180px; }
.map-pop strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.map-pop ul { list-style: none; margin: 0; padding: 0; }
.map-pop li { padding: 2px 0; }
.map-pop .ref { font-family: var(--font-cond); font-weight: 700; font-size: 1.05rem; }
.qr-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-card svg { display: block; border: 1px solid var(--line); border-radius: 4px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photos a { display: block; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--page); }
.photos img { display: block; width: 100%; height: 140px; object-fit: cover; }
.photos .cap { display: block; padding: 6px 8px; font-size: .82rem; color: var(--ink-2); }

.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.results li:last-child { border-bottom: 0; }
.results .r { font-weight: 700; font-size: .9rem; }
.results .r-pass { color: var(--green); }
.results .r-fail { color: var(--red); }
.results .r-na { color: var(--ink-3); }
.results .note { display: block; color: var(--red); font-weight: 500; margin-top: 2px; }

.pager { display: flex; gap: .75rem; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .93rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--ink-2); font-size: .85rem; display: block; }

/* ---------------------------------------------------------------- operative check-in page */

body.scan { background: var(--paper); font-size: 17px; }
.plate { background: var(--plate); color: var(--ink); padding: 14px 18px 18px; }
.plate-inner, .scan-main, .scan-foot { max-width: 560px; margin: 0 auto; }
.plate .owner { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .95rem; min-height: 28px; }
.plate .owner img { max-height: 28px; max-width: 120px; object-fit: contain; }
.plate .fleet-xl { margin-top: 8px; font-size: 3.4rem; }
.plate .desc { font-size: 1.1rem; font-weight: 500; margin-top: 4px; }
.plate .last { font-size: .9rem; margin-top: 8px; color: #3b3200; }
.dnu-banner { background: var(--red); color: #fff; padding: 14px 18px; }
.dnu-banner .inner { max-width: 560px; margin: 0 auto; display: flex; gap: .75rem; align-items: flex-start; }
.dnu-banner .sign-stop { background: #fff; width: 18px; height: 18px; margin-top: 4px; box-shadow: inset 0 0 0 4px var(--red), 0 0 0 2px #fff; }
.dnu-banner strong { display: block; font-size: 1.1rem; }
.scan-main { padding: 4px 16px 130px; }
.scan-errors { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--red-wash); color: var(--red); font-weight: 600; border-left: 5px solid var(--red); }
.q { padding: 18px 0; border-bottom: 1px solid var(--line-2); }
.q:last-of-type { border-bottom: 0; }
.q-label { display: block; font-weight: 600; font-size: 1.08rem; margin-bottom: 10px; }
.q-label .opt { color: var(--ink-3); font-weight: 400; font-size: .95rem; }
.q .hint { color: var(--ink-2); font-size: .92rem; margin: -4px 0 10px; }
.q.has-error .q-label { color: var(--red); }
.q select, .q input[type="text"], .q input[type="number"], .q textarea { min-height: 50px; font-size: 1.05rem; padding: 11px 12px; border-width: 2px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.five { grid-template-columns: repeat(5, 1fr); }
.choice { position: relative; margin: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 6px 8px; border: 2px solid var(--field-border); border-radius: var(--radius); background: #fff; font-weight: 600; line-height: 1.2; cursor: pointer; user-select: none; }
.choice input:checked + span { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue); }
.choice input:focus-visible + span { outline: 3px solid rgba(27, 79, 138, .45); outline-offset: 2px; }
.gps { display: flex; gap: .7rem; align-items: center; padding: 11px 13px; border-radius: var(--radius); background: var(--page); font-size: .95rem; }
.gps .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.gps[data-state="pending"] .dot { background: var(--amber); }
.gps[data-state="ok"] .dot { background: var(--green); }
.gps[data-state="denied"] .dot, .gps[data-state="unavailable"] .dot { background: var(--red); }
.gps .msg { flex: 1; }
.gps button { margin-left: auto; }
.site-hint { margin: 8px 0 0; font-size: .95rem; color: var(--green); font-weight: 600; }
.check-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 22px; }
.check-head .hint { margin: 0; }
.check-item { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.check-item .check-text { font-weight: 500; margin-bottom: 9px; }
.check-item.has-error .check-text { color: var(--red); }
.check-item .choice span { min-height: 46px; }
.check-item .choice input[value="pass"]:checked + span { border-color: var(--green); background: var(--green-wash); color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.check-item .choice input[value="fail"]:checked + span { border-color: var(--red); background: var(--red-wash); color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.check-item .choice input[value="na"]:checked + span { border-color: var(--ink-2); background: var(--line-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); }
.fail-detail { display: none; margin-top: 10px; padding: 12px; border-radius: var(--radius); background: var(--red-wash); }
.check-item.is-fail .fail-detail, .check-item:has(input[value="fail"]:checked) .fail-detail { display: block; }
.fail-detail label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--red); }
.fail-detail textarea { min-height: 80px; }
.fail-detail .field { margin-bottom: 10px; }
input[type="file"] { font: inherit; font-size: .95rem; max-width: 100%; }
.all-pass { margin: 12px 0 0; }
.submit-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.submit-bar .inner { max-width: 560px; margin: 0 auto; }
.btn-submit { width: 100%; min-height: 56px; font-size: 1.15rem; }
.scan-foot { padding: 18px 16px 150px; color: var(--ink-2); font-size: .85rem; border-top: 1px solid var(--line-2); }

.done { max-width: 560px; margin: 0 auto; padding: 28px 18px 60px; }
.done .big { display: flex; align-items: center; gap: .8rem; font-family: var(--font-cond); font-weight: 700; font-size: 2.1rem; line-height: 1.05; margin-bottom: 12px; }
.done .big .sign { width: 26px; height: 26px; }
.done .stop-box { background: var(--red); color: #fff; padding: 16px 18px; border-radius: var(--radius); margin-bottom: 18px; }
.done .stop-box strong { display: block; font-size: 1.2rem; margin-bottom: 4px; }
.done .dl { margin-top: 18px; font-size: 1rem; }
.message-page { max-width: 520px; margin: 0 auto; padding: 48px 20px; }
.message-page h1 { margin-bottom: .75rem; }

/* ---------------------------------------------------------------- error pages */

.error-page { max-width: 560px; margin: 0 auto; padding: 60px 20px; }
.error-page .code { font-family: var(--font-cond); font-weight: 700; font-size: 1.1rem; color: var(--ink-2); }
.error-page h1 { margin: .25rem 0 .75rem; }

@media print {
  .topbar, .sidenav, .viewas, .page-head .actions, .btn, form { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .panel { border: 0; padding: 0; }
}

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

.leaflet-tooltip.map-count { background: transparent; border: 0; box-shadow: none; color: #fff; font-weight: 700; font-size: 12px; padding: 0; }
.leaflet-tooltip.map-count::before { display: none; }
.map-note { background: #fff; padding: 6px 10px; border-radius: 4px; font: 500 .9rem var(--font); color: var(--ink-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.map.tall { height: 520px; }
@media (max-width: 860px) { .map.tall { height: 420px; } }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 10px; font-size: .9rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; }
.lookup-results { margin-top: 8px; display: grid; gap: 4px; font-size: .9rem; color: var(--ink-2); }
.lookup-hit { text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.lookup-hit:hover { border-color: var(--blue); }
.lookup-hit.on { border-color: var(--blue); background: var(--blue-wash); }

/* fieldsets used for grouped choices: make the legend sit like a normal label */
fieldset.q, fieldset.check-item { border: 0; margin: 0; padding-left: 0; padding-right: 0; min-width: 0; }
fieldset > legend.q-label, fieldset > legend.check-text { float: left; width: 100%; padding: 0; }
fieldset > legend + * { clear: both; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; padding: 10px 14px; margin-right: 10px; border: 2px solid var(--field-border); border-radius: var(--radius); background: #fff; color: var(--ink); cursor: pointer; }
.filters label.checkbox { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .95rem; color: var(--ink); }
.filters label.checkbox input { margin-top: 0; }

.size-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.size-tabs a { display: block; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.size-tabs a span { display: block; font-size: .85rem; color: var(--ink-2); }
.size-tabs a[aria-current="page"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-wash); }
@media (max-width: 860px) { .size-tabs { grid-template-columns: 1fr 1fr; } }
.table .group-row td { background: var(--page); border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }

/* due dates and drivers */
.tally.tally-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tally > div { padding: 16px 18px; border-left: 1px solid var(--line-2); }
.tally > div:first-child { border-left: 0; }
@media (max-width: 860px) {
  .tally.tally-4 a:last-child, .tally.tally-4 > div:last-child { grid-column: auto; border-left: 1px solid var(--line-2); }
  .tally > div { border-left: 0; border-top: 1px solid var(--line-2); }
  .tally > div:nth-child(-n+2) { border-top: 0; }
  .tally > div:nth-child(even) { border-left: 1px solid var(--line-2); }
}
/* number plate: black on yellow-white, like the back plate */
.reg { display: inline-block; font-family: var(--font-cond); font-weight: 700; font-size: .95rem; letter-spacing: .04em; line-height: 1.2; padding: 0 6px; border-radius: 3px; background: #fff7d1; color: var(--ink); border: 1px solid #d9c56a; white-space: nowrap; }
.assign-row { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.assign-row select { flex: 1; min-width: 200px; }
.filters > a { padding: 6px 2px; font-weight: 600; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; }
.filters > a[aria-current="page"] { color: var(--blue-ink); border-bottom-color: var(--blue); }

/* settings page: tiles grouped under headings */
.tile-group { font-size: 1.1rem; color: var(--ink-2); margin: 6px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 26px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.tile:hover { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); color: var(--ink); }
.tile-title { font-family: var(--font-cond); font-weight: 700; font-size: 1.25rem; line-height: 1.15; color: var(--blue-ink); }
.tile-text { color: var(--ink-2); font-size: .92rem; }
.tile-count { margin-top: auto; padding-top: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-3); }

/* admin: website enquiries */
.enquiries { display: grid; }
.enquiry { padding: 16px 20px; border-top: 1px solid var(--line-2); }
.enquiry.is-new { box-shadow: inset 4px 0 0 var(--blue); }
.enquiry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.enquiry-head .sub { display: block; color: var(--ink-2); font-size: .875rem; }
.enquiry-actions { display: flex; gap: 8px; align-items: center; }
.enquiry-contact { margin: 6px 0 0; font-size: .93rem; }
.enquiry-msg { margin: 8px 0 0; white-space: pre-wrap; }

/* links in tables and detail lists: quieter until hovered */
.table a:not(.btn):not(.fleet), .dl a:not(.btn) { text-decoration: none; font-weight: 500; color: var(--blue-ink); }
.table a:not(.btn):not(.fleet):hover, .dl a:not(.btn):hover { text-decoration: underline; }
.main { min-width: 0; }

/* check-in code page */
.code-form { padding-top: 8px; }
.code-form input[type="password"] { width: 100%; min-height: 54px; font-size: 1.4rem; letter-spacing: .2em; padding: 10px 14px; border: 2px solid var(--field-border); border-radius: var(--radius); }
.code-form .btn-submit { margin-top: 18px; }
