/* ============================================================================
   OH TEMPLATE — design system
   Extracted and generalised from OptraEMR (00-emrv2). Plain CSS, no build step.
   Works alongside the Tailwind CDN: Tailwind supplies layout utilities, this file
   supplies the components and the palette.

   Everything is driven from the tokens in :root. To rebrand an application you
   change tokens, never component rules. A second palette lives in
   themes/ocean.css as a worked example.

   Visual language: deep brand chrome on the left, light canvas for the work,
   soft rounded surfaces, tinted icon tiles, pill controls, low-contrast
   elevation, one hue per meaning.
   ============================================================================ */

/* ---- 1. tokens ---------------------------------------------------------- */
:root{
  color-scheme:light;

  /* brand ramp — action, links, active state, focus */
  --brand-50:#ecfbf7;  --brand-100:#cdf5eb; --brand-200:#a2ead9; --brand-300:#6fd2bf;
  --brand-400:#2eb4a1; --brand-500:#0f9887; --brand-600:#0c766a; --brand-700:#0e534b;
  --brand-800:#0c3531; --brand-900:#08221f;
  --brand-rgb:15 152 135;   /* the 500 as channels — shadows and washes follow a theme switch */
  --brand-deep:#04211d;     /* darker than 900 in BOTH modes: ink on a pale fill, gradient floor */
  --on-brand:#fff;          /* text on a brand-500 fill; dark mode swaps it for --brand-deep */
  --shade-rgb:12 53 49;     /* tint of elevation shadows */
  --scrim-rgb:8 34 31;      /* tint of modal / palette backdrops */
  --brand-acc:#0f8f80;      /* the brand as a card / KPI identity accent (store.css), same in both modes */

  /* text */
  --ink:#17201e; --ink-muted:#5d6b68; --ink-soft:#93a09d; --ink-invert:#fff;

  /* surfaces — page, raised, subtle fill, deeper fill, hover wash */
  --paper:#f5f7f7; --card:#fff; --surface-2:#f7faf9; --sunk:#eaf0ee; --hover:#f2f7f6;
  --tabstrip:#dfe8e5; --tabstrip-line:#cddad6; --tabstrip-hover:#eef4f2;
  --rule:#e6ecea; --rule-soft:#eff3f2;
  /* --line is the name several modules' stylesheets use for a border (Medical Coding, the store's progress dialog,
     Denial Prediction, EHR Integration). It was never defined, so every border written with it drew nothing. It is
     the rule colour, and follows each theme and brand. */
  --line:var(--rule);

  /* chrome — the sidebar frame. Flip these five to make the menu light. */
  --nav:#0c3531; --nav-2:#0e534b; --nav-line:#1b4b45;
  --nav-ink:#eefaf7; --nav-ink-2:#9dc3bb; --nav-ink-3:#6f948d;

  /* semantic — one hue per meaning, never reused for decoration */
  --ok:#1fa25a;     --ok-bg:#e9f7ef;     --ok-line:#a8e0c6;
  --warn:#b07d18;   --warn-bg:#fdf6e8;   --warn-line:#eed6a0;
  --danger:#c0492c; --danger-bg:#fdf1ee; --danger-line:#f0cfc5;
  --info:#2563eb;   --info-bg:#eff5ff;   --info-line:#bdd5fd;

  /* machine-generated content is violet and nothing else is */
  --ai:#7c5cbf; --ai-deep:#5f4494; --ai-bg:#f4effb; --ai-line:#dccdf1;

  /* ---- chart series -----------------------------------------------------
     A SEPARATE palette from the semantic tokens above. Those encode meaning —
     red is danger, violet is machine-generated — and reusing them for "series 4"
     would make a chart contradict the rest of the system. These eight encode
     identity only, are assigned in this fixed order and are never cycled: a
     ninth series folds into "Other" or the chart becomes small multiples.
     The order is the colour-blindness safety mechanism, not decoration.
     Validated in both modes against this template's card surfaces. */
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100;
  --s5:#e87ba4; --s6:#008300; --s7:#4a3aa7; --s8:#e34948;
  --s-grid:#e6ecea; --s-axis:#93a09d;

  --r:16px; --r-sm:10px; --r-xs:8px; --r-pill:999px; --r-btn:10px;
  --r-lg:var(--r); --r-md:12px;   /* used by name in app.css, store.css and module sheets; undefined until 23 Oct 2026 (square corners) */

  /* type scale — the reference style reads at 15px; nothing a person must read goes below 12 */
  --fs-xs:12px; --fs-sm:13px; --fs-base:14.5px; --fs-md:15.5px; --fs-lg:18px; --fs-xl:20px;
  --fs-2xl:24px; --fs-3xl:30px;
  --sh-1:0 1px 2px rgb(var(--shade-rgb) / .04), 0 6px 18px rgb(var(--shade-rgb) / .05);
  --sh-2:0 2px 6px rgb(var(--shade-rgb) / .06), 0 16px 40px rgb(var(--shade-rgb) / .08);
  --sh-3:0 18px 48px rgb(var(--shade-rgb) / .18);
  --t:140ms cubic-bezier(.2,.7,.3,1);

  --font-body:'Inter Tight',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-head:'Archivo','Inter Tight',system-ui,sans-serif;
  --font-mono:'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}

/* Dark is authored for night shifts and reading rooms, not generated by
   inversion. Only tokens are redefined; not one component rule changes. */
:root[data-theme="dark"]{
  color-scheme:dark;
  --brand-50:#0d2b28;  --brand-100:#12403a; --brand-200:#17564e; --brand-300:#2c8577;
  --brand-400:#3fb3a0; --brand-500:#4ecab5; --brand-600:#6fd9c6; --brand-700:#93e5d5;
  --brand-800:#b9efe4; --brand-900:#dcf7f1;
  --on-brand:var(--brand-deep);   /* white on the pale dark-mode 500 is ~2:1 */

  --ink:#e8eeec; --ink-muted:#9fb0ac; --ink-soft:#71847f; --ink-invert:#08221f;

  --paper:#0e1513; --card:#161f1d; --surface-2:#1b2523; --sunk:#0a100f; --hover:#1f2b28;
  --tabstrip:#0a100f; --tabstrip-line:#26332f; --tabstrip-hover:#1b2523;
  --rule:#26332f; --rule-soft:#1e2724;

  --nav:#0a1210; --nav-2:#14201d; --nav-line:#243330;
  --nav-ink:#e8f4f1; --nav-ink-2:#8fa8a2; --nav-ink-3:#65807a;

  --ok:#35c489;     --ok-bg:#0e2a20;     --ok-line:#1d5f45;
  --warn:#e0a334;   --warn-bg:#2e2412;   --warn-line:#63501f;
  --danger:#f0736b; --danger-bg:#331a17; --danger-line:#6d3230;
  --info:#5b8cf7;   --info-bg:#16233f;   --info-line:#2a4478;

  --ai:#a583e6; --ai-deep:#c3aaf2; --ai-bg:#221b35; --ai-line:#453363;

  /* dark steps for the same eight hues, chosen for the dark band — not flipped */
  --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500;
  --s5:#d55181; --s6:#008300; --s7:#9085e9; --s8:#e66767;
  --s-grid:#26332f; --s-axis:#71847f;

  --sh-1:0 1px 2px rgba(0,0,0,.4);
  --sh-2:0 6px 18px rgba(0,0,0,.5);
  --sh-3:0 20px 52px rgba(0,0,0,.65);
}

/* ---- brand palettes ------------------------------------------------------
   <html data-brand="teal|indigo|blue">, set before first paint by tw-config.js
   and switched from the account menu (shell.js). Teal is the :root palette
   above, but a page with no brand set shows blue (the blue block's selector). Only brand, chrome and the faintly brand-tinted neutrals move;
   semantic (ok/warn/danger/info/ai) and chart series never do. Each palette
   needs a light set and a [data-theme="dark"] set: the light set has the same
   specificity as the teal dark block, so it must come after it. */
:root[data-brand="indigo"]{
  --brand-50:#eef0ff;  --brand-100:#e0e4ff; --brand-200:#c6cdfd; --brand-300:#a3aefa;
  --brand-400:#7b83f0; --brand-500:#4f4ad8; --brand-600:#4038c0; --brand-700:#342d99;
  --brand-800:#27236c; --brand-900:#1a1847;
  --brand-rgb:79 74 216; --brand-deep:#110f33; --brand-acc:#4f4ad8;
  --shade-rgb:32 29 84; --scrim-rgb:21 19 56;
  --ink:#191a2c; --ink-muted:#5d5f78; --ink-soft:#9395ad;
  --paper:#f5f6f9; --surface-2:#f8f8fc; --sunk:#eaecf4; --hover:#f3f3fa;
  --tabstrip:#e1e3f0; --tabstrip-line:#d0d3e5; --tabstrip-hover:#eff0f7;
  --rule:#e5e7f0; --rule-soft:#eff0f6;
  --nav:#27236c; --nav-2:#342d99; --nav-line:#3a3582;
  --nav-ink:#f0f0ff; --nav-ink-2:#bcbde8; --nav-ink-3:#9395cf;
  --s-grid:#e5e7f0; --s-axis:#9395ad;
}
:root[data-brand="indigo"][data-theme="dark"]{
  --brand-50:#1a1a3a;  --brand-100:#23234f; --brand-200:#2e2e6a; --brand-300:#4a4aa0;
  --brand-400:#6d6fd8; --brand-500:#8b8ef0; --brand-600:#a5a8f5; --brand-700:#c0c2f8;
  --brand-800:#d9dafb; --brand-900:#eeeefe;
  --ink:#e9e9f2; --ink-muted:#a4a5ba; --ink-soft:#76778e; --ink-invert:#110f33;
  --paper:#0f0f16; --card:#17171f; --surface-2:#1c1c26; --sunk:#0a0a10; --hover:#212130;
  --tabstrip:#0a0a10; --tabstrip-line:#292938; --tabstrip-hover:#1c1c26;
  --rule:#292938; --rule-soft:#20202b;
  --nav:#0d0d1a; --nav-2:#17172a; --nav-line:#28283d;
  --nav-ink:#ecebf7; --nav-ink-2:#a3a2c0; --nav-ink-3:#7f7ea3;
  --s-grid:#292938; --s-axis:#76778e;
}
:root:not([data-brand="teal"]):not([data-brand="indigo"]){   /* blue is also what a page shows before any brand is set */
  --brand-50:#edf5ff;  --brand-100:#d8e8fd; --brand-200:#b4d1fb; --brand-300:#83b2f5;
  --brand-400:#478ee9; --brand-500:#1765cc; --brand-600:#1254ae; --brand-700:#114389;
  --brand-800:#0f3263; --brand-900:#0a2140;
  --brand-rgb:23 101 204; --brand-deep:#06162b; --brand-acc:#1765cc;
  --shade-rgb:15 46 87; --scrim-rgb:10 30 58;
  --ink:#16202b; --ink-muted:#5a6776; --ink-soft:#909dab;
  --paper:#f5f7fa; --surface-2:#f7f9fc; --sunk:#e9eef4; --hover:#f2f6fa;
  --tabstrip:#dfe6ee; --tabstrip-line:#cdd8e3; --tabstrip-hover:#eef3f8;
  --rule:#e4eaf0; --rule-soft:#eef2f6;
  --nav:#0f3263; --nav-2:#114389; --nav-line:#1d4677;
  --nav-ink:#edf4fd; --nav-ink-2:#aac3e4; --nav-ink-3:#84a2c9;
  --s-grid:#e4eaf0; --s-axis:#909dab;
}
:root:not([data-brand="teal"]):not([data-brand="indigo"])[data-theme="dark"]{
  --brand-50:#0c1f36;  --brand-100:#11304f; --brand-200:#17416b; --brand-300:#2a64a0;
  --brand-400:#3f86d6; --brand-500:#5aa0f0; --brand-600:#7db5f4; --brand-700:#a1caf7;
  --brand-800:#c4ddfa; --brand-900:#e2eefd;
  --ink:#e8edf3; --ink-muted:#9eacbb; --ink-soft:#6f7e8e; --ink-invert:#06162b;
  --paper:#0e131a; --card:#151c25; --surface-2:#1a222c; --sunk:#0a0e14; --hover:#1e2835;
  --tabstrip:#0a0e14; --tabstrip-line:#253140; --tabstrip-hover:#1a222c;
  --rule:#253140; --rule-soft:#1d2530;
  --nav:#0a0f17; --nav-2:#141c28; --nav-line:#243142;
  --nav-ink:#e8eef6; --nav-ink-2:#93a4bb; --nav-ink-3:#6f829c;
  --s-grid:#253140; --s-axis:#6f7e8e;
}

/* ---- 2. base ------------------------------------------------------------ */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font-body);
  font-size:var(--fs-base);line-height:1.55;text-wrap:pretty;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4,h5,h6,.font-head{font-family:var(--font-head);font-weight:600;letter-spacing:-.015em;margin:0}
