/*
 * portal-ui.css — the portal's shared UI component layer.
 *
 * WHAT BELONGS HERE
 *   Anything a second feature could reasonably reuse: the design tokens, the modal family
 *   (backdrop, panel, head/body/foot, stacking), buttons, form fields, the character counter,
 *   list rows, callouts, the switch, the toast, the inline filter-as-you-type search and the
 *   file dropzone. Rules here must be feature-agnostic — no page selectors, no ids.
 *
 * WHAT DOES NOT
 *   Feature-shaped rules stay in that feature's own stylesheet (Message History keeps threads,
 *   bubbles, the composer, the tag filter, the lightbox and the PDF chrome in messages.css).
 *   A widget that merely renders inside a modal is NOT a component.
 *
 * AND NOT style_new.css
 *   style_new.css is the legacy global sheet and is closed to new component styles — it had
 *   grown one way only (net +698 lines over its last 40 commits) because every feature bolted
 *   its widgets onto it. New shared styles come here instead. (.claude/rules/portal-ui.md)
 *
 * LOAD ORDER — deliberate
 *   Linked from parts/resources :: head AFTER dark.css. dark.css overrides a handful of these
 *   components by name and relies on winning those ties; before VF-4845 it won them because the
 *   components lived in a page-linked sheet that also came after it. Keeping this file last
 *   preserves that relationship exactly, so no dark-mode rule had to be rewritten. If this link
 *   ever moves above dark.css, the non-!important rules in its message block start losing.
 *
 * CLASS NAMES
 *   Components are prefixed ui-. The former message-* / msg-* names are kept as alias branches
 *   on every selector so markup outside VF-4845 keeps working; they are transitional and should
 *   be dropped once nothing references them.
 *
 * BRAND ACCENTS (--brand, --accent) carry the client's colors. They are NOT hardcoded per schema
 * here and no <schema>.schema.css is modified: applyMessageBrandTokens() in message-utils.js
 * reads the colors the active schema already paints (.btn-primary background and its paired
 * border, or the .loader accent) and writes the two base values inline on <html>, overriding the
 * literals below. Those literals are the VF-4971 mockup palette (Logicom) and stand in only if
 * that probe cannot run. Every shade is derived from the two bases with color-mix(), so a brand
 * added later needs no change to this file either.
 *
 * SEMANTIC colors stay fixed across schemas — --red* (danger/delete/failed), --amber* (warning),
 * --blue* (info/outbound bubbles), --green* (delivered) encode meaning, not branding, and must
 * not shift when a client's palette does.
 *
 * Tokens sit on :root because the backdrops, the lightbox and the toast mount as SIBLINGS of the
 * page element, so properties declared on a page class never reach them.
 */
/* Spec: DESIGN.md (repo-root design contract). This :root is the live token sheet for its front-matter
   tokens (colors / rounded / sizes — note some names differ: DESIGN.md "--line-2" = border #D3D7DE is
   --line-d here), and the ui-* and lp-* components below map to DESIGN.md › Components › Overlays, Inputs,
   Feedback ({component.toast}, {component.spinner}, {component.skeleton}, {component.loading-pill},
   {component.change-mark}). Report drift against DESIGN.md; don't fork values silently. */
:root  {
    --brand: #D23A12;
    /* Bind the design-system accent to the active brand's primary so every var(--accent)/var(--acc)
       surface (radios, buttons, checkboxes, switches...) repaints per brand on EVERY page, not only
       where applyMessageBrandTokens() runs. Each <schema>.schema.css sets --brand-primary (loaded
       before this sheet); the amber literal is only a fallback if a schema omits it. Dark mode still
       remaps --accent via dark.css (--dm-accent), so this stays dark-safe. */
    --accent: var(--brand-primary, #ED9F2B);
    --brand-d: color-mix(in srgb, var(--brand) 84%, black);
    --brand-l: color-mix(in srgb, var(--brand) 15%, white);
    --accent-d: color-mix(in srgb, var(--accent) 90%, black);
    --accent-l: color-mix(in srgb, var(--accent) 12%, white);
    --accent-l2: color-mix(in srgb, var(--accent) 22%, white);
    --red: #D23A12;
    --red-d: #B0300C;
    --red-l: #FBE9E3;
    --amber: #ED9F2B;
    --amber-d: #D58A1F;
    --amber-l: #FDF4E5;
    --bg: #F2F3F8; /* DESIGN.md colors.canvas — THE page background (surface-page #F7F8FA = --srf-2 is hover/expanded rows, NOT the page; 2026-10-21 ruling) */
    --card: #FFFFFF;
    --line: #E5E7EB; /* DESIGN.md colors.hairline (2026-10-21 ruling adopted the portal value) */
    --line-2: #F0F1F4;
    --ink: #1F2329;
    --ink-2: #4B5158;
    --ink-3: #8A8F96; /* DESIGN.md colors.ink-muted (2026-10-21 ruling adopted the portal value) */
    --ink-4: #B6BAC1;
    --blue: #2A8AC9;
    --blue-d: #1F6FA4;
    --blue-l: #E3F0F9;
    --green: #28A745;
    --green-l: #E4F4E8;
    --red-stat: #D9534F;
    --red-stat-l: #FBE7E6;
    --red-stat-ink: #9D2D2A;  /* readable red on --red-stat-l */
    --amber-stat: #F0AD4E;
    --amber-stat-l: #FCF2DF;
    --muted: #6C757D;
    --font: 'Inter', system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'Courier New', monospace;

    /* ── VF-4845 modal-redesign tokens (design handoff "Modal Redesign Spec") ──
       Accent values are DERIVED from --accent so they follow the client schema through the
       applyMessageBrandTokens() probe above; only semantic colors (--dgr danger, --ok success)
       are literals, per the semantic-color rule in the header comment. The handoff's --line-2
       is renamed --line-d here: --line-2 already exists above with the opposite meaning
       (lighter divider, not darker border). Dark-mode remaps live in dark.css, scoped to
       html.dark-mode (not .message-page) so they reach the sibling-mounted modals. */
    --scrim: rgba(16, 18, 22, .55);
    --scrim-media: rgba(9, 10, 13, .88);
    --srf: #FFFFFF;
    --srf-2: #F7F8FA;
    --srf-3: #EFF1F5;
    --line-d: #D3D7DE;
    --acc: var(--accent);
    --acc-hi: color-mix(in srgb, var(--accent) 85%, black);
    --acc-tint: color-mix(in srgb, var(--accent) 12%, white);
    /* Readable "selected" text on --acc-tint (DESIGN.md colors.accent-ink; ≈#8A5A0B for the default
       amber). Derived so tenant accents get it free — DESIGN.md › Implementation contract. */
    --acc-ink: color-mix(in srgb, var(--accent) 58%, black);
    --on-acc: #FFFFFF;
    /* Ink for small/bold text ON the accent fill. --on-acc (white) is the button-label color and
       is fine at button size, but at the 10.5px/600 of a state word it drops to ~2.2:1 on a light
       accent; this near-black reads on every schema accent the probe can produce. */
    --on-acc-strong: #201503;
    --dgr: #D64545;
    --dgr-hi: #B93A3A;
    --dgr-tint: #FCEDED;
    /* Readable danger/success text ON the tints (DESIGN.md colors.danger-ink / success-ink —
       own-value tokens per › Implementation contract; added 2026-10-21 for the LogViewer). */
    --dgr-ink: #8F2F2F;
    --ok: #2E9E5B;
    --ok-tint: #E9F7EF;
    --ok-ink: #1F6B3F;
    --viewer: #2A2E34;
    --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
    --shadow-1: 0 24px 64px -12px rgba(16, 18, 22, .25), 0 2px 8px rgba(16, 18, 22, .06);
    --shadow-menu: 0 12px 32px -8px rgba(16, 18, 22, .18);
    --r-ctl: 8px;
    --r-row: 10px;
    --r-panel: 12px;
    --r-sheet: 18px;
}

/* ===== WELLS ===== */
/* Soften the portal's primary content container globally: Bootstrap's .well defaults to a hard
   4px — lift it to the panel radius token so pages read less boxy. portal-ui.css loads after
   bootstrap.css, so this wins without !important; per-page/inline radii still override it. */
.well {
    border-radius: var(--r-panel);
}

/* ===== INLINE (filter-as-you-type) SEARCH ===== */ /* Used where the list is already in memory: magnifier glyph as the affordance, × to clear, no submit button. Server-backed searches keep the portal's search-control fragment instead. */ .ui-inline-search,
/* ===== INLINE (filter-as-you-type) SEARCH ===== */ /* Used where the list is already in memory: magnifier glyph as the affordance, × to clear, no submit button. Server-backed searches keep the portal's search-control fragment instead. */ .msg-inline-search {
    position: relative;
    margin-bottom: 10px;
}

.ui-inline-search .ui-inline-search-icon,
.msg-inline-search .msg-inline-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
}

.ui-inline-search-clear,
.msg-inline-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ui-inline-search-clear:hover,
.msg-inline-search-clear:hover {
    background: var(--srf-3);
    color: var(--ink);
}

/* The field itself. The wrapper absolutely positions a 15px magnifier at left:11px and a 24px
   clear button at right:6px, so the input has to reserve both gutters — without this rule the
   value and placeholder run underneath the glyph. It was missing while the only consumer
   (messages.css .msg-tag-filter-search) supplied its own, which made the component
   incomplete for the next one; a feature sheet that still declares its own input wins on
   specificity and is unaffected. */
.ui-inline-search input,
.msg-inline-search input {
    width: 100%;
    box-sizing: border-box;
    height: var(--ctl-h, 32px);
    padding: 0 32px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--srf);
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    outline: 0;
}

.ui-inline-search input:focus,
.msg-inline-search input:focus {
    border-color: var(--accent);
}

/* ===== SERVER-BACKED SEARCH GROUP ===== */
/* The submit-style search control (a .form-control + an .input-group-btn "Search" button), as
   opposed to the filter-as-you-type .ui-inline-search above. Rounds the group's OUTER corners to
   8px so the input's left and the button's right read as one pill: the button already gets 8px from
   .btn, and this adds the matching 8px to the input's left corners (which .form-control otherwise
   leaves at the 4px default, making the group look dated and lopsided). Add this class to the
   .input-group that wraps the input + Search button. This is the reusable, feature-agnostic
   replacement for per-page id rules such as the former #ai-call-history-search block in
   style_new.css.
   NOTE: uses `:not(:last-child)` (the search input) rather than `:first-child`, because several
   filter/report forms place hidden `<input>`s (perPage/sort/switchName) INSIDE the input-group
   before the visible search field — with `:first-child` the rounding silently landed on the hidden
   input and the visible box stayed square (fax/message reports + event-history). `:not(:last-child)`
   targets the search field regardless of any hidden inputs preceding it (the button is last). */
.ui-search-group .form-control:not(:last-child) {
    /* !important: Bootstrap's `.input-group .form-control:not(:first-child):not(:last-child)`
       (specificity 0,4,0) forces border-radius:0 on a search field that has a hidden input before it
       and the button after it — higher than this rule's selector, so it wins without !important. */
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
    border-color: #d3d7de;
}

/* Pull the Search button flush to the group's right edge AND round its outer corners. The group is a
   Bootstrap inline-table pinned to a fixed width (e.g. 300px); its auto table layout hands the leftover
   width to the button cell, so the (left-aligned) button stopped ~7px short of the group edge — and thus
   short of the export link / table right edge below. (Bootstrap's `width: 1%` on the cell is only a table
   minimum here and doesn't stop the over-allocation; neither does `width: 0`.) Make the button fill its
   cell instead: width 100% plus the 1px that compensates its -1px border-weld margin, so the button's
   right edge meets the group edge while the input↔button border weld is preserved. */
