/* v5.13 2026-11-30 (Joseph: "In popup mode the pinned menu is in the way"): the pop-up record is centred on the work area, not on the whole window (--oms-pop-x, --oms-pop-w from section-workspace.js v6.4); with no values it is centred on the window as before. */
/* v5.12 2026-11-27 (Joseph): the same room above and under the Select row on every section screen (the Cases distances). */
/* v5.11 2026-11-27 (Joseph): the full-page record header no longer slides up 5px when a scroll starts. */
/* v5.10 2026-11-27 (Joseph): the two grid title panels touch both edges of the work area, like the Addresses bar. */
/* v5.9 2026-11-27 (Joseph): the two grid title panels stretch to both sides of the work area. */
/* v5.8 2026-11-27 (Joseph): the two grid title panels have round corners again (6px); still grid edge to grid edge. */
/* v5.7 2026-11-27 (Joseph): grid title panels stay visible when the list page scrolls (at the end). */
/* v5.6 2026-11-27 (Joseph): top and lower grid title bars are the same square panel, from grid edge to grid edge (at the end). */
/* v5.5 2026-11-27 (Joseph): lower grid title line: not bold, at the grid edge, New on its line, row count (at the end). */
/* v5.4 2026-11-27 (Joseph): the pop-up ends 14px above the work area's bottom at every window height (at the end). */
/* v5.3 2026-11-27 (Joseph): 14px under the record inside both pop-ups (at the end). */
/* v5.2 2026-11-27 (Joseph): 14px on the right inside both pop-ups (at the end). */
/* v5.1 2026-11-27 (Joseph "go"): pop-up title bar on non-section screens (.rs-pop .rs-page-nav, at the end). */
/* v5.0 2026-11-27 (Joseph "start with the popup"): pop-up = approved page title bar (.ws-pop.ws-page, at the end). */
/* v4.9 2026-11-27 (Joseph "go"): sheet = full-page record on Case Plans and other non-section screens (.rs-page, at the end). */
/* v4.8 2026-11-27 (Joseph "go"): record_view_mode sheet = record below the grids (.ws-below, at the end). */
/* v4.7 2026-11-03 (Joseph): Supervision screen only: labels on one line (wider label column). */
/* v4.6 2026-11-01: Orbit "Records / Show" row and child heading between the grids. */
/* v4.5 2026-11-01: record counts in the screen dropdown. v4.4 2026-11-01: Show dropdown; page Previous / Next with words. v4.2 2026-11-01: page layout (.ws-page) at the end. */
/* section-workspace.css v3.8 (2026-10-27: fixed-width screen dropdown) v3.7 (2026-10-27: All mode: every case row looks included) v3.6 (2026-10-27: All mode: no case looks selected while its record is not open) v3.5 (2026-10-27: no lines on the open parent row) v3.4 (2026-10-27: connector lines removed) v3.3 (2026-10-27: no ✕ in the sheet header) v3.2 (2026-10-27: no "Read only" label in the sheet header) v3.1 (2026-10-27: selected case line in the sheet) v3.0 (2026-10-27: selected case line) v2.7 (2026-10-27: split: expand, cases tab on the left) v2.6 (2026-10-27: split layout try-out on Cases) v2.5 (2026-10-27: big records stack into one column when the sheet is narrow) v2.4 (2026-10-27: accent lines join the row to the sheet) v2.3 (2026-10-26: New greyed out in All mode) v2.2 (2026-10-26: Activity card rule moved to activity.css) v2.1 (2026-10-26: All-mode highlight, Activity card) v2.0 (2026-10-26: pop-up mode) v1.9 (2026-10-26: New hidden only on the open record's grid) v1.7 (2026-10-26: New/Delete in sheet header) v1.6 (2026-10-26: row-to-sheet tab, matching backgrounds) v1.5 (outline) v1.4 (2026-10-26: Deleted icon) v1.3 (2026-10-26: watermark) v1.2 (2026-10-26: matching bar colors) v1.1 (2026-10-26: For switch) v1.0 (2026-10-26): the section workspace (section-workspace.js), Supervision pilot.
   Grids on the left (parent grid on top, child grid below), one record sheet on the right. Colors come from the theme tokens
   (--t-*), so every theme keeps its own look; panels, buttons, grids and forms are the app's own. */

/* ---- the page: two columns; the sheet spans both rows */
#content.ws-on{--ws-gap:10px;display:grid;grid-template-columns:minmax(0,1fr) calc(var(--ws-w,45%) - var(--ws-gap));grid-template-rows:auto minmax(0,1fr);column-gap:var(--ws-gap);align-content:start;overflow:hidden}
#content.ws-on>section:not(.ws-sheet){grid-column:1;min-width:0}
#content.ws-on>.case-parent{grid-row:1}
#content.ws-on>.case-parent+section:not(.ws-sheet){grid-row:2;margin-top:10px;align-self:start;max-height:100%;overflow:auto}
#content.ws-on>section:first-child:not(.case-parent){grid-row:1 / span 2;align-self:start;max-height:100%;overflow:auto}
#content.ws-on>.ws-sheet{grid-column:2;grid-row:1 / span 2;position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;max-height:100%;margin:0;overflow:visible}
#content.ws-on>.ws-strip{grid-column:2;grid-row:1 / span 2;display:none}
/* closed: grids take the whole width */
#content.ws-on.ws-closed{grid-template-columns:minmax(0,1fr) 0;column-gap:0}
#content.ws-on.ws-closed>.ws-sheet{display:none}
/* tucked: a thin strip on the right brings it back */
#content.ws-on.ws-tucked{grid-template-columns:minmax(0,1fr) 34px}
#content.ws-on.ws-tucked>.ws-sheet{display:none}
#content.ws-on.ws-tucked>.ws-strip{display:flex}
/* full width: the sheet covers the grids */
#content.ws-on.ws-full{grid-template-columns:0 minmax(0,1fr);column-gap:0}
#content.ws-on.ws-full>section:not(.ws-sheet){visibility:hidden}

/* ---- the parent grid is short; the child grid fills the rest */
#content.ws-on>.case-parent .tablewrap{max-height:176px}
#content.ws-on .case-parent-table tr.ws-open td{box-shadow:inset 0 1px var(--t-accent),inset 0 -1px var(--t-accent)}
#content.ws-on .case-parent-table tr.ws-open td:first-child{box-shadow:inset 3px 0 var(--t-accent),inset 0 1px var(--t-accent),inset 0 -1px var(--t-accent)}

