:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #edeae2;
  --border: #d2c4bb;
  --text: #262420;
  --text-muted: #6b675e;
  --accent: #a26769;
  --accent-strong: #7e5052;
  --accent-contrast: #ffffff;
  --accent-soft: #f4eded;
  --danger: #a8271f;
  --danger-soft: #fbe7e5;
  --warning: #8a5410;
  --warning-soft: #fbeedd;
  --routine: #33546f;
  --routine-soft: #e7eef4;
  --done: #2e7d4f;
  --done-soft: #e5f3ea;
  --shadow: 0 1px 2px rgba(30, 25, 15, 0.06), 0 6px 20px -8px rgba(30, 25, 15, 0.18);
  --radius: 12px;
  --font-display: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a18;
    --surface: #1f2321;
    --surface-2: #262b28;
    --border: #534d4a;
    --text: #edeae2;
    --text-muted: #a7a299;
    --accent: #b38284;
    --accent-strong: #c5a1a2;
    --accent-contrast: #241213;
    --accent-soft: #443b3a;
    --danger: #e5877e;
    --danger-soft: #3a201d;
    --warning: #e3ae6c;
    --warning-soft: #3a2e19;
    --routine: #9dc0da;
    --routine-soft: #202f3d;
    --done: #8fcba6;
    --done-soft: #1c3225;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0 0 .3em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
a { color: var(--accent-strong); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tabular { font-variant-numeric: tabular-nums; }

#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: .7em 1.1em; font-weight: 600; cursor: pointer;
  min-height: 44px; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .45em .8em; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Login ---------- */
.login-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px;
}
.brand-mark {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; justify-content: center;
  background: #ffffff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px;
}
.brand-logo { height: 34px; width: auto; display: block; }
.brand-word {
  font-family: var(--font-display); color: var(--accent); font-weight: 600;
  margin: 0; line-height: 1.15; font-size: 1.15rem;
}
.login-brand-mark { margin-bottom: 1.4em; width: 100%; }
.login-brand-mark .brand-logo { height: 36px; }
.login-brand-mark .brand-word { font-size: 1.25rem; }
.field { margin-bottom: 1.1em; }
.field label { display: block; font-weight: 600; font-size: .85rem; color: var(--text-muted); margin-bottom: .4em; text-transform: uppercase; letter-spacing: .04em; }
select, input[type=text], input[type=date], input[type=number], input[type=time], input[type=email], input[type=tel], input[type=search], input[type=datetime-local], textarea {
  width: 100%; padding: .7em .8em; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
.autocomplete { position: relative; }
.autocomplete-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; padding: 6px;
}
.autocomplete-item {
  display: block; width: 100%; text-align: left; padding: .6em .7em; border-radius: 8px;
  border: none; background: transparent; color: var(--text); font-size: 1rem; cursor: pointer;
}
.autocomplete-item:hover, .autocomplete-item:focus-visible { background: var(--accent-soft); }
.autocomplete-empty { padding: .6em .7em; color: var(--text-muted); font-size: .9rem; }
.pin-display { display: flex; gap: 10px; justify-content: center; margin: 1em 0 1.2em; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dot.filled { background: var(--accent); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button {
  min-height: 60px; font-size: 1.4rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; font-family: var(--font-display); font-weight: 600;
}
.pinpad button:active { background: var(--accent-soft); }
.login-error { color: var(--danger); font-size: .9rem; margin-top: .6em; min-height: 1.2em; }

/* ---------- App shell ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.topbar-brand-mark { margin-right: auto; padding: 6px 12px; }
.topbar-brand-mark .brand-logo { height: 28px; }
.topbar-brand-mark .brand-word { font-size: 1.05rem; }
.topbar .who { font-size: .85rem; color: var(--text-muted); text-align: right; }
.topbar .who strong { color: var(--text); }

.tabs { display: flex; gap: 4px; padding: 8px 12px 0; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  border: none; background: transparent; padding: .8em 1.1em; font-weight: 600; color: var(--text-muted);
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px;
}
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }

main { flex: 1; padding: 18px; max-width: 1100px; width: 100%; margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1.1fr 1.4fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
/* Emergencies section on the site reference sheet — background tint + a
   coloured left edge so it stands out from the other, plainer sections when
   scanning the Management tab in a hurry (see the matching print styling
   further down for the printed sheet). */
.card-emergencies { background: var(--danger-soft); border-color: var(--danger); border-left-width: 4px; }
.card-emergencies h3 { color: var(--danger); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 160px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-flex; align-items: center; gap: .4em; padding: .3em .7em; border-radius: 999px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-routine { background: var(--routine-soft); color: var(--routine); }
.pill-done { background: var(--done-soft); color: var(--done); }
.pill-neutral { background: var(--surface-2); color: var(--text-muted); }
.urgency-stripe { width: 6px; border-radius: 4px; align-self: stretch; flex: 0 0 6px; }
.urgency-stripe.safety_critical, .pill-safety_critical { background: var(--danger); }
.urgency-stripe.high, .pill-high { background: var(--warning); }
.urgency-stripe.routine, .pill-routine-u { background: var(--routine); }
.urgency-stripe.low { background: var(--done); }

/* ---------- Job list ---------- */
.job-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.job-card:hover { border-color: var(--accent); }
.job-card .meta { color: var(--text-muted); font-size: .85rem; margin-top: .2em; }
.job-card .title { font-weight: 600; }
.job-list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--text-muted); text-align: center; padding: 30px 10px; }
.muted { color: var(--text-muted); font-size: .85rem; }
.job-number { display: inline-block; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82em; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; margin-right: 2px; letter-spacing: .02em; }
.panel-head .job-number { font-size: .9rem; margin-right: 4px; }

/* ---------- Board home hint (maintenance default-home filter) ---------- */
.board-home-hint { color: var(--text-muted); font-size: .9rem; margin-bottom: 10px; }
.board-home-hint strong { color: var(--text); }
.link-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; font-size: .9rem; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--accent); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; }

