/*
 * Brand: navy #000f50 and mint #31f882, both taken from the RLS logo.
 * Mint only ever means "progress / done" — never use it as decoration.
 * Barlow Condensed = signage voice (headings, job numbers, asset plates).
 * Atkinson Hyperlegible = everything people read, chosen for phones used outdoors.
 */
:root {
    --navy: #000f50;
    --navy-2: #24337a;
    --navy-pale: #e4e7f4;
    --mint: #31f882;
    --mint-pale: #dcfbe8;
    --mint-ink: #08703a;
    --paper: #eef0f4;
    --sheet: #fff;
    --ink: #0d1436;
    --muted: #5a6282;
    --rule: #d8dbe6;
    --amber: #f0a20e;
    --amber-pale: #fff2d4;
    --amber-ink: #7d5200;
    --red: #dc3239;
    --red-pale: #fde6e6;
    --red-ink: #a01419;
    --display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --body: "Atkinson Hyperlegible", system-ui, sans-serif;
    --gutter: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--body); }
img { max-width: 100%; display: block; }
a { color: var(--navy-2); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }

/* ---------- Top bar ---------- */
.bar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 0 28px; padding: 0 var(--gutter); flex-wrap: wrap; }
.bar .logo img { height: 46px; width: auto; }
.bar nav { display: flex; gap: 24px; margin-right: auto; }
.bar nav a { color: #b9bfdc; text-decoration: none; font-weight: 700; padding: 22px 0 19px; border-bottom: 3px solid transparent; }
.bar nav a:hover { color: #fff; }
.bar nav a[aria-current] { color: #fff; border-bottom-color: var(--mint); }
.bar :focus-visible { outline-color: var(--mint); }

.me { position: relative; }
.me summary { list-style: none; cursor: pointer; font-weight: 700; padding: 10px 0; }
.me summary::-webkit-details-marker { display: none; }
.me summary::after { content: ""; display: inline-block; margin-left: 8px; border: 5px solid transparent; border-top-color: currentColor; vertical-align: -2px; }
.me-menu { position: absolute; right: 0; top: 100%; background: var(--sheet); color: var(--ink); border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 15, 80, .2); padding: 6px; min-width: 190px; z-index: 10; }
.me-menu a, .me-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; border-radius: 4px; }
.me-menu a:hover, .me-menu button:hover { background: var(--paper); }
.me-menu form { margin: 0; }

@media (max-width: 640px) {
    .bar { padding-top: 8px; gap: 0 16px; }
    .bar .logo img { height: 38px; }
    .bar nav { order: 3; width: 100%; margin: 0; }
    .bar nav a { padding: 12px 0 9px; }
    .bar .btn { margin-left: auto; padding: 0 14px; }
    .bar .bell { margin-left: -6px; }
    .me summary { max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .me summary::after { display: none; }
}

main.page { max-width: 1180px; margin: 0 auto; padding: 28px var(--gutter) 72px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 4px; border: 2px solid transparent; font: 700 1rem var(--body); text-decoration: none; cursor: pointer; background: var(--navy); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn.go { background: var(--mint); color: var(--navy); }
.btn.go:hover { background: #74fcab; }
.btn.quiet { background: transparent; color: var(--navy); border-color: var(--rule); }
.btn.quiet:hover { border-color: var(--navy); }
.btn.danger { background: transparent; color: var(--red-ink); border-color: #f0b4b6; }
.btn.danger:hover { border-color: var(--red-ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.wide { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------- Forms ---------- */
label, .label { display: block; font-weight: 700; margin: 18px 0 6px; }
.hint { color: var(--muted); font-size: .9rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--rule);
    border-radius: 4px; padding: 9px 12px; min-height: 44px;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); outline: none; box-shadow: 0 0 0 3px rgba(36, 51, 122, .2); }
input[type=file] { font: inherit; max-width: 100%; }
input[type=file]::file-selector-button { font: 700 .95rem var(--body); background: var(--paper); color: var(--navy); border: 1.5px solid var(--rule); border-radius: 4px; padding: 10px 14px; margin-right: 12px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.check strong { display: block; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.inline { display: flex; gap: 8px; margin-top: 10px; }
.inline select, .inline input { flex: 1; min-width: 0; }

.flash { padding: 12px 16px; border-radius: 4px; margin: 0 0 24px; font-weight: 700; }
.flash-ok { background: var(--mint-pale); color: var(--mint-ink); }
.flash-error { background: var(--red-pale); color: var(--red-ink); }

/* ---------- Page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(2.1rem, 4vw, 2.75rem); color: var(--navy); }
.narrow { max-width: 680px; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 24px 24px; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.empty { border: 2px dashed var(--rule); border-radius: 6px; padding: 56px 24px; text-align: center; color: var(--muted); }
.empty p { font-size: 1.1rem; margin-bottom: 18px; }
dialog { border: 0; border-radius: 8px; padding: 24px; width: min(92vw, 520px); color: var(--ink); }
dialog::backdrop { background: rgba(0, 15, 80, .55); }
dialog h2 { font-size: 1.8rem; color: var(--navy); }

/* ---------- Site switcher: the headline of the jobs page ---------- */
.list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; flex-wrap: wrap; }
.list-head .sites { flex: 1 1 auto; min-width: 0; }
.scope { display: inline-flex; border: 2px solid var(--navy); border-radius: 6px; overflow: hidden; flex: none; margin: 4px 0 16px; }
.scope a { padding: 7px 14px; font-weight: 700; text-decoration: none; color: var(--navy); font-size: .95rem; }
.scope a + a { border-left: 2px solid var(--navy); }
.scope a[aria-current] { background: var(--navy); color: #fff; }
.scope a:not([aria-current]):hover { background: var(--navy-pale); }
.list-foot { margin-top: 12px; font-size: .9rem; }
.list-foot a { color: var(--muted); }
.bell { position: relative; color: #fff; display: inline-flex; padding: 8px; border-radius: 6px; }
.bell:hover { background: rgba(255, 255, 255, .1); }
.bell-count { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font: 700 .7rem/16px var(--body); text-align: center; border: 2px solid var(--navy); box-sizing: content-box; transform: translate(40%, -20%); }
.bell-count[hidden] { display: none; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 2px; }
.blocked-tag { font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 3px; background: var(--red); color: #fff; white-space: nowrap; }
.blocked-banner { background: var(--red-pale); border-left: 6px solid var(--red); border-radius: 0 8px 8px 0; padding: 18px 22px; margin: -8px 0 32px; }
.blocked-banner h2 { color: var(--red-ink); font-size: 1.5rem; margin-bottom: 6px; }
.blocked-banner textarea { background: #fff; }
.blocker-check { margin-top: 14px; padding: 12px 14px; border: 1.5px solid #f0b4b6; border-radius: 6px; background: #fff; }
.blocker-check strong { color: var(--red-ink); }
.mention { color: var(--navy-2); }
.timeline .ev-blocked::before { background: var(--red); border-color: var(--red); }
.timeline .ev-unblocked::before { background: var(--mint); border-color: var(--mint-ink); }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list a { display: block; padding: 14px 18px; text-decoration: none; color: var(--ink); border-left: 4px solid transparent; }
.notice-list li + li a { border-top: 1px solid var(--rule); }
.notice-list a:hover { background: #f6f7fb; }
.notice-list .is-unread a { border-left-color: var(--red); background: #fff8f8; }
.notice-list .is-unread strong { color: var(--navy); }
.notice-list time { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.bar-who { margin-left: auto; font-weight: 700; padding: 20px 0; }
.every-label { align-self: center; font-weight: 700; }
.sites { display: flex; gap: 8px 36px; flex-wrap: wrap; margin-bottom: 22px; }
.sites a { font: 600 1.9rem/1.15 var(--display); color: #8a91ad; text-decoration: none; padding-bottom: 2px; border-bottom: 4px solid transparent; }
.sites a span { font: 400 1rem var(--body); margin-left: 4px; vertical-align: 3px; }
.sites a:hover { color: var(--navy); }
.sites a[aria-current] { color: var(--navy); border-bottom-color: var(--mint); }

.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.views { display: flex; gap: 4px; flex-wrap: wrap; }
.views a { padding: 6px 12px; border-radius: 4px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem; white-space: nowrap; }
.views a span { color: var(--muted); font-weight: 400; margin-left: 3px; }
.views a:hover { background: #e1e4ee; }
.views a[aria-current] { background: var(--navy); color: #fff; }
.views a[aria-current] span { color: #b9bfdc; }
.views a.alarm span { color: var(--red-ink); font-weight: 700; }
.views a.alarm[aria-current] span { color: #ffb0b3; }
.search { flex: 1 1 220px; max-width: 300px; }

@media (max-width: 640px) {
    .sites, .views { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
    .sites { gap: 24px; }
    .sites a { font-size: 1.45rem; white-space: nowrap; }
    .search { flex-basis: 100%; }
    .switches { justify-content: stretch; width: 100%; }
    .switches .scope { flex: 1 1 100%; margin-bottom: 0; }
    .switches .scope a { flex: 1; text-align: center; }
    .list-head .switches { margin-bottom: 16px; }
}

/* ---------- Job rows ---------- */
.job { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 20px 14px 14px; border-left: 6px solid var(--rule); text-decoration: none; color: inherit; }
.job + .job { border-top: 1px solid var(--rule); }
.job:hover { background: #f6f7fb; }
.job:hover .job-title { text-decoration: underline; }
.prio-critical { border-left-color: var(--red); }
.prio-high { border-left-color: var(--amber); }
.prio-medium { border-left-color: var(--navy-2); }
.prio-low { border-left-color: #b9bfd3; }
.job-no { font: 600 1.2rem var(--display); color: var(--muted); }
.job-title { display: block; font-weight: 700; font-size: 1.05rem; }
.job-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: .9rem; margin-top: 3px; align-items: center; }
.prio-critical .prio { color: var(--red-ink); font-weight: 700; }
.prio-high .prio { color: var(--amber-ink); font-weight: 700; }
.job-side { display: grid; justify-items: end; gap: 3px; text-align: right; font-size: .9rem; }
.who, .due { color: var(--muted); }
.due.soon { color: var(--amber-ink); font-weight: 700; }
.due.overdue { color: var(--red-ink); font-weight: 700; }

@media (max-width: 640px) {
    .job { grid-template-columns: auto minmax(0, 1fr); padding: 12px 14px 12px 12px; }
    .job-no { font-size: 1.05rem; }
    .job-main { grid-column: 1 / -1; grid-row: 2; }
    .job-side { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
    .job-side .who { display: none; }
}

/* Asset ID plate — like the stamped plates on the machines themselves. */
.plate { font: 600 .95rem/1.35 var(--display); letter-spacing: .05em; color: var(--navy); background: #fff; border: 1.5px solid var(--navy); border-radius: 3px; padding: 0 6px; text-decoration: none; white-space: nowrap; }
a.plate:hover { background: var(--navy); color: #fff; }

.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 8px; border-radius: 3px; white-space: nowrap; border: 1.5px solid transparent; }
/* Team tags: a coloured edge plus the word, so they read differently from the status chips. */
.team { display: inline-block; font-size: .8rem; font-weight: 700; padding: 0 7px 0 6px; border-radius: 3px; border: 1px solid var(--rule); border-left: 4px solid; background: #fff; white-space: nowrap; line-height: 1.5; }
.team-maintenance { border-left-color: var(--navy-2); color: var(--navy); }
.team-facilities { border-left-color: #0f8a84; color: #0b5f5b; }
.team-none { border-left-color: #b9bfd3; color: var(--muted); font-weight: 400; }
.switches { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.st-new { border-color: var(--navy); color: var(--navy); background: #fff; }
.st-assigned { background: var(--navy-pale); color: var(--navy); }
.st-in_progress { background: var(--navy); color: #fff; }
.st-awaiting_signoff { background: var(--amber-pale); color: var(--amber-ink); }
.st-complete { background: var(--mint); color: var(--navy); }
.st-cancelled { background: #e1e4ee; color: var(--muted); }
.st-missed { background: var(--red-pale); color: var(--red-ink); }

/* ---------- Job page ---------- */
.crumb { display: inline-block; margin-bottom: 18px; color: var(--muted); font-weight: 700; text-decoration: none; }
.crumb:hover { color: var(--navy); text-decoration: underline; }
.job-head { margin-bottom: 26px; }
.job-head .job-id { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font: 600 1.3rem var(--display); color: var(--muted); }
.job-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); color: var(--navy); margin: 4px 0 12px; max-width: 30ch; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; color: var(--muted); }
.prio-flag { font: 700 .8rem var(--body); padding: 1px 8px; border-radius: 3px; }
.prio-flag.prio-critical { background: var(--red); color: #fff; }
.prio-flag.prio-high { background: var(--amber); color: var(--navy); }

.rail { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0 0 36px; padding: 0; }
.rail li { border-top: 6px solid var(--rule); padding-top: 8px; font: 600 1.15rem var(--display); color: #8a91ad; }
.rail li.done { border-top-color: var(--mint); color: var(--navy); }
.rail li[aria-current] { border-top-color: var(--navy); color: var(--navy); }
.banner { padding: 14px 18px; border-radius: 6px; margin-bottom: 36px; font-weight: 700; }
.banner-cancelled { background: #e1e4ee; color: var(--muted); }
.banner-missed { background: var(--red-pale); color: var(--red-ink); }

.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.stack > * + * { margin-top: 40px; }
.section-title { margin-bottom: 12px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }

/* The one bold block on the page: what happens next. */
.next { background: var(--navy); color: #fff; border-radius: 8px; padding: 22px 24px 24px; }
.next h2 { font-size: 1.8rem; }
.next > p { color: #c9cde6; margin-top: 4px; }
.next label { color: #fff; }
.next .opt, .next .hint { color: #a9b0d4; }
.next :focus-visible { outline-color: var(--mint); }
.next input[type=file] { color: #fff; }
.next input[type=file]::file-selector-button { background: #fff; border-color: #fff; }
.next .btn.quiet { color: #fff; border-color: rgba(255, 255, 255, .35); }
.next .btn.quiet:hover { border-color: #fff; }
.next details { margin-top: 18px; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 14px; }
.next summary { cursor: pointer; font-weight: 700; }
.waiting { border: 2px dashed var(--rule); border-radius: 8px; padding: 18px 22px; color: var(--muted); }
.waiting h2 { color: var(--ink); font-size: 1.45rem; margin-bottom: 2px; }

.diptych { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diptych figure { margin: 0; position: relative; min-width: 0; }
.diptych figcaption { position: absolute; top: 10px; left: 10px; z-index: 1; font: 700 1.05rem var(--display); padding: 1px 10px; border-radius: 3px; background: var(--navy); color: #fff; }
.diptych .after figcaption { background: var(--mint); color: var(--navy); }
.diptych .lead img, .no-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #dfe2ea; }
.no-photo { display: grid; place-items: center; border: 2px dashed var(--rule); background: transparent; color: var(--muted); padding: 0 16px; text-align: center; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 4px; background: #dfe2ea; }
.done-notes { margin-top: 18px; padding: 14px 18px; background: var(--sheet); border-left: 4px solid var(--mint); border-radius: 0 6px 6px 0; }
.done-notes h3 { margin-bottom: 4px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 24px; border-left: 2px solid var(--rule); }
.timeline > li { position: relative; padding-bottom: 22px; }
.timeline > li::before { content: ""; position: absolute; left: -31px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid #9aa1bd; }
.timeline .ev-note::before { background: var(--navy-2); border-color: var(--navy-2); }
.timeline .ev-started::before, .timeline .ev-returned::before { background: var(--navy); border-color: var(--navy); }
.timeline .ev-completed::before, .timeline .ev-signed_off::before { background: var(--mint); border-color: var(--mint-ink); }
.timeline .ev-cancelled::before { background: var(--red); border-color: var(--red); }
.timeline time { display: block; color: var(--muted); font-size: .85rem; }
.said { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; margin-top: 6px; }
.note-form { margin-top: 8px; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.file-list li { padding: 4px 0; }
.file-list li::before { content: ""; display: inline-block; width: 10px; height: 12px; margin-right: 8px; border: 1.5px solid var(--muted); border-radius: 2px; vertical-align: -1px; }
.eml-drop { border: 2px dashed var(--rule); border-radius: 6px; padding: 14px 18px; margin-bottom: 18px; color: var(--muted); }
.eml-drop .is-done { color: var(--mint-ink); font-weight: 700; }
.eml-drop .is-error { color: var(--red-ink); font-weight: 700; }
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0, 15, 80, .82); pointer-events: none; }
.drop-overlay[hidden] { display: none; }
.drop-overlay p { font: 700 clamp(2rem, 5vw, 3.5rem) var(--display); color: #fff; border: 4px dashed var(--mint); border-radius: 12px; padding: 32px 48px; }
.confirm-name { margin-top: 14px; padding: 12px 16px; background: var(--amber-pale); border-radius: 6px; color: var(--amber-ink); }
.confirm-name .check { margin: 8px 0 0; color: var(--ink); font-weight: 700; }
.share { border: 0; padding: 0; margin: 14px 0 0; }
.share legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.share .check { margin: 6px 0; }
.shared { margin-top: 6px; font-size: .85rem; font-weight: 700; color: var(--navy-2); }
.note-form label { margin-top: 0; }

.side { display: grid; gap: 32px; }
.side h2 { font-size: 1.3rem; margin-bottom: 10px; }
.side h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.side dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.side dt { color: var(--muted); }
.side dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.people form { margin: 0; }
.side details summary { cursor: pointer; font-weight: 700; color: var(--red-ink); margin-top: 14px; }

@media (max-width: 900px) {
    .job-layout { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
    .rail li { font-size: .95rem; }
    .next { padding: 18px 16px 20px; margin: 0 calc(-1 * var(--gutter)); border-radius: 0; }
}
@media (max-width: 480px) {
    .diptych { grid-template-columns: 1fr; }
}

/* ---------- Tables & admin lists ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .85rem; color: var(--muted); padding: 12px 16px; border-bottom: 1.5px solid var(--rule); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table tr.retired td { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.tag { font-size: .8rem; font-weight: 700; padding: 1px 7px; border-radius: 3px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row input[type=text] { flex: 1 1 220px; width: auto; }
.list-row .check { margin: 0; }
.list-row .muted { font-size: .9rem; min-width: 5em; }

.asset-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.asset-head .plate { font-size: 1.9rem; padding: 2px 12px; border-width: 2.5px; }
.asset-top { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; }
.asset-photo img { display: block; width: min(100%, 360px); border-radius: 6px; border: 1px solid var(--rule); }
[data-for][hidden] { display: none; }
.asset-section { margin-bottom: 36px; }
.asset-checks .check-row { padding: 10px 0; border-top: 1px solid var(--rule); }
.asset-checks .check { margin: 0; }
.check-when { display: flex; flex-wrap: wrap; gap: 0 16px; padding-left: 30px; }
.check-when label { font-weight: 400; margin: 8px 0 4px; }
.check-row:not(:has(input[type=checkbox]:checked)) .check-when { display: none; }

/* ---------- Help ---------- */
.status-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.help { max-width: 820px; }
.help-lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.help-toc { margin: 28px 0 8px; padding: 18px 22px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
.help .help-toc ul { list-style: none; margin: 0 0 6px; padding: 0; columns: 2 220px; column-gap: 32px; }
.help .help-toc li { padding: 3px 0; margin: 0; break-inside: avoid; }
.help-toc a { font-weight: 700; text-decoration: none; }
.help-toc a:hover { text-decoration: underline; }
.help-toc-group { font: 600 1.05rem var(--display); color: var(--muted); margin: 10px 0 4px; }
.help-toc-group:first-child { margin-top: 0; }
.help section { margin-top: 52px; scroll-margin-top: 16px; }
.help section > h2 { font-size: 1.9rem; color: var(--navy); margin-bottom: 10px; }
.help .help-part { margin-top: 72px; padding-top: 24px; border-top: 4px solid var(--navy); font-size: 2.4rem; color: var(--navy); }
.help p, .help li { max-width: 68ch; }
.help p + p, .help p + ul, .help ul + p, .help ol + p { margin-top: 12px; }
.help ul, .help ol { padding-left: 1.3em; margin: 12px 0 0; }
.help li + li { margin-top: 6px; }
.help .steps li::marker { font: 700 1.05rem var(--display); color: var(--navy); }
.help code { font-size: .92em; background: var(--navy-pale); padding: 1px 5px; border-radius: 3px; }
.help-tip { margin-top: 16px; padding: 12px 16px; background: var(--navy-pale); border-radius: 6px; }
.help-shot { margin: 20px 0; }
.help-shot img { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.help-shot.is-phone { max-width: 340px; }
.help-shot figcaption { margin-top: 8px; color: var(--muted); font-size: .9rem; max-width: 60ch; }
.help-pair { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: flex-start; }
.help-pair .help-shot { flex: 1 1 260px; }

/* ---------- Login ---------- */
main.bare { min-height: 100vh; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-brand { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-brand img { width: 190px; }
.login-title { font: 700 clamp(3.5rem, 8vw, 7rem)/.88 var(--display); }
.login-title span { display: block; font-size: .62em; font-weight: 600; margin-top: .12em; }
.login-form { align-self: center; justify-self: center; width: min(100%, 380px); padding: 40px 20px; }
.login-form h1 { font-size: 2.3rem; color: var(--navy); margin-bottom: 4px; }
.report-callout { background: var(--sheet); border: 2px solid var(--navy); border-radius: 8px; padding: 18px 20px 20px; margin-bottom: 36px; }
.report-callout-title { font: 700 1.7rem/1.1 var(--display); color: var(--navy); margin-bottom: 6px; }
.report-callout .btn { margin-top: 14px; }
.login-form .btn { margin-top: 24px; }
.login-form .hint { margin-top: 18px; }
@media (max-width: 760px) {
    .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-brand { padding: 20px var(--gutter) 28px; gap: 28px; }
    .login-brand img { width: 120px; }
    .login-title { font-size: 3.6rem; }
    .login-form { align-self: start; }
}

/* Dynamic risk assessment: /jobs/{id}/start, then a record on the timeline. Red, amber and mint follow the paper card. */
.dra-step { background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--rule); border-radius: 6px; padding: 16px 20px 20px; margin-bottom: 16px; }
.dra-stop { border-left-color: var(--red); }
.dra-think { border-left-color: var(--amber); }
.dra-act { border-left-color: var(--mint); }
.dra-step h2 { font-size: 2rem; color: var(--navy); }
.dra-step h2:focus { outline: none; }
.dra-step h2 span { display: block; font: 400 .9rem var(--body); color: var(--muted); }
.dra-step h3 { margin-top: 18px; }
.dra-q { border: 0; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.dra-q legend { padding: 0; margin-bottom: 8px; float: left; width: 100%; }
.dra-q.missing legend { color: var(--red-ink); font-weight: 700; }
.yna { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.yna label, .hazards label { margin: 0; position: relative; }
.yna input, .hazards input { position: absolute; opacity: 0; pointer-events: none; }
.yna span, .hazards span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 10px; border: 2px solid var(--rule); border-radius: 4px; cursor: pointer; text-align: center; background: #fff; }
.yna input:focus-visible + span, .hazards input:focus-visible + span { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.yna input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.yna input[value=no]:checked + span { background: var(--red-ink); border-color: var(--red-ink); }
.dra-warn { background: var(--red-pale); color: var(--red-ink); padding: 12px 14px; border-radius: 4px; margin: 16px 0 0; }
.hazards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.hazards label { display: grid; }
.hazards span { justify-content: flex-start; text-align: left; font-weight: 400; }
.hazards input:checked + span { background: var(--amber-pale); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }
.hazards input:checked + span::before { content: "✓"; margin-right: 8px; }
.dra-record { margin-top: 6px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 14px; }
.dra-record summary { cursor: pointer; font-weight: 700; }
.dra-record summary strong { color: var(--red-ink); }
.dra-record p { margin: 8px 0 0; }
.dra-answers { list-style: none; margin: 8px 0 0; padding: 0; }
.dra-answers li { padding: 3px 0; }
.dra-answers span { display: inline-block; min-width: 3em; font-weight: 700; }
.dra-answers .no { color: var(--red-ink); }