/* ---- the sheet's header: kind, breadcrumb, n of N and buttons on top; the record's title below */
#content.ws-on .ws-head{display:flex;flex-direction:column;gap:4px;padding:7px 10px 8px 14px;border-bottom:1px solid var(--t-border);background:var(--t-raised);flex-shrink:0;min-width:0}
#content.ws-on .ws-bar{display:flex;align-items:center;gap:6px;min-width:0}
#content.ws-on .ws-kind{font:600 9px Consolas,monospace;letter-spacing:.8px;color:var(--t-accent-ink);background:var(--t-selected);border:1px solid var(--t-border);border-radius:4px;padding:2px 6px;white-space:nowrap;flex-shrink:0}
#content.ws-on .ws-kind.ws-kind-parent{color:var(--t-warm);background:var(--t-warm-bg);border-color:var(--t-warm-border)}
#content.ws-on .ws-kind:empty{display:none}
#content.ws-on .ws-crumb{display:flex;gap:6px;align-items:center;flex:1;min-width:0;font-size:11px;color:var(--t-muted);white-space:nowrap;overflow:hidden}
#content.ws-on .ws-crumb>*{flex-shrink:0}
#content.ws-on .ws-crumb>span:last-child{flex-shrink:1;min-width:2em;overflow:hidden;text-overflow:ellipsis}
#content.ws-on .ws-crumb button{flex-shrink:1;min-width:3em;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--t-accent);text-decoration:underline;text-underline-offset:2px;font-size:11px;overflow:hidden;text-overflow:ellipsis}
#content.ws-on .ws-ttl{display:flex;align-items:baseline;gap:10px;min-width:0}
#content.ws-on .ws-title{margin:0;font-size:14px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#content.ws-on .ws-dirty{font-size:11px;color:var(--t-warm);white-space:nowrap}
#content.ws-on .ws-ro{font-size:11px;color:var(--t-muted);white-space:nowrap}
#content.ws-on .ws-dirty[hidden],#content.ws-on .ws-ro[hidden]{display:none}
#content.ws-on .ws-pos{font:11px Consolas,monospace;color:var(--t-muted);white-space:nowrap;margin:0 2px;flex-shrink:0}
#content.ws-on .ws-ic{width:28px;height:26px;min-width:0;min-height:0;margin:0;display:grid;place-items:center;padding:0;border-radius:6px;color:var(--t-muted);background:var(--t-inset);border:1px solid var(--t-border);box-shadow:none;flex-shrink:0}
#content.ws-on .ws-ic:hover:not(:disabled){color:var(--t-strong);border-color:var(--t-accent);background:var(--t-selected)}
#content.ws-on .ws-ic:disabled{opacity:.4;cursor:default}
#content.ws-on .ws-ic svg{width:15px;height:15px}
/* unsaved changes: Save / Discard / Keep editing, inside the sheet */
#content.ws-on .ws-ask{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:9px 14px;background:var(--t-warm-bg);border-bottom:1px solid var(--t-warm-border);color:var(--t-strong);flex-shrink:0}
#content.ws-on .ws-ask[hidden]{display:none}
#content.ws-on .ws-ask span{margin-right:auto;font-size:12px}
#content.ws-on .ws-ask button{font-size:12px;padding:5px 12px}
/* the record (record-screen.js draws it here exactly as under a grid) scrolls inside the sheet; Save stays in view */
#content.ws-on .ws-sheet>.rs-detail{margin:0;flex:1;min-height:0;overflow:auto;border:0;border-radius:0;background:transparent;box-shadow:none}
#content.ws-on .ws-sheet>.rs-detail>.empty{padding:36px 18px}
#content.ws-on .ws-sheet .rs-detail .detailbody>.buttonrow{margin-bottom:-16px}

/* ---- drag the left edge to resize */
#content.ws-on .ws-grip{position:absolute;left:-8px;top:0;bottom:0;width:12px;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:col-resize;z-index:5;display:grid;place-items:center;touch-action:none}
#content.ws-on .ws-grip::before{content:"";width:4px;height:44px;border-radius:3px;background:var(--t-border);transition:background .15s,height .15s}
#content.ws-on .ws-grip:hover::before,#content.ws-on .ws-grip:focus-visible::before,#content.ws-on .ws-sheet.ws-drag .ws-grip::before{background:var(--t-accent);height:64px}
#content.ws-on .ws-grip:hover,#content.ws-on .ws-grip:focus-visible{background:transparent}
#content.ws-on .ws-snap{position:absolute;top:44px;left:50%;transform:translateX(-50%);font:11px Consolas,monospace;color:var(--t-accent-ink);background:var(--t-selected);border:1px solid var(--t-border);border-radius:10px;padding:1px 8px;opacity:0;transition:opacity .15s;pointer-events:none;z-index:6}
#content.ws-on .ws-sheet.ws-drag .ws-snap{opacity:1}
body:has(.ws-sheet.ws-drag){cursor:col-resize;user-select:none}

/* ---- the tucked strip */
#content.ws-on>.ws-strip{flex-direction:column;align-items:center;justify-content:flex-start;gap:10px;margin:0;padding:12px 0;min-width:0;min-height:0;border:1px solid var(--t-border);border-radius:7px;background:var(--t-raised);color:var(--t-strong);box-shadow:none;overflow:hidden}
#content.ws-on>.ws-strip span{color:var(--t-accent);font-size:16px;line-height:1}
#content.ws-on>.ws-strip b{writing-mode:vertical-rl;font-weight:600;font-size:12px;letter-spacing:.3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-height:calc(100% - 80px)}
#content.ws-on>.ws-strip em{writing-mode:vertical-rl;font-style:normal;color:var(--t-warm);font-size:11px;white-space:nowrap}
#content.ws-on>.ws-strip em[hidden]{display:none}
#content.ws-on>.ws-strip:hover{background:var(--t-selected)}

/* ---- the child screens dropdown (the child grid's title) */
#content.ws-on .ws-picker{display:inline-flex;align-items:center;gap:2px;min-height:0;margin:0;padding:3px 8px 3px 10px;border:1px solid var(--t-border);border-radius:6px;background:var(--t-inset);color:var(--t-strong);box-shadow:none;font:inherit;font-weight:600}
#content.ws-on .ws-picker:hover,#content.ws-on .ws-picker[aria-expanded="true"]{border-color:var(--t-accent);background:var(--t-selected)}
#content.ws-on .ws-picker .ws-chev{color:var(--t-accent);margin-left:6px;font-size:11px}
.ws-menu{position:fixed;z-index:60;width:240px;max-height:min(380px,70vh);overflow:auto;padding:6px;display:flex;flex-direction:column;gap:2px;background:var(--t-raised);border:1px solid var(--t-border);border-radius:8px;box-shadow:0 12px 30px var(--t-shadow)}
.ws-menu input{margin:0 0 4px;padding:6px 9px;font-size:12px;width:100%}
.ws-menu button{display:flex;align-items:center;gap:6px;min-height:0;margin:0;padding:7px 9px;border:0;border-radius:5px;background:transparent;box-shadow:none;color:var(--t-text);text-align:left;font-size:12px}
.ws-menu button[hidden]{display:none}
.ws-menu button:hover,.ws-menu button:focus-visible{background:var(--t-selected);color:var(--t-strong);outline:0}
.ws-menu button.cur{color:var(--t-accent);font-weight:600}
.ws-menu .ws-tick{width:12px;flex-shrink:0;color:var(--t-accent)}