/* Category / type of work picker — heading select above, item select
   below (see categoryPickerHtml in app.js); the item select is disabled
   and shows its blank label until a heading is chosen. */
.category-picker { display: flex; flex-direction: column; gap: 6px; }
.category-picker select:disabled { color: var(--text-muted); background: var(--surface-2); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.kpi .num { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.kpi .label { color: var(--text-muted); font-size: .82rem; }

/* ---------- Table (management) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { background: var(--surface-2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
tr:last-child td { border-bottom: none; }

/* Contractor capability matrix — a heading row per category, then one row
   per specific type of work under it (see capabilityMatrixHtml in app.js). */
.cap-matrix td, .cap-matrix th { padding: 6px 10px; }
.cap-matrix-heading th { background: var(--surface); color: var(--text); font-size: .82rem; text-transform: none; letter-spacing: 0; border-top: 2px solid var(--border); }
.cap-matrix select.cap-pref-input { width: 100%; min-width: 100px; font-size: .85rem; }

/* ---------- Modal / detail panel ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 12, .45); display: flex; justify-content: flex-end; z-index: 50; }
.panel { width: 100%; max-width: 560px; background: var(--bg); height: 100%; overflow-y: auto; box-shadow: var(--shadow); }
.panel-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 18px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.panel-body { padding: 18px; }
.panel-close { margin-left: auto; }

.overlay-center { justify-content: center; align-items: center; padding: 20px; z-index: 60; }
.modal-card { width: 100%; max-width: 360px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.modal-card h3 { margin-bottom: .3em; }
.modal-card .meta { margin-bottom: 1.1em; }
.modal-card-wide { max-width: 460px; }
.modal-actions { display: flex; gap: 10px; margin-top: 1.3em; }
.modal-actions .btn { flex: 1; }
.checkbox-list { display: flex; flex-direction: column; gap: .5em; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.checkbox-list .checkbox-row { gap: .6em; }
.export-error { color: var(--danger); font-size: .88rem; min-height: 1.1em; margin-top: .2em; }

.notes-thread { display: flex; flex-direction: column; gap: 10px; margin: .5em 0 1em; }
.note { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.note .who { font-weight: 700; font-size: .82rem; }
.note .when { color: var(--text-muted); font-size: .75rem; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin: .6em 0; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.photo-thumb { position: relative; }
.photo-thumb .photo-download {
  position: absolute; bottom: 4px; right: 4px; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .6); color: #fff; border-radius: 50%;
  font-size: 13px; line-height: 1; text-decoration: none;
}

.checkbox-row { display: flex; align-items: center; gap: .6em; }
.checkbox-row input { width: 20px; height: 20px; }

.doc-list { list-style: none; padding: 0; margin: .4em 0; display: flex; flex-direction: column; gap: .4em; }
.doc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; }

.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-140%); background: var(--text); color: var(--bg); padding: .7em 1.2em; border-radius: 10px; font-weight: 600; z-index: 100; transition: transform .25s ease; box-shadow: var(--shadow); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

/* ---------- Print — the "site reference sheet" wall printout ---------- */
/* #printArea (see index.html) is built fresh from current data right before
   window.print() is called (see printReferenceSheet in app.js) and is
   otherwise empty and hidden — everything else on screen (#app, the toast)
   is hidden only while actually printing, so the normal app is untouched. */
.print-only { display: none; }
/* Sets the printed page's own margin so the sheet doesn't depend on
   whatever margin Chrome's print dialog happens to be set to — narrower
   than Chrome's default, which was leaving too little usable width and
   pushing the section tables' right-hand border past the printable area. */
@page {
  size: A4;
  margin: 10mm 8mm;
}
@media print {
  #app, #toast { display: none !important; }
  .print-only {
    display: block !important;
    color: #000; background: #fff; font-family: "Work Sans", Arial, sans-serif;
    padding: 0 3mm;
  }
  .print-only .print-head { display: flex; align-items: center; gap: 4mm; margin-bottom: 4mm; }
  .print-only .print-logo { height: 16mm; width: auto; max-width: 40mm; object-fit: contain; }
  .print-only h1 { font-size: 20pt; margin: 0 0 1mm; }
  .print-only .print-meta { color: #444; font-size: 9pt; margin: 0; }
  .print-only .print-meta-date { font-size: 8pt; color: #777; margin-top: .5mm; }
  .print-only h2 { font-size: 13pt; margin: 6mm 0 2mm; border-bottom: 1px solid #000; padding-bottom: 1mm; break-after: avoid; }
  /* box-sizing: border-box is the important part here — without it, a
     width:100% table plus its own border ends up slightly WIDER than its
     container (border added on top of the 100%), which is exactly what
     was pushing the coloured frame off the right edge of the page.
     table-layout:fixed + the explicit column widths below, plus
     overflow-wrap on the cells, stop a single long, unbroken URL or email
     address from forcing a column (and the whole table) wider than the
     page — the other way a "frame" can end up running off the page. */
  .print-only table { width: 100%; box-sizing: border-box; table-layout: fixed; border-collapse: collapse; margin-bottom: 3mm; break-inside: auto; }
  .print-only tr { break-inside: avoid; }
  .print-only th, .print-only td { text-align: left; padding: 1.2mm 2mm; border-bottom: 1px solid #ccc; font-size: 10pt; vertical-align: top; overflow-wrap: anywhere; }
  .print-only th { border-bottom: 1px solid #000; font-size: 9pt; text-transform: uppercase; letter-spacing: .03em; }
  .print-only th:nth-child(1), .print-only td:nth-child(1) { width: 24%; }
  .print-only th:nth-child(2), .print-only td:nth-child(2) { width: 56%; }
  .print-only th:nth-child(3), .print-only td:nth-child(3) { width: 20%; }

  /* Every section gets its own colour-coded heading and a tinted table —
     a coloured outline around the table itself, plus a tint on every row —
     so the sheet reads as clearly divided blocks rather than one long
     plain table. Emergencies keeps red (the one Steve most wants to jump
     out); the other four each get their own colour purely to separate
     them visually.
     This is deliberately colour applied to the table/cells, NOT a border
     wrapped around a <div> containing the table: a div's border/background
     doesn't reliably redraw itself when the browser splits it across a
     page break (that's what caused the "text interferes with the box"
     bug), whereas a <table>'s own border and each row's own background are
     handled properly by the browser's print engine no matter how many
     pages a long section spans. */
  .print-only .ref-section { margin-top: 6mm; }
  .print-only .ref-section h2 { margin-top: 3mm; border-bottom: none; padding: 0 0 1mm; font-weight: 700; }
  .print-only .ref-section table { border: 1.5px solid; }

  .print-only .ref-section-contractors h2 { color: #2c5f8a; }
  .print-only .ref-section-contractors table { border-color: #2c5f8a; }
  .print-only .ref-section-contractors th { background: #d7e4f0; border-bottom-color: #2c5f8a; }
  .print-only .ref-section-contractors td { background: #eaf1f8; border-bottom-color: #bcd0e3; }

  .print-only .ref-section-other_suppliers h2 { color: #6a3d9a; }
  .print-only .ref-section-other_suppliers table { border-color: #6a3d9a; }
  .print-only .ref-section-other_suppliers th { background: #e3d5ef; border-bottom-color: #6a3d9a; }
  .print-only .ref-section-other_suppliers td { background: #f1eaf7; border-bottom-color: #d2bde5; }

  .print-only .ref-section-utilities h2 { color: #9a6b0c; }
  .print-only .ref-section-utilities table { border-color: #9a6b0c; }
  .print-only .ref-section-utilities th { background: #f3e1b8; border-bottom-color: #9a6b0c; }
  .print-only .ref-section-utilities td { background: #faf1de; border-bottom-color: #ead29a; }

  .print-only .ref-section-emergencies h2 { color: #c0392b; }
  .print-only .ref-section-emergencies table { border-color: #c0392b; }
  .print-only .ref-section-emergencies th { background: #f6d5d0; border-bottom-color: #c0392b; }
  .print-only .ref-section-emergencies td { background: #fdecea; border-bottom-color: #e6b8b2; }

  .print-only .ref-section-local_contacts h2 { color: #2e7d4f; }
  .print-only .ref-section-local_contacts table { border-color: #2e7d4f; }
  .print-only .ref-section-local_contacts th { background: #d2ecdc; border-bottom-color: #2e7d4f; }
  .print-only .ref-section-local_contacts td { background: #e9f5ee; border-bottom-color: #b9e0c8; }
}

/* ---------- Device registration (14 Oct 2026) ---------- */
.device-banner { background: var(--warning-soft); color: var(--text); border-bottom: 1px solid var(--warning); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .92rem; line-height: 1.4; }
.device-banner > div:first-child { flex: 1 1 320px; }
.device-banner-actions { display: flex; gap: 8px; flex: 1 1 300px; flex-wrap: wrap; }
.device-banner-actions input { flex: 1 1 180px; min-width: 0; }
.device-status { background: var(--warning-soft); border: 1px solid var(--warning); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; line-height: 1.45; }
.device-status-on { background: var(--done-soft); border-color: var(--done); }
.devices-h { margin: 18px 0 8px; }
.devices-revoked { margin-top: 18px; }
.devices-revoked summary { cursor: pointer; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.enrol-done { text-align: center; font-size: 1.3rem; font-weight: 700; color: var(--done); margin: 6px 0 8px; }
.qr-box { background: #fff; border-radius: 10px; padding: 8px; margin: 10px auto 12px; max-width: 300px; }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-steps { text-align: left; margin: 0 0 10px; padding-left: 1.3em; line-height: 1.5; font-size: .92rem; }
@media print {
  .print-only .qr-print { text-align: center; padding-top: 10mm; }
  .print-only .qr-print h1 { font-size: 24pt; }
  .print-only .qr-print-code { width: 110mm; margin: 8mm auto; }
  .print-only .qr-print-code svg { width: 100%; height: auto; }
  .print-only .qr-print ol { text-align: left; display: inline-block; font-size: 13pt; line-height: 1.6; }
}

/* ---------- Sign-in layout for PCs / landscape screens (20 Oct 2026) ----------
   Phones in portrait keep the single column. On a wide landscape screen the
   card becomes two columns: logo and intro on the left, name and PIN pad on
   the right, sized to fit a laptop screen without scrolling. */
.login-side .login-intro { text-align: center; margin: -4px 0 1em; color: var(--text-muted); font-size: .92rem; }
.login-side .login-tip { display: none; }
.login-refresh { margin-top: .5em; font-size: .85rem; color: var(--text-muted); display: flex; gap: .4em; align-items: center; flex-wrap: wrap; }
.login-refresh-warn { color: var(--danger); }
.login-refresh .link-btn { background: none; border: none; padding: 2px 4px; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.toast:not(.show) { visibility: hidden; }
@media (orientation: landscape) and (min-width: 860px) and (pointer: fine) { .login-side .login-tip { display: block; } }
@media (orientation: landscape) and (min-width: 860px) {
  .login-card.login-split {
    max-width: 860px; padding: 0; display: grid; grid-template-columns: 340px 1fr; overflow: hidden;
  }
  .login-split .login-side {
    background: var(--accent-soft); border-right: 1px solid var(--border);
    padding: 40px 32px; display: flex; flex-direction: column; justify-content: center;
  }
  .login-split .login-side .login-brand-mark { flex-direction: column; padding: 18px 14px; gap: 10px; }
  .login-split .login-side .login-brand-mark .brand-logo { height: 64px; }
  .login-split .login-side .login-brand-mark .brand-word { font-size: 1.5rem; }
  .login-split .login-side .login-intro { text-align: left; margin: 0 0 .8em; font-size: .95rem; color: var(--text); }
  .login-split .login-side .login-tip { text-align: left; margin: 0; font-size: .85rem; color: var(--text-muted); }
  .login-split .login-main { padding: 32px 36px; min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
  .login-split .pinpad { max-width: 330px; margin: 0 auto; }
  .login-split .pinpad button { min-height: 52px; font-size: 1.25rem; }
  .login-split .pin-display { margin: .6em 0 .9em; }
  .login-split .login-main > .btn-block, .login-split .login-main #loginPinBlock > .btn-block { max-width: 330px; margin-left: auto; margin-right: auto; display: block; }
}
@media (orientation: landscape) and (min-width: 860px) and (max-height: 760px) {
  .login-wrap { padding: 12px; }
  .login-split .login-main { padding: 22px 32px; min-height: 0; }
  .login-split .pinpad { gap: 8px; }
  .login-split .pinpad button { min-height: 44px; font-size: 1.15rem; }
  .login-split .field { margin-bottom: .7em; }
}

/* Two-step sign-in (20 Oct 2026) */
.mfa-code-input { font-size: 1.5rem; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-steps { margin: 4px 0 8px; padding-left: 1.3em; font-size: .92rem; }
.mfa-steps li { margin-bottom: 4px; }
.mfa-qr { display: flex; justify-content: center; margin: 6px 0; }
.mfa-qr svg { width: 180px; height: 180px; background: #fff; border-radius: 8px; }
.mfa-secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; font-size: .95rem; color: var(--text); word-break: break-all; }
.mfa-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px; background: var(--surface-2); border-radius: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; text-align: center; }
.mfa-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* An install button only shows when Chrome offers to install (21 Oct 2026). */
[hidden] { display: none !important; }

/* Back to the Crestview Hub (18 Nov 2026, Steve: make it stand out) */
.hub-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px 9px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast, #fff); font-weight: 700; font-size: .95rem; line-height: 1; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); border: 2px solid transparent; order: -1; }
.hub-btn:hover, .hub-btn:focus-visible { background: var(--accent-strong); color: var(--accent-contrast, #fff); outline: none; border-color: rgba(255, 255, 255, .5); transform: translateY(-1px); }
.hub-btn svg { width: 18px; height: 18px; flex: none; }
.hub-btn svg:first-child { width: 16px; height: 16px; margin-right: -2px; }
.hub-btn-short { display: none; }
@media (max-width: 600px) { .hub-btn { padding: 7px 12px 7px 8px; font-size: .9rem; } .hub-btn-text { display: none; } .hub-btn-short { display: inline; } }

/* "?" guidance notes (18 Nov 2026) */
.help-tip { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 8px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--accent, #a26769); font-size: .75rem; font-weight: 700; line-height: 1; cursor: help; vertical-align: middle; opacity: .8; text-transform: none; letter-spacing: 0; font-family: inherit; }
.help-tip:hover, .help-tip:focus-visible { opacity: 1; background: var(--accent, #a26769); color: #fff; outline: none; }
.help-pop { position: fixed; z-index: 9999; background: #2b2523; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .88rem; line-height: 1.45; font-weight: 400; text-transform: none; letter-spacing: 0; text-align: left; }
.help-pop p { margin: 0 0 8px; white-space: pre-line; }
.help-pop p:last-child { margin-bottom: 0; }

/* More noticeable "?" (18 Nov 2026, Steve) */
.help-tip { width: 24px; height: 24px; margin-left: 10px; border: 0; background: var(--accent, #a26769); color: #fff; font-size: .85rem; opacity: 1; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.help-tip:hover, .help-tip:focus-visible { background: var(--accent-strong, #7e5052); color: #fff; transform: scale(1.08); }

/* Phones: fade the right edge of the tab bar so it's clear there are more tabs to swipe to (18 Nov 2026). */
@media (max-width: 760px) {
  .tabs { padding-right: 36px; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .tabs::-webkit-scrollbar { display: none; }
}

/* Phones: just the name in the top bar (18 Nov 2026). */
@media (max-width: 560px) { .topbar .who-role { display: none; } .topbar .who br { display: none; } }

/* Job board, Management and Compliance calendar sit in a card like the other apps' pages (18 Nov 2026). */
.view-card { margin-top: 14px; }
.view-card > .section-title:first-child { margin-top: 0; }
.view-card .stat-card, .view-card .card { box-shadow: none; }

/* Compliance calendar: company cars (from the Company cars app, 18 Nov 2026) */
.cars-fleet { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 4px 0 16px; background: var(--surface); }
.cars-fleet .section-title h3 { margin: 0; }
.cars-fleet-row { padding: 10px 0; border-top: 1px solid var(--border); }
.cars-fleet-row:first-of-type { border-top: none; }
.notice { background: var(--warning-soft, #fdf3e2); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: .92rem; }
/* Pills keep their own width in a row, like the other apps (18 Nov 2026). */
.row > .pill { flex: 0 0 auto; }
