/* Task Helper — the SAFETY screens: SWMS library, editor, settings (job-intake.md §41; SF-2, lane TASK HELPER SAFETY).
 * Copyright Rapid Surveys Pty Ltd. App tokens only (--bg --card --ink --muted --line --accent --accent-ink --ok --err). Namespaced .sf-.
 * Phone first; nothing scrolls the page sideways (wide bits scroll inside their own box). */
.sf-screen.overlay { display: block; background: var(--bg); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
html.sf-open, html.sf-open body { overflow: hidden; }
.sf-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: var(--ink); color: #fff; }
/* BRIEF-1307 THBars (UI): under the app's top bar the bar carries the notch, so the head drops its safe-area padding */
html.th-under .sf-bar { padding-top: 8px; }
.sf-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sf-titles h2 { margin: 0; font-size: 18px; line-height: 1.25; color: #fff; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; outline: none; }
.sf-co { font-size: 12px; color: #9aa6b5; overflow-wrap: anywhere; }
.sf-back, .sf-x { width: auto; flex: none; margin: 0; min-height: 44px; min-width: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 15px; font-weight: 600; }
.sf-back { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-x { font-size: 20px; }
.sf-wrap { max-width: 960px; margin: 0 auto; padding: 12px 16px 96px; }
.sf-msg { margin: 0 0 10px; }
.sf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.sf-actions:empty { display: none; }
.sf-primary, .sf-ghost { width: auto; margin: 0; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 15px; }
.sf-primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.sf-ghost { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.sf-chip { width: auto; margin: 0; min-height: 36px; min-width: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; }
.sf-danger { color: var(--err) !important; }
.sf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sf-card { display: flex; flex-direction: column; gap: 2px; width: 100%; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-align: left; min-height: 44px; }
.sf-card-name { font-weight: 600; overflow-wrap: anywhere; }
.sf-card-sub { font-size: 13px; color: var(--muted); }
.sf-pill { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--bg); vertical-align: middle; }
.sf-pill-ok { border-color: var(--ok); color: var(--ok); }
.sf-pill-warn { border-color: #b45309; color: #b45309; }
.sf-pill-bad { border-color: var(--err); color: var(--err); }
.sf-badge { display: inline-block; margin: 4px 0; padding: 2px 10px; border: 1px solid #9E8C5B; border-radius: 999px; font-size: 12px; }
.sf-sec { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.sf-sec h3 { margin: 0 0 8px; font-size: 16px; }
.sf-sec.sf-gap { border-color: #b45309; }
.sf-f { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; font-size: 14px; }
.sf-f > span { color: var(--muted); font-size: 13px; }
.sf-f textarea { min-height: 88px; }
.sf-f input, .sf-f textarea, .sf-f select, .sf-row input, .sf-row select { width: 100%; max-width: 100%; margin: 0; font-size: 16px; }
.sf-check { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.sf-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; }
.sf-reg { color: var(--muted); font-size: 12px; }
.sf-step { margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.sf-haz { margin: 8px 0 0; padding: 8px 8px 8px 10px; border-left: 3px solid #9E8C5B; background: var(--card); border-radius: 6px; }
.sf-ctl { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 6px 0; padding: 6px; border: 1px dashed var(--line); border-radius: 8px; }
@media (min-width: 768px) { .sf-ctl { grid-template-columns: 2fr 1fr 2fr auto; align-items: start; } }
.sf-rate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.sf-rate select { width: auto; min-width: 0; flex: 1 1 140px; margin: 0; font-size: 15px; }
.sf-lvl { display: inline-block; padding: 1px 8px; border-radius: 4px; font-weight: 700; font-size: 13px; }
.sf-rowbtns { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.sf-gaps, .sf-warns { margin: 0 0 12px; padding: 10px 12px 10px 28px; border-radius: 10px; font-size: 14px; }
.sf-gaps { border: 1px solid #b45309; }
.sf-warns { border: 1px solid var(--line); }
.sf-gaps li, .sf-warns li { margin: 2px 0; }
.sf-cmt { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.sf-cmt-meta { color: var(--muted); font-size: 12px; }
.sf-grid { overflow-x: auto; margin: 0 0 10px; }
.sf-grid table { border-collapse: collapse; font-size: 13px; }
.sf-grid th, .sf-grid td { border: 1px solid var(--line); padding: 4px; text-align: center; }
.sf-grid select { width: auto; margin: 0; font-size: 13px; }
.sf-none { color: var(--muted); font-style: italic; }
.sf-hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.sf-note { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid #9E8C5B; background: var(--card); font-size: 14px; }
/* SF-5: the Take 5's bottom SHEET (outside signer, "I don't agree") — phone first, never a browser prompt */
.t5-sheetov { position: fixed; inset: 0; z-index: 990; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .5); }
.t5-sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; margin: 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; background: var(--bg); color: var(--ink); box-shadow: 0 -8px 24px rgba(0, 0, 0, .3); }
.t5-sheet h2 { margin: 0 0 8px; font-size: 18px; text-transform: none; letter-spacing: 0; }
.t5-err, .sf-f > .t5-err { color: var(--err); font-size: 13px; }
.t5-err:empty { display: none; }
.sf-filt { flex: 1 1 140px; margin: 0; }
.sf-filt input, .sf-filt select { width: 100%; min-height: 44px; }
/* Gary's live test (2026-10-10): the starter badge is an inline TAG, not a full-width bar; a card says it opens (a chevron) */
.sf-card .sf-badge, .sf-badge { align-self: flex-start; width: fit-content; max-width: 100%; }
.sf-card { position: relative; padding-right: 76px; cursor: pointer; }
.sf-card::after { content: 'Open ›'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 700; line-height: 1; color: var(--accent); }
.sf-card:hover, .sf-card:focus-visible { border-color: var(--accent); }
/* R-1 (BRIEF-1140): the READER screen — a toolbar top + bottom around the sandboxed version */
.sr-ov { position: fixed; inset: 0; z-index: 980; display: flex; flex-direction: column; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); background: var(--bg); }
html.th-under .sr-ov { padding-top: 8px; }   /* BRIEF-1307 THBars: the top bar carries the notch … */
html.th-above .sr-ov { padding-bottom: 8px; }   /* … and the phone's view bar the home indicator */
.sr-head { display: flex; align-items: center; gap: 8px; }
.sr-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.sr-head button { width: auto; margin: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; }
.sr-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-bar > * { flex: 1 1 auto; justify-content: center; }
.sr-bar a.sf-ghost { display: inline-flex; align-items: center; text-decoration: none; }
.sr-frame { flex: 1; width: 100%; min-height: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sr-msg { margin: 0; }
/* Gary's live test (2026-10-10): a Take 5 problem is shown ON its item + listed at the top */
.t5-bad { outline: 2px solid var(--err); outline-offset: 2px; border-radius: 8px; }
.t5-err.t5-item { display: block; margin: 4px 0 0; }
.t5-summary { margin: 0 0 12px; padding: 10px 12px; border: 2px solid var(--err); border-radius: 10px; background: var(--card); font-size: 14px; }
.t5-summary ul { margin: 6px 0 0; padding-left: 18px; }
.t5-goto { width: auto; margin: 2px 0; min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--err); font-size: 14px; text-align: left; text-decoration: underline; }
.t5-need { margin: 4px 0 6px; color: var(--err); font-size: 13px; font-weight: 600; }
.t5-req { color: var(--err); }
.sf-regrow { display: block; text-align: left; }
.sf-regrow ul { margin: 4px 0 0; padding-left: 18px; }
/* BRIEF-1181: the risk rating at once + the matrix viewer — the app's own form styles, 44 px controls */
.rk { margin: 4px 0 10px; }
.rk-label, .rk-head { display: block; margin: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rk-f { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); min-width: 0; }
.rk-f select, .rk-kind select { width: 100%; min-height: 44px; margin: 0; font-size: 16px; }
.rk-result { margin: 6px 0 2px; font-size: 14px; }
.rk-out .sf-lvl { font-size: 14px; padding: 2px 10px; }
.rk-stop { display: block; margin-top: 4px; color: var(--err); font-weight: 600; font-size: 14px; }
.rk-view { width: auto; margin: 2px 0 0; min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: underline; }
.rk-kind { margin-top: 6px; }
.mx-wrap { overflow-x: auto; margin: 0 0 10px; }
.mx { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.mx th { padding: 2px 1px; font-weight: 600; color: var(--muted); text-align: center; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; font-size: 10.5px; line-height: 1.15; }
.mx th[scope=row] { text-align: right; padding-right: 4px; }
.mx thead th:first-child, .mx th[scope=row] { width: 21%; }
.mx thead th { vertical-align: bottom; }
.mx-cell { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 2px 1px; border: 2px solid transparent; border-radius: 6px; font-size: 10.5px; font-weight: 700; overflow-wrap: normal; word-break: keep-all; letter-spacing: -.2px; }
.mx-cell.mx-stop { border-color: rgba(0, 0, 0, .55); }
.mx-cell.mx-on { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 400px) { .mx-cell { font-size: 9px; letter-spacing: -.3px; padding: 2px 0; } .mx th { font-size: 9px; letter-spacing: -.3px; } .mx thead th:first-child, .mx th[scope=row] { width: 16%; } }
/* BRIEF-1231: "SWMS not signed" on a Take 5 (Gary W1 = 2) — a warning band, words not colour alone */
.t5-unsigned { border-left-color: #b45309; }
.t5-unsigned b { display: block; margin-bottom: 2px; }
.t5-unsigned div { overflow-wrap: anywhere; }
/* BRIEF-1231 B: what this phone still has to send for the task (OFFLINE's outbox) */
.t5-unsent { border-left-color: #6b7280; border-left-style: dashed; }
.t5-unsent b { display: block; overflow-wrap: anywhere; }
/* BRIEF-1237's copy sheet moved to public/shared/copy-sheet/copy-sheet.css (BRIEF-1239 Q8) */
/* BRIEF-1244: the Diary's Take 5 section, compact for a phone — one row per Take 5 (tap = Read), a QR button, 44 px targets */
.t5-done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; }
.t5-link { width: auto; min-height: 44px; margin: 0; padding: 0 6px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; }
.t5-info { width: 44px; min-width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 22px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.t5-dr[hidden] { display: none; }
.t5-item { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.t5-item-active { border-color: var(--accent); }
.t5-row { display: flex; align-items: stretch; }
.t5-open { flex: 1 1 auto; min-width: 0; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; padding: 6px 10px; border: 0; border-radius: 10px 0 0 10px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; }
.t5-res { padding: 0 7px; border: 1px solid; border-radius: 9px; font-size: 11px; font-weight: 700; }
.t5-res-ok { border-color: var(--ok); color: var(--ok); }
.t5-res-bad { border-color: var(--err); color: var(--err); }
.t5-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.t5-what { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t5-who { color: var(--muted); }
.t5-tag { padding: 0 6px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--muted); }
.t5-tag-bad { border-color: var(--err); color: var(--err); }
.t5-qrbtn { flex: 0 0 44px; width: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 10px 10px 0; background: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.t5-crew, .t5-copies { padding: 0 10px 8px; }
.t5-crew .sf-chip, .t5-copies .sf-chip { min-height: 44px; }
.t5-earlier { margin: 4px 0 0; }
.t5-earlier > summary { min-height: 44px; display: flex; align-items: center; padding: 0 4px; color: var(--muted); font-weight: 600; cursor: pointer; }
.t5-earlier > summary::-webkit-details-marker { display: none; }
.t5-earlier > summary::after { content: '▸'; margin-left: 6px; }
.t5-earlier[open] > summary::after { content: '▾'; }
/* BRIEF-1253: the SWMS page — header, folded principal contractor, version rows with their date, a calm review line; selects match the inputs */
.sf-f select { min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd; color: var(--ink); }
.sf-swhead { padding-bottom: 4px; }
.sf-swtitle { margin: 0 0 4px; font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
.sf-swstate { margin: 0 0 4px; }
.sf-pcfold { margin: 4px 0 12px; }
.sf-pcfold > summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; }
.sf-ver { display: flex; align-items: center; gap: 8px; text-align: left; min-height: 44px; }
.sf-ver-main { flex: 1 1 auto; min-width: 0; }
.sf-ver-line { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sf-ver-open { flex: 0 0 auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.sf-ok-line { margin: 0 0 10px; color: var(--ok); font-weight: 600; }
/* BRIEF-1256 SDS-1: Safety Data Sheets (public/safety/sds.js) */
.sds-amber { display: block; margin: 4px 0 0; padding: 4px 8px; border-left: 3px solid #b45309; background: rgba(180, 83, 9, .10); color: #b45309; font-size: 13px; font-weight: 600; }
p.sds-amber { margin: 0 0 10px; }
.sds-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 16px; margin: 0 0 8px; }
.sds-filter .sf-f { flex: 1 1 220px; margin-bottom: 8px; }
a.sds-open, .sf-actions a.sf-ghost { display: inline-flex; align-items: center; text-decoration: none; }
.sds-versions .sf-cmt div { overflow-wrap: anywhere; }
/* BRIEF-1257 fix: Read and sign inside the task's SDS sheet */
.sds-signbox { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.sds-signbox h3 { margin: 0 0 6px; font-size: 16px; }
/* BRIEF-1257: an SDS read + signed inside the Take 5 */
.sds-steps { margin: 8px 0 12px; padding-left: 22px; }
.sds-steps li { margin: 2px 0; }
.t5-chem .sf-check { margin-bottom: 4px; }
.t5-sdsadd-list { max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.t5-sdsadd-list .sf-card { width: 100%; text-align: left; margin: 0 0 6px; }
/* BRIEF-1284: qualifications & licences (public/safety/quals.js). The photo row + the full-size viewer are styled by public/photo-viewer/photo-viewer.css
   ([data-pv-part], loaded before this file in index.html — ASSETS AS-2); only the item layout + SAFETY's chip size in the viewer bar stay here. */
/* BRIEF-1286b: the main image in the details (‹ › / swipe / ← →), a small list of the files under it; the full-size viewer carries the buttons */
.ql-item { display: grid; gap: 16px; }
@media (min-width: 760px) { .ql-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }
.ql-view-bar .sf-chip { min-height: 44px; padding: 0 16px; font-size: 15px; }
.sf-primary.gt-off { border-color: var(--line); background: var(--card); }   /* BRIEF-1289 G3: a greyed main button reads as greyed (muted text on the card, not on the accent) */
.sf-primary.gt-off, .sf-ghost.gt-off, .sf-chip.gt-off { display: inline-flex; align-items: center; justify-content: center; }
/* BRIEF-1307: a Take 5 NOT on a task (the + menu) — the same bottom sheet, taller, with its own header + result */
.t5-qov .t5-qsheet { max-height: 96vh; }
.t5-qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.t5-qhead h2 { margin: 0; }
.t5-qx { min-width: 44px; min-height: 44px; }
.t5-qrecent .sf-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t5-qdone { margin: 8px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.t5-qres { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.t5-qstop .t5-qres { color: var(--err); }
.t5-qok .t5-qres { color: var(--ok); }
/* BRIEF-1314: Qualifications → Team — the org chart under me, a status line per person (indented; branches fold) */
.ql-tm { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ql-tm-top { padding-left: 0; border-left: 0; }
.ql-tm > li { margin: 0; }
.ql-tm-branch > summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 2px 0 4px; min-height: 24px; }
.ql-tm-branch > .ql-tm { margin-top: 6px; }
.ql-tm-who { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.ql-tm-name { font-weight: 700; }
.ql-tm-role { font-size: 13px; color: var(--muted); }
.ql-tm-line { font-size: 13px; color: var(--ink); }
.ql-tm-none, .ql-tm-off .ql-tm-name { color: var(--muted); }
.ql-tm-off { cursor: default; border-style: dashed; }
.ql-tm-off::after { content: none; }   /* no login → nothing to open */
.ql-tm-branch > summary { margin-top: 4px; }
/* BRIEF-1307 card (Gary d-c1 = 1): the Take 5 as a FLOATING CARD — centred, rounded, its own pages; it sits BELOW the SWMS reader (980),
   the ask sheets (990) and the sign pad (1000) that open on top of it */
.t5-cardov { position: fixed; inset: 0; z-index: 970; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0, 0, 0, .5); }
.t5-card { width: 100%; max-width: 560px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; margin: 0; padding: 16px; border-radius: 14px; background: var(--bg); color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.t5-card h2 { margin: 0 0 8px; font-size: 18px; text-transform: none; letter-spacing: 0; }
.t5-pnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 8px 0 12px; }
.t5-dot { width: auto; margin: 0; min-height: 44px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 12px; line-height: 1.15; }
.t5-dot .t5-dotn { font-size: 15px; font-weight: 800; }
.t5-dot.t5-on { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); font-weight: 700; }
.t5-page > .t5-ptitle { margin: 0 0 8px; font-size: 18px; text-transform: none; letter-spacing: 0; outline: none; }
.t5-page h4 { margin: 0 0 8px; font-size: 15px; }
.t5-pbtns { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 0; }
.t5-ontask { margin: 0 0 10px; font-weight: 600; }
.t5-taskrow { display: flex; gap: 8px; align-items: center; }
.t5-taskrow input { flex: 1; min-width: 0; min-height: 44px; }
.t5-taskon { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--card); }
.t5-tasklist { list-style: none; margin: 4px 0 8px; padding: 4px; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.t5-tasklist [role=option] { padding: 10px 8px; min-height: 44px; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.t5-tasklist [role=option]:hover, .t5-tasklist .t5-active { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.t5-taskhead { padding: 4px 8px; font-size: 12px; color: var(--muted); }
.t5-tasknone { padding: 8px; color: var(--muted); }
.t5-taskwhy { font-size: 12px; color: var(--muted); }
.t5-mxpage .mx-cell { font-size: 11px; line-height: 1.1; }
.t5-mxsay { min-height: 1.4em; margin: 8px 0 0; font-weight: 600; }
/* BRIEF-1307 (3): the in-app PDF READER for SDSs (public/safety/pdf-reader.js) — above the Take 5 card (970), the SWMS reader (980) and the
   ask sheets (990) it may open from; the sign pad (1000) stays above it */
.pr-ov { position: fixed; inset: 0; z-index: 996; display: flex; flex-direction: column; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); background: var(--bg); }
html.th-under .pr-ov { padding-top: 8px; }
html.th-above .pr-ov { padding-bottom: 8px; }
.pr-head { display: flex; align-items: center; gap: 8px; }
.pr-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
.pr-head .sf-ghost { width: auto; margin: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; }
.pr-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pr-bar .sf-chip { min-width: 44px; min-height: 44px; font-size: 18px; }
.pr-bar .sf-chip:disabled { opacity: .4; }
.pr-pg { font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; padding: 0 2px; }
@media (max-width: 400px) { .pr-pw { display: none; } .pr-bar { gap: 4px; flex-wrap: nowrap; } .pr-bar .sf-chip { min-width: 42px; padding: 0 6px; } }
.pr-gap { flex: 1; }
.pr-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.pr-canvas { display: inline-block; max-width: none; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
/* BRIEF-1315 (UI's THFrame): Safety's bottom sheets + the Take 5 card keep their head (title + ✕) and button row in reach — the rows reach the
   sheet's 16px padding and its rounded top (frame.css does the sticking; --th-dpad / --th-dbg tell it the sheet's padding and colour) */
.t5-sheet, .t5-card { --th-dpad: 16px; --th-dbg: var(--bg); }
.t5-sheet > .th-dhead, .t5-card > .th-dhead { top: -16px; margin-top: -16px; margin-bottom: 8px; padding-top: 12px; padding-bottom: 6px; border-radius: 14px 14px 0 0; }
.t5-sheet > .th-dhead > h2, .t5-card > .th-dhead > h2 { margin: 0; }
.t5-sheet > .th-dfoot { bottom: calc(-1 * max(16px, env(safe-area-inset-bottom))); margin-top: 12px; margin-bottom: calc(-1 * max(16px, env(safe-area-inset-bottom))); }
/* 2b: join a no-task Take 5 made today (co-sign) — Gary d-t5join = 1 */
.t5-joinl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.t5-joinl li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.t5-joined { color: var(--ok); font-weight: 600; font-size: 13px; }
/* BRIEF-E1: emergency info setup (public/safety/emergency.js) */
.em-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.em-cell { flex: 1 1 140px; min-width: 0; margin: 0; }
.em-x { flex: 0 0 auto; min-height: 44px; }
.em-tel { font-weight: 700; font-size: 1.05em; white-space: nowrap; }
.em-main .em-tel { font-size: 1.3em; color: #b91c1c; }
.em-tlabel { color: var(--muted, #64748b); }
.em-list, .em-plans, .em-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.em-plans li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.em-up { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; margin-top: 8px; cursor: pointer; }
.em-pre { white-space: pre-wrap; }
.em-inherit { opacity: .8; border-left: 3px solid var(--line, #cbd5e1); padding-left: 10px; }
.em-miss { margin-bottom: 12px; border-left-color: #d97706; }
.em-pic { position: fixed; inset: 0; z-index: 992; display: flex; flex-direction: column; background: var(--bg, #fff); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
.em-pichead { display: flex; align-items: center; gap: 8px; } .em-pichead b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.em-picbody { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; } .em-picbody img { max-width: 100%; height: auto; }
/* BRIEF-E2: the emergency panel (public/safety/emergency-panel.js) + the Take 5 card's red chip */
.t5-qhead h2 { flex: 1; min-width: 0; }
.t5-em { min-height: 44px; padding: 0 12px; border-radius: 10px; background: #b91c1c; border-color: #b91c1c; color: #fff; font-weight: 700; width: auto; margin: 0; flex: 0 0 auto; }
.t5-emsee { width: auto; min-height: 32px; margin: 0 0 0 4px; padding: 0 10px; border-radius: 8px; border: 1px solid #b91c1c; background: transparent; color: #b91c1c; font-weight: 600; font-size: 13px; }
.em-ov { position: fixed; inset: 0; z-index: 985; display: flex; flex-direction: column; background: var(--bg, #fff); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
.em-phead { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 3px solid #b91c1c; }
.em-phead button { width: auto; margin: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; }
.em-ptitle { flex: 1; min-width: 0; } .em-ptitle h2 { margin: 0; font-size: 20px; color: #b91c1c; text-transform: none; letter-spacing: 0; } .em-psub { color: var(--muted, #64748b); font-size: 14px; overflow-wrap: anywhere; }
.em-pbody { flex: 1; overflow: auto; padding: 12px 0; max-width: 720px; width: 100%; margin: 0 auto; }
.em-big { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 0 0 14px; border-radius: 14px; background: #b91c1c; color: #fff !important; text-decoration: none; }
.em-bign { font-size: 34px; font-weight: 800; letter-spacing: 1px; } .em-bigl { font-size: 16px; font-weight: 600; }
.em-psec { margin: 0 0 14px; } .em-psec h3 { margin: 0 0 6px; font-size: 15px; }
.em-muster p { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--card, #f8fafc); border-left: 4px solid #15803d; font-weight: 600; }
.em-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.em-call { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line, #cbd5e1); background: var(--card, #fff); text-decoration: none; color: inherit; }
.em-cname { font-weight: 700; min-width: 0; overflow-wrap: anywhere; } .em-csub { font-weight: 400; color: var(--muted, #64748b); }
.em-cnum { font-weight: 800; color: #1d4ed8; white-space: nowrap; } .em-cnote { margin: 2px 0 0 14px; }
/* T5-R: a completed Take 5's SWMS / SDS lines open read-only */
.t5-vdoc { width: auto; min-height: 36px; margin: 2px 0; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line, #cbd5e1); background: var(--card, #fff); color: #1d4ed8; font-weight: 600; text-align: left; }
/* NOTE-ACTS A2: legislation & references (public/safety/legislation.js) */
.lg-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.lg-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.lg-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lg-link { font-size: 14px; }
.lg-x { flex: 0 0 auto; min-height: 40px; }
.lg-search { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.lg-srow { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.lg-q { flex: 1 1 200px; margin: 0; } .lg-k { flex: 0 1 180px; margin: 0; }
.lg-results { margin-top: 8px; }
.lg-ownf { margin: 8px 0; }
/* NOTE-SOS S1: the distress alert (public/safety/emergency-panel.js) */
.em-sosbox { margin: 0 0 14px; }
.em-sos { position: relative; width: 100%; min-height: 64px; margin: 0; padding: 0 16px; border: 3px solid #7f1d1d; border-radius: 14px; background: #fff; color: #7f1d1d; font-size: 17px; font-weight: 800; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.em-sosring { position: absolute; inset: 0; background: #b91c1c; transform-origin: left center; transform: scaleX(var(--p, 0)); opacity: .9; }
.em-soslbl { position: relative; z-index: 1; }
.em-sos.em-holding { color: #fff; }
.em-sosnote { margin: 6px 0 0; }
.em-cd { position: fixed; inset: 0; z-index: 995; display: flex; align-items: center; justify-content: center; background: #7f1d1d; color: #fff; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.em-cdbox { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; text-align: center; }
.em-cdline { font-size: 22px; font-weight: 800; margin: 0; }
.em-cdcancel { min-height: 46vh; margin: 0; border: 4px solid #fff; border-radius: 18px; background: #fff; color: #7f1d1d; font-size: 34px; font-weight: 900; }
.em-cdnow { width: auto; align-self: center; min-height: 44px; margin: 0; padding: 0 18px; border: 2px solid #fecaca; border-radius: 10px; background: transparent; color: #fff; font-weight: 700; }
.em-cdnote { margin: 0; font-size: 14px; color: #fecaca; }
.em-sent { position: fixed; inset: 0; z-index: 990; display: flex; flex-direction: column; background: var(--bg, #fff); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
.em-sosrow { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; border: 1px solid var(--line, #cbd5e1); border-radius: 12px; }
.em-sosrow .em-cname { flex: 1; }
.em-sosrow .sf-chip { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; text-decoration: none; }
.em-sostext pre { white-space: pre-wrap; font-size: 13px; }
.em-again { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 14px; }
/* NOTE-SOS S2: the alert thread + the server-alert line */
.em-sosapp { margin-bottom: 10px; }
.em-thread { position: fixed; inset: 0; z-index: 990; display: flex; flex-direction: column; background: var(--bg, #fff); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
.em-msgs { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.em-msg { padding: 8px 10px; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; background: var(--card, #fff); }
.em-msg.em-mine { border-color: #9E8C5B; }
.em-map { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin: 6px 0; }
.em-dealt { border-color: #15803d; color: #15803d; font-weight: 700; }
.em-closed { border-left-color: #15803d; }
.em-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* NOTE-SOS S2b: PRACTICE — never red, always says PRACTICE */
.em-prac { margin: 0 0 8px; }
.em-sos.em-sos-practice { border: 3px dashed #1d4ed8; color: #1d4ed8; }
.em-sos.em-sos-practice .em-sosring { background: #1d4ed8; }
.em-cd.em-cd-practice { background: #1e3a8a; }
.em-cd.em-cd-practice .em-cdcancel { color: #1e3a8a; }
.em-practice { position: fixed; inset: 0; z-index: 990; display: flex; flex-direction: column; background: var(--bg, #fff); padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom)); }
.em-practice .em-phead { border-bottom-color: #1d4ed8; } .em-practice .em-ptitle h2 { color: #1d4ed8; }
.em-pracbig { margin: 0 0 12px; padding: 14px; border-radius: 12px; background: #dbeafe; color: #1e3a8a; font-size: 18px; font-weight: 800; }
.em-pracmsg { white-space: pre-wrap; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line, #cbd5e1); border-radius: 8px; }
.em-test { margin-top: 8px; min-height: 44px; }
/* WORK SITE (SERVER): the alert is practice only — the note above the switch */
.em-worksite{margin:0 0 8px;padding:8px 10px;border-radius:8px;background:#b45309;color:#fff;font-weight:700;text-align:center}
/* WS2: on the WORK site the numbers are text, not tel: links */
.em-big-off, .em-call-off { cursor: default; } .em-big-off { opacity: .85; } .em-tel-off { font-weight: 600; color: inherit; } .em-call-off .em-cnum { color: inherit; }
/* PR1 (Gary t-sospr): PRACTICE MODE — the slider in Safety settings + the blue bar on the Emergency panel */
.sf-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.sf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-slider { position: relative; width: 48px; height: 28px; border-radius: 14px; background: #9aa5b1; transition: background .15s; flex: none; }
.sf-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sf-switch input:checked + .sf-slider { background: #1e3a8a; } .sf-switch input:checked + .sf-slider::after { transform: translateX(20px); }
.sf-switch input:focus-visible + .sf-slider { outline: 2px solid #1e3a8a; outline-offset: 2px; } .sf-switch input:disabled + .sf-slider { opacity: .6; }
.em-prbar { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: #dbeafe; color: #1e3a8a; border: 2px dashed #1e3a8a; }
.em-prbar p { margin: 0 0 6px; }
.em-prlink { background: none; border: 0; padding: 8px 2px; min-height: 44px; color: var(--accent, #2f6df6); text-decoration: underline; font: inherit; cursor: pointer; }
/* Gary: "I want to be able to SEE this evacuation plan" — the plans INLINE in the Emergency panel (full width; tap → full screen + zoom) */
.em-plans-in { display: grid; gap: 12px; }
.em-plan { margin: 0; }
.em-planbtn { display: block; width: 100%; padding: 0; border: 1px solid var(--line, #e2e7ec); border-radius: 8px; background: #fff; overflow: hidden; cursor: zoom-in; min-height: 44px; }
.em-planimg, .em-planpdf { display: block; width: 100%; height: auto; }
.em-planwait { display: block; padding: 14px 10px; }
.em-plan figcaption { margin-top: 4px; font-size: 13px; color: var(--muted, #5b6672); overflow-wrap: anywhere; }
.em-planopen { margin-top: 6px; }
.em-picbody { touch-action: pan-x pan-y; } .em-zoomed .em-picbody { align-items: flex-start; justify-content: flex-start; }