.ui-search-group .input-group-btn:last-child > .btn {
    width: calc(100% + 1px);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* typeahead.js autosuggest on the search field. Typeahead wraps the input in an inline-block
   span.twitter-typeahead (forced to width:100% !important by style_new.css) and stacks an absolute
   .tt-hint clone under it. Inside the Bootstrap inline-table group that span stopped being the
   field cell, so it claimed the full row and the Search button cell overflowed ON TOP of the input
   (VF-5168 QA #43 - the admin-assignment modals). Make the wrapper the group's stretching table cell
   again; the input and its hint fill it, and the button cell keeps its natural width. */
.ui-search-group > .twitter-typeahead {
    display: table-cell !important;
    width: 100% !important;
    vertical-align: middle;
}

.ui-search-group > .twitter-typeahead > .form-control {
    float: none;
    width: 100%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* The inline completion (.tt-hint) is a clone of the field and inherited its ink colour, so the
   suggested remainder read as typed text. Mute it to the placeholder ink. !important: the modal
   field recast colours every .modal-body .form-control at higher specificity. */
.ui-search-group > .twitter-typeahead > .tt-hint {
    color: var(--ink-3) !important;
}

/* ===== CAPTCHA ROW ===== */
/* VF-5168: the "prove you're human" challenge image stacked directly ABOVE its 4-char input, both
   flush-left with the modal's field column. This replaces ~19 copy-pasted captcha blocks that wrapped
   the <img> and <input> in side-by-side col-md-* cells and carried an inline
   `padding-left: 30px; margin-top: -10px;` hack on the image cell — obsolete since modals.css flattens
   modal .form-group > div[class*="col-"] to full-width. The image and input are DIRECT children of
   .captcha-row (no col-* wrappers), so that flatten rule never touches them and the pair aligns with
   the label-above fields around it. Feature-agnostic: consumed by the delete-confirmation modals
   (#imgElem / #captchaValue) and the share-via-email modals (#captcha-image / #captcha-value). */
.captcha-row img {
    display: block;
    margin-bottom: 10px;
}

/* ===== MODALS (scoped, prefixed with message- in markup) ===== VF-4845 stage 2 — shared chrome per the "Modal Redesign Spec" handoff: scrim/surface/radius/ shadow tokens, panel widths S/M/L (.slim 440 / default 540 / .wide 720), 160ms fade + scale entrance. Every dialog is top-anchored at the same offset — confirms included, so a confirm stacked over a list modal lines up with the panel behind it instead of floating mid-screen. Confirms/detail cards carry .confirm-card, which is a marker only (it drops the ✕ on phone, where Cancel is the exit). */ .message-page .ui-modal-backdrop, .ui-modal-backdrop,
/* ===== MODALS (scoped, prefixed with message- in markup) ===== VF-4845 stage 2 — shared chrome per the "Modal Redesign Spec" handoff: scrim/surface/radius/ shadow tokens, panel widths S/M/L (.slim 440 / default 540 / .wide 720), 160ms fade + scale entrance. Every dialog is top-anchored at the same offset — confirms included, so a confirm stacked over a list modal lines up with the panel behind it instead of floating mid-screen. Confirms/detail cards carry .confirm-card, which is a marker only (it drops the ✕ on phone, where Cancel is the exit). */ .message-page .message-modal-backdrop, .message-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    z-index: 1050;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(48px, 9vh, 88px) 20px 20px;
}

.ui-modal-backdrop.open,
.message-modal-backdrop.open {
    display: flex;
}

@keyframes ui-modal-panel-in  {
    from {
        opacity: 0;
        transform: scale(.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ui-modal-backdrop .ui-modal,
.message-modal-backdrop .message-modal {
    background: var(--srf);
    border-radius: var(--r-panel);
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-1);
    font-family: var(--font);
}

.ui-modal-backdrop.open .ui-modal,
.message-modal-backdrop.open .message-modal {
    animation: ui-modal-panel-in 160ms cubic-bezier(.2, .8, .2, 1);
}

.ui-modal-backdrop .ui-modal.slim,
.message-modal-backdrop .message-modal.slim {
    max-width: 440px;
}

.ui-modal-backdrop .ui-modal.wide,
.message-modal-backdrop .message-modal.wide {
    max-width: 720px;
}

.ui-modal-backdrop .ui-modal.xl,
.message-modal-backdrop .message-modal.xl {
    max-width: 960px;
}

/* Media viewers (PDF) sit on the deeper media scrim. */ .ui-modal-backdrop.media,
/* Media viewers (PDF) sit on the deeper media scrim. */ .message-modal-backdrop.media {
    background: var(--scrim-media);
}

/* ── VF-4845 stage 5: stacked child modals (Add Contact / Import / Block a number) ── The parent modal stays open underneath (its panel is made inert by messageModalStackOpen); the child rides a lighter scrim so the parent reads as "waiting behind". */ .ui-modal-backdrop.stacked,
/* ── VF-4845 stage 5: stacked child modals (Add Contact / Import / Block a number) ── The parent modal stays open underneath (its panel is made inert by messageModalStackOpen); the child rides a lighter scrim so the parent reads as "waiting behind". */ .message-modal-backdrop.stacked {
    background: rgba(16, 18, 22, .35);
    z-index: 1060;
}

/* Back chevron in a child modal's head — PHONE ONLY (shown by messages-mobile.css while the modal is stacked), where a leading chevron is the conventional way back to the parent and the ✕ steps aside for it. On a pointer layout it would be a third control doing what ✕ and Cancel already do, so it stays hidden. */ .ui-modal-backdrop .ui-modal-back,
/* Back chevron in a child modal's head — PHONE ONLY (shown by messages-mobile.css while the modal is stacked), where a leading chevron is the conventional way back to the parent and the ✕ steps aside for it. On a pointer layout it would be a third control doing what ✕ and Cancel already do, so it stays hidden. */ .message-modal-backdrop .message-modal-back {
    display: none;
    width: 32px;
    height: 32px;
    flex: none;
    margin-right: 4px;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ui-modal-backdrop .ui-modal-back:hover,
.message-modal-backdrop .message-modal-back:hover {
    background: var(--srf-3);
    color: var(--ink);
}

.ui-modal-backdrop .ui-list-row.ui-row-flash,
.message-modal-backdrop .message-list-row.row-flash {
    animation: msg-row-flash 1.5s ease-out;
}

/* ── List-modal action toolbar ── Actions for a collection rendered in a modal sit at the top of the BODY: the head carries the title and close only, the footer carries dialog commitment only (design-system style guide, Buttons). Shared by the Contacts, Blocked Numbers and Templates modals. */ .ui-modal-backdrop .ui-modal-toolbar,
/* ── List-modal action toolbar ── Actions for a collection rendered in a modal sit at the top of the BODY: the head carries the title and close only, the footer carries dialog commitment only (design-system style guide, Buttons). Shared by the Contacts, Blocked Numbers and Templates modals. */ .message-modal-backdrop .message-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

/* Toolbar actions lead with an icon (Block a number, New template), so the button is a flex row
   with a gap rather than relying on a space between two inline children. */
.ui-modal-backdrop .ui-modal-toolbar .btn,
.message-modal-backdrop .message-modal-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ui-modal-backdrop .ui-modal-head h3,
.message-modal-backdrop .message-modal-head h3 {
    flex: 1;
    min-width: 0;
    /* Defensive: a title with no break opportunity must wrap inside the head instead of pushing
       the close button out of the panel (VF-4971 QA item 05). Inert for normal i18n titles. */
    overflow-wrap: anywhere;
}

.ui-modal-backdrop .ui-modal-head,
.message-modal-backdrop .message-modal-head {
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ui-modal-backdrop .ui-modal-head h3,
.message-modal-backdrop .message-modal-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

/* Modal subtitle = one line of scope-setting sentence-case body type. It used to render as uppercased mono, which the design system reserves for 2-word classification micro-labels — these subtitles are full sentences ("Rename this conversation and manage its participants"), and uppercasing a sentence costs legibility for nothing (design-system style guide, Typography). */ .ui-modal-backdrop .ui-modal-head h3 small,
/* Modal subtitle = one line of scope-setting sentence-case body type. It used to render as uppercased mono, which the design system reserves for 2-word classification micro-labels — these subtitles are full sentences ("Rename this conversation and manage its participants"), and uppercasing a sentence costs legibility for nothing (design-system style guide, Typography). */ .message-modal-backdrop .message-modal-head h3 small {
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 500;
    display: block;
    margin-top: 4px;
}

/* Button around a stroked SVG glyph. It used to render the &times; CHARACTER, which was the one icon in this family that was not an inline SVG: a text glyph carries far less ink than its font-size suggests, so it read faint next to the 16px title however large the font-size went. Sizes are 36/20 rather than the design handoff's 32/16 — a deliberate deviation, asked for twice in VF-4845 QA after seeing the spec size in place. Mobile takes the same glyph in a 44px tap target (messages-mobile.css). */ .ui-modal-backdrop .ui-modal-close,
/* Button around a stroked SVG glyph. It used to render the &times; CHARACTER, which was the one icon in this family that was not an inline SVG: a text glyph carries far less ink than its font-size suggests, so it read faint next to the 16px title however large the font-size went. Sizes are 36/20 rather than the design handoff's 32/16 — a deliberate deviation, asked for twice in VF-4845 QA after seeing the spec size in place. Mobile takes the same glyph in a 44px tap target (messages-mobile.css). */ .message-modal-backdrop .message-modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--r-ctl);
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ink-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: none;
}

.ui-modal-backdrop .ui-modal-close .pi,
.message-modal-backdrop .message-modal-close .pi {
    --pi-size: 20px;
}

/* Consumers outside the icon-pack layer still nest a bare <svg> here — keep both spellings. */
.ui-modal-backdrop .ui-modal-close > svg,
.message-modal-backdrop .message-modal-close > svg {
    width: 20px;
    height: 20px;
}

.ui-modal-backdrop .ui-modal-close:hover,
.message-modal-backdrop .message-modal-close:hover {
    background: var(--srf-3);
    color: var(--ink);
}

.ui-modal-backdrop .ui-modal-body,
.message-modal-backdrop .message-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
    min-height: 0;
}

.ui-modal-backdrop .ui-modal-foot,
.message-modal-backdrop .message-modal-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--srf-2);
    border-radius: 0 0 var(--r-panel) var(--r-panel);
}

/* Footer/head buttons: map the portal's .btn classes onto the handoff hierarchy — btn-success = primary (accent, follows the schema probe), btn-default = secondary. Scoped to the modals so global Bootstrap/schema button styling is untouched elsewhere. */ .ui-modal-backdrop .btn,
/* Footer/head buttons: map the portal's .btn classes onto the handoff hierarchy — btn-success = primary (accent, follows the schema probe), btn-default = secondary. Scoped to the modals so global Bootstrap/schema button styling is untouched elsewhere. */ .message-modal-backdrop .btn {
    min-height: var(--ctl-h, 32px);
    padding: 6px 16px;
    border-radius: var(--r-ctl);
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

/* Footer order is a VISUAL contract placed by CSS — same DOM convention as the Bootstrap family
   (modals.css): primary/commit FIRST, the dismiss (.btn-default) LAST, additional actions marked
   .pull-left. The flex order below renders [.pull-left …left] [Cancel] [Primary →far right].
   Never reorder the DOM to match the visuals — that double-flips. Foot buttons follow the
   portal-wide 32px control height (controls.css --ctl-h); the former 40px bump is gone. */
.ui-modal-backdrop .ui-modal-foot .btn-default,
.message-modal-backdrop .message-modal-foot .btn-default {
    order: -1;
}

.ui-modal-backdrop .ui-modal-foot .pull-left,
.message-modal-backdrop .message-modal-foot .pull-left {
    order: -2;
    margin-right: auto;
}

.ui-modal-backdrop .btn.btn-success,
.message-modal-backdrop .btn.btn-success {
    background: var(--acc);
    border: 1px solid var(--acc);
    color: var(--on-acc);
}

.ui-modal-backdrop .btn.btn-success:hover,
.message-modal-backdrop .btn.btn-success:hover {
    background: var(--acc-hi);
    border-color: var(--acc-hi);
}

.ui-modal-backdrop .btn.btn-default,
.message-modal-backdrop .btn.btn-default {
    background: var(--srf);
    border: 1px solid var(--line-d);
    color: var(--ink-2);
}

.ui-modal-backdrop .btn.btn-default:hover,
.message-modal-backdrop .btn.btn-default:hover {
    background: var(--srf-3);
    color: var(--ink);
}

.ui-modal-backdrop button:disabled,
.message-modal-backdrop button:disabled {
    opacity: .45;
    pointer-events: none;
}

/* Keyboard focus ring for every control in the feature, page level and modal level alike. It was previously scoped to .ui-modal-backdrop, which left the page's icon-only controls (composer tools, conversation-head actions, lightbox) with a hover tint and nothing at all for keyboard users — the exact case WCAG 2.2 §2.4.13 is about. */ .ui-modal-backdrop :is(button, a.btn):focus-visible, .message-page :is(button, a.btn):focus-visible, .msg-lightbox button:focus-visible,
/* Keyboard focus ring for every control in the feature, page level and modal level alike. It was previously scoped to .message-modal-backdrop, which left the page's icon-only controls (composer tools, conversation-head actions, lightbox) with a hover tint and nothing at all for keyboard users — the exact case WCAG 2.2 §2.4.13 is about. */ .message-modal-backdrop :is(button, a.btn):focus-visible, .message-page :is(button, a.btn):focus-visible, .msg-lightbox button:focus-visible {
    outline: 0;
    box-shadow: var(--focus);
}

.ui-modal-backdrop .ui-field,
.message-modal-backdrop .message-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.ui-modal-backdrop .ui-field label,
.message-modal-backdrop .message-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
}

.ui-modal-backdrop .ui-field input, .ui-modal-backdrop .ui-field select, .ui-modal-backdrop .ui-field textarea,
.message-modal-backdrop .message-field input, .message-modal-backdrop .message-field select, .message-modal-backdrop .message-field textarea {
    font-family: inherit;
    font-size: 13.5px;
    color: var(--ink);
    height: var(--ctl-h, 32px);
    padding: 0 12px;
    border: 1px solid var(--line-d);
    border-radius: var(--r-ctl);
    background: var(--srf);
    outline: 0;
    width: 100%;
}

.ui-modal-backdrop .ui-field input::placeholder, .ui-modal-backdrop .ui-field textarea::placeholder,
.message-modal-backdrop .message-field input::placeholder, .message-modal-backdrop .message-field textarea::placeholder {
    color: var(--ink-3);
}

.ui-modal-backdrop .ui-field input:focus, .ui-modal-backdrop .ui-field select:focus, .ui-modal-backdrop .ui-field textarea:focus,
.message-modal-backdrop .message-field input:focus, .message-modal-backdrop .message-field select:focus, .message-modal-backdrop .message-field textarea:focus {
    border-color: var(--acc);
    box-shadow: var(--focus);
}

.ui-modal-backdrop .ui-field textarea,
.message-modal-backdrop .message-field textarea {
    height: auto;
    resize: vertical;
    min-height: 80px;
    padding: 8px 12px;
}

/* Read-only field (the pre-filled contact number): muted surface so it reads as "shown, not editable". Deliberately NOT [disabled] — the value stays selectable, copyable and submitted, and a greyed-out control reads as broken rather than intentional. Tokens only, so dark mode comes from the dark.css remap. */ .ui-modal-backdrop .ui-field input[readonly],
/* Read-only field (the pre-filled contact number): muted surface so it reads as "shown, not editable". Deliberately NOT [disabled] — the value stays selectable, copyable and submitted, and a greyed-out control reads as broken rather than intentional. Tokens only, so dark mode comes from the dark.css remap. */ .message-modal-backdrop .message-field input[readonly] {
    background: var(--srf-2);
    color: var(--ink-3);
    cursor: default;
}

.ui-modal-backdrop .ui-field input[readonly]:focus,
.message-modal-backdrop .message-field input[readonly]:focus {
    border-color: var(--line-d);
    box-shadow: none;
}

.ui-modal-backdrop .ui-icon-btn,
.message-modal-backdrop .row-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--r-ctl);
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    padding: 0;
}

.ui-modal-backdrop .ui-icon-btn:hover,
.message-modal-backdrop .row-icon-btn:hover {
    background: var(--srf-3);
    color: var(--ink);
}

/* Destructive row action (contact delete): neutral at rest, danger tint on hover AND focus — keyboard users never hover, so focus has to carry the same signal (design-system style guide, Iconography). */ .ui-modal-backdrop .ui-icon-btn.danger:hover, .ui-modal-backdrop .ui-icon-btn.danger:focus-visible,
/* Destructive row action (contact delete): neutral at rest, danger tint on hover AND focus — keyboard users never hover, so focus has to carry the same signal (design-system style guide, Iconography). */ .message-modal-backdrop .row-icon-btn.danger:hover, .message-modal-backdrop .row-icon-btn.danger:focus-visible {
    background: var(--dgr-tint);
    color: var(--dgr);
}

/* Same boxed 32x32 row-action button inside a Bootstrap-3 modal table cell. The shared
   `parts/dynamic-table-like-template :: remove-icon` renders `.ui-icon-btn danger` in the fax /
   message / monitored-trunk CRUD-list modals, but the rules above are scoped to `.ui-modal-backdrop`
   (the other modal family), so mirror them for `.modal` — one delete-icon look across both families
   (VF-5168; the copy icon stays bare, per the widget conventions). Feature-agnostic: no ids. */
.modal .modal-dialog .modal-body .ui-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--r-ctl);
    border: 0;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-3);
    padding: 0;
    text-decoration: none;
}

.modal .modal-dialog .modal-body .ui-icon-btn:hover {
    background: var(--srf-3);
    color: var(--ink);
}

.modal .modal-dialog .modal-body .ui-icon-btn.danger:hover,
.modal .modal-dialog .modal-body .ui-icon-btn.danger:focus-visible {
    background: var(--dgr-tint);
    color: var(--dgr);
}

.ui-modal-backdrop .ui-btn-danger,
.message-modal-backdrop .message-btn-red {
    background: var(--dgr);
    color: #fff;
    border: 0;
    height: var(--ctl-h, 32px);
    padding: 0 16px;
    border-radius: var(--r-ctl);
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ui-modal-backdrop .ui-btn-danger:hover,
.message-modal-backdrop .message-btn-red:hover {
    background: var(--dgr-hi);
}

/* Secondary button = the standard 32px control step (controls.css --ctl-h), matching .btn. The dense list-row .compact modifier below keeps its smaller type; the height itself is one portal-wide step (design-system style guide, Buttons). */ .ui-modal-backdrop .ui-btn-secondary,
/* Secondary button = the standard 32px control step (controls.css --ctl-h), matching .btn. The dense list-row .compact modifier below keeps its smaller type; the height itself is one portal-wide step (design-system style guide, Buttons). */ .message-modal-backdrop .message-btn-secondary {
    background: var(--srf);
    color: var(--ink-2);
    border: 1px solid var(--line-d);
    height: var(--ctl-h, 32px);
    padding: 0 16px;
    border-radius: var(--r-ctl);
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Dense list-row step — pairs with the 32x32 .ui-icon-btn glyphs beside it. */ .ui-modal-backdrop .ui-btn-secondary.compact,
/* Dense list-row step — pairs with the 32x32 .row-icon-btn glyphs beside it. */ .message-modal-backdrop .message-btn-secondary.compact {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 12.5px;
}

.ui-modal-backdrop .ui-btn-secondary:hover,
.message-modal-backdrop .message-btn-secondary:hover {
    background: var(--srf-3);
    color: var(--ink);
}

.ui-modal-backdrop .ui-list-row,
.message-modal-backdrop .message-list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-row);
    background: var(--srf);
    margin-bottom: 6px;
}

.ui-modal-backdrop .ui-list-row:hover,
.message-modal-backdrop .message-list-row:hover {
    background: var(--srf-2);
}

.ui-modal-backdrop .ui-list-row .av,
.message-modal-backdrop .message-list-row .av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--line-2);
    display: grid;
    place-items: center;
    font-weight: 600;
    color: var(--ink-2);
    font-size: 12px;
    flex-shrink: 0;
}

.ui-modal-backdrop .ui-list-row .body,
.message-modal-backdrop .message-list-row .body {
    flex: 1;
    min-width: 0;
}

/* A long contact name must not push the row actions off the card — it truncates with an ellipsis instead (the full value stays available as the row's title attribute). */ .ui-modal-backdrop .ui-list-row .body strong,
/* A long contact name must not push the row actions off the card — it truncates with an ellipsis instead (the full value stays available as the row's title attribute). */ .message-modal-backdrop .message-list-row .body strong {
    display: block;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Same containment as the name strong above: an unbroken value (an E.164 number, an import
   source) has no wrap opportunity, so without the ellipsis trio it paints out from under .body
   and behind the row actions (VF-4971 QA item 04). */ .ui-modal-backdrop .ui-list-row .body span,
.message-modal-backdrop .message-list-row .body span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Blocked-number meta: reason and date each own a line, and a long reason truncates rather than wrapping into a block of text. */ .ui-modal-backdrop .ui-list-row .body .blocked-reason, .ui-modal-backdrop .ui-list-row .body .blocked-date,
/* Blocked-number meta: reason and date each own a line, and a long reason truncates rather than wrapping into a block of text. */ .message-modal-backdrop .message-list-row .body .blocked-reason, .message-modal-backdrop .message-list-row .body .blocked-date {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-modal-backdrop .ui-list-row .body .blocked-date,
.message-modal-backdrop .message-list-row .body .blocked-date {
    color: var(--ink-4);
}

.ui-modal-backdrop .ui-list-row .row-actions,
.message-modal-backdrop .message-list-row .row-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.ui-field-error,
.msg-field-error {
    color: var(--dgr);
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
}

/* ── In-field character counter, used by every length-capped field in these modals ── Scoped to the backdrop rather than to .ui-field so the notification-settings add-row (a flex row, not a .ui-field) can carry one too. */ .ui-modal-backdrop .ui-field-wrap, .message-page .ui-field-wrap,
/* ── In-field character counter, used by every length-capped field in these modals ── Scoped to the backdrop rather than to .message-field so the notification-settings add-row (a flex row, not a .message-field) can carry one too. */ .message-modal-backdrop .field-wrap, .message-page .field-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.ui-modal-backdrop .ui-field-wrap input, .ui-modal-backdrop .ui-field-wrap textarea, .message-page .ui-field-wrap input,
.message-modal-backdrop .field-wrap input, .message-modal-backdrop .field-wrap textarea, .message-page .field-wrap input {
    padding-right: 64px;
    width: 100%;
    box-sizing: border-box;
}

.ui-modal-backdrop .ui-field-counter, .message-page .ui-field-counter,
.message-modal-backdrop .field-counter, .message-page .field-counter {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ink-3);
    pointer-events: none;
}

/* A read-only field cannot be typed into, so its counter would only be noise. */ .ui-modal-backdrop .ui-field-wrap input[readonly] ~ .ui-field-counter, .message-page .ui-field-wrap input[readonly] ~ .ui-field-counter,
/* A read-only field cannot be typed into, so its counter would only be noise. */ .message-modal-backdrop .field-wrap input[readonly] ~ .field-counter, .message-page .field-wrap input[readonly] ~ .field-counter {
    display: none;
}

/* Textarea variant: the counter sits under the field instead of inside it — a textarea's vertical centre is nowhere near its last line. */ .ui-modal-backdrop .ui-field-counter.static, .message-page .ui-field-counter.static,
/* Textarea variant: the counter sits under the field instead of inside it — a textarea's vertical centre is nowhere near its last line. */ .message-modal-backdrop .field-counter.static, .message-page .field-counter.static {
    position: static;
    display: block;
    transform: none;
    text-align: right;
    margin-top: 4px;
}

.ui-modal-backdrop .ui-field-counter.over, .message-page .ui-field-counter.over,
.message-modal-backdrop .field-counter.over, .message-page .field-counter.over {
    color: var(--dgr);
}

/* ── Dropzone — DESIGN.md › Upload ({component.dropzone}); recast 2026-10-21 from the VF-4845
   CSV-dropzone leftover onto the spec: --srf-2 zone, 1.5px dashed --line-d, r10, padding 20×16,
   min-height 112, centred column with gap 4. Hover = --ink-3 border only; DRAGOVER is the accent
   state (solid --acc on --acc-tint); reject/error are danger. The legacy twin (the
   drag-and-drop-files fragment) is painted to the same contract in drag-and-drop-files.css. ── */
.ui-dropzone,
.msg-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 112px;
    border: 1.5px dashed var(--line-d);
    border-radius: var(--r-row);
    padding: 20px 16px;
    background: var(--srf-2);
    text-align: center;
    cursor: pointer;
    color: var(--ink-2);
    font-size: 12.5px;
}

