/* v4 additions on top of v3.css: outbox review, device list, status bars. Tokens come from v3.css. */
.v4bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0;padding:10px 14px;border-radius:var(--radius);border:1px solid var(--warn-border);background:var(--warn-bg);color:var(--warn-ink);font-weight:600}
.v4bar.bad{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger)}
.v4pend{margin-inline-start:6px;font-size:12px}
.v4unread{display:inline-block;margin-inline-start:6px;padding:1px 6px;border-radius:var(--r-xs);background:var(--danger-bg);color:var(--danger);font-size:11px;font-weight:700}
.v4rev{padding:10px 0;border-bottom:1px solid var(--line)}
.v4rev .v4acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.v4diff{margin:6px 0 0 18px;padding:0}
.v4dev{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.v4zoom{flex:1;display:flex;align-items:center;justify-content:center;font-weight:600}
.v4form .field{margin:8px 0}
#syncPill{border:0;cursor:pointer;font:inherit;font-size:12.5px}
#gate{display:grid}
.sch-item.me{outline:2px solid var(--focus-ring)}
.v4gatelinks{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px;justify-content:center}
.v4qr{max-width:260px;margin:12px auto}.v4qr svg{width:100%;display:block}
.v4phrase{font:700 26px/1.2 ui-monospace,Menlo,monospace;text-align:center;letter-spacing:2px;margin:8px 0}
.v4tbl{width:100%;border-collapse:collapse;font-size:13px}.v4tbl td,.v4tbl th{padding:6px 4px;border-bottom:1px solid var(--line);text-align:start;vertical-align:top}
.v4sec{margin:14px 0;padding-top:10px;border-top:1px solid var(--line)}.v4sec h3{font-size:15px;margin:0 0 8px}
.v4row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:6px 0}
.v4log{padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}.v4log .sys{color:var(--muted)}
body.scoped .apbctrl > :not(#triageBtn){display:none!important}
.v4row input[type=checkbox]{width:auto;min-height:0;height:auto;margin-inline-end:6px}
.v4row label{display:flex;align-items:center;gap:4px}

/* 0.2.18 (UI audit 01) */
.scrim{z-index:calc(var(--z-fab) + 1)}                      /* 1: a dialog is always above the + button */
body.scrim-open .toast{bottom:auto;top:calc(12px + env(safe-area-inset-top))} /* 19: never over dialog buttons */
@media(max-width:640px){ main{padding-bottom:calc(88px + env(safe-area-inset-bottom))} }  /* 19: the + never covers the last row */
body.scoped #drawerBody > :not(#triageBtn):not(#menuLogout){display:none!important}
.flag{cursor:pointer}
@media(max-width:640px){ #patBody .flag,#brdWrap .flag,#orgWrap .flag{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px} }
#rolesBody label.sethint{display:flex;align-items:center;gap:8px;margin:6px 0}
#rolesBody label.sethint input[type=checkbox]{width:22px;height:22px;min-height:0;flex:0 0 auto;margin:0}
#viewOnlyChip{font-size:12.5px}
#g-eye{min-width:44px}
#confirmScrim .modal-head h2{font-size:17px}
/* 5: Roles on a phone — people stacked, actions under the name */
.v4people{display:flex;flex-direction:column;gap:0}
.v4person{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0;border-bottom:1px solid var(--line)}
.v4person .who{flex:1 1 200px;min-width:0}
.v4person .acts{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.v4person select{min-width:120px}
#rolesBody details > summary{cursor:pointer;font-weight:600;padding:8px 0}

/* 0.2.21: workload level card (owner's choice D; v3 tabColor thresholds and --load-* tokens) */
.loadwrap{background:var(--bg);padding:8px 16px 6px}
.loadwrap[hidden]{display:none}
.loadcard{max-width:1400px;margin:0 auto;display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:9px 12px;background:var(--card);color:var(--ink)}
.loadcard .bars{display:flex;gap:3px;align-items:flex-end;height:22px;flex:0 0 auto}
.loadcard .bars i{display:block;width:6px;border-radius:1px;background:var(--line)}
.loadcard .bars i:nth-child(1){height:10px}.loadcard .bars i:nth-child(2){height:14px}.loadcard .bars i:nth-child(3){height:18px}.loadcard .bars i:nth-child(4){height:22px}
.loadcard .txt{flex:1;font-size:14px;min-width:0}
.loadcard .txt b{font-weight:700;font-size:17px;font-variant-numeric:tabular-nums}
.loadcard .chip{font-size:13px;font-weight:700;padding:3px 10px;border-radius:12px;flex:0 0 auto}
.loadcard .lv-low{background:var(--load-low,#256e45);color:#fff}
.loadcard .lv-mid{background:var(--load-mid,#e6b800);color:var(--load-mid-ink,#0b2a4a)}
.loadcard .lv-high{background:var(--load-high,#c62828);color:#fff}
.loadcard .lv-max{background:var(--load-max,#493776);color:#fff}
.loadcard .bars i.on.lv-low{background:var(--load-low,#256e45)}.loadcard .bars i.on.lv-mid{background:var(--load-mid,#e6b800)}
.loadcard .bars i.on.lv-high{background:var(--load-high,#c62828)}.loadcard .bars i.on.lv-max{background:var(--load-max,#493776)}
/* Wide screens and wall displays: the larger version of the mock-up */
@media(min-width:1366px){
  .loadcard{gap:22px;border-width:2px;border-radius:14px;padding:14px 22px}
  .loadcard .bars{gap:6px;height:56px}.loadcard .bars i{width:16px;border-radius:2px}
  .loadcard .bars i:nth-child(1){height:24px}.loadcard .bars i:nth-child(2){height:34px}.loadcard .bars i:nth-child(3){height:44px}.loadcard .bars i:nth-child(4){height:56px}
  .loadcard .txt b{font-size:44px;line-height:1}.loadcard .txt .lbl{font-size:20px;color:var(--muted)}
  .loadcard .chip{font-size:26px;padding:8px 24px;border-radius:30px}
}
body.scoped .loadcard{gap:22px;border-width:2px;border-radius:14px;padding:14px 22px}
body.scoped .loadcard .bars{gap:6px;height:56px}body.scoped .loadcard .bars i{width:16px}
body.scoped .loadcard .bars i:nth-child(1){height:24px}body.scoped .loadcard .bars i:nth-child(2){height:34px}body.scoped .loadcard .bars i:nth-child(3){height:44px}body.scoped .loadcard .bars i:nth-child(4){height:56px}
body.scoped .loadcard .txt b{font-size:44px;line-height:1}body.scoped .loadcard .chip{font-size:26px;padding:8px 24px;border-radius:30px}
/* Scrolled: the header slides away; the tabs and the card stay, the card as a slim line (~30 px) */
body.scrolled56 .loadwrap{padding:3px 16px}
body.scrolled56 .loadcard{padding:3px 10px;gap:8px;border-width:1px;border-radius:8px}
body.scrolled56 .loadcard .bars{height:14px;gap:2px}
body.scrolled56 .loadcard .bars i{width:5px;border-radius:1px}
body.scrolled56 .loadcard .bars i:nth-child(1){height:5px}body.scrolled56 .loadcard .bars i:nth-child(2){height:8px}body.scrolled56 .loadcard .bars i:nth-child(3){height:11px}body.scrolled56 .loadcard .bars i:nth-child(4){height:14px}
body.scrolled56 .loadcard .txt b{font-size:14px;line-height:1.2}
body.scrolled56 .loadcard .txt .lbl{font-size:12px}
body.scrolled56 .loadcard .chip{font-size:12px;padding:1px 8px;border-radius:10px}
/* v3: the header status pill carries the load colour, with a white ring so it reads on every theme */
#syncPill.lv-low{background:var(--load-low,#256e45);color:#fff;box-shadow:0 0 0 2px #fff}
#syncPill.lv-mid{background:var(--load-mid,#e6b800);color:var(--load-mid-ink,#0b2a4a);box-shadow:0 0 0 2px #fff}
#syncPill.lv-high{background:var(--load-high,#c62828);color:#fff;box-shadow:0 0 0 2px #fff}
#syncPill.lv-max{background:var(--load-max,#493776);color:#fff;box-shadow:0 0 0 2px #fff}

/* 0.2.24 (UI audit 02) */
#staffInstead{display:none;margin:0 0 6px}body.scoped #staffInstead{display:inline-flex}
body.scoped .apbctrl > #whoBox{display:block!important;cursor:default;max-width:280px}
.viewonlypill{cursor:default;display:inline-flex;align-items:center}
.btn:disabled,.btn.primary:disabled,.btn.ok:disabled,.btn.danger:disabled{background:var(--control-off);color:var(--muted);border-color:transparent;box-shadow:none;cursor:not-allowed;opacity:1}
#ownerBody > .v4sec:first-child{border-top:0;margin-top:0;padding-top:0}
.v4chip{display:inline-block;font-size:11.5px;padding:0 8px;border-radius:var(--r-pill);border:1px solid var(--line);text-transform:capitalize;margin-left:4px}
/* 0.2.26: v3-style Roles (simple rows, add form, edit page) */
.v4prow{cursor:pointer}.v4prow .who .sethint{word-break:break-all}
.v4chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.v4chips .v4chip,.v4chips .v4pend,.v4chips .v4unread{margin:0}
.v4chip.warn{border-color:var(--danger);color:var(--danger)}
.v4addwrap{margin:0 0 12px;border-bottom:1px solid var(--line);padding-bottom:12px}
.v4edit{margin-top:10px;max-width:420px}.v4edit input,.v4edit select{width:100%}.v4edit input[readonly]{opacity:1;background:var(--control-off)}
.v4pendrow .btn{flex:0 0 auto}
/* 0.2.27: the sign-in screen as the live board (v3): Forgot on its own line, a full-width "New user" */
#g-more.v4gatelinks{flex-direction:column;align-items:stretch;gap:8px}
#g-more .v4links{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#g-more .v4links .btn{text-decoration:underline;font-size:13px;min-height:44px}
#g-showreq{width:100%;justify-content:center;min-height:44px}
#g-login .login-actions43{position:relative}
.v4info{background:none;border:0;color:var(--muted);font-size:18px;min-width:44px;min-height:44px;cursor:pointer;flex:0 0 auto}
#g-eye svg{display:block}
#g-login .login-actions43 .v4remember{display:flex;align-items:center;gap:2px;flex:1 1 auto;min-width:0}
#g-login .login-actions43 .v4remember .rememberrow{flex:0 1 auto;margin:0}
#g-login .login-actions43 .v4remember .v4info{width:auto;min-width:44px;flex:0 0 auto}
