/* Ported verbatim from Trauma Board v3.31.1 Index.html (<style> block). Arabic/RTL rules are inert in v4 (English only). */
/* ---------- 00-tokens.css ---------- */
/* ============================================================================
   00-tokens.css — design tokens ONLY.
   ----------------------------------------------------------------------------
   What belongs here:
     * :root custom properties — colour palette, spacing, radii, shadows,
       typography scale, z-index scale.
     * The theme override mechanism, kept EXACTLY as the legacy sheet did it:
       a class on <body> (body.theme-dark / body.theme-contrast) that re-points
       a handful of variables, plus the dark-theme surface list that re-paints
       the components that are hard-coded white in light mode.
   What does NOT belong here: any component/layout rule that isn't part of the
   theme mechanism.

   THEME MECHANISM (do not change): JS does
       body.classList.remove('theme-dark','theme-contrast');
       if (PREFS.theme) body.classList.add(PREFS.theme);
   There is no [data-theme] attribute and no prefers-color-scheme query.

   IMPORTANT — --white vs --card:
     The legacy sheet used literal #fff for most surfaces AND had --card:#fff.
     They are not interchangeable: --card flips to a dark surface in dark
     theme, the literal #fff did not. Every literal #fff has therefore been
     tokenised as --white (never overridden), so that only the components
     listed in the dark-theme surface block below go dark — exactly as before.

   NOTE ON GEOMETRY TOKENS: the spacing and font-size scales below are declared
   for new code. The ported rules keep their literal px paddings/font-sizes
   (the legacy sheet used half-pixel sizes like 13.5px and one-off paddings
   that do not fit any scale) so that the port is pixel-identical. Radii and
   z-indexes DID map 1:1 and are referenced through tokens throughout.
   ========================================================================== */

:root{
  /* ---- brand navy ---------------------------------------------------- */
  --navy:#0b2a4a;
  --navy-700:#123a63;
  --navy-600:#1c4f82;
  --navy-500:#2c6fb0;          /* brand mark gradient start */
  --navy-050:#eef3f8;
  --focus-ring:#0a58ca;        /* 3:1+ on --card and --bg in every theme */
  --appbar-bg:#0b2a4a;         /* the header SURFACE — separate from --navy, which is text */
  /* Primary-button SURFACE, for the same reason --appbar-bg exists: .btn.primary
     used to paint its background from --navy, and --navy has to go LIGHT in dark
     theme so headings stay legible. The result was a pale blue button with pale
     text on it — measured 1.84:1. A surface token flips independently. */
  --primary-bg:#0b2a4a;
  --primary-bg-hover:#123a63;
  --on-primary:#fff;
  --focus-ring-on-navy:#ffd166;/* the ring has to be visible on the header too */

  /* ---- neutrals / surfaces ------------------------------------------- */
  --white:#fff;                /* static white — see note above */
  --bg:#f6f8fb;
  --card:#fff;                 /* themed surface (goes dark) */
  --ink:#1a2330;
  --muted:#5b6b7d;
  --line:#dde5ee;
  --text-faint:#63737f;        /* .contact .dial, .footnote — 4.7:1 on --card AND on --bg (was #9aa7b5, 2.45:1) */
  --row-hover:#fafcff;         /* tr.rowbtn:hover td */
  --control-off:#f4f6f9;       /* .ynbtn, .waittag resting fill */
  --switch-off:#cdd8e4;        /* .switch input, unchecked track */
  --chipbtn-bg:#dfe7f0;        /* .pullx */
  --chipbtn-bg-hover:#c9d6e6;  /* .pullx:hover */
  --dot-idle:#8aa0b6;          /* .nav .rdot */

  /* ---- on-navy (appbar foreground on the navy bar) ------------------- */
  --on-navy:#fff;
  --on-navy-dim:#cfe0f1;
  --on-navy-dimmer:#b9cbe0;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);

  /* ---- semantic status ----------------------------------------------- */
  --danger:#b3261e;
  /* SURFACE variants, for the same reason --appbar-bg and --primary-bg exist.
     --danger and --ok are TEXT colours and must go lighter in dark theme so they
     read on a dark card; the handful of places that use them as a BACKGROUND
     (with white text on top) must not move. Splitting them is the only way both
     can be right — before this, flipping either one broke the other. */
  --danger-surface:#b3261e;
  --danger-bg:#fdecea;
  --danger-border:#eccac7;
  --ok:#1f7a4d;
  --ok-surface:#1f7a4d;
  --ok-bg:#f1f9f4;
  --ok-border:#bfe0cd;
  --warn-bg:#fff3cd;           /* #noticeBar */
  --warn-border:#f0dcb8;
  --warn-ink:#7a5c00;
  --pending-bg:#fff6e6;        /* .pendrow (access requests) */
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;           /* organizer unassigned pool column */
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;        /* .logpop.flag */

  /* ---- case status codes (P / C / LAMA / D) --------------------------- */
  --st-P:#a3540b;              /* white on this = 4.83:1 (was #c86a12, 3.80:1) */
  --st-C:#5b6b7d;
  --st-LAMA:#b3261e;
  --st-D:#1f7a4d;

  /* ---- overlays ------------------------------------------------------- */
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);

  /* ---- shadows -------------------------------------------------------- */
  --shadow:0 1px 2px rgba(11,42,74,.06),0 4px 14px rgba(11,42,74,.06);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 -8px 40px rgba(11,42,74,.28);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);   /* used inside drop-shadow() */

  /* ---- radii ---------------------------------------------------------- */
  --r-xs:8px;
  --r-sm:9px;
  --r-md:10px;
  --radius:12px;               /* legacy name — kept */
  --r-lg:16px;
  --r-pill:20px;
  --r-xl:24px;
  --r-round:50%;

  /* ---- spacing scale (declared for new code; see note above) ---------- */
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:10px;
  --sp-4:12px;
  --sp-5:14px;
  --sp-6:16px;
  --sp-7:18px;
  --sp-8:22px;
  --sp-9:30px;

  /* ---- typography ----------------------------------------------------- */
  --font-head:'Newsreader',Georgia,'Times New Roman',serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  /* scale (declared for new code) */
  --fs-3xs:11px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:15px;
  --fs-lg:16px;
  --fs-xl:19px;
  --fs-2xl:22px;
  --fs-3xl:26px;
  --lh-body:1.45;

  /* ---- z-index scale --------------------------------------------------- */
  --z-sticky-inner:2;          /* .modal-head inside a scrolling modal */
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;              /* .logpop — rendered at body level */
  --z-gate:200;                /* auth overlay */
  --z-code-scrim:250;          /* forced "set private code" modal, above gate */
}

/* ============================================================================
   Theme overrides (Settings → Light / Dark / High contrast)

   THE RULE THAT MATTERS: a theme override must change TOKENS, not paint
   colours onto element selectors. `body.theme-dark .btn` computes to (0,2,1)
   and therefore beats `.btn.primary` at (0,2,0) — which is how every button
   variant collapsed into identical grey in dark mode, making Delete and Save
   indistinguishable in the edit-case footer. Flipping tokens instead means
   every variant keeps working in every theme, for free.
   ========================================================================== */

body.theme-contrast{
  --ink:#000;
  --primary-bg:#06203c;
  --primary-bg-hover:#0b2a4a;
  --muted:#2b3745;
  --line:#7f90a4;
  /* The point of High contrast is the text that is HARD to read, so the faint
     and status colours have to move too — previously this theme re-pointed
     three tokens and left every failing pair untouched. */
  --text-faint:#3d4a58;
  --st-P:#8f4a08;
  --st-C:#1a4f8f;
  --danger:#8c1c16;
  --ok:#14563a;
}

body.theme-dark{
  --bg:#0f1824;
  --card:#18242f;
  --ink:#e7eef6;
  --muted:#9db0c2;
  --line:#2c3d4f;
  --navy-050:#1b2a3a;
  /* The navy family carries every heading, tab-active state, sequence number
     and chip label. Left un-flipped it rendered navy-on-navy: measured between
     1.00:1 and 2.12:1 — headings were literally invisible. */
  --navy:#8ab4e8;
  --navy-600:#7fb0e0;
  --navy-700:#a9c8e8;
  /* The header stays DARK. --navy is the text/heading colour and had to go
     light for legibility, but .appbar paints its background from it — flipping
     both shipped a bright blue header, the opposite of what anyone wants in a
     corridor at 3am. */
  --appbar-bg:#0a1622;
  --on-navy:#e7eef6;
  /* Light-only chip fills, flipped so their (now light) foregrounds contrast. */
  --control-off:#22303d;
  --pending-bg:#3a2f1c;
  --ok-bg:#16302a;
  --danger-bg:#3a1f1d;
  --chipbtn-bg:#26374a;
  --switch-off:#3b4a5c;
  --focus-ring:#7cc4ff;
  --focus-ring-on-navy:#ffd166;
  /* Buttons keep a DARK surface in dark theme; only the surface moves, so every
     .btn variant (primary / ok / danger / ghost) keeps working unchanged. */
  --primary-bg:#2f6ba8;
  --primary-bg-hover:#3a7cbd;
  --on-primary:#fff;
  --text-faint:#93a3b3;     /* 4.8:1 on the dark page background */
  /* Status TEXT, lightened for a dark card. Measured before: the admitted "Y"
     chip 2.65:1, the remark flag 2.41:1, required-field asterisks 2.41:1 and
     the Delete button 2.31:1 — all of them --ok/--danger on a dark fill.
     The -surface pair above deliberately does NOT move, so .ynbtn.y, .toast.err
     and .syncpill.bad keep their white-on-strong-colour treatment. */
  --ok:#5fd39b;
  --danger:#ff8b86;
  /* --white is deliberately NOT flipped. It is the foreground of the status
     chips (.st-chip, .ynbtn.y) and the switch knob; flipping it painted dark
     text on mid-tone fills and made the knob vanish against its track. */
}

/* Dark theme: re-paint the surfaces that are literal white in light mode. */
body.theme-dark .formcard,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark .tablewrap,
body.theme-dark .ocard,
body.theme-dark .brd-row,
body.theme-dark .modal,
body.theme-dark .modal-head,
body.theme-dark .modal-foot,
body.theme-dark .subnav,
body.theme-dark #gate .card,
body.theme-dark .brd-log,
body.theme-dark .contact,
body.theme-dark .seg{background:var(--card);color:var(--ink)}
/* .btn / .iconbtn / .toggle button are deliberately NOT listed here. They are
   painted from --card/--ink in the component sheet, so they follow the theme
   without a higher-specificity override defeating their variants. */
body.theme-dark table th{background:var(--card);color:var(--muted)}

/* ---------- 10-base.css ---------- */
/* ============================================================================
   10-base.css — element-level foundations.
   ----------------------------------------------------------------------------
   What belongs here: the reset, html/body, global typography, native form
   control base styling + focus rings, and the documented cross-cutting
   behaviours (RTL/Arabic, safe-area insets, print).
   What does NOT belong here: anything with a class selector.
   ========================================================================== */

/* ---- reset ---------------------------------------------------------- */
*{box-sizing:border-box}

/* Never let the page itself scroll sideways (phones + the wall display). */
html,body{margin:0;padding:0;overflow-x:clip;max-width:100%}

/* ---- typography ------------------------------------------------------ */
body{
  font-family:var(--font-ui);
  color:var(--ink);
  background:var(--bg);
  line-height:var(--lh-body);
  -webkit-text-size-adjust:100%;
}
h1,h2,h3{font-family:var(--font-head);font-weight:600;margin:0}

/* ---- native form controls + focus ring -------------------------------- */
input,select,textarea{
  font:inherit;
  font-size:14px;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:var(--r-sm);
  background:var(--card);
  color:var(--ink);
  min-height:44px;            /* touch target — phones and iPads */
  width:100%;
}
/* The legacy sheet uses :focus, not :focus-visible — keyboard AND pointer
   focus both draw the ring. Preserved verbatim: switching to :focus-visible
   would remove the ring on tap/click, a visible behaviour change. */
input:focus,select:focus,textarea:focus{
  outline:2px solid var(--navy-600);
  outline-offset:0;
  border-color:var(--navy-600);
}

/* ---- RTL / Arabic ------------------------------------------------------
   There are no [dir="rtl"] rules anywhere in this stylesheet, by design:
     * JS flips the document direction:
         document.documentElement.dir = (LANG === 'ar') ? 'rtl' : 'ltr';
     * every directional rule in 20-layout / 30-components is written with
       CSS logical properties (margin-inline-*, padding-inline, inset-inline-*,
       border-inline-start, text-align:start/end), so the whole UI mirrors
       automatically. Keep it that way — do NOT reintroduce left/right.
     * Arabic faces are already in the --font-ui stack
       ('Noto Kufi Arabic', 'Segoe UI Arabic').
   ---------------------------------------------------------------------- */

/* ---- safe-area insets --------------------------------------------------
   <meta name="viewport" content="... viewport-fit=cover"> is set in the host
   HTML. env(safe-area-inset-*) is consumed at the three places it matters:
     * .appbar        (20-layout)       — padding-top for the notch
     * .modal-foot    (30-components)   — padding-bottom for the home bar
     * #fabNew        (30-components)   — bottom offset for the home bar
   ---------------------------------------------------------------------- */