.ui-dropzone:hover,
.msg-dropzone:hover {
    border-color: var(--ink-3);
}

/* dragover = the active drop target: the accent marks it like a focused field (spec {component.dropzone-dragover}) */
.ui-dropzone.dragover, .ui-dropzone.drag-n-drop-now,
.msg-dropzone.dragover, .msg-dropzone.drag-n-drop-now {
    border-style: solid;
    border-color: var(--acc);
    background: var(--acc-tint);
}

/* a dragged type the zone can't take ({component.dropzone-reject}) */
.ui-dropzone.is-reject,
.msg-dropzone.is-reject {
    border-style: solid;
    border-color: var(--dgr);
    background: var(--dgr-tint);
    color: var(--dgr);
}

/* required-and-empty on submit ({component.dropzone-error}) */
.ui-dropzone.is-error,
.msg-dropzone.is-error {
    border-color: var(--dgr);
}

.ui-dropzone.is-disabled,
.msg-dropzone.is-disabled {
    opacity: .45;
    pointer-events: none;
}

/* Bare 22px glyph in --ink-3 — the spec zone has no disc behind the icon. */
.ui-dropzone .dz-icon,
.msg-dropzone .dz-icon {
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-3);
    display: grid;
    place-items: center;
}

.ui-dropzone .dz-icon .pi,
.msg-dropzone .dz-icon .pi {
    --pi-size: 22px;
}

.ui-dropzone .dz-icon > svg,
.msg-dropzone .dz-icon > svg {
    width: 22px;
    height: 22px;
}

/* Line 1 ("Drag files here or browse files") is body-strong ink, like the legacy fragment's title line. The glyph
   above it is icon(name='upload-file'). */
.ui-dropzone .dz-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

/* "browse files" is a text-link ({colors.link}): no underline at rest, accent-hover + underline on hover, --focus for keyboard. */
.ui-dropzone .dz-link,
.msg-dropzone .dz-link {
    color: var(--crumb-link, var(--acc-hi));
    font-weight: 600;
    text-decoration: none;
}

.ui-dropzone .dz-link:hover,
.msg-dropzone .dz-link:hover {
    color: var(--acc-hi);
    text-decoration: underline;
}

.ui-dropzone .dz-link:focus-visible,
.msg-dropzone .dz-link:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: 4px;
}

/* Desktop shows the drag copy; the phone layout swaps it for a single tap target. */ .ui-dropzone .dz-tap,
/* Desktop shows the drag copy; the phone layout swaps it for a single tap target. */ .msg-dropzone .dz-tap {
    display: none;
}

.ui-dropzone .dz-file,
.msg-dropzone .dz-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
}

.ui-dropzone .dz-file .dz-clear,
.msg-dropzone .dz-file .dz-clear {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: var(--srf-3);
    color: var(--ink-2);
    cursor: pointer;
    line-height: 1;
}

/* ── Dropzone file rows — DESIGN.md › Upload ({component.dropzone-file-row}): 44px bordered rows
   BELOW the zone, gap 8. Anatomy: 18px kind glyph · name (truncates, tooltip carries it) · size
   (num-caption, tabular) · 28px bare danger remove. States: uploading = 2px NEUTRAL --busy-fill
   bar on --busy-track along the bottom (never the accent) + tabular % in place of the size;
   done = 16px --ok check before the ×; error = --dgr border + reason + Retry link (blocks
   submit). Markup contract (JS-rendered):
     <div class="dz-rows">
       <div class="dz-row [is-uploading|is-done|is-error]" style="--dz-progress:62%">
         <span class="dz-row-icon">description</span>
         <span class="dz-row-name" title="…">contract-2026.pdf</span>
         <span class="dz-row-size">2.4 MB</span>              ← or "62%" / the error reason
         <span class="dz-row-check">check_circle</span>        ← is-done only
         <a class="dz-row-retry">Retry</a>                     ← is-error only (i18n)
         <button class="dz-row-remove" aria-label="…">close</button>
         <span class="dz-row-bar"><i></i></span>               ← is-uploading only
       </div>
     </div> ── */
.dz-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    text-align: left;
}

.dz-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 6px 0 12px;
    background: var(--srf);
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    color: var(--ink);
    font-size: 13.5px;
    overflow: hidden;
}

.dz-row-icon,
.dz-row-check {
    font-family: 'Material Symbols Outlined Fill';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    flex: 0 0 auto;
    -webkit-font-smoothing: antialiased;
}

.dz-row-icon {
    font-size: 18px;
    color: var(--ink-3);
}

.dz-row-name {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dz-row-size {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 11px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.dz-row-check {
    font-size: 16px;
    color: var(--ok);
}

.dz-row-remove {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--ink-3);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-family: 'Material Symbols Outlined Fill';
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.dz-row-remove:hover,
.dz-row-remove:focus-visible {
    background: var(--dgr-tint);
    color: var(--dgr);
    outline: none;
}

/* Uploading: determinate neutral bar along the row's bottom edge; width via --dz-progress on the row. */
.dz-row-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--busy-track, var(--line-d));
}

.dz-row-bar > i {
    display: block;
    height: 100%;
    width: var(--dz-progress, 0%);
    background: var(--busy-fill, var(--ink-2));
    transition: width 160ms ease;
}

.dz-row.is-error {
    border-color: var(--dgr);
}

.dz-row.is-error .dz-row-size {
    font-size: 12.5px;
    color: var(--dgr);
}

.dz-row-retry {
    flex: 0 0 auto;
    color: var(--crumb-link, var(--acc-hi));
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.dz-row-retry:hover {
    color: var(--acc-hi);
    text-decoration: underline;
}

@media (max-width: 767px) {
    .dz-row {
        min-height: 52px;
    }

    .dz-row-remove {
        width: 44px;
        height: 44px;
    }
}

/* ── Numeric quantity/limit input — DESIGN.md › Inputs ({component.number-input}), 2026-10-21.
   Right-aligned tabular figures on the standard 32px/8px shell (controls.css); width 96, 88 in
   dense table cells. Behavior (↑/↓ step ×1 · Shift ×10 · PageUp/PageDown ×100 · wheel inert ·
   digits only · min/max clamp) binds to this class in static/js/number-spinner.js. Replaces the
   retired −/+ stepper; the unlimited state is disabled + placeholder "Unlimited", never "∞". ── */
input.ui-num {
    display: inline-block;
    width: 96px;
    padding: 0 10px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

input.ui-num.dense,
td input.ui-num {
    width: 88px;
}

/* ── VF-4845 leftovers: shared switch (Browser Notifications) ── Replaces bootstrap-toggle: a 44x26 track whose knob travels on :checked. The native checkbox stays in the DOM (visually hidden) so existing change handlers keep firing. */ .ui-switch,
/* ── VF-4845 leftovers: shared switch (Browser Notifications) ── Replaces bootstrap-toggle: a 44x26 track whose knob travels on :checked. The native checkbox stays in the DOM (visually hidden) so existing change handlers keep firing. */ .msg-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    flex: none;
}

.ui-switch input,
.msg-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.ui-switch .ui-switch-track,
.msg-switch .msg-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--line-d);
    transition: background 160ms;
    pointer-events: none;
}

.ui-switch .ui-switch-track::after,
.msg-switch .msg-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 18, 22, .25);
    transition: transform 160ms;
}

.ui-switch input:checked + .ui-switch-track,
.msg-switch input:checked + .msg-switch-track {
    background: var(--acc);
}

.ui-switch input:checked + .ui-switch-track::after,
.msg-switch input:checked + .msg-switch-track::after {
    transform: translateX(18px);
}

.ui-switch input:disabled + .ui-switch-track,
.msg-switch input:disabled + .msg-switch-track {
    opacity: .45;
}

.ui-switch input:focus-visible + .ui-switch-track,
.msg-switch input:focus-visible + .msg-switch-track {
    box-shadow: var(--focus);
}

/* Compact size modifier — matches the Dark Mode profile-menu pill (.pm-switch, 40x22, 18px knob).
   Use for instant-save toggles that sit inside dense table rows so the switch stays proportional to the text. */
.ui-switch.ui-switch--sm {
    width: 40px;
    height: 22px;
}

.ui-switch.ui-switch--sm .ui-switch-track::after {
    width: 18px;
    height: 18px;
}

.ui-switch.ui-switch--sm input:checked + .ui-switch-track::after {
    transform: translateX(18px);
}

/* ── VF-5204: destructive-confirm icon chip ──
   A 40x40 tinted disc carrying the confirm's own severity glyph, sitting at the head of a
   .confirm-card panel ahead of the title. It exists because a destructive confirm has to be
   recognisable BEFORE the title is read — the ui- family's other modals are neutral dialogs and
   carry no chip, so the chip is what marks this one as the irreversible kind. Danger is the only
   tone defined: a chip on a neutral dialog would be decoration, and decoration that looks like a
   severity signal is worse than none. */
.ui-modal-backdrop .ui-confirm-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--dgr-tint);
    color: var(--dgr);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin-right: 12px;
    --pi-size: 19px;
}

/* ── VF-5204: staged toggle field (label + bare pill + helper) ──
   The boolean that ARMS a heavier outcome inside a dialog that commits on its footer button —
   "Unassign before deletion" on the DID delete confirms. Deliberately NOT .ui-switch: a knob
   animates the flip as if it already took effect, which is a lie on a surface where nothing
   happens until Delete is pressed. The pill instead reads as a staged setting, the way a filter
   chip does. Instant-save toggles (a table row, a settings panel) keep .ui-switch.

   The native checkbox stays in the DOM, visually hidden, so change handlers and form submission
   keep working; the <button role="switch"> is the visible control and owns the a11y state. */
.ui-modal-backdrop .ui-toggle-field {
    display: block;
    margin-top: 14px;
}

/* The control that changes the sentence sits directly above the sentence, so the consequence
   callout is always the toggle's next sibling and owns the gap between the two. */
.ui-modal-backdrop .ui-toggle-field + .ui-callout {
    margin-top: 12px;
    margin-bottom: 0;
}

.ui-modal-backdrop .ui-toggle-field > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink-2);
    margin: 0 0 6px;
}

.ui-modal-backdrop .ui-toggle-field .ui-toggle-help {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink-3);
    margin-top: 6px;
}

/* Fully rounded is load-bearing, not styling. At --r-ctl with this type an accent-filled pill is
   pixel-for-pixel the primary button, and a control that looks like the commit button inside a
   destructive confirm is a misclick waiting to happen. 999px is a shape no button in this family
   has. The uppercase state word is a 2-word classification micro-label, which is one of the two
   sanctioned uppercase slots (TEMPLATE-RULES.md, Typography). */
/* 32px control step (DESIGN.md: no 40px step), 48px on phones below. */
.ui-modal-backdrop .ui-toggle-pill {
    height: 32px;
    min-width: 56px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--srf-3);
    color: var(--ink-2);
    border: 1px solid var(--line-d);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background 160ms, color 160ms;
}

.ui-modal-backdrop .ui-toggle-pill:hover {
    background: var(--line-d);
}

/* ON ink is --on-acc-strong, not --on-acc: white on the accent is ~2.2:1, which a 10.5px state
   word cannot carry (WCAG 1.4.3 wants 4.5:1 at this size). */
.ui-modal-backdrop .ui-toggle-pill[aria-checked="true"] {
    background: var(--acc);
    color: var(--on-acc-strong);
    border-color: transparent;
}

.ui-modal-backdrop .ui-toggle-pill[aria-checked="true"]:hover {
    background: var(--acc-hi);
}

.ui-modal-backdrop .ui-toggle-pill:disabled {
    opacity: .45;
    cursor: default;
}

@media (max-width: 767px) {
    .ui-modal-backdrop .ui-toggle-pill {
        height: 48px;
    }
}


/* ── VF-5204: grouped list ──
   The standalone .ui-list-row above is a card: its own border, radius and 6px gap, which is right
   for the Contacts/Blocked-numbers modals where each row is an independent object. A confirm that
   lists "the things about to be deleted" reads instead as ONE block with hairline separators — the
   rows are a single selection, not a set of cards. This wrapper collapses the child rows into that
   block without forking .ui-list-row itself. */
.ui-modal-backdrop .ui-list-group {
    border: 1px solid var(--line);
    border-radius: var(--r-row);
    overflow: hidden;
}

.ui-modal-backdrop .ui-list-group .ui-list-row {
    border: 0;
    border-bottom: 1px solid var(--srf-3);
    border-radius: 0;
    margin-bottom: 0;
}

.ui-modal-backdrop .ui-list-group .ui-list-row:last-child {
    border-bottom: 0;
}

/* Phone numbers are compared down the column, so they get tabular figures — proportional digits
   make two numbers of equal length look ragged against each other. */
.ui-modal-backdrop .ui-list-group .ui-list-row .body strong {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* The row meta here is a sentence ("Assigned to …"), not the machine value the base .body span rule
   is tuned for, so it drops the mono face and takes body type. */
.ui-modal-backdrop .ui-list-group .ui-list-row .body span {
    font-family: var(--font);
    font-size: 11.5px;
    color: var(--ink-3);
}

/* Classification micro-label under a modal title ("3 NUMBERS SELECTED") — one of the two sanctioned
   uppercase slots (TEMPLATE-RULES.md, Typography). Distinct from the sentence-case h3 small subtitle
   above, which is why it overrides it by name rather than replacing it. */
.ui-modal-backdrop .ui-modal-head h3 small.ui-modal-overline {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* Optional lead-in above the consequence sentence, used when the ON state can name a count
   ("2 of these numbers are assigned"). */
.ui-modal-backdrop .ui-callout .ui-callout-title {
    display: block;
    font-weight: 600;
    color: var(--dgr-ink, var(--ink));
    margin-bottom: 2px;
}


/* ── VF-5204: neutral callout ──
   The base .ui-callout carries the brand accent, which marks it as "this block matters". A statement of
   FORMAT ("numbers must look like this") is reference material, not a signal, so it takes the plain
   surface step and the info glyph instead — reserving the accent for blocks that actually claim
   attention. */
.ui-modal-backdrop .ui-callout.neutral {
    background: var(--srf-3);
    border-left-color: var(--line-d);
}

.ui-modal-backdrop .ui-callout.neutral > .pi,
.ui-modal-backdrop .ui-callout.neutral > svg {
    color: var(--ink-2);
}

/* ── VF-5204: a row of controls inside one .ui-field ──
   For fields that are a sequence rather than a single input — "start DID / to / end DID / add" — so the
   parts stay on one baseline and the text separators do not look like labels of their own. */
.ui-modal-backdrop .ui-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* The growing members are the inputs, or the .inp-cont wrappers around them — that wrapper is what
   showErrorValidation() hangs its .help-block on, so a field that can fail validation must keep it. */
.ui-modal-backdrop .ui-field-row > input,
.ui-modal-backdrop .ui-field-row > .inp-cont {
    flex: 1;
    min-width: 0;
}

/* Text that joins two controls ("to") and the filename beside a file picker: body copy, not a label. */
.ui-modal-backdrop .ui-field-row .ui-field-sep,
.ui-modal-backdrop .ui-field-row .ui-field-note {
    font-size: 12.5px;
    color: var(--ink-3);
    white-space: nowrap;
}

.ui-modal-backdrop .ui-field-row .ui-field-note {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Helper line under a field — the counterpart of .ui-toggle-help for plain inputs. */
.ui-modal-backdrop .ui-field-help {
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink-3);
}

/* Separates "what to delete" from "how to delete it": the inputs above collect numbers, the toggle below
   changes what happens to them. */
.ui-modal-backdrop .ui-toggle-field.ui-toggle-separated {
    border-top: 1px solid var(--line);
    padding-top: 16px;
    margin-top: 18px;
}

/* Closing aside under a modal body — where the per-item outcome can be found once the job runs. */
.ui-modal-backdrop .ui-modal-note {
    display: block;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ink-3);
    margin-top: 12px;
}


/* ── Inline filter toggle on a page toolbar ── the visible label text and its .ui-switch sit on one
   line, vertically centred to the 32px control height and aligned (vertical-align:middle) to an
   adjacent button. Fixes the switch dropping to the text baseline: a bare inline-block .ui-switch
   defaults to vertical-align:baseline, so placed next to text it sits visibly low. The <label>
   wraps the switch so the whole text is clickable. Reference: enterprise Departments page
   "Include Location Departments" filter. */
.ui-switch-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    margin-bottom: 0;
    font-weight: 400;
    vertical-align: middle;
    white-space: nowrap;
    cursor: pointer;
}

/* ── Label with trailing inline icon(s) ── a field label / caption followed by an info tooltip glyph
   (or a .pi icon, bare or inside a tooltip wrapper span): the icons centre on the text line. Inline,
   a glyphicon rides the text baseline plus the global `.glyphicon { top: 4px }` nudge and a .pi
   rides the baseline, so next to text one sits ~2px low and the other ~2px high. Not for labels that
   modals.css forces to display:block (`.modal … .form-group > label[class*="col-"]`). */