h1{font-size:34px;line-height:1.08}
h2{font-size:26px;line-height:1.16}
h3{font-size:21px}
h4{font-size:18px}
/* h6 heads a card or a block inside one: a title, not an uppercase label */
h5{font-size:var(--fs-lg);font-weight:700;color:var(--ink)}
h6{font-size:var(--fs-md);font-weight:700;letter-spacing:-.005em;color:var(--ink)}
a{color:var(--brand-600);text-decoration:none}
a:hover{color:var(--brand-800);text-decoration:underline}
hr{border:0;border-top:1px solid var(--rule);margin:0}
::selection{background:var(--brand-100);color:var(--brand-900)}
.muted{color:var(--ink-muted)}
.soft{color:var(--ink-soft)}
.kicker{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);font-weight:600}
.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.94em}
.num{font-variant-numeric:tabular-nums}
.oh-i{display:inline-block;width:1.15em;height:1.15em;flex:none;vertical-align:-.2em}
.measure{max-width:68ch}

/* ---- 3. surfaces -------------------------------------------------------- */
.card{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh-1);overflow:hidden}
/* opt out where a child must escape the box: menus, popovers, sticky heads */
.card.is-open{overflow:visible}
.card-pad{padding:22px 24px}
.card-hover{transition:box-shadow var(--t),transform var(--t),border-color var(--t)}
.card-hover:hover{box-shadow:var(--sh-2);border-color:var(--brand-200)}
.card-head{display:flex;align-items:center;gap:12px;padding:13px 18px;border-bottom:1px solid var(--rule-soft);flex-wrap:wrap}
/* A card header carrying a panel's name, and optionally a line of context beside it. Several
   components ask for this shape — the denial risk panel, the coded chart, the interoperability
   panel — and without it their headings rendered as a bare <h4> with no padding, sitting outside
   the card it was meant to head. The title is sized down from a page heading on purpose: it
   names a panel inside a screen, not the screen. */
.card-h{display:flex;align-items:baseline;gap:10px;padding:13px 18px;
  border-bottom:1px solid var(--rule-soft);flex-wrap:wrap}
.card-h>h4{font-size:15px;font-weight:600;margin:0;flex:none}
.card-h>.card-sub{font-size:12.5px;color:var(--ink-soft);flex:1 1 18ch;min-width:0}
.card-foot{display:flex;align-items:center;gap:10px;padding:14px 24px;border-top:1px solid var(--rule);background:var(--surface-2);flex-wrap:wrap}
.hairline{border-top:1px solid var(--rule-soft)}

/* accent rail — colour doing layout work rather than sitting in a corner */
.card-ok{border-left:3px solid var(--ok)}
.card-warn{border-left:3px solid var(--warn)}
.card-crit{border-left:3px solid var(--danger)}
.card-info{border-left:3px solid var(--info)}
.card-ai{border-left:3px solid var(--ai)}

/* icon tile — soft tinted square */
.itile{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;flex:none;
  background:var(--brand-50);color:var(--brand-600);font-size:16px;line-height:1}
.itile-ok{background:var(--ok-bg);color:var(--ok)}
.itile-warn{background:var(--warn-bg);color:var(--warn)}
.itile-danger{background:var(--danger-bg);color:var(--danger)}
.itile-ai{background:var(--ai-bg);color:var(--ai)}
.itile-neutral{background:var(--sunk);color:var(--ink-muted)}

/* ---- 4. KPI ------------------------------------------------------------- */
.kpi{position:relative;overflow:hidden;background:var(--card);border:1px solid var(--rule);
  border-radius:var(--r);box-shadow:var(--sh-1);padding:16px 18px;display:flex;flex-direction:column;gap:10px}
.kpi::before{content:'';position:absolute;left:0;right:0;top:0;height:3px;background:var(--brand-400)}
.kpi.tone-critical::before{background:var(--danger)}
.kpi.tone-warn::before{background:var(--warn)}
.kpi.tone-ok::before{background:var(--ok)}
.kpi.tone-ai::before{background:var(--ai)}
.kpi.tone-plain::before{background:var(--brand-200)}
.kpi-value{font-family:var(--font-head);font-weight:600;font-size:30px;line-height:1;letter-spacing:-.02em}
.delta{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;
  padding:3px 9px;border-radius:var(--r-pill);background:var(--brand-50);color:var(--brand-600)}
.delta-down{background:var(--danger-bg);color:var(--danger)}
.delta-flat{background:var(--sunk);color:var(--ink-muted)}
.meter{height:6px;border-radius:var(--r-pill);background:var(--sunk);overflow:hidden}
.meter>i{display:block;height:100%;border-radius:var(--r-pill);background:var(--brand-400)}

/* ---- 5. buttons --------------------------------------------------------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--font-head);
  font-weight:600;font-size:14px;padding:8px 16px;min-height:36px;border-radius:var(--r-btn);
  border:1px solid transparent;cursor:pointer;background:none;color:inherit;white-space:nowrap;
  transition:background var(--t),border-color var(--t),color var(--t),box-shadow var(--t)}
.btn:focus-visible{outline:2px solid var(--brand-400);outline-offset:2px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-primary{background:var(--brand-500);color:var(--on-brand);box-shadow:0 4px 14px rgb(var(--brand-rgb) / .22)}
.btn-primary:hover:not(:disabled){background:var(--brand-600)}
.btn-secondary{border-color:var(--rule);background:var(--card);color:var(--ink);box-shadow:0 1px 2px rgba(16,24,40,.04)}
.btn-secondary:hover:not(:disabled){border-color:var(--brand-300);color:var(--brand-700);background:var(--brand-50)}
.btn-ghost{color:var(--brand-600);padding-inline:10px}
.btn-ghost:hover:not(:disabled){color:var(--brand-800);background:var(--brand-50)}
/* a ghost that must not read as an action — 'Dismiss' beside 'Accept' */
.btn-quiet{color:var(--ink-muted);padding-inline:10px}
.btn-quiet:hover:not(:disabled){color:var(--ink);background:var(--hover)}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger:hover:not(:disabled){filter:brightness(.92)}
/* a button made from a link keeps its own colours on hover: the global a:hover (dark blue, underlined) is more
   specific than .btn-primary and turned white button text dark (GeneEvidence "Continue this conversation", 17 Nov) */