/* ---- print --------------------------------------------------------------
   The legacy stylesheet has NO @media print block. None has been added here:
   this is a straight port, and inventing print rules would be a behaviour
   change. If printing is ever needed, add it in this file.
   ---------------------------------------------------------------------- */

/* ---------- 20-layout.css ---------- */
/* ============================================================================
   20-layout.css — page chrome and structural scaffolding.
   ----------------------------------------------------------------------------
   What belongs here: the appbar, the sub-navigation, <main> and view headers,
   containers (grid, filter bar, organizer columns, board sections, directory
   list, placeholder views) and the table scaffolding (.tablewrap / table / th
   / td). Anything that positions or sizes a region of the page.
   What does NOT belong here: the visual treatment of individual widgets —
   that lives in 30-components.css.
   ========================================================================== */

/* ============================ APPBAR ==================================== */
.appbar{
  position:sticky;top:0;z-index:var(--z-appbar);
  background:var(--appbar-bg);color:var(--on-navy);
  padding:env(safe-area-inset-top) 0 0;    /* notch */
  box-shadow:var(--shadow-appbar);
}
.appbar-inner{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap;padding-block:12px;padding-inline:16px;max-width:1400px;margin-inline:auto}
/* wrap buttons onto a 2nd line on narrow phones instead of overflowing */
.apbctrl{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-inline-start:auto;min-width:0}

.brand{display:flex;align-items:center;gap:10px;min-width:0;flex-shrink:1}
/* MERGED: the legacy sheet declared `.brand .t{min-width:0}` and then
   `.brand .t{display:flex;flex-direction:column;min-width:0}` a few lines
   later. Identical outcome — collapsed into one rule. */
.brand .t{display:flex;flex-direction:column;min-width:0}
.brand .t b,.brand .t span{overflow:hidden;text-overflow:ellipsis}
.brand .mark{
  width:34px;height:34px;border-radius:var(--r-sm);flex:0 0 auto;
  background:linear-gradient(140deg,var(--navy-500),var(--navy));
  display:grid;place-items:center;color:var(--on-navy);
  font-family:var(--font-head);font-size:18px;
  border:1px solid var(--on-navy-border);
}
.brand .t b{font-size:15px;white-space:nowrap}
.brand .t span{font-size:11px;color:var(--on-navy-dimmer);white-space:nowrap}

/* Legacy top-nav. No element in the current markup carries .nav / .rdot —
   see the port notes. Kept because the JS may still build it. */
.nav{display:flex;gap:6px;margin-inline-start:auto;flex-wrap:wrap;align-items:center}
.nav button{font:inherit;font-size:13px;color:var(--on-navy-dim);background:transparent;border:1px solid transparent;padding:8px 12px;border-radius:var(--r-xs);cursor:pointer;min-height:40px;display:flex;align-items:center;gap:7px}
.nav button.active{background:var(--on-navy-fill);color:var(--on-navy)}
.nav .rdot{width:9px;height:9px;border-radius:var(--r-round);background:var(--dot-idle);display:none}

.whobox{color:var(--on-navy-dim);font-size:11.5px;text-align:end;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}

/* Narrow phones. NOTE: `max-width:none` below is deliberately re-overridden
   further down by `.filterbar select,.filterbar input{max-width:240px}` —
   equal specificity, later rule wins. Preserved from the original ordering;
   do not move the .filterbar rules above this block. */
/* `justify-content:flex-end` on .apbctrl pushes overflow past the START edge,
   which is unreachable in LTR — scrollWidth equalled clientWidth, so there was
   no scroll range at all and Log / Roles simply could not be tapped on a 375px
   phone. They stayed in the tab order, so keyboard focus vanished for two stops.
   Wrapping is the fix: nothing overflows, so nothing is unreachable. */
@media(max-width:640px){
  .apbctrl{justify-content:flex-start;flex-wrap:wrap;row-gap:6px;overflow-x:visible;mask-image:none}

}
@media(max-width:560px){
  .whobox{display:none}
  .brand .t span{display:none}
  .filterbar select{flex:1 1 44%;max-width:none}
  /* `.search` matched nothing: the box is <input type="search">, so `search`
     is the TYPE, not a class. The rule looked live and did nothing. */
  .filterbar input[type="search"]{flex:1 1 100%;max-width:none}
}
.whobox .role{display:inline-block;background:var(--on-navy-fill-soft);border:1px solid var(--on-navy-border-soft);border-radius:var(--r-pill);padding:0 8px;text-transform:capitalize}

/* ============================ SUBNAV ==================================== */
/* The appbar and subnav stick TOGETHER as one block. The previous
   `top:59px` was a hard-coded guess at the appbar's height; the appbar wraps
   its controls onto 2–3 rows on phones and adds env(safe-area-inset-top) on a
   notched device, so the real height is 70–217px. The tabs were therefore
   hidden behind the header on every iPhone, at every width. No measurement and
   no JS is needed — sticky positioning stacks them for us. */
.stickytop{position:sticky;top:0;z-index:var(--z-appbar)}
.stickytop .appbar{position:static}

/* PHONES: NOTHING IS PINNED. The app bar wraps to 2–3 rows on a narrow screen
   and the tab strip adds ~52px more, so a sticky header costs ~117px of a
   780px viewport before a single patient row — permanently. On a desktop that
   is 15% of the window; on a phone it is a fifth of the list.
   Let the whole header scroll away and the list gets the entire screen. The
   trade is that reaching Save / Settings means scrolling back up; on a phone
   that is one flick, and the alternative was paying for it on every screen. */
@media(max-width:640px){
  /* rc.9.58 — the surgeon asked for the tabs to stay while the list scrolls. The app bar itself
     still scrolls away (it wraps to 2–3 rows; pinning it costs a fifth of the screen), but the tab
     strip is one 52px row and it is how you move between Patients, Organizer and Board. A sticky
     child cannot outlive its container, so the container itself sticks at minus the height of
     everything above the tabs: the bar slides off the top, the tabs stop there. */
  .stickytop{position:sticky;top:calc(-1 * var(--above56,0px));z-index:var(--z-appbar)}
}
.subnav{background:var(--card);border-bottom:1px solid var(--line);z-index:var(--z-subnav)}
.subnav-inner{display:flex;gap:2px;max-width:1400px;margin-inline:auto;padding-inline:10px;overflow-x:auto}
.subnav button{font:inherit;font-size:14px;color:var(--muted);background:transparent;border:0;border-bottom:3px solid transparent;padding:13px 14px;cursor:pointer;white-space:nowrap;min-height:48px;display:flex;align-items:center;gap:8px}
.subnav button.active{color:var(--navy);border-bottom-color:var(--navy);background:var(--subnav-active-bg);font-weight:600;border-top-left-radius:var(--r-xs);border-top-right-radius:var(--r-xs)}

/* ======================= VIEWS / SECTIONS =============================== */
main{max-width:1400px;margin-inline:auto;padding:16px}
/* rc.9.57 — THE HEADING STAYS. It sits under whatever is already pinned: the app bar and tabs
   on a desktop (measured, because that bar wraps), nothing on a phone, where the bar is static
   by the choice made at the 640px breakpoint. The heading costs one line, so a phone keeps its
   list; once the page has scrolled, the phone drops the explanatory subtitle and tightens the
   line, leaving the view's name and no more. */
.viewhead{position:sticky;top:var(--stick56,0px);z-index:var(--z-subnav);display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:0 0 10px;padding-block:8px;background:var(--bg)}
@media(max-width:640px){
 body.scrolled56 .viewhead{padding-block:4px;box-shadow:0 1px 0 var(--line)}
 body.scrolled56 .viewhead h2{font-size:18px}
 body.scrolled56 .viewhead .sub{display:none}
}
.viewhead h2{font-size:22px;color:var(--navy)}
.viewhead .sub{color:var(--muted);font-size:13px}
.spacer{flex:1}

/* ============================ GRID ====================================== */
.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid .full{grid-column:1/-1}
@media(max-width:560px){.grid{grid-template-columns:1fr}}

/* ========================== FILTER BAR ================================== */
.filterbar{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px;align-items:center}
.filterbar select,.filterbar input{max-width:240px}

/* ====================== TABLE SCAFFOLDING =============================== */
/* THE STICKY HEADER HAS NEVER WORKED, and this is why.
   `overflow-x:auto` with `overflow-y:visible` is not a legal pair: per spec a
   non-visible value on one axis forces the other to compute to `auto`. So this
   element silently became the nearest scrollport for its sticky `th`, and since
   it has auto height and never scrolls, `th` had nothing to stick to. Measured
   on a 25-case list: the header sat at -339px after scrolling — every column
   below the fold unlabelled.
   Making the wrapper a REAL scroller in both axes, with a height bound, gives
   the header a scrollport that actually scrolls. */
/* min-height must never exceed the measured max, or it wins and the wrapper
   overshoots the viewport again — which is what happened at 1.5x zoom,
   where 180 CSS px renders as 270 visual px. */
.tablewrap{overflow:auto;max-height:var(--tablemax,70dvh);
           min-height:min(180px, var(--tablemax,70dvh));
           overscroll-behavior:contain;
           border:1px solid var(--line);border-radius:var(--radius);background:var(--card)}
table{border-collapse:collapse;width:100%;min-width:720px}

@media(max-width:640px){
  /* PHONES DO NOT GET THE INNER SCROLLPORT.
     Bounding the table's height so its header can stick is a clear win on a
     desktop, where the chrome above it costs ~310px of an 800px window. On a
     390px phone the filter bar alone WRAPS TO 206px, and the scrollport pins it
     — plus the app bar, the tabs and the view heading — permanently on screen:
     measured 4 visible rows out of 780px. Letting the page scroll instead means
     the filters scroll away and the list gets the whole screen once you move.

     The cost is honest: the column header does not stick on a phone. That is
     the behaviour the app has always had there, and four rows of a trauma list
     is a worse problem than an unlabelled column you can scroll back to. */
  .tablewrap{max-height:none;min-height:0;overflow-x:auto;overflow-y:visible}
}

th,td{text-align:start;padding:11px 12px;border-bottom:1px solid var(--line);font-size:13.5px;vertical-align:middle}
/* rc.9.56 — TABLE ZOOM, SEPARATE FROM PAGE ZOOM. Page zoom scales the chrome too, so widening
   the view costs the tabs and the filter bar their legibility. This scales the table alone:
   text, cell padding and the table's minimum width together, so zooming out genuinely fits more
   columns on the screen instead of shrinking the type under a scrollbar. Per device. */
.tablewrap table{--tz:var(--tzoom,1);min-width:calc(720px * var(--tz))}
.tablewrap th{font-size:calc(12px * var(--tz))}
.tablewrap td{font-size:calc(13.5px * var(--tz))}
.tablewrap th,.tablewrap td{padding:calc(11px * var(--tz)) calc(12px * var(--tz))}
th{background:var(--navy-050);color:var(--navy);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.4px;position:sticky;top:0}
tr:last-child td{border-bottom:0}