/* ---- after a save the row flashes once */
#content.ws-on tr.ws-flash td{animation:ws-flash 1s ease-out}
@keyframes ws-flash{from{background:var(--t-selected);box-shadow:inset 0 0 0 999px var(--t-glow)}}
@media (prefers-reduced-motion:reduce){#content.ws-on tr.ws-flash td{animation:none}}

/* ---- phones: the sheet covers the screen */
@media(max-width:760px){
 #content.ws-on{display:block;overflow:visible}
 #content.ws-on>.case-parent+section:not(.ws-sheet){margin-top:10px;max-height:none}
 #content.ws-on>.ws-sheet{position:fixed;inset:0;z-index:50;border-radius:0;max-height:none}
 #content.ws-on.ws-tucked>.ws-strip{position:fixed;right:0;top:30%;height:40%;width:34px;z-index:50}
 #content.ws-on .ws-grip,#content.ws-on [data-ws="wide"]{display:none}
}

/* ---- For: Selected supervision | All supervisions (beside the child screens dropdown) */
#content.ws-on .ws-scope{display:inline-flex;align-items:center;border:1px solid var(--t-border);border-radius:6px;overflow:hidden;background:var(--t-inset);flex-shrink:0}
#content.ws-on .ws-scope-label{padding:0 8px;font-size:11px;color:var(--t-muted);border-right:1px solid var(--t-border);align-self:stretch;display:grid;place-items:center}
#content.ws-on .ws-scope button{margin:0;min-height:0;padding:4px 10px;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--t-muted);font-size:12px;white-space:nowrap}
#content.ws-on .ws-scope button+button{border-left:1px solid var(--t-border)}
#content.ws-on .ws-scope button.on{background:var(--t-selected);color:var(--t-accent-ink);font-weight:600}
#content.ws-on .ws-scope button:hover:not(.on){color:var(--t-strong)}

/* ---- v1.2 (Joseph 2026-10-26): matching colors. The supervisions grid's title bar and the sheet's header while it shows a
   supervision share one color (an accent tint); the child grid's title bar and the sheet's header for a child record share another
   (a lighter tint). Both come from each theme's own accent, so every theme keeps its look. */
#content.ws-on{--ws-parent-bar:color-mix(in srgb,var(--t-accent) 20%,var(--t-raised));--ws-child-bar:color-mix(in srgb,var(--t-accent) 7%,var(--t-raised))}
#content.ws-on>.case-parent>.toolbar,#content.ws-on>.case-parent>.case-bar,#content.ws-on .ws-sheet.ws-for-parent .ws-head,#content.ws-on>.ws-strip.ws-for-parent{background:var(--ws-parent-bar);box-shadow:inset 3px 0 var(--t-accent)}
#content.ws-on>section:not(.case-parent):not(.ws-sheet)>.toolbar,#content.ws-on .ws-sheet .ws-head,#content.ws-on>.ws-strip{background:var(--ws-child-bar);box-shadow:inset 3px 0 color-mix(in srgb,var(--t-accent) 45%,transparent)}
#content.ws-on .ws-sheet.ws-for-parent .ws-head{background:var(--ws-parent-bar);box-shadow:inset 3px 0 var(--t-accent)}
#content.ws-on>.ws-strip.ws-for-parent{background:var(--ws-parent-bar);box-shadow:inset 3px 0 var(--t-accent)}

/* v1.3 watermark behind the open record: names what is open (Supervision, Drug Test...) */
#content.ws-on>.ws-sheet{container-type:inline-size}
#content.ws-on .ws-sheet>.ws-mark{position:absolute;left:6%;right:6%;top:52%;transform:translateY(-50%) rotate(-18deg);text-align:center;font-size:clamp(26px,10cqi,80px);font-weight:800;letter-spacing:.06em;text-transform:uppercase;line-height:1.05;white-space:normal;overflow-wrap:normal;color:var(--t-accent);opacity:.08;pointer-events:none;z-index:3}
#content.ws-on .ws-sheet.ws-for-parent>.ws-mark{opacity:.1}
/* v1.4 small Deleted icon button in the child grid's bar, with a tooltip */
#content.ws-on .ws-del{position:relative;display:inline-grid;place-items:center;width:30px;height:30px;min-height:0;padding:0}
#content.ws-on .ws-del svg{width:16px;height:16px}
#content.ws-on .ws-del[data-tip]::after{content:attr(data-tip);position:absolute;right:0;top:calc(100% + 7px);white-space:nowrap;padding:4px 8px;border-radius:5px;font-size:11px;line-height:1.3;font-weight:500;background:var(--t-strong,#1f2b36);color:var(--t-surface,#fff);box-shadow:0 4px 12px rgba(0,0,0,.25);opacity:0;transform:translateY(-4px);pointer-events:none;transition:opacity .12s,transform .12s;z-index:30}
#content.ws-on .ws-del[data-tip]:hover::after,#content.ws-on .ws-del[data-tip]:focus-visible::after{opacity:1;transform:none}
/* v1.6 one selection: the selected row, a small tab across the gap and the sheet share one background (no outline) */
#content.ws-on{position:relative;--ws-sel:color-mix(in srgb,var(--t-accent) 16%,var(--t-surface))}
#content.ws-on>.ws-src tr.selected,#content.ws-on>.ws-src tr.selected:hover{background:var(--ws-sel)}
#content.ws-on>.ws-sheet.ws-linked{background:var(--ws-sel)}
#content.ws-on>.ws-bridge{position:absolute;z-index:4;pointer-events:none;background:var(--ws-sel)}
#content.ws-on>.ws-bridge[hidden]{display:none}
/* v1.7 New and Delete in the sheet's header; the grid's New buttons and the form's Delete are pressed by them, so hide those while the sheet is open */
#content.ws-on .ws-ttl{align-items:center}
#content.ws-on .ws-acts{margin-left:auto;display:flex;gap:8px;flex-shrink:0}
#content.ws-on .ws-acts button{min-height:0;padding:5px 11px;font-size:12px;margin:0;white-space:nowrap}
#content.ws-on .ws-acts button[hidden]{display:none}
#content.ws-on.ws-k-parent:not(.ws-closed):not(.ws-tucked) [data-ws="new-parent"],#content.ws-on.ws-k-child:not(.ws-closed):not(.ws-tucked)>section:not(.ws-sheet) [data-rs-new]{display:none}   /* v1.9: only the grid whose record is open */
#content.ws-on #wsSheet .buttonrow [data-rs-delete]{display:none}
/* v2.0 pop-up mode (tenant setting record_view_mode = popup, and always on phones): the grids take the full width and
   the record opens in a pop-up window over them; Esc, ✕ or a click outside closes it */
#content.ws-on>.ws-backdrop{display:none}
#content.ws-on.ws-pop{grid-template-columns:minmax(0,1fr) 0;column-gap:0}
#content.ws-on.ws-pop:not(.ws-closed)>.ws-backdrop{display:block;position:fixed;inset:0;z-index:59;background:color-mix(in srgb,#000 38%,transparent)}
#content.ws-on.ws-pop>.ws-sheet{position:fixed;z-index:60;top:5vh;bottom:5vh;left:var(--oms-pop-x,50%);transform:translateX(-50%);width:min(900px,calc(var(--oms-pop-w,100vw) - 32px));max-height:none;margin:0;border-radius:10px;box-shadow:0 24px 64px rgba(0,0,0,.45);outline:none}
#content.ws-on.ws-pop.ws-closed>.ws-sheet{display:none}
#content.ws-on.ws-pop .ws-grip,#content.ws-on.ws-pop .ws-snap,#content.ws-on.ws-pop [data-ws="tuck"],#content.ws-on.ws-pop [data-ws="wide"],#content.ws-on.ws-pop>.ws-strip,#content.ws-on.ws-pop>.ws-bridge{display:none}
#content.ws-on.ws-pop .ws-sheet>.rs-detail{border-radius:0 0 10px 10px}
@media(max-width:760px){#content.ws-on.ws-pop>.ws-sheet{inset:0;transform:none;width:auto;border-radius:0}}
.ws-menu .ws-menu-sep{margin:4px 2px;border:0;border-top:1px solid var(--t-border)}
.ws-menu .ws-menu-deleted{color:var(--t-muted)}
@media(max-width:760px){body:has(#content.ws-on) main>.context,body:has(#content.ws-on) main>.pagehead{display:none}}   /* v2.0: no large title over the workspace on phones */
/* v2.1 All supervisions: no supervision row looks picked (unless a supervision is the open record) */
#content.ws-on.ws-all:not(.ws-k-parent)>.case-parent tr.selected,#content.ws-on.ws-all:not(.ws-k-parent)>.case-parent tr.selected:hover{background:transparent;box-shadow:none}
#content.ws-on.ws-all:not(.ws-k-parent)>.case-parent tr.selected td{color:inherit}
/* v2.2: the Activity card's place moved to activity.css (bottom-left on every screen, so it never jumps) */
/* v2.2 All supervisions: the child grid's New is greyed out, with a tooltip */
#content.ws-on [data-rs-new].ws-off{position:relative;opacity:.45;cursor:not-allowed;filter:grayscale(.6)}
#content.ws-on [data-rs-new].ws-off[data-tip]:hover::after{content:attr(data-tip);position:absolute;right:0;top:calc(100% + 7px);white-space:nowrap;padding:4px 8px;border-radius:5px;font-size:11px;font-weight:500;line-height:1.3;background:var(--t-strong,#1f2b36);color:var(--t-surface,#fff);box-shadow:0 4px 12px rgba(0,0,0,.25);z-index:30;opacity:1}

/* v2.4 (Joseph 2026-10-27): two accent lines from the selected row's top and bottom edges to the sheet, opening along its edge */
#content.ws-on>.ws-wire{position:absolute;z-index:5;pointer-events:none;overflow:visible}
#content.ws-on>.ws-wire path{fill:none;stroke:var(--t-accent);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
#content.ws-on.ws-pop>.ws-wire,#content.ws-on.ws-tucked>.ws-wire,#content.ws-on.ws-full>.ws-wire,#content.ws-on.ws-closed>.ws-wire{display:none!important}

/* v2.5 (Joseph 2026-10-27, Cases): a record laid out for the full screen (boxes side by side, 2-4 fields per row) is cramped in a
   half-width sheet. The sheet measures itself: below 900px wide the boxes stack in one column; below 760px the fields that
   share a row stack too (3-4 per row: below 1100px). Full width (or a wide sheet) shows the record's own layout. Fixed-size grids (Drug Tests results) keep theirs. */
@container (max-width: 900px){
 #content.ws-on .ws-sheet .ws-body [style*="grid-template-columns"]:has(> div > fieldset),
 #content.ws-on .ws-sheet .ws-body [style*="grid-template-columns"]:has(> fieldset){grid-template-columns:minmax(0,1fr)!important}
}
@container (max-width: 760px){
 #content.ws-on .ws-sheet .ws-body [style*="grid-template-columns: repeat("]{grid-template-columns:minmax(0,1fr)!important}
 /* Drug Tests results grid (drug, presumptive, lab, ...): the columns shrink to the sheet instead of running off its edge */
 #content.ws-on .ws-sheet .ws-body [style*="grid-template-columns: 170px 90px"]{grid-template-columns:minmax(64px,1fr) 76px minmax(0,1.4fr) minmax(0,1fr)!important}
}
@container (max-width: 1100px){
 #content.ws-on .ws-sheet .ws-body [style*="grid-template-columns: repeat(3,"],#content.ws-on .ws-sheet .ws-body [style*="grid-template-columns: repeat(4,"]{grid-template-columns:minmax(0,1fr)!important}
}

/* ---- v2.6 (Joseph 2026-10-27, try-out on Cases): SPLIT = master-detail side by side.
   Left: the cases grid, full height. Right: the case strip, the screen's grid, and the record below it. */
#content.ws-on.ws-split{grid-template-columns:var(--ws-left,38%) minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);column-gap:22px}
#content.ws-on.ws-split>.case-parent{grid-column:1;grid-row:1 / span 3;align-self:stretch;display:flex;flex-direction:column;min-height:0;max-height:100%}
#content.ws-on.ws-split>.case-parent .tablewrap{max-height:none;flex:1 1 auto;min-height:0}
#content.ws-on.ws-split>.ws-casebar{grid-column:2;grid-row:1}
#content.ws-on.ws-split>.case-parent+section:not(.ws-sheet){grid-column:2;grid-row:2;margin-top:10px;max-height:none;overflow:visible}
#content.ws-on.ws-split>.case-parent+section:not(.ws-sheet) .tablewrap{max-height:200px}
#content.ws-on.ws-split>.ws-sheet{grid-column:2;grid-row:3;margin-top:10px;max-height:100%}
#content.ws-on.ws-split.ws-closed{grid-template-columns:var(--ws-left,38%) minmax(0,1fr);column-gap:22px}
#content.ws-on.ws-split.ws-closed>.case-parent+section:not(.ws-sheet){grid-row:2 / span 2;align-self:start;max-height:100%;overflow:auto}
#content.ws-on.ws-split.ws-closed>.case-parent+section:not(.ws-sheet) .tablewrap{max-height:none}
/* the case record itself: it takes the place of the screen's grid */
#content.ws-on.ws-split.ws-k-parent>.case-parent+section:not(.ws-sheet){display:none}
#content.ws-on.ws-split.ws-k-parent>.ws-sheet{grid-row:2 / span 2}
/* no tuck, full width or sheet resizing here; the divider resizes the two sides */
#content.ws-on.ws-split .ws-grip,#content.ws-on.ws-split .ws-snap,#content.ws-on.ws-split [data-ws="tuck"],#content.ws-on.ws-split>.ws-strip{display:none}
#content.ws-on>.ws-vgrip{position:absolute;z-index:6;width:12px;min-width:0;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;cursor:col-resize;touch-action:none}
#content.ws-on>.ws-vgrip::after{content:"";position:absolute;left:5px;top:50%;height:44px;width:2px;transform:translateY(-50%);border-radius:2px;background:var(--t-border)}
#content.ws-on>.ws-vgrip:hover::after,#content.ws-on>.ws-vgrip.ws-drag::after,#content.ws-on>.ws-vgrip:focus-visible::after{background:var(--t-accent)}
/* the case strip: the picked case's columns across, matching the picked row */
#content.ws-on>.ws-casebar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;min-width:0;padding:9px 12px 9px 14px;border:1px solid var(--t-border);border-radius:8px;background:var(--ws-sel);box-shadow:inset 3px 0 var(--t-accent)}
#content.ws-on>.ws-casebar .ws-cb-main{font-weight:700;font-size:14px;color:var(--t-strong)}
#content.ws-on>.ws-casebar .ws-cb-pair{display:flex;flex-direction:column;font-size:12.5px;color:var(--t-strong);line-height:1.25;white-space:nowrap}
#content.ws-on>.ws-casebar .ws-cb-pair small{font:600 9px Consolas,monospace;letter-spacing:.7px;color:var(--t-muted);text-transform:uppercase}
#content.ws-on>.ws-casebar .ws-cb-btn{margin-left:auto;font-size:12px;padding:5px 12px}
#content.ws-on>.ws-casebar .ws-cb-none{color:var(--t-muted);font-size:12px}

/* v2.7 (Joseph 2026-10-27): expand. The cases grid tucks into a vertical tab on the left and the right side takes the width */
#content.ws-on>.ws-lstrip{display:none}
#content.ws-on.ws-split.ws-ltuck,#content.ws-on.ws-split.ws-ltuck.ws-closed{grid-template-columns:34px minmax(0,1fr);column-gap:10px}
#content.ws-on.ws-split.ws-ltuck>.case-parent,#content.ws-on.ws-split.ws-ltuck>.ws-vgrip{display:none}
#content.ws-on.ws-split.ws-ltuck>.ws-lstrip{grid-column:1;grid-row:1 / span 3;display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;min-height:0;margin:0;padding:12px 0;border:1px solid var(--t-border);border-radius:8px;background:var(--ws-parent-bar);box-shadow:inset 3px 0 var(--t-accent);color:var(--t-strong);cursor:pointer;overflow:hidden}
#content.ws-on.ws-split.ws-ltuck>.ws-lstrip:hover{border-color:var(--t-accent)}
#content.ws-on>.ws-lstrip>span{font-size:16px;line-height:1;color:var(--t-accent)}
#content.ws-on>.ws-lstrip>b{writing-mode:vertical-rl;transform:rotate(180deg);font-size:12px;font-weight:600;letter-spacing:.04em;white-space:nowrap}
#content.ws-on .case-parent>.toolbar .ws-ltuck-btn{order:-1;margin-right:2px}
#content.ws-on.ws-split [data-ws="wide"][aria-pressed="true"]{color:var(--t-accent);border-color:var(--t-accent)}

/* v3.1 (Joseph 2026-10-27): the selected case, always shown at the top of the detail sheet under its header */
#content.ws-on .ws-sheet>.ws-picked{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;padding:6px 14px;border-bottom:1px solid var(--t-border);background:var(--ws-sel);box-shadow:inset 3px 0 var(--t-accent);font-size:12.5px;color:var(--t-strong);min-width:0}
#content.ws-on .ws-sheet>.ws-picked .ws-picked-label{font:600 9px Consolas,monospace;letter-spacing:.8px;text-transform:uppercase;color:var(--t-warm)}
#content.ws-on .ws-sheet>.ws-picked strong{font-size:13px}
#content.ws-on .ws-sheet>.ws-picked .ws-picked-pair{white-space:nowrap}
#content.ws-on .ws-sheet>.ws-picked .ws-picked-pair small{font:600 9px Consolas,monospace;letter-spacing:.6px;text-transform:uppercase;color:var(--t-muted)}

/* v3.2 (Joseph 2026-10-27: "Remove the read only from the screens"): no "Read only" label beside the title (records still open with the Edit button) */
#content.ws-on .ws-sheet .ws-ro{display:none!important}

/* v3.3 (Joseph 2026-10-27: "remove the X in the detail screen"): no ✕ on the side sheet (tuck ›| or Esc puts it away). The pop-up keeps its ✕ (phones have no Esc). */
#content.ws-on:not(.ws-pop) .ws-sheet [data-ws="close"]{display:none}

/* v3.4 (Joseph 2026-10-27: "remove the connector lines"): the v2.4 accent lines are switched off (delete this rule to bring them back) */
#content.ws-on>.ws-wire{display:none!important}

/* v3.5 (Joseph 2026-10-27): no horizontal accent lines on the open case / supervision row (the row keeps its selected background) */
#content.ws-on .case-parent-table tr.ws-open td,#content.ws-on .case-parent-table tr.ws-open td:first-child{box-shadow:none}
#content.ws-on .case-parent-table tr.selected td:first-child{box-shadow:inset 3px 0 var(--t-accent)}

/* v3.6 (Joseph 2026-10-27: "When selecting all cases do not select all the cases on the top grid"): with For = All, no parent row looks
   picked, unless that case is open in the sheet right now (not tucked or closed) */
#content.ws-on.ws-all.ws-tucked>.case-parent tr.selected,#content.ws-on.ws-all.ws-closed>.case-parent tr.selected,
#content.ws-on.ws-all.ws-tucked>.case-parent tr.selected:hover,#content.ws-on.ws-all.ws-closed>.case-parent tr.selected:hover{background:transparent;box-shadow:none}
#content.ws-on.ws-all:not(.ws-k-parent)>.case-parent tr.selected td,#content.ws-on.ws-all.ws-tucked>.case-parent tr.selected td,#content.ws-on.ws-all.ws-closed>.case-parent tr.selected td{color:inherit;background:transparent;box-shadow:none!important}

/* v3.7 (Joseph 2026-10-27: "I think we should select all cases"): with For = All, EVERY parent row shows the selected background,
   so the grid says all of them are in the list below (replaces the v3.6 "none selected" look) */
#content.ws-on.ws-all>.case-parent tr[data-case-row],#content.ws-on.ws-all>.case-parent tr[data-case-row]:hover{background:var(--ws-sel)!important}
#content.ws-on.ws-all>.case-parent tr[data-case-row] td{background:transparent;color:var(--t-strong)}
#content.ws-on.ws-all>.case-parent tr[data-case-row] td:first-child{box-shadow:inset 3px 0 var(--t-accent)!important}

/* v3.8 (Joseph 2026-10-27: "make the drop down size fixed to the largest selection"): every screen name sits in the same grid cell,
   hidden except the current one, so the button is always as wide as the longest name */
#content.ws-on .ws-picker .ws-pick-name{display:inline-grid;text-align:left}
#content.ws-on .ws-picker .ws-pick-name>span,#content.ws-on .ws-picker .ws-pick-name::after{grid-area:1 / 1;white-space:nowrap}
#content.ws-on .ws-picker .ws-pick-name::after{content:attr(data-w);visibility:hidden}
/* v3.9 (Joseph 2026-10-27): sheet header — labels line up on one centre line, bigger text, title bigger */
#content.ws-on .ws-head{gap:6px;padding:9px 12px 10px 14px}
#content.ws-on .ws-bar{gap:8px;min-height:28px}
#content.ws-on .ws-kind{font-size:11px;line-height:16px;padding:2px 8px}
#content.ws-on .ws-crumb,#content.ws-on .ws-crumb button{font-size:13px;line-height:20px}
#content.ws-on .ws-pos{font-size:13px;line-height:20px}
#content.ws-on .ws-ttl{align-items:center;min-height:32px}
#content.ws-on .ws-title{font-size:19px;font-weight:600;line-height:1.25}
/* v4.0 (Joseph 2026-10-27): no kind label (CHARGE, CASE...) in the sheet header; the path already says it */
#content.ws-on .ws-kind{display:none!important}
/* v4.1 (Joseph 2026-10-27): watermark number on its own line under the word */
#content.ws-on .ws-sheet>.ws-mark{white-space:pre-line}

/* v4.2 (Joseph 2026-11-01, Orbit one-column): PAGE layout. Grids only, full width; the open record covers them as a full page with ← Back. */
#content.ws-on .ws-back{display:none}
#content.ws-on.ws-page .ws-back{display:inline-flex;align-items:center;margin-right:10px;padding:4px 10px;min-height:0;font-size:12px;border:1px solid var(--t-border);border-radius:5px;background:none;color:var(--t-accent);box-shadow:none;white-space:nowrap}
#content.ws-on.ws-page .ws-back:hover{background:var(--t-selected,transparent)}
#content.ws-on.ws-page.ws-tucked,#content.ws-on.ws-page.ws-closed{grid-template-columns:minmax(0,1fr) 0;column-gap:0}
#content.ws-on.ws-page>.ws-strip,#content.ws-on.ws-page.ws-tucked>.ws-strip{display:none!important}
#content.ws-on.ws-page .ws-grip,#content.ws-on.ws-page .ws-snap,#content.ws-on.ws-page [data-ws="wide"],#content.ws-on.ws-page [data-ws="tuck"],#content.ws-on.ws-page [data-ws="close"]{display:none!important}
#content.ws-on.ws-page.ws-full>section:not(.ws-sheet){display:none}
#content.ws-on.ws-page>.ws-bridge{display:none!important}
/* v4.4 (Joseph, as in Orbit): "Show [Selected case | All cases]" and "← Previous  n of N  Next →" on the record page */
#content.ws-on .ws-scope-pick{cursor:default}
#content.ws-on .ws-scope-select{margin:0;min-height:0;height:26px;padding:0 26px 0 8px;border:0;border-radius:0;background-color:transparent;box-shadow:none;color:var(--t-text);font-size:12px;cursor:pointer}
#content.ws-on.ws-page [data-ws="prev"],#content.ws-on.ws-page [data-ws="next"]{width:auto;padding:0 10px;gap:4px;display:inline-flex;align-items:center;font-size:12px;color:var(--t-text)}
#content.ws-on.ws-page [data-ws="prev"] svg,#content.ws-on.ws-page [data-ws="next"] svg{display:none}
#content.ws-on.ws-page [data-ws="prev"]::before{content:'← Previous'}
#content.ws-on.ws-page [data-ws="next"]::before{content:'Next →'}
#content.ws-on.ws-page [data-ws="prev"]{order:1}#content.ws-on.ws-page .ws-pos{order:2;margin:0 6px}#content.ws-on.ws-page [data-ws="next"]{order:3}
#content.ws-on ~ .ws-menu .ws-menu-n,.ws-menu .ws-menu-n{color:var(--t-muted);font-variant-numeric:tabular-nums;white-space:pre}

/* v4.6 (Joseph 2026-11-01, like Orbit Cases): between the parent grid and the child grid: "Records [Warrants (4) ▾]  Show [Selected case ▾]",
   then the child grid's heading "Warrants  For case P2025-001" with its buttons on the right. Theme colors only. */
#content.ws-on .ws-recbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px 4px;margin:14px 0 6px}
#content.ws-on .ws-recbar-label,#content.ws-on .ws-recbar .ws-scope-label{padding:0;border:0;background:none;font-size:14px;color:var(--t-muted)}
#content.ws-on .ws-recbar .ws-picker-select{min-height:30px;padding:4px 10px;border:1px solid var(--t-border);border-radius:5px;background:transparent;font-size:14px;font-weight:400;color:var(--t-text)}
#content.ws-on .ws-recbar .ws-pick-n{color:var(--t-muted)}
#content.ws-on .ws-recbar .ws-scope{gap:4px;margin:0;padding:0;border:0;border-radius:0;background:none;overflow:visible}
#content.ws-on .ws-recbar .ws-scope-select{height:30px;padding:0 28px 0 9px;border:1px solid var(--t-border);border-radius:5px;font-size:14px}
#content.ws-on .ws-child-panel>.toolbar{margin-top:4px}
#content.ws-on .ws-child-title .ws-context{margin-left:12px;font-size:13px;font-weight:400;color:var(--t-muted)}
#content .case-parent .rs-hint{margin:0 14px 0 auto;font-size:13px;color:var(--t-muted);white-space:nowrap}
#content .case-parent .rs-hint+.rs-toolbar-actions{margin-left:0}
@media (max-width:760px){#content .case-parent .rs-hint{display:none}}

/* 2026-11-02 (Joseph): Select [screen]  For [case]: one equal, smaller gap (4px) between every label and box */

/* v4.7 (Joseph 2026-11-03): on the Supervision screen no label wraps to a second line ("Date Assigned to Caseload *" is the longest) */
@media (min-width: 761px) {
  #content.supervisions-workspace .rs-labels-left>div:not(#oms-x1):not(#oms-x2):not(#oms-x3){grid-template-columns:215px minmax(0,1fr)!important}
  #content.supervisions-workspace .rs-labels-left>div>label:not(#oms-x1):not(#oms-x2):not(#oms-x3){white-space:nowrap!important}
}

/* v4.8 (Joseph 2026-11-27: record_view_mode "sheet" = the top grid, the bottom grid and the detail below, with a button to hide the top,
   like Case Plans). section-workspace.js v5.5 adds .ws-below in sheet mode: one column that scrolls as a whole, the record under the
   grids (never over them), its title bar (New / Edit / Delete...) sticks to the top while the record scrolls. No resize grip, tuck,
   full width, close or Back in this mode. Pop-up mode (.ws-pop) is not touched. */
#content.ws-on.ws-below{display:block;overflow:hidden auto}
#content.ws-on.ws-below>section:not(.ws-sheet){max-height:none;overflow:visible}
#content.ws-on.ws-below>.ws-sheet{display:flex;position:relative;width:auto;max-height:none;margin:14px 0 0;overflow:visible}
#content.ws-on.ws-below.ws-closed>.ws-sheet,#content.ws-on.ws-below.ws-tucked>.ws-sheet:not(#ws-x1){display:none}
#content.ws-on.ws-below.ws-tucked:not(.ws-closed)>.ws-sheet:not(#ws-x1){display:flex}
#content.ws-on.ws-below .ws-sheet>.ws-body{max-height:none;overflow:visible}
#content.ws-on.ws-below .ws-sheet>.ws-head{position:sticky;top:0;z-index:6}
#content.ws-on.ws-below .ws-back,#content.ws-on.ws-below .ws-grip,#content.ws-on.ws-below .ws-snap,#content.ws-on.ws-below [data-ws="wide"],
#content.ws-on.ws-below [data-ws="tuck"],#content.ws-on.ws-below [data-ws="close"],#content.ws-on.ws-below>.ws-strip,#content.ws-on.ws-below>.ws-bridge,
#content.ws-on.ws-below>.ws-wire,#content.ws-on.ws-below>.ws-backdrop{display:none!important}

/* v4.8 (same day): popup mode on grid-detail screens OUTSIDE a section workspace (Case Plans, Facility List, Role Groups...),
   record-screen.js v7.5: the grid(s) take the page; the record opens in the same pop-up window as the sections (.rs-pop-open),
   with its own button row (the title-bar copies sit behind the dim backdrop). Sheet mode never gets these classes. */
#content.rs-pop>.rs-pop-back,#content.rs-pop>.rs-pop-x{display:none}
#content.rs-pop:not(.rs-pop-open)>#rsDetail{display:none}
#content.rs-pop.rs-pop-open>.rs-pop-back{display:block;position:fixed;inset:0;z-index:59;background:color-mix(in srgb,#000 38%,transparent)}
#content.rs-pop.rs-pop-open>#rsDetail{position:fixed;z-index:60;top:5vh;bottom:5vh;left:var(--oms-pop-x,50%);transform:translateX(-50%);width:min(900px,calc(var(--oms-pop-w,100vw) - 32px));max-height:none;margin:0;padding-top:0;overflow:auto;border-radius:10px;box-shadow:0 24px 64px rgba(0,0,0,.45);outline:none}
/* v4.8: both pop-ups (sections .ws-pop and the screens above .rs-pop) get a solid window color, so the grids under them do not
   show through on themes whose panels are see-through (Orbit dark). */
html:root #content.ws-on.ws-pop>.ws-sheet:not(#ws-x1),html:root #content.rs-pop.rs-pop-open>#rsDetail:not(#rs-x1){background:var(--o-surface,var(--t-surface,#fff))!important}

/* v4.9 (Joseph 2026-11-27 "go"): sheet mode on grid-detail screens OUTSIDE a section workspace (Case Plans, Facility List, Role Groups...)
   opens the record as a full page, like Cases / Supervisions (record-screen.js v7.6 .rs-page / .rs-page-open). The title bar row
   (title + New / Edit / Delete / More) stays; the grids hide; a bar with "← Back to <grid>" and "← Previous  n of N  Next →" sits
   over the record. Closed: the screen looks exactly as before minus the record under the grid. */
#content.rs-page>.rs-page-nav{display:none}
#content.rs-page:not(.rs-page-open)>#rsDetail{display:none}
html:root #content.rs-page.rs-page-open>.case-parent:not(#rs-x1):not(#rs-x2){display:none!important}
#content.rs-page.rs-page-open>section.panel:not(#rsDetail):not(.case-parent)>:not(.toolbar){display:none}
#content.rs-page.rs-page-open>.rs-page-nav{display:flex;align-items:center;gap:8px;margin:10px 0 8px;min-width:0}
#content.rs-page .rs-page-nav button{min-height:0;margin:0;padding:4px 10px;font-size:12px;border:1px solid var(--t-border);border-radius:5px;background:none;color:var(--t-text);box-shadow:none;white-space:nowrap;cursor:pointer}
#content.rs-page .rs-page-nav .rs-page-back{color:var(--t-accent)}
#content.rs-page .rs-page-nav button:hover:not(:disabled){background:var(--t-selected,transparent)}
#content.rs-page .rs-page-nav button:disabled{opacity:.45;cursor:default}
#content.rs-page .rs-page-steps{display:inline-flex;align-items:center;gap:6px;margin-left:auto}
#content.rs-page .rs-page-pos{margin:0 6px;font-size:13px;color:var(--t-muted);font-variant-numeric:tabular-nums}

/* v5.0 (Joseph 2026-11-27 "start with the popup"): the pop-up window (.ws-pop) now also carries .ws-page (section-workspace.js v5.7), so it
   gets the approved full-page title bar: New / Edit-Save / Delete-Cancel / More in the header (record-bar.js), "← Previous  n of N  Next →"
   in words, no buttons under the form. Pop-up only: no "← Back to ..." (the window closes instead) and a ✕ at the end of the top line. */
html:root #content.ws-on.ws-pop .ws-back:not(#ws-x1):not(#ws-x2){display:none!important}
html:root #content.ws-on.ws-pop.ws-page [data-ws="close"]:not(#ws-x1):not(#ws-x2){display:inline-flex!important;align-items:center;justify-content:center;order:4;width:30px;height:28px;margin-left:6px;padding:0;font-size:15px;line-height:1;color:var(--t-text)}
html:root #content.ws-on.ws-pop [data-ws="close"] svg{display:none}
html:root #content.ws-on.ws-pop [data-ws="close"]::before{content:'✕'}

/* v5.1 (Joseph 2026-11-27 "go"): the pop-up on screens OUTSIDE a section (Case Plans, Facility List, Role Groups...) gets the same approved
   title bar as the section pop-up (record-screen.js v7.8): a fixed header on top of the window with "← Previous  n of N  Next →" and ✕,
   the record's title, and the screen's own New / Edit-Save / Delete-Cancel / More (the title-bar group record-bar.js builds) lifted into
   it, so no buttons sit under the form. Page mode (.rs-page) keeps its Back line; the title and ✕ are pop-up only. */
#content.rs-page .rs-rec-title,#content.rs-page .rs-pop-close{display:none}
#content.rs-pop>.rs-page-nav{display:none}
#content.rs-pop.rs-pop-open>.rs-page-nav{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:34px 46px;align-items:center;column-gap:10px;position:fixed;z-index:61;top:5vh;left:var(--oms-pop-x,50%);transform:translateX(-50%);width:min(900px,calc(var(--oms-pop-w,100vw) - 32px));height:92px;box-sizing:border-box;margin:0;padding:8px 14px 4px;border-radius:10px 10px 0 0;background:var(--o-bar,var(--t-raised));box-shadow:inset 0 0 0 1px var(--o-bar-edge,var(--t-border))}
#content.rs-pop.rs-pop-open:has(#rsDetail button[type="submit"][form="rsForm"])>.rs-page-nav{background:var(--o-bar-edit,var(--t-raised));box-shadow:inset 0 0 0 1px var(--o-bar-edit-edge,var(--t-border))}
#content.rs-pop .rs-page-nav .rs-page-back{display:none}
#content.rs-pop .rs-page-nav .rs-page-steps{grid-column:2;grid-row:1;margin-left:0}
#content.rs-pop .rs-page-nav .rs-rec-title{grid-column:1;grid-row:2;margin:0;font-size:19px;font-weight:600;line-height:1.25;color:var(--t-strong,var(--t-text));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#content.rs-pop .rs-page-nav .rs-pop-close{width:30px;padding:0;margin-left:6px;font-size:15px;line-height:1}
#content.rs-pop.rs-pop-open>#rsDetail{top:calc(5vh + 92px);border-radius:0 0 10px 10px}
html:root #content.rs-pop.rs-pop-open>section.panel:not(#rsDetail):not(.case-parent) .rs-toolbar-actions:not(#rs-x1){position:fixed;z-index:62;top:calc(5vh + 50px);right:calc(100vw - var(--oms-pop-x,50vw) - min(450px, var(--oms-pop-w,100vw) / 2 - 16px) + 14px);margin:0;display:inline-flex;align-items:center;gap:4px}
html:root #content.rs-pop.rs-pop-open>section.panel:not(#rsDetail):not(.case-parent) .rs-toolbar-actions .oms-rec-bin:not(#rs-x1){display:none!important}
@media(max-width:760px){#content.rs-pop.rs-pop-open>.rs-page-nav{inset:0 0 auto 0;transform:none;width:auto;border-radius:0;top:0}#content.rs-pop.rs-pop-open>#rsDetail{inset:92px 0 0 0;transform:none;width:auto;border-radius:0}html:root #content.rs-pop.rs-pop-open>section.panel:not(#rsDetail):not(.case-parent) .rs-toolbar-actions:not(#rs-x1){top:50px;right:14px}}
/* v5.1: the list's title bar is sticky (its own layer, under the window), so while the pop-up is open it is lifted above the window but
   made invisible; only its button group shows, placed in the pop-up's header. The page's "← Back to ..." is not shown in the pop-up. */
html:root #content.rs-pop.rs-pop-open>section.panel:not(#rsDetail):not(.case-parent)>.toolbar:has(.rs-toolbar-actions):not(#rs-x1):not(#rs-x2){z-index:62!important;visibility:hidden;pointer-events:none}
html:root #content.rs-pop.rs-pop-open>section.panel:not(#rsDetail):not(.case-parent)>.toolbar .rs-toolbar-actions:not(#rs-x1):not(#rs-x2){visibility:visible;pointer-events:auto}
html:root #content.rs-pop .rs-page-nav .rs-page-back:not(#rs-x1):not(#rs-x2):not(#rs-x3){display:none!important}

/* v5.2 (Joseph 2026-11-27: "right side of the popup window should also have 14px from the edge"): in both pop-ups the form keeps the
   standard 14px on its right too (it already had 14px on the left), so no box touches the window's edge. Pop-up only. */
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.ws-on.ws-pop>#wsSheet #rsDetail>.detailbody:not(#pw1):not(#pw2):not(#pw3):not(#pw4):not(#pw5):not(#pw6):not(#pw7):not(#pw8):not(#pw9):not(#pw10):not(#pw11):not(#pw12){margin-right:13px!important}   /* + the window's 1px line = 14px, the same as its left side */
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.rs-pop.rs-pop-open>#rsDetail>.detailbody:not(#pw1):not(#pw2):not(#pw3):not(#pw4):not(#pw5):not(#pw6):not(#pw7):not(#pw8):not(#pw9):not(#pw10):not(#pw11):not(#pw12){margin-left:13px!important;margin-right:13px!important}   /* both sides: 13px + the window's 1px line = 14px on every screen */
/* (the long :not(#pw..) tail only out-ranks the app-wide rule orbit-layout.css v2.3 "form 14px from the left, 0 on the right") */

/* v5.3 (Joseph 2026-11-27: "leave 14px from the bottom of the form to the bottom of the main form"): in both pop-ups the last thing in the
   record (the Source / Added line, or the last box when there is none) ends 14px above the window's bottom edge: 13px here + the
   window's 1px line. The Source line's own 16px of space under it is dropped in the pop-up so the two do not add up. Pop-up only. */
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.ws-on.ws-pop>#wsSheet>#rsDetail:not(#pb1):not(#pb2):not(#pb3):not(#pb4):not(#pb5):not(#pb6):not(#pb7):not(#pb8):not(#pb9):not(#pb10):not(#pb11):not(#pb12),
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.rs-pop.rs-pop-open>#rsDetail:not(#pb1):not(#pb2):not(#pb3):not(#pb4):not(#pb5):not(#pb6):not(#pb7):not(#pb8):not(#pb9):not(#pb10):not(#pb11):not(#pb12){padding-bottom:13px!important}
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.ws-on.ws-pop>#wsSheet>#rsDetail>.rs-meta:last-child:not(#pb1):not(#pb2):not(#pb3):not(#pb4):not(#pb5):not(#pb6):not(#pb7):not(#pb8):not(#pb9):not(#pb10):not(#pb11):not(#pb12),
html:root:not([data-theme="lcars"]) body.oms-flat #content.record-workspace.rs-pop.rs-pop-open>#rsDetail>.rs-meta:last-child:not(#pb1):not(#pb2):not(#pb3):not(#pb4):not(#pb5):not(#pb6):not(#pb7):not(#pb8):not(#pb9):not(#pb10):not(#pb11):not(#pb12){padding-bottom:0!important;margin-bottom:0!important}

/* v5.4 (Joseph 2026-11-27: "keep the 14px gap from the bottom even if the form shrinks"): both pop-up windows end 14px above the bottom
   of the work area (the top of the page footer) at every window height. Before, the bottom was 5% of the window height, so on a short
   window the pop-up ran over the footer. --oms-footer-h is the footer's measured height (section-workspace.js v6.0). Not on phones
   (there the pop-up is the whole screen). */
@media(min-width:761px){
  html:root #content.ws-on.ws-pop>.ws-sheet:not(#ws-x1):not(#ws-x2){bottom:calc(var(--oms-footer-h,0px) + 14px)}
  html:root #content.rs-pop.rs-pop-open>#rsDetail:not(#rs-x1):not(#rs-x2){bottom:calc(var(--oms-footer-h,0px) + 14px)}
}

/* v5.5 (Joseph 2026-11-27, the lower grid's title line on a section, e.g. Cases > Investigations): the title is not bold and starts at the
   grid's left edge; New sits on the title's line (it used to sit lower, touching the grid); the row count shows like the upper grid's,
   just left of the search icon (record-screen.js v8.1 adds it). The grid itself does not move. */
html:root:not([data-theme="lcars"]) #content.ws-on>.ws-child-panel>.toolbar>h2.ws-child-title:not(#lt1):not(#lt2):not(#lt3):not(#lt4):not(#lt5):not(#lt6):not(#lt7):not(#lt8):not(#lt9):not(#lt10):not(#lt11):not(#lt12){font-weight:400!important}
html:root:not([data-theme="lcars"]) #content.ws-on>.ws-child-panel>.toolbar:not(#lt1):not(#lt2):not(#lt3):not(#lt4):not(#lt5):not(#lt6):not(#lt7):not(#lt8):not(#lt9):not(#lt10):not(#lt11):not(#lt12){padding-left:1px!important}
html:root:not([data-theme="lcars"]) #content.ws-on>.ws-child-panel>.toolbar:not(#lt1):not(#lt2):not(#lt3):not(#lt4):not(#lt5):not(#lt6):not(#lt7):not(#lt8):not(#lt9):not(#lt10):not(#lt11):not(#lt12):not(#lt13){padding-bottom:6px!important}   /* room between New and the grid, on every section */
/* on the Cases screens the title sits 3px higher on its line (orbit-layout.css v4.0, "14px under the dropdowns"), so there New is lifted the
   same way to sit on the title's line; with the 6px above, the grid stays exactly where it was. Same screen list as that v4.0 rule. */
html:root:not([data-theme="lcars"]) main.oms-stepping #content.ws-on.ws-page:is(.case-list-workspace,.referrals-workspace,.offenses-workspace,.arrests-workspace,.victims-workspace,.witnesses-workspace,.codefendants-workspace,.associates-workspace,.warrants-workspace,.adult-violations-workspace,.juvenile-violations-workspace,.conditions-workspace,.hearings-workspace,.sentences-workspace,.places-workspace,.investigations-workspace,.evidences-workspace,.interviews-workspace,.hc-applications-workspace,.grants-and-fundings-workspace,.state-registrations-workspace,.diversion-programs-workspace,.informal-probation-workspace,.djj-status-workspace,.chronos-workspace,.post-sentence-intake-workspace,.prcs-pre-release-workspace,.case-history-workspace,.sentences-and-terms-workspace,.caseload-list-workspace,.caseload-views-workspace,.gang-list-workspace,.gang-members-workspace,.gang-images-workspace,.gang-non-associations-workspace,.incident-list-workspace,.incident-clients-workspace,.incident-staff-workspace,.incident-reviews-workspace,.incident-addenda-workspace,.incident-evidence-workspace,.placement-agency-list-workspace,.placement-agency-residents-workspace,.placement-agency-rates-workspace,.placement-agency-notes-workspace,.program-provider-list-workspace,.program-provider-enrollments-workspace,.victim-list-workspace,.victim-cases-workspace,.victim-addresses-workspace,.victim-contact-info-workspace)>.ws-child-panel>.ws-recbar+.toolbar>.rs-toolbar-actions:not(#cs1):not(#cs2):not(#cs3):not(#cs4):not(#cs5):not(#cs6):not(#cs7):not(#cs8):not(#cs9):not(#lt1):not(#lt2):not(#lt3):not(#lt4):not(#lt5):not(#lt6):not(#lt7):not(#lt8):not(#lt9):not(#lt10):not(#lt11):not(#lt12){align-self:flex-start!important;margin-top:-6px!important}

/* v5.6 (Joseph 2026-11-27 19:59Z: "that panel is rectangular and no need for round edges and spans from edge to edge and add a similar panel for
   the bottom grid"; "the export icons and new ... do not align"): the title bar of the top grid and of the lower grid are the same panel: square
   corners, from the grid's left edge to its right edge, same height and padding, so New and the export icon sit at the same place over both grids.
   The colour is the layout's bar colour (--o-bar); the top bar keeps its Edit colour. */
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25){margin-left:0!important;margin-right:0!important;padding:6px 10px 6px 13px!important;border-radius:6px!important;box-shadow:none!important;box-sizing:border-box!important;min-height:40px!important;align-items:center!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25){margin-top:14px!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(.oms-rec-editing){background:var(--o-bar, var(--ws-parent-bar))!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25)>:is(h2,.rs-toolbar-actions),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25)>:is(h2,.rs-toolbar-actions){align-self:center!important;margin-top:0!important;margin-bottom:0!important}

/* v5.7 (Joseph 2026-11-27 21:54Z: "Why are the buttons on top of grid-grid-record scrolling up ... buttons should always be visible"): when the
   list page itself scrolls (short window, long lower grid) each grid's title panel stays at the top of the work area while its grid is in view:
   the top grid's panel first, then the lower grid's panel takes its place. The panels were "sticky" already but their sections clipped with
   overflow:hidden, which made the section the scroll box, so nothing ever stuck; overflow:clip clips the same without that. */
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25){overflow:clip!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25){position:sticky!important;top:0!important;z-index:7!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(.oms-rec-editing){background-color:var(--o-bar-solid, var(--o-bar, var(--ws-parent-bar)))!important}
/* v5.8 (Joseph 2026-11-27 22:43Z: "make these bars i marked with x rounded again"): the two panels above have 6px corners again (v5.6 made them square). */
/* v5.9 (Joseph 2026-11-27 22:43Z: "and make them stretch all the way to the sides"): the two panels run the full width of the work area (they started at the grid's left edge, 13px in); their titles still start at the grid's left edge. */
/* v5.10 (Joseph 2026-11-27 22:46Z: "on other screen they touch the edges like this", Addresses): the two panels were 1px inside each side of the work
   area (their section has a 1px unseen border); they now sit on it, exactly where the Addresses bar sits. */
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){overflow-clip-margin:1px!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){margin-left:-1px!important;margin-right:-1px!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){margin-top:-1px!important}
/* v5.11 (Joseph 2026-11-27 22:50Z: "the bar marked with the red X moves a bit until the bar touched to top ... it should not move"): the header of a
   record shown as a full page (sheet mode) stuck 5px higher than where it rests (screen-standards.css top:-4px), so it slid up at the start of a
   scroll. It now sticks exactly where it rests; the thin strip over it is painted in the page colour so nothing shows through there. The same
   strip covers the grid title panels of the list. */
html:root:not([data-theme="lcars"]) main #content.ws-on.ws-page>.ws-sheet>.ws-head:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){top:1px!important;box-shadow:0 -6px 0 0 var(--o-page, var(--t-bg, #eef1f5))!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.case-parent>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26),html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){box-shadow:0 -5px 0 0 var(--o-page, var(--t-bg, #eef1f5))!important}
/* v5.12 (Joseph 2026-11-28 00:32Z: "the distance between the top grid, dropdowns and lower grid differ ... should be equidistant and resemble the
   distances on cases screen"): the Cases screens had their own rules for the room around the Select row (14px above it, 14px under it); every
   other section had 21px above. All sections now use the Cases distances. */
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){margin-top:3px!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.ws-recbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){margin-top:0!important;margin-bottom:0!important}
html:root:not([data-theme="lcars"]) main #content.ws-on>.ws-child-panel>.ws-recbar+.toolbar:not(#gp1):not(#gp2):not(#gp3):not(#gp4):not(#gp5):not(#gp6):not(#gp7):not(#gp8):not(#gp9):not(#gp10):not(#gp11):not(#gp12):not(#gp13):not(#gp14):not(#gp15):not(#gp16):not(#gp17):not(#gp18):not(#gp19):not(#gp20):not(#gp21):not(#gp22):not(#gp23):not(#gp24):not(#gp25):not(#gp26){margin-top:14px!important}
