:root {
  color-scheme: light;
  --bg: #f5f7fa; --card: #fff; --text: #0e1726; --muted: #4a5568; --line: #d5dae3;
  --brand: #0fb398; --brand-dark: #0a7d6b; --action: #0a7d6b; --action-btn: #0a7d6b; --action-dark: #086656; --info-bg: #dbe8fd; --info: #1957c2; --go: #1e7a3c; --go-dark: #16602f; --nav: #fff;
  --ok-bg: #d9f2e1; --ok: #1e7a3c; --warn-bg: #fdebc8; --warn: #8a5300; --bad-bg: #f9d6d3; --bad: #8c1d17; --gray-bg: #e6e9ef; --gray: #4a5366;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1726; --card: #172338; --text: #e8ecf3; --muted: #9aa7bd; --line: #2a3750; --brand: #3df5c8; --brand-dark: #0fb398; --action: #3df5c8; --action-btn: #0a7d6b; --action-dark: #086656; --info-bg: #1f3a66; --info: #a9c8ff; --go: #2f9e57; --go-dark: #26834a; --nav: #111c2f;
    --ok-bg: #1f4a31; --ok: #8be0a8; --warn-bg: #54400f; --warn: #f4cd7a; --bad-bg: #5a2420; --bad: #f4a29b; --gray-bg: #3a4152; --gray: #c3c9d6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1726; --card: #172338; --text: #e8ecf3; --muted: #9aa7bd; --line: #2a3750; --brand: #3df5c8; --brand-dark: #0fb398; --action: #3df5c8; --action-btn: #0a7d6b; --action-dark: #086656; --info-bg: #1f3a66; --info: #a9c8ff; --go: #2f9e57; --go-dark: #26834a; --nav: #111c2f;
  --ok-bg: #1f4a31; --ok: #8be0a8; --warn-bg: #54400f; --warn: #f4cd7a; --bad-bg: #5a2420; --bad: #f4a29b; --gray-bg: #3a4152; --gray: #c3c9d6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--action); }
h1 { margin: 8px 0 16px; font-size: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
h2 { margin: 0 0 10px; font-size: 1.15rem; }
h3 { margin: 14px 0 2px; font-size: 1rem; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }

nav { background: var(--nav); border-bottom: 3px solid var(--brand); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding: 8px 16px; }
nav .logo { font-weight: 700; margin-right: 8px; }
nav a { text-decoration: none; color: var(--text); padding: 6px 4px; }
nav a:hover { color: var(--action); }
nav a.current, .menu summary.current { color: var(--action); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
nav .spacer { flex: 1; }
nav form { margin: 0; }
.menu { position: relative; }
.menu summary { cursor: pointer; padding: 6px 4px; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu div { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.menu div a { display: block; padding: 6px 10px; }

.links { display: contents; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-left: auto; cursor: pointer; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 1px; }
@media (max-width: 1000px) {
  .burger { display: inline-flex; }
  .links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-top: 6px; }
  nav.open .links { display: flex; }
  .links > a, .menu summary { padding: 12px 6px; border-top: 1px solid var(--line); }
  .links .spacer { display: none; }
  .links > form, .links > button { margin-top: 8px; }
  .menu div { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .menu div a { padding: 10px 6px; }
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
a.card { color: var(--text); text-decoration: none; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid .card { margin-bottom: 0; }
.two-col { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.stat { text-align: center; } .stat b { display: block; font-size: 2rem; }
.choice { display: flex; flex-direction: column; gap: 6px; } .choice:hover { border-color: var(--action); }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 120px; padding: 10px 12px; border-radius: 10px; background: #0b0d12; color: #fff; text-decoration: none; border: 1px solid var(--line); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.tile:hover { border-color: var(--action); }
.tile-name, .tile-count { position: relative; text-shadow: 0 1px 4px rgba(0,0,0,.9); font-weight: 600; }
.tile-attn { position: relative; align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: .8rem; font-weight: 600; text-shadow: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
td.actions { white-space: nowrap; }
.thumb { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 6px; }
.detail-img { float: right; max-width: 220px; max-height: 200px; margin: 0 0 8px 16px; background: #fff; border-radius: 8px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }

label { display: block; font-weight: 600; margin: 10px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
small { display: block; }
button, .btn { display: inline-block; padding: 10px 16px; font: inherit; font-weight: 600; color: #fff; background: var(--action-btn); border: 0; border-radius: 6px; cursor: pointer; text-decoration: none; line-height: 1.2; }
button:hover, .btn:hover { background: var(--action-dark); }
.btn.secondary, button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover, button.secondary:hover { border-color: var(--action); color: var(--action); background: transparent; }
/* the next step in a process is green; things that end or undo the work are outlined in red */
button.next, .btn.next { background: var(--go); color: #fff; border: 0; }
button.next:hover, .btn.next:hover { background: var(--go-dark); color: #fff; border: 0; }
button.secondary.danger, .btn.secondary.danger { color: var(--bad); border-color: var(--bad); }
button.secondary.danger:hover, .btn.secondary.danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.steps .steplabel { min-width: 7.5rem; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.waiting { color: var(--muted); }
.kcard .knext { margin-top: 6px; width: 100%; }
.btn.small, button.small { padding: 4px 10px; font-size: .85rem; }
form.inline { display: inline; margin: 0; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.inline-row select { width: auto; }

.filters { display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; }
.filters.wide { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }
.filters.add { grid-template-columns: 1fr auto; }
.filters.move { grid-template-columns: 1fr 1fr auto; }
.row { display: grid; gap: 4px 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row .full { grid-column: 1 / -1; }
.pager { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--gray-bg); color: var(--gray); white-space: nowrap; }
.badge.in_service, .badge.closed, .badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.in_repair, .badge.in_research, .badge.committee_review, .badge.trial, .badge.findings, .badge.returned, .badge.awaiting_parts, .badge.ordered, .badge.received, .badge.ready_for_pickup { background: var(--warn-bg); color: var(--warn); }
.badge.out_of_service, .badge.not_approved, .badge.denied { background: var(--bad-bg); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; margin: 0 6px 6px 0; border: 1px solid var(--line); border-radius: 99px; }
.chip small { display: inline; }
.chip-x { padding: 0 4px; background: none; color: var(--muted); font-size: 1rem; }
.chip-x:hover { background: none; color: var(--action); }

.timeline { list-style: none; margin: 0 0 12px; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { margin: 0 0 12px; }
.flash { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.error { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.muted { color: var(--muted); }
.login { max-width: 380px; margin: 10vh auto; }
@media (max-width: 760px) { .filters, .filters.move, .filters.wide { grid-template-columns: 1fr; } .detail-img { float: none; display: block; margin: 0 0 12px; } .facts { grid-template-columns: 1fr; } }

button.variant { margin: 0 6px 6px 0; }
button.variant.chosen { outline: 3px solid var(--action); }

/* checkbox lists (distribution lists on a ticket, list members) */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .25rem .75rem; max-height: 16rem; overflow: auto; padding: .25rem 0; }
.checklist .check { margin: 0; }

.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.gal { height: 110px; max-width: 200px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid #8884; }
.labels { display: flex; flex-wrap: wrap; gap: 8px; }
.label { display: flex; gap: 8px; align-items: center; width: 3.6in; border: 1px solid #8886; border-radius: 6px; padding: 6px; background: #fff; color: #000; break-inside: avoid; font-size: 12px; }
.label .qr { width: 1.2in; flex: none; }
.label .qr svg { width: 100%; height: auto; display: block; }
.label small { word-break: break-all; font-size: 9px; }
@media print { nav, .noprint, .flash, footer { display: none !important; } body { background: #fff; } .label { border-color: #000; } }
.warn { background: var(--warn-bg, #fff4d6); color: var(--warn, #7a5200); }

nav .logo { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.nav-logo { height: 30px; width: auto; max-width: 90px; object-fit: contain; }
.login-logo { text-align: center; margin: 0 0 8px; }
.login-logo img { max-height: 120px; max-width: 100%; }
.brand-preview { max-height: 160px; max-width: 100%; background: repeating-conic-gradient(#8883 0% 25%, transparent 0% 50%) 50% / 16px 16px; }

/* ---------- kanban boards ---------- */
.viewtoggle { display: flex; gap: 6px; margin: 0 0 12px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.kcol { flex: 0 0 250px; background: var(--gray-bg); border: 2px solid transparent; border-radius: 10px; padding: 8px; min-height: 140px; }
.kcol h2 { font-size: 0.95rem; margin: 2px 4px 8px; display: flex; justify-content: space-between; }
.kcount { color: var(--muted); font-weight: normal; }
.kcol.kdone { opacity: 0.85; }
.kcol.kok { border-color: var(--ok); }
.kcol.kno { border-color: var(--bad); }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.kcard[draggable="true"] { cursor: grab; }
.kcard.kdrag { opacity: 0.5; }
.knum { font-weight: 600; margin-right: 6px; }
.ktitle { margin: 2px 0 4px; overflow-wrap: anywhere; }
.kmeta { font-size: 0.82rem; color: var(--muted); }
.kmeta.warn { color: var(--warn); font-weight: 600; }
.kmeta.bad { color: var(--bad); font-weight: 600; }
.kmove { display: flex; gap: 4px; margin-top: 6px; }
.kmove select { flex: 1; min-width: 0; }
.kempty { margin: 6px 4px; }

/* ---------- RD&I stage tracker ---------- */
.stages { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: stage; }
.stages li { counter-increment: stage; padding: 6px 12px; border-radius: 999px; background: var(--gray-bg); color: var(--gray); font-size: 0.88rem; }
.stages li::before { content: counter(stage) ". "; }
.stages li.done { background: var(--ok-bg); color: var(--ok); }
.stages li.now { background: var(--action-btn); color: #fff; font-weight: 600; }

.evalsheet { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.evalsheet h3 { margin: 2px 0 6px; }
.approval { border-top: 1px solid var(--line); padding: 6px 0; }
.approval h3 { margin: 4px 0; }
.scanbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
.catchips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0 0 16px; }
.catchips > .muted { margin-right: 10px; }
a.catchip { color: var(--text); text-decoration: none; padding: 4px 12px; }
a.catchip:hover { border-color: var(--action); color: var(--action); }
.chip-attn { display: inline-block; min-width: 1.3em; padding: 0 6px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: .8rem; text-align: center; }
.kindtabs { display: flex; gap: 6px; margin: 0 0 12px; }
.sublist { list-style: none; margin: 0 0 12px; padding: 0; }
.sublist li { padding: 6px 0; border-top: 1px solid var(--line, #e3e5e8); }
.sublist li:first-child { border-top: 0; }
.info { position: relative; display: inline-block; margin-left: 6px; cursor: help; color: var(--action); font-weight: 700; }
[data-tip]:not([data-tip=""]) { cursor: help; }
.badge[data-tip]:not([data-tip=""]) { text-decoration: underline dotted; text-underline-offset: 3px; }
.tipbox { position: fixed; z-index: 1000; max-width: min(320px, 86vw); padding: 8px 10px; border-radius: 8px; background: var(--nav, #232836);
  color: #fff; font-size: .85rem; font-weight: 400; line-height: 1.35; box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: none; }
.info[hidden] { display: none; }

/* bag inspection: big touch targets for answering with gloves on */
.answers { border: 1px solid var(--line, #ccc); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.answers legend { font-weight: 600; padding: 0 6px; }
.answers label { display: inline-flex; align-items: center; gap: 8px; margin-right: 22px; padding: 8px 4px; font-size: 1.05rem; }
.answers input[type=radio] { width: 22px; height: 22px; }

.video { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.video summary { cursor: pointer; font-weight: 600; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 10px 0; background: #000; border-radius: 6px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Find box and scan buttons */
.findbox { margin: 0; }
.findbox input { width: 11rem; padding: 6px 10px; }
.findbox.mob { display: none; }
.scanfield { display: flex; align-items: stretch; gap: 6px; }
.scanfield input { flex: 1; min-width: 0; }
.scanbtn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; cursor: pointer; display: inline-flex; align-items: center; }
.scanbtn:hover { color: var(--action); border-color: var(--action); }
.scanmodal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.88); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.scanmodal video { width: 100%; max-width: 520px; max-height: 60vh; border-radius: 10px; background: #000; }
.scanmodal .scanmsg { margin: 0; text-align: center; }
.findicon { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-left: auto; cursor: pointer; color: var(--text); align-items: center; }
.findicon .ico, .findicon svg { width: 22px; height: 22px; }
.findicon + .burger { margin-left: 8px; }
nav.finding .findicon { color: var(--action); border-color: var(--action); }
.findbox { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); min-width: 16rem; }
.suggest a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.suggest a:hover, .suggest a:focus { background: var(--bg); }
.suggest small { display: block; color: var(--muted); }
.suggest .none { padding: 8px 10px; color: var(--muted); }
.desk-only { display: inline-block; } .mob-only { display: none; }
.toolsmenu { margin: 0 0 10px; } .toolsmenu summary { cursor: pointer; display: inline-block; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.toolsmenu .toolsbody { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.catselect { display: none; }
@media (max-width: 700px) {
  .desk-only { display: none !important; } .mob-only { display: block; }
  .catchips { display: none !important; } .catselect { display: block; margin: 8px 0; }
  .catselect select { width: 100%; }
}
@media (max-width: 1000px) {
  .findicon { display: inline-flex; }
  .findbox.desk { display: none; }
  .findbox.mob { display: none; flex-basis: 100%; order: 5; }
  nav.finding .findbox.mob { display: block; }
  .findbox.mob .scanfield { width: 100%; }
  .findbox.mob input { width: 100%; }
}

.invtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; border-bottom: 2px solid var(--line, #e3e5e8); }
.invtabs a { padding: 8px 16px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--text); text-decoration: none; font-weight: 600; }
.invtabs a .muted { display: none; font-weight: 400; font-size: .8rem; }
.invtabs a:hover { color: var(--action); }
.invtabs a.on { border-bottom-color: var(--action); color: var(--action); }
@media (min-width: 700px) { .invtabs a .muted { display: inline; margin-left: 6px; } }

.stat.sev-urgent { border-color: var(--bad, #c0392b); border-left-width: 5px; }
.stat.sev-urgent b { color: var(--bad, #c0392b); }
.stat.sev-warn { border-left: 5px solid var(--warn, #b7791f); }
.stat.sev-warn b { color: var(--warn, #b7791f); }
.stat.sev-zero { opacity: .55; }
.stat.sev-zero b { color: var(--muted, #888); font-weight: 500; }
.stat.sev-zero:hover { opacity: 1; }

/* Red (the brand colour) marks the one main action on a page. Filter buttons and buttons inside table rows are neutral. */
.filters button, td .btn:not(.next), td button:not(.next), .table-wrap .btn:not(.next), .table-wrap button:not(.next) {
  background: transparent; color: var(--text); border: 1px solid var(--line); }
.filters button:hover, td .btn:not(.next):hover, td button:not(.next):hover, .table-wrap .btn:not(.next):hover, .table-wrap button:not(.next):hover {
  background: transparent; color: var(--action); border-color: var(--action); }
td button.danger, td .btn.danger, .table-wrap button.danger { color: var(--bad); border-color: var(--bad); }

.photostrip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.photostrip img.thumb { height: 90px; width: auto; max-width: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

h2.fsec { font-size: 1.05rem; margin: 22px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
form h2.fsec:first-of-type { margin-top: 4px; }
label.check { flex-wrap: wrap; line-height: 1.35; }

.crumbs { font-size: .85rem; margin: 0 0 6px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--action); text-decoration: underline; }
.narrow { max-width: 820px; }
.ico { display: none; }
@media (max-width: 1000px) { .links .ico { display: inline-block; width: 1.6em; text-align: center; opacity: .75; } }

.viewbar{background:#f6c343;color:#201600;padding:.5rem 1rem;display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;font-size:.95rem;position:sticky;top:0;z-index:50}
.viewbar form{margin:0}.viewbar a{color:#201600;text-decoration:underline}

/* Busy feedback: after a click on a submit button or a link, the button dims, shows a spinner, and a bar runs across the top. */
.busybar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--action); z-index: 1000; opacity: 0; }
.busybar.on { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1,.7,.2,1); }
button.busy { opacity: .7; cursor: progress; pointer-events: none; }
button.busy::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .5em; vertical-align: -.1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busyspin .7s linear infinite; }
@keyframes busyspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.busy::after { animation: none; } .busybar.on { transition: none; } }

tr.group th { background: var(--gray-bg); color: var(--text); text-align: left; text-transform: none; font-size: .95rem; }

.locpick { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.locpick select { flex: 1 1 8rem; min-width: 8rem; max-width: 100%; }
.placelist td, .placerows td { vertical-align: top; }
.placelist .right { text-align: right; }
ul.plain { list-style: none; margin: .3rem 0 0; padding: 0; }
details summary { cursor: pointer; font-size: .85rem; color: var(--muted, #666); }

.placelist th.num, .placelist td.num { text-align: right; width: 6rem; }

.walkbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.walkbar .walknav { display: flex; flex-wrap: wrap; gap: .4rem; }
ol.stoplist { margin: .5rem 0 0; padding-left: 1.4rem; }
ol.stoplist li { padding: 2px 0; }
ol.stoplist li.done a { color: var(--muted, #666); }

/* Folded sections and "add" forms that stay out of the way until asked for */
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--muted, #6b7280); transition: transform .15s; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h2 { display: inline; margin: 0; }
details.addform { margin-top: .75rem; }
details.addform > summary { display: inline-block; cursor: pointer; list-style: none; }
details.addform > summary::-webkit-details-marker { display: none; }
details.addform[open] > summary { margin-bottom: .75rem; }
details.fold > summary h2 { font-size: 1.05rem; color: inherit; white-space: nowrap; }
details.fold > summary h2 small { display: inline; margin-left: .35rem; }

/* Setup menu groups */
.menu .menuhead { display: block; padding: .5rem .9rem .15rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b7280); }
.menu .menuhead:not(:first-child) { border-top: 1px solid var(--line, #e5e7eb); margin-top: .35rem; }

.locbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.locbar label { margin: 0; }
.locbar select { width: auto; max-width: 100%; }
h2.sect { margin: 1rem 0 .5rem; font-size: 1.05rem; }
.allclear { padding: .9rem 1.1rem; }
details.quiet { margin: .75rem 0 1rem; }
details.quiet summary { cursor: pointer; }

/* Phones: tables become stacked cards, filters fold, buttons are easy to hit */
@media (max-width: 700px) {
  table.cards, table.cards tbody { display: block; }
  table.cards tr:first-child:has(th) { display: none; }
  table.cards tr { display: block; border: 1px solid var(--line); border-left: 5px solid var(--action-btn); border-radius: 10px; margin: 0 0 16px; padding: 8px 12px; background: var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
  table.cards tr:last-child { margin-bottom: 0; }
  table.cards td + td { border-top: 1px solid var(--line); }
  table.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 5px 0; text-align: right; }
  table.cards td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; text-align: left; flex: 0 0 38%; }
  table.cards td:not([data-label])::before { content: none; }
  table.cards td.actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; }
  .table-wrap:has(table.cards) { overflow-x: visible; }
  table.cards td.emptycell { display: block; text-align: center; }
  table.cards td.emptycell::before { content: none; }
  .btn.small, button.small { padding: 10px 14px; font-size: .95rem; min-height: 44px; }
  details.filterwrap { margin-bottom: 12px; }
  details.filterwrap > summary { list-style: none; cursor: pointer; }
  details.filterwrap > summary::-webkit-details-marker { display: none; }
  details.filterwrap[open] > summary { margin-bottom: 8px; }
  nav .links > a, .menu summary { min-height: 44px; }
}
button.secondary.danger::before, .btn.secondary.danger::before { content: "⚠ "; }

.stickybar { position: sticky; top: 0; z-index: 3; }
.catchips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (max-width: 700px) { .catchips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; } .catchips .chip { white-space: nowrap; flex: 0 0 auto; } }
.locbar input { width: auto; flex: 1 1 12rem; }

/* place page action bar */
.actionbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 .8rem; }
.actionbar form { margin: 0; }
.actionbar form.inline { display: inline-flex; width: auto; flex: 0 0 auto; }
.actionbar .btn, .actionbar button { white-space: nowrap; }

/* tabs on a place page: scroll sideways on a phone */
.placetabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 2px solid var(--line, #e3e5e8); overflow-x: auto; white-space: nowrap; }
.placetabs a { padding: 8px 14px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--text); text-decoration: none; font-weight: 600; }
.placetabs a:hover { color: var(--action); }
.placetabs a.on { border-bottom-color: var(--action); color: var(--action); }
nav.placetabs { flex-wrap: nowrap; background: transparent; padding: 0; overflow-x: auto; }
nav.placetabs a { flex: 0 0 auto; }
@media (max-width: 700px) { nav.placetabs a { padding: 8px 9px; font-size: .95rem; } }

/* ---------- status colours: green = ready/OK, amber = due or in progress, red = overdue/out/danger, blue = information, grey = inactive.
   Every colour also carries an icon and a word, so it does not depend on seeing colour. ---------- */
.badge.ok, .badge.good { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .badge.due { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .badge.overdue { background: var(--bad-bg); color: var(--bad); }
.badge.info, .badge.submitted { background: var(--info-bg); color: var(--info); }
.badge::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: .35em; vertical-align: -.17em; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E"); }
.badge.in_service, .badge.closed, .badge.approved, .badge.ok, .badge.good { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E"); }
.badge.in_repair, .badge.in_research, .badge.committee_review, .badge.trial, .badge.findings, .badge.returned, .badge.awaiting_parts, .badge.ordered,
.badge.received, .badge.ready_for_pickup, .badge.warn, .badge.due { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6.5V12l3.5 2'/%3E%3C/svg%3E"); }
.badge.out_of_service, .badge.not_approved, .badge.denied, .badge.bad, .badge.overdue { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M15 9l-6 6M9 9l6 6'/%3E%3C/svg%3E"); }
.badge.info, .badge.submitted { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 11v5M12 7.5v.5'/%3E%3C/svg%3E"); }
.badge.number::before { content: none; }

/* ---------- icons ---------- */
svg.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
svg.i.lg { width: 2rem; height: 2rem; }
nav .links > a svg.i, nav .menu summary svg.i { margin-right: 6px; opacity: .8; }
nav .links > a.current svg.i, nav .menu summary.current svg.i, nav .links > a:hover svg.i { opacity: 1; }
nav .menu summary { display: flex; align-items: center; }

/* ---------- category colours: .cat-<colour> sets --cat (the colour) and --cat-ink (text on it). Used by tiles, chips and dots. ---------- */
.cat-blue { --cat: #1d5fd1; --cat-ink: #fff; }
.cat-sky { --cat: #0b79b0; --cat-ink: #fff; }
.cat-teal { --cat: #0f766e; --cat-ink: #fff; }
.cat-green { --cat: #1f7a3d; --cat-ink: #fff; }
.cat-yellow { --cat: #f2c200; --cat-ink: #1d2330; }
.cat-orange { --cat: #d9600b; --cat-ink: #fff; }
.cat-red { --cat: #b3261e; --cat-ink: #fff; }
.cat-pink { --cat: #c2185b; --cat-ink: #fff; }
.cat-purple { --cat: #6d3fc0; --cat-ink: #fff; }
.cat-indigo { --cat: #3f4fb5; --cat-ink: #fff; }
.cat-brown { --cat: #7a4a21; --cat-ink: #fff; }
.cat-slate { --cat: #4a5568; --cat-ink: #fff; }
.cattiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); margin-bottom: 18px; }
.cattile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 124px; padding: 14px 14px 12px; border-radius: 14px;
  background: var(--cat); color: var(--cat-ink); text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .12s, box-shadow .12s; }
.cattile:hover, .cattile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.28); }
.cattile svg.i.lg { width: 2.4rem; height: 2.4rem; stroke-width: 1.8; margin-bottom: 4px; }
.cattile b { font-size: 1.05rem; line-height: 1.2; }
.cattile small { opacity: .92; }
.cattile .cat-attn { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: #fff; color: #7a3d00; font-size: .8rem; font-weight: 700; }
.cattile .cat-attn svg.i { width: 1em; height: 1em; }
a.catchip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--cat); }
a.catchip svg.i { color: var(--cat); }
a.catchip.on { background: var(--cat); color: var(--cat-ink); border-color: var(--cat); }
a.catchip.on svg.i { color: var(--cat-ink); }
.catdot { display: inline-block; width: .7em; height: .7em; margin-right: .45em; border-radius: 50%; background: var(--cat); vertical-align: .05em; }
.catbadge { display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; border-radius: 8px; background: var(--cat); color: var(--cat-ink); vertical-align: middle; }
.catbadge svg.i { width: 1.15em; height: 1.15em; margin: 0; }
@media (max-width: 700px) {
  .cattiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cattile { min-height: 108px; padding: 12px; }
  .cattile b { font-size: .98rem; }
}

/* ---------- ready light: a coloured edge on the row, matching the badge ---------- */
tr.rowstat td:first-child { box-shadow: inset 5px 0 0 var(--rowc, transparent); }
tr.rowstat.ok { --rowc: var(--ok); }
tr.rowstat.bad { --rowc: var(--bad); }
tr.rowstat.neutral { --rowc: var(--line); }
td svg.i, h1 svg.i { color: var(--muted); }
h1 svg.i.lg { width: 1.4em; height: 1.4em; }

/* ---------- large buttons: on a touch screen wider than a phone (a wall or truck tablet, or gloves) buttons, text, tabs and tick boxes get bigger by themselves. No setting. ---------- */
@media (pointer: coarse) and (min-width: 700px) {
  body { font-size: 18px; }
  button, .btn { min-height: 52px; padding: 12px 20px; font-size: 1.05rem; }
  .btn.small, button.small { min-height: 48px; padding: 10px 16px; font-size: 1rem; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 52px; font-size: 1.05rem; }
  input[type=checkbox], input[type=radio] { width: 28px; height: 28px; }
  nav .links > a, .menu summary { min-height: 52px; display: inline-flex; align-items: center; }
  .invtabs a, .placetabs a { padding: 14px 20px; }
  th, td { padding: 12px 10px; }
  a.catchip { padding: 10px 16px; }
  .cattile { min-height: 150px; }
  .answers label { padding: 12px 6px; font-size: 1.15rem; }
  .answers input[type=radio] { width: 32px; height: 32px; }
  .badge { font-size: .95rem; padding: 4px 12px; }
}

.bigsearch { display: flex; gap: 8px; margin: 0 0 6px; }
.bigsearch input { flex: 1; min-width: 0; font-size: 1.15rem; padding: 14px 16px; }
.bs-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; padding: 6px 10px; font-size: .8rem; }
.bs-btn svg.i { width: 1.5em; height: 1.5em; }
.bs-msg { margin: 0 0 10px; min-height: 1.2em; }
.showbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }

.homebtn { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin: 0 0 14px; border-radius: 12px; background: var(--action-btn, var(--action)); color: #fff; text-decoration: none; }
.homebtn b { display: block; font-size: 1.5rem; }
.homebtn small { opacity: .85; font-size: .85rem; }
.homebtn .go { margin-left: auto; font-weight: 600; }
.homebtn svg.i { color: #fff; }
.homebtn:hover { filter: brightness(1.08); }
.placetiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.placetile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; text-align: center; }
.placetile b { font-size: 1.25rem; }
.placetile small { color: var(--muted); }
.placetile svg.i { color: var(--action); }
.placetile:hover { border-color: var(--action); box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.jump { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jump input { max-width: 14rem; }

.strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.strip .badge { font-size: 1rem; padding: 4px 12px; }

.rowstat.warn { --rowc: var(--warn, #b45309); }
.rowstat.info { --rowc: var(--info, #2563eb); }
.card.empty { text-align: center; padding: 28px 16px; }
.card.empty svg.i { width: 1.6em; height: 1.6em; color: var(--ok); vertical-align: middle; }
details.card > summary { cursor: pointer; padding: 4px 0; }
.countcard h2 small { display: inline; font-weight: 400; margin: 0 6px; }

.bigsearch.plain select { max-width: 16rem; }
.strip a.badge { text-decoration: none; }
.strip a.badge.on { outline: 2px solid var(--action); }
tr.grouphead td { background: var(--card); padding-top: 14px; border-bottom: 0; }
tr.sizerow td:first-child { padding-left: 2.2rem; }
tr.grouphead small { display: inline; }

details.morefilters { margin: 0 0 12px; }
details.morefilters > summary { cursor: pointer; color: var(--action); font-weight: 600; padding: 4px 0; }
td.emptycell { text-align: center; padding: 24px 12px; }
td.emptycell svg.i { width: 1.6em; height: 1.6em; color: var(--muted); vertical-align: middle; }

.kcol { border-top: 5px solid var(--line); }
.kcol.ktone-info { border-top-color: var(--info, #2563eb); }
.kcol.ktone-warn { border-top-color: var(--warn); }
.kcol.ktone-ok { border-top-color: var(--ok); }
.kcol.ktone-bad { border-top-color: var(--bad); }
.kcard { border-left: 5px solid var(--line); }
.kcard.kwarn { border-left-color: var(--warn); }
.kcard.kbad { border-left-color: var(--bad); }

/* the "Show:" bars: plain pill links, the chosen one filled */
.showbar a.chip { color: var(--text); text-decoration: none; padding: 4px 12px; margin: 0; }
.showbar a.chip:hover { border-color: var(--action); color: var(--action); }
.showbar a.chip.on { background: var(--action); color: #fff; border-color: var(--action); }
.showbar a.chip.on svg.i { color: #fff; }

/* Setup menu: wide enough that "Duplicate supplies" and "Places and people" stay on one line */
.menu div { min-width: 230px; }
.menu div a { white-space: nowrap; }

/* daily apparatus check: one row per line, big Pass / Fail buttons */
.dline { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dline:last-child { border-bottom: 0; }
.dline.dfail { background: var(--bad-bg); }
.dtext { flex: 1 1 18rem; }
.dans { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dans label { margin: 0; }
.dpass, .dfailb { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; min-height: 44px; }
.dpass:has(input:checked) { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.dfailb:has(input:checked) { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.dpass input, .dfailb input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dpass:focus-within, .dfailb:focus-within { outline: 2px solid var(--action); }
.dnote { width: 12rem; }
.today .tline { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.today .tline:last-child { border-bottom: 0; }
.easy { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.easy a.btn { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; }
.dfailpanel { display: none; flex: 1 1 100%; padding: 8px 0 4px; }
.dline:has(input[value=fail]:checked) .dfailpanel { display: block; }
.dfailpanel input:not([type=file]) { width: 100%; max-width: 40rem; }
.dphotos { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.dphoto { display: inline-flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dphoto img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.dseen { background: var(--info-bg, var(--card)); border-left: 4px solid var(--info, #2563eb); padding: 6px 10px; border-radius: 6px; }
.dthumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin: 4px 4px 0 0; }

/* dashboard: station switcher and the big inspection boxes */
.stationbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.stationbar label { margin: 0; font-weight: 600; }
.stationbar select { min-width: 12rem; }
.bigtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.bigtile { border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.bigtile.bt-ok { border-left-color: var(--ok); }
.bigtile.bt-warn { border-left-color: var(--warn); }
.bigtile.bt-bad { border-left-color: var(--bad); }
.bigtile.bt-info { border-left-color: var(--info, #2563eb); }
.bt-top { display: flex; gap: 10px; align-items: center; }
.bt-top b { font-size: 1.15rem; display: block; }
.bt-top small { display: block; color: var(--muted); }
.bigtile .badge { align-self: flex-start; }
.bigtile form { margin: 0; }
.bt-go { width: 100%; min-height: 48px; font-size: 1.05rem; text-align: center; justify-content: center; margin-top: auto; }
.stationbar select { width: auto; flex: 0 1 20rem; } .stationbar label { display: inline; }

/* phones: nothing should push the page wider than the screen */
form.inline-row { flex-wrap: wrap; max-width: 100%; }
form.inline-row select, form.inline-row input { max-width: 100%; }
small.muted { overflow-wrap: anywhere; }
@media (max-width: 700px) { td, th { overflow-wrap: anywhere; } td.actions { white-space: normal; } }
.table-wrap + .bigtiles{margin-top:1rem}
.callout{padding:.6rem .8rem;border-radius:8px;border-left:4px solid var(--muted,#888);background:var(--card-alt,rgba(128,128,128,.1))}
.callout.bad{border-left-color:var(--bad);background:var(--bad-bg);color:var(--bad)}
.bs-btn[hidden] { display: none !important; }

/* Inspections: one card per job, with a big button */
.taskcards { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.taskcard { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--rowc, var(--line)); border-radius: 10px; padding: 12px 14px; }
.taskcard.bad { --rowc: var(--bad); } .taskcard.warn { --rowc: var(--warn, #b45309); } .taskcard.info { --rowc: var(--info, #2563eb); } .taskcard.neutral { --rowc: var(--line); }
.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tc-where { font-size: 1.15rem; } .tc-what { font-weight: 600; } .tc-path { overflow-wrap: anywhere; }
.tc-act form { margin: 0; }
.btn.big, button.big { min-height: 50px; padding: 10px 22px; font-size: 1.1rem; font-weight: 700; }
button.big { background: var(--action); color: #fff; border-color: var(--action); }
.btn.big.secondary { background: var(--card); color: var(--text); }
@media (max-width: 700px) { .taskcard { flex-direction: column; align-items: stretch; } .tc-act .btn, .tc-act button { width: 100%; text-align: center; } }

.myprofile { display: inline-flex; align-items: center; gap: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } .facts dt { color: var(--muted); } .facts dd { margin: 0; }
td form select, td form input[type=text] { max-width: 100%; }
.locpick .locfind { flex: 1 1 100%; }

/* Top bar stays put; on phones the main buttons sit in a bar at the bottom of the screen */
nav.topnav { position: sticky; top: 0; z-index: 50; }
.whoami { display: none; width: 38px; height: 38px; border-radius: 50%; background: var(--action); color: #fff !important; align-items: center; justify-content: center; font-weight: 700; padding: 0 !important; text-decoration: none; }
.menuwho { display: none; }
.tabbar { display: none; }
@media (max-width: 1000px) {
  .whoami { display: inline-flex; margin-left: 8px; }
  nav.topnav .burger { display: none; }
  nav.topnav .findicon + .whoami { margin-left: 8px; }
  body { padding-bottom: 78px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--nav); border-top: 2px solid var(--line); padding: 4px 4px max(4px, env(safe-area-inset-bottom)); gap: 2px; }
  .tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px; margin: 0; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: .78rem; font-weight: 600; text-decoration: none; cursor: pointer; }
  .tabbar svg.i { width: 26px; height: 26px; margin: 0; }
  .tabbar a.current, nav.topnav.open ~ .tabbar .tabmore { color: var(--action); background: var(--card); text-decoration: none; }
  nav.topnav.open .links { position: fixed; left: 0; right: 0; bottom: 84px; top: auto; max-height: 72vh; overflow-y: auto; z-index: 60; background: var(--nav); border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 8px 14px; box-shadow: 0 -8px 24px rgba(0,0,0,.35); }
  .menuwho { display: flex; align-items: center; gap: 10px; padding: 10px 6px; }
  .menuwho span { display: flex; flex-direction: column; } .menuwho small { color: var(--muted); }
  .links > a.menuwho { border-top: 0; }
}
@media print { .tabbar, .whoami { display: none !important; } body { padding-bottom: 0; } nav.topnav { position: static; } }

/* ---------- the use log form: big tiles to tap ---------- */
.picks { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.picks.small { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.pick { position: relative; display: block; margin: 0; cursor: pointer; }
.pick input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pick > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; min-height: 84px; padding: 10px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--card, #fff); }
.pick small { color: var(--muted); font-size: .75rem; }
.pick input:checked + span { border-color: var(--action); background: color-mix(in srgb, var(--action) 12%, transparent); box-shadow: 0 0 0 1px var(--action); }
.pick input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 2px; }
.pick.res-ok input:checked + span { border-color: var(--ok, #1a7f37); box-shadow: 0 0 0 1px var(--ok, #1a7f37); }
.pick.res-warn input:checked + span { border-color: var(--warn, #b26a00); box-shadow: 0 0 0 1px var(--warn, #b26a00); }
.pick.res-bad input:checked + span { border-color: var(--bad, #b3261e); box-shadow: 0 0 0 1px var(--bad, #b3261e); }
.uselog button.big { font-size: 1.1rem; padding: 14px 28px; }

.backbtn { display: inline-block; margin: 0 0 12px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); text-decoration: none; font-weight: 600; }
.backbtn:hover { border-color: var(--action-btn); }
@media print { .backbtn { display: none; } }
.bigsearch { position: relative; }
.bigsearch .suggest { top: calc(100% + 2px); }
.itembar { display: none; }
@media (max-width: 1000px) {
  .itembar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 78px; z-index: 54; padding: 8px 12px; background: var(--nav); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(0,0,0,.25); }
  .itembar .btn { flex: 1 1 0; text-align: center; font-size: 1.1rem; padding: 14px 10px; margin: 0; }
  body.hasitembar { padding-bottom: 150px; }
}
@media print { .itembar { display: none !important; } }
.picks.results { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.picks.results .pick > span { height: 100%; min-height: 96px; }
@media (max-width: 600px) {
  .picks.results { grid-template-columns: 1fr; }
  .picks.results .pick > span { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 64px; padding: 10px 14px; text-align: left; }
}
.itemhead { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--action-btn); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.itemhead .backbtn { margin: 0; flex: none; }
.itemhead .eid { font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.itemhead .ptitle { font-weight: 600; }
.itemhead .where { color: var(--muted); font-size: .9rem; }
.lastline { margin: 0 0 6px; }
.savebar { display: flex; gap: 10px; margin: 16px 0; }
@media (max-width: 1000px) {
  .savebar { position: fixed; left: 0; right: 0; bottom: 78px; z-index: 54; margin: 0; padding: 8px 12px; background: var(--nav); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(0,0,0,.25); }
  .savebar .big { flex: 1 1 auto; }
  body.hassavebar { padding-bottom: 150px; }
}
@media print { .savebar { display: none; } }
.dateline { display: flex; gap: 12px; flex-wrap: wrap; }
.dateline .d { flex: 0 0 11.5rem; }
.dateline .w { flex: 1 1 14rem; }
details.exposure > summary { cursor: pointer; list-style: none; }
details.exposure > summary::-webkit-details-marker { display: none; }
details.exposure > summary h2 { display: inline-block; margin: 0 8px 0 0; }
details.exposure[open] > summary { margin-bottom: 8px; }
.easy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.easy a.btn { flex-direction: column; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 6px; text-align: center; font-weight: 700; margin: 0; }
.easy a.btn svg.i { width: 30px; height: 30px; }
.invhead { margin: 0 0 8px; }
.wheretitle { margin: 0 0 6px; }
.wheretiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.wtile { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-left: 5px solid var(--action-btn); border-radius: 10px; background: var(--card); color: var(--text); text-decoration: none; }
.wtile svg.i { width: 26px; height: 26px; flex: none; color: var(--action); }
.wtile b { font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.wtile:hover { border-color: var(--action); }
.wtile.back { border-left-color: var(--line); }
@media (max-width: 480px) { .wheretiles { grid-template-columns: 1fr 1fr; } }
.suggestwrap { position: relative; }
.insptabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 14px; }
.insptabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 66px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; position: relative; }
.insptabs a svg.i { width: 24px; height: 24px; }
.insptabs a.on { border-color: var(--action); background: color-mix(in srgb, var(--action) 14%, transparent); color: var(--action); }
.insptabs a .badge { position: absolute; top: -8px; right: -4px; font-size: .75rem; }
.insptiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 16px; }
.itile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: 12px 8px; text-align: center; border: 1px solid var(--line); border-top: 5px solid var(--action-btn); border-radius: 12px; background: var(--card); color: var(--text); text-decoration: none; }
.itile svg.i { width: 34px; height: 34px; color: var(--action); }
.itile b { font-size: 1.05rem; }
.itile small { color: var(--muted); }
.itile .badge { position: absolute; top: 8px; right: 8px; }
.itile:hover { border-color: var(--action); }
@media (max-width: 700px) { .insptiles { grid-template-columns: 1fr 1fr; } .insptabs a { font-size: .78rem; min-height: 60px; } }
.followup { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.followup .btn { min-height: 52px; display: inline-flex; align-items: center; gap: 8px; }

/* phone: users as cards, the edit forms stack full width; boards stack instead of scrolling sideways */
@media (max-width: 700px) {
  table.userrows td.stack { display: block; text-align: left; }
  table.userrows td.stack::before { display: block; margin-bottom: 6px; }
  table.userrows td.stack form.inline-row { display: grid; gap: 10px; }
  table.userrows td.stack select, table.userrows td.stack input:not([type=checkbox]) { width: 100%; min-height: 48px; }
  table.userrows td.stack .check { min-height: 40px; }
  table.userrows td.actions .btn, table.userrows td.actions button, table.userrows td.stack button { min-height: 48px; }
  .kanban { display: block; overflow: visible; }
  .kcol { flex: none; width: auto; margin-bottom: 14px; min-height: 0; }
  .kcol h2 { font-size: 1.1rem; }
  .kcard .kmove select, .kcard .knext, .kcard .kmove button { min-height: 48px; }
  .kcard .knum { font-size: 1.1rem; font-weight: 700; }
}

/* never let the page get wider than the screen: that is what pushed the top and bottom bars out of view */
html, body { max-width: 100%; overflow-x: clip; }
.badge { max-width: 100%; }
table.cards td[data-label="Details"], table.cards td[data-label="Status"] { flex-wrap: wrap; justify-content: flex-end; }
table.cards td[data-label="Details"] > div { max-width: 100%; }
table.cards td .badge { white-space: normal; text-align: left; }
.locbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.locbar select, .locbar input[type=text] { flex: 1 1 200px; max-width: 100%; min-width: 0; }

/* sticky page title */
.stickyhead { position: sticky; top: var(--navh, 56px); z-index: 30; background: var(--bg); margin: 0 -2px 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.stickyhead h1 { margin: 0; }

/* icon filters: type of place on Inspections, which tickets on the Board */
.filterbox { margin: 8px 0 14px; }
.typechips, .tfilters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.tchip, .tf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; text-align: center; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none; }
.tchip svg.i, .tf svg.i { width: 26px; height: 26px; margin: 0; }
.tchip.on, .tf.on { border-color: var(--action); background: var(--action); color: #fff; }
@media (min-width: 700px) { .typechips, .tfilters { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); } }

.tagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.tagrow input[name=name] { flex: 1 1 180px; min-width: 0; }
.tagrow select { width: auto; max-width: 100%; }
.tagicon svg.i { width: 26px; height: 26px; }
.tfilters.tags { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.tf { position: relative; }
.tf small.badge { position: absolute; top: 4px; right: 4px; }

/* phone: cards hide empty cells and lead with the main one; forms get big fields */
@media (max-width: 700px) {
  table.cards td:empty { display: none; }
  table.cards td:first-child { font-weight: 700; font-size: 1.05rem; }
  form.card input:not([type=checkbox]):not([type=radio]):not([type=file]), form.card select, form.card textarea { font-size: 16px; min-height: 48px; width: 100%; max-width: 100%; box-sizing: border-box; }
  form.card textarea { min-height: 110px; }
  form.card label:not(.check) { font-weight: 600; margin-top: 6px; display: block; }
  form.card .row > div { flex: 1 1 100%; min-width: 0; }
  form.card .check { min-height: 44px; display: flex; align-items: center; gap: 10px; }
  form.card .check input[type=checkbox] { width: 26px; height: 26px; min-height: 0; flex: 0 0 auto; }
  form.card h2.fsec { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
}
nav.tfilters, nav.typechips, nav.insptabs { background: none; border: 0; box-shadow: none; padding: 0; }
@media (max-width: 700px) { table.userrows input[type=checkbox], table.cards input[type=checkbox] { width: 24px; height: 24px; } table.userrows td form.inline-row { display: grid; gap: 8px; } table.userrows select, table.userrows input:not([type=checkbox]) { width: 100%; min-height: 48px; font-size: 16px; } }

.insptabs.two { grid-template-columns: repeat(2, 1fr); }
.insptabs a { position: relative; text-align: center; font-weight: 600; text-decoration: none; color: var(--text); background: var(--card); }
.viewtoggle { margin: 0 0 12px; display: flex; gap: 8px; }
.viewtoggle .btn { min-height: 44px; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; }
.stickyhead h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1.5rem; }

/* ticket detail: short title line (icon, number, status) with the long description underneath */
h1.tickethead { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .25rem; }
p.ticketsub { font-size: 1.05rem; font-weight: 600; margin: 0 0 1rem; overflow-wrap: anywhere; }

/* dashboard "Tickets for me": item name first, then ticket number and type, then status */
.mytickets { display: grid; gap: .6rem; margin-bottom: .75rem; }
a.mytk { display: block; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: inherit; text-decoration: none; }
a.mytk:hover, a.mytk:focus-visible { border-color: var(--info, #2563eb); }
.mytk-name { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.mytk-sub { display: block; margin-top: .2rem; color: var(--muted, #6b7280); font-size: .95rem; overflow-wrap: anywhere; }
.mytk-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }

/* one-line page title; the buttons after it wrap underneath on a narrow phone */
.stickyhead h1 .ptitle { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* daily check: who answered, and the little "Saved" under each line */
.dline .dby, .dline .dsave { display: block; margin-top: .15rem; font-size: .85rem; }
.bad-text { color: var(--bad); font-weight: 600; }

/* dashboard: checks that are started and not finished */
.card.resume { display: grid; gap: .6rem; }
.card.resume h2 { margin: 0; }

/* Inventory sections and place sections as big icon tiles, like the Inspections page */
.insptabs.three { grid-template-columns: repeat(3, 1fr); }
.insptabs.four { grid-template-columns: repeat(4, 1fr); }
nav.insptabs a span { text-align: center; }
/* the buttons under a place's name: big, with icons; two across on a phone */
.actionbar { gap: .6rem; margin: .4rem 0 1rem; }
.actionbar .btn, .actionbar button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; padding: 8px 16px; }
.actionbar form.inline { display: contents; }
@media (max-width: 700px) { .actionbar .btn, .actionbar button { flex: 1 1 calc(50% - .3rem); } .actionbar .btn:first-child:nth-last-child(odd) { flex-basis: 100%; } }

/* Equipment filters as square icon tiles. Categories keep their colours; on a phone they sit in a fold-out so 12 tiles don't push the list off the screen. */
.tfilters.cats { grid-template-columns: repeat(3, 1fr); }
.tfilters.cats a.tf { font-size: .82rem; line-height: 1.15; min-height: 78px; overflow-wrap: anywhere; }
a.tf.cattile { border-color: var(--cat); }
a.tf.cattile svg.i { color: var(--cat); }
a.tf.cattile.on { background: var(--cat); border-color: var(--cat); color: var(--cat-ink); }
a.tf.cattile.on svg.i { color: var(--cat-ink); }
.tfilters.status, .tfilters.show { grid-template-columns: repeat(3, 1fr); }
.tf small.badge.warn { background: var(--warn-bg); color: var(--warn); }
details.catdetails { margin: 0 0 12px; }
details.catdetails > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; cursor: pointer; }
@media (min-width: 701px) {
  .tfilters.cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tfilters.status, .tfilters.show { grid-template-columns: repeat(auto-fit, minmax(140px, 200px)); }
  details.catdetails > summary { display: none; }
}

/* Header logo: one image for light themes, a reversed one for dark. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: inline; } }
:root[data-theme="dark"] .logo-light { display: none; } :root[data-theme="dark"] .logo-dark { display: inline; }

.tagrow { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tagrow button, .tagrow .check { min-height: 44px; }
.tagrow .check { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) { .tagrow input[name=name] { flex: 1 1 100%; order: 1; } .tagrow .tagicon { order: 0; } .tagrow select { order: 2; flex: 1 1 120px; } }
.micbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 72px; font-size: 1.15rem; border-radius: 14px; }
.micbtn.listening { background: var(--bad); color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 30%, transparent); } }
.poweredby { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 16px 90px; }
.poweredby a { color: inherit; }