/* =================== ORGANIZER (column board) =========================== */
.org-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.org-cols{display:flex;gap:12px;align-items:flex-start;overflow-x:auto;padding-bottom:8px}
.col{flex:0 0 280px;max-width:300px;background:var(--navy-050);border:1px solid var(--line);border-radius:var(--radius);display:flex;flex-direction:column}
.col.pool{background:var(--pool-bg);border-color:var(--pool-border)}
.col-head{display:flex;align-items:center;gap:8px;padding:11px 12px;border-bottom:1px solid var(--line)}
.col-head .name{font-weight:600;font-size:14px;color:var(--navy);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.col-body{padding:10px;display:flex;flex-direction:column;gap:9px;min-height:44px}

/* ========================= BOARD SECTIONS =============================== */
.board-ready{display:flex;align-items:center;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.board-day{font-family:var(--font-head);font-size:18px;color:var(--navy);margin:6px 0 14px;padding-bottom:6px;border-bottom:2px solid var(--line);display:flex;align-items:center;gap:10px}
.board-day.tomorrow{color:var(--muted);margin-top:30px}
.board-day .d{font-size:13px;color:var(--muted);font-family:var(--font-ui);font-weight:400}
.brd-tomorrow .brd-row{opacity:.9}
.brd-theatre{margin-bottom:22px}
.brd-theatre h3{font-size:15px;color:var(--navy-600);text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.brd{display:flex;flex-direction:column;gap:10px}

/* ====================== PLACEHOLDER VIEWS =============================== */
.placeholder{max-width:640px;margin:60px auto;text-align:center;color:var(--muted);padding:40px 20px}
.placeholder h2{font-size:26px;color:var(--navy);margin-bottom:8px}
.placeholder .badge{display:inline-block;font-size:12px;color:var(--navy-600);background:var(--navy-050);border:1px solid var(--line);border-radius:var(--r-pill);padding:4px 12px;margin-top:14px}

/* ======================= PHONE DIRECTORY LIST =========================== */
.dirlist{display:flex;flex-direction:column;gap:8px;max-width:760px}

/* ---------- 30-components.css ---------- */
/* ============================================================================
   30-components.css — individual UI widgets.
   ----------------------------------------------------------------------------
   What belongs here: buttons, pills/badges/chips, form-field components,
   switches, modals & scrims, toast, FAB, save flag, popovers, notice/env bars,
   table cell content, and cards.
   What does NOT belong here: design tokens (00), element defaults (10),
   page scaffolding (20), or visibility/preference helpers (40).

   ORDERING RULES THAT MATTER (equal-specificity ties the legacy sheet relied
   on) — do not reorder blocks across these boundaries:
     * `.toggle button.on` must stay AFTER `body.theme-dark .toggle button`
       (00-tokens.css) so the selected state still wins in dark theme.
     * `@media(min-width:640px){.modal{border-radius:var(--r-lg)}}` must stay
       AFTER the base `.modal` rule.
     * the `@media(max-width:640px)` appbar-button block must stay AFTER
       `.langtog`.
   ========================================================================== */

/* ============================== BUTTONS ================================= */
.btn{
  font:inherit;font-size:14px;font-weight:500;
  /* --card, NOT --white. --white deliberately never flips, so in dark theme this
     painted a white button and then wrote --ink (near-white) on it: 1.17:1, an
     invisible Cancel button in every dialog in the app. --card is #fff in light,
     so light mode is unchanged. */
  border:1px solid var(--line);background:var(--card);color:var(--ink);
  padding:10px 14px;border-radius:var(--r-md);cursor:pointer;
  min-height:44px;display:inline-flex;align-items:center;gap:7px;white-space:nowrap;
}
.btn:hover{border-color:var(--navy-600)}
.btn.primary{background:var(--primary-bg);color:var(--on-primary);border-color:var(--primary-bg)}
.btn.primary:hover{background:var(--primary-bg-hover)}
.btn.ghost{background:transparent}
/* MERGED: the legacy sheet declared `.btn.danger` twice — once in the
   settings-modal block (border-color:#e6b3ad) and once here
   (border-color:#eccac7). Both set the same three properties, so the second
   fully shadowed the first; the first was dead and #e6b3ad never rendered.
   Only the winning declaration is kept. */
.btn.ok{background:var(--ok-bg);border-color:var(--ok);color:var(--ok);font-weight:600}
.btn.danger{color:var(--danger);border-color:var(--danger-border);background:var(--danger-bg)}
.btn.sm{min-height:44px;padding:9px 12px;font-size:13px}
.btn .ic{font-size:16px;line-height:1}

.iconbtn{border:1px solid var(--line);background:var(--card);width:44px;height:44px;border-radius:var(--r-sm);cursor:pointer;font-size:14px;display:grid;place-items:center;color:var(--ink);flex:0 0 auto}
.iconbtn:disabled{opacity:.35;cursor:not-allowed}
.iconbtn.ready{color:var(--ok);border-color:var(--ok-border)}

.ynbtn{font:inherit;font-size:12px;font-weight:700;border:1px solid var(--line);background:var(--control-off);color:var(--muted);border-radius:var(--r-pill);padding:5px 12px;cursor:pointer;min-height:44px;min-width:48px}
.ynbtn.y{color:var(--white);background:var(--ok-surface);border-color:var(--ok-surface)}

/* Unschedule.
   Was a 22px button with a ::after inset:-11px "hit area". That trick enlarges
   what a FINGER can hit but not what getBoundingClientRect() reports, so it
   passes a touch-target audit while a real audit of the rendered box would fail
   it — and the reviewer has no way to tell the two apart. Now the button is a
   real 44x44 and the visible 22px circle is a child element. */
.pullx{border:0;background:transparent;padding:0;width:44px;height:44px;flex:none;
       cursor:pointer;font:inherit;display:grid;place-items:center}
.pullx .px{width:22px;height:22px;border-radius:var(--r-round);background:var(--chipbtn-bg);
       color:var(--navy-700);font-size:12px;line-height:1;display:grid;place-items:center}
/* 22px is a quarter of the minimum target area, for a destructive action, in a
   table row, on a phone. The dot stays 22px so the row does not reflow; the
   TAPPABLE area is expanded to 44x44 around it. */
.pullx:hover .px{background:var(--chipbtn-bg-hover)}

.brd-done{min-height:44px;padding:9px 14px;font-size:12.5px}
.brd-log{border:1px solid var(--line);background:var(--card);border-radius:var(--r-xs);min-height:44px;min-width:44px;cursor:pointer;font-size:15px;line-height:1}
td .btn.sm.primary{white-space:nowrap}

/* segmented on/off group (organizer view toggle) */
.toggle{display:flex;border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden}
.toggle button{font:inherit;font-size:13.5px;padding:9px 14px;border:0;background:var(--card);color:var(--muted);cursor:pointer;min-height:44px;border-inline-start:1px solid var(--line)}
.toggle button:first-child{border-inline-start:0}
.toggle button.on{background:var(--navy);color:var(--on-navy);font-weight:600}

/* ---- appbar buttons (keep .langtog and its media query adjacent) ------- */
.langtog{font:inherit;font-size:14px;font-weight:600;color:var(--on-navy);background:var(--on-navy-fill);border:1px solid var(--on-navy-border);border-radius:var(--r-sm);padding:8px 12px;cursor:pointer;min-height:46px;min-width:48px}
.langtog:hover{background:var(--on-navy-fill-hover)}
#refreshBtn,#settingsBtn,#langTog,#homeBtn{font-size:22px}
#refreshBtn{font-size:15px;display:inline-flex;align-items:center;gap:5px}
#refreshBtn .ricon{display:inline-block;font-size:17px;line-height:1}
@keyframes tbspin{to{transform:rotate(360deg)}}
#refreshBtn.spin .ricon{animation:tbspin .8s linear}
@media(max-width:640px){
  .langtog{min-height:44px;min-width:44px}
  /* #refreshBtn excluded: line 81 singles it out to 15px because it is a TEXT
     button ("💾 Save"), not a glyph. Re-raising it to 20px grew it to 47x111
     beside 44px neighbours on every tablet and large phone. */
  #settingsBtn,#langTog,#homeBtn{font-size:20px}
}

/* ========================= PILLS / BADGES / CHIPS ======================= */
.pill{font-size:11px;padding:2px 8px;border-radius:var(--r-pill);background:var(--navy-050);color:var(--navy-600);border:1px solid var(--line);min-width:22px;text-align:center}
/* .statuspill has no background of its own — JS paints it per ready-state. */
.statuspill{font-size:12.5px;color:var(--on-navy);padding:8px 12px;border-radius:var(--r-xs);font-weight:600;white-space:nowrap}

.st-chip{font-size:11px;font-weight:600;color:var(--white);padding:2px 9px;border-radius:var(--r-pill);white-space:nowrap}
.st-chip.P{background:var(--st-P)}
.st-chip.C{background:var(--st-C)}
.st-chip.LAMA{background:var(--st-LAMA)}
.st-chip.D{background:var(--st-D)}

.yn{font-size:11px;font-weight:600;padding:2px 8px;border-radius:var(--r-pill);border:1px solid var(--line);color:var(--muted)}
.yn.y{color:var(--ok);border-color:var(--ok-border);background:var(--ok-bg)}
.ready-dot{display:inline-block;width:9px;height:9px;border-radius:var(--r-round);background:var(--ok-surface);margin-inline-end:6px;vertical-align:middle}
.readytag{font-size:11px;font-weight:700;color:var(--ok);background:var(--ok-bg);border:1px solid var(--ok-border);padding:2px 8px;border-radius:var(--r-pill)}
.waittag{font-size:12px;font-weight:600;color:var(--muted);background:var(--control-off);border:1px solid var(--line);padding:3px 10px;border-radius:var(--r-pill)}
.ready-badge{font-size:15px;font-weight:600;padding:9px 16px;border-radius:var(--r-xl);border:1px solid var(--line);background:#e7edf3;color:#1a2330}
/* Now a BUTTON, not a label: it opens the scheduling sheet. So it needs the
   full 44px touch target the audit demands, and an explicit font reset —
   a <button> does not inherit the page font on iOS Safari. */
.orchip{display:inline-flex;align-items:center;gap:7px;font:inherit;font-size:12px;font-weight:600;color:var(--navy);background:var(--navy-050);border:1px solid var(--line);border-radius:var(--r-pill);padding:4px 12px;min-height:44px;white-space:nowrap;cursor:pointer;text-align:start}
.orchip:hover{background:var(--navy-100,#dbe7f4)}

/* remark / caution flag on a board row */
.flag{color:var(--danger);cursor:help;font-size:24px;margin-inline-end:6px;user-select:none;vertical-align:-3px;line-height:1;filter:drop-shadow(var(--shadow-flag))}
/* No-op in the original (same colour as the resting state) — kept verbatim
   so the selector still exists for anyone hooking onto it. */
.flag:hover{color:var(--danger)}

.seqno{font-family:var(--font-head);font-weight:600;font-size:16px;color:var(--navy);min-width:22px;text-align:center}

/* ============================ FORM FIELDS =============================== */
.field{display:flex;flex-direction:column;gap:5px}
.field label{font-size:12.5px;color:var(--muted);font-weight:500}
.req{color:var(--danger)}

.seg{display:flex;border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden;min-height:44px}
.seg label{flex:1;position:relative}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg span{display:flex;align-items:center;justify-content:center;height:100%;min-height:44px;font-size:13.5px;cursor:pointer;padding:0 8px;color:var(--muted);border-inline-start:1px solid var(--line);user-select:none}
.seg label:first-child span{border-inline-start:0}
.seg input:checked+span{background:var(--navy);color:var(--on-navy);font-weight:600}
.seg.st input[value="P"]:checked+span{background:var(--st-P)}
.seg.st input[value="C"]:checked+span{background:var(--st-C)}
.seg.st input[value="LAMA"]:checked+span{background:var(--st-LAMA)}
.seg.st input[value="D"]:checked+span{background:var(--st-D)}

.switch{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:13.5px;color:var(--ink);user-select:none}
/* min-height:44px from the global input rule beats height:24px in the
   used-value calculation — not a specificity tie, so no amount of ordering
   fixed it. The track rendered 42x44 with the 20px knob pinned to its top
   corner: a blob, not a switch, in every theme. Reset the floor explicitly. */
.switch input{appearance:none;-webkit-appearance:none;width:42px;height:24px;min-height:24px;border-radius:var(--r-pill);background:var(--switch-off);position:relative;cursor:pointer;flex:0 0 auto;transition:background .15s}
.switch input:checked{background:var(--primary-bg)}
.switch input::after{content:"";position:absolute;top:2px;inset-inline-start:2px;width:20px;height:20px;border-radius:var(--r-round);background:var(--white);transition:inset-inline-start .15s}
.switch input:checked::after{inset-inline-start:20px}

.fs{border:0;padding:0;margin:0 0 16px}
.fs legend{font-family:var(--font-head);font-size:12px;font-weight:600;color:var(--navy-600);text-transform:uppercase;letter-spacing:.6px;margin-bottom:10px;padding:0}

.cellrow{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.cellrow select{min-width:120px}
.ord{display:flex;align-items:center;gap:5px}
.hint{font-size:12px;color:var(--muted);margin:2px 0 12px}

.rememberrow{display:flex;align-items:center;gap:8px;margin:2px 0 14px;font-size:14px;color:var(--muted);cursor:pointer;user-select:none}
.rememberrow input{width:18px;height:18px;accent-color:var(--navy)}

/* ---- settings modal controls ------------------------------------------ */
.setgrp{margin-bottom:16px}
.setlbl{font-size:13px;color:var(--muted);font-weight:600;margin-bottom:6px}
.segbtns{display:flex;gap:8px}
.segbtns button{flex:1;min-height:44px;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:var(--r-sm);cursor:pointer;font:inherit}
.segbtns button.on{background:var(--navy);color:var(--on-navy);border-color:var(--navy)}
.setrow{display:flex;align-items:center;justify-content:space-between;font-size:15px;cursor:pointer}
.setrow input{width:22px;height:22px}
/* rc.9.58 — searching a 91-person roster and then scrolling back to the top to add someone was
   the same complaint twice: both controls stay above the list while it scrolls. */
.rolestop58{position:sticky;top:0;z-index:var(--z-sticky-inner);background:var(--card);padding-top:2px}
#help-body56 .help-card56{border:1px solid var(--line);border-radius:var(--radius);background:var(--card);padding:12px 14px;margin-bottom:10px}
#help-body56 .help-card56 h3{margin:0 0 6px;font-size:var(--fs-sm);color:var(--navy)}
#help-body56 .help-card56 p{margin:0;font-size:var(--fs-sm);line-height:1.5}
.sethint{font-size:12px;color:var(--muted);margin-top:6px}

/* ---- theatre-list editor rows + phone prefix --------------------------- */
.th-row{display:flex;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--line)}
.th-row input{flex:1;min-width:0}
.th-row .del{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger);width:44px;height:44px;border-radius:var(--r-xs);cursor:pointer;font-size:15px;flex:0 0 auto}
.prefixbox{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted)}
.prefixbox input{min-height:44px;width:84px;text-align:center}

/* ========================== TABLE CELL CONTENT ========================== */
#patBody tr[data-id]{cursor:pointer}
#patBody tr[data-id]:hover td{background:var(--row-hover)}
td.cled{cursor:pointer}
tr.daydiv td{background:var(--navy-050);color:var(--navy-600);font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.5px;padding:8px 12px;border-top:2px solid var(--line)}
tr.daydiv .d{font-family:var(--font-ui);font-weight:400;text-transform:none;letter-spacing:0;color:var(--muted);margin-inline-start:8px}
.empty{color:var(--muted);text-align:center;padding:34px 16px;font-style:italic}

/* ================================ CARDS ================================= */
.formcard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px;max-width:820px}

/* organizer case card */
.ocard{background:var(--card);border:1px solid var(--line);border-radius:var(--r-md);padding:10px;box-shadow:var(--shadow);border-inline-start:4px solid var(--navy-600)}
.ocard.ready{border-inline-start-color:var(--ok)}
.ocard .l1{font-weight:600;font-size:13.5px;display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.ocard .l2{color:var(--muted);font-size:12px;margin-top:2px}
.ocard .ctrl{display:flex;gap:6px;align-items:center;margin-top:9px;flex-wrap:wrap}
.ocard select{min-height:38px;padding:6px 8px;font-size:12.5px;flex:1;min-width:110px}

/* board row card */
.brd-row{display:flex;align-items:center;gap:14px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow);border-inline-start:5px solid var(--navy-600)}
.brd-row.ready{border-inline-start-color:var(--ok)}
.brd-row.done{opacity:.55}
.brd-row.done .brd-dx,.brd-row.done .brd-surg{text-decoration:line-through}
.brd-seq{font-family:var(--font-head);font-size:26px;font-weight:600;color:var(--navy);min-width:38px;text-align:center}
.brd-body{flex:1;min-width:0}
.brd-dx{font-size:16px;font-weight:600}
.brd-surg{font-size:14px;color:var(--navy-600);margin-top:2px}
.brd-meta{font-size:12.5px;color:var(--muted);margin-top:3px;display:flex;gap:10px;flex-wrap:wrap}
.brd-flags{display:flex;flex-direction:column;gap:6px;align-items:flex-end}

/* phone directory card */
.contact{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:12px 14px;box-shadow:var(--shadow)}
.contact .info{flex:1;min-width:0}
.contact .dept{font-weight:600;font-size:14.5px;color:var(--navy)}
.contact .sub2{color:var(--muted);font-size:12.5px;margin-top:2px}
.contact .ext{font-family:var(--font-head);font-size:19px;font-weight:600;color:var(--navy-700);white-space:nowrap}
.contact .call{text-decoration:none;min-height:44px;padding:10px 14px}
.contact .dial{font-size:11px;color:var(--text-faint);margin-top:2px}

/* change-log / audit row */
/* rc.9.63 — the board's own events, owner only, set apart from what people did to cases. */
.audsys63{color:var(--muted);font-style:italic}
.audsys63 .aw{font-style:normal}
.audrow{display:flex;gap:10px;padding:10px 4px;border-bottom:1px solid var(--line);font-size:13px}
.audrow .aw{font-weight:600;color:var(--navy);white-space:nowrap}
.audrow .at{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.audrow .ac{flex:1;min-width:0;color:var(--ink)}

/* =========================== MODALS / SCRIMS ============================ */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:var(--z-scrim);display:none;align-items:flex-end;justify-content:center}
.scrim.open{display:flex}
/* The forced "set your private code" modal must sit ABOVE the login gate
   (z-index 200), otherwise a first-time user's mandatory code screen opens
   hidden behind the gate. */
#codeScrim{z-index:var(--z-code-scrim)}
@media(min-width:640px){.scrim{align-items:center;padding:20px}}

.modal{background:var(--card);width:100%;max-width:640px;border-radius:var(--r-lg) var(--r-lg) 0 0;max-height:94vh;overflow:auto;box-shadow:var(--shadow-modal)}
@media(min-width:640px){.modal{border-radius:var(--r-lg)}}
.modal.narrow{max-width:460px}
.modal-head{position:sticky;top:0;background:var(--card);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;padding:14px 18px;z-index:var(--z-sticky-inner)}
.modal-head h2{font-size:19px;color:var(--navy);flex:1}
.modal-head .x{border:0;background:transparent;font-size:24px;cursor:pointer;color:var(--muted);width:44px;height:44px;border-radius:var(--r-xs)}
.modal-head .x:hover{background:var(--navy-050)}
.modal-body{padding:16px 18px 6px}
.modal-foot{position:sticky;bottom:0;background:var(--card);border-top:1px solid var(--line);display:flex;gap:10px;padding:12px 18px;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
#thScrim .modal-body{max-height:60vh;overflow:auto}

/* ============================ AUTH GATE ================================= */
#gate{position:fixed;inset:0;z-index:var(--z-gate);background:var(--bg);display:grid;place-items:center;padding:20px}
#gate .card{max-width:400px;width:100%;background:var(--card);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow);padding:26px}
#gate h2{font-size:22px;color:var(--navy);margin-bottom:6px}
#gate p{color:var(--muted);font-size:13.5px;margin:0 0 16px}
#gate a{color:var(--navy-600);font-size:13px}
.gmsg{font-size:13px;margin-top:12px;min-height:1em}
.gmsg.err{color:var(--danger)}
.gmsg.ok{color:var(--ok)}

/* pending access-request row (owner/manager console) */
.pendrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--pending-bg);border:1px solid var(--pending-border);border-radius:var(--r-md);padding:10px;margin-bottom:8px}
.pendrow .e{flex:1 1 100%;font-weight:600;font-size:13.5px;min-width:0;overflow:hidden;text-overflow:ellipsis}
.pendrow select{min-height:38px;flex:1 1 40%}
.pendrow .btn{min-height:38px}

/* ======================= NOTICE / ENVIRONMENT BAR ======================= */
#noticeBar{display:none;background:var(--warn-bg);border:1px solid var(--warn-border);color:var(--warn-ink);border-radius:var(--r-md);padding:9px 13px;margin:10px 0;font-size:14px}

/* ============================= SAVE FLAG ================================ */
.saveflag{position:fixed;bottom:calc(14px + env(safe-area-inset-bottom));inset-inline-start:14px;background:var(--navy);color:var(--on-navy);font-size:12px;padding:6px 12px;border-radius:var(--r-pill);opacity:0;transition:.2s;z-index:var(--z-saveflag)}
.saveflag.show{opacity:.9}

/* ================================ TOAST ================================= */
.toast{position:fixed;inset-inline:0;bottom:calc(22px + env(safe-area-inset-bottom));margin-inline:auto;width:max-content;max-width:90vw;background:var(--navy);color:var(--on-navy);padding:11px 18px;border-radius:var(--r-xl);font-size:13.5px;box-shadow:var(--shadow-toast);z-index:var(--z-toast);opacity:0;transform:translateY(8px);transition:opacity .2s,transform .2s;pointer-events:none}
.toast.show{opacity:1;transform:translateY(0);pointer-events:auto}
/* Errors must not look like confirmations. Red fill, a warning glyph, and they
   stay long enough to be read by someone who was looking at the patient. */
.toast.err{background:var(--danger-surface);color:#fff;font-weight:600;max-width:min(92vw,460px);text-align:start;line-height:1.45}
.toast.err::before{content:"\26A0  "}

/* ================================= FAB ================================== */
#fabNew{position:fixed;inset-inline-end:18px;bottom:calc(18px + env(safe-area-inset-bottom));width:56px;height:56px;border-radius:var(--r-round);border:none;background:var(--navy);color:var(--on-navy);font-size:28px;line-height:1;box-shadow:var(--shadow-fab);z-index:var(--z-fab);display:none;cursor:pointer}
/* Any open dialog hides the FAB. It is drawn above .scrim and lands exactly on
   the edit modal's Save button on a phone, eating the tap. */
body.scrim-open #fabNew{display:none !important}
/* on phones the floating + replaces the toolbar button */
@media(max-width:640px){ #fabNew{display:block} #newCaseBtn{display:none} }

/* ============================== POPOVERS ================================
   log / flag popover — rendered at body level so page zoom never scales it;
   anchored under its row. */
.logpop{position:fixed;z-index:var(--z-popover);background:var(--navy);color:var(--on-navy);padding:9px 13px;border-radius:var(--r-md);font-size:13px;line-height:1.35;max-width:82vw;box-shadow:var(--shadow-pop);display:none}
/* NOT `.logpop.flag`. showPop() sets this class on the POPOVER, and `.flag`
   is also the trigger glyph's class — which further down sets
   position:relative. Same specificity, later rule wins, so the popover
   stopped being position:fixed and its viewport-based left/top offsets
   placed it below the fold. It was rendered, populated and invisible.
   A modifier class must not share a name with an element class. */
.logpop.is-remark{background:var(--flagpop-bg)}


/* ========================= FOCUS VISIBILITY ==============================
   Previously only inputs/selects/textareas had a focus ring, and it used
   --navy-600 which scored 1.87:1 against the dark card. Every button,
   including the visually-hidden radios behind the Admitted/Proceed/Status
   segments, now shows a ring that meets 3:1 in all three themes. */
.btn:focus-visible,
.iconbtn:focus-visible,
.langtog:focus-visible,
.pullx:focus-visible,
.ynbtn:focus-visible,
.brd-log:focus-visible,
.brd-done:focus-visible,
.segbtns button:focus-visible,
.toggle button:focus-visible,
.subnav button:focus-visible,
.modal-head .x:focus-visible,
.th-row .del:focus-visible,
.contact .call:focus-visible,
[tabindex]:focus-visible,
a:focus-visible{
  outline:3px solid var(--focus-ring);
  outline-offset:2px;
  border-radius:var(--r-xs);
}
/* The segmented radios are opacity:0 — the ring has to land on their label. */
.seg input:focus-visible + span{
  outline:3px solid var(--focus-ring);
  outline-offset:-3px;
}

/* ========================= REDUCED MOTION ================================ */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
}


/* ========================= SYNC STATUS PILL ==============================
   Persistent, honest state: Live / N unsaved / Offline / Not live. Replaces a
   250ms "Saving…" flash that left an unsynced phone looking identical to a
   synced one. */
.syncpill{
  font:inherit;font-size:12px;font-weight:700;letter-spacing:.02em;
  min-height:44px;padding:0 12px;border-radius:var(--r-pill);
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);color:var(--on-navy);
  cursor:pointer;white-space:nowrap;flex:0 0 auto;
}
.syncpill.ok{opacity:.75;font-weight:600}
.syncpill.warn{background:#f2c960;color:#3d2c00;border-color:#f2c960}
.syncpill.bad{background:var(--danger-surface);color:#fff;border-color:var(--danger-surface)}
@media(max-width:640px){ .syncpill{font-size:11.5px;padding:0 10px} }


/* ========================= APPBAR CONTROL FIXES ==========================
   #whoBox is a <button> (it opens "change my code") and must not inherit the
   user-agent button fill on the navy header. */
.whobox{
  background:transparent;border:0;color:inherit;font:inherit;
  padding:0;cursor:pointer;text-align:start;min-height:44px;
}
/* The focus ring was tuned against the page surfaces, so it scored ~1.2–2.3:1
   on the header. The appbar gets its own. */
.appbar .langtog:focus-visible,
.appbar .syncpill:focus-visible,
.appbar .whobox:focus-visible,
#refreshBtn:focus-visible,
#fabNew:focus-visible{
  outline:3px solid var(--focus-ring-on-navy);
  outline-offset:2px;
}

/* The FAB overlapped the "Done" button on the Board tab as well as the modal
   footer. Reserve room under the scrolling content instead of moving it. */
#view-trauma{padding-bottom:calc(84px + env(safe-area-inset-bottom))}

/* THE HEADER BUDGET.
   At 390px the appbar wrapped to three rows — 222px of chrome plus the subnav,
   a third of an iPhone screen, before a single patient is visible. On a phone
   the two zoom buttons and the Home link are duplicated in Settings, and the
   Save button does not need its word. Dropping those returns the header to two
   rows without removing a single capability. */
@media(max-width:430px){
  .syncpill{max-width:96px;overflow:hidden;text-overflow:ellipsis}
  /* Scoped to the BAR. These were hidden outright because the header had no
     room; the drawer is that room, so hiding them there too would remove a
     capability the phone genuinely wants — text size matters most on the
     smallest screen, at 3am, which is exactly where this rule applied. */
  .apbctrl #zoomOutBtn,.apbctrl #zoomInBtn,.apbctrl #homeBtn{display:none !important}
  #refreshBtn [data-i18n="syncBtn"]{display:none}
  /* WRAP AGAIN. `nowrap` existed to force the nine-button bar onto one row; the
     drawer took eight of them away, and the rule then squeezed the four that
     remain into a scroll strip that cut Save off the right edge. */
  .appbar-inner{gap:8px 10px;padding-block:9px;flex-wrap:wrap}
  /* ONE row, always. Wrapping made the header height depend on the user's role
     — a manager at 390px got three rows (212px of chrome before any patient is
     visible) simply because they have one more button than an editor. A single
     scrollable row is a fixed 44px whatever the role, and nothing is removed. */
  .apbctrl{gap:6px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;
           scrollbar-width:none;-webkit-overflow-scrolling:touch;
           mask-image:linear-gradient(to left,transparent 0,#000 18px)}
  .apbctrl::-webkit-scrollbar{display:none}
  .langtog{padding-inline:10px}
  .brand .t span{display:none}   /* the subtitle, not the name */
}

/* Pending-request rows kept a 38–42px override that undid the 44px floor. */
.pendrow select,.pendrow .btn,.ocard select{min-height:44px}

/* The organizer's day select collapsed to ~29px on a narrow phone. */
.ocard select,td select{min-width:96px}


/* The remark flag is now a focusable control (it was a bare <span>, so the
   special request was unreachable by keyboard). Keep the glyph small so rows
   don't reflow, but give it a real 44px target like .pullx. */
.flag{position:relative;display:inline-flex;align-items:center;justify-content:center}
/* The overlay used to extend 12px past a 21.5px glyph with only 6px of
   margin after it, so tapping the START of the diagnosis opened the remark
   popover instead of the case. Keep the vertical reach (rows are tall
   enough) and stop the trailing edge at the margin. */
.flag::after{content:"";position:absolute;inset-block:-11px;inset-inline-start:-12px;inset-inline-end:-4px}

/* ======================= SCHEDULING SHEET =============================== */
/* A .modal variant, not a new component: it inherits the bottom-anchored
   placement on phones and the centred card at >=640px that .scrim already
   provides, so there is one dialog behaviour in the app rather than two. */
.modal.sheet{display:flex;flex-direction:column;max-height:88vh;overflow:hidden}
.modal.sheet .modal-head{position:static;align-items:flex-start}
.sch-title{flex:1;min-width:0}
.sch-title h2{font-size:17px;margin:0 0 1px}
.sch-who{font-size:12.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sch-who b{color:var(--ink)}
/* Destructive, so it reads as destructive — but muted until touched, because a
   permanently red control in the header trains people to ignore red. */
.sch-remove{color:var(--muted);font-size:18px}
.sch-remove:hover,.sch-remove:focus-visible{background:var(--danger-050,#fdeceb);color:var(--danger)}

.sch-row{display:flex;gap:10px;padding:12px 18px;border-bottom:1px solid var(--line);flex:none}
.sch-row .field{flex:1;min-width:0;margin:0}
.sch-row select{width:100%}

.sch-listhead{padding:12px 18px 6px;flex:none;display:flex;align-items:baseline;gap:8px}
.sch-listhead b{font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:var(--navy)}
.sch-listhead span{font-size:12px;color:var(--muted)}

.sch-list{overflow:auto;-webkit-overflow-scrolling:touch;flex:1;min-height:80px;padding:0 12px 4px}
.sch-item{display:flex;align-items:center;gap:10px;padding:9px 8px;border-radius:var(--r-sm,8px);
          border:1px solid transparent;font-size:13px}
.sch-item + .sch-item{margin-top:2px}
/* The position number.
   As a BUTTON it must be a real 44x44 target, but a 44px circle beside 13px
   text looks like a dial pad. So the button is 44x44 and transparent and the
   visible circle is a real 28px child element.

   It was a ::before with z-index:-1 first. That put the circle BEHIND the row's
   own background — .no is position:relative with no z-index, so it creates no
   stacking context — and the highlighted row rendered white text on a pale
   background, invisible. Two lessons kept here as comment rather than repeated:
   z-index:-1 escapes further up than people expect, and a hit area faked with a
   pseudo-element also measures as 24px to any audit reading
   getBoundingClientRect(), so it passes a touch-target check while still being
   hard to hit. A real child element is honest on both counts. */
.sch-item .no{width:44px;height:44px;flex:none;border:0;background:transparent;padding:0;
              font:inherit;display:grid;place-items:center}
/* Specific enough to beat `.sch-item .no` (0,2,0). `button.no` alone is
   (0,1,1) and lost, so the tap-to-jump numbers showed an arrow cursor and
   read as inert text — the exact affordance they were added to provide. */
.sch-item span.no{cursor:default}
.sch-item .dot{width:28px;height:28px;border-radius:var(--r-round);background:var(--navy-050);
              color:var(--navy);font-size:11.5px;font-weight:700;display:grid;place-items:center}
.sch-item button.no{cursor:pointer}
button.no:hover .dot,button.no:focus-visible .dot{background:var(--navy-500);color:var(--on-primary)}
button.no:active .dot{transform:scale(.92)}
.sch-item .txt{min-width:0;flex:1}
.sch-item .txt b{display:block;font-size:13px;font-weight:600}
.sch-item .txt span{display:block;font-size:12px;color:var(--muted);
                    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sch-item .meta{font-size:12px;color:var(--muted);flex:none;text-align:end}

/* The case being placed: highlighted, and the ONLY row with arrows. In the old
   Organizer every row had arrows and several groups were on screen at once,
   so "which one did I just move" was a real question. */
.sch-item.me{background:var(--navy-050);border-color:var(--navy-500)}
.sch-item.me .dot{background:var(--navy-500);color:var(--on-primary)}
.sch-item.new{border-style:dashed}
/* 44px MINIMUM in both axes. These were 38px tall and slipped through review
   because they LOOK generous next to a 13px row; the audit rule exists
   precisely because eyeballing touch targets does not work. */

.sch-hint{margin:0;padding:0 18px 10px;flex:none}

/* ============== PATIENTS: OR-list cell and block gaps =================== */
/* Chip and ✕ are two separate 44px targets with a gap between them, not one
   compound widget where a mis-tap unschedules a patient. */
.orcell{display:inline-flex;align-items:center;gap:6px}

/* The blank row that separates today / tomorrow / everything else.
   Height only — no border. A rule would read as a table section heading and
   invite the question "what is this section called?", which is a question the
   OR-list column already answers on every row. */
.blockgap td{height:16px;padding:0;border-bottom:0;background:var(--bg)}

/* `.chip` is emitted three times by the Roles console (staff number, role,
   expiry) and had NO rule in any stylesheet — so an ACTIVE user's badges
   rendered as run-on 16px text jammed against the email, while an EXPIRED
   user's `.st-chip` branch rendered a proper pill. Expired looked formatted;
   active looked broken. */
.chip{display:inline-flex;align-items:center;background:var(--navy-050);color:var(--navy);
      border:1px solid var(--line);border-radius:var(--r-pill);
      padding:1px 9px;font-size:11.5px;font-weight:600;white-space:nowrap}

/* ---- dark-theme surfaces that were painted from --white or --navy ---------
   Same root cause every time: --white deliberately never flips, and --navy is a
   TEXT colour that has to go light in dark theme. Anything using either as a
   SURFACE inverted itself. Measured before: theme switcher 1.17:1 (white on
   white — you could not read the control that gets you out of dark mode), the
   New-case FAB and every toast 1.84:1, the selected Admitted/Proceed/Status
   option 1.84:1. */
.segbtns button{background:var(--card);color:var(--ink)}
.segbtns button.on{background:var(--primary-bg);color:var(--on-primary);border-color:var(--primary-bg)}
#fabNew{background:var(--primary-bg);color:var(--on-primary)}
.toast{background:var(--primary-bg);color:var(--on-primary)}
.seg input:checked+span{background:var(--primary-bg);color:var(--on-primary)}

/* A completed case is neither decoration nor a disabled control, and "Reopen"
   inside it is an active button — 0.55 opacity put its text at 2.23:1. */
.brd-row.done{opacity:.78}

/* ========================= PHONE MENU DRAWER ============================ */
/* A .modal variant so the focus trap, focus restore and scroll lock in
   22-a11y.js apply unchanged — one dialog behaviour in the app, not two. */
.modal.drawer{
  max-width:320px;width:86%;margin-inline-start:auto;
  height:100dvh;max-height:100dvh;border-radius:0;
  display:flex;flex-direction:column;
  padding-top:env(safe-area-inset-top);
}
/* The scrim centres its modal at >=640px; the drawer wants the inline-end edge
   at every width it is ever shown at. It is only shown below 640px, but pinning
   it here means a tablet rotating across the breakpoint never flashes it centred. */
#drawerScrim{align-items:stretch;justify-content:flex-end;padding:0}
.drawer-body{
  overflow:auto;-webkit-overflow-scrolling:touch;flex:1;min-height:0;
  padding:12px 14px calc(14px + env(safe-area-inset-bottom));
  display:flex;flex-direction:column;gap:8px;
}
/* The moved buttons were styled for a navy bar. In the panel they sit on --card,
   so they need the page's foreground, full width and a readable label. */
/* display:flex is the load-bearing line. `.langtog` is a plain <button>, so
   justify-content and gap were inert and the glyph sat jammed against its label
   in a centred blob — "⚙Settings". */
.drawer-body .langtog{
  display:flex;align-items:center;justify-content:flex-start;gap:12px;
  width:100%;text-align:start;
  min-height:52px;font-size:15px;padding:10px 14px;
  color:var(--ink);background:var(--card);border:1px solid var(--line);
}
/* A fixed-width slot for the glyph, so the labels line up as a column rather
   than stepping in and out with each icon's width. */
.drawer-body .langtog > :first-child:not(.mlabel){flex:0 0 24px;text-align:center}
.drawer-body .langtog:hover{background:var(--navy-050)}
.drawer-body .langtog[hidden]{display:none}
.drawer-body .mlabel{font-weight:600}

/* The drawer slides rather than appearing, and can be dragged shut. */
.modal.drawer{transition:transform .18s ease-out}
.scrim:not(.open) .modal.drawer{transform:translateX(100%)}
html[dir="rtl"] .scrim:not(.open) .modal.drawer{transform:translateX(-100%)}
.modal.drawer.dragging{transition:none}
@media (prefers-reduced-motion:reduce){ .modal.drawer{transition:none} }

/* Organizer position picker — sized like the arrows it sits between, and wide
   enough for a two-digit list without the native chevron clipping the number. */
.ord{display:flex;justify-content:center}
.ord .seqpick{min-width:72px;min-height:44px;padding:4px 6px;text-align:center;
              font-weight:700;color:var(--navy);background:var(--card);
              border:1px solid var(--line);border-radius:var(--r-xs)}
/* Log out reads as the exit it is: separated from the navigation above it and
   coloured like the other destructive controls in the app. */
.drawer-body #menuLogout{margin-top:10px;border-top:1px solid var(--line);
                         padding-top:14px;border-radius:0 0 var(--r-sm) var(--r-sm);
                         color:var(--danger);font-weight:700}

/* The Organizer draft bar. Sticky inside the tab so it is visible however long
   the lists grow — an unsaved draft the user cannot see is a lost draft. */
.orgbar{position:sticky;top:calc(var(--stick56,0px) + var(--vhead56,0px));z-index:5;display:flex;align-items:center;gap:10px;
  padding:10px 14px;margin:0 0 10px;border-radius:10px;
  background:var(--card);border:1.5px solid var(--navy);box-shadow:0 2px 8px rgba(15,35,66,.12)}
.orgbar span{font-weight:600;color:var(--ink)}
.orgbar.bad{border-color:var(--danger-surface)}
.orgbar.bad span{color:var(--danger-surface)}

/* The update bar. Bottom of the screen, above the toasts' zone, never covering
   the appbar controls — it must be noticeable without being in the way of the
   round that is happening right now. */
.updbar{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);z-index:60;
  display:flex;align-items:center;gap:12px;padding:10px 16px;border-radius:12px;
  background:var(--appbar-bg,#132a4a);color:#fff;box-shadow:0 6px 20px rgba(0,0,0,.3)}
.updbar span{font-weight:600}

/* ---------- 40-utilities.css ---------- */
/* ============================================================================
   40-utilities.css — helpers, preference toggles and one-off overrides.
   ----------------------------------------------------------------------------
   What belongs here: role-based visibility helpers, .hide, the accessibility
   preference classes JS puts on <body>, and small single-selector overrides
   that don't belong to any component.
   Loaded last so its overrides win. Every rule here is either !important or
   id-anchored, so moving it to the end of the bundle is cascade-safe.
   ========================================================================== */

/* ===================== ROLE-BASED VISIBILITY ============================
   JS sets exactly one of body.role-viewer / .role-editor / .role-manager /
   .role-owner. Class names are referenced from the JS and the markup — do not
   rename them.
     .editoronly  — editor and above
     .editorup    — editor and above (e.g. the change Log button)
     .manageronly — manager and above
     .owneronly   — owner only
   ====================================================================== */
body.role-viewer .editoronly{display:none!important}
body.role-editor .manageronly{display:none!important}
body.role-viewer .editorup{display:none!important}
body.role-viewer .manageronly{display:none!important}
body:not(.role-owner) .owneronly{display:none!important}

/* viewers get no "add case" affordance */
body:not(.role-editor):not(.role-manager):not(.role-owner) #fabNew{display:none!important}

/* ============================== .hide ==================================
   The legacy sheet scoped this to the auth gate only (`#gate .hide`); it is
   used by gate(which) to swap between #g-loading / #g-login / #g-request.
   Kept scoped — promoting it to a global `.hide` would be a behaviour change,
   because other elements in the app are hidden with the `hidden` attribute
   or inline style instead.
   ====================================================================== */
#gate .hide{display:none}

/* ============ ACCESSIBILITY / THEME PREFERENCES (Settings) =============
   Theme variables live in 00-tokens.css; only the non-colour preferences are
   here.
   NOTE (dead code, kept deliberately): the .fs-sm/.fs-lg/.fs-xl step classes
   are never applied any more — applyPrefs() does
       b.classList.remove('fs-sm','fs-lg','fs-xl');
   and sizing is now driven by applyZoom()/PREFS.zoom via a CSS transform on
   the content wrapper. The rules are retained so an older cached client that
   still sets the class keeps working.
   ====================================================================== */
body.fs-sm{zoom:.9}
body.fs-lg{zoom:1.15}
body.fs-xl{zoom:1.3}
body.pref-bold *{font-weight:600!important}

/* ============================ MISC ONE-OFFS ============================ */
#whoBox{cursor:pointer}
#whoBox:hover{opacity:.85}
.footnote{color:var(--text-faint);font-size:11.5px;margin-top:18px}

/* Turn 25: direction-independent presentation proposal. */
:where(button,[role="button"],summary):focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
.appbar :focus-visible{outline-color:var(--focus-ring-on-navy)}
button,[role="button"],summary{min-height:44px;min-width:44px}
summary{display:list-item;padding-block:10px;cursor:pointer}
#menuBtn{order:3}
.apbctrl{order:2;overflow:visible;flex-wrap:wrap}
.flag{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
.seg label{min-width:44px}
#menuBtn[hidden]{display:none}
.wave25-note{margin:0 0 12px;color:var(--muted)}
.wave25-card{border:1px solid var(--line);background:var(--card);border-radius:var(--radius);padding:12px 14px;margin:0 0 12px;overflow-wrap:anywhere}
.wave25-card.refused{border-color:var(--danger-border);background:var(--danger-bg)}
.wave25-title{margin:0 0 6px;font-weight:600;color:var(--navy)}
.wave25-title.refused{color:var(--danger)}
.wave25-record{margin:2px 0}
.wave25-reference{margin:2px 0;color:var(--muted);font-size:var(--fs-xs)}
.wave25-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.wave25-attention{position:fixed;bottom:calc(18px + env(safe-area-inset-bottom));inset-inline-start:12px;max-width:calc(100vw - 110px);z-index:var(--z-fab);min-height:48px;padding:10px 18px;border:1px solid var(--danger-surface);border-radius:var(--r-pill);background:var(--danger-surface);color:var(--white);font:inherit;font-weight:600;box-shadow:var(--shadow-fab);cursor:pointer;white-space:normal}
.wave25-editor-title{font-size:var(--fs-md);color:var(--navy);margin:10px 0 8px}
.wave25-more{color:var(--muted);margin:8px 0}
.wave25-field{margin-bottom:10px}
.wave25-field input,.wave25-field select{width:100%;min-width:0}
.wave25-field.refused{border:2px solid var(--danger);border-radius:var(--radius);padding:10px;background:var(--danger-bg)}
.wave25-field.refused label{color:var(--danger)}
.wave25-grow{flex:1;min-width:0}
.wave25-config-row{display:flex;gap:8px;flex-wrap:wrap}
.wave25-config-row input{flex:1 1 160px;min-width:0}
.wave25-section{font-weight:600;color:var(--navy);margin:14px 0 8px}
.wave25-owner-action{margin-block-end:8px;margin-inline-end:8px}
.wave25-hint{color:var(--muted);font-size:var(--fs-xs);margin-top:6px}
.wave25-json-field{margin-top:8px}
.wave25-json{width:100%;font-family:monospace;font-size:var(--fs-xs)}
.wave25-full{width:100%}
#quarantine-foot .btn,#owner-body .btn{white-space:normal;overflow-wrap:anywhere}
@media(max-width:639px){
 #refreshBtn [data-i18n="syncBtn"]{display:inline}
 body:not([data-phone-layout="table"]) #tab-patients .tablewrap{overflow:visible;max-height:none;min-height:0;border:0;background:transparent}
 body:not([data-phone-layout="table"]) #tab-patients table{display:block;min-width:0;width:100%;table-layout:fixed}
 body:not([data-phone-layout="table"]) #tab-patients thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body:not([data-phone-layout="table"]) #patBody{display:grid;gap:12px;width:100%;min-width:0}
 body:not([data-phone-layout="table"]) #patBody tr[data-id]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:8px;min-width:0}
 body:not([data-phone-layout="table"]) #patBody td{display:block;min-width:0;min-height:44px;padding:8px;border:0;white-space:normal;overflow-wrap:anywhere;font-size:var(--fs-sm)}
 body:not([data-phone-layout="table"]) #patBody td::before{content:attr(data-label);display:block;color:var(--muted);font-size:var(--fs-2xs);font-weight:600;margin-bottom:4px}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(1),body:not([data-phone-layout="table"]) #patBody td:nth-child(5),body:not([data-phone-layout="table"]) #patBody td:nth-child(6),body:not([data-phone-layout="table"]) #patBody td:nth-child(9){grid-column:1/-1}
 body:not([data-phone-layout="table"]) #patBody .orcell{display:flex;max-width:100%;align-items:center}
 body:not([data-phone-layout="table"]) #patBody .orchip{min-width:0;flex:1;white-space:normal;overflow-wrap:anywhere}
 body:not([data-phone-layout="table"]) #patBody .btn{max-width:100%;white-space:normal}
 body:not([data-phone-layout="table"]) #patBody .blockgap{display:none}
 body:not([data-phone-layout="table"]) #tab-patients .filterbar>*{min-width:0;max-width:100%}
 body:not([data-phone-layout="table"]) #tab-patients .filterbar select{flex:1 1 44%}
 body:not([data-phone-layout="table"]) #tab-patients .filterbar input[type="search"]{flex:1 1 100%;max-width:100%}
 body:not([data-phone-layout="table"]) #tab-patients .viewhead .sub{flex-basis:100%}
}

body[data-look="harbour"]:not(.theme-dark):not(.theme-contrast),body[data-look="harbour"].theme-contrast{
  --navy:#163d61;
  --navy-700:#163d61;
  --navy-600:#235881;
  --navy-500:#2c6fb0;
  --navy-050:#e8eff5;
  --focus-ring:#164fac;
  --appbar-bg:#163d61;
  --primary-bg:#163d61;
  --primary-bg-hover:#102f4c;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#f2f6fa;
  --card:#ffffff;
  --ink:#182d3d;
  --muted:#4d6172;
  --line:#69796f;
  --text-faint:#4d6172;
  --row-hover:#edf1f4;
  --control-off:#edf1f4;
  --switch-off:#657b90;
  --chipbtn-bg:#dfe7f0;
  --chipbtn-bg-hover:#c9d6e6;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#a32622;
  --danger-surface:#a32622;
  --danger-bg:#fff0ed;
  --danger-border:#a32622;
  --ok:#17674f;
  --ok-surface:#17674f;
  --ok-bg:#e9f5ef;
  --ok-border:#17674f;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#fff6e6;
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="harbour"].theme-dark{
  --navy:#b0d4f4;
  --navy-700:#b0d4f4;
  --navy-600:#b0d4f4;
  --navy-500:#2c6fb0;
  --navy-050:#263846;
  --focus-ring:#9bcfff;
  --appbar-bg:#0d1924;
  --primary-bg:#22557f;
  --primary-bg-hover:#28608f;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#101b25;
  --card:#1a2a37;
  --ink:#eef4f8;
  --muted:#b0c0ce;
  --line:#849488;
  --text-faint:#b0c0ce;
  --row-hover:#263846;
  --control-off:#293a46;
  --switch-off:#6b8095;
  --chipbtn-bg:#26374a;
  --chipbtn-bg-hover:#354b59;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#ffb4ab;
  --danger-surface:#a32622;
  --danger-bg:#3d2525;
  --danger-border:#ffb4ab;
  --ok:#8ae2b6;
  --ok-surface:#17674f;
  --ok-bg:#193a2c;
  --ok-border:#8ae2b6;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#3a2f1c;
  --pending-border:#e6c98a;
  --pool-bg:#302e28;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="limestone"]:not(.theme-dark):not(.theme-contrast),body[data-look="limestone"].theme-contrast{
  --navy:#335647;
  --navy-700:#335647;
  --navy-600:#335647;
  --navy-500:#2c6fb0;
  --navy-050:#eaece4;
  --focus-ring:#164fac;
  --appbar-bg:#293d35;
  --primary-bg:#335647;
  --primary-bg-hover:#264236;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#f5f3ed;
  --card:#fffefa;
  --ink:#29312f;
  --muted:#56615b;
  --line:#69796f;
  --text-faint:#56615b;
  --row-hover:#edf1f4;
  --control-off:#edf1f4;
  --switch-off:#657b90;
  --chipbtn-bg:#dfe7f0;
  --chipbtn-bg-hover:#c9d6e6;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#a32622;
  --danger-surface:#a32622;
  --danger-bg:#fff0ed;
  --danger-border:#a32622;
  --ok:#17674f;
  --ok-surface:#17674f;
  --ok-bg:#e9f5ef;
  --ok-border:#17674f;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#fff6e6;
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:8px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Newsreader',Georgia,'Times New Roman',serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="limestone"].theme-dark{
  --navy:#bce2ca;
  --navy-700:#bce2ca;
  --navy-600:#bce2ca;
  --navy-500:#2c6fb0;
  --navy-050:#304137;
  --focus-ring:#9bcfff;
  --appbar-bg:#152019;
  --primary-bg:#315b47;
  --primary-bg-hover:#396750;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#181e1b;
  --card:#242e28;
  --ink:#f1f3eb;
  --muted:#bac6b9;
  --line:#849488;
  --text-faint:#bac6b9;
  --row-hover:#263846;
  --control-off:#293a46;
  --switch-off:#6b8095;
  --chipbtn-bg:#26374a;
  --chipbtn-bg-hover:#354b59;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#ffb4ab;
  --danger-surface:#a32622;
  --danger-bg:#3d2525;
  --danger-border:#ffb4ab;
  --ok:#8ae2b6;
  --ok-surface:#17674f;
  --ok-bg:#193a2c;
  --ok-border:#8ae2b6;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#3a2f1c;
  --pending-border:#e6c98a;
  --pool-bg:#302e28;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:8px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Newsreader',Georgia,'Times New Roman',serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="burgundy"]:not(.theme-dark):not(.theme-contrast),body[data-look="burgundy"].theme-contrast{
  --navy:#681d48;
  --navy-700:#681d48;
  --navy-600:#681d48;
  --navy-500:#87365f;
  --navy-050:#eee1e8;
  --focus-ring:#76245a;
  --appbar-bg:#571337;
  --primary-bg:#681d48;
  --primary-bg-hover:#501336;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#f7f3f4;
  --card:#fffafb;
  --ink:#32212c;
  --muted:#695361;
  --line:#8a7180;
  --text-faint:#695361;
  --row-hover:#f0e6ec;
  --control-off:#f0e6ec;
  --switch-off:#657b90;
  --chipbtn-bg:#eee1e8;
  --chipbtn-bg-hover:#e2cfdc;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#a32622;
  --danger-surface:#a32622;
  --danger-bg:#fff0ed;
  --danger-border:#a32622;
  --ok:#17674f;
  --ok-surface:#17674f;
  --ok-bg:#e9f5ef;
  --ok-border:#17674f;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#fff6e6;
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="burgundy"].theme-dark{
  --navy:#f0bdd8;
  --navy-700:#f0bdd8;
  --navy-600:#f0bdd8;
  --navy-500:#87365f;
  --navy-050:#44313e;
  --focus-ring:#efb5dc;
  --appbar-bg:#321025;
  --primary-bg:#772450;
  --primary-bg-hover:#872d5d;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#211b20;
  --card:#30262d;
  --ink:#faf0f5;
  --muted:#d0bcc7;
  --line:#a68b9b;
  --text-faint:#d0bcc7;
  --row-hover:#40303a;
  --control-off:#40303a;
  --switch-off:#6b8095;
  --chipbtn-bg:#40303a;
  --chipbtn-bg-hover:#503b49;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#ffb4ab;
  --danger-surface:#a32622;
  --danger-bg:#3d2525;
  --danger-border:#ffb4ab;
  --ok:#8ae2b6;
  --ok-surface:#17674f;
  --ok-bg:#193a2c;
  --ok-border:#8ae2b6;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#3a2f1c;
  --pending-border:#e6c98a;
  --pool-bg:#302e28;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
/* Contrast is an overlay on each look; bold remains the existing overlay. */
body[data-look].theme-contrast{--ink:#000;--muted:#26312b;--text-faint:#26312b;--line:#465249;--danger:#8c1c16;--ok:#14563a}
#set-look,#set-phone-layout{display:flex;flex-wrap:wrap;gap:8px}
#set-look button,#set-phone-layout button{flex:1 1 90px;border:2px solid var(--line);background:var(--card);color:var(--ink);border-radius:var(--r-sm);padding:8px;font:inherit}
#set-look button[aria-pressed="true"],#set-phone-layout button[aria-pressed="true"]{border:3px solid var(--navy);font-weight:700;background:var(--navy-050)}
.look-swatch{display:inline-block;width:18px;height:18px;margin-inline-end:6px;vertical-align:middle;border-radius:50%;border:1px solid var(--ink)}
[data-look-choice="harbour"] .look-swatch{background:#163d61}
[data-look-choice="limestone"] .look-swatch{background:#335647}
[data-look-choice="burgundy"] .look-swatch{background:#681d48}
.orgbar.bad span{color:var(--danger)}
.orchip:hover{background:var(--chipbtn-bg-hover)}
.sch-remove:hover,.sch-remove:focus-visible{background:var(--danger-bg);color:var(--danger)}
.ready-badge{background:var(--ready-0);color:var(--ready-ink)}
.toast:not(.err),.saveflag,.logpop:not(.is-remark),.toggle button.on,.brand .mark{background:var(--primary-bg);color:var(--on-primary)}
.brd-row.done,.brd-tomorrow .brd-row,.syncpill.ok,.saveflag.show,#whoBox:hover,.iconbtn:disabled{opacity:1}
button:disabled{color:var(--muted);background:var(--control-off);opacity:1;cursor:not-allowed}

.confirmation26{border:1px solid var(--line);border-radius:var(--radius);padding:22px;width:min(92vw,480px);max-height:85dvh;overflow:auto;background:var(--card);color:var(--ink);box-shadow:var(--shadow-modal)}
.confirmation26::backdrop{background:var(--scrim)}
.confirmation26 h2{font-size:var(--fs-lg);color:var(--navy);margin:0 0 16px}
.confirmation26 p{white-space:pre-wrap;overflow-wrap:anywhere}
/* Turn 28: warnings are siblings of segmented controls. */
[data-enum-note]{display:block;color:var(--ink);font-size:var(--fs-sm);margin-top:6px}
[data-enum-note][hidden]{display:none!important}
.card-status28{display:none}
@media(max-width:639px){
 body:not([data-phone-layout="table"]) #patBody .card-status28{display:inline-flex;flex-shrink:0;font-size:var(--fs-2xs);font-weight:700;border:1px solid var(--line);border-radius:4px;padding:2px;color:var(--ink);background:var(--card)}
 body:not([data-phone-layout="table"]) #patBody{gap:8px}
 body:not([data-phone-layout="table"]) #patBody tr[data-id]{grid-template-columns:minmax(0,2fr) minmax(44px,1fr) minmax(0,2fr);padding:4px 8px}
 body:not([data-phone-layout="table"]) #patBody td{padding:2px 4px;min-height:44px;display:flex;align-items:center;gap:4px;overflow:hidden}
 body:not([data-phone-layout="table"]) #patBody td::before{display:none}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(1){grid-column:1;grid-row:1}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(2){grid-column:2;grid-row:1}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(3){grid-column:3;grid-row:1}
 /* rc.9.56 — the injury date was hidden on the card, and a trauma case without it reads as if
    it happened today. It shares the diagnosis line, right-aligned and quiet, so the card keeps
    its height and the diagnosis keeps the width it actually needs. */
 body:not([data-phone-layout="table"]) #patBody td:nth-child(4){grid-column:3;grid-row:2;display:flex;justify-content:flex-end;align-items:center;white-space:nowrap;color:var(--muted);font-size:var(--fs-2xs);line-height:40px;padding-inline-end:0}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(5){grid-column:1/3;grid-row:2;display:block;white-space:nowrap;text-overflow:ellipsis;line-height:40px}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(6){grid-column:1/-1;display:block;white-space:nowrap;text-overflow:ellipsis;line-height:40px}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(7){grid-column:1/2}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(8){grid-column:2/-1}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(7)::before,body:not([data-phone-layout="table"]) #patBody td:nth-child(8)::before{display:inline;margin:0}
 body:not([data-phone-layout="table"]) #patBody td:nth-child(9){grid-column:1/-1}
 body:not([data-phone-layout="table"]) #patBody .orcell{width:100%;gap:4px}
 body:not([data-phone-layout="table"]) #patBody button{min-height:44px;min-width:44px}
}

/* rc.9.56 — WITHOUT tomorrow's tint, one card ran into the next. A 1px hairline between two
   white cards on a bright ward screen is not a boundary. Every card now carries the same quiet
   edge and lift that the tomorrow card gets from its colour; the tomorrow rules still win where
   they apply, because they come later in the sheet. The Board's rows keep their own leading edge,
   which already carries the ready and done states; a grey edge there would overwrite it. */
@media(max-width:639px){
 body:not([data-phone-layout="table"]) #patBody tr[data-id],
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id]{
   border-color:var(--card-edge56,rgba(15,23,42,.18));
   box-shadow:0 1px 2px rgba(15,23,42,.10);
   border-inline-start:4px solid var(--card-edge56,rgba(15,23,42,.18))}
}
/* rc.9.59 — THE PHONE CARD SAYS WHERE THE CASE STANDS. The table separates "on today's list",
   "on tomorrow's list" and "not on a list" with gap rows; the card layout hides those rows, so the
   phone showed one flat column. A card on today's list takes the ready green it already uses for
   that state, with a solid leading edge; tomorrow keeps the indigo agreed on 19 Sep; everything
   else stays plain (the surgeon asked for plain, with no alternating tint on top of the states).
   Colour is not the only signal: each card still carries its chip, so this reads without it. */
@media(max-width:639px){
 body:not([data-phone-layout="table"]) #patBody tr[data-rk58="0"]{background:var(--ok-bg);border-color:var(--ok-border);border-inline-start-color:var(--ok);box-shadow:inset 5px 0 0 var(--ok)}
 [dir="rtl"] body:not([data-phone-layout="table"]) #patBody tr[data-rk58="0"]{box-shadow:inset -5px 0 0 var(--ok)}
}
body.theme-dark{--card-edge56:rgba(148,163,184,.42)}
body.theme-contrast{--card-edge56:currentColor}

/* Turn 29: hidden is authoritative across role, theme and layout rules. */
html body [hidden]{display:none!important}
.org-status29{display:none}
@media(max-width:640px){
 body:not([data-phone-organizer="table"]) #orgWrap .tablewrap{overflow:visible;max-height:none;border:0;background:transparent;box-shadow:none}
 body:not([data-phone-organizer="table"]) #orgWrap table,body:not([data-phone-organizer="table"]) #orgWrap tbody{display:block;width:100%;min-width:0}
 body:not([data-phone-organizer="table"]) #orgWrap thead{display:none}
 body:not([data-phone-organizer="table"]) #orgWrap tr.daydiv{display:block;margin-block:12px 6px}
 body:not([data-phone-organizer="table"]) #orgWrap tr.daydiv td{display:block;white-space:normal}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id]{display:grid;grid-template-columns:56px minmax(0,1fr) minmax(44px,1fr) 44px;gap:4px;background:var(--card);border:1px solid var(--line);border-radius:var(--r-md);padding:8px;margin-block:8px;box-shadow:var(--shadow)}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td{display:flex;align-items:center;gap:4px;min-width:0;padding:0;border:0;white-space:normal;overflow-wrap:anywhere}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(1){grid-column:1;grid-row:1/3}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(2){grid-column:2/-1;grid-row:1}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(3){grid-column:2;grid-row:2;font-size:12px;color:var(--muted)}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(4){grid-column:3/-1;grid-row:2;font-size:12px;color:var(--muted)}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(3)::before,body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(4)::before{content:'·';margin-inline-end:3px}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(5),body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(6){grid-column:1/-1;display:block;white-space:nowrap;overflow:auto;font-size:13px;line-height:24px}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(7){grid-column:1/3}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(8){grid-column:3}
 body:not([data-phone-organizer="table"]) #orgWrap tr[data-id] td:nth-child(9){grid-column:4}
 body:not([data-phone-organizer="table"]) #orgWrap select,body:not([data-phone-organizer="table"]) #orgWrap button{min-height:44px;min-width:44px;max-width:100%;font-size:13px}
 body:not([data-phone-organizer="table"]) #orgWrap select{width:100%;padding-inline:6px}
 body:not([data-phone-organizer="table"]) #orgWrap .ord{width:100%}
 body:not([data-phone-organizer="table"]) #orgWrap .seqpick{width:56px}
 body:not([data-phone-organizer="table"]) #orgWrap .org-status29{display:inline-flex;flex-shrink:0;border:1px solid var(--line);border-radius:4px;font-size:11px;padding:1px 4px;font-weight:700}
}

/* Turn 30: full labels at phone widths, independent of colour tokens. */
@media(max-width:640px){
 #orgBar{flex-wrap:wrap;align-items:stretch;gap:8px}
 #orgBar>span{flex:1 0 100%;min-width:0;white-space:normal;overflow-wrap:anywhere}
 #orgBar button{flex:1 1 130px;min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere;height:auto}
}

/* Turn 31: independent phone layouts, existing controls and content retained. */
.phone-layout31{display:flex;flex-wrap:wrap;gap:8px}
.phone-layout31 button{flex:1 1 90px;border:2px solid var(--line);background:var(--card);color:var(--ink);border-radius:var(--r-sm);padding:8px;font:inherit;min-height:44px}
.phone-layout31 button[aria-pressed="true"]{border:3px solid var(--navy);font-weight:700;background:var(--navy-050)}
/* Allow wheel/touch to continue into the document at list boundaries. */
.tablewrap{overscroll-behavior:auto}
@media(min-width:641px){
 #tab-patients .tablewrap,#orgWrap .tablewrap{min-height:280px;overflow:auto}
}
@media(max-width:640px){
 /* The Board table is a horizontally scrollable, aligned three-column list:
    order | all clinical details | status/actions. No content is cloned or hidden. */
 body[data-phone-board="table"] #brdWrap .brd{overflow-x:auto;gap:0}
 body[data-phone-board="table"] #brdWrap .brd-row{display:grid;grid-template-columns:44px minmax(320px,1fr) 140px;min-width:560px;border-radius:0;box-shadow:none;margin:0;padding:8px;gap:8px}
 body[data-phone-board="table"] #brdWrap .brd-flags{align-items:stretch}
 body[data-phone-board="table"] #brdWrap .brd-dx,body[data-phone-board="table"] #brdWrap .brd-surg{white-space:normal;overflow-wrap:anywhere}
}

/* Pairing shares the selected look; QR always has a white quiet zone. */
#gate .card:has(#g-display32:not(.hide)){width:min(680px,calc(100vw - 24px));max-width:680px}
.pair-actions32{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}.pair-actions32 button{min-height:44px}
#display-qr32{max-width:100%;margin:16px auto;width:325px;background:white;color:black}
#display-qr32 svg{display:block;width:100%;height:auto;aspect-ratio:1}
.pair-phrase32{font-size:1.5rem;font-weight:700;letter-spacing:.08em;overflow-wrap:anywhere}
#display-status32,#approve-status32{min-height:2em;overflow-wrap:anywhere}
#display-owner32 article{padding:12px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
#display-owner32 button{min-height:44px}

/* Display printing: application data never enters the print layout. */
#print-disabled33{display:none}
@media print{
 body.display-mode33 > *{display:none!important}
 body.display-mode33 > #print-disabled33{display:block!important;color:#000;background:#fff}
}
/* Turn 35: role rules remain authoritative after controls move into the drawer. */
body.role-viewer #refreshBtn,body.role-viewer .editoronly,body.role-viewer .editorup,
body.role-viewer .manageronly,body.role-viewer .owneronly{display:none!important}
body.display-mode33 #settingsBtn{display:none!important}
/* Turn 43: logical spacing supports either writing direction and every token look. */
#g-login .login-actions43{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#g-login .login-actions43 .rememberrow{margin:0;flex:1 1 190px}
#g-login .login-actions43 button{flex:0 0 auto;min-width:100px}
#g-login #g-msg{margin:8px 0;min-height:1.4em}
#login-links43{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
#login-links43 button{font-size:13px;text-decoration:underline}
#g-showreq{width:100%;justify-content:center}
#signin-subtitle43{overflow-wrap:anywhere}
.sr-only43{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.pending-badge43{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;padding:2px 6px;margin-inline-start:6px;border-radius:20px;font-size:12px;line-height:1.2;background:var(--primary-bg);color:var(--on-primary);border:1px solid currentColor}
#display-manual-menu43{padding:12px}
#display-manual-menu43 input{width:100%;box-sizing:border-box}
@media(max-width:420px){#g-login .login-actions43{flex-direction:column;align-items:stretch}#g-login .login-actions43 .rememberrow{flex:0 0 auto}#g-login .login-actions43 button{width:100%}}

#menuBtn{display:flex;align-items:center;justify-content:center}


/* Teal & Gold: QAGC identity with contrast-adjusted functional colours. */
body[data-look="tealgold"]:not(.theme-dark),body[data-look="tealgold"].theme-contrast{
  --navy:#173f45;
  --navy-700:#173f45;
  --navy-600:#173f45;
  --navy-500:#3c5658;
  --navy-050:#f2efe7;
  --focus-ring:#173f45;
  --appbar-bg:#173f45;
  --primary-bg:#173f45;
  --primary-bg-hover:#10292c;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#e4c882;
  --white:#ffffff;
  --bg:#f7f5f0;
  --card:#fdfcf9;
  --ink:#10292c;
  --muted:#3c5658;
  --line:#6b8082;
  --text-faint:#3c5658;
  --row-hover:#f2efe7;
  --control-off:#f2efe7;
  --switch-off:#657b90;
  --chipbtn-bg:#f2efe7;
  --chipbtn-bg-hover:#e4dfd2;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#a32622;
  --danger-surface:#a32622;
  --danger-bg:#fff0ed;
  --danger-border:#a32622;
  --ok:#17674f;
  --ok-surface:#17674f;
  --ok-bg:#e9f5ef;
  --ok-border:#17674f;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#fff6e6;
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#7a5400;
  --st-C:#173f45;
  --st-LAMA:#8f4321;
  --st-D:#046004;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:10px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-ui:system-ui,-apple-system,'Segoe UI',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#046004;
  --load-mid:#fab219;
  --load-mid-ink:#10292c;
  --load-high:#8f4321;
  --load-max:#8f2020;
}
body[data-look="tealgold"].theme-dark{
  --navy:#e4c882;
  --navy-700:#e4c882;
  --navy-600:#e4c882;
  --navy-500:#e4c882;
  --navy-050:#19383b;
  --focus-ring:#e4c882;
  --appbar-bg:#10292c;
  --primary-bg:#e4c882;
  --primary-bg-hover:#f0dbab;
  --on-primary:#10292c;
  --focus-ring-on-navy:#e4c882;
  --white:#ffffff;
  --bg:#10292c;
  --card:#173438;
  --ink:#f7f5f0;
  --muted:#c7d6d5;
  --line:#93a5a5;
  --text-faint:#c7d6d5;
  --row-hover:#1d3d40;
  --control-off:#1d3d40;
  --switch-off:#6b8095;
  --chipbtn-bg:#19383b;
  --chipbtn-bg-hover:#234449;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#ffb4ab;
  --danger-surface:#a32622;
  --danger-bg:#3d2525;
  --danger-border:#ffb4ab;
  --ok:#8ae2b6;
  --ok-surface:#17674f;
  --ok-bg:#193a2c;
  --ok-border:#8ae2b6;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#3a2f1c;
  --pending-border:#e6c98a;
  --pool-bg:#302e28;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#7a5400;
  --st-C:#173f45;
  --st-LAMA:#8f4321;
  --st-D:#046004;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:10px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-ui:system-ui,-apple-system,'Segoe UI',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#046004;
  --load-mid:#fab219;
  --load-mid-ink:#10292c;
  --load-high:#8f4321;
  --load-max:#8f2020;
}
/* rc.9.61 — Fuchsia: Harbour's token set with the brand family recoloured; neutrals, danger,
   ok, warn and the chart hues are Harbour's own, so only the identity changes. */
body[data-look="fuchsia"]:not(.theme-dark):not(.theme-contrast),body[data-look="fuchsia"].theme-contrast{
  --navy:#9d1b60;
  --navy-700:#9d1b60;
  --navy-600:#b32f7f;
  --navy-500:#c95ba0;
  --navy-050:#fbe9f3;
  --focus-ring:#9d1b60;
  --appbar-bg:#9d1b60;
  --primary-bg:#9d1b60;
  --primary-bg-hover:#7d1449;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#fdf6fa;
  --card:#ffffff;
  --ink:#182d3d;
  --muted:#4d6172;
  --line:#69796f;
  --text-faint:#4d6172;
  --row-hover:#fbeef5;
  --control-off:#fbeef5;
  --switch-off:#657b90;
  --chipbtn-bg:#f7dcea;
  --chipbtn-bg-hover:#eec2db;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#a32622;
  --danger-surface:#a32622;
  --danger-bg:#fff0ed;
  --danger-border:#a32622;
  --ok:#17674f;
  --ok-surface:#17674f;
  --ok-bg:#e9f5ef;
  --ok-border:#17674f;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#fff6e6;
  --pending-border:#e6c98a;
  --pool-bg:#f4f1ea;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#fbf0f6;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#4a0b30;
  --load-high:#c62828;
  --load-max:#493776;
}
body[data-look="fuchsia"].theme-dark{
  --navy:#f8b6d9;
  --navy-700:#f8b6d9;
  --navy-600:#f8b6d9;
  --navy-500:#c95ba0;
  --navy-050:#3a2130;
  --focus-ring:#ffc7e4;
  --appbar-bg:#1a0e15;
  --primary-bg:#8e2b62;
  --primary-bg-hover:#a63573;
  --on-primary:#ffffff;
  --focus-ring-on-navy:#ffd166;
  --white:#ffffff;
  --bg:#180c12;
  --card:#241620;
  --ink:#eef4f8;
  --muted:#b0c0ce;
  --line:#849488;
  --text-faint:#b0c0ce;
  --row-hover:#3a2130;
  --control-off:#33202c;
  --switch-off:#6b8095;
  --chipbtn-bg:#2f1d29;
  --chipbtn-bg-hover:#4a2c3c;
  --dot-idle:#a1b4c4;
  --on-navy:#ffffff;
  --on-navy-dim:#ffffff;
  --on-navy-dimmer:#ffffff;
  --on-navy-fill:rgba(255,255,255,.14);
  --on-navy-fill-soft:rgba(255,255,255,.15);
  --on-navy-fill-hover:rgba(255,255,255,.22);
  --on-navy-border:rgba(255,255,255,.18);
  --on-navy-border-soft:rgba(255,255,255,.2);
  --danger:#ffb4ab;
  --danger-surface:#a32622;
  --danger-bg:#3d2525;
  --danger-border:#ffb4ab;
  --ok:#8ae2b6;
  --ok-surface:#17674f;
  --ok-bg:#193a2c;
  --ok-border:#8ae2b6;
  --warn-bg:#fff3cd;
  --warn-border:#f0dcb8;
  --warn-ink:#614800;
  --pending-bg:#3a2f1c;
  --pending-border:#e6c98a;
  --pool-bg:#302e28;
  --pool-border:#e6dcc4;
  --flagpop-bg:#7a3d00;
  --st-P:#854b08;
  --st-C:#375c82;
  --st-LAMA:#514485;
  --st-D:#276143;
  --scrim:rgba(11,42,74,.42);
  --subnav-active-bg:rgba(11,42,74,.07);
  --shadow:0 1px 3px rgba(0,0,0,.08);
  --shadow-appbar:0 2px 10px rgba(11,42,74,.18);
  --shadow-modal:0 12px 40px rgba(0,0,0,.24);
  --shadow-toast:0 6px 22px rgba(11,42,74,.3);
  --shadow-fab:0 6px 20px rgba(11,42,74,.35);
  --shadow-pop:0 8px 26px rgba(11,42,74,.34);
  --shadow-flag:0 1px 1px rgba(0,0,0,.2);
  --r-xs:6px;
  --r-sm:8px;
  --r-md:10px;
  --radius:12px;
  --r-lg:16px;
  --r-pill:24px;
  --r-xl:24px;
  --r-round:50%;
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:12px;
  --sp-4:16px;
  --sp-5:20px;
  --sp-6:24px;
  --sp-7:32px;
  --sp-8:40px;
  --sp-9:48px;
  --font-head:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --font-ui:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Kufi Arabic','Segoe UI Arabic',sans-serif;
  --fs-3xs:12px;
  --fs-2xs:12px;
  --fs-xs:13px;
  --fs-sm:14px;
  --fs-md:16px;
  --fs-lg:18px;
  --fs-xl:20px;
  --fs-2xl:24px;
  --fs-3xl:30px;
  --lh-body:1.5;
  --z-sticky-inner:2;
  --z-subnav:15;
  --z-appbar:20;
  --z-scrim:40;
  --z-saveflag:50;
  --z-fab:55;
  --z-toast:60;
  --z-popover:75;
  --z-gate:200;
  --z-code-scrim:250;
  --ready-ink:#1a2330;
  --ready-0:#e7edf3;
  --ready-1:#fde6c9;
  --ready-2:#fbd99a;
  --ready-3:#e9ecad;
  --ready-4:#cfe6a4;
  --ready-5:#b6dc8c;
  --ready-6:#a3d47f;
  --load-low:#256e45;
  --load-mid:#e6b800;
  --load-mid-ink:#0b2a4a;
  --load-high:#c62828;
  --load-max:#493776;
}
[data-look-choice="fuchsia"] .look-swatch{background:#9d1b60}
[data-look-choice="tealgold"] .look-swatch{background:#173f45;border:3px solid #e4c882}
#staff-board45{display:none}body.display-mode33 #staff-board45{display:inline-flex}

/* rc.9.52 — tomorrow's cases are told apart from today's at a glance: a tinted card or row with a
   coloured left edge, a matching "Tomorrow" chip, and tinted Organizer day headers. One indigo that
   none of the four looks uses as an accent; a deeper version in dark mode. */
:root{--tmr-bg:#eef1ff;--tmr-edge:#4f46e5;--tmr-ink:#312e81;--tmr-hover:#dde2ff}
body.theme-dark{--tmr-bg:#1f2348;--tmr-edge:#8b93ff;--tmr-ink:#dfe3ff;--tmr-hover:#2c3270}
/* rc.9.61 — TOMORROW, PER LOOK. Harbour keeps the indigo approved on 19 Sep. The others were
   reading it against their own primary: indigo beside Royal Burgundy's magenta, and beside
   Teal-gold's teal. Each look names a tomorrow colour that stands apart from its primary and
   from the ready green that marks today's list; every ink-on-tint pair measures 9.0 or better.
   'Today' needs no entry here: it uses the --ok family, which every look already defines. */
body[data-look="limestone"]:not(.theme-dark){--tmr-bg:#f3ecfd;--tmr-edge:#6d28d9;--tmr-ink:#4c1d95;--tmr-hover:#e9dffb}
body[data-look="limestone"].theme-dark{--tmr-bg:#241a3a;--tmr-edge:#b39bff;--tmr-ink:#e7dcff;--tmr-hover:#2f2350}
body[data-look="burgundy"]:not(.theme-dark){--tmr-bg:#e8f0fe;--tmr-edge:#1d4ed8;--tmr-ink:#1e3a8a;--tmr-hover:#d7e4fd}
body[data-look="burgundy"].theme-dark{--tmr-bg:#12233f;--tmr-edge:#7aa5ff;--tmr-ink:#dbe7ff;--tmr-hover:#1a2f52}
body[data-look="tealgold"]:not(.theme-dark){--tmr-bg:#f3ecfd;--tmr-edge:#6d28d9;--tmr-ink:#4c1d95;--tmr-hover:#e9dffb}
body[data-look="tealgold"].theme-dark{--tmr-bg:#241a3a;--tmr-edge:#b39bff;--tmr-ink:#e7dcff;--tmr-hover:#2f2350}
body[data-look="fuchsia"]:not(.theme-dark){--tmr-bg:#e8f0fe;--tmr-edge:#1d4ed8;--tmr-ink:#1e3a8a;--tmr-hover:#d7e4fd}
body[data-look="fuchsia"].theme-dark{--tmr-bg:#12233f;--tmr-edge:#7aa5ff;--tmr-ink:#dbe7ff;--tmr-hover:#1a2f52}
/* Table rows (desktop, and phone when Table is chosen): tinted cells, edge on the leading cell. */
#patBody tr.tmr52>td,#orgWrap tr.tmr52[data-id]>td{background:var(--tmr-bg)}
#patBody tr.tmr52>td:first-child,#orgWrap tr.tmr52[data-id]>td:first-child{box-shadow:inset 4px 0 0 var(--tmr-edge)}
[dir="rtl"] #patBody tr.tmr52>td:first-child,[dir="rtl"] #orgWrap tr.tmr52[data-id]>td:first-child{box-shadow:inset -4px 0 0 var(--tmr-edge)}
/* Phone cards: only where the card layouts themselves apply (same breakpoints). */
@media(max-width:639px){
 body:not([data-phone-layout="table"]) #patBody tr.tmr52[data-id]{background:var(--tmr-bg);border-color:var(--tmr-edge);box-shadow:inset 5px 0 0 var(--tmr-edge)}
 body:not([data-phone-layout="table"]) #patBody tr.tmr52>td{background:transparent;box-shadow:none}
 [dir="rtl"] body:not([data-phone-layout="table"]) #patBody tr.tmr52[data-id]{box-shadow:inset -5px 0 0 var(--tmr-edge)}
}
@media(max-width:640px){
 body:not([data-phone-organizer="table"]) #orgWrap tr.tmr52[data-id]{background:var(--tmr-bg);border-color:var(--tmr-edge);box-shadow:inset 5px 0 0 var(--tmr-edge)}
 body:not([data-phone-organizer="table"]) #orgWrap tr.tmr52[data-id]>td{background:transparent;box-shadow:none}
 [dir="rtl"] body:not([data-phone-organizer="table"]) #orgWrap tr.tmr52[data-id]{box-shadow:inset -5px 0 0 var(--tmr-edge)}
}
/* Outlined, never filled: filled means a button you tap to act (e.g. Add to OR list). */
.orchip.tmr52{background:var(--tmr-bg);border:2px solid var(--tmr-edge);color:var(--tmr-ink);font-weight:700}
.orchip.tmr52:hover{background:var(--tmr-hover)}
#orgWrap tr.daydiv.tmr52 td{background:var(--tmr-bg);color:var(--tmr-ink);box-shadow:inset 4px 0 0 var(--tmr-edge);font-weight:700}
[dir="rtl"] #orgWrap tr.daydiv.tmr52 td{box-shadow:inset -4px 0 0 var(--tmr-edge)}
