:root { --accent:#a8006a; --red:#c0392b; --amber:#b05e00; --green:#1e8449; }
/* Milne Safety brand bar (logo + phone) shown above each page header */
.brandbar { display:flex; align-items:center; justify-content:space-between; gap:12px; background:#fff; border-bottom:1px solid #e3e3e3; padding:8px 16px; }
.brandbar img { height:40px; width:auto; }
.brandbar .brand-phone { font-weight:700; color:var(--accent); white-space:nowrap; }
.brandbar .brand-phone a { color:var(--accent); text-decoration:none; }
* { box-sizing: border-box; }
body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; color: #222; background: #f4f4f6; }
header { background: var(--accent); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 20px; margin: 0; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.hidden { display: none; }
.muted { color: #595959; font-size: 14px; }
.req { color: var(--red); font-size: 13px; }
.hint { color: #5a5a5a; font-size: 13px; margin: 2px 0 8px; }
.inline-check { font-weight: 500; }
label { display: block; margin: 10px 0; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input:not([type]), input[type=file], textarea, select { width: 100%; min-height: 44px; padding: 10px; font-size: 16px; border: 1px solid #999; border-radius: 6px; font-weight: 400; background: #fff; }
input[type=checkbox] { width: auto; min-height: 0; margin-right: 8px; transform: scale(1.4); }
input:disabled, textarea:disabled { background: #e8e8e8; color: #777; cursor: not-allowed; }
/* visible keyboard focus (WCAG 2.4.7) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #1a6fd6; outline-offset: 2px;
}
.row { display: flex; gap: 10px; margin-top: 12px; }
button { flex: 1; min-height: 44px; padding: 14px; font-size: 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
button.secondary { background: #e2e2e2; color: #222; }
.btn-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; background: #e2e2e2; color: #222; border-radius: 8px; text-decoration: none; font-weight: 600; }
/* sticky action bar — Save + live progress always in reach on a tablet */
#action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; gap: 12px;
  align-items: center; padding: 10px 16px; background: #fff; border-top: 1px solid #ccc; box-shadow: 0 -2px 10px rgba(0,0,0,.09); }
#action-bar.hidden { display: none; }
#bar-msg { flex: 1; font-weight: 600; font-size: 15px; }
#bar-msg.err { color: var(--red); font-weight: 700; }
#action-bar #btn-submit { flex: 0 0 auto; min-width: 150px; }
body.inspecting main { padding-bottom: 86px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; color: #fff; text-transform: uppercase; }
.chip-new { background: #1a6fd6; } .chip-scheduled { background: var(--green); } .chip-done { background: #595959; } .chip-cancelled { background: var(--red); }
.element { border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px; margin: 12px 0; }
.el-head { font-size: 16px; }
.help { margin: 4px 0 8px; }
/* Big segmented Pass/Fail/N/A buttons (radios kept for accessibility) */
.statuses { display: flex; gap: 8px; margin: 10px 0; }
.statuses label { flex: 1; text-align: center; margin: 0; padding: 14px 6px; min-height: 48px;
  border: 2px solid #999; border-radius: 8px; font-weight: 700; cursor: pointer; background: #fff; user-select: none; }
.statuses label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.statuses label:has(input[value="pass"]:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.statuses label:has(input[value="fail"]:checked) { background: var(--red); border-color: var(--red); color: #fff; }
.statuses label:has(input[value="na"]:checked) { background: #595959; border-color: #595959; color: #fff; }
.statuses label:has(input:focus-visible) { outline: 3px solid #1a6fd6; outline-offset: 2px; }
.obs { margin-top: 6px; }
.defect-pick { margin-top: 8px; color: var(--accent); font-weight: 600; border-color: var(--accent); background: #fdf2f8; }
.defect-pick.hidden { display: none; }
.photo-row { margin-top: 10px; padding: 8px; background: #fdecea; border-radius: 6px; }
.status { font-size: 14px; }
.status.ok { color: #d1ffd6; }
.status.warn { color: #ffd; font-weight: 700; }
#qr-video { width: 100%; max-height: 300px; background: #000; border-radius: 8px; margin: 8px 0; }
ul { margin: 6px 0; padding-left: 20px; }
a { color: var(--accent); }
.element.changed { border-left: 4px solid var(--amber); background: #fff8ec; }
.element .was { font-size: 12px; color: #6a6a6a; }
.element .was.now-changed { color: #9a5200; font-weight: 700; }
.result-banner { padding: 14px 16px; border-radius: 8px; font-weight: 700; margin: 10px 0; font-size: 17px; }
.result-banner.ok { background: #effaf1; color: #155d32; border: 1px solid #bfe6c8; }
.result-banner.ok a { color: #155d32; }
.result-banner.action { background: #fdecea; color: var(--red); border: 1px solid #f3c2bc; }
.success-panel { background: #effaf1; border: 1px solid #bfe6c8; border-radius: 10px; padding: 22px; text-align: center; }
.success-panel h3 { color: var(--green); margin: 0 0 8px; font-size: 22px; }
.inline-error { background: #fdecea; color: var(--red); border: 1px solid #f3c2bc; border-radius: 6px; padding: 10px 12px; margin: 10px 0; display: none; }
.inline-error.show { display: block; }
.toolbar { display: flex; gap: 8px; margin: 10px 0; }
.toolbar button { flex: 0 0 auto; padding: 10px 14px; font-size: 15px; }
.req-mark { color: var(--red); } .opt-mark { color: #5a5a5a; font-weight: 400; }
#new-door-fields { border: 1px dashed #c9a; border-radius: 8px; padding: 12px; margin-top: 10px; background: #faf5f8; }
.advanced { margin: 8px 0 4px; }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 8px 0; }
.flash { outline: 3px solid var(--amber); outline-offset: 2px; transition: outline .2s; }
#rating-buttons button { flex: 1; background: #fff; color: var(--accent); border: 2px solid var(--accent); }
#rating-buttons button.sel { background: var(--accent); color: #fff; }
#rating-buttons button.sel::after { content: " ✓"; }
.thumb { display: inline-block; height: 38px; width: 38px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-left: 6px; border: 1px solid #999; }
.thumb.hidden { display: none; }
/* ---- 7 Nov: navigation, sign-in, price card, email dialog, settings ---- */
.topnav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.topnav a { color: #fff; text-decoration: none; font-weight: 600; padding: 6px 2px; }
.topnav a[aria-current="page"] { border-bottom: 2px solid #fff; }
.user-chip { font-size: 13px; opacity: .95; }
.user-chip .signout { color: #fff; text-decoration: underline; margin-left: 6px; font-weight: 400; }
.login-card { max-width: 420px; margin: 24px auto; }
.price-card { border: 2px solid var(--accent); }
.price-flag { background: #fff4d6; border: 1px solid #e0b44a; color: #6b4b00; border-radius: 6px; padding: 10px 12px; margin: 6px 0 10px; }
.price-edit { display: flex; align-items: center; gap: 8px; }
.price-edit .pound { font-size: 22px; font-weight: 700; color: var(--accent); }
.price-edit input { max-width: 160px; font-size: 22px; font-weight: 700; }
.price-edit button { flex: 0 0 auto; }
.pdf-link { font-weight: 700; }
dialog.mail-dialog { width: min(680px, 96vw); border: 0; border-radius: 10px; padding: 0; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog.mail-dialog::backdrop { background: rgba(0,0,0,.45); }
.mail-form { padding: 18px 20px; max-height: 90vh; overflow: auto; }
.mail-form h2 { margin-top: 0; color: var(--accent); }
.mail-form textarea { font-family: inherit; }
.draft-mode { background: #eef4ff; border-left: 4px solid #1a6fd6; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.mail-actions { flex-wrap: wrap; }
.attach { background: #f6f6f8; padding: 8px 10px; border-radius: 6px; }
.status-draft { background: #1a6fd6; } .status-sent { background: var(--green); }
.status-failed { background: var(--red); } .status-discarded { background: #8a8a8a; }
.settings-grid label { margin: 12px 0 4px; }
.settings-grid .hint { margin-top: 0; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th, table.users td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e5e5e5; vertical-align: middle; }
table.users button { flex: 0 0 auto; padding: 6px 10px; min-height: 36px; font-size: 14px; }
.once-password { font-family: ui-monospace, Consolas, monospace; font-size: 18px; background: #fffbe6; border: 1px dashed #b08900; padding: 10px; border-radius: 6px; user-select: all; }
.auth-banner { position: sticky; top: 0; z-index: 60; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* 7 Nov: live progress bar, pick list, inline new-door errors, door list */
#action-bar { flex-wrap: wrap; }
#action-bar .progress { flex: 1 0 100%; height: 8px; background: #e6e6e6; border-radius: 4px; overflow: hidden; }
#progress-fill { height: 100%; width: 0; background: var(--accent, #a8006a); transition: width .25s; }
#bar-msg.needs { color: #6b4400; }
.pick-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.pick-list .pick { text-align: left; }
.new-door-err { color: var(--red, #b00020); font-weight: 600; min-height: 0; margin: 4px 0; }
.new-door-err:empty { display: none; }
#pass-note-warn.result-banner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input.is-off { opacity: .55; }
.door-list { margin: 8px 0 12px; }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.doors { border-collapse: collapse; width: 100%; font-size: 14px; }
table.doors th, table.doors td { border-bottom: 1px solid #ddd; padding: 6px 8px; text-align: left; vertical-align: top; }
table.doors input, table.doors select { min-width: 90px; }
