/* 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: 5; 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); }