a.btn:hover{text-decoration:none}
a.btn-primary:hover{color:var(--on-brand)}
a.btn-secondary:hover{color:var(--brand-700)}
a.btn-ghost:hover{color:var(--brand-800)}
a.btn-quiet:hover{color:var(--ink)}
a.btn-danger:hover{color:#fff}
.btn-sm{font-size:13px;padding:5px 12px;min-height:32px}
.btn-icon{padding:0;width:40px;min-height:40px;border-radius:var(--r-pill)}
.btn-icon.btn-sm{width:32px;min-height:32px}
/* the round outlined row action of the reference tables */
.btn-round{padding:0;width:36px;min-height:36px;border-radius:50%;border:1px solid var(--rule);background:var(--card);color:var(--ink-muted)}
.btn-round:hover:not(:disabled){border-color:var(--brand-300);color:var(--brand-700);background:var(--brand-50)}
.btn .oh-i{width:17px;height:17px}
@media (pointer:coarse){.btn{min-height:44px;padding-inline:20px}.btn-sm{min-height:38px}}

/* ---- 6. forms ----------------------------------------------------------- */
.field{display:flex;flex-direction:column;gap:3px}
.field>label{font-size:12.5px;font-weight:600;color:var(--ink);line-height:1.35}
.field-hint{font-size:11.5px;color:var(--ink-soft);line-height:1.4}
.field-error{font-size:var(--fs-xs);color:var(--danger)}
.input{width:100%;background:var(--card);border:1px solid var(--rule);border-radius:var(--r-sm);
  padding:5px 11px;min-height:34px;font-family:inherit;font-size:13.5px;color:var(--ink);
  transition:border-color var(--t),box-shadow var(--t)}
.input:focus{outline:none;border-color:var(--brand-400);box-shadow:0 0 0 4px var(--brand-50)}
.input::placeholder{color:var(--ink-soft)}
.input.is-invalid{border-color:var(--danger)}
.input:disabled{background:var(--surface-2);color:var(--ink-soft);cursor:not-allowed}
textarea.input{min-height:80px;resize:vertical}
select.input{appearance:none;padding-right:34px;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235d6b68' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:right 14px center;background-size:11px 8px;background-repeat:no-repeat}
:root[data-theme="dark"] select.input{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%239fb0ac' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.input-search{border-radius:var(--r-pill);background:var(--surface-2);border-color:transparent;padding-left:16px}
.input-search:focus{background:var(--card)}
.switch{position:relative;display:inline-flex;align-items:center;gap:9px;cursor:pointer;font-size:13px}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch i{width:38px;height:22px;border-radius:var(--r-pill);background:var(--sunk);position:relative;
  transition:background var(--t);flex:none}
.switch i::after{content:'';position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;
  background:var(--card);box-shadow:var(--sh-1);transition:transform var(--t)}
.switch input:checked + i{background:var(--brand-500)}
.switch input:checked + i::after{transform:translateX(16px)}
.switch input:focus-visible + i{outline:2px solid var(--brand-400);outline-offset:2px}
@media (pointer:coarse){.input{min-height:44px}}

/* ---- 7. tags ------------------------------------------------------------ */
.tag{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:600;padding:5px 12px;
  border-radius:8px;border:1px solid transparent;white-space:nowrap;line-height:1.25}
.tag-neutral{background:var(--sunk);color:var(--ink-muted)}
.tag-outline{border-color:var(--rule);color:var(--ink-muted);background:var(--card)}
.tag-brand{background:var(--brand-50);color:var(--brand-600)}
.tag-ok{background:var(--ok-bg);color:var(--ok)}
.tag-warn{background:var(--warn-bg);color:var(--warn)}
.tag-critical{background:var(--danger-bg);color:var(--danger)}
.tag-danger{background:var(--danger);color:#fff}
.tag-info{background:var(--info-bg);color:var(--info)}
.tag-ai{background:var(--ai-bg);color:var(--ai)}
.tag-dot::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}

/* ---- 8. tables ---------------------------------------------------------- */
.table{width:100%;border-collapse:separate;border-spacing:0}
.table th{font-family:var(--font-head);font-size:var(--fs-sm);letter-spacing:0;color:var(--ink);
  text-align:left;padding:10px 16px;background:var(--surface-2);border-bottom:1px solid var(--rule);font-weight:600;
  text-transform:none}
.table th:first-child{border-top-left-radius:var(--r-sm)}
.table th:last-child{border-top-right-radius:var(--r-sm)}
.table td{padding:11px 16px;border-bottom:1px solid var(--rule-soft);vertical-align:middle;font-size:var(--fs-base)}
.table tbody tr:last-child td{border-bottom:0}
.table tbody tr{transition:background .12s}
.table tbody tr:hover{background:var(--hover)}
.table tr.is-selected{background:var(--brand-50)}
.table tr.is-selected td:first-child{box-shadow:inset 3px 0 0 var(--brand-500)}
.table .num{font-variant-numeric:tabular-nums;white-space:nowrap}
.table .mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;white-space:nowrap}
.table .money{font-weight:700;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
/* a person or organisation cell: avatar, name, a quiet second line */
.cell-who{display:flex;align-items:center;gap:12px;min-width:0}
.cell-who .av{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:var(--brand-50);color:var(--brand-700);font-family:var(--font-head);font-weight:700;font-size:13px}
.cell-who b{display:block;font-weight:600;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cell-who span{display:block;font-size:var(--fs-xs);color:var(--ink-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nowrap{white-space:nowrap}

/* smart data table (OH.ui.dataTable): search, sortable headers, paging */
.dt-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 20px;border-bottom:1px solid var(--rule-soft)}
.dt-toolbar .dt-search{flex:1;min-width:200px;max-width:320px}
.dt-toolbar .dt-search .input{width:100%;min-height:36px}
.dt-size{display:flex;align-items:center;gap:8px;font-size:var(--fs-sm);color:var(--ink-muted);white-space:nowrap}
.dt-size select{width:auto;min-height:40px;padding-block:.3rem}
.table th{white-space:nowrap}
.table th.dt-sortable{cursor:pointer;user-select:none;white-space:nowrap}
.table .sel-cell{width:56px}
.table th.dt-sortable:hover{background:var(--brand-50);color:var(--brand-700)}
.dt-caret{margin-left:6px;font-size:10px;opacity:.4}
.table th.dt-sortable:hover .dt-caret{opacity:.85}
.dt-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  padding:14px 20px;border-top:1px solid var(--rule-soft)}
.dt-count{font-size:var(--fs-sm);color:var(--ink-muted)}
.dt-pager{display:flex;align-items:center;gap:8px}
.dt-jump{display:flex;align-items:center;gap:8px;font-size:var(--fs-sm);color:var(--ink-muted);white-space:nowrap}
.dt-jump select{width:auto;min-height:32px;padding:.2rem 1.5rem .2rem .55rem}

/* ---- the height of a table ----------------------------------------------
   The rows scroll inside the table and the page does not: the toolbar, the
   column headings and the pager stay where they were put while a thousand rows
   go past under them. `--dt-h` is written on the box by ui.js, measured against
   the real window (see fitOne there); the fraction here is the fallback, used
   before the first measurement, with JavaScript off, and on anything narrower
   than a laptop, where there is nothing left under a stacked KPI strip worth
   measuring.

   A module that needs a different height sets `max-height` on `.dt-scroll`
   itself — any module selector is longer than this one, and an inline height
   (Benefits & Eligibility sizes its own grid) beats both.

   The wheel passes on to the page once a table reaches its end (overscroll-behavior:auto), and a
   table that only overflows sideways never holds the wheel at all: with `contain`, the pointer
   resting over any table stopped the page from scrolling, which felt like the app had frozen. */
.dt-scroll{overflow:auto;max-height:var(--dt-h,68vh);overscroll-behavior:auto}
/* The Actions column every table carries: quiet icons, pushed to the right edge, the bin
   turning red only when it can actually be used. A disabled one keeps its tooltip, which is
   where the reason a row cannot be removed is written. */
.row-acts{display:flex;align-items:center;justify-content:flex-end;gap:2px}
.row-acts .btn-icon.btn-sm{width:30px;min-height:30px}
.row-acts .btn[data-del]:hover:not(:disabled){color:var(--danger);background:var(--danger-bg)}
.row-acts .btn:disabled{opacity:.35}
.dt-scroll .table thead th{position:sticky;top:0;z-index:4}
/* A dialog scrolls its own body; a second scrollport inside it is two
   scrollbars for one list. */
.oh-modal .dt-scroll{max-height:none}
/* A dialog keeps the wheel to itself: a list or the dialog body that reaches its end does not start
   scrolling the page behind the backdrop (tables on the page itself hand the wheel on; see .dt-scroll). */
.oh-modal .dt-scroll,.oh-modal-body{overscroll-behavior:contain}

/* ---- 9. AI surfaces ------------------------------------------------------
   Machine-generated content is always violet and always says why it is there.
   Nothing else in the system may use this hue. */
.ai-badge{display:inline-flex;align-items:center;font-family:var(--font-head);font-size:9.5px;
  font-weight:700;letter-spacing:.08em;padding:3px 8px;background:var(--ai);color:#fff;
  border-radius:var(--r-pill);flex:none}
.ai-panel{border:1px solid var(--ai-line);border-radius:var(--r);
  background:linear-gradient(180deg,var(--ai-bg),var(--card) 78%)}
.ai-card{border:1px solid var(--rule);background:var(--card);border-radius:var(--r-sm);
  padding:13px 15px;display:flex;flex-direction:column;gap:8px;
  transition:border-color var(--t),box-shadow var(--t)}
.ai-card:hover{border-color:var(--ai-line);box-shadow:var(--sh-1)}
.ai-card.is-accepted{border-color:var(--brand-400);background:var(--brand-50)}
.ai-card.is-dismissed{opacity:.45}
.ai-why{font-size:11.5px;color:var(--ink-muted);line-height:1.5}
.ai-source{font-size:11px;color:var(--ai-deep);border-bottom:1px dotted var(--ai-line);cursor:pointer}
.ai-conf{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;color:var(--ink-muted)}
.ai-conf i{width:34px;height:4px;border-radius:var(--r-pill);background:var(--sunk);overflow:hidden;display:block}
.ai-conf i b{display:block;height:100%;background:var(--ai);border-radius:var(--r-pill)}
/* streaming answer: a caret that blinks while the model is still writing */
.ai-stream{font-size:13.5px;line-height:1.6}
.ai-stream.is-live::after{content:'';display:inline-block;width:7px;height:15px;margin-left:2px;
  background:var(--ai);vertical-align:-2px;animation:aiCaret 1s steps(2) infinite}
@keyframes aiCaret{0%,49%{opacity:1}50%,100%{opacity:0}}
.ai-thinking{display:inline-flex;gap:4px;align-items:center}
.ai-thinking i{width:5px;height:5px;border-radius:50%;background:var(--ai);animation:aiDot 1.1s ease-in-out infinite}
.ai-thinking i:nth-child(2){animation-delay:.16s}
.ai-thinking i:nth-child(3){animation-delay:.32s}
@keyframes aiDot{0%,80%,100%{opacity:.28;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}

/* ---- 10. alerts --------------------------------------------------------- */
.alert{display:flex;gap:12px;align-items:flex-start;padding:14px 18px;border-radius:12px;
  font-size:14px;line-height:1.5}
.alert-critical{border:1px solid var(--danger-line);background:var(--danger-bg);color:var(--ink)}
.alert-warn{border:1px solid var(--warn-line);background:var(--warn-bg);color:var(--ink)}
.alert-important{border:1px solid var(--brand-200);background:var(--brand-50);color:var(--ink)}
.alert-info{border:1px dashed var(--rule);background:var(--surface-2);color:var(--ink-muted)}

/* context banner — "you are looking at something outside your usual scope" */
.banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:9px 20px;
  background:var(--warn-bg);border-bottom:1px solid var(--warn-line);position:sticky;top:0;z-index:25}
.banner-tag{font-family:var(--font-head);font-weight:600;font-size:9.5px;letter-spacing:.1em;
  text-transform:uppercase;padding:3px 8px;background:var(--warn);color:#fff;border-radius:2px;flex:none}
.banner-text{font-size:12.5px;color:var(--ink);line-height:1.45;min-width:200px;flex:1}
/* trial countdown: brand-tinted, turns to the warning colours in its last two days */
.banner-trial{background:var(--brand-50);border-bottom:1px solid var(--brand-200,var(--rule))}
.banner-trial.is-urgent{background:var(--warn-bg);border-bottom-color:var(--warn-line)}
.banner-count{display:flex;align-items:baseline;gap:5px;flex:none;padding:3px 10px;border-radius:8px;background:var(--brand-500);color:#fff}
.banner-trial.is-urgent .banner-count{background:var(--warn)}
.banner-count b{font-family:var(--font-head);font-size:18px;line-height:1.1}
.banner-count span{font-size:11px;font-weight:600;letter-spacing:.02em}
.banner-note{display:inline-block;margin-left:8px;padding:2px 9px;border-radius:999px;background:var(--surface,#fff);
  border:1px solid var(--rule);font-weight:700;font-size:12px;color:var(--ink)}

/* ---- 11. shell ---------------------------------------------------------- */
.shell{display:flex;min-height:100vh}
.sidebar{width:var(--sb-w,236px);flex:none;background:var(--nav);color:var(--nav-ink-2);
  border-right:1px solid var(--nav-line);display:flex;flex-direction:column;position:sticky;top:0;
  height:100vh;z-index:35;overflow-x:hidden;
  transition:width .2s cubic-bezier(.4,0,.2,1),margin-right .2s cubic-bezier(.4,0,.2,1)}
.sidebar nav{overflow-x:hidden;overflow-y:auto;
  /* A thin, quiet scrollbar that belongs to the dark menu: no arrows, no light track, a faint thumb. */
  scrollbar-gutter:stable}
/* Chrome and Safari draw arrows whenever the standard properties are set, so those are left to
   browsers without the ::-webkit-scrollbar styling (Firefox). */
@supports not selector(::-webkit-scrollbar){
  .sidebar nav{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.16) transparent}
}
.sidebar nav::-webkit-scrollbar{width:6px}
.sidebar nav::-webkit-scrollbar-track{background:transparent}
.sidebar nav::-webkit-scrollbar-button{display:none;height:0}
.sidebar nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);border-radius:6px}
.sidebar nav::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32)}
.sidebar .brandmark{display:flex;align-items:center;gap:10px;padding:20px 20px 12px}
.sidebar .brandmark .glyph{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;
  background:var(--brand-500);color:var(--on-brand);font-family:var(--font-head);font-weight:700;font-size:15px;flex:none}
.sidebar .brandmark .name{font-family:var(--font-head);font-weight:600;font-size:17px;
  line-height:1;letter-spacing:.01em;color:var(--nav-ink);display:block}
.sidebar .brandmark .kicker{color:var(--nav-ink-3);margin-top:3px}
.sidebar .foot{margin-top:auto;padding:12px 16px;border-top:1px solid var(--nav-line);
  display:flex;align-items:center;gap:8px}
.sidebar .foot .who{min-width:0;flex:1}
.sidebar .foot .who b{display:block;font-size:12.5px;color:var(--nav-ink);font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar .foot .who span{display:block;font-size:10.5px;color:var(--nav-ink-3);line-height:1.3}
.sidebar .jump{padding:10px 16px;border-top:1px solid var(--nav-line)}
.sidebar .btn-secondary{background:var(--nav-2);border-color:var(--nav-line);color:var(--nav-ink)}
.sidebar .btn-secondary:hover{background:var(--nav-line);color:#fff;border-color:var(--nav-line)}

.navgroup{font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--nav-ink-3);
  padding:14px 20px 6px;font-weight:700}
/* Menu items are the near-white of the sidebar's own palette, not a muted grey: they are the
   thing the sidebar is for, and a dim label on a dark panel is read slower every single time.
   The token rather than #fff so each brand keeps its own near-white — the blue navy wants a
   faintly blue white, the teal a faintly green one — and the rail, the flyouts and the dark
   theme all follow without a second rule. Hover goes to pure white on a lifted background, so
   there is still somewhere for the pointer to take it. */
.navlink{display:flex;align-items:center;gap:11px;margin:2px 10px;padding:9px 12px;border-radius:var(--r-sm);
  font-size:13.5px;color:var(--nav-ink);cursor:pointer;transition:background var(--t),color var(--t)}
.navlink:hover{background:var(--nav-2);color:#fff;text-decoration:none}
.navlink.is-active{background:var(--brand-500);color:var(--on-brand);font-weight:600;box-shadow:0 4px 14px rgb(var(--brand-rgb) / .22)}
.navlink .dot{width:18px;text-align:center;font-size:14px;flex:none;opacity:.9}
/* a page listed under the one above it: indented, with a guide line, always shown */
.navlink.is-sub{margin-left:34px;padding-top:6px;padding-bottom:6px;font-size:13px;position:relative}
.navlink.is-sub::before{content:"";position:absolute;left:-12px;top:-2px;bottom:-2px;border-left:1px solid var(--nav-line)}
.navlink.is-sub .dot{width:14px;font-size:12px}
/* a long name wraps onto a second line rather than lose its end ("Prior Auth Requirements") */
.navlink .label{min-width:0;flex:1 1 auto;line-height:1.3;overflow-wrap:anywhere}
.navlink .count{margin-left:auto;font-size:10.5px;font-weight:700;padding:1px 8px;border-radius:var(--r-pill);
  background:var(--nav-2);color:var(--nav-ink-2)}
.navlink.is-active .count{background:rgba(255,255,255,.22);color:#fff}
.usercard{display:flex;align-items:center;gap:10px;margin:10px;padding:10px 12px;border-radius:var(--r-sm);
  background:var(--nav-2)}
.usercard b{display:block;font-size:12.5px;color:var(--nav-ink);font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.usercard span.sub{display:block;font-size:10.5px;color:var(--nav-ink-3);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avatar{width:34px;height:34px;border-radius:var(--r-pill);display:grid;place-items:center;
  background:var(--brand-500);color:var(--on-brand);font-family:var(--font-head);font-weight:600;font-size:12.5px;flex:none}

.content{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;gap:12px;padding:12px 22px;background:var(--card);
  border-bottom:1px solid var(--rule);position:sticky;top:0;z-index:30}
.page{padding:20px 26px 40px;display:flex;flex-direction:column;gap:18px;max-width:2100px;width:100%}
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;gap:16px}
.page-head .actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}

/* collapsed rail: icons only, expansion floats so content keeps its width */
/* Collapsed behaviour lives in section 27, next to the flyout it depends on. */
.railtoggle{position:absolute;top:14px;right:-11px;width:22px;height:22px;border-radius:var(--r-pill);
  border:1px solid var(--nav-line);background:var(--nav-2);color:var(--nav-ink);font-size:10px;
  display:grid;place-items:center;cursor:pointer;z-index:40;box-shadow:var(--sh-1)}
.railtoggle:hover{background:var(--brand-500);border-color:var(--brand-500);color:var(--on-brand)}

.mobilenav{display:none}
@media (max-width:767px){
  .sidebar{display:none}
  .mobilenav{display:flex;position:fixed;bottom:0;left:0;right:0;background:var(--nav);
    border-top:1px solid var(--nav-line);z-index:40;padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -6px 24px rgba(0,0,0,.14)}
  .mobilenav a{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:10px 4px;
    min-height:58px;font-size:10px;color:var(--nav-ink);text-decoration:none}
  .mobilenav a.is-active{color:#fff;font-weight:600}
  .content{padding-bottom:74px}
  .page{padding:14px 14px 30px;gap:14px}
}

/* ---- 12. density -------------------------------------------------------
   A clerk on a 13-inch laptop and a manager on a 27-inch monitor want different
   amounts of air. One attribute drives every surface, so no page is ever
   redesigned to fit. */
html[data-density="compact"] .card-pad{padding:12px 14px}
html[data-density="compact"] .table th{padding:7px 11px;font-size:10.5px}
html[data-density="compact"] .table td{padding:8px 11px;font-size:12.5px}
html[data-density="compact"] .input{min-height:32px;padding:6px 10px;font-size:12.5px}
html[data-density="compact"] .btn{padding:6px 12px;font-size:12.5px;min-height:32px}
html[data-density="compact"] .btn-sm{padding:3px 9px;font-size:11.5px;min-height:28px}
html[data-density="compact"] .navlink{padding:6px 12px;font-size:12.5px}
html[data-density="compact"] .chip{padding:4px 10px;font-size:11.5px}
html[data-density="compact"] .kicker{font-size:9px}
html[data-density="compact"] .topbar{padding:8px 16px}
html[data-density="compact"] .page{padding:12px 16px 30px;gap:12px}
html[data-density="compact"] .alert{padding:8px 12px}

/* ---- 13. the workbench --------------------------------------------------
   Full-width cards stacked in one column are what make a page long and narrow at
   the same time. .wb flows panels into as many columns as the screen can carry
   and lets a panel claim two when it earns them, so a wide monitor shows three
   columns of work instead of one column of work and two of whitespace. */
.wb{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.wb > *{flex:1 1 320px;min-width:0}
.wb-2{flex:2 1 660px}
.wb-full{flex:1 1 100%}
.wb-sm{flex:1 1 320px;max-width:520px}
.wb-tight{gap:10px}

/* a panel that can be folded away when it is not today's problem */
.panel{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh-1);
  overflow:hidden;display:flex;flex-direction:column;min-width:0}
.panel > summary{display:flex;align-items:center;gap:8px;padding:10px 14px;cursor:pointer;
  font-family:var(--font-head);font-size:12.5px;font-weight:600;list-style:none;
  border-bottom:1px solid transparent}
.panel > summary::-webkit-details-marker{display:none}
.panel > summary::before{content:'▸';font-size:9px;color:var(--ink-soft);transition:transform var(--t)}
.panel[open] > summary::before{transform:rotate(90deg)}
.panel[open] > summary{border-bottom-color:var(--rule)}
.panel > summary:hover{background:var(--hover)}
.panel > summary .n{margin-left:auto;font-size:10px;font-weight:700;padding:1px 7px;
  border-radius:var(--r-pill);background:var(--sunk);color:var(--ink-muted)}
.panel-body{padding:12px 14px;min-width:0}

/* ---- 14. record context bar -------------------------------------------- */
.ctxbar{display:flex;align-items:center;gap:14px;padding:12px 22px;background:var(--card);
  border-bottom:1px solid var(--rule);flex-wrap:wrap}
.ctxbar .ident{width:40px;height:40px;display:grid;place-items:center;background:var(--brand-700);
  color:#fff;font-family:var(--font-head);font-weight:600;flex:none;border-radius:var(--r-sm)}
.ctxbar .facts{display:flex;align-items:flex-end;gap:22px;flex-wrap:wrap}
.ctxbar .fact{display:flex;flex-direction:column;gap:1px}
.ctxbar .fact .k{font-size:9px;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-soft);font-weight:700}
.ctxbar .fact .v{font-size:13.5px;font-weight:600}

/* ---- 15. command palette ------------------------------------------------ */
.palette-back{position:fixed;inset:0;background:rgb(var(--scrim-rgb) / .32);backdrop-filter:blur(2px);z-index:60;display:none}
.palette{position:fixed;z-index:61;top:9vh;left:50%;transform:translateX(-50%);width:min(1040px,94vw);
  background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh-2);
  display:none;flex-direction:column;max-height:78vh;overflow:hidden}
.pal-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--rule)}
.pal-group{padding:0 14px 2px}
.pal-group-h{padding:13px 2px 7px;position:sticky;top:0;background:var(--card);z-index:1;
  display:flex;align-items:baseline;gap:8px}
.pal-group-hint{text-transform:none;letter-spacing:0;font-weight:500;color:var(--ink-soft);font-size:10.5px}
.pal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(172px,1fr));gap:8px;
  padding:3px 0 8px}
.pal-tile{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;
  padding:11px 12px;min-height:66px;border:1px solid var(--rule);border-radius:var(--r-sm);
  background:var(--card);cursor:pointer;transition:border-color .12s,background .12s,transform .12s}
/* the tile lifts on hover, so it must sit ABOVE the sticky group heading —
   otherwise the heading paints over the tile's top border */
.pal-tile:hover{border-color:var(--brand-400);background:var(--brand-50);
  transform:translateY(-1px);position:relative;z-index:2}
.pal-tile.is-cursor{border-color:var(--brand-500);background:var(--brand-50);
  box-shadow:0 0 0 2px var(--brand-100);position:relative;z-index:2}
.pal-ico{font-size:16px;line-height:1;color:var(--brand-600)}
.pal-label{font-size:13px;font-weight:600;color:var(--ink);line-height:1.25}
.pal-hint{font-size:10.5px;color:var(--ink-soft);line-height:1.3;margin-top:auto}

/* ---- 16. workspace wall ------------------------------------------------- */
.ws-wall{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
.ws-tile{display:flex;flex-direction:column;gap:9px;text-align:left;padding:18px;border:1px solid var(--rule);
  border-radius:var(--r);background:var(--card);box-shadow:var(--sh-1);cursor:pointer;
  transition:border-color var(--t),box-shadow var(--t),transform var(--t)}
.ws-tile:hover{border-color:var(--brand-400);box-shadow:var(--sh-2);transform:translateY(-2px)}
.ws-tile.is-home{border-color:var(--brand-500);background:linear-gradient(180deg,var(--brand-50),var(--card) 62%)}
.ws-ico{width:38px;height:38px;border-radius:12px;background:var(--brand-500);color:var(--on-brand);
  display:grid;place-items:center;font-size:17px;flex:none}
.ws-title{font-family:var(--font-head);font-weight:700;font-size:21px;line-height:1.15;color:var(--ink)}
.ws-stat{font-size:12.5px;color:var(--ink-muted)}
.ws-locked{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:10px}
.ws-locked-tile{border:1px dashed var(--rule);border-radius:var(--r-sm);padding:12px 14px;background:var(--card)}

/* ---- 17. typeahead ------------------------------------------------------ */
.lookup{position:relative}
.lookup-menu{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 6px);background:var(--card);
  border:1px solid var(--rule);border-radius:var(--r-sm);box-shadow:var(--sh-2);max-height:270px;
  overflow:auto;display:none;padding:5px}
.lookup-item{padding:9px 12px;cursor:pointer;font-size:13px;display:flex;gap:9px;align-items:baseline;
  border-radius:var(--r-xs)}
.lookup-item:hover,.lookup-item.is-cursor{background:var(--brand-50)}
.lookup-item .code{font-family:var(--font-mono);font-size:11px;color:var(--brand-600);flex:none}

/* ---- 18. chips, tabs, segmented ----------------------------------------- */
.chiprow{display:flex;gap:7px;flex-wrap:wrap}
.chip{border:1px solid var(--rule);background:var(--card);padding:7px 15px;font-size:13px;font-weight:500;
  cursor:pointer;border-radius:var(--r-pill);white-space:nowrap;color:var(--ink);
  transition:background var(--t),border-color var(--t),color var(--t)}
.chip:hover{border-color:var(--brand-300);color:var(--brand-700);background:var(--brand-50)}
.chip.is-on{border-color:var(--brand-400);background:var(--brand-50);color:var(--brand-800)}
.chip.is-active{border-color:var(--brand-700);background:var(--brand-700);color:#fff}
.chip .x{margin-left:6px;opacity:.55;font-size:10px}
.chip .x:hover{opacity:1}

/* Folder tabs. The active tab is physically joined to the panel below it — its
   bottom border is removed and it covers the strip's rule with a 1px shadow
   (a negative margin here makes the strip scroll vertically). */
/* Tabs are the white header of the card below them: an underline marks the active one. */
.tabs{display:flex;align-items:stretch;gap:4px;background:var(--card);
  border:1px solid var(--rule);border-bottom-color:var(--rule-soft);
  border-radius:var(--r) var(--r) 0 0;padding:0 16px;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs.tabs-flush{border-radius:var(--r) var(--r) 0 0}
.tabs .tab{position:relative;border:0;background:none;font:inherit;font-family:var(--font-head);
  font-size:14.5px;font-weight:600;color:var(--ink-muted);padding:16px 14px 14px;cursor:pointer;
  white-space:nowrap;display:inline-flex;align-items:center;gap:8px;transition:color .14s}
.tabs .tab::after{content:'';position:absolute;left:10px;right:10px;bottom:0;height:3px;
  border-radius:3px 3px 0 0;background:transparent;transition:background .14s}
.tabs .tab:hover{color:var(--ink)}
.tabs .tab:hover::after{background:var(--rule)}
.tabs .tab:focus-visible{outline:2px solid var(--brand-400);outline-offset:-4px;border-radius:8px}
.tabs .tab.is-on{color:var(--brand-700);cursor:default}
.tabs .tab.is-on::after{background:var(--brand-600)}
.tabs .tab .n{font-size:11.5px;font-weight:700;padding:1px 7px;border-radius:var(--r-pill);
  background:var(--sunk);color:var(--ink-muted);border:0}
.tabs .tab.is-on .n{background:var(--brand-50);color:var(--brand-700)}
/* the card a tab strip heads loses its own top edge so the two read as one surface */
.tabs + .card,.tabs + section.card,.tabs + [data-tabpanel] > .card:first-child{border-top:0;border-top-left-radius:0;border-top-right-radius:0}
.tabpanel{background:var(--card);border:1px solid var(--rule);border-top:0;
  border-radius:0 0 var(--r) var(--r);padding:16px}

.segmented{display:inline-flex;background:var(--sunk);border-radius:var(--r-pill);padding:3px;gap:2px;
  flex:none;max-width:100%}
.segmented button{border:none;background:none;font:inherit;font-size:12.5px;font-weight:600;padding:7px 16px;
  border-radius:var(--r-pill);cursor:pointer;color:var(--ink-muted);white-space:nowrap}
.segmented button.is-on{background:var(--card);color:var(--brand-700);box-shadow:var(--sh-1)}

/* ---- 19. steps ---------------------------------------------------------- */
.steps{display:flex;gap:8px;flex-wrap:wrap}
.step{display:inline-flex;align-items:center;gap:7px;flex:none;border:1px solid var(--rule);
  background:var(--card);padding:6px 12px;font-size:12.5px;font-weight:600;color:var(--ink-soft);
  cursor:pointer;white-space:nowrap;border-radius:var(--r-pill)}
.step:hover{border-color:var(--brand-300);color:var(--brand-800)}
.step.is-on{border-color:var(--brand-700);background:var(--brand-700);color:#fff}
.step.is-done{border-color:var(--brand-200);background:var(--brand-50);color:var(--brand-800)}
.step-n{font-family:var(--font-mono);font-size:10px;border:1px solid currentColor;padding:0 4px;opacity:.75;
  border-radius:3px}

/* ---- 20. feedback ------------------------------------------------------- */
.toasts{position:fixed;right:20px;bottom:20px;z-index:70;display:flex;flex-direction:column;gap:9px}
.toast{background:var(--brand-800);color:#fff;padding:12px 18px;border-radius:var(--r-pill);font-size:13px;
  box-shadow:var(--sh-2);max-width:380px}
:root[data-theme="dark"] .toast{background:var(--brand-200);color:var(--ink-invert)}

.spark{display:flex;align-items:flex-end;gap:4px;height:38px}
.spark i{flex:1;background:var(--brand-200);display:block;border-radius:3px 3px 1px 1px;min-width:3px}
.spark i.hi{background:var(--brand-400)}
.spark i.max{background:var(--brand-600)}

.skeleton,.sk{background:linear-gradient(90deg,var(--sunk),var(--surface-2),var(--sunk));
  background-size:200% 100%;animation:sk 1.1s linear infinite;border-radius:var(--r-sm)}
@keyframes sk{to{background-position:-200% 0}}

.empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:44px 20px;text-align:center}
.empty .itile{width:52px;height:52px;border-radius:16px;font-size:22px}
.empty h4{font-size:16px}
.empty p{margin:0;color:var(--ink-muted);font-size:13px;max-width:44ch}

/* ---- 21. print ---------------------------------------------------------- */
@media print{
  .sidebar,.topbar,.mobilenav,.toasts,.railtoggle,.no-print{display:none !important}
  .card{box-shadow:none;border-color:#ccc}
  body{background:#fff}
  .page{padding:0}
}

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

/* ---- 23. modal ---------------------------------------------------------- */
.oh-modal-back{position:fixed;inset:0;background:rgb(var(--scrim-rgb) / .38);backdrop-filter:blur(2px);
  z-index:80;display:grid;place-items:center;padding:20px}
.oh-modal{width:min(560px,100%);max-height:86vh;background:var(--card);border:1px solid var(--rule);
  border-radius:var(--r);box-shadow:var(--sh-3);display:flex;flex-direction:column;overflow:hidden}
.oh-modal-body{padding:18px 20px;overflow:auto;flex:1}
@media (prefers-reduced-motion:no-preference){
  .oh-modal{animation:ohIn .16s cubic-bezier(.2,.7,.3,1)}
  @keyframes ohIn{from{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:none}}
}

/* ---- 24. custom select --------------------------------------------------
   A native <select> popup is drawn by the operating system: it ignores every
   CSS rule, so it arrives square-cornered with a blue system highlight beside
   our rounded controls. The native element stays in the DOM — forms, validation
   and OH.ui.read() keep working — and is visually replaced by a button and a
   menu we can actually style. OH.ui.enhance() does this automatically. */
.oh-sel{position:relative}
.oh-sel > select{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none;left:12px;bottom:0}
.oh-sel-btn{display:flex;align-items:center;gap:8px;width:100%;text-align:left;
  background:var(--card);border:1px solid var(--rule);border-radius:var(--r-sm);
  padding:5px 11px;min-height:34px;font-family:inherit;font-size:13.5px;color:var(--ink);cursor:pointer;
  transition:border-color var(--t),box-shadow var(--t)}
.oh-sel-btn:hover{border-color:var(--brand-300)}
.oh-sel-btn:focus-visible,.oh-sel.is-open .oh-sel-btn{outline:none;border-color:var(--brand-400);
  box-shadow:0 0 0 4px var(--brand-50)}
.oh-sel-btn .v{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.oh-sel-btn .v.is-placeholder{color:var(--ink-soft)}
.oh-sel-btn .c{flex:none;color:var(--ink-muted);transition:transform var(--t);line-height:1}
.oh-sel.is-open .oh-sel-btn .c{transform:rotate(180deg)}
.oh-sel-btn[disabled]{background:var(--surface-2);color:var(--ink-soft);cursor:not-allowed}
/* The menu is moved to <body> while it is open. A card, a table and a modal all
   set overflow:hidden somewhere up the tree, and no z-index can lift a child out
   of a clipping ancestor — the menu would simply be cut off. Positioning is
   written inline from the button's rectangle when it opens. */
.oh-sel-menu{position:absolute;z-index:90;left:0;right:0;top:calc(100% + 6px);background:var(--card);
  border:1px solid var(--rule);border-radius:var(--r-sm);box-shadow:var(--sh-2);
  max-height:264px;overflow:auto;padding:5px;display:none}
.oh-sel-menu.drop-up{top:auto;bottom:calc(100% + 6px)}
.oh-sel.is-open > .oh-sel-menu{display:block}
.oh-sel-menu.is-portal{position:fixed;z-index:120;left:auto;right:auto;top:auto;bottom:auto;display:block}
.oh-sel-opt{display:flex;align-items:center;gap:8px;padding:8px 11px;border-radius:var(--r-xs);
  font-size:13px;cursor:pointer;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.oh-sel-opt:hover,.oh-sel-opt.is-cursor{background:var(--brand-50);color:var(--brand-800)}
.oh-sel-opt.is-on{font-weight:600;color:var(--brand-700)}
.oh-sel-opt.is-on::after{content:'✓';margin-left:auto;font-size:11px;flex:none}
.oh-sel-opt[data-disabled]{opacity:.45;cursor:not-allowed}
/* compact density and small variants keep the same geometry as .input */
html[data-density="compact"] .oh-sel-btn{min-height:32px;padding:6px 10px;font-size:12.5px}
@media (pointer:coarse){.oh-sel-btn{min-height:44px}}
.dt-size .oh-sel{width:auto;min-width:74px}
.dt-jump .oh-sel{width:auto;min-width:66px}
.dt-size .oh-sel-btn,.dt-jump .oh-sel-btn{min-height:32px;padding:5px 10px;font-size:12.5px}

/* ---- 25. popover menu ---------------------------------------------------
   The account menu in the topbar, and anything else that hangs off a control. */
.oh-menu-wrap{position:relative}
.oh-menu{position:absolute;z-index:90;right:0;top:calc(100% + 8px);min-width:210px;background:var(--card);
  border:1px solid var(--rule);border-radius:var(--r-sm);box-shadow:var(--sh-2);padding:5px;display:none}
.oh-menu.is-open{display:block}
.oh-menu-head{padding:9px 11px 7px;border-bottom:1px solid var(--rule-soft);margin-bottom:4px}
.oh-menu-head b{display:block;font-size:13px;font-weight:600}
.oh-menu-head span{display:block;font-size:11px;color:var(--ink-muted)}
.oh-menu a,.oh-menu button{display:flex;align-items:center;gap:9px;width:100%;text-align:left;
  padding:8px 11px;border:0;border-radius:var(--r-xs);background:none;font:inherit;font-size:13px;
  color:var(--ink);cursor:pointer;text-decoration:none}
.oh-menu a:hover,.oh-menu button:hover{background:var(--brand-50);color:var(--brand-800);text-decoration:none}
.oh-menu .sep{height:1px;background:var(--rule-soft);margin:4px 0}
.oh-menu .danger{color:var(--danger)}
.oh-menu .danger:hover{background:var(--danger-bg);color:var(--danger)}
.oh-menu .k{margin-left:auto;font-family:var(--font-mono);font-size:10px;color:var(--ink-soft)}
/* Theme colour row: three swatches. The swatch colours are the palettes themselves, so they are
   literals on purpose — they must NOT follow the active brand. */
.oh-menu .oh-brandrow{display:flex;align-items:center;gap:9px;padding:6px 11px;font-size:13px;color:var(--ink)}
.oh-menu .oh-brandrow .oh-i{width:16px;height:16px;margin-right:8px;color:var(--ink-muted)}
.oh-menu .oh-brandrow>span:not(.oh-swatches){white-space:nowrap}
.oh-menu .oh-swatches{margin-left:auto;padding-left:14px;display:flex;gap:7px}
.oh-menu button.oh-swatch,.oh-menu button.oh-swatch:hover{width:20px;height:20px;padding:0;flex:none;border-radius:50%;
  border:2px solid var(--card);box-shadow:0 0 0 1px var(--rule);cursor:pointer}
.oh-menu button.oh-swatch.is-on{box-shadow:0 0 0 2px var(--ink)}
.oh-menu button.oh-swatch:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.oh-menu button.oh-swatch-teal,.oh-menu button.oh-swatch-teal:hover{background:#0f9887}
.oh-menu button.oh-swatch-indigo,.oh-menu button.oh-swatch-indigo:hover{background:#4f4ad8}
.oh-menu button.oh-swatch-blue,.oh-menu button.oh-swatch-blue:hover{background:#1765cc}
.topbar .who{display:flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border-radius:var(--r-pill);
  border:1px solid transparent;background:none;cursor:pointer;font:inherit;color:var(--ink)}
.topbar .who:hover{background:var(--hover);border-color:var(--rule)}
.topbar .who .nm{font-size:12.5px;font-weight:600;line-height:1.15}
.topbar .who .rl{font-size:10.5px;color:var(--ink-muted);line-height:1.15}
.topbar .who .c{font-size:9px;color:var(--ink-soft)}

/* ---- 26. nested navigation ----------------------------------------------
   A parent row toggles its children in place when the menu is open, and shows
   them in a flyout when the menu is collapsed to a rail. */
/* the chevron points right while the children are folded and down once they are open */
.navlink .caret{margin-left:auto;font-size:9px;opacity:.6;transition:transform var(--t);transform:rotate(-90deg);flex:none}
.navlink.is-open .caret{transform:none}
.navlink.has-children.is-active-parent{color:var(--nav-ink);background:var(--nav-2)}
.navkids{display:none;margin:0 10px 4px;padding-left:10px;border-left:1px solid var(--nav-line)}
.navkids.is-open{display:block}
.navkids .navlink{margin:1px 0;padding:7px 11px;font-size:12.5px}
.navkids .navlink .dot{font-size:11px;width:14px}
/* a heading inside a child list ("Masters" under Medical Coding), and the caret of a parent that is a
   screen of its own: a wider target, since the rest of the row opens the screen */
.navsection{margin:10px 0 3px;padding:0 11px;font-size:9.5px;font-weight:600;letter-spacing:.12em;
  text-transform:uppercase;color:var(--nav-ink-3)}
.navlink.has-children[data-href] .caret{padding:6px;margin:-6px -6px -6px auto;border-radius:var(--r-xs)}
.navlink.has-children[data-href] .caret:hover{background:var(--nav-line);opacity:1}
.navlink.has-children.is-active{background:var(--nav-2)}
.flyout .fs{display:block;padding:8px 11px 3px;font-size:9.5px;font-weight:600;letter-spacing:.12em;
  text-transform:uppercase;color:var(--nav-ink-3)}

/* ---- 27. the collapsed rail --------------------------------------------
   Collapsed, the sidebar stays 58px wide and a hovered item shows a flyout with
   its label and any children. The rail itself never expands on hover: an
   expanding rail hides the first column of the page under it, and with nested
   menus there is nowhere for the children to go. */
html[data-rail="on"] .sidebar{--sb-w:58px;overflow:visible}
/* Both axes must stay visible: per the CSS spec, if one axis is not
   `visible` the other computes to `auto`, so an overflow-y here silently
   clips the flyout horizontally and it renders at the right position but
   invisible. A 58px rail holds icons only, so there is nothing to scroll. */
html[data-rail="on"] .sidebar nav{overflow:visible}
html[data-rail="on"] .sidebar .rail-hide{display:none}
html[data-rail="on"] .navlink{margin:2px 7px;padding:9px 0;justify-content:center;gap:0}
html[data-rail="on"] .navlink.is-sub{margin:2px 7px;padding:7px 0}
html[data-rail="on"] .navlink.is-sub::before{display:none}
html[data-rail="on"] .navlink .label,
html[data-rail="on"] .navlink .count{display:none}
/* A group heading cannot be read at 8px in a 58px rail, and wrapping produced
   clipped nonsense, so collapsed it becomes what it actually is at that width —
   a divider. The flyouts carry the words instead. */
html[data-rail="on"] .navgroup{padding:0;margin:9px 12px 7px;height:1px;overflow:hidden;
  text-indent:-999px;background:var(--nav-line);white-space:nowrap}
html[data-rail="on"] .usercard{margin:8px 7px;padding:8px;justify-content:center}
html[data-rail="on"] .sidebar .brandmark{padding:20px 0 12px;justify-content:center}
html[data-rail="on"] .sidebar .jump,
html[data-rail="on"] .sidebar .foot{padding-left:0;padding-right:0;justify-content:center}
html[data-rail="on"] .navkids{display:none !important}
html[data-rail="on"] .navlink{position:relative}
html[data-rail="on"] .navlink .caret{display:none}
html[data-rail="on"] .navlink > .flyout{display:none}
html[data-rail="on"] .navlink:hover > .flyout{display:block}
.flyout{position:absolute;left:100%;top:-4px;margin-left:8px;z-index:60;min-width:186px;
  background:var(--nav-2);border:1px solid var(--nav-line);border-radius:var(--r-sm);
  box-shadow:var(--sh-3);padding:5px}
.flyout .ft{display:block;padding:7px 11px;font-size:12.5px;font-weight:600;color:var(--nav-ink);
  white-space:nowrap}
/* The same menu items as the sidebar's, so the same near-white. Collapsed to the rail, this is
   the only place the words appear at all — dimming them here would be worse, not better. */
.flyout a{display:block;padding:7px 11px;border-radius:var(--r-xs);font-size:12.5px;
  color:var(--nav-ink);white-space:nowrap;text-decoration:none}
.flyout a:hover{background:var(--nav-line);color:#fff;text-decoration:none}
.flyout a.is-active{background:var(--brand-500);color:var(--on-brand)}
/* a bridge so the pointer can cross the 8px gap without the flyout closing */
.flyout::before{content:'';position:absolute;left:-10px;top:0;bottom:0;width:10px}

/* ---- 28. spacing utility ------------------------------------------------
   Sibling panels inside a workbench column must not touch. */
.stack{display:flex;flex-direction:column;gap:14px}
.stack-tight{display:flex;flex-direction:column;gap:10px}


/* ---- 29. charts ---------------------------------------------------------
   A figure wraps every chart: a header carrying the title and the data toggle,
   the canvas, and a table of the same numbers. The table is not optional —
   three of the eight light-mode series steps sit below 3:1 against a white
   card, and the rule for that is that the values must be readable another way. */
.chart{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);
  box-shadow:var(--sh-1);display:flex;flex-direction:column;overflow:hidden}
.chart-head{display:flex;align-items:baseline;gap:10px;padding:14px 16px 0;flex-wrap:wrap}
.chart-head h6{margin:0}
.chart-head .sub{font-size:11.5px;color:var(--ink-soft)}
.chart-head .tools{margin-left:auto;display:flex;gap:6px;align-items:center}
.chart-canvas{position:relative;padding:10px 14px 14px;min-height:0}
.chart-canvas canvas{display:block;width:100% !important}
.chart-table{display:none;border-top:1px solid var(--rule);max-height:260px;overflow:auto}
.chart.show-data .chart-table{display:block}
.chart.show-data .chart-canvas{display:none}
.chart-table table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
.chart-table th{position:sticky;top:0;background:var(--surface-2);text-align:left;
  padding:8px 12px;font-family:var(--font-head);font-size:10.5px;letter-spacing:.03em;
  color:var(--ink-muted);border-bottom:1px solid var(--rule);white-space:nowrap}
.chart-table td{padding:7px 12px;border-bottom:1px solid var(--rule-soft);
  font-variant-numeric:tabular-nums;white-space:nowrap}
.chart-table td:first-child{font-weight:500}
.chart-table tr:last-child td{border-bottom:0}
.chart-key{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;color:var(--ink-muted)}
.chart-key i{width:9px;height:9px;border-radius:50%;flex:none}
.chart-empty{display:grid;place-items:center;min-height:180px;color:var(--ink-soft);font-size:13px}

/* ---- 30. SweetAlert2, wearing our tokens --------------------------------
   SweetAlert2 ships its own look, which would arrive as a second design system
   inside the first. Everything below re-skins it from the same variables as the
   rest of the app, so an alert in dark mode is dark without a second theme. */
.swal2-container{z-index:200 !important}
.swal2-popup{background:var(--card) !important;color:var(--ink) !important;
  border:1px solid var(--rule) !important;border-radius:var(--r-lg) !important;
  box-shadow:var(--sh-3) !important;padding:24px 24px 20px !important;
  font-family:var(--font-body) !important;width:auto !important;max-width:440px}
.swal2-title{font-family:var(--font-head) !important;font-size:17px !important;
  font-weight:600 !important;color:var(--ink) !important;padding:0 !important;
  line-height:1.35 !important}
.swal2-html-container{font-size:13.5px !important;color:var(--ink-muted) !important;
  margin:8px 0 0 !important;padding:0 !important;line-height:1.55 !important}
.swal2-actions{margin:20px 0 0 !important;gap:8px !important;justify-content:flex-end !important;
  width:100% !important}
.swal2-styled{margin:0 !important;padding:9px 18px !important;border-radius:var(--r-sm) !important;
  font-family:var(--font-body) !important;font-size:13px !important;font-weight:500 !important;
  box-shadow:none !important;transition:filter var(--t),background var(--t)}
.swal2-styled:focus{box-shadow:0 0 0 4px var(--brand-50) !important}
.swal2-styled.swal2-confirm{background:var(--brand-600) !important;color:var(--on-brand) !important;
  border:1px solid var(--brand-600) !important}
.swal2-styled.swal2-confirm:hover{filter:brightness(1.06)}
.swal2-styled.swal2-cancel{background:var(--card) !important;color:var(--ink) !important;
  border:1px solid var(--rule) !important}
.swal2-styled.swal2-cancel:hover{border-color:var(--brand-300) !important;background:var(--hover) !important}
.swal2-styled.swal2-deny{background:var(--danger) !important;color:#fff !important;
  border:1px solid var(--danger) !important}
/* A destructive confirmation must not wear the primary colour: the button that
   deletes something should never be the same button as the one that saves it. */
.swal2-popup.oh-danger .swal2-styled.swal2-confirm{background:var(--danger) !important;
  border-color:var(--danger) !important}
.swal2-icon{margin:0 auto 14px !important;font-size:10.4px !important;border-width:3px !important}  /* SweetAlert2 draws the icon in em: shrink it by font size, or the cross and tick break */
.swal2-icon .swal2-icon-content{font-size:26px !important}
.swal2-icon.swal2-success{border-color:var(--ok) !important;color:var(--ok) !important}
.swal2-icon.swal2-success [class^='swal2-success-line']{background-color:var(--ok) !important}
.swal2-icon.swal2-success .swal2-success-ring{border-color:var(--ok-line) !important}
.swal2-icon.swal2-error{border-color:var(--danger) !important;color:var(--danger) !important}
.swal2-icon.swal2-error [class^='swal2-x-mark-line']{background-color:var(--danger) !important}
.swal2-icon.swal2-warning{border-color:var(--warn) !important;color:var(--warn) !important}
.swal2-icon.swal2-info,.swal2-icon.swal2-question{border-color:var(--info) !important;color:var(--info) !important}
.swal2-close{color:var(--ink-soft) !important;font-size:26px !important}
.swal2-close:hover{color:var(--ink) !important}
.swal2-input,.swal2-textarea,.swal2-select{background:var(--card) !important;color:var(--ink) !important;
  border:1px solid var(--rule) !important;border-radius:var(--r-sm) !important;
  font-family:var(--font-body) !important;font-size:13.5px !important;box-shadow:none !important;
  margin:14px 0 0 !important;padding:9px 13px !important;width:100% !important}
.swal2-input:focus,.swal2-textarea:focus{border-color:var(--brand-400) !important;
  box-shadow:0 0 0 4px var(--brand-50) !important}
.swal2-validation-message{background:var(--danger-bg) !important;color:var(--danger) !important;
  font-size:12.5px !important;border-radius:var(--r-sm);margin-top:10px !important}
.swal2-timer-progress-bar{background:var(--brand-300) !important}
.swal2-backdrop-show{background:rgba(12,20,18,.42) !important}

/* ---- 31. lookup (search as you type) ------------------------------------
   The most-used control in a record system: find the patient, the vendor, the
   code. Like the select menu, the panel is moved to <body> while it is open so
   a card or a modal cannot clip it. */
.lookup{position:relative}
.lookup-menu{position:absolute;z-index:120;background:var(--card);border:1px solid var(--rule);
  border-radius:var(--r-sm);box-shadow:var(--sh-2);max-height:300px;overflow:auto;padding:5px;
  display:none;min-width:220px}
.lookup-menu.is-open{display:block}
.lookup-menu.is-portal{position:fixed}
.lookup-opt{display:flex;align-items:center;gap:10px;padding:8px 11px;border-radius:var(--r-xs);
  cursor:pointer;font-size:13px}
.lookup-opt:hover,.lookup-opt.is-cursor{background:var(--brand-50)}
/* title above subtitle: both are spans, so they need to be told to stack */
.lookup-opt .lk-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.lookup-opt .lk-title{font-weight:500;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lookup-opt .lk-sub{font-size:11.5px;color:var(--ink-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lookup-opt .lk-meta{font-family:var(--font-mono);font-size:11px;color:var(--ink-soft);flex:none}
.lookup-opt mark{background:var(--brand-100);color:var(--brand-800);padding:0 1px;border-radius:2px}
.lookup-note{padding:10px 12px;font-size:12.5px;color:var(--ink-soft)}
.lookup-head{color:var(--danger);border-bottom:1px solid var(--rule-soft)}
.lookup-chip{display:inline-flex;align-items:center;gap:7px;padding:5px 8px 5px 11px;
  border:1px solid var(--brand-200);background:var(--brand-50);border-radius:var(--r-pill);
  font-size:12.5px;color:var(--brand-800);max-width:100%}
.lookup-chip b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lookup-chip button{border:0;background:none;color:var(--brand-600);cursor:pointer;
  font-size:14px;line-height:1;padding:0 2px}
.lookup-chip button:hover{color:var(--danger)}

/* ---- 32. file upload ----------------------------------------------------- */
.drop{border:1.5px dashed var(--rule);border-radius:var(--r);background:var(--surface-2);
  padding:22px 18px;text-align:center;cursor:pointer;transition:border-color var(--t),background var(--t)}
.drop:hover{border-color:var(--brand-300);background:var(--brand-50)}
.drop.is-over{border-color:var(--brand-500);background:var(--brand-50);border-style:solid}
.drop .drop-ico{font-size:22px;color:var(--brand-500);line-height:1}
.drop .drop-main{font-size:13.5px;font-weight:500;margin-top:6px}
.drop .drop-sub{font-size:11.5px;color:var(--ink-muted);margin-top:3px}
.drop input[type=file]{display:none}
.filelist{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.fileitem{display:flex;align-items:center;gap:11px;padding:9px 12px;border:1px solid var(--rule);
  border-radius:var(--r-sm);background:var(--card)}
.fileitem .fi-ico{width:30px;height:30px;border-radius:var(--r-xs);display:grid;place-items:center;
  background:var(--sunk);color:var(--ink-muted);font-size:12px;flex:none;font-family:var(--font-mono)}
.fileitem .fi-main{flex:1;min-width:0}
.fileitem .fi-name{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fileitem .fi-sub{font-size:11px;color:var(--ink-muted)}
.fileitem.is-bad{border-color:var(--danger-line);background:var(--danger-bg)}
.fileitem.is-bad .fi-sub{color:var(--danger)}
.fileitem .fi-bar{height:3px;border-radius:2px;background:var(--sunk);overflow:hidden;margin-top:5px}
.fileitem .fi-bar i{display:block;height:100%;background:var(--brand-500);transition:width .2s}

/* ---- 33. date range ------------------------------------------------------ */
.daterange{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.daterange .dr-presets{display:inline-flex;border:1px solid var(--rule);border-radius:var(--r-sm);
  overflow:hidden;background:var(--card)}
.daterange .dr-presets button{border:0;border-right:1px solid var(--rule);background:none;
  padding:7px 12px;font:inherit;font-size:12.5px;color:var(--ink-muted);cursor:pointer;white-space:nowrap}
.daterange .dr-presets button:last-child{border-right:0}
.daterange .dr-presets button:hover{background:var(--hover);color:var(--ink)}
.daterange .dr-presets button.is-on{background:var(--brand-500);color:var(--on-brand)}
.daterange .dr-custom{display:none;align-items:center;gap:6px}
.daterange.is-custom .dr-custom{display:flex}
.daterange .dr-custom input{padding:6px 9px;font-size:12.5px}
.daterange .dr-sep{color:var(--ink-soft);font-size:12px}

/* ---- 34. table selection and bulk actions -------------------------------- */
.table td.sel-cell,.table th.sel-cell{width:38px;padding-left:12px;padding-right:0}
.table input[type=checkbox]{width:15px;height:15px;accent-color:var(--brand-600);cursor:pointer;
  vertical-align:middle}
.table tr.is-picked td{background:var(--brand-50)}
.bulkbar{display:flex;align-items:center;gap:10px;padding:9px 14px;background:var(--brand-800);
  color:#fff;font-size:13px}
.bulkbar .bb-n{font-weight:600}
.bulkbar .bb-acts{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.bulkbar button{border:1px solid rgba(255,255,255,.28);background:rgba(255,255,255,.1);color:#fff;
  border-radius:var(--r-sm);padding:5px 12px;font:inherit;font-size:12.5px;cursor:pointer}
.bulkbar button:hover{background:rgba(255,255,255,.2)}
.bulkbar .bb-clear{border:0;background:none;text-decoration:underline;padding:5px 4px}

/* ---- 35. accessibility --------------------------------------------------- */
.skiplink{position:absolute;left:-9999px;top:0;z-index:300;background:var(--brand-600);color:var(--on-brand);
  padding:10px 16px;border-radius:0 0 var(--r-sm) 0;font-size:13px;font-weight:500}
.skiplink:focus{left:0;text-decoration:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* ============================================================================
   36. FULL-WIDTH PAGE SYSTEM  (template v2)
   Adopted from the reference application screenshots in
   docs/WebAppScreenShotsforTemplate: generous spacing, one clear hierarchy per
   page, stat cards that read at a glance, pill navigation across the full width,
   and tables with room to breathe.

   The rule this encodes: a module is a set of FULL-WIDTH PAGES joined by tab
   navigation — never two panes squeezed side by side. A record opens as its own
   page with a breadcrumb back, the way an EMR opens a chart.
   ============================================================================ */

/* ---- page header: title, breadcrumb, actions ---- */
.oh-ph{display:flex;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:6px}
.oh-ph-main{min-width:0;flex:1}
.oh-ph h1{font-family:var(--font-head);font-size:var(--fs-3xl);line-height:1.15;font-weight:700;
  letter-spacing:-.02em;color:var(--ink);margin:0}
.oh-ph-sub{font-size:var(--fs-md);color:var(--ink-muted);margin-top:6px}
.oh-ph-crumb{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--ink-muted);margin-bottom:7px}
.oh-ph-crumb a{color:var(--ink-muted);text-decoration:none}
.oh-ph-crumb a:hover{color:var(--brand-600)}
.oh-ph-crumb svg{width:13px;height:13px;opacity:.6}
.oh-ph-acts{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-left:auto}

/* ---- tabs: an underline strip that heads the panel it switches ----
   Tabs are not a row of buttons. The strip is the top edge of the panel, the active tab carries
   a bar that opens onto it, and the others sit quietly until pointed at. */
.oh-tabwrap{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh-1);
  margin-top:16px}
.oh-tabnav{display:flex;align-items:stretch;gap:4px;overflow-x:auto;scrollbar-width:none;
  padding:0 14px;border-bottom:1px solid var(--rule)}
.oh-tabnav::-webkit-scrollbar{display:none}
.oh-tabnav button,.oh-tabnav a{position:relative;display:inline-flex;align-items:center;gap:8px;white-space:nowrap;
  border:0;background:none;color:var(--ink-muted);padding:15px 14px 13px;cursor:pointer;text-decoration:none;
  font-family:var(--font-head);font-size:13.5px;font-weight:600;transition:color .14s}
.oh-tabnav button::after,.oh-tabnav a::after{content:'';position:absolute;left:10px;right:10px;bottom:-1px;
  height:3px;border-radius:3px 3px 0 0;background:transparent;transition:background .14s}
.oh-tabnav button:hover,.oh-tabnav a:hover{color:var(--ink)}
.oh-tabnav button:hover::after{background:var(--rule)}
.oh-tabnav .is-on,.oh-tabnav .is-on:hover{color:var(--brand-700)}
.oh-tabnav .is-on::after,.oh-tabnav .is-on:hover::after{background:var(--brand-600)}
.oh-tabnav button:focus-visible{outline:2px solid var(--brand-400);outline-offset:-4px;border-radius:8px}
.oh-tabnav .n{font-size:11px;font-weight:700;background:var(--sunk);color:var(--ink-muted);
  border-radius:999px;min-width:20px;height:19px;display:inline-grid;place-items:center;padding:0 6px}
.oh-tabnav .is-on .n{background:var(--brand-50);color:var(--brand-700)}
.oh-tabbody{padding:20px 22px 22px}
/* inside the panel, sections are groups rather than cards floating on cards */
.oh-tabbody > .oh-sec,.oh-tabbody > .card,.oh-tabbody > section{box-shadow:none}
.oh-tabbody > * + *{margin-top:16px}
@media (max-width:820px){.oh-tabbody{padding:16px}}

/* ---- patient banner: whose record this is and where it stands ---- */
.oh-pb{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh-1);
  padding:16px 20px 0;position:relative;overflow:hidden}
.oh-pb::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--brand-500)}
.oh-pb-top{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.oh-pb-back{flex:none;width:34px;height:34px;border-radius:10px;border:1px solid var(--rule);background:var(--card);
  color:var(--ink-muted);display:grid;place-items:center;cursor:pointer;transition:all .14s}
.oh-pb-back:hover{border-color:var(--brand-300);color:var(--brand-700);background:var(--brand-50)}
.oh-pb-back svg{width:17px;height:17px}
.oh-pb-av{flex:none;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  background:var(--brand-50);color:var(--brand-700);font-family:var(--font-head);font-weight:700;font-size:15px;
  border:1px solid var(--brand-100)}
.oh-pb-id{min-width:0;flex:1 1 280px}
.oh-pb-name{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-family:var(--font-head);
  font-size:22px;font-weight:700;letter-spacing:-.01em;color:var(--ink);line-height:1.2}
.oh-pb-name .tag,.oh-pb-name .be-chip,.oh-pb-name [class*="chip"]{font-size:11.5px;letter-spacing:0}
.oh-pb-meta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;margin-top:5px;font-size:14px;color:var(--ink-muted)}
.oh-pb-meta i{width:3px;height:3px;border-radius:50%;background:var(--ink-soft)}
.oh-pb-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-left:auto}
.oh-pb-row{display:flex;flex-wrap:wrap;margin:14px -20px 0;padding:11px 20px;border-top:1px solid var(--rule-soft);
  background:var(--surface-2,#fafbfb);gap:8px 0}
.oh-pb-d{display:flex;flex-direction:column;gap:2px;padding:0 22px 0 0;margin-right:22px;
  border-right:1px solid var(--rule);min-width:0}
.oh-pb-d:last-child{border-right:0;margin-right:0}
.oh-pb-d .k{font-size:12.5px;font-weight:500;color:var(--ink-muted)}
.oh-pb-d .v{font-size:14.5px;color:var(--ink);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:320px}
.oh-pb-d .v.mono{font-variant-numeric:tabular-nums}
.oh-pb-d .v.is-none{color:var(--ink-soft)}
.oh-pb-steps{list-style:none;display:flex;margin:0 -20px;padding:0;border-top:1px solid var(--rule-soft)}
.oh-pb-steps li{flex:1;display:flex;align-items:center;gap:9px;padding:12px 20px;font-size:13.5px;font-weight:600;
  color:var(--ink-soft);position:relative;white-space:nowrap}
.oh-pb-steps li + li{border-left:1px solid var(--rule-soft)}
.oh-pb-steps li::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;background:transparent}
.oh-pb-steps .dot{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-size:11px;
  border:1.5px solid var(--rule);color:var(--ink-soft);background:var(--card)}
.oh-pb-steps li.is-done{color:var(--ink-muted)}
.oh-pb-steps li.is-done .dot{background:var(--ok);border-color:var(--ok);color:#fff}
.oh-pb-steps li.is-done::after{background:var(--ok)}
.oh-pb-steps li.is-now{color:var(--brand-700);background:var(--brand-50)}
.oh-pb-steps li.is-now .dot{border-color:var(--brand-600);color:var(--brand-700)}
.oh-pb-steps li.is-now::after{background:var(--brand-600)}
.oh-pb-steps li.is-hold{color:var(--danger);background:var(--danger-bg)}
.oh-pb-steps li.is-hold .dot{border-color:var(--danger);background:var(--danger);color:#fff}
.oh-pb-steps li.is-hold::after{background:var(--danger)}
@media (max-width:820px){
  .oh-pb-steps{flex-wrap:wrap}.oh-pb-steps li{flex:1 1 50%}
  .oh-pb-d{border-right:0;margin-right:0;padding-right:18px}
  .oh-pb-acts{margin-left:0;width:100%}
}

/* ---- stat cards: the row of numbers a page opens with ---- */
.oh-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:16px;margin-bottom:18px}
/* Four headline figures deserve the headline treatment. Seven pipeline counters do not: at full
   size they wrap to two rows and push the thing the page is actually about below the fold. */
.oh-stats.is-dense{grid-template-columns:repeat(auto-fit,minmax(136px,1fr));gap:10px;margin-bottom:18px}
.oh-stats.is-dense .oh-stat{padding:11px 13px;gap:9px}
.oh-stats.is-dense .oh-stat::before{width:3px}
.oh-stats.is-dense .oh-stat-l{font-size:11.5px}
.oh-stats.is-dense .oh-stat-v{font-size:21px;margin-top:1px}
.oh-stats.is-dense .oh-stat-ico{width:32px;height:32px}
.oh-stats.is-dense .oh-stat-ico svg{width:16px;height:16px}
.oh-stat{position:relative;display:flex;align-items:center;gap:14px;background:var(--card);
  border:1px solid var(--rule);border-radius:var(--r);padding:13px 16px;overflow:hidden;
  box-shadow:var(--sh-1)}
.oh-stat::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--brand-500)}
.oh-stat.t-ok::before{background:var(--ok)} .oh-stat.t-warn::before{background:var(--warn)}
.oh-stat.t-danger::before{background:var(--danger)} .oh-stat.t-info::before{background:var(--info)}
.oh-stat.t-ai::before{background:var(--ai)} .oh-stat.t-neutral::before{background:var(--ink-soft)}
.oh-stat-body{min-width:0;flex:1}
.oh-stat-l{font-size:var(--fs-sm);color:var(--ink-muted);font-weight:500}
.oh-stat-v{font-family:var(--font-head);font-size:var(--fs-2xl);font-weight:700;letter-spacing:-.02em;
  color:var(--ink);line-height:1.15;margin-top:1px}
.oh-stat-d{display:inline-flex;align-items:center;gap:4px;margin-top:7px;font-size:11.5px;font-weight:700;
  padding:3px 9px;border-radius:999px;background:var(--ok-bg);color:var(--ok)}
.oh-stat-d.is-down{background:var(--danger-bg);color:var(--danger)}
.oh-stat-d.is-flat{background:var(--sunk);color:var(--ink-muted)}
.oh-stat-ico{flex:none;width:44px;height:44px;border-radius:12px;display:grid;place-items:center;
  background:var(--brand-50);color:var(--brand-600)}
.oh-stat-ico svg{width:26px;height:26px}
.oh-stat.t-ok .oh-stat-ico{background:var(--ok-bg);color:var(--ok)}
.oh-stat.t-warn .oh-stat-ico{background:var(--warn-bg);color:var(--warn)}
.oh-stat.t-danger .oh-stat-ico{background:var(--danger-bg);color:var(--danger)}
.oh-stat.t-info .oh-stat-ico{background:var(--info-bg);color:var(--info)}
.oh-stat.t-ai .oh-stat-ico{background:var(--ai-bg);color:var(--ai)}
.oh-stat.is-clickable{cursor:pointer}
.oh-stat.is-clickable{cursor:pointer;text-align:left;font:inherit;color:inherit}
.oh-stat.is-clickable:hover{border-color:var(--brand-300);box-shadow:var(--sh-2)}
/* the slice the table below is currently filtered to */
.oh-stat.is-on{border-color:var(--brand-400);background:var(--brand-50)}
.oh-stat.is-on .oh-stat-v{color:var(--brand-700)}

/* ---- section card: a titled block of content on a page ---- */
.oh-sec{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);
  box-shadow:var(--sh-1);margin-bottom:20px;overflow:hidden}
.oh-sec-h{display:flex;align-items:center;gap:12px;padding:17px 20px;flex-wrap:wrap;
  border-bottom:1px solid var(--rule-soft)}
.oh-sec-h h2{font-family:var(--font-head);font-size:17px;font-weight:700;letter-spacing:-.01em;margin:0}
.oh-sec-h .oh-sec-sub{font-size:12.5px;color:var(--ink-muted);width:100%;margin-top:-4px}
.oh-sec-h .oh-sec-r{margin-left:auto;display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.oh-sec-b{padding:20px}
.oh-sec-b.is-flush{padding:0}
/* an accent bar beside a section title, as the reference uses */
.oh-sec-h.has-accent h2{padding-left:12px;position:relative}
.oh-sec-h.has-accent h2::before{content:'';position:absolute;left:0;top:2px;bottom:2px;width:3px;
  border-radius:2px;background:var(--brand-500)}

/* ---- definition grid: labelled facts, readable, never cramped ---- */
.oh-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px 26px}
.oh-fact{min-width:0}
.oh-fact-l{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--ink-soft);
  font-weight:600;margin-bottom:3px}
.oh-fact-v{font-size:14.5px;color:var(--ink);font-weight:500;word-break:break-word}
.oh-fact-v.is-mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}

/* ---- a row of filter chips above a table ---- */
.oh-filterbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.oh-filterbar .oh-fb-r{margin-left:auto;display:flex;gap:9px;align-items:center;flex-wrap:wrap}

@media (max-width:820px){
  .oh-ph h1{font-size:22px}
  .oh-ph-acts{margin-left:0;width:100%}
  .oh-sec-b{padding:16px}
}

/* ================================================================================================
   37 · WHY  —  the reason a field is asked for, on request
   A form of eight fields carries eight paragraphs of justification. Printed on the page that is
   half a screen of prose above the thing somebody came to fill in; carried on the label it is
   there for whoever wants it and invisible to everybody else.
   ============================================================================================== */
.oh-why{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;padding:0;margin-left:5px;vertical-align:1px;
  border:1px solid var(--rule);border-radius:50%;background:transparent;
  font-family:var(--font-head);font-size:9px;font-weight:700;line-height:1;
  color:var(--ink-soft);cursor:help;transition:color var(--t),border-color var(--t)}
.oh-why:hover,.oh-why:focus-visible{border-color:var(--brand-400);color:var(--brand-600);outline:none}
.oh-why-pop{
  position:fixed;z-index:200;width:min(280px,calc(100vw - 24px));
  padding:9px 11px;border-radius:10px;
  background:var(--ink);color:var(--ink-invert);font-size:12px;line-height:1.5;
  box-shadow:var(--sh-2);pointer-events:none}

/* ------------------------------------------------------------------------------------------------
   Form controls have a width, not the page's width
   A field in a two-column grid on a 1500px page is 700px wide, and a 700px "Choose one" box —
   with a dropdown to match — is the clumsiest thing on a screen. A control is as wide as the
   longest value anybody puts in it; past that, width is only distance between the label and the
   text. Prose and free text still get the room they need: .is-wide opts out, and a textarea,
   a file input and anything explicitly given a width are left alone.
   ---------------------------------------------------------------------------------------------- */
.field{max-width:560px}
.field.is-wide{max-width:none}
.field:has(textarea),.field:has(input[type="file"]){max-width:none}
.field:has(textarea) .input,.field:has(input[type="file"]) .input{max-width:none}

/* A grid of form fields. auto-fill rather than a fixed column count, so fields sit beside each
   other at a field's own width instead of being spread to the far corners of a wide page — the
   thing that makes a two-column form on a large screen read as two unrelated forms. */
.oh-formgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:11px 16px;align-items:start}
.oh-formgrid > .is-wide,.oh-formgrid > .field.is-wide{grid-column:1/-1}
/* a state chip in the banner is read at a glance, so it is sized to be */
.oh-pb-name .be-st,.oh-pb-name .ce-st{font-family:var(--font-body,inherit);font-size:12px;padding:4px 10px;font-weight:600}

/* ---- data table toolbar and footer (reference layout) ---- */
.dt-title{display:flex;align-items:center;gap:10px;margin:0;font-size:var(--fs-lg)}
.dt-title-n{font-size:12px;font-weight:700;padding:2px 9px;border-radius:var(--r-pill);background:var(--sunk);color:var(--ink-muted)}
.dt-tools{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;margin-left:auto}
@media (max-width:1100px){.dt-tools{flex-wrap:wrap}}
.dt-toolbar .dt-search{position:relative;display:block;flex:0 1 300px;min-width:200px;max-width:320px}
.dt-toolbar .dt-search .oh-i{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--ink-soft);pointer-events:none}
.dt-toolbar .dt-search .input{padding-left:40px}
.dt-toolbar .oh-sel{width:auto;min-width:160px}
.dt-busy .oh-i{animation:ohSpin 1s linear infinite;color:var(--ink-soft)}
@keyframes ohSpin{to{transform:rotate(360deg)}}
.dt-left{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.dt-foot .dt-size .oh-sel{width:auto;min-width:76px}
.dt-pager .btn .oh-i{width:15px;height:15px}
.dt-caret .oh-i{width:13px;height:13px;vertical-align:-2px}
@media (max-width:640px){.dt-tools{margin-left:0;width:100%}.dt-toolbar .dt-search{flex:1 1 100%;max-width:none}}

/* ---- shell icons ---- */
.navlink .dot .oh-i{width:19px;height:19px}
.navlink .caret .oh-i{width:15px;height:15px}
.navlink .caret{margin-left:auto;display:inline-flex;transition:transform .15s}
.topbar .btn .oh-i{width:18px;height:18px}
.shell-search{position:relative}
.shell-search .oh-i{position:absolute;left:14px;top:50%;transform:translateY(-50%);width:17px;height:17px;color:var(--ink-soft);pointer-events:none}
.shell-search .input-search{padding-left:40px}
.oh-menu a .oh-i,.oh-menu button .oh-i{width:16px;height:16px;margin-right:8px;color:var(--ink-muted)}
.jump .kbd{margin-left:8px;opacity:.7;font-size:11px}
/* keyboard shortcuts are not offered on a touch screen or a phone */
@media (hover:none), (max-width:767px){ .kbd, .kbd-hint{ display:none } }
.jump .btn .oh-i{width:16px;height:16px}

.oh-stat-s{font-size:var(--fs-sm);color:var(--ink-muted);margin-top:4px}
/* a list of short notes, each with an icon that says what kind of note it is */
.oh-notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.oh-notes li{display:flex;gap:12px;align-items:flex-start;font-size:var(--fs-base);line-height:1.5;color:var(--ink)}
.oh-notes li .oh-i{width:18px;height:18px;margin-top:2px;flex:none}
.oh-notes li.n-warn .oh-i{color:var(--warn)} .oh-notes li.n-danger .oh-i{color:var(--danger)}
.oh-notes li.n-info .oh-i{color:var(--info)} .oh-notes li.n-muted{color:var(--ink-muted)} .oh-notes li.n-muted .oh-i{color:var(--ink-soft)}
.oh-notes-h{font-size:var(--fs-xs);font-weight:600;color:var(--ink-muted);margin:18px 0 10px}
.oh-notes-h:first-child{margin-top:0}
.table th.text-right,.table td.text-right{text-align:right}

/* the older static page header reads exactly like OH.ui.pageHead */
.page-head{align-items:flex-start;gap:16px;margin-bottom:0}
.page-head h2{font-family:var(--font-head);font-size:var(--fs-2xl);line-height:1.15;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
.page-head h2 + p,.page-head p.muted{font-size:var(--fs-base)!important;color:var(--ink-muted);margin-top:3px!important}
.page-head .actions .btn{min-height:36px}


/* Search-as-you-type boxes are inputs like any other: a row of controls only reads as a row when
   the picker, the select and the plain box are the same height. */
.lookup .lk-input{border-radius:var(--r-sm);background:var(--card);border-color:var(--rule);
  min-height:34px;padding:5px 11px;font-size:13.5px}
.lookup .lk-input:focus{background:var(--card)}
.lookup-chip{min-height:34px;padding:4px 8px 4px 11px;font-size:13.5px;border-radius:var(--r-sm)}
@media (pointer:coarse){.lookup .lk-input,.lookup-chip{min-height:44px}}

/* A table still fetching says so rather than saying it is empty. The spinner turns because a
   still one reads as a picture of a spinner, and the sentence is the part that matters. */
.dt-loading{display:inline-flex;align-items:center;gap:9px;color:var(--ink-muted);font-size:13px}
.dt-loading .oh-i{animation:oh-spin 900ms linear infinite;color:var(--brand-500)}
@keyframes oh-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.dt-loading .oh-i{animation:none}}

/* ---- Leads and follow-ups (assets/js/leads.js) ---- */
/* one lead: rows of panels, each row one height; what does not fit scrolls inside its panel */
.ld-row { display: grid; gap: 16px; margin-top: 16px; align-items: stretch; }
.ld-row-a { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); height: 470px; }
.ld-row-b { grid-template-columns: repeat(3, minmax(0, 1fr)); height: 340px; }
.ld-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; margin: 0; }
.ld-panel > .card-head { flex: none; display: flex; align-items: center; gap: 8px; }
.ld-panel > .p-4 { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1100px) {
  .ld-row-a, .ld-row-b { grid-template-columns: 1fr; height: auto; }
  .ld-panel { height: auto; max-height: 460px; }
}
.ld-why { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 12px;
  background: var(--card); padding: 10px 14px; font-size: 13.5px; color: var(--ink); }
.ld-tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ld-tl li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); font-size: 13px; }
.ld-tl li:last-child { border-bottom: 0; }
.ld-tl .t { color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-tl .x { color: var(--ink); overflow-wrap: anywhere; }
.ld-tl li.k-contact_request .x, .ld-tl li.k-signin_refused .x { color: var(--danger); font-weight: 500; }
.ld-tl li.k-reminder_sent .x, .ld-tl li.k-stage .x { color: var(--ai); }
@media (max-width: 640px) { .ld-tl li { grid-template-columns: 1fr; gap: 2px; } }
.ld-notes { display: flex; flex-direction: column; gap: 8px; }
.ld-note { border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; }
.ld-note .h { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.ld-note .h .muted { margin-right: auto; }
.ld-note .b { font-size: 13px; margin-top: 4px; color: var(--ink); overflow-wrap: anywhere; }
.ld-small { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.ld-small td { padding: 5px 4px; border-bottom: 1px solid var(--rule-soft); }
