/* Task Helper — ASSETS: the company's equipment register screen (BRIEF-1287 AS-1; lane ASSETS). Copyright Rapid Surveys Pty Ltd.
 * App tokens only (--bg --card --ink --muted --line --accent --accent-ink --ok --err --hover). Namespaced .as-. Phone first (360 px);
 * the page never scrolls sideways; every tap target ≥ 44 px. */
.as-screen.overlay { display: block; background: var(--bg); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
html.as-open, html.as-open body { overflow: hidden; }
.as-bar { position: sticky; top: 0; z-index: 3; 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; }
.as-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-titles h2 { margin: 0; font-size: 18px; line-height: 1.25; color: #fff; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; outline: none; }
.as-co { font-size: 12px; color: #9aa6b5; overflow-wrap: anywhere; }
.as-back, .as-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: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.as-back { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-x { font-size: 20px; }
.as-back:focus-visible, .as-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.as-wrap { max-width: 980px; margin: 0 auto; padding: 12px 16px 96px; }
.as-msg { margin: 0 0 10px; font-size: 14px; }
.as-msg.err { color: var(--err); } .as-msg.ok { color: var(--ok); }
.as-hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.as-none { color: var(--muted); font-size: 14px; }

.as-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.as-actions:empty { display: none; }
.as-primary, .as-ghost, .as-danger { width: auto; margin: 0; min-height: 44px; padding: 0 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.as-primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.as-ghost { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.as-danger { border: 1px solid var(--err); background: var(--card); color: var(--err); }
.as-primary:disabled, .as-ghost:disabled { opacity: .45; cursor: default; }

/* segments (Register / Mine · List / Tree · the asset's tabs) */
.as-seg { display: flex; gap: 4px; margin: 0 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow-x: auto; scrollbar-width: none; }
.as-seg::-webkit-scrollbar { display: none; }
.as-seg button { flex: 1 0 auto; width: auto; margin: 0; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.as-seg button[aria-selected="true"], .as-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* filters */
.as-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.as-filters input, .as-filters select { flex: 1 1 140px; min-width: 0; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--card); color: var(--ink); box-sizing: border-box; }
.as-filters input[type="search"] { flex-basis: 100%; }

/* the register */
.as-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.as-card { display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 100%; margin: 0; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; font: inherit; min-height: 52px; box-sizing: border-box; }
.as-card:hover { background: var(--hover); }
.as-card-top { display: flex; align-items: flex-start; gap: 8px; }
.as-card-top b { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.as-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.as-where { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.as-wait { font-size: 13px; font-weight: 600; color: #8a5a00; }

.as-chip { flex: none; display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); white-space: nowrap; }
.as-chip.in_service { color: var(--ok); border-color: var(--ok); background: var(--card); }
.as-chip.out_of_service { color: #8a5a00; border-color: #e7c27a; background: #fff6e0; }
.as-chip.lost, .as-chip.damaged, .as-chip.expired { color: var(--err); border-color: var(--err); background: var(--card); }
.as-chip.soon { color: #8a5a00; border-color: #e7c27a; background: #fff6e0; }

/* the tree */
.as-tree, .as-tree ul { list-style: none; margin: 0; padding: 0; }
.as-tree ul { margin-left: 14px; padding-left: 10px; border-left: 2px solid var(--line); }
.as-tree li { margin: 6px 0 0; }
.as-tree details > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.as-tree details > summary::-webkit-details-marker { display: none; }
.as-tw { flex: none; width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); font-size: 14px; }
.as-tree details[open] > summary .as-tw { transform: rotate(90deg); }
.as-tree .as-card { flex: 1; min-width: 0; }
.as-tree .as-leaf { display: flex; align-items: center; gap: 6px; }
.as-tree .as-leaf::before { content: ''; flex: none; width: 44px; }

/* the asset page */
.as-banner { margin: 0 0 12px; padding: 12px; border: 1px solid #e7c27a; border-radius: 12px; background: #fff6e0; color: #5c3d00; font-size: 14px; }
.as-banner .as-actions { margin: 10px 0 0; }
.as-box { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.as-box > h3 { margin: 0 0 8px; font-size: 15px; }
.as-dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.as-dl dt { color: var(--muted); }
.as-dl dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.as-chain { list-style: none; margin: 0 0 10px; padding: 0; font-size: 14px; }
.as-chain li { padding: 4px 0; }
.as-chain li + li::before { content: '↳ '; color: var(--muted); }
.as-link { width: auto; margin: 0; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; cursor: pointer; text-align: left; }
.as-hist { list-style: none; margin: 0; padding: 0; }
.as-hist li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.as-hist li:first-child { border-top: 0; }
.as-hist .as-sub { display: block; margin-top: 2px; }

/* forms + sheets */
.as-row { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; }
.as-f { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px; min-width: 0; font-size: 12px; color: var(--muted); }
.as-f.as-wide { flex-basis: 100%; }
.as-f input, .as-f select, .as-f textarea { width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); box-sizing: border-box; }
.as-f textarea { min-height: 80px; resize: vertical; }
.as-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--ink); cursor: pointer; }
.as-check input { width: 20px; height: 20px; margin: 0; }
.as-sheet-back { position: fixed; inset: 0; z-index: 1100;   /* above the map's Maximise (1000) — a confirm under it was invisible (1303 bug) */ display: flex; align-items: flex-start; justify-content: center; padding: 56px 12px 12px; background: rgba(15, 20, 30, .45); overflow-y: auto; }
.as-sheet { width: 100%; max-width: 520px; padding: 16px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); box-sizing: border-box; }
.as-sheet h3 { margin: 0 0 10px; font-size: 17px; outline: none; }
.as-sheet .as-actions { margin: 14px 0 0; justify-content: flex-end; }
.as-pick { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.as-pick button { display: block; width: 100%; margin: 0 0 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.as-pick button:hover { background: var(--hover); }
.as-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.as-pick button .as-sub { display: block; margin-top: 2px; }   /* the kind / where line under the name, never run on after it */
.as-kinds { list-style: none; margin: 0; padding: 0; }
.as-kinds li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.as-kinds li:first-child { border-top: 0; }
.as-kinds li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.as-banner.as-disputed { border-color: var(--err); background: var(--card); color: var(--ink); }
/* AS-1b: a kind's quick ticks (big, thumb-sized toggles) */
.as-ticks { border: 0; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.as-ticks legend { padding: 0; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.as-tick { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
.as-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.as-tick > span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; }
.as-tick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.as-tick input:checked + span::before { content: '\2713\00a0'; }
.as-tick input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.as-kinds li > span { flex: 1 1 200px; display: flex; flex-direction: column; }
.as-kinds li > span > .as-chip { align-self: flex-start; margin-top: 2px; }
.as-kinds .as-ghost { min-width: 44px; padding: 0 12px; }
.as-marked { background: #fff6e0; transition: background .3s; }
/* AS-5: the scan bar (See · Take · Report damaged — big, thumb-sized) */
.as-scanbar { margin: 0 0 12px; padding: 12px; border: 2px solid var(--accent); border-radius: 12px; background: var(--card); }
.as-scanbar p { margin: 0 0 10px; font-size: 15px; }
.as-scanbtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.as-scanbtns button { min-height: 56px; font-size: 16px; }
/* AS-2: the calibration pill slot (QUALITY's pill inside) */
.as-cal:empty { display: none; }
.as-cal { display: block; }
@media (min-width: 768px) { .as-filters input[type="search"] { flex-basis: 260px; } }
/* P-1 (BRIEF-1297): the prestart checklist editor + doing a prestart (big answer targets for gloved hands on a phone) */
.as-cl { margin: 0 0 12px; padding: 0 0 0 22px; }
.as-cl > li { margin: 0 0 12px; }
.as-cl-t { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 15px; background: var(--card); color: var(--ink); }
.as-cl-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; }
.as-cl-opts .as-ghost { width: auto; min-height: 40px; min-width: 44px; padding: 0 10px; margin: 0; }
.as-cl-opts .as-ghost:first-of-type { margin-left: auto; }
.as-pre-it { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.as-pre-it legend { padding: 0 4px; font-weight: 600; font-size: 15px; }
.as-pre-ans { display: flex; gap: 6px; margin-top: 4px; }
.as-pre-ans label { flex: 1 1 0; position: relative; }
.as-pre-ans input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.as-pre-ans span { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; background: var(--bg); color: var(--ink); }
.as-pre-ans input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.as-pre-ok input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }
.as-pre-fail input:checked + span { background: var(--err); border-color: var(--err); color: #fff; }
.as-pre-na input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.as-pre-why { margin-top: 10px; }
/* P-2: the asset's log boxes (readings · open issues) */
.as-log .as-hist li { position: relative; }
.as-mini { width: auto; min-height: 36px; padding: 0 12px; margin: 6px 0 0; font-size: 14px; }
/* PS-PICK: the + menu's Prestart picker ("What you have" / "Other equipment") */
.as-h { margin: 14px 0 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
html.th-under .as-bar { padding-top: 8px; }   /* BRIEF-1307: under the app's top bar — no safe-area gap needed */
/* the asset page's PATH (Gary 2026-10-16): where it sits, every part tappable, "↑ Up" one tap away */
.as-path { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 10px; }
.as-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 14px; min-width: 0; }
.as-crumb { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.as-crumb-t { color: var(--muted); padding: 0 6px; }
.as-crumb-sep { color: var(--muted); }
.as-crumb-here { padding: 0 6px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.as-up { min-height: 44px; white-space: nowrap; }
/* BRIEF-1309: the label scanner (public/assets/label-scan.js) — a sheet anchored to the top; the camera, a typed box, the answer */
.ls-back { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-start; justify-content: center; padding: 16px; background: rgba(15, 20, 28, .55); overflow: auto; }
.ls-sheet { width: 100%; max-width: 480px; padding: 14px 16px 16px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); box-sizing: border-box; }
.ls-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ls-head h3 { margin: 0; font-size: 18px; }
.ls-x { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.ls-hint { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.ls-cam { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 50vh; border-radius: 10px; overflow: hidden; background: #000; }
.ls-cam[hidden] { display: none; }
.ls-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ls-aim { position: absolute; inset: 22% 12%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); pointer-events: none; }
.ls-line { margin: 8px 0; min-height: 1.2em; font-size: 14px; }
.ls-type { display: flex; align-items: flex-end; gap: 8px; }
.ls-f { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.ls-f input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; color: var(--ink); background: var(--card); }
.ls-type .as-primary { min-height: 44px; }
.ls-out { margin-top: 10px; }
.ls-out .as-actions { margin: 8px 0; }
.ls-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 40vh; overflow: auto; }
.ls-item { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 6px 10px; margin: 0 0 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ls-item:hover, .ls-item:focus-visible { border-color: var(--accent); outline: none; }
.ls-head h3 { flex: 1 1 auto; min-width: 0; } .ls-sheet .ls-x { width: auto; flex: none; }   /* never stretched by a page's global button rule */
/* BRIEF-1316: "Check what's here" + the Missing list (phone first: big tick targets, nested rows indented) */
.as-chip.missing { color: #8a5a00; border-color: #c98a00; border-style: dashed; background: #fff6e0; }
.as-banner.as-missing { border-style: dashed; border-color: #c98a00; }
.as-ck { list-style: none; margin: 0 0 12px; padding: 0; }
.as-ck li { margin: 0 0 6px; padding-left: calc(var(--d, 0) * 18px); }
.as-ckb { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.as-ckb:hover { background: var(--hover); }
.as-ckb[aria-pressed="true"] { border-color: #c98a00; background: #fff6e0; }
.as-ckbox { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 6px; background: var(--card); color: #8a5a00; font-weight: 700; }
.as-ckb[aria-pressed="true"] .as-ckbox { border-color: #c98a00; }
.as-cktx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.as-cktx .as-sub { display: block; margin-top: 2px; }
.as-ckm { flex: none; font-size: 12px; font-weight: 700; color: #8a5a00; }
.as-ckgo { position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
.as-miss .as-mrow { margin-bottom: 10px; }
.as-miss .as-mrow .as-actions { margin: 6px 0 0; }
/* Gary 2026-10-16 asset entry: "What is it?" matches · a new kind in the kind picker · a photo while adding */
.as-what { padding-bottom: 6px; }
.as-sugg { list-style: none; margin: 6px 0 0; padding: 0; }
.as-sugg button { display: block; width: 100%; margin: 0 0 6px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.as-sugg button:hover, .as-sugg button[aria-selected="true"] { background: var(--hover); border-color: var(--accent); }
.as-sugg .as-sub { display: block; margin-top: 2px; }
.as-newkind { margin: 4px 0 8px; padding: 10px 12px; border: 1px dashed var(--accent); border-radius: 10px; background: var(--card); }
.as-newkind .as-actions { margin: 8px 0 4px; }
/* CT-1b (Gary d-ct1..10 = 1): COUNTED assets — the total on a card, the places list with its actions, the Kinds radio */
.as-cnt { flex: none; display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; }
.as-counts { list-style: none; margin: 0; padding: 0; }
.as-crow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.as-crow:last-child { border-bottom: 0; }
.as-cplace { font-size: 15px; overflow-wrap: anywhere; }
.as-crow .as-actions { margin: 0; }
.as-tick.as-off { opacity: .45; }
/* CT-2: a counted line in a check — a number box (big, phone first); amber when fewer than should be there; missing counts on the page */
.as-ckc { cursor: default; flex-wrap: wrap; }
.as-ckc.as-short { border-color: #c98a00; background: #fff6e0; }
.as-ckn { display: flex; flex-direction: column; gap: 2px; flex: none; font-size: 12px; color: var(--muted); }
.as-ckn input { width: 88px; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 17px; text-align: right; background: var(--card); color: var(--ink); box-sizing: border-box; }
.as-cmiss .as-cplace { color: #8a5a00; }
/* NOTE-ASSETDEL: "Delete it…" at the foot of the Status sheet (a quiet red link, never a big button) · QUALITY's reason under a greyed tick */
.as-del { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.as-danger-link { color: var(--err); font-weight: 600; }
.as-tick > span .as-sub { color: inherit; opacity: .8; font-weight: 400; margin-left: 6px; }   /* a note inside a chip reads as its quieter part, never a chip of its own */
.as-ticks .as-why { flex-basis: 100%; margin: -4px 0 0; }   /* QUALITY's reason, on its own line right under the greyed tick */

/* REPLY-SERIAL2: the Serial row's Add… / Change… sits on the value's line (no top margin inside the Details list) */
.as-dl .as-mini { margin: 0 0 0 6px; min-height: 32px; vertical-align: baseline; }
/* BRIEF-J4: on the job-narrowed register, how often each was used there */
.as-card .as-used { color: var(--ink); }

