/* @ekm-tags: style, messaging */
/*
 * The Inbox (owner spec 2026-11-11, js/ekm-unified-inbox.js adds .uib-v3 to #uib-root). One calm, dense working surface:
 *   - no page title (the nav already says Inbox) and no second section column when the portal's left nav lists the sections;
 *   - colour-coded category tabs (the whole label inside its coloured rectangle, 32px, inside a 44px target);
 *   - a quiet toolbar (search, sort, Filter, one action, refresh);
 *   - list (~40%) | reading pane (~60%), each scrolling on its own; full width beside the nav.
 * Colour lives in the tabs, the row labels, the 3px left border of each row and the selected row's tint; the rest is neutral.
 *
 * Every new control has its own uib3-* class, so the earlier layers (css/ekm-unified-inbox.css, css/ekm-inbox-2030.css) never restyle it;
 * where those layers style shared parts of the reading pane (Pearl, 0,3,1), the rules here carry one element more (html body …).
 * Contrast: the hues are the owner's; text and active fills are the same hue darkened just enough for WCAG AA (table in
 * docs/contracts/unified-inbox.md). Every control is a 44px target.
 */

/* ── tokens ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.uib-root.uib-v3 {
  --v3-surface: #FFFFFF; --v3-canvas: #F7F6F3; --v3-field: #F2F0EC; --v3-hover: #F7F5F1;
  --v3-ink: #1C2530; --v3-ink2: #3B4653; --v3-muted: #5A6470; --v3-hair: #E4E0D8; --v3-hair2: #EEEBE5;
  --v3-nav: #1F262F; --v3-nav-ink: #D5DBE2; --v3-nav-sel: #343E4A; --v3-focus: #3F6DBF; --v3-unread: #1F6FD1; --v3-alert: #9A2A20;
  --v3-font: var(--font-ui, 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);
  /* per category: c = hue / border, t = text on the tint, b = tint, a = active fill, o = text on the active fill */
  --c-all: #34495E; --t-all: #34495E; --b-all: #EDF1F5; --a-all: #34495E; --o-all: #FFFFFF;
  --c-email: #4776C6; --t-email: #406AB2; --b-email: #EAF1FC; --a-email: #4572C0; --o-email: #FFFFFF;
  --c-phone: #218C79; --t-phone: #1C7868; --b-phone: #E6F5F0; --a-phone: #1E816F; --o-phone: #FFFFFF;
  --c-fax: #8B65B7; --t-fax: #7A59A1; --b-fax: #F1EAF8; --a-fax: #8762B2; --o-fax: #FFFFFF;
  --c-portal: #B88135; --t-portal: #8E6329; --b-portal: #FCF3DF; --a-portal: #B88135; --o-portal: #1F1A17;
  --c-documents: #677D96; --t-documents: #596C81; --b-documents: #EDF1F5; --a-documents: #60748C; --o-documents: #FFFFFF;
  --c-website: #C36C65; --t-website: #9C5651; --b-website: #FAECEA; --a-website: #AA5E58; --o-website: #FFFFFF;
  --c-tasks: #A26296; --t-tasks: #8F5684; --b-tasks: #F7ECF4; --a-tasks: #9C5E90; --o-tasks: #FFFFFF;
  --c-team: #536FA6; --t-team: #4F699E; --b-team: #EAF0F9; --a-team: #536FA6; --o-team: #FFFFFF;
  --c-direct: #4776C6; --t-direct: #406AB2; --b-direct: #EAF1FC; --a-direct: #4572C0; --o-direct: #FFFFFF;
  --c-group: #8B65B7; --t-group: #7A59A1; --b-group: #F1EAF8; --a-group: #8762B2; --o-group: #FFFFFF;
}
:is(html[data-dark], html[data-theme="pearl_night"]) .uib-root.uib-v3 {
  --v3-surface: #1A1E24; --v3-canvas: #14171C; --v3-field: #232830; --v3-hover: #20252C;
  --v3-ink: #EEF1F4; --v3-ink2: #C9D0D8; --v3-muted: #A3ADB8; --v3-hair: #2D333C; --v3-hair2: #252A32;
  --v3-nav: #0F1216; --v3-nav-ink: #C9D0D8; --v3-nav-sel: #2A313B; --v3-focus: #8FB0E6; --v3-unread: #7FB0F0; --v3-alert: #F2A193;
  --t-all: #A9B6C3; --b-all: rgba(237, 241, 245, .08); --a-all: #4A6178;
  --t-email: #8FB0E6; --b-email: rgba(71, 118, 198, .18);
  --t-phone: #5CC2AE; --b-phone: rgba(33, 140, 121, .2);
  --t-fax: #B9A0D8; --b-fax: rgba(139, 101, 183, .2);
  /* Portal stays gold in the dark, never brown (the redesign rule): a bright gold active fill with dark ink, a light gold tint */
  --t-portal: #DDB06F; --b-portal: rgba(226, 186, 110, .16); --a-portal: #D9A24E; --o-portal: #1F1A17;
  --t-documents: #A5B5C7; --b-documents: rgba(103, 125, 150, .22);
  --t-website: #E39C95; --b-website: rgba(195, 108, 101, .2);
  --t-tasks: #D29CC6; --b-tasks: rgba(162, 98, 150, .2);
  --t-team: #9EB2DA; --b-team: rgba(83, 111, 166, .22);
  --t-direct: #8FB0E6; --b-direct: rgba(71, 118, 198, .18);
  --t-group: #B9A0D8; --b-group: rgba(139, 101, 183, .2);
}
.uib-root.uib-v3 [data-uib-color="all"] { --k-c: var(--c-all); --k-t: var(--t-all); --k-b: var(--b-all); --k-a: var(--a-all); --k-o: var(--o-all); }
.uib-root.uib-v3 [data-uib-color="email"] { --k-c: var(--c-email); --k-t: var(--t-email); --k-b: var(--b-email); --k-a: var(--a-email); --k-o: var(--o-email); }
.uib-root.uib-v3 [data-uib-color="phone"] { --k-c: var(--c-phone); --k-t: var(--t-phone); --k-b: var(--b-phone); --k-a: var(--a-phone); --k-o: var(--o-phone); }
.uib-root.uib-v3 [data-uib-color="fax"] { --k-c: var(--c-fax); --k-t: var(--t-fax); --k-b: var(--b-fax); --k-a: var(--a-fax); --k-o: var(--o-fax); }
.uib-root.uib-v3 [data-uib-color="portal"] { --k-c: var(--c-portal); --k-t: var(--t-portal); --k-b: var(--b-portal); --k-a: var(--a-portal); --k-o: var(--o-portal); }
.uib-root.uib-v3 [data-uib-color="documents"] { --k-c: var(--c-documents); --k-t: var(--t-documents); --k-b: var(--b-documents); --k-a: var(--a-documents); --k-o: var(--o-documents); }
.uib-root.uib-v3 [data-uib-color="website"] { --k-c: var(--c-website); --k-t: var(--t-website); --k-b: var(--b-website); --k-a: var(--a-website); --k-o: var(--o-website); }
.uib-root.uib-v3 [data-uib-color="tasks"] { --k-c: var(--c-tasks); --k-t: var(--t-tasks); --k-b: var(--b-tasks); --k-a: var(--a-tasks); --k-o: var(--o-tasks); }
.uib-root.uib-v3 [data-uib-color="team"] { --k-c: var(--c-team); --k-t: var(--t-team); --k-b: var(--b-team); --k-a: var(--a-team); --k-o: var(--o-team); }
.uib-root.uib-v3 [data-uib-color="direct"] { --k-c: var(--c-direct); --k-t: var(--t-direct); --k-b: var(--b-direct); --k-a: var(--a-direct); --k-o: var(--o-direct); }
.uib-root.uib-v3 [data-uib-color="group"] { --k-c: var(--c-group); --k-t: var(--t-group); --k-b: var(--b-group); --k-a: var(--a-group); --k-o: var(--o-group); }

/* ── page ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
html body .uib-root.uib-v3 {
  display: flex; flex-direction: column; overflow: hidden; height: max(520px, calc(100dvh - var(--uib-top, 120px) - 10px));
  padding: 0; background: transparent; color: var(--v3-ink); font-family: var(--v3-font); font-size: 14px; line-height: 1.4; letter-spacing: 0;
}
.uib-root.uib-v3 :focus-visible { outline: 2px solid var(--v3-focus); outline-offset: 2px; }
.uib-root.uib-v3 [hidden] { display: none !important; }
/* full width beside the nav: the page's own padding is trimmed only while the Inbox is on screen (other pages keep theirs) */
@media (min-width: 761px) {
  #main-content.nav-model-b-layout:has(.hp-nav-rail) > .nav-model-b-main:has(.uib-root.uib-v3) { padding-left: 0; padding-right: 16px; padding-top: 10px; }
  #main-content.nav-model-b-layout:has(.uib-root.uib-v3) { column-gap: 0; }
}

/* ── shell: main, full width ──────────────────────────────────────────────────────────────────────────────────────
 * The Inbox no longer draws its own section column (the left nav lists Patient / Team Communication / Archived), so the shell is
 * ONE column at every width. It used to be "176px | main" unless the left nav's Inbox links were on screen (.has-rail-sections):
 * with that group collapsed or not drawn, the whole Inbox was squeezed into the 176px column (owner 2026-11-16: "why does the inbox
 * open like this"). */