.ui-label-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ui-label-icons > .glyphicon {
    top: 0;
}

.ui-label-icons > span:not(.pi):not(.glyphicon) {
    display: inline-flex;
}

/* ── Confirm-dialog options (VF-5168, QA 2026-10-28 #12) — checkbox rows inside a bootbox confirm body
   built with lpConfirmCheckOption() (common-functions.js): one left-aligned column, so every box shares
   the same x; the option text sits inside the checkbox label, so clicking it toggles the box. */
.lp-confirm-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
}

.lp-confirm-option label.checkLabel {
    display: inline-flex;
    align-items: center;
    left: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    color: var(--ink);
}

.lp-confirm-option input.checkB + .label-text::before {
    margin-right: 8px;
}

/* ── "Create Another" add-dialog option (VF-5328) — the visible label + the .ui-switch sit on one
   line, vertically centred to the 32px control height. Replaces the legacy checkLabel/checkB
   checkbox used in every add/create dialog. In a modal footer, also tag the element `pull-left` so
   modals.css floats it to the far-left (order:-2; margin-right:auto) with the Cancel/primary pair
   kept on the right; on a full-page add form it floats inline with the Create/Cancel button row. */
.ui-create-another {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
}

/* Shared design-system radio (VF-5250; globalized). THE single source of truth for EVERY radio in the
   portal: applied by element selector so any <input type="radio"> adopts it automatically - no per-page
   CSS, no opt-in class. The legacy .ui-radio class is kept as an explicit alias for back-compat.
   Escape hatch: add class="no-ui-radio" to a radio that must stay a native/hidden control (e.g. the
   ACD-state badge pickers). Bootstrap data-toggle="buttons" toggle radios need no opt-out - they are
   already clip-hidden by a higher-specificity rule in bootstrap.css. Per the design-system spec: 20x20,
   2px border --line-d -> --ink-4 on hover -> --acc when on; the radio keeps the field fill and draws the
   --acc dot (the pill radius is the only shape difference from the checkbox). design --line-2 (control
   border #D3D7DE) == portal --line-d; --srf-field falls back to --srf. Colours are tokens, so it is
   dark-mode-safe and repaints per brand with no per-page override. */
input[type="radio"]:not(.no-ui-radio),
.ui-radio {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 20px; /* DESIGN.md component.radio 20px (matches this rule's own "20x20" comment; was 17px) */
    height: 20px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--line-d, #D3D7DE);
    border-radius: 999px;
    background: var(--srf-field, var(--srf, #fff));
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input[type="radio"]:not(.no-ui-radio):hover,
.ui-radio:hover {
    border-color: var(--ink-4, #B6BAC1);
}

input[type="radio"]:not(.no-ui-radio):checked,
.ui-radio:checked {
    border-color: var(--acc, #ED9F2B);
}

/* Filled dot centred by equal insets (integer px) so it renders crisp - a 10px dot inside the
   16px padding box (20px - 2x2px border), leaving a tidy 3px ring, Material-radio proportions. */
input[type="radio"]:not(.no-ui-radio):checked::after,
.ui-radio:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 999px;
    background: var(--acc, #ED9F2B);
}

input[type="radio"]:not(.no-ui-radio):focus-visible,
.ui-radio:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc, #ED9F2B) 35%, transparent);
}

input[type="radio"]:not(.no-ui-radio):disabled,
.ui-radio:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Static info callout for persistent explanatory copy (design-system Modals rule; VF-4845 design review Q7). The trio is deliberate: the tint marks the block's extent, the 3px left border gives a scan anchor, and the leading icon encodes the severity class so info and warning stay distinguishable without color (WCAG 1.4.1) — the icon, not the hue, is what carries that guarantee, which is why the bar can follow the brand. Hue is the schema accent via --acc/--acc-tint, which applyMessageBrandTokens() probes from the active schema, so the bar repaints per brand and needs no dark-mode override (--acc-tint is a color-mix over the modal surface). One callout per modal. */ .ui-modal-backdrop .ui-callout,
/* Static info callout for persistent explanatory copy (design-system Modals rule; VF-4845 design review Q7). The trio is deliberate: the tint marks the block's extent, the 3px left border gives a scan anchor, and the leading icon encodes the severity class so info and warning stay distinguishable without color (WCAG 1.4.1) — the icon, not the hue, is what carries that guarantee, which is why the bar can follow the brand. Hue is the schema accent via --acc/--acc-tint, which applyMessageBrandTokens() probes from the active schema, so the bar repaints per brand and needs no dark-mode override (--acc-tint is a color-mix over the modal surface). One callout per modal. */ .message-modal-backdrop .message-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--acc-tint);
    border: 0;
    border-left: 3px solid var(--acc);
    padding: 12px 14px;
    border-radius: var(--r-ctl);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-2);
    margin-bottom: 12px;
}

/* Filled badge, not the stroked outline used elsewhere in these modals: a 1.8px hairline in the accent sits at roughly 2:1 against its own 12% tint (below the 3:1 WCAG 1.4.11 floor for a non-text graphic) and reads as barely there. A solid disc carries the accent as mass and knocks the glyph out in --on-acc, which every brand already guarantees is legible on its accent (it is the accent-button label color). */ .ui-modal-backdrop .ui-callout > .pi, .ui-modal-backdrop .ui-callout > svg,
/* Filled badge, not the stroked outline used elsewhere in these modals: a 1.8px hairline in the accent sits at roughly 2:1 against its own 12% tint (below the 3:1 WCAG 1.4.11 floor for a non-text graphic) and reads as barely there. A solid disc carries the accent as mass and knocks the glyph out in --on-acc, which every brand already guarantees is legible on its accent (it is the accent-button label color). */ .message-modal-backdrop .message-callout > .pi, .message-modal-backdrop .message-callout > svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--acc);
}

/* Knockout parts of a legacy inline <svg> callout badge (.disc/.glyph). The Material Symbols font
   renders the filled glyph directly, so under PortalIcons these selectors simply match nothing. */
.ui-modal-backdrop .ui-callout .disc,
.message-modal-backdrop .message-callout .disc {
    fill: currentColor;
}

.ui-modal-backdrop .ui-callout .glyph,
.message-modal-backdrop .message-callout .glyph {
    fill: none;
    stroke: var(--on-acc);
    stroke-width: 2.2;
    stroke-linecap: round;
}

.ui-modal-backdrop .ui-callout strong,
.message-modal-backdrop .message-callout strong {
    color: var(--ink);
}

/* Danger variant — the error-detail payload. Semantic red rather than the brand accent, because the hue here encodes a failure and must not repaint per schema; the triangle glyph is what actually carries that severity for anyone who cannot perceive the color. Fixed --red* tokens, so this needs no dark-mode override. */ .ui-modal-backdrop .ui-callout.danger,
/* Danger variant — the error-detail payload. Semantic red rather than the brand accent, because the hue here encodes a failure and must not repaint per schema; the triangle glyph is what actually carries that severity for anyone who cannot perceive the color. Fixed --red* tokens, so this needs no dark-mode override. */ .message-modal-backdrop .message-callout.danger {
    background: var(--dgr-tint);
    border-left-color: var(--dgr);
}

.ui-modal-backdrop .ui-callout.danger > .pi, .ui-modal-backdrop .ui-callout.danger > svg,
.message-modal-backdrop .message-callout.danger > .pi, .message-modal-backdrop .message-callout.danger > svg {
    color: var(--dgr);
}

.ui-modal-backdrop .ui-callout.danger .glyph,
.message-modal-backdrop .message-callout.danger .glyph {
    stroke: var(--srf);
}

/* ===== TOAST ===== */ .ui-toast,
/* ===== TOAST ===== */ .message-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 13px;
    z-index: 2000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    font-family: 'Inter', system-ui, sans-serif;
}

.ui-toast.show,
.message-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.ui-toast.error,
.message-toast.error {
    background: var(--red-stat);
}

.ui-toast.success,
.message-toast.success {
    background: var(--green);
}

.ui-toast.warning,
.message-toast.warning {
    background: var(--amber-d);
}

/* A sticky toast (error / warning — see messageToast) waits for the user instead of fading, so
   unlike the resting toast it has to accept clicks for its own close button to work. */
.ui-toast.sticky,
.message-toast.sticky {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 12px;
}

/* The text takes the row and the button centres against it, whatever the message wraps to. */
.ui-toast .ui-toast-text,
.message-toast .ui-toast-text {
    flex: 1 1 auto;
    min-width: 0;
}

.ui-toast-close {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    opacity: .8;
    line-height: 1;
    cursor: pointer;
    /* A bare 14px glyph is a 14px target; the box gives it something to aim at without changing
       how the glyph itself reads. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    flex: none;
    align-self: center;
}

.ui-toast-close:hover,
.ui-toast-close:focus {
    opacity: 1;
    background: rgba(255, 255, 255, .18);
}

/* ===== SKELETON LOADING ===== */
@keyframes skel-pulse  {
    0%, 100% { opacity: 1; }
    50%       { opacity: .45; }
}

/* 14 — contact source shown under the number in the Contacts modal rows */ .ui-modal-backdrop .ui-list-row .body .contact-source,
/* 14 — contact source shown under the number in the Contacts modal rows */ .message-modal-backdrop .message-list-row .body .contact-source {
    display: block;
    font-size: 11px;
    color: var(--ink-4);
}

/* ===== Add Administrator modal (VF-5168) ===== */
#addAdministratorModal .inp-cont { position: relative; }
#addAdministratorModal #addAdminHelper { font-style: normal; font-size: 12px; color: var(--md-ink-3, #878D95); display: block; margin-top: 6px; }
#addAdministratorModal #addAdminError { font-style: normal; }

.add-admin-suggestion { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 8px; cursor: pointer; }
.add-admin-suggestion:hover { background: var(--md-srf-3, #EFF1F5); }
.add-admin-suggestion .aas-name { font-size: 13.5px; color: var(--md-ink, #1F2329); white-space: nowrap; }
.add-admin-suggestion .aas-sub { font-size: 12px; color: var(--md-ink-3, #878D95); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.add-admin-suggestion .aas-tag { font-size: 10.5px; font-weight: 600; color: var(--md-ink-2, #4B5158); background: var(--md-srf-2, #F7F8FA); border: 1px solid var(--md-line-2, #D3D7DE); border-radius: 10px; padding: 2px 8px; }
.add-admin-suggestion.is-disabled { opacity: .45; cursor: not-allowed; }
.add-admin-suggestion.is-disabled:hover { background: transparent; }
#addAdminResults { border: 1px solid var(--md-line, #EBEDF2); border-radius: 10px; padding: 6px; margin-top: 6px; box-shadow: 0 8px 24px rgba(16,24,40,.14); }

.add-admin-card { border: 1px solid var(--md-line, #EBEDF2); border-radius: 10px; padding: 14px 16px; }
.add-admin-card .aac-id { display: flex; align-items: center; gap: 10px; }
/* Name + email + Change share one row; baseline-align them so the smaller email text sits level
   with the name (the avatar stays vertically centered via the parent's align-items:center). */
.add-admin-card .aac-idmain { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.add-admin-card .aac-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--md-srf-3, #EFF1F5); color: var(--md-ink-2, #4B5158); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; }
.add-admin-card .aac-name { font-size: 14px; font-weight: 650; color: var(--md-ink, #1F2329); }
.add-admin-card .aac-email { font-size: 12.5px; color: var(--md-ink-3, #878D95); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-admin-card .aac-change { font-size: 12px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.add-admin-card .aac-divider { height: 1px; background: var(--md-line, #EBEDF2); margin: 12px 0; }
.add-admin-card .aac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.add-admin-card .aac-grid > div { display: flex; flex-direction: column; gap: 3px; }
.add-admin-card .aac-grid label { font-size: 11.5px; font-weight: 600; color: var(--md-ink-3, #878D95); margin: 0; }
.add-admin-card .aac-grid span { font-size: 12.5px; color: var(--md-ink-2, #4B5158); }
.add-admin-card .aac-roles { grid-column: 1 / -1; }
/* Context (Enterprise + Group) spans the full card width so the Group id stays on the same line
   instead of wrapping under the Enterprise id inside a half-width grid cell. */
.add-admin-card .aac-context { grid-column: 1 / -1; }
.add-admin-card .aas-pill { display: inline-block; font-size: 11px; font-weight: 600; color: var(--md-ink-2, #4B5158); background: var(--md-srf-2, #F7F8FA); border: 1px solid var(--md-line, #EBEDF2); border-radius: 10px; padding: 2px 8px; margin: 0 4px 4px 0; }
#addAdminGrantLine { font-size: 12.5px; color: var(--md-ink-3, #878D95); margin-top: 14px; }
#addAdminGrantLine strong { color: var(--md-ink-2, #4B5158); }

/* ===== Edit administrator modal (parts/admins/edit-administrator-modal) ===== */
/* Identity card reuses the Add modal's .add-admin-card; the email carries a copy icon. */
#editAdminIdentity { margin-bottom: 8px; }
/* Compact two-column card for the wide (900px) Edit modal so the transfer lists stay in view:
   User ID | User type, Context | Last login, then Roles across. Same fields as the Add modal's
   card (PortalAdminCard) - only the layout is denser; the narrow Add modal keeps its stack. */
#editAdminIdentity .add-admin-card { padding: 10px 14px; }
#editAdminIdentity .aac-avatar { width: 28px; height: 28px; font-size: 11px; }
#editAdminIdentity .aac-divider { margin: 8px 0; }
#editAdminIdentity .aac-grid { gap: 6px 16px; }
#editAdminIdentity .aac-grid > div { gap: 1px; min-width: 0; }
#editAdminIdentity .aac-context { grid-column: auto; }
#editAdminIdentity .aac-roles { grid-column: 1 / -1; order: 1; }
#editAdminIdentity .aas-pill { padding: 1px 7px; margin: 0 4px 2px 0; }
@media (max-width: 767px) {
    #editAdminIdentity .aac-grid { grid-template-columns: minmax(0, 1fr); }
}
#editAdminIdentity .aac-email { min-width: 0; }
#editAdminIdentity .aac-copy { flex: 0 0 auto; }
#editAdminIdentity .aac-copy .link-icon { margin-left: 0 !important; vertical-align: middle; }
#editAdminIdentity .aac-grid .aac-copy { margin-left: 6px; }
#editAdminIdentity .aac-grid span { overflow-wrap: anywhere; }
/* Linked switch, page selects and the search box share a two-column grid instead of each taking
   the full modal width. Cells are .form-group (label above control); the label-less search cell
   bottom-aligns with its neighbour. One column on phones. */
.edit-admin-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; align-items: end; margin-bottom: 10px; }
.modal .modal-dialog .modal-body .edit-admin-controls > .form-group { margin: 0; min-width: 0; }
.edit-admin-controls .ui-search-group { width: 100%; }
/* The search box always sits in the RIGHT column (beside the last select, or alone on the right
   when the modal has no selects), above the Assigned list. */
.edit-admin-controls > .edit-admin-search { grid-column: 2; }
@media (max-width: 767px) {
    .edit-admin-controls { grid-template-columns: minmax(0, 1fr); }
    .edit-admin-controls > .edit-admin-search { grid-column: auto; }
}

.add-admin-skeleton { display: flex; gap: 12px; align-items: center; border: 1px solid var(--md-line, #EBEDF2); border-radius: 10px; padding: 14px 16px; }
.add-admin-skeleton .aas-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--md-srf-3, #EFF1F5); }
.add-admin-skeleton .aas-bars { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.add-admin-skeleton .aas-bars span { height: 10px; border-radius: 6px; background: var(--md-srf-3, #EFF1F5); animation: aasShimmer 1.4s ease-in-out infinite; }
.add-admin-skeleton .aas-bars span:nth-child(1) { width: 60%; }
.add-admin-skeleton .aas-bars span:nth-child(2) { width: 80%; }
.add-admin-skeleton .aas-bars span:nth-child(3) { width: 45%; }
@keyframes aasShimmer { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ===== Add Administrator modal — dark mode (VF-5168) ===== */
/* The light-mode rules above use --md-* / hard-coded #hex fallbacks that are not flipped in dark
   mode.  Mirror dark.css tokens (--dm-text / --dm-subtle / --dm-muted / --dm-elevated /
   --dm-border) so all text and chrome on the profile card and the suggestion list are legible
   against the dark modal-body surface. Brand-amber primary buttons are not affected. */
html.dark-mode .add-admin-suggestion:hover { background: var(--dm-elevated) !important; }
html.dark-mode .add-admin-suggestion .aas-name { color: var(--dm-text) !important; }
html.dark-mode .add-admin-suggestion .aas-sub { color: var(--dm-muted) !important; }
html.dark-mode .add-admin-suggestion .aas-tag { color: var(--dm-subtle) !important; background: var(--dm-elevated) !important; border-color: var(--dm-border) !important; }
html.dark-mode #addAdminResults { border-color: var(--dm-border) !important; background: var(--dm-surface) !important; }

html.dark-mode .add-admin-card { border-color: var(--dm-border) !important; background: var(--dm-elevated) !important; }
html.dark-mode .add-admin-card .aac-avatar { background: var(--dm-surface) !important; color: var(--dm-subtle) !important; }
html.dark-mode .add-admin-card .aac-name { color: var(--dm-text) !important; }
html.dark-mode .add-admin-card .aac-email { color: var(--dm-muted) !important; }
html.dark-mode .add-admin-card .aac-divider { background: var(--dm-border) !important; }
html.dark-mode .add-admin-card .aac-grid label { color: var(--dm-muted) !important; }
html.dark-mode .add-admin-card .aac-grid span { color: var(--dm-subtle) !important; }
html.dark-mode .add-admin-card .aas-pill { color: var(--dm-subtle) !important; background: var(--dm-surface) !important; border-color: var(--dm-border) !important; }
html.dark-mode #addAdminGrantLine { color: var(--dm-muted) !important; }
html.dark-mode #addAdminGrantLine strong { color: var(--dm-subtle) !important; }

html.dark-mode .add-admin-skeleton { border-color: var(--dm-border) !important; background: var(--dm-elevated) !important; }
html.dark-mode .add-admin-skeleton .aas-avatar { background: var(--dm-surface) !important; }
html.dark-mode .add-admin-skeleton .aas-bars span { background: var(--dm-surface) !important; }
html.dark-mode #addAdministratorModal #addAdminHelper { color: var(--dm-muted) !important; }

/* ===== Fax Account "Users" tab inline picker (VF-5168) =====
   Reuses the add-admin component look (.add-admin-suggestion / .add-admin-card / .aas-* / .aac-* are
   already global above). Only the results box + helper/error chrome need fax-scoped selectors, mirroring
   #addAdminResults / #addAdminHelper which are id-scoped to the Admin modal. */
#fax-assign-search-group .inp-cont { position: relative; }
#fax-assign-helper { font-style: normal; font-size: 12px; color: var(--md-ink-3, #878D95); display: block; margin-top: 6px; }
#fax-assign-error { font-style: normal; }
#fax-assign-results { border: 1px solid var(--md-line, #EBEDF2); border-radius: 10px; padding: 6px; margin-top: 6px; box-shadow: 0 8px 24px rgba(16,24,40,.14); }
html.dark-mode #fax-assign-results { border-color: var(--dm-border) !important; background: var(--dm-surface) !important; }
html.dark-mode #fax-assign-helper { color: var(--dm-muted) !important; }


/* ── VF-5168: SlimSelect dropdown lifted out of a clipping modal body ──
   slimselect-modal-fix.js switches an open .ss-content to position:fixed (in place — it
   stays inside .ss-main, so every `.ss-main .ss-content ...`-scoped rule keeps applying)
   whenever the select sits inside a modal; a fixed box escapes the modal body's
   overflow clipping and overlays the footer. left/top/width are set inline by the shim;
   !important beats the inline margin/height that SlimSelect's moveContentAbove/Below
   write, which are meaningless once the panel is fixed. */
.ss-content.ss-modal-lifted {
    position: fixed !important;
    margin: 0 !important;
    height: auto !important;
    z-index: 10000; /* above the modal's own footer/siblings within its stacking context */
}

/* ── VF-5168: tail.select "multiselector" dropdown lifted out of a clipping modal body ──
   Sibling of the rule above for the other portal select widget. tailselect-modal-fix.js switches
   an open .select-dropdown to position:fixed in place while its .tail-select sits inside a modal,
   so the panel escapes the modal body's overflow clipping and overlays the footer instead of being
   trapped under it. left/top/width are written inline by the shim; !important beats the vendor
   .select-dropdown { position:absolute; margin:2px 0 0 } rule (meaningless once the panel is fixed). */
.tail-select .select-dropdown.tail-modal-lifted {
    position: fixed !important;
    margin: 0 !important;
    z-index: 10000; /* above the modal's own footer/siblings within its stacking context */
}

/* tail.select caps the panel by writing an inline max-height in init(); the shim's instant-open
   path (needed to keep lift/teardown synchronous) replaces the panel's inline styles and erases
   that cap, so a lifted list would render full-height. Re-cap the scrollable region here — the
   .dropdown-inner already carries overflow-y:auto, this just bounds it — matching the ~350px box
   the widget shows off-modal (≈300px list + the fixed search/actions row above it). */
.tail-select .select-dropdown.tail-modal-lifted .dropdown-inner {
    max-height: 300px;
    overflow-y: auto;
}

/* VF-5168: tail.select multiselect corners. controls.css rounds the closed control (.select-label)
   to --r-ctl as part of the shared 32px/8px control language; round the two pieces it doesn't reach
   so the whole widget is consistent: the right-side caret cap (:after, vendor 0 2px 2px 0) and the
   open dropdown panel (.select-dropdown, vendor 3px). The vendor sheet (tail.select-default.min.css)
   loads per-page after this one, so these need !important (like the modal-fix rules above). Global —
   every tail.select: the Reports History type/status filters and the same widget on other pages. */
.tail-select .select-label:after {
    border-radius: 0 var(--r-ctl) var(--r-ctl) 0 !important;
}
.tail-select .select-dropdown {
    border-radius: var(--r-ctl) !important;
}

/* ── VF-5220: NRM filter-modal bespoke multi-select (nrf-select.js) dropdown lifted out of a clipping modal body ──
   Third sibling of the two rules above, for the Number Reputation filter modals' own multi-select.
   nrf-select.js switches an open .nrf-panel to position:fixed in place (it stays inside its
   .nrf-select, so every `#nr-filters-modal .nrf-panel ...`-scoped rule — styling, dark mode, the
   .nrf-list max-height — keeps applying) whenever the widget sits inside a modal, so the panel
   escapes the modal body's overflow clipping and overlays the footer. left/top/width are written
   inline by the shim; !important beats the default .nrf-panel { position:absolute; top:calc(100% + 6px) }
   in nrm-filters.css (meaningless once fixed), and right:auto keeps its left:0;right:0 base from
   over-constraining the inline width. */
.nrf-panel.nrf-modal-lifted {
    position: fixed !important;
    margin: 0 !important;
    top: auto; /* JS writes the real top inline (wins over this); drop the calc(100%+6px) default */
    right: auto !important; /* !important beats the id-scoped `#nr-filters-modal .nrf-panel { right: 0 }` base */
    z-index: 10000 !important; /* above the modal's own footer/siblings; !important beats the id-scoped base's z-index:1060 */
}

/* ===== Typography: Inter everywhere (VF-5168) =====
   The portal typeface is Inter (fonts.css); everything inherits it from the body (style_new.css).
   Bootstrap (bundled in logicom-custom.min.css) re-pins its own Helvetica stack on tooltip and
   popover, which escapes that inheritance — put Inter first there too; the old stack stays as
   the fallback only. */
.tooltip, .popover {
    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* VF-5253: tooltips/popovers must always paint over the UI. The portal promotes several modal
       elements to z-index:10000 (the .ui-modal rules above), which buried stock Bootstrap tooltips
       (z-index 1070) under the modal chrome. Pin them above everything. Paired with the global
       container:'body' default set in parts/resources — without that, a tooltip anchored near a
       scrollable modal's edge expands the modal's scrollWidth and spawns a horizontal scrollbar. */
    z-index: 20000 !important;
}

/* ===== MENU (dropdown launcher) =====
   Promoted from the Messages page settings dropdown (messages.css, design handoff surface 01) —
   the `.message-page .menu-dropdown` rules there stay as the transitional alias; author new
   markup with these `ui-` names (spec/20-menus-dropdowns.md). Behavior (open/close, outside
   click, caret flip, roving-focus keyboard model) comes from ui-menu.js — the panel itself only
   knows the `.open` class.

   Anatomy: a `.ui-menu-wrap` positioning context holding the trigger button (which carries a
   `.ui-menu-caret`) and the `.ui-menu` panel of `.ui-menu-item` rows (role=menuitem, one leading
   16px icon each, NO dividers). Neutral hover, not the brand accent: menu items are equal-weight
   destinations, and tinting the hovered one brand-colored reads as "selected" rather than
   "pointed at". */
.ui-menu-wrap {
    position: relative;
}

/* Trigger caret: vertically centred with the label (the bare 10px glyph otherwise sits on the
   baseline and reads as "too low") and flipped while the menu is open. */
.ui-menu-caret {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    line-height: 1;
    vertical-align: middle;
    transition: transform .15s ease;
}

.ui-menu-wrap [aria-expanded="true"] .ui-menu-caret {
    transform: rotate(180deg);
}

/* Width grows with the labels so longer translations do not wrap, capped at 320. z-index matches
   Bootstrap's dropdown layer (1000), not the Messages page's 60: this panel mounts on arbitrary
   host pages whose stacking contexts we do not control. */
.ui-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--srf);
    border: 1px solid var(--line);
    border-radius: var(--r-row);
    box-shadow: var(--shadow-menu);
    z-index: 1000;
    width: max-content;
    min-width: 248px;
    max-width: 320px;
    padding: 6px;
    display: none;
}

.ui-menu.open {
    display: block;
}

/* Opens right-edge-aligned instead — for triggers near the right edge of the viewport. */
.ui-menu.ui-menu-right {
    left: auto;
    right: 0;
}

/* Items may be divs (role=menuitem + roving tabindex, the reference shape) or buttons — the
   button resets are inert on divs. */
.ui-menu-item {
    min-height: 38px;
    width: 100%;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-2);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui-menu-item:hover,
.ui-menu-item:focus-visible,
.ui-menu-item.active {
    background: var(--srf-3);
    color: var(--ink);
    outline: 0;
}

.ui-menu-item .pi {
    --pi-size: 16px;
    color: var(--ink-3);
}

.ui-menu-item:hover .pi,
.ui-menu-item:focus-visible .pi,
.ui-menu-item.active .pi {
    color: var(--ink-2);
}

/* A hairline separator between menu groups (VF-5168 devices Action menu). */
.ui-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}

/* Destructive menu item (e.g. the Action menu's Delete): red label + glyph, danger-tint hover.
   The selectors carry `.ui-menu.open > a.ui-menu-item.danger` too, to out-specify the open-menu
   pinned-highlight reset (`.ui-menu.open > a.ui-menu-item`) that otherwise repaints an <a> item ink. */
.ui-menu-item.danger,
.ui-menu-item.danger .pi,
.ui-menu.open > a.ui-menu-item.danger,
.ui-menu.open > a.ui-menu-item.danger .pi {
    color: var(--dgr);
}

.ui-menu-item.danger:hover,
.ui-menu-item.danger:focus-visible,
.ui-menu-item.danger.active,
.ui-menu.open > a.ui-menu-item.danger:hover,
.ui-menu.open > a.ui-menu-item.danger:focus-visible,
.ui-menu.open > a.ui-menu-item.danger.active {
    background: var(--dgr-tint);
    color: var(--dgr);
}

.ui-menu-item.danger:hover .pi,
.ui-menu-item.danger:focus-visible .pi,
.ui-menu-item.danger.active .pi,
.ui-menu.open > a.ui-menu-item.danger:hover .pi {
    color: var(--dgr);
}

/* VF-5168 device-profile identity strip — glyph tile + name/type + key/value facts.
   Shared by group/enterprise/system device-profile.html (the Lines-tab header strip). */
.dv-identity {
    display: flex;
    align-items: center;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.dv-id-tile {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--r-ctl, 8px);
    background: var(--srf-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dv-id-tile .pi {
    --pi-size: 22px;
    color: var(--ink-2);
}

.dv-id-main { min-width: 0; margin-right: 8px; }

.dv-id-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.dv-id-type { font-size: 12.5px; color: var(--ink-3); }

.dv-id-kv { display: flex; flex-direction: column; gap: 2px; }

.dv-id-k {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.dv-id-v { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* An <a> menu item (e.g. Fax > Broadcast > History, kept an <a> for middle-click/open-in-tab) is
   pinned permanently highlighted while the panel is open, because the ui-menu reuses the `.open`
   class and mounts inside a legacy `ul.nav-buttons` toolbar — so the per-brand schema rule
   `ul.nav-buttons .open > a` (the toolbar's OWN active-item brand fill) matches it at rest. The
   <div>/<button> siblings never match `> a`, which is why only the link lit up. Menu items own
   their hover/focus/active states: beat the schema rule (portal-ui.css loads after the schema, and
   these selectors outrank it) and restore the neutral look. */
.ui-menu.open > a.ui-menu-item,
.ui-menu.open > a.ui-menu-item:focus {
    background-color: transparent;
    color: var(--ink-2);
}

/* Intentional highlight states only — hover, KEYBOARD focus, and the roving `.active`. The
   `:focus-visible` rule is listed after the plain-`:focus` reset above so a keyboard-focused item
   still resolves to the gray highlight (both match at equal specificity; later wins), while a plain
   pointer `:focus` stays neutral instead of catching the schema's orange. */
.ui-menu.open > a.ui-menu-item:hover,
.ui-menu.open > a.ui-menu-item:focus-visible,
.ui-menu.open > a.ui-menu-item.active {
    background-color: var(--srf-3);
    color: var(--ink);
}

/* ── Menu card — the phone treatment of the same launcher ──
   A centered `.ui-modal-backdrop.ui-menu-card` dialog replacing the dropdown where a panel
   anchored to the trigger would open off the screen edge (promoted from the Messages settings
   hub, messages-mobile.css). Rows are real <button>s — on a phone this dialog is the only way
   into those screens, and a div with a data-action is unreachable by keyboard. Each row: a 32px
   icon chip, the label, and a trailing chevron saying the row opens another surface. The card
   keeps its ✕ (spec/16: only confirm cards drop theirs) and carries no footer button. */
.ui-menu-card .ui-modal-body {
    padding: 4px 12px 12px;
}

.ui-menu-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 10px 8px;
    margin-bottom: 2px;
    border: 0;
    border-radius: var(--r-row);
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}

.ui-menu-card-row:last-child {
    margin-bottom: 0;
}

.ui-menu-card-row:active {
    background: var(--srf-3);
}

.ui-menu-card-icon {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: var(--r-ctl);
    background: var(--srf-3);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui-menu-card-icon .pi {
    --pi-size: 16px;
    color: inherit;
}

.ui-menu-card-row strong {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
}

/* Affordance only — the row itself is the control, so the chevron carries no label of its own. */
.ui-menu-card-chevron {
    --pi-size: 15px;
    color: var(--ink-4);
}

/* Table row-action icon slot (VF-5168 icon migration): the .pi twin of fonts.css's
   .history-row-button font sizing. Tune --pi-size against the live table in the browser. */
.pi.history-row-button {
    --pi-size: 22px;
    font-size: var(--pi-size);
    line-height: 32px;
    padding: 0;
    margin-right: 4px;
}

/* Profile dropdown icon column (replaces the #logoutModal [class^="icon-"] alignment rules). */
#logoutModal .pi {
    --pi-size: 20px;
    width: 24px;
    margin-right: 10px;
    justify-content: flex-start;
}

/* ===== Selection components (VF-5248) ======================================================
   Feature-agnostic building blocks first used by the fax group/admin screens:
     .ui-radiotabs     - a nav-tabs strip whose tabs carry a radio dot; one choice swaps the pane below
                         (behaviour: static/js/ui-radio-tabs.js)
     .ui-tab-count     - count pill inside a nav-tabs tab ("Organizations 2")
     .ui-tag, .ui-tag-list, .ui-tag-more - small neutral chips (sm / accent / warn) and a no-wrap chip row
   ========================================================================================== */
/* helper line under a form field (hint / scope explanation) */
.ui-field-hint {
    display: block;
    margin-top: 6px;
    font-style: normal;
    font-size: 12px;
    color: var(--ink-3);
}

/* a hint that warns about the value above it (e.g. a credential close to expiry) */
.ui-field-hint.is-danger {
    color: var(--red-stat-ink);
}

/* a control and its action button(s) on one line - e.g. a period picker followed by "Run report" */
.ui-control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
}

ul.nav.nav-tabs.ui-radiotabs {
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

ul.nav.nav-tabs.ui-radiotabs > li > a {
    cursor: pointer;
}

ul.nav.nav-tabs.ui-radiotabs > li.disabled > a {
    cursor: not-allowed;
    opacity: .5;
}

ul.nav.nav-tabs.ui-radiotabs input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0 6px 0 0;
    border: 1.5px solid var(--line-d);
    border-radius: 50%;
    background: var(--srf);
    position: relative;
    vertical-align: middle;
    cursor: pointer;
    transition: border-color 160ms ease;
}

ul.nav.nav-tabs.ui-radiotabs input[type="radio"]:checked {
    border-color: var(--acc);
}

ul.nav.nav-tabs.ui-radiotabs input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--acc);
}

ul.nav.nav-tabs.ui-radiotabs input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

/* A mouse click on the dot focuses the radio, and the bootstrap radio :focus outline plus the modal field ring
   (.ui-modal-backdrop .ui-field input:focus) drew a halo that a click on the tab text never shows. Only keyboard
   focus (:focus-visible above) gets the ring. */
ul.nav.nav-tabs.ui-radiotabs input[type="radio"]:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.ui-tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: var(--ink-2);
    background: var(--srf-3);
}

ul.nav-tabs > li.active .ui-tab-count {
    color: #FFFFFF;
    background: var(--acc);
}

.ui-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--srf-2);
    border: 1px solid var(--line);
    white-space: nowrap;
    vertical-align: middle;
}

.ui-tag.sm {
    height: 18px;
    padding: 0 6px;
    font-size: 10.5px;
}

.ui-tag.is-accent {
    color: var(--acc-hi);
    background: var(--acc-tint);
    border-color: transparent;
}

.ui-tag.is-warn {
    color: var(--red-stat-ink);
    background: var(--red-stat-l);
    border-color: transparent;
}

/* Chip input (parts/dynamic-table-like-template :: chips-section): the shared table-like widget's rows laid out
   as removable accent chips under the add field - the Recipients design of Number Reputation > Add Alert. */
.ui-chips-field > label {
    display: block;
    margin-bottom: 6px;
}

.ui-chips-add .form-control,
.ui-chips-add .btn {
    height: 32px;
    min-height: 32px;
}

.ui-chips-table,
.ui-chips-table > tbody {
    display: block;
    width: 100%;
}

.ui-chips-table > tbody {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.ui-chips-table > tbody > tr {
    display: inline-flex;
}

.ui-chips-table > tbody > tr.hidden {
    display: none !important;
}

.ui-chips-table > tbody > tr > td {
    border: 0;
    padding: 0;
}

.ui-chips-table > tbody > tr[id$="-no-entries"] > td {
    color: var(--ink-3, #6b7280);
    font-size: 12px;
}

.ui-chips-table > tbody > tr > td.ui-chip,
.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background-color: var(--acc, #f0a500);
    color: var(--on-acc, #fff);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    word-break: break-all;
}

.ui-chip .ui-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    opacity: 0.85;
    text-decoration: none;
}

.ui-chip .ui-chip-remove > * {
    display: block;
}

.ui-chip .ui-chip-remove:hover,
.ui-chip .ui-chip-remove:focus {
    color: inherit;
    opacity: 1;
    text-decoration: none;
}

.ui-chips-count {
    color: var(--ink-3, #6b7280);
    font-size: 12px;
    margin: 5px 0 0;
}

.ui-tag-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow: hidden;
    min-width: 0;
}

.ui-tag-more {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

html.dark-mode .ui-field-hint {
    color: var(--dm-muted) !important;
}

html.dark-mode .ui-field-hint.is-danger {
    color: color-mix(in srgb, var(--red-stat) 55%, white) !important;
}

html.dark-mode ul.nav.nav-tabs.ui-radiotabs input[type="radio"] {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html.dark-mode .ui-tab-count {
    color: var(--dm-subtle) !important;
    background: var(--dm-elevated) !important;
}

html.dark-mode .ui-tag {
    color: var(--dm-subtle) !important;
    background: var(--dm-elevated) !important;
    border-color: var(--dm-border) !important;
}

/* ==========================================================================================
   VF-5248 shared ui-* additions (first used by the fax group modals; feature-agnostic)
     .ui-field-row          - two .ui-field side by side inside a .ui-modal body (stacks on phone)
     .ui-field.is-invalid   - a field whose validation failed (danger control border)
     .ui-tag-list.is-wrap   - chip row that wraps instead of clipping
     .ui-tag-more.is-static - non-interactive "+N more" counter
     .ui-radio-cards / .ui-radio-card - single-choice list of bordered rows: radio + title/sub + right-aligned value/hint
   ========================================================================================== */
.ui-modal-backdrop .ui-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 16px;
}

@media (max-width: 600px) {
    .ui-modal-backdrop .ui-field-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ui-modal-backdrop .ui-field.is-invalid input,
.ui-modal-backdrop .ui-field.is-invalid textarea {
    border-color: var(--dgr);
}

/* a SlimSelect picker: style_new.css draws every .ss-single-selected border with !important */
.ui-modal-backdrop .ui-field.is-invalid .ss-main .ss-single-selected {
    border-color: var(--dgr) !important;
}

.ui-modal-backdrop .ui-field.is-invalid input:focus,
.ui-modal-backdrop .ui-field.is-invalid textarea:focus {
    border-color: var(--dgr);
    box-shadow: 0 0 0 3px var(--dgr-tint);
}

.ui-tag-list.is-wrap {
    flex-wrap: wrap;
    overflow: visible;
}

.ui-tag-more.is-static {
    cursor: default;
    color: var(--ink-3);
}

.ui-radio-cards {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-d);
    border-radius: var(--r-row);
    background: var(--srf);
    overflow: hidden;
}

.ui-radio-cards > label.ui-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: none;
    margin: 0;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    font-weight: 400;
    color: var(--ink);
    cursor: pointer;
    transition: background 120ms ease;
}

.ui-radio-cards > label.ui-radio-card:first-child {
    border-top: 0;
}

.ui-radio-cards > label.ui-radio-card:hover {
    background: var(--srf-2);
}

.ui-radio-cards > label.ui-radio-card.is-selected {
    background: var(--acc-tint);
}

.ui-radio-cards > label.ui-radio-card.is-disabled {
    cursor: not-allowed;
    background: var(--srf);
}

.ui-radio-cards .ui-radio-card input[type="radio"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    min-height: 0;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    accent-color: var(--acc);
    cursor: inherit;
}

.ui-radio-cards .ui-radio-card input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: 50%;
}

.ui-radio-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.ui-radio-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-radio-card-sub {
    font-size: 12px;
    color: var(--ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-radio-card-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    text-align: right;
}

.ui-radio-card-value {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.ui-radio-card-hint {
    font-size: 12px;
    color: var(--ink-3);
    white-space: nowrap;
}

.ui-radio-card.is-disabled .ui-radio-card-title,
.ui-radio-card.is-disabled .ui-radio-card-sub,
.ui-radio-card.is-disabled .ui-radio-card-value {
    color: var(--ink-4);
}

.ui-radio-card.is-disabled .ui-radio-card-hint {
    color: var(--ink-2);
}

html.dark-mode .ui-radio-cards {
    background: var(--dm-surface) !important;
    border-color: var(--dm-border) !important;
}

html.dark-mode .ui-radio-cards > label.ui-radio-card {
    border-color: var(--dm-border) !important;
}

html.dark-mode .ui-radio-cards > label.ui-radio-card:hover,
html.dark-mode .ui-radio-cards > label.ui-radio-card.is-selected {
    background: var(--dm-elevated) !important;
}

html.dark-mode .ui-radio-card-title,
html.dark-mode .ui-radio-card-value {
    color: var(--dm-text) !important;
}

html.dark-mode .ui-radio-card-sub,
html.dark-mode .ui-radio-card-hint,
html.dark-mode .ui-tag-more.is-static {
    color: var(--dm-muted) !important;
}

/* ===== Selection bar (VF-5248) ==============================================================
   .ui-selection-bar   - the left side of a list toolbar while table rows are selected: "N selected" + the bulk
                         action(s) + Clear, swapped in place of the toolbar's usual buttons (the page toggles the two
                         <li>s; no sticky bar). Markup: div.ui-selection-bar > span.ui-selection-count + a.btn...
   tr.ui-row-selected  - light accent tint on a selected table row
   ========================================================================================== */
.ui-selection-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px;
    border-radius: var(--r-ctl);
    background: var(--acc-tint);
}

.ui-selection-bar .ui-selection-count {
    padding: 0 8px 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--acc-hi);
    white-space: nowrap;
}

.ui-selection-bar .btn {
    margin: 0;
}

.table > tbody > tr.ui-row-selected > td {
    background-color: var(--acc-tint);
}

html.dark-mode .ui-selection-bar {
    background: var(--dm-elevated) !important;
}

html.dark-mode .ui-selection-bar .ui-selection-count {
    color: var(--dm-text) !important;
}

html.dark-mode .table > tbody > tr.ui-row-selected > td {
    background-color: var(--dm-elevated) !important;
}

/* ==========================================================================================
   VF-5248: read-only detail list and run-state label (first used by the fax group report details modal)
     .ui-detail-list    - key/value summary (a <dl>: dt label / dd value pairs) for detail modals and cards
     .ui-detail-caption - small caption above a block inside a detail surface ("Files")
     .ui-status         - run state of a report or job: .is-run (Running), .is-ok (Completed), .is-err (Failed)
   ========================================================================================== */
.ui-detail-list {
    display: grid;
    grid-template-columns: minmax(110px, max-content) minmax(0, 1fr);
    gap: 10px 16px;
    align-items: baseline;
    margin: 0 0 18px;
}

.ui-detail-list > dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    color: var(--ink-3);
}

.ui-detail-list > dd {
    margin: 0;
    min-width: 0;
    font-size: 13.5px;
    line-height: 20px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.ui-detail-caption {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
}

.ui-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 11px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--ink-2);
    background: var(--srf-3);
}

.ui-status.is-run {
    color: var(--ink-2);
    background: var(--srf-3);
}

.ui-status.is-ok {
    color: color-mix(in srgb, var(--ok) 70%, black);
    background: var(--ok-tint);
}

.ui-status.is-err {
    color: var(--red-stat-ink);
    background: var(--red-stat-l);
}

/* ── Change tracker (change-tracker.js) — shared "CHANGED · WAS {saved}" pill + save flash ──
   Reusable across Save-surface forms; the JS owns the text/visibility, this owns the look. */
.ct-pill {
    display: inline-flex;
    align-items: center;
    height: 20px;
    margin-left: 8px;
    padding: 0 8px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-3);
    white-space: nowrap;
    vertical-align: middle;
}

/* keepCase trackers (opt-in): only the "CHANGED · WAS" mark is upper-cased; the saved value reads as typed */
.ct-pill.ct-pill-keep-case {
    gap: .35em; /* an inline-flex pill drops the space between its spans */
    text-transform: none;
}

.ct-pill.ct-pill-keep-case .ct-pill-mark {
    text-transform: uppercase;
}

@keyframes ct-row-flash {
    from { background: var(--acc-tint); }
    to { background: transparent; }
}

.ct-row-flash {
    animation: ct-row-flash 1.5s ease-out;
}

/* =========================================================================
   VF-5168 — shared loading-feedback primitives (Logicom New UI spec).
   Neutral (never accent), reusable; replaces the full-screen blocking spinner
   on in-place AJAX surfaces. Skeleton pieces pulse gently between two neutral
   greys to signal the load is live (lp-skel-pulse).
   ========================================================================= */
@keyframes lp-spin { to { transform: rotate(360deg); } }

/* Gentle breathing pulse for skeleton pieces — a subtle neutral grey shift (never accent)
   so a loading surface reads as live rather than frozen. Shared by .lp-skel-bar and the
   feature skeleton blocks (registrations / edit-user / move-user modals). */
@keyframes lp-skel-pulse {
    0%, 100% { background-color: var(--srf-3); }
    /* Half-way toward --line-d — a softer pulse (half the previous colour extent). */
    50%      { background-color: color-mix(in srgb, var(--srf-3) 50%, var(--line-d)); }
}

.lp-spin {
    display: inline-block;
    flex: none;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    border: 2px solid var(--line-2);
    border-top-color: var(--ink-3);
    border-radius: 50%;
    animation: lp-spin .9s linear infinite;
}

.lp-spin--sm { width: 16px; height: 16px; }

/* Icon-button busy state: a row action (Play / view-transcript) swapped to the shared .pi spinner
   while its async work runs (lpIconBusy in common-functions.js). The spinner inherits the button's
   colour; the control is non-interactive (pointer-events set inline) until restore() is called. */
.lp-icon-busy { cursor: default; }

/* Inline "Loading …" caption that replaces a section body while its data loads. */
.lp-loading-caption {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    color: var(--ink-3);
    font-size: 13px;
}

/* Scoped overlay: dims the wrapped content + input-blocks it, and floats a
   sticky neutral "busy" pill. Lives on a surface (a well, a modal body) — the
   page chrome around it stays live. */
.lp-overlay { position: relative; }

.lp-overlay > *:not(.lp-overlay-veil) {
    transition: opacity var(--dur-state, 160ms);
}

.lp-overlay.is-busy > *:not(.lp-overlay-veil) {
    opacity: .55;
    pointer-events: none;
}

.lp-overlay-veil {
    position: absolute;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    pointer-events: none;
    z-index: 5;
}

.lp-overlay.is-busy > .lp-overlay-veil { display: flex; }

/* Pill is pinned to the CENTRE of its reference box, not stuck inside a tall surface. Because it is
   position:fixed, its containing block is the nearest ancestor with a transform — inside a modal that
   is the (transformed) .modal-dialog, so the pill centres in the modal; on a plain page well there is
   no such ancestor, so it centres in the viewport (true screen centre). This fixes the old sticky+flex
   behaviour that centred the pill in a long well and dropped it below the fold. */
.lp-overlay-pill {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 16px 0 14px;
    background: var(--srf);
    border: 1px solid var(--line);
    border-radius: var(--r-row);
    box-shadow: var(--shadow-menu);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink);
    pointer-events: none;
}

/* Inside a modal, center the busy pill on the overlaid modal body (its inset:0 veil) rather than the
   viewport. The default position:fixed above relies on the .modal-dialog's transform as a containing
   block, which is absent under prefers-reduced-motion (modals.css sets transform:none) and for modal
   variants without a transformed dialog (bootbox, ui-modal) — so the fixed pill escaped to screen
   centre and landed at the modal's bottom edge. Switching to absolute makes the veil the containing
   block → true modal-body centre. Page-well overlays are not inside .modal, so they keep the fixed
   viewport-centre behaviour. We deliberately do NOT add a transform to the modal itself, which would
   also capture the position:fixed SlimSelect/Tagify dropdown shims that escape scrollable modal bodies. */
.modal .lp-overlay-pill {
    position: absolute;
}

/* Full-page blocking busy pill shown by showSpinner() before a full-page navigation or a blocking
   AJAX submit (common-functions.js). It is the same .lp-overlay-pill centred on the viewport, lifted
   above the #spinner-fade scrim (.spin z-index 9999999). Replaces the retired spin.js dot-ring.
   The don't-flash-on-fast-load delayed reveal lives with the scrim rule in style_new.css. */
.lp-page-busy {
    z-index: 2000000000;
}

/* Button busy / just-saved states — the spinner is NEVER inside a button (DS);
   busy keeps the label + width and just dims + blocks it. */
.btn.is-loading {
    opacity: .45;
    pointer-events: none;
}

.btn.is-saved {
    background: var(--acc-tint) !important;
    color: color-mix(in srgb, var(--accent, #ED9F2B) 72%, #000) !important;
    border-color: transparent !important;
    pointer-events: none;
}

/* Skeleton rows (table pages): --srf-3 bars with the shared gentle pulse. */
.lp-skel-row {
    display: flex;
    align-items: center;
    height: 56px;
    border-top: 1px solid var(--line);
}

.lp-skel-row > .lp-skel-cell {
    padding: 0 12px;
    box-sizing: border-box;
}

.lp-skel-bar {
    height: 10px;
    border-radius: 4px;
    background: var(--srf-3);
    animation: lp-skel-pulse 1.5s ease-in-out infinite;
}

/* Blocked state for modal footer buttons / header close while a save is in flight (DS: the footer
   disables its own buttons; Esc/scrim stop closing). Same look as .btn.is-loading. */
.lp-disabled {
    opacity: .45 !important;
    pointer-events: none !important;
}

/* Toast — a confirmation that needs no action (success). Bottom-right stack, newest on top, 6s life. */
.lp-toast-stack {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    align-items: flex-end;
    pointer-events: none;
}

.lp-toast {
    width: 320px;
    max-width: calc(100vw - 32px);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 10px 12px 14px;
    background: var(--srf);
    border: 1px solid var(--line);
    border-radius: var(--r-row);
    box-shadow: var(--shadow-menu);
    pointer-events: auto;
    animation: lp-toast-in var(--dur-state, 160ms) ease-out;
}

@keyframes lp-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.lp-toast .lp-toast-icon {
    flex: none;
    /* One 20px line shared by icon, title and close: flex-center the glyph in a 20px box
       (a bare glyphicon line box sits on font metrics and drifts off the title's centre). */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    font-size: 16px;
    line-height: 1;
    /* Two-class selector: material-icons.css nudges every .glyphicon down 4px (`top: 4px`) and
       would otherwise win on load order, dropping the icon and × below the title line. */
    top: 0;
}

.lp-toast--ok .lp-toast-icon { color: var(--ok, #2E9E5B); }
.lp-toast--neu .lp-toast-icon { color: var(--ink-2); }

.lp-toast-body { flex: 1; min-width: 0; }

.lp-toast-title {
    font-weight: 600;
    font-size: 13.5px;
    line-height: 20px;
    color: var(--ink);
}

.lp-toast-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-2);
    margin-top: 2px;
}

.lp-toast .lp-toast-close {
    flex: none;
    /* Center the × glyph in its box: the button is also a .glyphicon (inline-block, top:1px),
       which left the mark high-left — flex-center it and cancel the glyphicon top offset. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    /* 24px hit area centred on the 20px title line (pull up by half the 4px overhang). */
    margin: -2px 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1;
    top: 0;
    cursor: pointer;
}

.lp-toast-close:hover { color: var(--ink); }

html.dark-mode .lp-toast {
    background: var(--dm-elevated, #1e2024);
    border-color: var(--dm-border, #33363d);
}

html.dark-mode .lp-toast-title { color: var(--dm-text, #e8eaed); }

html.dark-mode .lp-overlay-pill {
    background: var(--dm-elevated, #1e2024);
    border-color: var(--dm-border, #33363d);
    color: var(--dm-text, #e8eaed);
}

html.dark-mode .ui-detail-list > dt,
html.dark-mode .ui-detail-caption {
    color: var(--dm-muted) !important;
}

html.dark-mode .ui-detail-list > dd {
    color: var(--dm-text) !important;
}

html.dark-mode .ui-status,
html.dark-mode .ui-status.is-run {
    color: var(--dm-subtle) !important;
    background: var(--dm-elevated) !important;
}

html.dark-mode .ui-status.is-ok {
    color: color-mix(in srgb, var(--ok) 55%, white) !important;
    background: color-mix(in srgb, var(--ok) 22%, transparent) !important;
}

html.dark-mode .ui-status.is-err {
    color: color-mix(in srgb, var(--red-stat) 55%, white) !important;
    background: color-mix(in srgb, var(--red-stat) 24%, transparent) !important;
}

/* ==========================================================================================
   VF-5248: the static info callout and the one-line modal subtitle inside a Bootstrap .modal (restyled by modals.css).
   The .ui-callout family above is scoped to .ui-modal-backdrop and does not reach Bootstrap modals. Same contract:
   tint + 3px left border + mandatory leading icon, sentence case, one per modal. The subtitle is h3.modal-title > small,
   sized explicitly because <small> inherits the 15px body size. Tokens are remapped by html.dark-mode, so no dark override is needed.
   ========================================================================================== */
.modal .ui-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--acc-tint);
    border: 0;
    border-left: 3px solid var(--acc);
    padding: 12px 14px;
    border-radius: var(--r-ctl);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--ink-2);
    margin-bottom: 12px;
}

.modal .ui-callout > .pi {
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--acc);
}

.modal .ui-callout strong {
    color: var(--ink);
}

/* Danger variant for Bootstrap modals — same contract as the .ui-modal-backdrop one above: semantic red, never
   the brand accent; the leading warning glyph carries the severity for anyone who cannot perceive the hue. */
.modal .ui-callout.danger {
    background: var(--dgr-tint);
    border-left-color: var(--dgr);
}

.modal .ui-callout.danger > .pi {
    color: var(--dgr);
}

.modal h3.modal-title > small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ink-3);
}

/* ===== Rich select option (VF-5248) ========================================================================
   SlimSelect renders an <option>'s innerHTML in the list and as the selected value. A name on the left and a
   right-aligned meta part (e.g. a capacity "12 / 25", optionally preceded by a short flag such as "Group is full").
     <span class="ui-option-row"><span class="ui-option-name">…</span>
       <span class="ui-option-meta"><span class="ui-option-flag">…</span> <span class="ui-option-count">…</span></span></span>
   ========================================================================================================== */
.ui-option-row {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.ui-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-option-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    white-space: nowrap;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.ui-option-flag {
    font-size: 11.5px;
}

.ss-option-selected .ui-option-meta::after {
    content: "\2713";
    color: var(--acc);
}

/* ── SlimSelect panel skin, global (VF-5168, QA 2026-10-28 #14/#16). DESIGN.md › Selectors: panel
   surface + hairline, radius 10, --shadow-menu, padding 6; options radius 8, padding 0 x 10, hover
   surface-sunken; SELECTED = accent-tint + accent-ink, "never a saturated fill". Replaces the legacy
   square panel + saturated selected row (style_new.css / brand schema `.ss-option-selected {... !important}`)
   everywhere - including modals outside an .lp-form-recast form (Hunt Group Advanced, Edit User >
   Location). Light theme only: dark.css keeps its own .ss-content skin. */
html:not(.dark-mode) .ss-main .ss-content {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px;
    background-color: var(--srf);
    box-shadow: var(--shadow-menu);
}

html:not(.dark-mode) .ss-main .ss-content .ss-list .ss-option {
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--ink);
}

html:not(.dark-mode) .ss-main .ss-content .ss-list .ss-option:hover,
html:not(.dark-mode) .ss-main .ss-content .ss-list .ss-option.ss-highlighted {
    background-color: var(--srf-3);
    color: var(--ink);
}

/* no :not(.ss-disabled) - SlimSelect also marks the picked option ss-disabled */
html:not(.dark-mode) .ss-main .ss-content .ss-list .ss-option.ss-option-selected {
    background-color: var(--acc-tint) !important;
    color: var(--acc-ink) !important;
    font-weight: 600 !important;
}

/* SlimSelect sets `.ss-content .ss-list .ss-option * { display: inline-block }`: restore the layout inside the list */
.ss-content .ss-list .ss-option .ui-option-row {
    display: flex;
}

.ss-content .ss-list .ss-option .ui-option-meta {
    display: inline-flex;
}

/* highlighted / hovered rows recolour their text: the meta part and the check follow it */
.ss-content .ss-list .ss-option.ss-highlighted .ui-option-meta,
.ss-content .ss-list .ss-option:hover .ui-option-meta,
.ss-content .ss-list .ss-option.ss-highlighted .ui-option-meta::after,
.ss-content .ss-list .ss-option:hover .ui-option-meta::after {
    color: inherit;
}

/* a disabled option (e.g. a full group) is muted as a whole; its flag stays slightly darker */
.ss-content .ss-list .ss-option.ss-disabled .ui-option-meta {
    color: inherit;
}

.ss-content .ss-list .ss-option.ss-disabled .ui-option-flag {
    color: var(--ink-2);
}

html.dark-mode .ui-option-meta {
    color: var(--dm-muted) !important;
}

/* ===== SlimSelect placeholder (VF-5248) ===================================================================
   A single select that starts empty carries <option value="" data-placeholder="true">Choose …</option>: SlimSelect
   keeps it out of the list and shows its text in the empty field, wrapped in span.ss-disabled - muted here instead of
   the library's barely visible #dedede (dark mode: dark.css).
   ========================================================================================================== */
.ss-main .ss-single-selected .placeholder .ss-disabled {
    color: var(--ink-3);
}

/* ===== SlimSelect value ellipsis (VF-5248) =================================================================
   A plain-text value too long for the field ends in "…". SlimSelect's .placeholder is a flex box and Chrome draws no
   ellipsis for bare text inside one; a vertically centred block does (overflow / nowrap / text-overflow come from
   the library). Values with markup - rich options, the placeholder span - keep the library's flex layout.
   ========================================================================================================== */
.ss-main .ss-single-selected .placeholder:not(:has(*)) {
    display: block;
    align-self: center;
    line-height: 1.4;
}

/* ===== Disabled dropdown options (VF-5248) =================================================================
   An option that cannot be picked (an organization already assigned whole, a full group) stays readable: SlimSelect
   paints it #dedede and tail.select at 35% opacity, both close to invisible on white. Muted --ink-3 instead; the
   not-allowed cursor still marks it. Dark mode: dark.css covers SlimSelect; tail.select's dark options are forced to
   the text colour there, so its disabled ones need their own rule.
   ========================================================================================================== */
.ss-main .ss-content .ss-list .ss-option.ss-disabled,
.tail-select .select-dropdown ul li.dropdown-option.disabled {
    color: var(--ink-3);
    text-shadow: none;
}

html.dark-mode .tail-select .select-dropdown ul li.dropdown-option.disabled {
    color: var(--dm-muted) !important;
}

/* ===== Multi-select chips (VF-5248) ========================================================================
   Target of tail.select's `multiContainer`: the picked items as removable chips under the field (click = unselect),
   while the field itself reads "N selected".
     <div class="ui-select-chips" id="…"></div>   (tail.select fills it with div.select-handle elements)
   ========================================================================================================== */
.ui-select-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ui-select-chips:empty {
    display: none;
}

.ui-select-chips .select-handle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 8px 0 10px;
    border-radius: var(--r-ctl);
    background: var(--acc);
    color: var(--on-acc);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.ui-select-chips .select-handle::after {
    content: "\00d7";
    font-size: 15px;
    line-height: 1;
}

.ui-select-chips .select-handle:hover {
    background: var(--acc-hi);
}

/* ===== Multi-select "Select all" row (VF-5248) =============================================================
   ui-select-all.js heads a tail.select multi-select list with one bulk-select checkbox (checkboxes.css checkLabel /
   checkB):
     <label class="checkLabel ui-select-all"><input type="checkbox" class="checkB"/><span class="label-text"></span>
         <span class="ui-select-all-text">Select all</span></label>
   Sticky, so it stays at hand in a scrolled list; the line under it sets it apart from the options it acts on.
   ========================================================================================================== */
.tail-select .select-dropdown .ui-select-all {
    position: sticky;
    top: 0;
    left: auto;
    z-index: 22; /* over the options' check glyphs (tail.select draws them at z-index 21) */
    display: flex;
    align-items: center;
    margin: 0;
    padding: 6px 12px 6px 5px;
    border-bottom: 1px solid var(--line);
    background: var(--srf);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
}

.tail-select .select-dropdown .ui-select-all .label-text {
    display: inline-flex;
}

/* option-sized box centred in tail.select's 26px check glyph zone (5px + 16px + 5px), so the text lines up with the
   option texts */
.tail-select .select-dropdown .ui-select-all .label-text::before {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    border-radius: 5px;
    background-size: 11px 11px;
}

html.dark-mode .tail-select .select-dropdown .ui-select-all {
    border-bottom-color: var(--dm-border);
    background: var(--dm-surface);
    color: var(--dm-text);
}

/* ===== Multi-select checklist (VF-5261) ====================================================================
   UiSelectAll.toolbar() (ui-select-all.js) marks the tail.select container .ui-select-checklist and builds, inside
   the search row:
     <div class="ui-select-search"><span class="pi … ui-select-search-icon"></span><input class="search-input"/></div>
     <div class="ui-select-toolbar"><span class="ui-select-toolbar-count">2 of 28 selected</span>
         <button type="button" class="ui-select-toolbar-all">Select all</button>
         <button type="button" class="ui-select-toolbar-clear">Clear</button></div>
   Every option ends in a check box (accent fill + white check when selected) instead of the vendor's leading check
   glyph. The toolbar lives in the search row, which tail.select measures when it sizes the list, so the list keeps
   its full scroll range.
   ========================================================================================================== */
.tail-select.ui-select-checklist .ui-select-search {
    position: relative;
    display: flex;
}

.tail-select.ui-select-checklist .ui-select-search .search-input {
    padding-left: 32px;
}

.tail-select.ui-select-checklist .ui-select-search-icon {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: var(--ink-3);
    pointer-events: none;
    --pi-size: 16px;
}

.tail-select.ui-select-checklist .ui-select-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 2px 0;
    font-size: 12px;
    line-height: 16px;
}

.tail-select.ui-select-checklist .ui-select-toolbar-count {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ink-3);
}

.tail-select.ui-select-checklist .ui-select-toolbar button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
}

.tail-select.ui-select-checklist .ui-select-toolbar button:hover {
    color: var(--acc);
}

.tail-select.ui-select-checklist .ui-select-toolbar button:focus-visible {
    outline: 0;
    border-radius: 4px;
    box-shadow: var(--focus);
}

.tail-select.ui-select-checklist .ui-select-toolbar button:disabled {
    color: var(--ink-3);
    cursor: default;
}

.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option,
.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option.selected {
    padding: 7px 40px 7px 12px;
    color: var(--ink);
}

.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option::before {
    display: none;
}

.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--line-d);
    border-radius: 4px;
    background: var(--srf) center / 12px 12px no-repeat;
    transform: translateY(-50%);
}

.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option.selected::after {
    border-color: var(--acc);
    background-color: var(--acc);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option.disabled::after {
    border-color: var(--line);
    background-color: var(--srf-2);
}

html.dark-mode .tail-select.ui-select-checklist .ui-select-toolbar button {
    color: var(--dm-text);
}

html.dark-mode .tail-select.ui-select-checklist .ui-select-toolbar button:disabled,
html.dark-mode .tail-select.ui-select-checklist .ui-select-toolbar-count {
    color: var(--dm-muted);
}

html.dark-mode .tail-select.ui-select-checklist .select-dropdown ul li.dropdown-option:not(.selected)::after {
    border-color: var(--dm-border);
    background-color: var(--dm-surface);
}

/* ==========================================================================================
   VF-5261 shared ui-* additions (first used by the fax application modals; feature-agnostic)
     .ui-field.is-locked  - a field the page has already fixed: the read-only value at full contrast with a
                            leading lock glyph (.ui-field-lock), so it reads as "set for you", never as disabled
     .ui-field.is-invalid - also outlines a tail.select multi-select, whose label is the visible control
   ========================================================================================== */
.ui-modal-backdrop .ui-field .ui-field-lock-wrap {
    position: relative;
}

.ui-modal-backdrop .ui-field.is-locked input[readonly] {
    color: var(--ink);
    padding-left: 32px;
}

.ui-modal-backdrop .ui-field .ui-field-lock {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    --pi-size: 16px;
    color: var(--ink-3);
    pointer-events: none;
}

/* tail.select-default.min.css draws the .select-label border with !important (VF-5261 QA 62766/02: the Scopes picker
   stayed grey) */
.ui-modal-backdrop .ui-field.is-invalid .tail-select .select-label {
    border-color: var(--dgr) !important;
}

/* ==========================================================================================
   VF-5198 shared ui-* additions for server-paged AJAX tables (first used by Fax monitoring; feature-agnostic,
   driven by static/js/ajax-table.js)
     .lp-overlay-local     - a busy veil scoped to one widget keeps its pill inside that widget, so several tables
                             refreshing at once each show their own pill instead of one at the viewport centre
     .ui-table-error       - the error band of a table or widget that could not load: text + Retry
     .ui-row-expander      - leading chevron button of an expandable row (turns when its row is open)
     .ui-row-expanded / .ui-row-expansion - the open row and the full-width row holding its lazy content
     .ui-hscroll / .ui-hscroll-top - a wide table scrolled sideways, with a second scrollbar above it kept in step
                             with the one under it (PortalAjaxTable.topScrollbar), as on the Advanced View tables
   ========================================================================================== */
.ui-hscroll {
    /* the containing block of the table's absolutely positioned content (a header's .sr-only label): without it that
       content escapes the scroll box and widens the page */
    position: relative;
    overflow-x: auto;
    margin-bottom: 20px;
}

.ui-hscroll > .table {
    margin-bottom: 0;
}

.ui-hscroll-top {
    overflow-x: auto;
    overflow-y: hidden;
}

/* the bar's content: as wide as the table, one pixel high, so the bar is only its scrollbar */
.ui-hscroll-top > div {
    height: 1px;
}

.lp-overlay.lp-overlay-local .lp-overlay-pill {
    position: absolute;
}

/* room for the pill while busy only: an idle widget keeps its own height */
.lp-overlay.lp-overlay-local.is-busy {
    min-height: 64px;
}

.ui-table-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--r-ctl);
    background: var(--dgr-tint);
    color: var(--dgr-hi);
    font-size: 13.5px;
    font-weight: 500;
}

.table > tbody > tr.ui-table-error-row > td,
.table > tbody > tr.ui-table-error-row:hover > td {
    padding: 10px 0;
    background: transparent;
}

.ui-table-error .ui-table-error-retry {
    flex: none;
}

a.ui-row-expander {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--ink-3);
    text-decoration: none !important;
    --pi-size: 18px;
}

a.ui-row-expander:hover,
a.ui-row-expander:focus-visible {
    color: var(--acc-hi);
    background: var(--acc-tint);
}

a.ui-row-expander:focus-visible {
    outline: 2px solid var(--acc);
    outline-offset: 1px;
}

a.ui-row-expander .pi {
    transition: transform var(--dur-state, 160ms);
}

a.ui-row-expander[aria-expanded="true"] .pi {
    transform: rotate(90deg);
}

.table > tbody > tr.ui-row-expanded > td,
.table > tbody > tr.ui-row-expansion > td {
    background: var(--acc-tint);
}

.table > tbody > tr.ui-row-expansion > td {
    padding: 12px 16px 16px;
    border-top: 0;
}

.ui-row-expansion-content {
    position: relative;
    min-height: 120px;
}

html.dark-mode .ui-table-error {
    background: color-mix(in srgb, var(--dgr) 18%, var(--dm-surface));
    color: var(--dm-text);
}

html.dark-mode .table > tbody > tr.ui-row-expanded > td,
html.dark-mode .table > tbody > tr.ui-row-expansion > td {
    background: var(--dm-elevated);
}

/* ============================================================================
   Centred shell — ultra-wide layout cap (VF-5168, design_handoff_responsive §7)
   ----------------------------------------------------------------------------
   On screens wider than --shell-max the navbar contents, the sidebar rail and
   the main content well are capped at --shell-max and centred, so the page
   reads exactly as it does on a 1920 monitor instead of stretching across a
   2560 / 3440 / ultra-wide display. The leftover space becomes a plain gutter
   on each side.

   Pure CSS, no DOM wrapper: the portal shell is a fixed full-width navbar +
   a float:left `.navdiv` rail + a normal-flow `.container-fluid` that fills the
   rest. A viewport-derived gutter re-creates the "centred band" without any
   per-page markup change:
     gutter = (100vw - --shell-max) / 2
     • navbar       → symmetric horizontal padding = gutter   (brand strip stays
                      full-bleed; only its contents inset and centre)
     • .navdiv rail → margin-left  = gutter  (band's left edge)
     • container    → margin-right = gutter  (band's right edge; its left edge is
                      already bounded by the floated rail)

   Guarded by `min-width: 1921px` so there is provably ZERO change at or below
   1920 — the common case. Modals / spinners / toasts are viewport overlays and
   are intentionally left full-viewport. Works across all six nav contexts
   because the rules target the shared shell classes. Dark-mode safe.
   ============================================================================ */
:root {
    --shell-max: 1920px;
    /* Side gutters: a hair darker than the page (--bg) so the centred band reads
       as intentional. The 1px --line edge on the band is the crisp separator. */
    --shell-gutter-bg: color-mix(in srgb, var(--bg) 92%, #000);
}

@media (min-width: 1921px) {
    nav.navbar-invert.navbar-fixed-top {
        padding-left: calc((100vw - var(--shell-max)) / 2);
        padding-right: calc((100vw - var(--shell-max)) / 2);
    }

    .navdiv {
        margin-left: calc((100vw - var(--shell-max)) / 2);
        border-left: 1px solid var(--line);
    }

    /* ~150 templates wrap the aside-* include in an extra <div class="navdiv">
       (to carry a th:if), and the fragment root is itself .navdiv — so the rail
       renders as .navdiv > .navdiv. Neutralise the inner one or the gutter
       margin (and band edge) would apply twice, pushing the rail into the
       content (seen on System > Domains at >1920px). */
    .navdiv .navdiv {
        margin-left: 0;
        border-left: 0;
    }

    body > div.container-fluid {
        margin-right: calc((100vw - var(--shell-max)) / 2);
        border-right: 1px solid var(--line);
    }

    /* Gutters = exposed body background; keep the band (container well) on --bg. */
    body {
        background-color: var(--shell-gutter-bg);
    }

    body > div.container-fluid {
        background-color: var(--bg);
    }

    /* Dark mode: gutter a step below the dark page bg; band keeps the dark bg.
       dark.css paints `html.dark-mode body` with !important, so match it here;
       the container-fluid override wins on specificity + load order. */
    html.dark-mode body {
        background-color: color-mix(in srgb, var(--dm-bg) 80%, #000) !important;
    }

    html.dark-mode .navdiv {
        border-left-color: var(--dm-border);
    }

    html.dark-mode body > div.container-fluid {
        background-color: var(--dm-bg);
        border-right-color: var(--dm-border);
    }
}

/* =====================================================================
 * Page title + description (DESIGN.md component.page-header) — ui-style-sweep 2026-10-21.
 * The parts/page-title fragment's bare <h2> inherited Bootstrap's 30px/500; DESIGN.md
 * page-title is 21px/800. Scoped to the fragment's classes so it reaches every page that
 * uses parts/page-title without touching the global <h2> element.
 * ===================================================================== */
.lp-page-title {
    font-size: 21px;
    font-weight: 700; /* DESIGN.md typography.page-title 700 (Inter max hosted weight; was 800 synthetic) */
    line-height: 1.25;
    color: var(--ink);
}
.lp-page-desc {
    font-size: 12.5px; /* DESIGN.md typography.helper */
    font-weight: 500;
    line-height: 1.6;
    color: var(--ink-2); /* DESIGN.md page description = colors.ink-secondary #4B5158 (was --ink-3 ink-muted) */
}
/* VF-5168 (QA 2026-10-28 #09): page descriptions are disabled globally. The parts/page-title fragment
   and the hand-written .lp-page-desc paragraphs are commented out in the templates; this hides the remaining
   legacy pages whose bare <p> description sits directly under the page <h2>. NOTE: DESIGN.md PageHeader
   still documents the description line (drift flagged to the design owner). */
.lp-page-desc,
.container-fluid > h2 + p {
    display: none;
}

/* =====================================================================
 * .lp-form-recast — OPT-IN page-form recast onto the design-system tokens
 * =====================================================================
 * Add this class to a Bootstrap `form.form-horizontal` to recast its labels,
 * inputs, native/SlimSelect dropdowns, section headings, radio rows and
 * required-field note onto the design tokens, and to flatten the horizontal
 * grid to the "label over field" grammar. Opt-in by design: every rule is
 * scoped under `.lp-form-recast`, so a form without the class is untouched —
 * no fleet blast. These rules out-specificity the legacy style_new.css
 * `.form-control` / `label` / `h4` / `.select-domains` rules; the SlimSelect
 * border needs `!important` to beat style_new.css's own `!important`.
 *
 * Origin: the proven page-local recast of group/attendant/attendant-edit.html
 * (ui-style-sweep 2026-10-20, 09-aa-edit), generalized here and shared across
 * the Auto Attendant form pages (attendant-edit / attendant-new /
 * attendant_hours / submenu-edit). Page-specific bits (the inline
 * "Transfer to operator [N] seconds" row) stay in the page's own <style>.
 *
 * Multi-column entry tables: the hours/submenu "key · description · action ·
 * action-data" rows live under a `[data-id]` container (businessEntries,
 * afterEntries, holidayEntries, submenuEntries) and must NOT be stacked, so
 * the full-width flatten carves them out with `:not([data-id] ...)`. Their
 * labels/inputs still pick up the token typography (that's layout-safe).
 * --------------------------------------------------------------------- */

/* Row: design-system spacing scale (20px between rows). */
.lp-form-recast .form-group.row,
.lp-form-recast .form-group.mb-20 {
    margin-bottom: 20px;
    /* Cancel Bootstrap's negative row gutter (`.row { margin: 0 -15px }`). This recast zeroes the
       column padding-left/right below (grid flattened to stacked label-over-field), so the -15px pull
       is UNcompensated and would drag every field row 15px left — overrunning the container's (.well)
       left padding until controls nearly touch its border. Zero it so content sits on the padded edge. */
    margin-left: 0;
    margin-right: 0;
}

/* Flatten the Bootstrap form-horizontal grid to label-over-field: the label
   and its field column become full-width stacked blocks, the field column
   caps at a form-sensible width. Excluded: rows inside a [data-id] entry
   container (the multi-column key/description/action tables), which must keep
   their side-by-side columns. */
.lp-form-recast .form-group.row:not([data-id] .form-group.row) > label[class*="col-"],
.lp-form-recast .form-group.row:not([data-id] .form-group.row) > div[class*="col-"] {
    float: none;
    width: 100%;
    max-width: 420px;
    padding-left: 0;
    padding-right: 0;
}
.lp-form-recast .form-group.row:not([data-id] .form-group.row) > label.col-md-1 {
    max-width: 100px;
}

/* Field labels — typography.label 12/600, colors.ink; drop the legacy
   14/400 #3F4047. Covers the col-md-4 / col-xs-4 / col-sm-4 / col-md-1
   label widths these forms use. */
.lp-form-recast label.col-md-4,
.lp-form-recast label.col-xs-4,
.lp-form-recast label.col-sm-4,
.lp-form-recast label.col-md-1 {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 6px;
    padding-top: 0;
}

/* Required asterisk — colors.danger. */
.lp-form-recast label sup {
    color: var(--dgr);
    font-weight: 600;
}

/* Inputs & native selects — typography.body 13.5/500 ink, border #D3D7DE. */
.lp-form-recast .form-control,
.lp-form-recast .ss-main .ss-single-selected {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    border-color: var(--line-d) !important; /* beat style_new.css .ss-single-selected !important */
}

/* Placeholder — colors.ink-muted #878D95 (drop legacy #666666). */
.lp-form-recast .form-control::placeholder {
    color: var(--ink-3);
}

/* Focus — the brand --focus ring, no native Bootstrap #66AFE9 glow. */
.lp-form-recast .form-control:focus,
.lp-form-recast .ss-main.ss-open-below .ss-single-selected,
.lp-form-recast .ss-main.ss-open-above .ss-single-selected {
    border-color: var(--acc);
    box-shadow: var(--focus);
    outline: 0;
}

/* Welded local-part @ domain input-group — InputGroup flattens the inner
   (joined) corners only; outer corners stay --r-ctl 8px (overrides the
   legacy .select-domains 4px). This service-user-id pattern recurs across
   the AA forms (edit + new), so it lives on the shared class. */
.lp-form-recast .id-separator-domain-clipboard-copy > #uuid.form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.lp-form-recast .id-separator-domain-clipboard-copy > .input-group-addon {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    /* Highlight the "@" separator as a distinct chip (surface-sunken fill + bold ink glyph) so it reads
       as a styled join between the local-part input and the domain select, not a blank white seam. The
       top/bottom borders match the fields' --line-d so the welded shell outline is continuous. */
    border-top: 1px solid var(--line-d);
    border-bottom: 1px solid var(--line-d);
    background: var(--srf-3);
    color: var(--ink);
    font-weight: 600;
}
.lp-form-recast .select-domains.select-domains {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--r-ctl) !important;
    border-bottom-right-radius: var(--r-ctl) !important;
    /* Chrome clamps native-<select> border-radius to ~4px unless the native
       appearance is stripped; without this the right corners stay ~4px and
       don't match the 8px user-part input. Removing the appearance also drops
       the native arrow, so a matching grey chevron is painted in its place
       (same recipe as the BLF domain select, style_new.css #list-URI-domain-part). */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234B5158' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

/* Opt-in welded local-part @ domain InputGroup for surfaces outside .lp-form-recast (e.g. the
   Bulk Users Import table's User ID / Line Port cells). Same grammar as the weld above: outer
   corners keep --r-ctl, inner joins are square, the "@" is a grey --srf-3 chip. Stretching the
   row lets the chip take the fields' height instead of the legacy fixed 2.43em addon. */
.lp-id-domain-weld.id-separator-domain-clipboard-copy {
    align-items: stretch;
}
.lp-id-domain-weld > input.form-control {
    border-top-left-radius: var(--r-ctl);
    border-bottom-left-radius: var(--r-ctl);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.lp-id-domain-weld.id-separator-domain-clipboard-copy > .input-group-addon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0 10px;
    border: 1px solid var(--line-d);
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background: var(--srf-3);
    color: var(--ink);
    font-weight: 600;
}
.lp-id-domain-weld > select.form-control.form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--r-ctl) !important; /* beat style_new.css .select-domains 4px !important */
    border-bottom-right-radius: var(--r-ctl) !important;
    /* Chrome clamps native-<select> radius to ~4px unless the appearance is stripped; repaint the chevron. */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234B5158' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

/* Determinate progress bar — DESIGN.md › ProgressStrip (determinate form): a 4px NEUTRAL fill on a neutral rail.
   Never the accent (it marks the one primary action, not progress) and never a status colour — the outcome of
   the thing being tracked is carried by a .ui-status pill next to the bar. Markup (JS sets --ui-progress and
   aria-valuenow together):
     <div class="ui-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="42"
          aria-label="…" style="--ui-progress:42%"><i></i></div>
   With its numeric value: wrap both in .ui-progress-cell —
     <div class="ui-progress-cell"> …the bar… <span class="ui-progress-value">42%</span></div>
   Replaces the legacy Bootstrap .progress > .progress-bar (20px, striped, accent-blue) for new surfaces. */
.ui-progress {
    display: block;
    flex: 1 1 auto;
    min-width: 60px;
    height: 4px;
    border-radius: 2px;
    background: var(--busy-track, var(--line-d));
    overflow: hidden;
}

.ui-progress > i {
    display: block;
    height: 100%;
    width: var(--ui-progress, 0%);
    border-radius: inherit;
    background: var(--busy-fill, var(--ink-2));
    transition: width 240ms ease;
}

.ui-progress-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui-progress-value {
    flex: none;
    min-width: 38px;
    text-align: right;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}

html.dark-mode .ui-progress {
    background: rgba(255, 255, 255, .18);
}

html.dark-mode .ui-progress > i {
    background: #FFFFFF;
}

html.dark-mode .ui-progress-value {
    color: #FFFFFF;
}

/* Warning banner — the page-level notice showTopMessage(…, "warning" | "banner") renders (div[data-notification]).
   DESIGN.md › banner-warn: there is no amber warning; a warning is the danger hue at lower weight — white
   surface, 1px danger border, secondary ink, control radius. Replaces the legacy amber gradient
   (logicom-custom-theme.css / Bootstrap .alert-warning) and dark.css's amber fill for this banner only. */
div[data-notification].alert-warning {
    background: var(--srf) !important;
    background-image: none !important;
    filter: none;
    box-shadow: none !important;
    border: 1px solid var(--dgr) !important;
    border-radius: var(--r-ctl);
    color: var(--ink-2) !important;
    padding: 12px 14px;
}

div[data-notification].alert-warning strong {
    color: var(--ink) !important;
}

html.dark-mode div[data-notification].alert-warning {
    background: transparent !important;
    color: #FFFFFF !important;
}

html.dark-mode div[data-notification].alert-warning strong {
    color: #FFFFFF !important;
}

/* Invalid control in a table cell (e.g. a bulk-import row field that failed validation): the cell's
   inputs / selects / tail.select label take the danger border so the bad field is visible in a wide grid. */
.ui-cell-invalid .form-control,
.ui-cell-invalid select,
.ui-cell-invalid .tail-select .select-label {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 1px var(--red);
}

/* Device picker welded to its "Add Device" button: loadSelector() converts the
   #deviceProfileName <select> to a SlimSelect, which injects a .ss-main wrapper
   that Bootstrap's .input-group corner-flattening never sees, so the select box
   keeps a rounded right edge against the button. Flatten its right corners (the
   button's left corners are already flattened by buttons.css
   .input-group-btn:last-child). Scoped to .input-group — the only SlimSelect
   sitting inside an input-group on a recast form is this device picker. */
.lp-form-recast .input-group > .ss-main .ss-single-selected {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Section headings — panel-title 16/700 ink (drop legacy h4 18/500 #333). */
.lp-form-recast h4 {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
    margin: 24px 0 12px;
}

/* Required-field note — typography.helper 12.5/500, colors.ink-muted. */
.lp-form-recast .aa-required-note {
    font-size: 12.5px;
    font-weight: 500;
    font-style: italic;
    color: var(--ink-3);
    display: block;
    margin: 0 0 20px;
}

/* Radio rows — gap on the design scale; numeric inputs pick up tabular figures. */
.lp-form-recast .form-check {
    margin-bottom: 8px;
}
.lp-form-recast .form-check-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
}

/* label-input-rows renders each radio OPTION as a Bootstrap `.form-check.row`
   whose parts are grid columns (radio col-md-1 · label col-md-7 · optional prefix
   input col-md-4). Once the recast zeroes the field column's padding, the row's
   -15px gutters are uncompensated and drag the radio past the well's left border.
   Lay the option out as a simple left-anchored flex flow and strip the column
   float/width/padding from its parts. Scoped to `.form-check.row`, so the plain
   `.form-check` radios on the AA forms are untouched. */
.lp-form-recast .form-check.row {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
/* NB: do NOT reset the radio <input> here — it keeps its global design-system
   sizing (20x20 circle); float is already ignored inside this flex row and its
   padding/margin are zero from the global rule. Only the label and the optional
   prefix-input column need their col-md float/width/padding stripped. */
.lp-form-recast .form-check.row > .form-check-label,
.lp-form-recast .form-check.row > .inp-cont {
    float: none;
    width: auto;
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}
/* The optional prefix input follows the label inline, so it keeps a sensible
   fixed width instead of the old col-md-4 share. */
.lp-form-recast .form-check.row > .inp-cont {
    width: 160px;
}

.lp-form-recast input.form-control[type="text"][inputmode="numeric"],
.lp-form-recast #extension,
.lp-form-recast #firstDigitTimeoutSeconds,
.lp-form-recast #time_zone,
.lp-form-recast #phoneNumber {
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
 * #user-form — the full user-creation forms (add-new-user / add-new-user-flow2)
 * ---------------------------------------------------------------------
 * These pages opt into .lp-form-recast, but their label+field rows are plain
 * `.form-group` (no `.row`), which the generic flatten above (keyed on
 * `.form-group.row`) does not catch — so those rows stayed horizontal while the
 * few `.form-group.row` rows flattened, giving a broken half-horizontal/half-stacked
 * mix. Flatten the plain rows too, scoped to #user-form (so no other recast page is
 * touched) and only on rows that carry a col-* LABEL (a real label+field row), which
 * leaves the action/button rows — `.form-group.col-xs-12` with no col-label — alone.
 * The wide Service Pack card row keeps full width instead of the 420 field cap.
 * ===================================================================== */
#user-form.lp-form-recast .form-group:has(> label[class*="col-"]) {
    margin-bottom: 20px;
    /* `.form-horizontal .form-group` carries Bootstrap's -15px row gutters; the flatten below zeroes the
       column padding that normally compensates, so without zeroing these the whole row is dragged 15px left
       and overruns the well's padding (controls touch the left edge). Zero them so every field sits on the
       well's padded edge (same left padding across all rows). */
    margin-left: 0;
    margin-right: 0;
}
#user-form.lp-form-recast .form-group:has(> label[class*="col-"]) > label[class*="col-"],
#user-form.lp-form-recast .form-group:has(> label[class*="col-"]) > div[class*="col-"] {
    float: none;
    width: 100%;
    max-width: 420px;
    padding-left: 0;
    padding-right: 0;
}
/* Service Pack row holds two plan cards side by side — don't cap it at the field width
   (!important beats the equally-specific label-row flatten rule above). */
#user-form.lp-form-recast .form-group:has(.webex-modal-panel) > div[class*="col-"] {
    max-width: none !important;
}

/* Service Pack plan cards onto the design PlanCard look: --srf fill, --r-panel radius with overflow
   hidden (so the header rule and footer button corners follow the radius), 1px --line-2 (== portal
   --line-d) border → --acc + focus ring when selected. Scoped to #user-form so the Webex activation
   modal that reuses .webex-modal-panel is untouched. */
#user-form .webex-modal-panel {
    background: var(--srf, #fff);
    border: 1px solid var(--line-d, #d3d7de);
    border-radius: var(--r-panel, 10px);
    overflow: hidden;
}
#user-form .webex-modal-panel.active {
    border-color: var(--acc);
    box-shadow: var(--focus, 0 0 0 3px rgba(237, 159, 43, .35));
}
#user-form .webex-modal-panel-header {
    padding: 12px 14px;
    border-bottom-color: var(--line, #e8eaed);
}

/* ===== ROW KEBAB (.ui-kebab) ===== VF-5144. The table-row kebab of DESIGN.md > Tables "page table - kebab + action
   row": a bare 32px IconButton (48px tap target at <=767px). more_vert rests grey ({colors.ink-muted}) and turns the
   tenant accent on a button-like srf-3 surface on hover / keyboard focus / while its action row is open
   (aria-expanded="true") - the same grey-to-accent behaviour as the copy affordance. --focus ring for keyboard focus.
   Markup: parts/row-kebab :: row-kebab(index) (JS-built rows: lpRowKebab()). Behaviour shared by every page:
   common-functions.js (aria-expanded sync, Space). Feature-agnostic: no page selectors, no ids. */
.ui-kebab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--ink-3);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.ui-kebab .pi {
    --pi-size: 20px;
}

/* Mouse focus leaves no trace: a kebab just closed by a click keeps focus but must read as resting grey - the legacy
   `a:focus { color: #23527c }` (logicom-custom.min.css, 0,1,1) would otherwise paint it link blue. Declared BEFORE the
   hover / keyboard-focus / open rule below so those still win while they apply. */
.ui-kebab:focus {
    color: var(--ink-3);
    outline: none;
    text-decoration: none;
}

.ui-kebab:hover,
.ui-kebab:focus-visible,
.ui-kebab[aria-expanded="true"] {
    background: var(--srf-3);
    color: var(--acc);
    text-decoration: none;
}

.ui-kebab:focus-visible {
    box-shadow: var(--focus);
}

@media (max-width: 767px) {
    .ui-kebab {
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ui-kebab {
        transition: none;
    }
}