.uib-root.uib-v3 .uib3-shell {
  flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden;
  border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); box-shadow: 0 1px 2px rgba(20, 24, 30, .04), 0 8px 24px -18px rgba(20, 24, 30, .18);
}
.uib-root.uib-v3.has-rail-sections .uib3-shell { grid-template-columns: minmax(0, 1fr); }
.uib-root.uib-v3.has-rail-sections .uib3-nav { display: none; }
.uib-root.uib-v3 .uib3-nav { background: var(--v3-nav); padding: 12px 8px; overflow-y: auto; }
.uib-root.uib-v3 .uib3-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.uib-root.uib-v3 .uib3-nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--v3-nav-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.uib-root.uib-v3 .uib3-nav-btn:hover { background: rgba(255, 255, 255, .06); }
.uib-root.uib-v3 .uib3-nav-btn.is-on { background: var(--v3-nav-sel); color: #FFFFFF; font-weight: 600; }
.uib-root.uib-v3 .uib3-nav-btn:focus-visible { outline-color: #FFFFFF; }
.uib-root.uib-v3 .uib3-nav-tx { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uib-root.uib-v3 .uib3-nav-n { flex: 0 0 auto; min-width: 22px; padding: 1px 6px; border-radius: 4px; background: #E9E5DD; color: #1F1A17; font-size: 12px; font-weight: 700; text-align: center; }
.uib-root.uib-v3 .uib3-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* ── category tabs: the whole label inside its coloured rectangle (32px), in a 44px target ─────────────────────── */
.uib-root.uib-v3 .uib3-tabs { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0 6px; padding: 6px 14px 4px; border-bottom: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.uib-root.uib-v3 .uib3-tab-in {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--k-c);
  border-radius: 5px; background: var(--k-b); color: var(--k-t); font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color .12s ease, border-color .12s ease;
}
.uib-root.uib-v3 .uib3-tab:hover .uib3-tab-in { border-color: var(--k-c); }
.uib-root.uib-v3 .uib3-tab[aria-selected="true"] .uib3-tab-in { background: var(--k-a); border-color: var(--k-a); color: var(--k-o); }
.uib-root.uib-v3 .uib3-tab:focus-visible { outline: none; }
.uib-root.uib-v3 .uib3-tab:focus-visible .uib3-tab-in { outline: 2px solid var(--v3-focus); outline-offset: 2px; }
.uib-root.uib-v3 .uib3-tab-n { min-width: 18px; padding: 1px 5px; border-radius: 3px; background: var(--v3-surface); color: var(--v3-ink); font-size: 11px; font-weight: 700; text-align: center; }
.uib-root.uib-v3 .uib3-tab[aria-selected="true"] .uib3-tab-n { background: rgba(255, 255, 255, .92); color: #1F1A17; }

/* Phone sub-tabs: one quiet underline row */
.uib-root.uib-v3 .uib3-subtabs { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 0 20px; padding: 0 16px; border-bottom: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-subtab { min-height: 44px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--v3-muted); font: inherit; font-size: 13px; cursor: pointer; }
.uib-root.uib-v3 .uib3-subtab:hover { color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-subtab[aria-selected="true"] { color: var(--t-phone); border-bottom-color: var(--c-phone); font-weight: 600; }

/* ── toolbar: search · sort · Filter · action · refresh (quiet controls, 44px) ─────────────────────────────────── */
.uib-root.uib-v3 .uib3-toolbar { position: relative; flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-search { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 6px; background: var(--v3-field); color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-search:focus-within { border-color: var(--v3-focus); background: var(--v3-surface); }
html body .uib-root.uib-v3 .uib3-search .uib-ui-ico { display: inline-block; flex: 0 0 auto; }
.uib-root.uib-v3 .uib3-search-in { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0; border: 0; background: none; color: var(--v3-ink); font: inherit; font-size: 14px; outline: none; }
.uib-root.uib-v3 .uib3-search-in::placeholder { color: var(--v3-muted); opacity: 1; }
html body .uib-root.uib-v3 :is(.uib3-btn, .uib3-select) {
  display: inline-flex; flex-direction: row; align-items: center; gap: 6px; height: 44px; min-height: 44px; padding: 0 12px; margin: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--v3-ink2); font: inherit; font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
html body .uib-root.uib-v3 .uib3-select { padding-right: 6px; }
html body .uib-root.uib-v3 :is(.uib3-btn, .uib3-select):hover { background: var(--v3-hover); color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-btn.is-active { border-color: var(--v3-hair); color: var(--v3-ink); font-weight: 600; }
html body .uib-root.uib-v3 .uib3-btn[disabled] { opacity: .55; cursor: default; }
html body .uib-root.uib-v3 .uib3-btn .uib-ui-ico { display: inline-block; }
html body .uib-root.uib-v3 .uib3-btn > span { display: inline; position: static; width: auto; height: auto; clip: auto; clip-path: none; margin: 0; white-space: nowrap; }
html body .uib-root.uib-v3 .uib3-icon { width: 44px; padding: 0; justify-content: center; }
html body .uib-root.uib-v3 .uib3-tools-wrap { display: inline-flex; position: relative; }
html body .uib-root.uib-v3 .uib3-pop {
  display: flex; position: absolute; top: calc(100% + 6px); right: 0; left: auto; z-index: 40; width: min(300px, 86vw); max-width: none; flex-direction: column; gap: 2px; padding: 8px;
  border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, .35);
}
html body .uib-root.uib-v3 .uib3-pop[hidden] { display: none; }
.uib-root.uib-v3 .uib3-check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--v3-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.uib-root.uib-v3 .uib3-check:hover { background: var(--v3-hover); }
.uib-root.uib-v3 .uib3-box { width: 16px; height: 16px; border: 1.5px solid var(--v3-muted); border-radius: 3px; flex: 0 0 auto; }
.uib-root.uib-v3 .uib3-check.is-on .uib3-box { background: var(--v3-ink); border-color: var(--v3-ink); box-shadow: inset 0 0 0 3px var(--v3-surface); }
.uib-root.uib-v3 .uib3-pop-l { padding: 8px 8px 2px; font-size: 12px; color: var(--v3-muted); }
html body .uib-root.uib-v3 .uib3-pop .uib-select { height: 44px; min-height: 44px; margin: 0 4px; padding: 0 8px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; }
.uib-root.uib-v3 .uib3-pop .uib-mutes { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; margin-top: 6px; border-top: 1px solid var(--v3-hair2); }
html body .uib-root.uib-v3 .uib3-pop .uib-mute { min-height: 44px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--v3-ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-pop .uib-mute:hover { background: var(--v3-hover); }

/* load / error notes: one compact line */
html body .uib-root.uib-v3 .uib3-status { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 0 16px; border-bottom: 1px solid var(--v3-hair2); font-size: 12.5px; }
html body .uib-root.uib-v3 .uib3-status :is(.uib-err, .uib-load, .uib-muted) { padding: 0; border: 0; line-height: 1.3; }
html body .uib-root.uib-v3 .uib3-status .uib-err { color: var(--v3-alert); }
html body .uib-root.uib-v3 .uib3-status :is(.uib-load, .uib-muted) { color: var(--v3-muted); }
html body .uib-root.uib-v3 .uib3-status .uib-linkbtn { min-height: 44px; padding: 0 4px; color: inherit; font-weight: 600; }

/* ── list (~40%) | reading pane (~60%) ────────────────────────────────────────────────────────────────────────── */
.uib-root.uib-v3 .uib3-split { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); }
.uib-root.uib-v3 .uib3-list { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; border-right: 1px solid var(--v3-hair); background: var(--v3-surface); }
.uib-root.uib-v3 .uib3-rows { list-style: none; margin: 0; padding: 0; }
.uib-root.uib-v3 .uib3-li + .uib3-li { border-top: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-row {
  display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 44px; padding: 11px 16px 12px 15px; margin: 0;
  border: 0; border-left: 3px solid var(--k-c); border-radius: 0; background: var(--v3-surface); color: var(--v3-ink); text-align: left; cursor: pointer; font: inherit;
}
.uib-root.uib-v3 .uib3-row:hover { background: var(--v3-hover); }
.uib-root.uib-v3 .uib3-row.is-sel { background: var(--k-b); }
.uib-root.uib-v3 .uib3-row.is-muted { opacity: .8; }
.uib-root.uib-v3 .uib3-row-top, .uib-root.uib-v3 .uib3-row-mid, .uib-root.uib-v3 .uib3-row-bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.uib-root.uib-v3 .uib3-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--v3-unread); }
.uib-root.uib-v3 .uib3-who { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-row.is-unread .uib3-who { font-weight: 700; }
.uib-root.uib-v3 .uib3-time { flex: 0 0 auto; margin-left: auto; font-size: 12px; color: var(--v3-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.uib-root.uib-v3 .uib3-label { flex: 0 0 auto; display: inline-block; padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--k-c) 45%, transparent); border-radius: 4px; background: var(--k-b); color: var(--k-t); font-size: 11px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.uib-root.uib-v3 .uib3-ctx { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-preview { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-row.is-unread .uib3-preview { color: var(--v3-ink2); }
.uib-root.uib-v3 .uib3-action { flex: 0 0 auto; margin-left: auto; color: var(--v3-alert); font-size: 12px; font-weight: 600; white-space: nowrap; }
/* Message safety flag (20270914172658): the same plain-text status marker with a dot - no pill. Urgent in the alert colour, review in amber. */
.uib-root.uib-v3 .uib3-action[data-uib-status="safety"]::before,
.uib-root.uib-v3 .uib3-action[data-uib-status="safety_review"]::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.uib-root.uib-v3 .uib3-action[data-uib-status="safety_review"] { color: #8A5A00; }
.uib-root .uib-safety { margin: 6px 0 10px; padding: 8px 10px; border-left: 3px solid var(--v3-alert, #9A2A20); background: transparent; font-size: 13px; line-height: 1.4; }
.uib-root .uib-safety[data-uib-safety="review"] { border-left-color: #8A5A00; }
.uib-root .uib-safety[data-uib-safety="acknowledged"] { border-left-color: var(--v3-hair); color: var(--v3-muted); }
.uib-root .uib-safety-acts { margin: 0 0 10px; }
.uib-root .uib-safety-ack { margin: 0 0 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uib-root.uib-v3 .uib3-action[data-uib-status="safety_review"] { color: #E8B65A; } :root:not([data-theme="light"]) .uib-root .uib-safety[data-uib-safety="review"] { border-left-color: #E8B65A; } }
:root[data-theme="dark"] .uib-root.uib-v3 .uib3-action[data-uib-status="safety_review"] { color: #E8B65A; }
:root[data-theme="dark"] .uib-root .uib-safety[data-uib-safety="review"] { border-left-color: #E8B65A; }
.uib-root.uib-v3 .uib3-empty { padding: 40px 24px; color: var(--v3-muted); text-align: center; }
.uib-root.uib-v3 .uib3-empty strong { display: block; margin-bottom: 6px; color: var(--v3-ink); font-weight: 600; }
.uib-root.uib-v3 .uib3-empty p { max-width: 42ch; margin: 0 auto; font-size: 13px; }
.uib-root.uib-v3 .uib3-more { padding: 10px; text-align: center; border-top: 1px solid var(--v3-hair2); }

/* reading pane: the same type and controls as the rest of the Inbox */
.uib-root.uib-v3 .uib3-pane { container: uibthread / inline-size; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; background: var(--v3-canvas); }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-empty { margin: auto; padding: 40px 20px; color: var(--v3-muted); text-align: center; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head {
  position: relative; z-index: 1; flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px;
  padding: 16px 24px 14px; border-bottom: 1px solid var(--v3-hair); background: var(--v3-surface);
}
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-title { margin: 2px 0 0; font-family: var(--v3-font); font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.005em; color: var(--v3-ink); overflow-wrap: anywhere; }
html body .uib-root.uib-v3 .uib3-pane :is(.uib-pane-sub, .uib-pane-meta) { padding: 0; border: 0; font-size: 13px; color: var(--v3-muted); }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles .uib-pane-meta::before { content: none; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-acts { position: static; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; margin: 0; flex: 1 1 100%; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head:is([data-uib-lane="team_direct"], [data-uib-lane="team_group"]) .uib-pane-acts { flex: 0 0 auto; margin-left: auto; align-self: flex-start; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-body { flex: 1 1 auto; padding: 18px 24px; }
html body .uib-root.uib-v3 .uib3-pane .uib-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head .uib-back { display: none; }
html body .uib-root.uib-v3 .uib3-pane .uib3-prose { white-space: pre-wrap; overflow-wrap: anywhere; }
/* pane buttons: rectangles with a hairline (primary = ink), never the older rounded Pearl shapes */
html body .uib-root.uib-v3 .uib3-pane :is(.uib-btn, a.uib-btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; height: auto; padding: 0 14px; margin: 0;
  border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); box-shadow: none; color: var(--v3-ink); font-family: var(--v3-font); font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer;
}
html body .uib-root.uib-v3 .uib3-pane :is(.uib-btn, a.uib-btn):hover { background: var(--v3-hover); }
html body .uib-root.uib-v3 .uib3-pane :is(.uib-btn.uib-btn--primary) { border-color: var(--v3-ink); background: var(--v3-ink); color: var(--v3-surface); }
html body .uib-root.uib-v3 .uib3-pane :is(.uib-btn.uib-btn--primary):hover { background: var(--v3-ink2); }
html body .uib-root.uib-v3 .uib3-pane .uib-icon-btn { min-width: 44px; padding: 0 12px; }
html body .uib-root.uib-v3 .uib3-pane .uib-linkbtn { min-height: 44px; padding: 0 2px; color: var(--v3-ink2); font-family: var(--v3-font); font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
html body .uib-root.uib-v3 .uib3-pane .uib-card { border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); box-shadow: none; }
/* the Spruce composer (Reply / Note): a flat card on the pane edge */
html body .uib-root.uib-v3 .uib3-pane .uib-composer { margin: 0; padding: 12px 16px 14px; border: 0; border-top: 1px solid var(--v3-hair); border-radius: 0; background: var(--v3-surface); box-shadow: none; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer.is-note { box-shadow: inset 3px 0 0 #B8955F; }
html body .uib-root.uib-v3 .uib3-pane .uib-mode { border-radius: 6px; }
html body .uib-root.uib-v3 .uib3-pane .uib-mode-btn { border-radius: 5px; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer .uib-reply { border-radius: 6px; }
/* Team: the conversation and its reply box */
html body .uib-root.uib-v3 .uib3-pane .uib3-tm { max-width: 80%; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: flex-end; gap: 8px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer:has(> .uib-note:only-child) { flex-wrap: wrap; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-reply { flex: 1 1 auto; width: 100%; height: 64px; min-height: 64px; max-height: 64px; padding: 10px 12px; field-sizing: fixed; border: 1px solid var(--v3-hair); background: var(--v3-surface); color: var(--v3-ink); font: inherit; resize: none; grid-area: auto; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-actions { flex: 0 0 auto; width: auto; display: flex; margin: 0; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-note { flex: 1 1 100%; margin: 0; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-send { min-height: 44px; }

/* ── tablet / phone ───────────────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .uib-root.uib-v3 .uib3-split { grid-template-columns: minmax(260px, 42%) minmax(0, 1fr); }
  .uib-root.uib-v3 .uib3-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
}
@media (max-width: 760px) {
  /* phones: the Inbox is as tall as its content (the page scrolls; the bottom nav and its More sheet keep their touch handling) */
  html body .uib-root.uib-v3 { height: auto; overflow-x: hidden; overflow-y: auto; padding: 8px 10px 16px; }
  .uib-root.uib-v3 .uib3-shell { grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .uib-root.uib-v3 .uib3-nav { padding: 6px; }
  .uib-root.uib-v3 .uib3-nav ul { flex-direction: row; overflow-x: auto; }
  .uib-root.uib-v3 .uib3-nav li { flex: 1 0 auto; }
  .uib-root.uib-v3 .uib3-nav-btn { justify-content: center; gap: 6px; padding: 0 10px; }
  .uib-root.uib-v3 .uib3-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .uib-root.uib-v3 .uib3-split { display: block; }
  .uib-root.uib-v3 .uib3-list { border-right: 0; overflow: visible; }
  .uib-root.uib-v3 .uib3-pane { display: none; overflow: visible; }
  .uib-root.uib-v3.is-reading :is(.uib3-nav, .uib3-tabs, .uib3-subtabs, .uib3-toolbar, .uib3-status, .uib3-list) { display: none; }
  .uib-root.uib-v3.is-reading .uib3-pane { display: flex; }
  html body .uib-root.uib-v3.is-reading .uib3-pane .uib-pane-head .uib-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; }
  html body .uib-root.uib-v3.is-reading .uib3-pane .uib-back .uib-btn-tx { display: inline; position: static; width: auto; height: auto; clip: auto; clip-path: none; }
  html body .uib-root.uib-v3 .uib3-pane :is(.uib-pane-head, .uib-pane-body) { padding-left: 14px; padding-right: 14px; }
  /* the Filter menu spans the toolbar (anchored to its button it would open past the left edge), and fits the screen */
  html body .uib-root.uib-v3 .uib3-tools-wrap { position: static; }
  html body .uib-root.uib-v3 .uib3-pop { left: 14px; right: 14px; width: auto; max-height: min(60vh, 440px); overflow-y: auto; }
}

/* owner 2026-11-12: "things shouldnt be cut off", "make the name option smaller so the message can be bigger",
   "the link patient is not easy to find/do" */
/* the conversation list takes ~32%, the reading pane the rest */
.uib-root.uib-v3 .uib3-split { grid-template-columns: minmax(260px, 32%) minmax(0, 1fr); }
@media (max-width: 1100px) { .uib-root.uib-v3 .uib3-split { grid-template-columns: minmax(240px, 36%) minmax(0, 1fr); } }
/* the More (⋯) menu opens to the right of its button, inside the pane (it opened leftward, past the pane's edge) */
html body .uib-root.uib-v3 .uib3-pane .uib-menu-wrap { position: relative; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-pop="more"] { left: 0; right: auto; top: calc(100% + 6px); min-width: 240px; max-width: min(320px, calc(100vw - 32px)); z-index: 40; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-pop="more"] :is(.uib-btn, .uib-linkbtn) { width: 100%; justify-content: flex-start; white-space: normal; text-align: left; }
/* Link patient: an obvious button, and the search right under the header */
html body .uib-root.uib-v3 .uib3-pane .uib-btn.uib3-linkpt { border-color: var(--c-phone); color: var(--t-phone); font-weight: 600; }
html body .uib-root.uib-v3 .uib3-pane .uib-btn.uib3-linkpt[aria-expanded="true"] { background: var(--b-phone); }
.uib-root.uib-v3 .uib3-link { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 24px 14px; border-bottom: 1px solid var(--v3-hair); background: var(--b-phone); }
.uib-root.uib-v3 .uib3-link-l { font-size: 13px; font-weight: 600; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-link-row { display: flex; gap: 8px; align-items: center; }
.uib-root.uib-v3 .uib3-link-in { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; font-size: 14px; }
.uib-root.uib-v3 .uib3-link-in:focus { outline: 2px solid var(--v3-focus); outline-offset: 1px; }
.uib-root.uib-v3 .uib3-link-results { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.uib-root.uib-v3 .uib3-link-pick { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 12px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.uib-root.uib-v3 .uib3-link-pick:hover { border-color: var(--c-phone); }
.uib-root.uib-v3 .uib3-link-pick span { font-size: 12px; color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-link-note { margin: 0; font-size: 13px; color: var(--v3-muted); }
@media (max-width: 760px) { .uib-root.uib-v3 .uib3-link { padding: 12px 14px; } }
/* Team conversations: each person's own bubble colour, exactly as the Messages hub shades it (css/ekm-team-messages-2030.css): a pale shade
   with dark words in light themes, a deep shade with light words in dark ones; my own messages stay the solid ink bubble */
html body .uib-root.uib-v3 .uib3-pane .uib3-tm.uib3-pc {
  --tm-pc-ink: #1F1A17; --tm-pc-soft: #3A3430;
  background: color-mix(in srgb, var(--msg-pc) 24%, #FFFFFF);
  background: oklch(from var(--msg-pc) 0.89 calc(c * 0.45) h);
  border: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tm-pc-ink) 10%, transparent); color: var(--tm-pc-ink);
}
:is(html[data-dark], html[data-theme="pearl_night"]) body .uib-root.uib-v3 .uib3-pane .uib3-tm.uib3-pc {
  --tm-pc-ink: #FFFFFF; --tm-pc-soft: #F1F1F3;
  background: color-mix(in srgb, var(--msg-pc) 48%, #141519);
  background: oklch(from var(--msg-pc) 0.42 min(c, 0.12) h);
}
html body .uib-root.uib-v3 .uib3-pane .uib3-tm.uib3-pc :is(.uib-pm-body, .uib-pm-body *) { color: var(--tm-pc-ink); -webkit-text-fill-color: var(--tm-pc-ink); }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm.uib3-pc .uib-pm-meta { color: var(--tm-pc-soft); -webkit-text-fill-color: var(--tm-pc-soft); }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm.is-mine { border: 0; background: var(--v3-ink); color: var(--v3-surface); }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm.is-mine :is(.uib-pm-body, .uib-pm-meta) { color: var(--v3-surface); -webkit-text-fill-color: var(--v3-surface); }

/* ── main header (owner 2026-11-12): Patient Communication · Team Communication … Archived; each side's sub-tabs below ─────────────── */
.uib-root.uib-v3 .uib3-main-tabs { flex: 0 0 auto; display: flex; align-items: stretch; gap: 0 4px; padding: 0 14px; border-bottom: 1px solid var(--v3-hair); overflow-x: auto; scrollbar-width: none; }
.uib-root.uib-v3 .uib3-main-sp { flex: 1 1 auto; }
.uib-root.uib-v3 .uib3-main-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; margin: 0 0 -1px; border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  background: none; color: var(--v3-muted); font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.uib-root.uib-v3 .uib3-main-tab:hover { color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-main-tab[aria-selected="true"] { color: var(--v3-ink); border-bottom-color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-main-tab.is-archived { font-size: 13.5px; font-weight: 500; padding: 0 8px; }
.uib-root.uib-v3 .uib3-main-tab.is-archived[aria-selected="true"] { font-weight: 600; }
.uib-root.uib-v3 .uib3-main-tab .uib3-nav-ico { width: 16px; height: 16px; }
.uib-root.uib-v3 .uib3-main-n { min-width: 22px; padding: 1px 6px; border-radius: 4px; background: var(--v3-ink); color: var(--v3-surface); font-size: 12px; font-weight: 700; line-height: 1.4; text-align: center; }
.uib-root.uib-v3 .uib3-main-tab:not([aria-selected="true"]) .uib3-main-n { background: var(--v3-field); color: var(--v3-ink); }
/* the Email mailbox switch: the same quiet underline row as Phone, in the Email blue */
.uib-root.uib-v3 .uib3-subtab.is-mail[aria-selected="true"] { color: var(--t-email); border-bottom-color: var(--c-email); }
@media (max-width: 760px) {
  .uib-root.uib-v3 .uib3-main-tabs { padding: 0 6px; }
  .uib-root.uib-v3 .uib3-main-tab { padding: 0 10px; font-size: 14px; }
  .uib-root.uib-v3.is-reading .uib3-main-tabs { display: none; }
}
.uib-root.uib-v3 .uib3-main-short { display: none; }
@media (max-width: 760px) {
  .uib-root.uib-v3 .uib3-main-long { display: none; }
  .uib-root.uib-v3 .uib3-main-short { display: inline; }
}

/* ── the retired Service screen, inside the Inbox (owner 2026-11-12) ─────────────────────────────────────────── */
/* Phone › Suggested (confirm) / Not linked: the office's link queues, set apart from the conversation views by a hairline */
.uib-root.uib-v3 .uib3-subtab.is-queue { color: var(--v3-ink2); }
.uib-root.uib-v3 .uib3-subtab.is-queue:first-of-type, .uib-root.uib-v3 .uib3-subtab:not(.is-queue) + .uib3-subtab.is-queue { margin-left: 4px; padding-left: 18px; border-left: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-sub-n { display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--v3-field); color: var(--v3-ink); font-size: 11px; font-weight: 700; text-align: center; }
.uib-root.uib-v3 .uib3-svc { padding: 10px 14px 16px; font-size: 13.5px; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-svc .svc-note { color: var(--v3-ink2); }
html body .uib-root.uib-v3 .uib3-svc :is(.svc-btn, .svc-chip) { min-height: 44px; color: var(--v3-ink); }
/* New ▾ (text, direct, group, Ask team, my status): opens leftward from its button, like Filter (it sits near the right edge) */
.uib-root.uib-v3 .uib3-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--v3-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.uib-root.uib-v3 .uib3-menu-item span { font-size: 12px; color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-menu-item:hover { background: var(--v3-hover); }
/* select several texts: a checkbox beside each Phone row, and one bar of actions */
.uib-root.uib-v3 .uib3-li.has-pick { display: flex; align-items: stretch; }
.uib-root.uib-v3 .uib3-li.has-pick > .uib3-row { flex: 1 1 auto; min-width: 0; }
.uib-root.uib-v3 .uib3-pick { position: relative; flex: 0 0 44px; display: flex; align-items: flex-start; justify-content: center; padding-top: 13px; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-pick input { position: absolute; top: 0; left: 0; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.uib-root.uib-v3 .uib3-pick input:checked + .uib3-box { background: var(--v3-ink); border-color: var(--v3-ink); box-shadow: inset 0 0 0 3px var(--v3-surface); }
.uib-root.uib-v3 .uib3-pick input:focus-visible + .uib3-box { outline: 2px solid var(--v3-focus); outline-offset: 2px; }
.uib-root.uib-v3 .uib3-bulk { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--v3-hair); background: var(--v3-surface); }
.uib-root.uib-v3 .uib3-bulk-n { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-btn.uib3-quiet { color: var(--v3-muted); }
/* the reading pane: the system's patient guess (Confirm) and the assignment select */
.uib-root.uib-v3 .uib3-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 10px 12px; border: 1px solid var(--v3-hair); border-left: 3px solid var(--c-phone); border-radius: 6px; background: var(--v3-surface); }
.uib-root.uib-v3 .uib3-sugg-tx { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-sugg-tx span { font-size: 12.5px; color: var(--v3-ink2); }
.uib-root.uib-v3 .uib3-sugg-acts { display: flex; flex-wrap: wrap; gap: 6px; }
/* Spruce fix 6: the phone number is on more than one chart (a family phone): check who is texting. Text stays the normal ink (AA). */
.uib-root.uib-v3 .uib3-shared { margin: 0 16px 8px; padding: 8px 12px; border: 1px solid var(--v3-hair); border-left: 3px solid var(--c-warn, #B7791F); border-radius: 6px; background: var(--v3-surface); font-size: 13px; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-sugg .uib3-shared { flex: 1 1 100%; margin: 0; }
.uib-root.uib-v3 .uib3-shared--err { border-left-color: var(--v3-hair); color: var(--v3-ink2); }
.uib-root.uib-v3 .uib3-assign { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; font-size: 13px; color: var(--v3-ink2); }
html body .uib-root.uib-v3 .uib3-assign select { min-height: 44px; max-width: 100%; padding: 0 8px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; }

/* ── denser (owner 2026-11-12: "not SO much wasted space and more of the message showed") ───────────────────────── */
/* the category tabs and the search / tools share one row; it wraps onto two when the screen is narrow */
.uib-root.uib-v3 .uib3-bar { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; border-bottom: 1px solid var(--v3-hair2); }
.uib-root.uib-v3 .uib3-bar > .uib3-tabs { flex: 0 1 auto; min-width: 0; padding: 4px 6px 4px 14px; border-bottom: 0; }
.uib-root.uib-v3 .uib3-bar > .uib3-toolbar { flex: 1 1 520px; min-width: 0; padding: 4px 14px 4px 6px; border-bottom: 0; }
.uib-root.uib-v3 .uib3-main-tab { min-height: 44px; }
/* list rows: the same three lines, less padding */
.uib-root.uib-v3 .uib3-row { gap: 2px; padding: 7px 14px 8px 13px; }
/* the reading pane title: label · name · detail on one line, then the actions */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head { gap: 6px 12px; padding: 8px 20px; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-title { margin: 0; font-size: 17px; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head:is([data-uib-lane="team_direct"], [data-uib-lane="team_group"]) .uib-pane-acts { align-self: center; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-body { padding: 12px 20px; }
/* reply boxes: one comfortable line to start, the Send button beside it */
html body .uib-root.uib-v3 .uib3-pane .uib-composer { padding: 8px 16px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-reply { height: 44px; min-height: 44px; max-height: 44px; padding: 11px 12px; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-reply { min-height: 52px; height: 52px; }
@media (max-width: 900px) { .uib-root.uib-v3.is-reading .uib3-bar { display: none; } }
@media (min-width: 761px) {
  /* the tools stay on one line; when they and the tabs do not fit side by side, the whole tool group moves under the tabs */
  /* basis ~ the tools' own width, so the group moves under the tabs whole; it may still wrap inside (never spills sideways: layout guard) */
  .uib-root.uib-v3 .uib3-bar > .uib3-toolbar { flex: 1 1 760px; flex-wrap: wrap; }
  .uib-root.uib-v3 .uib3-bar > .uib3-toolbar .uib3-search { flex: 1 1 160px; min-width: 140px; }
}

/* the category tabs fill their row, evenly (owner 2026-11-12: "spread more evenly across the page"); each keeps at least its own label width,
   so on a narrow screen the row still scrolls instead of squeezing a label */
.uib-root.uib-v3 .uib3-bar > .uib3-tabs { flex: 1 1 auto; }
.uib-root.uib-v3 .uib3-tabs { gap: 0 8px; }
.uib-root.uib-v3 .uib3-tabs > .uib3-tab { flex: 1 1 0; min-width: fit-content; }
.uib-root.uib-v3 .uib3-tabs > .uib3-tab > .uib3-tab-in { flex: 1 1 auto; justify-content: center; }

/* ── more of the conversation on screen (owner 2026-11-12: "how insanely annoying it is how little of the text box shows") ── */
/* the title and its actions (Assign, Workflow, Link patient, More) share one row; the actions wrap under it only when narrow */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-acts { flex: 0 1 auto; margin-left: auto; justify-content: flex-end; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles { flex: 1 1 280px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-assign { display: inline-flex; margin: 0; }
html body .uib-root.uib-v3 .uib3-pane .uib3-assign select { min-height: 44px; max-width: 220px; padding: 0 8px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; font-size: 13.5px; }
/* the status line and the link panel take only what they need */
html body .uib-root.uib-v3 .uib3-status { padding: 0 14px; font-size: 12px; }
.uib-root.uib-v3 .uib3-link { gap: 6px; padding: 8px 20px 10px; }
.uib-root.uib-v3 .uib3-link-results { max-height: 180px; }
/* reply boxes start at one line and grow with what is typed (up to about 8 lines, then scroll) */
html body .uib-root.uib-v3 .uib3-pane .uib-composer .uib-reply,
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-reply,
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-reply {
  field-sizing: content; height: auto; min-height: 44px; max-height: 176px; overflow-y: auto; resize: none; line-height: 1.4;
}
/* the text reply on ONE row in every look (Pearl already does): Reply / Note · the box · saved replies, emoji, Send */
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "mode txt tools" "hint hint hint"; align-items: end; gap: 4px 8px;
}
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-mode { grid-area: mode; flex-wrap: nowrap; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-reply { grid-area: txt; width: 100%; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-comp-tools { grid-area: tools; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0; width: auto; }
html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) > .uib-note { grid-column: 1 / -1; margin: 0; }

/* ── a SIGNIFICANT amount more room (owner 2026-11-12) ─────────────────────────────────────────────────────────── */
/* one top row: Patient / Team / Archived on the left, search and tools on the right; it wraps only when narrow */
.uib-root.uib-v3 .uib3-top { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; border-bottom: 1px solid var(--v3-hair); }
.uib-root.uib-v3 .uib3-top > .uib3-main-tabs { flex: 0 0 auto; border-bottom: 0; }
.uib-root.uib-v3 .uib3-top > .uib3-toolbar { flex: 1 1 520px; min-width: 0; flex-wrap: wrap; justify-content: flex-end; padding: 0 14px 0 6px; border-bottom: 0; }
.uib-root.uib-v3 .uib3-top > .uib3-toolbar .uib3-search { flex: 0 1 280px; min-width: 140px; height: 44px; }
.uib-root.uib-v3 .uib3-top > .uib3-toolbar .uib3-search-in { height: 44px; }
/* the category tabs now have their row to themselves */
.uib-root.uib-v3 .uib3-bar > .uib3-tabs { padding-right: 14px; }
/* Expand: the conversation fills the Inbox; Back to Inbox (or Collapse) brings the list back */
@media (min-width: 901px) {
  .uib-root.uib-v3.is-focus :is(.uib3-bar, .uib3-subtabs, .uib3-status, .uib3-list) { display: none; }
  .uib-root.uib-v3.is-focus .uib3-split { grid-template-columns: minmax(0, 1fr); }
  html body .uib-root.uib-v3.is-focus .uib3-pane .uib-pane-head .uib-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; }
}
@media (max-width: 900px) { html body .uib-root.uib-v3 .uib3-pane .uib3-expand { display: none; } }
/* screen-reader-only labels inside toolbar buttons stay hidden (the generic ".uib3-btn > span" rule shows spans) */
html body .uib-root.uib-v3 .uib3-btn > span.uib-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 761px) {
  /* the tools stay one line: beside the section tabs when they fit, otherwise the whole group on its own line */
  .uib-root.uib-v3 .uib3-top > .uib3-toolbar { flex: 1 1 600px; min-width: min(100%, 600px); flex-wrap: nowrap; }
  .uib-root.uib-v3 .uib3-top > .uib3-toolbar .uib3-search { flex: 1 1 220px; min-width: 110px; }
}
/* the conversation title row: name (shortened if needed) and the actions on one line in a normal-width pane */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles { flex: 1 1 200px; min-width: 0; flex-wrap: nowrap; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html body .uib-root.uib-v3 .uib3-pane .uib3-assign select { max-width: 150px; }
@container uibthread (max-width: 1100px) {
  html body .uib-root.uib-v3 .uib3-pane [data-uib-act="workflow"] .uib-btn-tx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
html body .uib-root.uib-v3 .uib3-pane .uib-pane-titles { flex-basis: 140px; }
html body .uib-root.uib-v3 .uib3-pane .uib-pane-acts { gap: 6px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-assign select { max-width: 132px; }
/* the actions sit at the right edge of the title row now: More opens leftward, inside the pane */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-acts [data-uib-pop="more"] { left: auto; right: 0; }
/* a narrow pane (a phone): Reply / Note and the buttons on top, the box the full width under them */
@container uibthread (max-width: 560px) {
  html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "mode tools" "txt txt" "hint hint"; }
  html body .uib-root.uib-v3 .uib3-pane .uib-composer:not(.uib3-composer) .uib-comp-tools { justify-self: end; }
}
/* the section tabs scroll inside their own box when narrow (never push the row wider: layout guard) */
.uib-root.uib-v3 .uib3-top > .uib3-main-tabs { flex: 0 1 auto; min-width: 0; }
.uib-root.uib-v3 .uib3-top > .uib3-toolbar { min-width: 0; }
@media (min-width: 761px) { .uib-root.uib-v3 .uib3-top > .uib3-toolbar { min-width: min(100%, 600px); flex-wrap: wrap; } }

/* ── Team pane: files, quick reactions, emoji, attach (owner 2026-11-13) ───────────────────────────────────────── */
html body .uib-root.uib-v3 .uib3-pane .uib3-tm { position: relative; }
.uib-root.uib-v3 .uib3-tm-files { margin-top: 6px; }
.uib-root.uib-v3 .uib3-tm-files :is(img) { max-width: min(260px, 100%); height: auto; border-radius: 6px; }
.uib-root.uib-v3 .uib3-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
html body .uib-root.uib-v3 .uib3-rx-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 8px; border: 1px solid var(--v3-hair); border-radius: 14px; background: var(--v3-surface); color: var(--v3-ink); font: inherit; font-size: 13px; cursor: pointer; -webkit-text-fill-color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-rx-chip.is-mine { border-color: var(--v3-ink); font-weight: 600; }
html body .uib-root.uib-v3 span.uib3-rx-chip { cursor: default; }
/* the quick reactions appear on the message you point at (or tab to), beside it */
.uib-root.uib-v3 .uib3-rx-bar { position: absolute; top: -40px; display: none; gap: 2px; padding: 2px; border: 1px solid var(--v3-hair); border-radius: 22px; background: var(--v3-surface); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35); z-index: 3; }
.uib-root.uib-v3 .uib3-tm.is-mine .uib3-rx-bar { right: 8px; }
.uib-root.uib-v3 .uib3-tm:not(.is-mine) .uib3-rx-bar { left: 8px; }
.uib-root.uib-v3 .uib3-tm:hover .uib3-rx-bar, .uib-root.uib-v3 .uib3-tm:focus-within .uib3-rx-bar { display: inline-flex; }
@media (hover: none) { .uib-root.uib-v3 .uib3-rx-bar { position: static; display: inline-flex; margin-top: 6px; box-shadow: none; } }
html body .uib-root.uib-v3 .uib3-rx-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 18px; line-height: 1; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-rx-btn:hover, html body .uib-root.uib-v3 .uib3-rx-btn:focus-visible { background: var(--v3-hover); }
/* reply tools: attach · emoji · Send */
html body .uib-root.uib-v3 .uib3-pane .uib3-composer { flex-wrap: wrap; }
html body .uib-root.uib-v3 .uib3-pane .uib3-composer .uib-reply { flex: 1 1 200px; width: auto; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-attach { position: relative; cursor: pointer; }
.uib-root.uib-v3 .uib3-attach-list { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.uib-root.uib-v3 .uib3-attach-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border: 1px solid var(--v3-hair); border-radius: 6px; background: var(--v3-surface); color: var(--v3-ink); font-size: 13px; }
html body .uib-root.uib-v3 .uib3-attach-x { width: 44px; height: 32px; border: 0; background: none; color: var(--v3-muted); font-size: 18px; cursor: pointer; }
/* room above each message for its reaction bar */
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm { margin-top: 10px; }
/* the list | conversation area never spills sideways (layout guard, dark Team view on Linux CI, 2026-11-13): the list column may shrink below
   its usual minimum when the area itself is that narrow, and anything wider than the area is cut at its edge (no scroll box: overflow-x clip) */
.uib-root.uib-v3 .uib3-split { min-width: 0; overflow-x: clip; text-overflow: ellipsis; }
@media (min-width: 1101px) { .uib-root.uib-v3 .uib3-split { grid-template-columns: minmax(min(260px, 100%), 32%) minmax(0, 1fr); } }
@media (min-width: 901px) and (max-width: 1100px) { .uib-root.uib-v3 .uib3-split { grid-template-columns: minmax(min(240px, 100%), 36%) minmax(0, 1fr); } }
.uib-root.uib-v3 .uib3-list { min-width: 0; }

/* ── Option D (owner 2026-11-16: "this just looks so messy … four options"; chose D): the category filters are a slim list beside the
   conversations, like folders in a mail app — a dot in the category colour, the name, the unread count on the right — instead of a row
   of eight coloured boxes. Wide: 188px list | conversations | conversation. 901–1200px: the list is a 60px column of dots with counts
   (the name on hover). Phone (≤900px): one "Showing: …" button that opens the same list. Tools keep their words. ─────────────────── */
.uib-root.uib-v3 .uib3-filters { min-width: 0; min-height: 0; overflow-y: auto; padding: 8px 6px 12px; border-right: 1px solid var(--v3-hair2); background: var(--v3-surface); }
.uib-root.uib-v3 .uib3-filters-toggle { display: none; }
.uib-root.uib-v3 .uib3-filters .uib3-tabs { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 2px; padding: 0; border: 0; overflow: visible; }
.uib-root.uib-v3 .uib3-filters .uib3-tab {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; flex: none; min-width: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--v3-muted); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.uib-root.uib-v3 .uib3-filters .uib3-tab:hover { background: var(--v3-hover); color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-filters .uib3-tab[aria-selected="true"] { background: var(--b-all); color: var(--v3-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--k-c); }
.uib-root.uib-v3 .uib3-filters .uib3-tab:focus-visible { outline: 2px solid var(--v3-focus); outline-offset: -2px; }
.uib-root.uib-v3 .uib3-filters .uib3-tab-in {
  flex: 1 1 auto; min-width: 0; height: auto; padding: 0; border: 0; border-radius: 0; background: none; color: inherit;
  font: inherit; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start;
}
.uib-root.uib-v3 .uib3-filters .uib3-tab[aria-selected="true"] .uib3-tab-in { background: none; border: 0; color: inherit; }
.uib-root.uib-v3 .uib3-tab-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--k-c); }
.uib-root.uib-v3 .uib3-tab-dot[data-uib-color="all"], .uib-root.uib-v3 .uib3-tab[data-uib-color="all"] .uib3-tab-dot { background: var(--v3-muted); }
.uib-root.uib-v3 .uib3-filters .uib3-tab-n {
  flex: none; margin-left: auto; min-width: 0; padding: 0; border-radius: 0; background: none; color: var(--v3-unread);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
/* on the highlighted filter the count is ink (the unread blue on the light highlight is under 4.5:1) */
.uib-root.uib-v3 .uib3-filters .uib3-tab[aria-selected="true"] .uib3-tab-n { background: none; color: var(--v3-ink); }
.uib-root.uib-v3 .uib3-fgrp { padding: 12px 10px 4px; color: var(--v3-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
/* the one next action in the toolbar is filled (New / New message); every other tool keeps its word */
html body .uib-root.uib-v3 .uib3-btn.uib3-btn--primary { background: var(--v3-ink); border-color: var(--v3-ink); color: var(--v3-surface); font-weight: 600; }
html body .uib-root.uib-v3 .uib3-btn.uib3-btn--primary:hover { background: var(--v3-ink2); color: var(--v3-surface); }
html body .uib-root.uib-v3 .uib3-pop-item { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--v3-ink); font: inherit; text-align: left; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-pop-item:hover { background: var(--v3-hover); }

@media (min-width: 1201px) {
  .uib-root.uib-v3 .uib3-split { grid-template-columns: 188px minmax(min(260px, 100%), 28%) minmax(0, 1fr); }   /* the list keeps about a third of list + conversation */
}
@media (min-width: 901px) and (max-width: 1200px) {
  .uib-root.uib-v3 .uib3-split { grid-template-columns: 60px minmax(min(240px, 100%), 36%) minmax(0, 1fr); }
  .uib-root.uib-v3 .uib3-filters { padding: 8px 4px; }
  .uib-root.uib-v3 .uib3-filters .uib3-tab { position: relative; justify-content: center; padding: 0; min-height: 44px; }
  .uib-root.uib-v3 .uib3-filters .uib3-tab-in, .uib-root.uib-v3 .uib3-fgrp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; }
  .uib-root.uib-v3 .uib3-filters .uib3-tab-dot { width: 10px; height: 10px; }
  .uib-root.uib-v3 .uib3-filters .uib3-tab-n { position: absolute; top: 2px; right: 3px; margin: 0; font-size: 10.5px; }
}
@media (min-width: 901px) {
  .uib-root.uib-v3.is-focus .uib3-filters { display: none; }
  .uib-root.uib-v3.is-focus .uib3-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .uib-root.uib-v3 .uib3-filters { grid-column: 1 / -1; position: relative; overflow: visible; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--v3-hair2); }
  .uib-root.uib-v3 .uib3-filters-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--v3-hair); border-radius: 8px;
    background: var(--v3-surface); color: var(--v3-ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer;
  }
  .uib-root.uib-v3 .uib3-filters-toggle .uib3-toggle-n { margin-left: auto; color: var(--v3-ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .uib-root.uib-v3 .uib3-filters-toggle .uib-ui-ico { margin-left: auto; }
  .uib-root.uib-v3 .uib3-filters-toggle .uib3-toggle-n + .uib-ui-ico { margin-left: 0; }
  .uib-root.uib-v3 .uib3-filters .uib3-tabs { display: none; }
  .uib-root.uib-v3[data-uib-menu-open="filters"] .uib3-filters .uib3-tabs {
    display: flex; position: absolute; z-index: 20; left: 12px; right: 12px; top: calc(100% - 4px); padding: 6px;
    border: 1px solid var(--v3-hair); border-radius: 10px; background: var(--v3-surface); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
    max-height: min(60vh, 440px); overflow-y: auto;
  }
  .uib-root.uib-v3.is-reading .uib3-filters { display: none; }
}
html body .uib-root.uib-v3 .uib3-filters .uib3-tab-in { display: block; text-align: left; }
/* on dark themes the dots take the category's light tint (the tone made for dark surfaces) rather than its mid colour */
:is(html[data-dark], html[data-theme="pearl_night"]) .uib-root.uib-v3 .uib3-tab-dot { background: var(--k-t); }
:is(html[data-dark], html[data-theme="pearl_night"]) .uib-root.uib-v3 .uib3-filters .uib3-tab[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--k-t); }
/* dark themes: no light box on a dark surface (tests/helpers/contrast-audit.mjs) — the one next action is outlined in ink instead */
:is(html[data-dark], html[data-theme="pearl_night"]) body .uib-root.uib-v3 .uib3-btn.uib3-btn--primary { background: var(--v3-field); border-color: var(--v3-ink); color: var(--v3-ink); }
:is(html[data-dark], html[data-theme="pearl_night"]) body .uib-root.uib-v3 .uib3-btn.uib3-btn--primary:hover { background: var(--v3-hover); color: var(--v3-ink); }

/* ── Team Communication: headshots, the conversation's own tools, more of the message on screen (owner 2026-11-17: "i thought we were
   fixing this issue? … make more of the message on the screen and less wasted space … I like the messages having the headshot") ── */
.uib-root.uib-v3 .uib3-av { display: inline-flex; flex: none; line-height: 0; }
.uib-root.uib-v3 .uib3-av .portal-avatar { flex: none; }
.uib-root.uib-v3 .uib3-av-ini { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 12px; font-weight: 600; line-height: 1; background: var(--v3-field); color: var(--v3-ink); }
/* list: the headshot left of the name; a direct conversation is two lines (name + last message) */
.uib-root.uib-v3 .uib3-row.has-av { position: relative; padding-left: 62px; min-height: 60px; justify-content: center; }
.uib-root.uib-v3 .uib3-row.has-av .uib3-row-av { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
/* the tools row never leaves Refresh alone on a second line (a whole wasted row above the conversations): Search gives up width first */
@media (min-width: 761px) {
  .uib-root.uib-v3 .uib3-top > .uib3-toolbar { flex-wrap: nowrap; }
  .uib-root.uib-v3 .uib3-top > .uib3-toolbar .uib3-search { flex: 1 1 220px; min-width: 120px; }
}
/* the conversation header: one row (headshot, name, who), the tools on the right */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-head.uib3-team-head { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 6px 12px 6px 16px; min-height: 56px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-titles { flex: 1 1 auto; min-width: 0; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-title { margin: 0; font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-sub { margin: 0; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-acts { flex: none; display: flex; align-items: center; gap: 2px; margin-left: auto; align-self: center; }
html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib3-tool[aria-pressed="true"] { background: var(--v3-field); }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm-search { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 16px; border-bottom: 1px solid var(--v3-hair); }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm-search input { flex: 1 1 auto; min-width: 0; min-height: 40px; }
html body .uib-root.uib-v3 .uib3-pane .uib3-tm-search [data-uib-tm-count] { flex: none; font-size: 12px; }
/* messages: a colleague's headshot beside their bubble; tighter bubbles, wider text */
html body .uib-root.uib-v3 .uib3-pane .uib-pane-body.uib-thread:has([data-uib-team-thread]) { padding: 10px 16px 12px; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm { max-width: min(86%, 760px); padding: 7px 11px 8px; margin-top: 6px; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm.has-av { margin-left: 40px; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm-av { position: absolute; left: -40px; top: 0; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm .uib-pm-meta { font-size: 11.5px; margin-bottom: 2px; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm .uib-pm-body { line-height: 1.42; }
html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm[hidden] { display: none; }
@media (max-width: 900px) {
  html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm.has-av { margin-left: 34px; }
  html body .uib-root.uib-v3 .uib3-pane [data-uib-team-thread] .uib3-tm-av { left: -34px; }
  html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib3-av { display: none; }
  /* a phone: Back and the name on the first line, the tools on their own line under them (never a squeezed-out name) */
  html body .uib-root.uib-v3 .uib3-pane .uib-pane-head.uib3-team-head { flex-wrap: wrap; row-gap: 4px; }
  html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-titles { flex: 1 1 140px; }
  html body .uib-root.uib-v3 .uib3-pane .uib3-team-head .uib-pane-acts { flex: 1 0 100%; justify-content: flex-end; margin-left: 0; }
}
/* every emoji as a reaction: the quick ones on hover, and "All reactions" opens the full list under them (owner 2026-11-17) */
.uib-root.uib-v3 .uib3-rx-bar.is-open { display: inline-flex; z-index: 6; }
html body .uib-root.uib-v3 .uib3-rx-btn.uib3-rx-more { width: auto; min-width: 44px; padding: 0 8px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-size: 14px; color: var(--v3-ink); -webkit-text-fill-color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-rx-btn.uib3-rx-more[aria-expanded="true"] { background: var(--v3-field); }
.uib-root.uib-v3 .uib3-rx-pick { position: absolute; top: calc(100% + 4px); z-index: 7; display: grid; grid-template-columns: repeat(8, 44px); gap: 2px; padding: 6px; border: 1px solid var(--v3-hair); border-radius: 12px; background: var(--v3-surface); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .45); }
.uib-root.uib-v3 .uib3-tm.is-mine .uib3-rx-pick { right: 0; }
.uib-root.uib-v3 .uib3-tm:not(.is-mine) .uib3-rx-pick { left: 0; }
@media (max-width: 560px), (hover: none) {
  .uib-root.uib-v3 .uib3-rx-pick { grid-template-columns: repeat(auto-fill, 44px); width: min(368px, calc(100vw - 72px)); }
}
/* the emoji picker (every emoji, like a phone's): search, categories, Frequently used, then each category; in the reply box and as
   All reactions (owner 2026-11-17: "give option to use ALL emojis in messages like apple") */
html body .uib-root.uib-v3 .uib-composer { position: relative; }
html body .uib-root.uib-v3[data-uib-menu-open="emoji"] [data-uib-pop="emoji"] { display: block; left: auto; right: 0; width: min(392px, calc(100vw - 48px)); max-height: none; overflow: hidden; padding: 0; }
.uib-root.uib-v3 .uib3-rx-pick { display: block; padding: 0; width: min(392px, calc(100vw - 48px)); grid-template-columns: none; }
.uib-root.uib-v3 .uib3-emo { display: flex; flex-direction: column; gap: 6px; padding: 8px; max-height: min(420px, 60vh); }
html body .uib-root.uib-v3 .uib3-emo .uib3-emo-q { width: 100%; min-height: 44px; box-sizing: border-box; }
.uib-root.uib-v3 .uib3-emo-tabs { display: flex; gap: 0; overflow-x: auto; overflow-y: hidden; flex: none; scrollbar-width: thin; border-bottom: 1px solid var(--v3-hair); }
html body .uib-root.uib-v3 .uib3-emo-tab { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 20px; line-height: 1; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-emo-tab:hover, html body .uib-root.uib-v3 .uib3-emo-tab:focus-visible { background: var(--v3-hover); }
.uib-root.uib-v3 .uib3-emo-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.uib-root.uib-v3 .uib3-emo-h { margin: 6px 4px 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--v3-muted); -webkit-text-fill-color: var(--v3-muted); }
.uib-root.uib-v3 .uib3-emo-cells { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 0; justify-content: start; }
html body .uib-root.uib-v3 .uib3-emo-cells .uib-emo { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 24px; line-height: 1; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-emo-cells .uib-emo:hover, html body .uib-root.uib-v3 .uib3-emo-cells .uib-emo:focus-visible { background: var(--v3-hover); }
.uib-root.uib-v3 .uib3-emo [hidden] { display: none !important; }
.uib-root.uib-v3 .uib3-emo-none { margin: 12px 4px; font-size: 13px; }
/* the empty checkbox space of a row that cannot be selected (nothing to click there) */
.uib-root.uib-v3 .uib3-pick.uib3-pick--none { cursor: default; }

/* ── Fold arrows (owner 2026-11-18: "an option like an arrow to close the different sections to make it less chaotic"; chose the
   categories column and the conversation list). Wide screens only; remembered per viewer. A folded column is a thin strip holding
   only its arrow, so the conversation gets the room. Expand (is-focus) still hides both. ─────────────────────────────────────────── */
.uib-root.uib-v3 .uib3-fold {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; flex: none;   /* a 44px target, like every control here */
  border: 1px solid transparent; border-radius: 6px; background: none; color: var(--v3-muted); cursor: pointer;
}
.uib-root.uib-v3 .uib3-fold:hover { background: var(--v3-hover); color: var(--v3-ink); border-color: var(--v3-hair); }
.uib-root.uib-v3 .uib3-fold:focus-visible { outline: 2px solid var(--v3-focus); outline-offset: 1px; }
.uib-root.uib-v3 .uib3-fold .uib-ui-ico { width: 16px; height: 16px; }
.uib-root.uib-v3 .uib3-filters > .uib3-fold { margin: -4px -2px 0 auto; }
.uib-root.uib-v3 .uib3-list > .uib3-fold { margin: 0 2px 0 auto; }
@media (max-width: 900px) { .uib-root.uib-v3 .uib3-fold { display: none; } }
@media (min-width: 901px) {
  .uib-root.uib-v3.is-fold-filters:not(.is-focus) .uib3-filters { padding: 8px 2px; }
  .uib-root.uib-v3.is-fold-filters:not(.is-focus) .uib3-filters > :not(.uib3-fold) { display: none; }
  .uib-root.uib-v3.is-fold-filters:not(.is-focus) .uib3-filters > .uib3-fold { margin: 0 auto; }
  .uib-root.uib-v3.is-fold-list:not(.is-focus) .uib3-list > :not(.uib3-fold) { display: none; }
  .uib-root.uib-v3.is-fold-list:not(.is-focus) .uib3-list > .uib3-fold { margin: 8px auto 0; }
  .uib-root.uib-v3.is-fold-list:not(.is-focus) .uib3-list { overflow: hidden; }
}
@media (min-width: 1201px) {
  .uib-root.uib-v3.is-fold-filters:not(.is-focus) .uib3-split { grid-template-columns: 48px minmax(min(260px, 100%), 28%) minmax(0, 1fr); }
  .uib-root.uib-v3.is-fold-list:not(.is-focus) .uib3-split { grid-template-columns: 188px 48px minmax(0, 1fr); }
}
@media (min-width: 901px) and (max-width: 1200px) {
  .uib-root.uib-v3.is-fold-filters:not(.is-focus) .uib3-split { grid-template-columns: 48px minmax(min(240px, 100%), 36%) minmax(0, 1fr); }
  .uib-root.uib-v3.is-fold-list:not(.is-focus) .uib3-split { grid-template-columns: 60px 48px minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .uib-root.uib-v3.is-fold-filters.is-fold-list:not(.is-focus) .uib3-split { grid-template-columns: 48px 48px minmax(0, 1fr); }
}

/* the open fax's document in the reading pane (owner 2026-11-20: a fax opens to the document) */
html body .uib-root.uib-v3 .uib3-pane .uib-fax-doc { margin-top: 10px; }
/* Fax: Route to provider + the rarer filing actions under More (owner 2026-11-22) */
html body .uib-root.uib-v3 .uib3-pane .uib-fax-more { display: inline-block; position: relative; }
html body .uib-root.uib-v3 .uib3-pane .uib-fax-more > summary { list-style: none; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-pane .uib-fax-more > summary::-webkit-details-marker { display: none; }
html body .uib-root.uib-v3 .uib3-pane .uib-fax-more-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
html body .uib-root.uib-v3 .uib3-pane .uib-fax-routed { font-weight: 600; color: var(--c-ink2, inherit); }
html body .uib-root.uib-v3 .uib3-pane .uib-fax-frame { display: block; width: 100%; height: max(480px, calc(100vh - 300px)); border: 1px solid var(--v3-hair); border-radius: 6px; background: #fff; }
/* the patient-text character count (owner rule 2026-11-20: texts under 600 characters) — shown from 450 characters, red over the limit */
html body .uib-root .uib-count { margin: 2px 0 0; font-size: 11.5px; color: var(--v3-muted, #5A6470); text-align: right; }
html body .uib-root .uib-count.is-over { color: var(--v3-alert, #9A2A20); font-weight: 600; text-align: left; }

/* ── Reading pane cleanup (owner 2026-11-20: "messy, not organized, not user friendly") ──────────────────────────────────────────
   The title row is Link patient (only when unlinked) · Actions ▾ (no Mark handled, owner 2026-11-21); the composer is Reply/Note · box · Templates ▾ · emoji · Send.
   Notes fold to one readable line (who · when — how it starts); a long message sent again folds under the first copy. */
/* the title row: [Link patient (only when unlinked)] [Actions ▾] — nothing else */
html body .uib-root .uib-pane-head .uib-pane-acts { flex-wrap: nowrap; gap: 8px; }
/* Actions ▾ / Templates ▾: a word button (the theme's square icon-button sizing does not apply) */
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-btn.uib-icon-btn { width: auto !important; min-width: 0; padding: 0 12px !important; gap: 6px; }
html body .uib-root .uib-pane-acts .uib-actions-menu > .uib-btn .uib-btn-tx,
html body .uib-root .uib-comp-tools .uib-tpl-menu > .uib-btn .uib-btn-tx { position: static !important; width: auto !important; height: auto !important; clip-path: none !important; overflow: visible !important; }
/* a menu: one item per line, left-aligned, quiet; the item's own word always shows */
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop { min-width: 260px; max-width: min(340px, 90vw); padding: 6px; }
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop :is(.uib-btn, .uib-linkbtn) {
  display: flex !important; width: 100% !important; min-height: 40px; justify-content: flex-start !important; gap: 10px; padding: 0 10px !important; margin: 0;
  border: 0 !important; border-radius: 6px; background: transparent !important; box-shadow: none !important; color: inherit; font-size: 13.5px; font-weight: 500; text-align: left; text-decoration: none;
}
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop :is(.uib-btn, .uib-linkbtn):hover { background: var(--v3-hover, rgba(127, 127, 127, .12)) !important; }
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop :is(.uib-btn, .uib-linkbtn) :is(.uib-btn-tx, .uib-chart-tx, span) {
  position: static !important; width: auto !important; height: auto !important; clip-path: none !important; overflow: visible !important;
}
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop .prs-btn-short { display: none !important; }
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) > .uib-menu-pop .prs-btn-long { display: inline !important; }
html body .uib-root .uib-actions-menu .uib-act-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--v3-hair, rgba(127, 127, 127, .25)); }
html body .uib-root .uib-actions-menu .uib-act-row select { flex: 1; max-width: none !important; }
html body .uib-root :is(.uib-actions-menu, .uib-tpl-menu) .uib-act-k { margin: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--v3-muted, #5A6470); }
html body .uib-root .uib-tpl-menu .uib-tpl-saved { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--v3-hair, rgba(127, 127, 127, .25)); }
html body .uib-root .uib-tpl-menu .uib-tpl-saved .uib-act-k { padding: 0 10px 6px; }
/* a folded staff note: one quiet row, readable, never a bare label */
html body .uib-root .msg-hub-spruce-thread .spruce-internal-note-wrap:not(.is-expanded) { margin: 2px 0; }
html body .uib-root .msg-hub-spruce-thread .spruce-internal-note-collapsed-line {
  display: block; width: 100%; box-sizing: border-box; padding: 5px 10px; border-left: 3px solid var(--v3-hair, rgba(127, 127, 127, .45)); border-radius: 6px;
  background: rgba(127, 127, 127, .07); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; cursor: pointer;
}
html body .uib-root .msg-hub-spruce-thread .spruce-internal-note-collapsed-line:hover { text-decoration: none; background: rgba(127, 127, 127, .13); }
/* the same message sent again: a one-line row on the sent side; it opens in place */
html body .uib-root .msg-hub-spruce-thread .uib-repeat { align-self: flex-end; max-width: 85%; }
html body .uib-root .msg-hub-spruce-thread .uib-repeat > summary {
  list-style: none; cursor: pointer; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; color: var(--v3-muted, #5A6470); text-align: right;
}
html body .uib-root .msg-hub-spruce-thread .uib-repeat > summary::-webkit-details-marker { display: none; }
html body .uib-root .msg-hub-spruce-thread .uib-repeat > summary:hover { background: rgba(127, 127, 127, .1); }
html body .uib-root .msg-hub-spruce-thread .uib-repeat[open] > summary { margin-bottom: 4px; }
/* "Which provider?" — a saved reply that names the provider asks first (patient's clinicians listed first) */
html body .uib-root .uib-provpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-top: 1px solid var(--v3-hair, rgba(127, 127, 127, .25)); background: rgba(127, 127, 127, .06); }
html body .uib-root .uib-provpick-k { font-size: 12.5px; font-weight: 600; }
html body .uib-root .uib-provpick select { min-height: 36px; max-width: 280px; }
html body .uib-root .uib-provpick .uib-btn { min-height: 36px !important; }

/* ── Sleek pass (owner 2026-11-24: "make the current version sleeker higher tech modern + use the icons … my bubble color should NOT
   be yellow"). Same layout; quieter lines, line icons in the category colour instead of dots and "Phone · Text" boxes, softer selected
   states, an Unread · All switch above the list, and the viewer's own sent bubbles in neutral ink (never the gold finish). ────────── */
html body .uib-root.uib-v3 .uib3-shell { border-radius: 14px; border-color: var(--v3-hair2); box-shadow: 0 1px 1px rgba(10, 12, 16, .03), 0 18px 40px -28px rgba(10, 12, 16, .35); }
:is(html[data-dark], html[data-theme="pearl_night"]) body .uib-root.uib-v3 .uib3-shell { background: color-mix(in srgb, var(--v3-surface) 88%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1); }
html body .uib-root.uib-v3 .uib3-filters { padding: 10px 8px 14px; }
/* side list: icon · name · count; the selected one a soft fill, no coloured bar */
html body .uib-root.uib-v3 .uib3-filters .uib3-tab { gap: 12px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; letter-spacing: .005em; }
html body .uib-root.uib-v3 .uib3-filters .uib3-tab[aria-selected="true"] { background: color-mix(in srgb, var(--v3-ink) 7%, transparent); box-shadow: none; font-weight: 600; }
html body .uib-root.uib-v3 .uib3-tab-ico { flex: none; width: 18px; height: 18px; color: var(--k-c); }
html body .uib-root.uib-v3 [data-uib-color="all"] .uib3-tab-ico, html body .uib-root.uib-v3 .uib3-tab-icow[data-uib-color="all"] .uib3-tab-ico { color: var(--v3-muted); }
html body .uib-root.uib-v3 .uib3-tab-icow { display: inline-flex; }
html body .uib-root.uib-v3 .uib3-fgrp { padding: 16px 12px 6px; font-size: 10.5px; letter-spacing: .12em; opacity: .9; }
/* rows: no coloured side bar; the channel icon carries the colour */
html body .uib-root.uib-v3 .uib3-row { border-left: 0; padding: 12px 16px 13px 18px; gap: 5px; }
html body .uib-root.uib-v3 .uib3-li + .uib3-li { border-top-color: color-mix(in srgb, var(--v3-hair2) 70%, transparent); }
html body .uib-root.uib-v3 .uib3-row.is-sel { background: color-mix(in srgb, var(--v3-ink) 7%, transparent); box-shadow: inset 2px 0 0 var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-row .uib3-who { letter-spacing: .005em; }
html body .uib-root.uib-v3 .uib3-row.is-unread .uib3-who { font-weight: 650; }
html body .uib-root.uib-v3 .uib3-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--v3-unread) 18%, transparent); }
html body .uib-root.uib-v3 .uib3-label.uib3-label--ico { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--k-t); }
html body .uib-root.uib-v3 .uib3-label-ico { color: var(--k-c); }
html body .uib-root.uib-v3 .uib3-label-ico { width: 16px; height: 16px; }
html body .uib-root.uib-v3 .uib3-action { font-weight: 600; letter-spacing: .01em; }
/* Unread · All: two quiet text tabs above the list, the chosen one underlined */
html body .uib-root.uib-v3 .uib3-seen { position: sticky; top: 0; z-index: 2; display: flex; gap: 20px; padding: 0 18px; border-bottom: 1px solid var(--v3-hair2); background: var(--v3-surface); }
html body .uib-root.uib-v3 .uib3-seen-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 2px; margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--v3-muted); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
html body .uib-root.uib-v3 .uib3-seen-btn:hover { color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-seen-btn[aria-pressed="true"] { color: var(--v3-ink); font-weight: 600; border-bottom-color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-seen-n { font-size: 12px; font-weight: 700; color: var(--v3-unread); font-variant-numeric: tabular-nums; }
html body .uib-root.uib-v3 .uib3-seen-btn[aria-pressed="true"] .uib3-seen-n { color: var(--v3-ink); }
html body .uib-root.uib-v3 .uib3-empty .uib-linkbtn { min-height: 44px; padding: 0 6px; font-weight: 600; color: var(--v3-ink); }
/* the viewer's own texts: neutral ink, the same as their own Team messages (was the Pearl finish colour, gold with Champagne) */
html body .uib-root.uib-v3 .uib-bubbles .msg-hub-spruce-bubble.outbound { background: var(--v3-ink); border: 0; color: var(--v3-surface); box-shadow: none; }
html body .uib-root.uib-v3 .uib-bubbles .msg-hub-spruce-bubble.outbound :is(.msg-thread-prose, .msg-hub-spruce-bubble-meta, .msg-read-more, a) { color: var(--v3-surface); -webkit-text-fill-color: var(--v3-surface); }
/* the section tabs are never cut off or slid under Search (owner 2026-11-24 screenshot: "make sure nothing like this happens where things
   are overlapped"): on a wide screen they keep their full width, and the tools move to their own line when both do not fit */
@media (min-width: 761px) {
  html body .uib-root.uib-v3 .uib3-top > .uib3-main-tabs { flex: 0 0 auto; overflow: visible; }
  html body .uib-root.uib-v3 .uib3-top > .uib3-toolbar { flex: 1 1 600px; min-width: min(100%, 600px); }
}
/* a missed call's icon is the alert colour (it needs a call back); calls and voicemails keep the phone colour */
html body .uib-root.uib-v3 .uib3-label[data-uib-callkind="missed"] .uib3-label-ico { color: var(--v3-alert); }
