/* AnyShape - Global Stylesheet */
:root {
  --navy:      #1B3A5C;
  --blue:      #2E75B6;
  --light-blue:#D5E8F0;
  --mid-blue:  #BDD7EE;
  --silver:    #F2F2F2;
  --dark-gray: #404040;
  --mid-gray:  #666666;
  --white:     #FFFFFF;
  --orange:    #E67E22;
  --green:     #27AE60;
  --red:       #C0392B;
  --radius:    4px;
  --shadow:    0 2px 8px rgba(0,0,0,0.12);
  /* v4.209.0: --soft was used in ~297 places across CSS, PHP and JS but was never
     defined. An undefined custom property with no fallback is invalid at
     computed-value time, so `color: var(--soft)` fell back to the inherited
     colour and those elements rendered at full body weight instead of muted.
     269 of those uses had no fallback; the other 28 carried six different
     hand-picked greys (#6b7280, #9ca3af, #6b7a8d, #94a3b8, #64748b, #5b6573),
     which this token now unifies. */
  --soft:      #6b7280;
  /* v5.63.0a: the record form's per-field gutter - the fixed column at the right of
     every field wrapper that carries the menu glyph. ONE DECLARATION: both the button
     and the inert spacer that stands in for it read this, so the two can never drift
     apart and leave a redacted field a different width from its neighbours.
     16px, not the 24px v5.63.0 shipped. That number was the WCAG 2.2 minimum CLICK
     TARGET, and using it as the visual column made a glyph about 3px wide sit in the
     middle of a 24px space - so it read as detached from the control it belongs to,
     and on a three-column form it took 9% of a 265px field. The target size is met by
     the button's height and the vertical spacing between fields instead of by padding
     the column out sideways. */
  --rec-field-gutter: 16px;
}

/* ── High contrast mode ──────────────────────────────────────── */
[data-contrast="high"] {
  --navy:      #FFFFFF;
  --blue:      #FFDD00;
  --light-blue:#1A1A1A;
  --mid-blue:  #444444;
  --silver:    #121212;
  --dark-gray: #FFFFFF;
  --mid-gray:  #CCCCCC;
  --white:     #1A1A1A;
  --orange:    #FFAA00;
  --green:     #00FF88;
  --red:       #FF5555;
  --shadow:    0 2px 8px rgba(255,255,255,0.08);
  /* v4.209.0: high contrast MUST carry its own --soft. The base #6b7280 measures
     3.9:1 on the #121212 body and 3.6:1 on #1A1A1A cards, under the 4.5:1 AA
     floor, and most --soft sites are 10-12px. Before the token existed these
     elements inherited #FFFFFF (about 18:1). #CCCCCC restores 11.7:1 and matches
     --mid-gray in this palette. Never let this mode inherit the base value. */
  --soft:      #CCCCCC;
}
[data-contrast="high"] body { background:#121212; color:#FFFFFF; }
[data-contrast="high"] .app-nav { background:#000000; border-bottom:2px solid #FFDD00; }
[data-contrast="high"] .nav-brand { color:#FFDD00; }
/* v4.35.0: in high-contrast the band loses its colour (black/yellow wins via
   the .app-nav rule above), so the words carry the signal. The environment
   becomes a solid yellow block - the single loudest element - while purpose
   stays a yellow outline so the env clearly dominates. */
[data-contrast="high"] .nav-env { background:#FFDD00; color:#141414; }
[data-contrast="high"] .nav-maint { background:#FFDD00; color:#141414;
                                    box-shadow:0 0 0 2px #141414; }  /* dark ring: white would
                                    blur into the yellow at the edge (v5.4.0c) */
[data-contrast="high"] .nav-purpose { background:transparent; border:1px solid #FFDD00; color:#FFDD00; }
[data-contrast="high"] .nav-purpose-dot { background:transparent; box-shadow:inset 0 0 0 2px #FFDD00; }
[data-contrast="high"] .nav-sep { background:#FFDD00; }
[data-contrast="high"] .nav-version { color:#FFDD00; border-top-color:#444444; }
[data-contrast="high"] .nav-link { color:#FFFFFF; }
[data-contrast="high"] .nav-link:hover,
[data-contrast="high"] .nav-link.active { background:#333333; color:#FFDD00; outline:1px solid #FFDD00; }
[data-contrast="high"] .btn-primary  { background:#FFDD00; color:#000000; border:2px solid #FFDD00; }
[data-contrast="high"] .btn-primary:hover { background:#FFE84D; }
[data-contrast="high"] .btn-secondary { background:#000000; color:#FFDD00; border:2px solid #FFDD00; }
[data-contrast="high"] .btn-secondary:hover { background:#222222; }
[data-contrast="high"] .btn-ghost { background:#000000; color:#FFFFFF; border:2px solid #FFFFFF; }
[data-contrast="high"] .btn-ghost:hover { background:#222222; color:#FFDD00; border-color:#FFDD00; }
[data-contrast="high"] .btn-danger { background:#FF5555; color:#000000; border:2px solid #FF5555; }
[data-contrast="high"] .form-control { background:#000000; color:#FFFFFF; border:2px solid #FFFFFF; }
[data-contrast="high"] .form-control:focus { border-color:#FFDD00; box-shadow:0 0 0 2px rgba(255,221,0,0.4); }
[data-contrast="high"] .modal { background:#1A1A1A; border:2px solid #FFFFFF; }
[data-contrast="high"] .modal-header { border-bottom:1px solid #444444; }
[data-contrast="high"] .modal-footer { border-top:1px solid #444444; }
[data-contrast="high"] .alert-info    { background:#002244; color:#99CCFF; border-color:#3366AA; }
[data-contrast="high"] .alert-success { background:#003311; color:#00FF88; border-color:#006622; }
[data-contrast="high"] .alert-error   { background:#330011; color:#FF5555; border-color:#660022; }
[data-contrast="high"] .alert-warning { background:#332200; color:#FFAA00; border-color:#664400; }
[data-contrast="high"] .login-card { background:#1A1A1A; border:2px solid #FFFFFF; }
[data-contrast="high"] .login-card .form-control { background:#000000; color:#FFFFFF; }
/* v5.14.1: the divider label masks the rules with the CARD's background, and high contrast repaints
   the card, so the mask has to follow it. Without this a white block sits behind the label. */
[data-contrast="high"] .oauth-divider span { background:#1A1A1A; }
[data-contrast="high"] .section-card,
[data-contrast="high"] .add-user-form { background:#1A1A1A; border:1px solid #444444; }
[data-contrast="high"] .data-table th,
[data-contrast="high"] .users-table th,
[data-contrast="high"] .col-table th,
[data-contrast="high"] .pl-list-table th,
[data-contrast="high"] .views-table th,
[data-contrast="high"] .roles-table th,
[data-contrast="high"] .teams-table th,
[data-contrast="high"] .perm-grid th,
[data-contrast="high"] .perm-matrix th,
[data-contrast="high"] .members-table th { background:#000000; color:#FFDD00; border-bottom:2px solid #FFDD00; }
[data-contrast="high"] .data-table td,
[data-contrast="high"] .users-table td,
[data-contrast="high"] .col-table td,
[data-contrast="high"] .pl-list-table td,
[data-contrast="high"] .views-table td,
[data-contrast="high"] .roles-table td,
[data-contrast="high"] .teams-table td,
[data-contrast="high"] .perm-grid td,
[data-contrast="high"] .perm-matrix td,
[data-contrast="high"] .members-table td { border-bottom:1px solid #333333; color:#FFFFFF; }
[data-contrast="high"] .data-table tr:nth-child(even) td,
[data-contrast="high"] .users-table tr:nth-child(even) td,
[data-contrast="high"] .col-table tr:nth-child(even) td,
[data-contrast="high"] .pl-list-table tr:nth-child(even) td,
[data-contrast="high"] .views-table tr:nth-child(even) td,
[data-contrast="high"] .roles-table tr:nth-child(even) td,
[data-contrast="high"] .teams-table tr:nth-child(even) td { background:#222222; }
[data-contrast="high"] select option { background:#1A1A1A; color:#FFFFFF; }
/* Roles permission grid: compact picker select and the None ladder segment are
   not standard form controls, so give them explicit high-contrast treatment. */
[data-contrast="high"] .perm-read { background:#000000; color:#FFFFFF; border:1px solid #FFFFFF; }
[data-contrast="high"] .rl-seg.rl-none-on { color:#1A1A1A; }
[data-contrast="high"] .tab { color:#CCCCCC; }
[data-contrast="high"] .tab.active { color:#FFDD00; border-bottom-color:#FFDD00; }
[data-contrast="high"] .badge { background:rgba(255,221,0,0.2); color:#FFDD00; }
[data-contrast="high"] .page-main { color: #FFFFFF; }
[data-contrast="high"] .ag-theme-alpine {
    --ag-background-color: #1A1A1A;
    --ag-odd-row-background-color: #1A1A1A;
    --ag-even-row-background-color: #222222;
    --ag-header-background-color: #000000;
    --ag-header-foreground-color: #FFDD00;
    --ag-foreground-color: #FFFFFF;
    --ag-secondary-foreground-color: #FFFFFF;
    --ag-border-color: #444444;
    --ag-row-border-color: #333333;
    --ag-row-hover-color: #2A2A2A;
    --ag-selected-row-background-color: #002244;
    --ag-range-selection-border-color: #FFDD00;
    --ag-input-focus-border-color: #FFDD00;
    --ag-checkbox-checked-color: #FFDD00;
}
[data-contrast="high"] .ag-theme-alpine .ag-row { color: #FFFFFF !important; }
[data-contrast="high"] .ag-theme-alpine .ag-row-even { background-color: #222222 !important; }
[data-contrast="high"] .ag-theme-alpine .ag-row-odd  { background-color: #1A1A1A !important; }
[data-contrast="high"] .ag-theme-alpine .ag-row-selected,
[data-contrast="high"] .ag-theme-alpine .ag-row-selected.ag-row-even,
[data-contrast="high"] .ag-theme-alpine .ag-row-selected.ag-row-odd { background-color: #002244 !important; }
[data-contrast="high"] .ag-theme-alpine .ag-cell { color: #FFFFFF !important; border-color: #333333; }
[data-contrast="high"] .ag-theme-alpine .ag-header-cell { color: #FFDD00; }
[data-contrast="high"] .ag-theme-alpine .ag-paging-panel { background:#000; color:#FFF; }
[data-contrast="high"] #contrast-toggle { background:#FFDD00; color:#000000; border:2px solid #FFDD00; font-weight:700; }

/* ── Contrast toggle button ──────────────────────────────────── */
#contrast-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
#contrast-toggle:hover { border-color:#FFFFFF; color:#FFFFFF; }
*,*::before,*::after { box-sizing: border-box; margin:0; padding:0; }
body { font-family: Arial, sans-serif; font-size: 14px; color: var(--dark-gray); background: var(--silver); }

/* Nav */
/* v5.1.0b: page minimum width, derived rather than chosen.
   The nav is a single non-wrapping row (brand, purpose and environment pills, the
   direct entity links, the record-types dropdown, user, timezone, contrast, logout)
   and it cannot shrink, so it sets a floor on how narrow the page can be. Nothing
   used to know that floor existed, which produced two faults below that width:
   scrolling right into blank page, because the containers were 100% of the WINDOW
   rather than of the scrollable width; and the coloured band stopping at the window
   edge, stranding Contrast and Logout on the page background where they were barely
   readable.
   min-content means "the narrowest this can be without anything overflowing", which
   the browser computes from the real content, so every deployment gets its own floor
   with no constant to maintain. That matters: measured on two installs of this same
   product the figure was 1117 and 1188, so any hardcoded number would have forced
   the narrower one to scroll for no reason. Verified in a browser on both before
   shipping; the page figure tracked the nav figure exactly.
   DEPENDS ON the panel-level overflow above. A table with no scroll container of its
   own contributes its full width here and would blow the minimum up. If a future page
   scrolls horizontally for no obvious reason, look for an unwrapped wide table before
   anything else. */
/* v5.53.0: SCOPED AWAY FROM EMBED MODE. This floor exists for the sake of .app-nav
   (see the rule below): it keeps the coloured band spanning the full scrollable
   width so Contrast and Logout are never stranded on the page background. The
   chromeless pinned grid renders NO nav at all - grid_page.php does
   `if (empty($gridEmbed)) renderNav($pageKey)` - so the rule protected nothing there
   and cost a page horizontal scrollbar in the record rail.
   HOW IT BIT: min-content floors the BODY to its widest unbreakable content, which
   in the embed is the one-row toolbar. body was therefore sized to 998px inside a
   758px viewport, and .page-main / .page-header / .toolbar simply inherited that
   width. Because the toolbar was never squeezed, its own
   `.embed-mode .toolbar{min-width:0;overflow-x:auto}` (v4.205.0b) could not engage -
   measured 950/950, exactly fitting its content with nothing to scroll - so the
   overflow landed on the document instead. The vertical scrollbar followed: chrome
   measured 93px against the 104px grid-height budget, which fits, until the
   horizontal scrollbar took 15px of viewport height and pushed 670px of content into
   659px. One cause, both bars.
   The comment below already predicted this shape - "if a future page scrolls
   horizontally for no obvious reason, look for an unwrapped wide table before
   anything else". It was an unwrapped wide toolbar. */
body:not(.embed-mode) { min-width: min-content; }
/* Width of the CONTENT, with a floor of the full width, so the band spans the whole
   scrollable page rather than stopping at the window edge. Belt and braces alongside
   the rule above: if some future content ever pushes the page wider than the nav, the
   controls still sit on navy instead of being stranded. */
.app-nav { display:flex; justify-content:space-between; align-items:center; background:var(--env-bg, var(--navy)); padding:0 16px; height:48px; position:sticky; top:0; z-index:100; box-shadow:var(--shadow); width:max-content; min-width:100%; }
.nav-brand { color:var(--white); font-weight:700; font-size:18px; margin-right:24px; }
/* v4.35.0: environment + purpose indicator pills (in nav-left, after brand). */
.nav-env { font-size:12px; line-height:1.7; padding:2px 9px; border-radius:999px; background:rgba(255,255,255,0.18); color:#fff; text-transform:uppercase; letter-spacing:0.04em; white-space:nowrap; }
/* v5.4.0c: maintenance-bypass band. MUST come after .nav-env: both are single-class
   selectors, so equal specificity means source order decides. v5.4.0/a/b had this rule
   BEFORE .nav-env, so the pill background silently overwrote the red and the band looked
   like any other env pill in normal contrast. High contrast was unaffected because its
   override carries attribute+class specificity, which is why only normal mode looked wrong.
   The white ring is deliberate: the nav background is operator-configurable via the env
   colour and can itself be red, so the band cannot rely on contrasting with it. */
.nav-maint { background:#B03A2E; color:#fff; font-weight:600;
             box-shadow:0 0 0 2px rgba(255,255,255,0.92); }
.nav-purpose { display:inline-flex; align-items:center; gap:6px; font-size:12px; line-height:1.7; padding:2px 9px; border-radius:999px; background:rgba(255,255,255,0.16); color:#fff; white-space:nowrap; }
.nav-purpose-dot { width:8px; height:8px; border-radius:50%; background:var(--p-dot,#fff); display:inline-block; flex:none; }
/* v4.35.1: separates the env/purpose indicator from the first nav item. */
.nav-sep { width:1px; height:22px; background:rgba(255,255,255,0.4); margin:0 8px; flex:none; align-self:center; }
/* v4.35.0: installed version, muted footer line inside the system dropdown. */
.nav-version { font-size:11px; color:var(--soft); padding:8px 12px 4px; border-top:1px solid var(--silver); margin-top:4px; text-transform:none; letter-spacing:0; font-variant-numeric:tabular-nums; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.nav-version-copy { background:none; border:none; cursor:pointer; padding:2px 5px; margin:0; color:var(--soft); font-size:12px; line-height:1; border-radius:4px; }
.nav-version-copy:hover { background:var(--silver); color:#1a1a1a; }
.nav-version-copy.copied { color:#128a3a; }
[data-contrast="high"] .nav-version-copy { color:#FFDD00; }
[data-contrast="high"] .nav-version-copy:hover { background:#333333; color:#FFDD00; }
[data-contrast="high"] .nav-version-copy.copied { color:#00FF66; }
.nav-left,.nav-right { display:flex; align-items:center; gap:4px; }
.nav-link { color:rgba(255,255,255,0.8); text-decoration:none; padding:6px 12px; border-radius:var(--radius); font-size:13px; transition:background 0.15s; }
.nav-link:hover,.nav-link.active { background:rgba(255,255,255,0.15); color:var(--white); }
.nav-admin { font-size:12px; opacity:0.85; }
.nav-divider { color:rgba(255,255,255,0.3); padding:0 8px; }
.nav-user { color:rgba(255,255,255,0.7); font-size:13px; padding:0 8px; }
.nav-system-wrap { display:inline-flex; align-items:center; }
/* v4.6.1: nav dropdown buttons must visually match .nav-link entries.
   v4.6.2: also set color explicitly and handle :focus / :active states.
   v4.6.1 relied on `color:inherit` which the browser overrode with its
   default button text color once the button was focused (e.g. after a
   click), making the buttons go dark grey on a navy nav. We now set the
   color to match .nav-link explicitly and pin it across all interactive
   states. Also replace the default focus outline with an inset ring so
   focus is still visually communicated without the dark browser default. */
.nav-system-btn { background:none; border:none; cursor:pointer; font-family:inherit; font-size:13px; padding:6px 12px; color:rgba(255,255,255,0.8); border-radius:var(--radius); transition:background 0.15s; }
.nav-system-btn:hover, .nav-system-btn:focus, .nav-system-btn:active, .nav-system-btn.active { color:var(--white); background:rgba(255,255,255,0.15); outline:none; }
.nav-system-btn:focus-visible { box-shadow:0 0 0 2px rgba(255,255,255,0.4) inset; }
.nav-system-wrap .dropdown-menu { top:calc(100% + 2px); }
/* v4.73.0a: viewer timezone control. Same chrome reset + state pinning as
   nav-system-btn so it inherits the bar foreground in both resting and hover
   states and never falls back to the default button grey on focus. */
.nav-tz-btn { display:inline-flex; align-items:center; gap:6px; background:none; border:none; cursor:pointer; font-family:inherit; font-size:13px; padding:6px 12px; color:rgba(255,255,255,0.8); border-radius:var(--radius); transition:background 0.15s; white-space:nowrap; }
.nav-tz-btn:hover, .nav-tz-btn:focus, .nav-tz-btn:active, .nav-tz-btn.active { color:var(--white); background:rgba(255,255,255,0.15); outline:none; }
.nav-tz-btn:focus-visible { box-shadow:0 0 0 2px rgba(255,255,255,0.4) inset; }
[data-contrast="high"] .nav-tz-btn { color:#FFFFFF; }
[data-contrast="high"] .nav-tz-btn:hover, [data-contrast="high"] .nav-tz-btn:focus, [data-contrast="high"] .nav-tz-btn.active { background:#333333; color:#FFDD00; outline:1px solid #FFDD00; }
/* v4.6.0: "All Record Types" dropdown — same visual treatment as the System
   cog dropdown but with a text label rather than an icon.
   v4.6.1: typography harmonization.
   v4.6.2: same :focus regression fix as nav-system-btn — see above. */
.nav-records-wrap { display:inline-flex; align-items:center; }
.nav-records-btn { background:none; border:none; cursor:pointer; font-family:inherit; font-size:13px; padding:6px 12px; color:rgba(255,255,255,0.8); border-radius:var(--radius); transition:background 0.15s; }
.nav-records-btn:hover, .nav-records-btn:focus, .nav-records-btn:active, .nav-records-btn.active { color:var(--white); background:rgba(255,255,255,0.15); outline:none; }
.nav-records-btn:focus-visible { box-shadow:0 0 0 2px rgba(255,255,255,0.4) inset; }
.nav-records-wrap .dropdown-menu { top:calc(100% + 2px); }
/* v5.98.0: navigation groups - a group's menu in the bar, and its heading in All Record Types.
   v5.98.1: the group button takes the SAME rules as the All Record Types button (v5.98.0 left it a bare
   <button>, which the browser drew as a grey box in both colour modes); the heading is a toggle. */
.nav-group-wrap { display:inline-flex; align-items:center; }
.nav-group-btn { background:none; border:none; cursor:pointer; font-family:inherit; font-size:13px; padding:6px 12px; color:rgba(255,255,255,0.8); border-radius:var(--radius); transition:background 0.15s; }
.nav-group-btn:hover, .nav-group-btn:focus, .nav-group-btn:active, .nav-group-btn.active { color:var(--white); background:rgba(255,255,255,0.15); outline:none; }
.nav-group-btn:focus-visible { box-shadow:0 0 0 2px rgba(255,255,255,0.4) inset; }
.nav-group-wrap .dropdown-menu { top:calc(100% + 2px); }
.dropdown-subhead { display:flex; justify-content:space-between; align-items:center; width:100%; background:none; border:none; border-top:1px solid var(--mid-gray, #ddd); cursor:pointer; font-family:inherit; text-align:left; padding:8px 12px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--navy); }
.dropdown-subhead:hover { background:var(--silver); }
.dropdown-subhead:focus-visible { outline:2px solid var(--mid-blue); outline-offset:-2px; }
.dropdown-subhead-chev { font-size:10px; margin-left:8px; }
.dropdown-item-grouped { padding-left:22px; }
[data-contrast="high"] .dropdown-subhead { color:#FFFF00; border-top-color:#555; }
[data-contrast="high"] .dropdown-subhead:hover { background:#333; }

/* Page */
/* v4.7.0-hotfix1: reverted v4.6.2's flex-based layout. The flex approach
   (.page-main as flex column, .grid-container as flex:1) broke AG Grid
   rendering on entity pages — the grid container resolved to 0 height at
   AG Grid's measurement time, and the grid never appeared. Going back to
   absolute-height sizing on the grid. We lose the "grid auto-fills viewport
   regardless of description presence" property but keep working grids.
   Top padding kept at 12px (the v4.6.2 tightening was fine on its own). */
.page-main { padding:12px 24px 0; max-width:100%; }
.page-header { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.page-header h1 { font-size:22px; color:var(--navy); white-space:nowrap; }
.toolbar { display:flex; align-items:center; gap:8px; flex:1; }
/* v4.209.0 / CORRECTED v5.1.0a: grid density. Cell padding 18px -> 8px and text
   13px -> 12px, bringing the main grid into line with the child-record tables
   (.rcp-grid uses 6px 8px).
   v5.1.0a: the padding landed in v4.209.0; the FONT SIZE never did, and the reason
   was misdiagnosed. AG Grid's JavaScript INJECTS its own theme CSS as <style>
   blocks at runtime, after every <link> in the document. A browser probe on the
   real deployment listed the cascade:
       style.css              .ag-theme-alpine       12px   (ours)
       inline (JS-injected)   [class*="ag-theme-"]   14px
       inline (JS-injected)   .ag-theme-alpine       13px   (won)
   All three are one selector, so the last one wins and ours cannot be made last by
   ordering <link> tags. v4.209.0 moved the CDN links above style.css and credited
   the reorder for a change that never happened; the rows and padding it also shipped
   come from grid options and CSS that does not tie, which is why the fault hid.
   Fix is specificity, not order: two classes (0-2-0) beat every injected rule. Both
   grid hosts already emit `class="ag-theme-alpine grid-container"`, so nothing else
   changes. No !important: this is the tie-breaker of last resort and spending it
   here would leave nothing above it.
   The explicit font-size declarations are deliberate as well as the variable. The
   same probe measured the theme element at 13px while a cell measured 14px, so the
   cell is not consuming --ag-font-size; setting the variable alone would move the
   wrapper and leave the text where it is.
   Padding at 8px does not widen existing saved views (column widths are persisted);
   it removes truncation inside the widths already stored.
   v5.1.0b: 12px measured a touch small once it could finally be judged, so 12.5px.
   Fractional sizes are safe here: row height is a grid option in JS, not derived from
   the font, and autosize measures rendered text either way.
   v5.1.0b: line-height 29px. AG Grid sizes the line box off the ROW (30px) while the
   cell is 29px, the row less its bottom border. A 30px line box in a 29px box cannot
   centre, so text sat about half a pixel low and the renderer rounded that to a whole
   pixel depending on zoom and scroll. Measured against the selection checkbox, which
   is centred exactly: checkbox centre 176.0, text ink centre 176.5. The checkbox was
   never the problem. This was always true; the smaller font exposed it by leaving
   visible slack in the line box where 14px text had filled it.
   LOAD-BEARING PAIR: this 29px tracks `rowHeight: 30` in grid.js / audit_log.js (30
   less the 1px bottom border). Move the row height and this moves with it. */
.grid-container.ag-theme-alpine { --ag-font-size:12.5px; --ag-cell-horizontal-padding:8px; font-size:12.5px; }
.grid-container.ag-theme-alpine .ag-cell,
.grid-container.ag-theme-alpine .ag-header-cell { font-size:12.5px; line-height:29px; }
/* v5.1.3: the row-selection checkbox, 16px -> 14px.
   AG Grid sizes this control independently of cell text, so dropping the grid font
   to 12.5px in v5.1.0b left the box proportionally about 12% heavier than it had
   been, and it read as chunky. Measured before changing anything: the control is
   centred exactly within its cell (centre 176.0 against the cell's 176.0), so this
   is size only. The apparent misalignment reported alongside it was the TEXT sitting
   low, fixed separately by the line-height above.
   font-size matters as much as the box: the tick is a glyph, so sizing width and
   height alone leaves an oversized check in a smaller box.
   Scoped to the selection column deliberately. The same control appears in column
   menus and filter popups, where 16px is correct and there is no shrunken text to sit
   beside. Wins on specificity (0-3-0 with the attribute selector) rather than
   !important, which stays reserved as the tie-breaker of last resort. */
.grid-container.ag-theme-alpine [col-id="__rowSelect"] .ag-checkbox-input-wrapper {
  width:14px; height:14px; font-size:14px;
}
/* v4.209.0: AG Grid reserves permanent layout space for the header menu button. The base
   rule is `opacity: 0`, not `display: none`, so the ~16px button box (--ag-icon-size) is
   subtracted from every header label whether or not the button is showing. That is why
   "Maintenance Type" truncated to "Maintenance..." in a column with visible free space.
   Taking the button out of flow returns that width to the label. The label width is now
   constant hovered or not, so AG's reason for reserving the space (no reflow as the mouse
   crosses a column) still holds; the trade is that on a header whose text fills its column
   the button overlays the last few characters on hover, which the background masks cleanly.
   Specificity here is (0,3,0) against the base rule's (0,2,0), so this wins on its own.
   v5.39.0: THIS RULE IS NOW INERT. grid.js sets `columnMenu: 'new'`, under which AG
   Community renders no menu button at all, so there is nothing for it to match. It is
   kept, not deleted, because reverting the header mode is a one-line change the owner
   may make after evaluating on Staging, and this rule is what that revert needs back.
   Do not read it as describing current behaviour. The header width it protected is now
   protected by the filter-button rule immediately below, which does the same job for the
   control that replaced this one. */
.ag-theme-alpine .ag-header-cell-menu-button:not(.ag-header-menu-always-show) {
  position: absolute;
  right: var(--ag-cell-horizontal-padding);
  background: var(--ag-header-background-color);
}
/* v5.39.1: the filter funnel shows ONLY on hover, or when a filter is set on that column.
   AG's own rule (ag-grid.css) gives .ag-header-cell-filter-button a flat `opacity: 1` with
   no hide condition, so out of the box it is present on every header at all times.

   TWO reasons, and the second is the load-bearing one (owner, 2026-08-21):

   1. WIDTH. Permanently in flow, it takes roughly one icon width from every header label -
      the same cost v4.209.0 removed for the menu button, reintroduced by the control that
      replaced it. The absolute positioning below is that same fix applied to the new
      control: out of flow when hidden, so the label keeps the width.

   2. SIGNAL. An icon that is always present cannot mean "this column is filtered". AG marks
      the active state by colouring the same icon, which only reads if its ABSENCE is the
      resting state. Showing it always does not merely cost width, it removes the indicator,
      which is why this is closer to a defect than to a preference.

   .ag-filter-active is AG's own class, toggled on the button from the column's filter-changed
   event, so the pinned state needs no handler of ours. It is the exact analogue of
   ag-header-menu-always-show in the rule above, and is excluded the same way: a FILTERED
   column's button stays in flow, so the label shortens and the icon has its own space rather
   than sitting over the heading text.

   .ag-header-active is AG's hover class on the header cell.

   KNOWN, and deliberately not corrected: on a NARROW sorted column the floating funnel can
   land on the sort arrow while hovering. The arrow sits immediately after the heading TEXT,
   not at the right edge, so on a normal-width column there is clear space between them and
   they never meet. The fix would be reserving an icon width inside the label on sorted
   columns, which spends exactly the width this rule reclaims, on the narrow columns where it
   is scarcest. Sorting is unaffected either way (the heading text is the sort target, not the
   arrow) and clicking the funnel filters rather than sorts, which was the original defect.
   Revisit only if it reads badly in use.

   Specificity: (0,3,0) and (0,4,0) against AG's (0,1,0), so both win without !important. */
.ag-theme-alpine .ag-header-cell .ag-header-cell-filter-button:not(.ag-filter-active) {
  position: absolute;
  right: var(--ag-cell-horizontal-padding);
  background: var(--ag-header-background-color);
  opacity: 0;
  transition: opacity 0.15s;
}
.ag-theme-alpine .ag-header-cell.ag-header-active .ag-header-cell-filter-button:not(.ag-filter-active) {
  opacity: 1;
}
/* v4.206.0b/c: the selection column is checkbox-only, pinned left. Centring + cell padding
   are done inline via the column's cellStyle (grid.js), which cannot miss. Zero the
   checkbox's own 12px margin (--ag-cell-widget-spacing) by col-id (AG always sets col-id on
   the cell / header) so the centring is exact, and zero the header cell padding the same way. */
/* v5.39.0: the select column's clear-selection header control. Drawn to read as the
   same family as the row checkboxes below it (14px box, see the rule further up) but
   deliberately NOT a tri-state checkbox: it can only ever empty a selection, so it
   must never render a state that implies it could fill one. Disabled at zero, where
   it is a quiet empty box; active it carries a dash, the conventional "some but not
   all" mark, which is exactly what a partial selection is. */
.kwl-sel-header { display:flex; align-items:center; justify-content:center; width:100%; height:100%; }
.kwl-sel-clear {
  width:14px; height:14px; padding:0; margin:0; cursor:pointer;
  border:1px solid var(--ag-border-color, rgba(0,0,0,0.25));
  border-radius:2px; background:var(--white); position:relative;
}
.kwl-sel-clear:disabled { cursor:default; opacity:0.45; }
/* The dash. Only drawn when something is selected, so the resting state says
   nothing rather than saying "empty checkbox, click to fill". */
.kwl-sel-clear.is-on { border-color:var(--navy); background:var(--navy); }
.kwl-sel-clear.is-on::after {
  content:''; position:absolute; left:2px; right:2px; top:50%;
  height:2px; margin-top:-1px; background:var(--white); border-radius:1px;
}
.kwl-sel-clear:not(:disabled):hover { border-color:var(--navy); }

/* v5.39.0: the status-bar count is the second route to Clear selection. Only reads
   as interactive once there is something to clear. */
.status-selected { border-radius:var(--radius); padding:0 4px; }
.status-selected.is-active { cursor:pointer; color:var(--navy); }
.status-selected.is-active:hover { background:var(--silver); }
.status-selected[aria-disabled="true"] { cursor:default; }

.ag-theme-alpine [col-id="__rowSelect"] .ag-selection-checkbox { margin: 0 !important; }
.ag-theme-alpine .ag-header-cell[col-id="__rowSelect"] { padding-left: 0 !important; padding-right: 0 !important; }
/* v4.206.0c: AG's pinned-section horizontal-scroll spacers (.ag-horizontal-left-spacer /
   -right-spacer) default to overflow-x:scroll purely to reserve scrollbar height, which shows
   a REDUNDANT little horizontal scrollbar under the pinned selection column whenever the grid
   scrolls horizontally. Hide it; the real scrollbar stays in the centre section, and the
   spacer keeps its height so rows stay aligned. */
.ag-theme-alpine .ag-horizontal-left-spacer,
.ag-theme-alpine .ag-horizontal-right-spacer { overflow-x: hidden !important; }
/* v4.6.1: optional record type description rendered between the toolbar
   bar and the grid. Sits as a direct child of .page-main so its left edge
   aligns with the H1's left edge. Quiet styling so it doesn't compete
   with the heading or the grid below.
   v4.6.2: trimmed vertical margins so the description sits closer to
   both the toolbar (above) and the grid (below). */
.page-description { font-size:13px; color:var(--soft); margin:0 0 6px; max-width:980px; line-height:1.5; }
.status-bar { display:flex; gap:24px; padding:8px 0 12px; font-size:12px; color:var(--mid-gray); border-top:1px solid var(--mid-blue); margin-top:8px; }

/* Grid */
/* v4.7.1: two-case grid sizing based on whether the page has a record
   type description. grid_page.php adds `.has-description` to .page-main
   when a description is present. Without that class (audit log, entity
   pages with no description), 150px of chrome: nav 48px + page-main
   top padding 12px + page-header ~32px + status-bar ~45px + slack ~13px.
   With the class, add ~22px for a single-line description → 172px. */
.grid-container { width:100%; height:calc(100vh - 150px); min-height:300px; position:relative; }
/* v5.127.83 (owner's finding F4): the loading cover over the whole grid while a view, a reset or a search is applied
   (grid.js showGridCover). A light wash that blurs what is behind it; a small "Loading view" box in the middle. */
.grid-cover { position:absolute; inset:0; z-index:20; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.72); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); border-radius:4px;
  animation:gridCoverIn .12s ease-out; }
.grid-cover[hidden] { display:none; }
/* v6.0.4 (F6): the records cover - below the header row (grid.js sets `top` to the header's height), so the headers and
   floating filters stay visible and usable; square top corners where it meets the header */
.grid-cover.grid-cover-records { border-radius:0 0 4px 4px; }
@keyframes gridCoverIn { from { opacity:0; } to { opacity:1; } }
.grid-cover-box { display:flex; align-items:center; gap:10px; padding:10px 16px; background:var(--white); border:1px solid var(--mid-blue);
  border-radius:6px; box-shadow:0 2px 8px rgba(0,0,0,.08); font-size:13px; color:var(--navy); }
.grid-cover-spin { width:18px; height:18px; border:2px solid var(--mid-blue); border-top-color:var(--blue); border-radius:50%;
  animation:gridCoverSpin .8s linear infinite; }
@keyframes gridCoverSpin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .grid-cover, .grid-cover-spin { animation:none; } }
.page-main.has-description .grid-container { height:calc(100vh - 172px); }

/* tidy: Audit Log layout fix. The page has a busy toolbar (9 controls) plus a
   permanent single-row rotation banner. With the shared side-by-side header,
   narrowing the window made the toolbar WRAP below the title - growing the
   header's height - so the grid's fixed-height budget (which assumes a
   one-row header) was correct at full width but overflowed into a second
   (page) scrollbar at narrower widths. The cause was the variable header
   height, not the arithmetic. Stacking the toolbar permanently below the title
   makes the chrome height STABLE at every width (the toolbar overflows
   horizontally rather than wrapping taller), so one fixed grid-height budget is
   correct at all widths. Scoped to .page-audit only - no other grid page is
   touched (they have far fewer toolbar controls and don't hit the wrap). The
   224px budget covers: nav 48 + page padding 12 + two-row header ~78 + banner
   ~38 + status-bar ~45 + slack, plus ~16px headroom so the grid still fits when
   a page horizontal scrollbar appears at narrow widths and eats ~15px of
   vertical space (the "as soon as the H-scroll shows, the V-scroll shows"
   case). (Err slightly generous: too much subtraction is harmless bottom
   whitespace; too little brings the scrollbar back.) */
.page-audit .page-header { flex-direction:column; align-items:stretch; flex-wrap:nowrap; gap:8px; }
.page-audit .toolbar { flex:none; }
.page-audit .grid-container { height:calc(100vh - 240px); }
.kwl-blank-means { color:var(--soft); font-style:italic; }   /* v5.121.0: Blank means, in grids */
.kwl-fit-help { font-size:11px; color:var(--soft); margin-top:2px; }   /* v5.121.0: Blank means / byte counter under a field */
.kwl-fit-help.is-over { color:var(--red,#dc2626); }
/* v6.0.1: COLUMN NAMING - the Friendly Name / Column Name field states in the three naming dialogs (entity_config_page.js
   cnField). Green valid, amber adjusted by the page (with why), red the person's own invalid edit (with why). The words
   under the field carry the meaning; the colour and the mark only point at it. */
.form-control.kwl-name-ok, .form-control.kwl-name-ok:focus             { border-color:var(--green); }
.form-control.kwl-name-adjusted, .form-control.kwl-name-adjusted:focus { border-color:var(--orange); }
.form-control.kwl-name-bad, .form-control.kwl-name-bad:focus           { border-color:var(--red); box-shadow:0 0 0 1px var(--red); }
.kwl-name-note { font-size:11px; margin-top:3px; line-height:1.35; }
.kwl-name-note-adjusted { color:#9a5a00; }
.kwl-name-note-adjusted::before { content:"! "; font-weight:700; }
.kwl-name-note-bad { color:var(--red); }
.kwl-name-note-bad::before { content:"\2715  "; font-weight:700; }
[data-contrast="high"] .kwl-name-note-adjusted { color:var(--orange); }
.row-flagged { background:#fff3cd !important; color:#856404; text-decoration:line-through; opacity:0.75; }

/* Buttons */
.btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border:none; border-radius:var(--radius); font-size:13px; font-weight:600; cursor:pointer; text-decoration:none; transition:opacity 0.15s,background 0.15s; white-space:nowrap; }
.btn:disabled { opacity:0.5; cursor:not-allowed; }
.btn-primary  { background:var(--navy); color:var(--white); }
.btn-primary:hover { background:#254f80; }
.btn-secondary { background:var(--blue); color:var(--white); }
.btn-secondary:hover { background:#235d92; }
.btn-danger   { background:var(--red); color:var(--white); }
.btn-ghost    { background:transparent; color:var(--dark-gray); border:1px solid #ccc; }
.btn-ghost:hover { background:var(--silver); }
.btn-oauth    { background:var(--white); color:var(--dark-gray); border:1px solid #ccc; font-weight:400; }
.btn-full     { width:100%; justify-content:center; }
.btn-sm       { padding:4px 10px; font-size:12px; }
.badge { background:rgba(255,255,255,0.25); border-radius:10px; padding:1px 7px; font-size:11px; font-weight:700; }

/* Forms */
.form-group { margin-bottom:14px; }
.form-group label { display:block; font-weight:600; margin-bottom:5px; font-size:13px; }
.form-control { width:100%; padding:7px 10px; border:1px solid #ccc; border-radius:var(--radius); font-family:inherit; font-size:13px; color:var(--dark-gray); background:var(--white); }
.form-control:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 2px rgba(46,117,182,0.2); }
.form-control-sm { padding:4px 8px; font-size:12px; width:auto; }
/* v5.127.84 (owner's finding F1, 5 November 2026): every text box's grabber drags up and down only. A sideways drag
   widened a half-width field past its half and pushed its neighbour onto a row of its own. Every textarea in the app:
   record forms, task and public forms, admin screens. A display-only field keeps its grabber (v5.84.8), up / down too.
   The height a long-text box opens at is text_fit.js's. */
textarea { resize: vertical; }
/* v5.127.84 (owner's finding F2): "< 12 of 43 >" at the start of a record's top bar (RecordSurface.mountNav). */
.rec-nav { display:inline-flex; align-items:center; gap:4px; margin-right:8px; }   /* not .rail-nav: that is the rail's navigator */
.rec-nav .btn { padding:6px 8px; line-height:0; }
.rec-nav-pos { font-size:12px; color:var(--soft); white-space:nowrap; min-width:56px; text-align:center; }
.form-note { font-size:12px; color:var(--mid-gray); margin-top:12px; text-align:center; }
.checkbox-label { display:flex; align-items:center; gap:8px; font-weight:400; cursor:pointer; }

/* Alerts */
.alert { padding:10px 14px; border-radius:var(--radius); font-size:13px; margin-bottom:12px; }
.alert-success { background:#d4edda; color:#155724; border:1px solid #c3e6cb; }
.alert-error   { background:#f8d7da; color:#721c24; border:1px solid #f5c6cb; }
.alert-warning { background:#fff3cd; color:#856404; border:1px solid #ffc107; }
/* v5.127.34 (module off = off): the fail-loud banner every signed-in user sees while a switched-off module has live work */
.module-off-banner { margin:10px 16px; border-radius:6px; }
.module-off-banner .module-off-detail { margin-top:6px; }
.module-off-banner .module-off-detail ul { margin:4px 0 0 18px; padding:0; }
.alert-info    { background:var(--light-blue); color:var(--navy); border:1px solid var(--mid-blue); }
/* v4.24.0a: the import upload/validation error can be multi-line (one row per
   failing reference, joined with \n by validate_upload). Preserve those line
   breaks while still wrapping long lines, so the list reads one-per-line rather
   than collapsed onto a single line. Scoped to the import error element. */
#uploadError { white-space: pre-line; }
.mt-2 { margin-top:10px; }

/* Modals */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:850; display:flex; align-items:center; justify-content:center; }
.modal { background:var(--white); border-radius:6px; box-shadow:0 8px 32px rgba(0,0,0,0.2); width:90%; max-width:640px; max-height:90vh; display:flex; flex-direction:column; }
.modal-sm { max-width:400px; }
/* v6.0.4 (F5): the unsaved-changes question with a third answer ("Add 3 members and close") - room for three buttons */
.modal-sm.modal-three-answers { max-width:540px; }
.modal-three-answers .modal-footer { flex-wrap:wrap; }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--mid-blue); }
.modal-header h3 { font-size:16px; color:var(--navy); }
.modal-close { background:none; border:none; font-size:22px; cursor:pointer; color:var(--mid-gray); line-height:1; }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { padding:14px 20px; border-top:1px solid var(--mid-blue); display:flex; justify-content:flex-end; gap:10px; }

/* Login */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; background:var(--navy); }
.login-card { background:var(--white); border-radius:8px; padding:40px; width:100%; max-width:480px; box-shadow:0 8px 32px rgba(0,0,0,0.3); }
.login-title { color:var(--navy); font-size:28px; text-align:center; margin-bottom:24px; }
/* v6.0.5 (owner, 18 November 2026): the name as a brand - its mark raised and smaller (includes/brand.php), and "Powered by
   AnyShape" directly under the sign-in card's heading, pulled up to sit with it */
.brand-mark { font-size:0.45em; font-weight:600; margin-left:1px; vertical-align:super; line-height:0; }
.brand-powered .brand-mark { font-size:0.7em; margin-left:0; }
.brand-powered { display:block; text-align:center; margin:-18px 0 26px; font-size:13px; letter-spacing:0.2px; color:var(--mid-gray); text-decoration:none; }
.brand-powered strong { font-weight:600; }
.brand-powered:hover, .brand-powered:focus-visible { text-decoration:underline; }
[data-contrast="high"] .brand-powered { color:#FFFFFF; }
/* v4.35.0: installed version, muted, at the foot of the login card. */
.login-version { text-align:center; margin-top:20px; font-size:11px; color:var(--mid-gray); font-variant-numeric:tabular-nums; }
.login-card .form-control { padding:10px 14px; font-size:15px; }
/* v4.192.0a: SSO provider buttons stack with spacing. Spacing is a property of
   the group, not of .btn-full, so it cannot leak into other full-width buttons
   (Send Reset Link, Sign In) elsewhere on this page or in the app. */
.sso-buttons { display:flex; flex-direction:column; gap:10px; }
.oauth-divider { text-align:center; margin:16px 0; color:var(--mid-gray); font-size:12px; position:relative; }
.oauth-divider::before,.oauth-divider::after { content:''; position:absolute; top:50%; width:42%; height:1px; background:#ddd; }
.oauth-divider::before { left:0; } .oauth-divider::after { right:0; }
/* v5.14.1: the two rules above are absolutely positioned at 42% from each side, leaving a 16% gap for
   the label. That fits "or" and nothing longer, so a wider label ("Choose a system") overflowed into
   the rules and they struck through the text. The span sits above them and masks whatever it covers,
   which makes the component work at any length. Invisible for "or", where the rules never reach the
   text anyway. */
.oauth-divider span { position:relative; background:var(--white); padding:0 12px; }
/* v4.36.0: "Sign in with email" disclosure (SSO-first login) */
.email-login > summary { list-style:none; cursor:pointer; text-align:center; font-size:13px; color:var(--blue); padding:8px 0; user-select:none; }
.email-login > summary::-webkit-details-marker { display:none; }
.email-login[open] > summary { color:var(--mid-gray); margin-bottom:6px; }
[data-contrast="high"] .email-login > summary { color:#FFDD00; }

/* Cell modal */
.cell-modal-content { white-space:pre-wrap; word-break:break-word; font-size:13px; line-height:1.6; max-height:400px; overflow-y:auto; background:var(--silver); padding:12px; border-radius:var(--radius); }

/* Mapping table */
.mapping-table { width:100%; border-collapse:collapse; font-size:12px; }
.mapping-table th { background:var(--navy); color:var(--white); padding:6px 10px; text-align:left; }
.mapping-table td { padding:5px 10px; border-bottom:1px solid #eee; }
.mapping-table tr:nth-child(even) td { background:var(--silver); }
/* v5.80.0: a column the operator has unticked on the import preview. Greyed IN
   PLACE rather than hidden, so the row count on screen still reconciles against
   the file the operator is holding. The checkbox itself stays at full strength -
   it is the control that undoes this. */
.mapping-table tr.kwl-col-excluded td { opacity:0.5; text-decoration:line-through; }
.mapping-table tr.kwl-col-excluded td:first-child { opacity:1; text-decoration:none; }
.status-mapped td { color:var(--green); }
.status-no-mapping-configured td { color:var(--mid-gray); }
.status-no-matching-column td { color:var(--mid-gray); }
.status-auto-managed-values-will-be-ignored td { color:var(--blue); font-style:italic; }

/* Progress bar */
.progress-bar-outer { background:#eee; border-radius:4px; height:12px; overflow:hidden; margin:12px 0; }
.progress-bar-inner { background:var(--blue); height:100%; width:0; transition:width 0.3s; }
.progress-bar-inner.deleting { width:100% !important; background:var(--orange); animation:pulse-bar 1.2s ease-in-out infinite; }
/* v5.127.13: the import preview's bar before the worker reports a reading - indeterminate, in the run's colour */
.progress-bar-inner.pending { width:100% !important; animation:pulse-bar 1.2s ease-in-out infinite; }
@keyframes pulse-bar { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Advanced search */
.adv-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.adv-col,.adv-op,.adv-val { flex:1; }
.adv-logic { margin-bottom:12px; }

.views-table{width:100%;border-collapse:collapse;font-size:13px}
.views-table th{background:var(--navy);color:var(--white);padding:7px 10px;text-align:left;font-weight:600;white-space:nowrap}
.views-table td{padding:7px 10px;border-bottom:1px solid var(--mid-blue);vertical-align:top}
.views-table tr:nth-child(even) td{background:var(--silver)}
.view-global-badge{background:var(--blue);color:var(--white);font-size:10px;padding:2px 6px;border-radius:10px;white-space:nowrap}
.view-personal-badge{background:var(--mid-gray);color:var(--white);font-size:10px;padding:2px 6px;border-radius:10px;opacity:0.7;white-space:nowrap}
.view-notes{color:var(--soft);font-size:12px;font-style:italic;max-width:220px}


.text-error { color:var(--red); }
.mt-2 { margin-top:10px; }
[hidden] { display:none !important; }

/* Advanced search nested groups */
.adv-group { border:1px solid var(--mid-blue); border-radius:4px; padding:10px 12px; margin-bottom:8px; background:var(--white); }
.adv-group-inner { border-left:3px solid var(--blue); margin-left:8px; padding:8px 10px 8px 14px; margin-top:8px; background:var(--silver); border-radius:0 4px 4px 0; }
.adv-group-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
/* v5.127.82 (F3): Advanced Search - the column filters that also apply */
.adv-colfilter-notice { display:flex; align-items:center; gap:12px; padding:6px 10px; margin-bottom:10px; font-size:12px; background:#fff8e1; border:1px solid #f0c14b; color:#7a5a00; border-radius:4px; }
.adv-colfilter-notice[hidden] { display:none; }
.adv-colfilter-notice .adv-colfilter-clear { margin-left:auto; white-space:nowrap; }
.adv-logic-sel { font-size:12px; border:1px solid var(--mid-blue); border-radius:3px; padding:2px 6px; background:var(--white); color:var(--navy); font-weight:600; }
.adv-row { display:flex; gap:6px; align-items:center; margin-bottom:6px; flex-wrap:wrap; }
/* v5.127.83 (owner's finding F7): an operator / value the column swap had to change - amber for 3 s (condition_builder.js) */
.adv-changed { outline:2px solid var(--orange); outline-offset:1px; box-shadow:0 0 0 4px rgba(230,126,34,.18); }
.adv-row select, .adv-row input { font-size:12px; }
.adv-col { width:140px; }
.adv-op  { width:145px; }
.adv-val { flex:1; min-width:100px; }
/* v4.80.0a: the Advanced Search dialog gets its own wider cap (the shared .modal
   is 640px) so a condition with multiple value controls stays on one line; the
   value controls are grouped in .adv-vals so they wrap together as a unit, not
   scattered, only when the window is genuinely narrow. */
/* v5.42.0: raised 820 -> 1040 to match the automation editor (.kwl-aued), which
   hosts the SAME condition builder. Advanced Search was the narrower of the two
   and therefore the binding constraint on the row: the v5.42.0 relative-offset
   control adds a number, a unit and a direction alongside the dynamic-value
   selector. .adv-vals still wraps as a unit on a genuinely narrow window, so this
   raises the point at which it wraps rather than changing what happens then. */
#advSearchModal .modal { max-width:1040px; }
/* v5.127.96 (v5.127.95 finding F1, owner 11 November 14:17): the value cluster takes a SMALL basis and shrinks first, so the
   remove "x" never drops onto a line of its own; when a row genuinely cannot fit, the cluster wraps as a unit and the "x"
   goes with it (the v4.80.0a intent). Every host of the builder - Advanced Search, automations, tasks, form rules, Criteria. */
.adv-vals { display:flex; gap:6px; align-items:center; flex-wrap:wrap; flex:1 1 180px; min-width:0; }
.adv-row > .adv-rm { flex:0 0 auto; }
.adv-vals .adv-val { min-width:90px; }
/* v6.0.5 (owner's finding F15): a picklist's value drop-down is as wide as its LONGEST value by default, so one long value
   pushed it onto a line of its own and past the dialog's edge (the value cluster's min-width:0 cannot shrink a select
   below its own minimum). It now takes the room left on the line and shortens its shown text instead; the list it opens
   still shows each value in full, and the chosen one is its tooltip (condition_builder.js). */
.adv-vals .adv-pick { flex:1 1 160px; min-width:120px; max-width:100%; width:auto; text-overflow:ellipsis; }
.adv-group-actions { display:flex; gap:6px; margin-top:6px; }
/* v5.127.82 (F4, F5): a second level of groups reads apart from the first; the drag handle, the item being moved and
   the line where it will land */
.adv-group-inner .adv-group-inner { background:var(--white); }
.adv-drag { cursor:grab; user-select:none; touch-action:none; color:var(--soft); font-size:14px; line-height:1; padding:2px 3px; letter-spacing:-3px; flex:0 0 auto; }
.adv-drag:hover { color:var(--blue); }
.adv-drag-active, .adv-drag-active * { cursor:grabbing !important; }
/* v5.127.97 (owner's finding on v5.127.91): a reorderable row's handle pressed - the closed hand and the row marked (data_actions.js) */
html.drag-grabbing, html.drag-grabbing * { cursor:grabbing !important; }
[data-drag-armed] > td, [data-drag-armed] { background:var(--light-blue, #eaf2fb); }
[data-contrast="high"] [data-drag-armed] > td, [data-contrast="high"] [data-drag-armed] { outline:2px solid #FFDD00; outline-offset:-2px; }
.adv-drag-active.adv-drop-refused, .adv-drag-active.adv-drop-refused * { cursor:no-drop !important; }
.adv-dragging { opacity:0.45; }
.adv-drop-line { height:0; border-top:3px solid var(--blue); margin:2px 0 6px; border-radius:2px; }
/* v6.0.0: conditions on child records - a child block reads apart from a group (its own colour and a tag naming it);
   its body is a builder of its own, rooted at the child type (condition_builder.js renderChildBlock) */
.adv-child-block { border:1px solid #9ad7c9; border-left:3px solid #17836f; border-radius:0 4px 4px 0; margin:8px 0 8px 8px; padding:8px 10px 8px 12px; background:#f3fbf9; }
.adv-child-header { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.adv-child-header > .adv-rm { margin-left:auto; flex:0 0 auto; }
.adv-child-tag { font-size:11px; font-weight:600; color:#0f5e50; background:#d6f0ea; border-radius:3px; padding:2px 8px; white-space:nowrap; }
.adv-child-rel { min-width:180px; max-width:280px; font-size:12px; }
.adv-child-q { min-width:200px; max-width:300px; font-size:12px; }
.adv-child-body { margin-top:8px; }
.adv-child-body > .adv-group { margin-bottom:0; }
.adv-child-warn { margin-top:6px; padding:5px 8px; font-size:12px; background:#fff8e1; border:1px solid #f0c14b; color:#7a5a00; border-radius:4px; }
.adv-child-note { margin-top:6px; font-size:12px; color:var(--soft); font-style:italic; }
.adv-add-child { color:#17836f; }
[data-contrast="high"] .adv-child-block { border-color:#444; border-left-color:#00E5C0; background:#141414; }
[data-contrast="high"] .adv-child-tag { color:#000; background:#00E5C0; }
[data-contrast="high"] .adv-child-warn { background:#000; color:#FFDD00; border-color:#FFDD00; }
[data-contrast="high"] .adv-add-child { color:#00E5C0; }
[data-contrast="high"] .adv-group { border-color:#444; background:#1A1A1A; }
[data-contrast="high"] .adv-group-inner { border-left-color:#FFDD00; background:#222; }
[data-contrast="high"] .adv-group-inner .adv-group-inner { background:#1A1A1A; }
[data-contrast="high"] .adv-drag { color:#FFDD00; }
[data-contrast="high"] .adv-drop-line { border-top-color:#FFDD00; }
[data-contrast="high"] .adv-logic-sel { background:#000; color:#FFDD00; border-color:#FFDD00; }

/* Form field read-only state */
.form-control[readonly] { cursor: default; }

/* Icon buttons */
.btn-icon { background:none; border:1px solid transparent; border-radius:4px; padding:4px 8px; font-size:16px; cursor:pointer; color:var(--mid-gray); transition:color 0.15s,border-color 0.15s; }
.btn-icon:hover { color:var(--navy); border-color:var(--mid-blue); }
.btn-icon-delete { font-size:14px; }
.btn-icon-delete.has-selection { color:var(--red); border-color:var(--red); font-weight:700; }
.btn-icon-delete:disabled { opacity:0.35; cursor:default; }

/* Dropdown menus */
.dropdown-wrap { position:relative !important; display:inline-flex; align-items:center; flex-shrink:0; }
.dropdown-menu { position:absolute !important; top:calc(100% + 4px); left:0; background:var(--white); border:1px solid var(--mid-blue); border-radius:6px; box-shadow:var(--shadow); z-index:500; min-width:200px; max-height:calc(100vh - 120px); overflow-y:auto; }
.dropdown-menu-right { left:auto; right:0; }
/* v4.207.0a: lifted out of the embed toolbar's overflow-x:auto clip. JS sets top/left/right
   inline from the button rect; this only wins the position from the absolute !important above. */
.dropdown-menu.kwl-menu-fixed { position:fixed !important; }
.dropdown-menu-wide { min-width:280px; }
/* v5.127.84 (owner's finding F4, 5 November 2026): the grid's Actions menu takes the width of its longest entry (a task's
   name), up to 420px - past that an entry wraps - instead of 200px, where the button's narrow wrapper left it. grid.js
   _positionActionsMenu() lines its right edge up with the button's when it would otherwise run past the window. */
#actionsMenu { width:max-content; max-width:min(420px, calc(100vw - 16px)); }
.dropdown-header { font-size:11px; font-weight:700; color:var(--soft); text-transform:uppercase; letter-spacing:0.5px; padding:8px 12px 4px; }
.dropdown-item { display:block; width:100%; text-align:left; background:none; border:none; padding:8px 12px; font-size:13px; color:var(--navy); cursor:pointer; }
/* v5.98.1: a menu entry that is a link is not underlined - it read as body text in All Record Types. */
a.dropdown-item { text-decoration:none; }
.dropdown-item:hover { background:var(--silver); }
.dropdown-item:disabled { color:var(--mid-gray); cursor:not-allowed; opacity:0.6; }
.dropdown-item:disabled:hover { background:none; }
.dropdown-item-danger { color:var(--red); }
.dd-icon { display:inline-block; width:1.5em; text-align:center; margin-right:6px; flex-shrink:0; }
.dropdown-item-danger:hover { background:#fff0f0; }
.action-count { display:inline-block; margin-left:6px; padding:1px 6px; border-radius:8px; background:var(--red); color:#fff; font-size:11px; font-weight:600; }
.dropdown-divider { border:none; border-top:1px solid var(--mid-blue); margin:4px 0; }

/* Views panel */
.view-btn { display:flex; align-items:center; gap:4px; }
.view-modified-dot { color:var(--orange); font-size:10px; }
.views-panel-section { padding:8px 0; }
.views-panel-heading { font-size:11px; font-weight:700; color:var(--soft); text-transform:uppercase; letter-spacing:0.5px; padding:4px 12px; }
.views-list { /* Accordion shows one section at a time; let it expand to fill
                 the panel body. Vertical scrolling, when needed, happens on
                 .views-panel-body (flex:1; overflow-y:auto). */ }
.view-row { display:flex; align-items:center; padding:5px 12px; gap:6px; }
.view-row:hover { background:var(--silver); }
.view-row-name { flex:1; font-size:13px; color:var(--navy); cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.view-row-name:hover { text-decoration:underline; }
.view-row-actions { display:flex; gap:2px; flex-shrink:0; }
.view-row-btn { background:none; border:none; cursor:pointer; font-size:13px; color:var(--mid-gray); padding:2px 4px; border-radius:3px; }
.view-row-btn:hover { color:var(--navy); background:var(--mid-blue); }
.view-row-btn.danger:hover { color:var(--red); background:#ffe0e0; }
.views-empty { font-size:12px; color:var(--soft); padding:6px 12px; font-style:italic; }

/* High contrast overrides */
[data-contrast="high"] .dropdown-menu { background:#1A1A1A; border-color:#555; }
[data-contrast="high"] .dropdown-item { color:#FFF; }
[data-contrast="high"] .dropdown-item:hover { background:#333; }
[data-contrast="high"] .view-row:hover { background:#333; }
[data-contrast="high"] .view-row-name { color:#FFF; }

/* Context menu */
.ctx-menu{position:fixed;background:var(--white);border:1px solid var(--mid-blue);border-radius:6px;box-shadow:var(--shadow);z-index:9999;min-width:200px;padding:4px 0}
.ctx-item{display:flex;align-items:center;gap:10px;padding:8px 14px;font-size:13px;color:var(--navy);cursor:pointer;white-space:nowrap;border:none;background:none;width:100%;text-align:left}
.ctx-item:hover{background:var(--silver)}
.ctx-item-danger{color:var(--red)}
.ctx-item-danger:hover{background:#fff0f0}
.ctx-item-icon{font-size:14px;width:18px;text-align:center;flex-shrink:0}
/* v5.73.0: TWO LEVELS OF GROUPING NEED TWO DEVICES. A context menu groups by SUBJECT
   (which record an action acts on - the header) and by KIND (open / copy / analyse -
   the separator). Until now both were drawn the same weight, so a second header would
   have competed with the rules rather than outranking them, and the hierarchy would
   have been unreadable.
   A SECTION BREAK is full width and labelled; a SUBDIVISION is inset and pale. */
.ctx-separator{border:none;border-top:1px solid var(--silver);margin:4px 14px}
/* v5.63.0 (record form Part A): a value-dependent DISABLED item. The grid's menu
   never needed one - every condition it applies is permission or mode, which are
   OMIT grounds. The record form's field menu greys an entry the user can light up
   by typing (Copy value on an empty field, Open link on one that holds no http(s)
   address), so the item stays in place and the menu keeps one shape. The :hover
   override matters as much as the colour: an item that highlights under the mouse
   and then does nothing reads as broken rather than as unavailable. */
.ctx-item[disabled]{color:var(--soft);cursor:default}
.ctx-item[disabled]:hover{background:none}
[data-contrast="high"] .ctx-item[disabled]{color:#999}
[data-contrast="high"] .ctx-item[disabled]:hover{background:none}
/* v4.209.0a: shared header help marker. Was defined only inside access.php's inline
   <style>, so entity_config.php could not reach it and hand-rolled its own marker as a
   grey glyph instead: `color:var(--mid-gray)` on a `.data-table th`, which is navy. That
   measures about 2.0:1. A white disc with a navy question mark measures 11.6:1 on the same
   background. Single definition here; access.php no longer carries a local copy. Use this
   class for any help marker sitting ON a dark header, never an inline colour. */
.rl-help{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;background:var(--white);color:var(--navy);font-size:10px;font-weight:700;cursor:help;margin-left:5px;vertical-align:middle}
.ctx-header{font-size:11px;font-weight:700;color:var(--soft);text-transform:uppercase;letter-spacing:0.5px;padding:6px 14px 2px}
/* Every header EXCEPT the first opens a new section, so it carries the strong rule.
   The first has nothing above it to divide from and stays flush. */
.ctx-menu > .ctx-header:not(:first-child){border-top:1px solid var(--mid-blue);margin-top:4px;padding-top:8px}
[data-contrast="high"] .ctx-menu > .ctx-header:not(:first-child){border-top-color:#555}
[data-contrast="high"] .ctx-separator{border-top-color:#3A3A3A}
/* v5.74.0: a section break with no header - full width and the header's weight, so a
   subject change reads as one whether or not it is labelled. */
.ctx-separator-section{border-top-color:var(--mid-blue);margin-left:0;margin-right:0}
[data-contrast="high"] .ctx-separator-section{border-top-color:#555}
[data-contrast="high"] .ctx-menu{background:#1A1A1A;border-color:#555}
[data-contrast="high"] .ctx-item{color:#FFF}
[data-contrast="high"] .ctx-item:hover{background:#333}

/* Toolbar divider and view inline controls */
.toolbar-divider { width:1px; height:24px; background:var(--mid-blue); margin:0 4px; flex-shrink:0; }
.toolbar-check { display:inline-flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; user-select:none; padding:0 4px; }
.toolbar-check input[type="checkbox"] { margin:0; cursor:pointer; }
.view-inline-wrap { display:flex; align-items:center; gap:6px; }
/* v4.207.0d: min-width stops the saved-view label being the toolbar's only elastic item.
   overflow:hidden gives a flex item a min-content floor of zero, so this label absorbed all
   the shrink and collapsed to nothing before the toolbar overflowed and offered its
   horizontal scroll. With a floor it stops at a readable width, the toolbar overflows sooner,
   and the scrollbar appears while the view name is still legible. min-width rather than
   flex-shrink:0, so long view names still truncate gracefully. */
.view-inline-name { font-size:13px; color:var(--navy); font-weight:600; min-width:96px; max-width:320px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:help; }

/* Audit log rotation status banner (audit_log.php). Sits between the page
   header / toolbar and the grid. Inline-flex so its contents align baseline.
   Yellow when rotation is overdue or disabled; neutral otherwise. */
.rotation-banner { display:flex; align-items:center; gap:12px; padding:6px 12px; margin-bottom:8px; font-size:12px; color:var(--soft); background:#fafbfc; border:1px solid var(--silver); border-radius:4px; }
.rotation-banner.warn { background:#fff8e1; border-color:#f0c14b; color:#7a5a00; }
.rotation-banner.disabled { background:#fdecec; border-color:#e9a3a3; color:#a02020; }
.rotation-banner-link { margin-left:auto; color:var(--blue); text-decoration:none; font-weight:600; }
.rotation-banner-link:hover { text-decoration:underline; }

/* v4.16.0-step6a.1 / v4.17.0: saved-view collision warning was a
   yellow inline banner here; promoted to a Toast in v4.17.0. See
   assets/js/toast.js, the .kwl-toast-warning style above, and grid.js
   renderColCollisionWarning. */

/* Views slide-in panel */
.views-panel-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.3); z-index:800; display:none; }
.views-panel-overlay.open { display:block; }
/* v4.128.4i: shared width for both right-hand slide-in panes (Saved Views and
   Column Stats). v4.146.0: widened 350px -> 425px, capped to 92vw so it never
   overflows a small screen. Closed offset (right) is >= the max width so the pane
   stays fully hidden when closed at any capped width. */
.views-panel { position:fixed; top:0; right:-425px; width:min(425px,92vw); height:100vh; background:var(--white); box-shadow:-4px 0 20px rgba(0,0,0,0.15); z-index:801; display:flex; flex-direction:column; transition:right 0.25s ease; }
.views-panel.open { right:0; }
.views-panel-header { display:flex; align-items:center; justify-content:space-between; padding:0 16px; height:48px; box-sizing:border-box; border-bottom:2px solid var(--blue); flex-shrink:0; }
.views-panel-title { font-size:15px; font-weight:700; color:var(--navy); }
.views-panel-body { flex:1; overflow-y:auto; }
.views-panel-section { padding:8px 0; }
.views-panel-heading { font-size:11px; font-weight:700; color:var(--soft); text-transform:uppercase; letter-spacing:0.5px; padding:6px 16px 2px; }
.views-list { }
.view-row { display:flex; align-items:center; padding:7px 16px; gap:8px; cursor:pointer; }
.view-row:hover { background:var(--silver); }
.view-row.active { background:var(--light-blue); }
.view-row-name-wrap { flex:1; min-width:0; cursor:pointer; }
.view-row-name { display:block; font-size:13px; color:var(--navy); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.view-row-meta { display:block; font-size:11px; color:var(--soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:1px; }
.view-row-meta-notes { font-style:italic; }
.view-row-actions { display:flex; gap:2px; flex-shrink:0; }
.view-row-btn { background:none; border:none; cursor:pointer; font-size:13px; color:var(--mid-gray); padding:2px 5px; border-radius:3px; }
.view-row-btn:hover { color:var(--navy); background:var(--mid-blue); }
.view-row-btn.danger:hover { color:var(--red); background:#ffe0e0; }
.views-empty { font-size:12px; color:var(--soft); padding:8px 16px; font-style:italic; }

/* Accordion header — replaces views-panel-heading for collapsible sections */
.views-acc-section { padding:0; }
.views-acc-header { display:flex; align-items:center; gap:8px; width:100%; padding:6px 16px; background:none; border:none; cursor:pointer; text-align:left; font-size:11px; font-weight:700; color:var(--soft); text-transform:uppercase; letter-spacing:0.5px; }
.views-acc-header:hover { background:var(--silver); }
.views-acc-header[disabled] { cursor:default; opacity:0.55; }
.views-acc-header[disabled]:hover { background:none; }
.views-acc-chevron { display:inline-block; width:12px; font-size:10px; color:var(--mid-gray); transition:transform 0.15s ease; }
.views-acc-label { flex:1; }
.views-acc-count { font-weight:600; color:var(--mid-gray); text-transform:none; letter-spacing:0; }
[data-contrast="high"] .views-acc-header:hover { background:#333; }

/* Column stats panel — unique-value list rows */
.col-stats-row { display:flex; align-items:center; gap:8px; padding:6px 14px; cursor:pointer; border-bottom:1px solid var(--silver); font-size:13px; }
.col-stats-row:hover { background:var(--light-blue); }
.col-stats-val { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--navy); }
.col-stats-count { color:var(--soft); font-variant-numeric:tabular-nums; font-size:12px; }
.col-stats-pct { color:var(--mid-gray); font-variant-numeric:tabular-nums; font-size:11px; width:46px; text-align:right; }
/* v5.127.83 (owner's finding F2): a date-time column's days, each expandable to its times (for reading - not clickable) */
.col-stats-toggle { flex:0 0 auto; width:20px; height:20px; padding:0; border:none; background:transparent; color:var(--navy); cursor:pointer; font-size:12px; line-height:20px; border-radius:3px; }
.col-stats-toggle:hover, .col-stats-toggle:focus-visible { background:var(--mid-blue); outline:none; }
.col-stats-times { background:var(--silver); border-bottom:1px solid var(--silver); }
.col-stats-row.col-stats-time { cursor:default; padding:3px 14px 3px 42px; font-size:12px; }
.col-stats-row.col-stats-time:hover { background:transparent; }
.col-stats-time-note { padding:4px 14px 6px 42px; font-size:12px; color:var(--soft); font-style:italic; }
[data-contrast="high"] .col-stats-row { border-bottom-color:#333; }
[data-contrast="high"] .col-stats-row:hover { background:#002244; }
[data-contrast="high"] .col-stats-val { color:#FFF; }

/* High contrast */
[data-contrast="high"] .views-panel { background:#1A1A1A; }
[data-contrast="high"] .view-row:hover { background:#333; }
[data-contrast="high"] .view-row.active { background:#002244; }
[data-contrast="high"] .view-row-name { color:#FFF; }
[data-contrast="high"] .view-inline-name { color:#FFF; }
.dropdown-info { font-size:11px; color:var(--soft); padding:6px 14px; font-style:italic; }
/* Inline save flash feedback */
@keyframes flash-green { 0%,100%{background:inherit} 20%{background:#d4edda} }
@keyframes flash-red   { 0%,100%{background:inherit} 20%{background:#f8d7da} }


/* Toolbar spacer pushes view name to far right */
.toolbar-spacer { flex:1; min-width:0; }
.btn-views-toggle { background:none; border:1px solid var(--mid-blue); border-radius:4px; padding:2px 8px; font-size:18px; line-height:1; cursor:pointer; color:var(--navy); transition:background 0.15s; }
.btn-views-toggle:hover { background:var(--mid-blue); }
.btn-views-toggle.open { transform:scaleX(-1); }
[data-contrast="high"] .view-name-bar { background:#1A1A1A; border-color:#444; }
[data-contrast="high"] .btn-views-toggle { color:#FFF; border-color:#555; }
.view-inline-prefix { font-size:11px; font-weight:400; color:var(--soft); text-transform:uppercase; letter-spacing:0.4px; margin-right:2px; }
/* v5.127.84 (owner's finding F3, 5 November 2026): the toolbar's Advanced Search / Columns / Actions / Import carry an icon
   beside the word, so the icon is familiar by the time a narrow grid (a record's related panel) drops the words. grid.js fitToolbar() adds .toolbar-compact when the words do not fit, measured on the toolbar itself; it is
   taken off again when they would. Compact: icons only (the name stays as tooltip and accessible name), "View:" dropped
   and the view name shortened with "..." (its full name is its tooltip); the Saved Views toggle never shrinks. */
.tb-btn { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.tb-btn .tb-ico { flex-shrink:0; opacity:0.7; }
.tb-btn .tb-caret { margin-left:-2px; }
.toolbar-compact .tb-btn { gap:3px; padding-left:8px; padding-right:8px; }
.toolbar-compact .tb-btn .tb-label { display:none; }
.toolbar-compact .tb-btn .tb-ico { opacity:1; }
.toolbar-compact .view-inline-prefix { display:none; }
.toolbar-compact .view-inline-name { min-width:40px; flex:0 1 auto; }
.toolbar .btn-views-toggle { flex-shrink:0; }
/* v5.127.87 (owner, 5 November 2026: "when the main grid is reduced in width, the menu items don't drop to icons"): the
   MAIN grid page's toolbar no longer sets the page's floor. `body:not(.embed-mode) { min-width: min-content }` (above) made
   the page as wide as the toolbar with its words, so the toolbar was never squeezed and fitToolbar() never saw it
   overflow - the page scrolled sideways instead. Size containment takes the toolbar's words out of that floor (the nav
   still sets it): the toolbar takes the width the page gives it, fitToolbar() measures its content against that, and the
   words drop when they do not fit - as in a record's related panel. */
body:not(.embed-mode) .page-header > .toolbar { contain: inline-size; min-width: 0; }

/* ─────────────────────────────────────────────────────────────
 * Toasts (v4.17.0; z-index discipline tightened v4.17.0a)
 * Stack-managed notification primitive. See assets/js/toast.js for API.
 * Container lives at viewport top-right; toasts stack downward.
 * z-index discipline (v4.17.0a):
 *   views-panel / slide-ins      = 800 / 801
 *   .modal-overlay (existing)    = 850
 *   task form modal (v5.90.0)    = 860  (over the record modal it is often opened from,
 *     under a confirm and under the toasts)
 *   Modal.confirm overlay (JS)   = 870
 *   .kwl-toast-container          = 900  (above all modals - persistent
 *     in-flight toasts remain visible if a modal opens mid-operation)
 * v5.127.88: while a dialog is open, toast.js moves the container (inline top / right /
 * max-width) into that dialog's top-right corner, under its top bar; the rule below is the
 * window-corner default it returns to.
 * ───────────────────────────────────────────────────────────── */
.kwl-toast-container { position:fixed; top:16px; right:16px; z-index:900; display:flex; flex-direction:column; gap:8px; max-width:380px; pointer-events:none; }
.kwl-toast { background:var(--white); border-left:4px solid var(--mid-gray); border-radius:var(--radius); box-shadow:var(--shadow); padding:10px 12px; pointer-events:auto; display:flex; gap:10px; align-items:flex-start; font-size:13px; line-height:1.4; color:var(--dark-gray); animation:kwl-toast-in 0.18s ease-out; }
.kwl-toast-icon { flex:0 0 auto; font-size:16px; line-height:1.2; margin-top:1px; }
.kwl-toast-body { flex:1 1 auto; min-width:0; word-wrap:break-word; }
.kwl-toast-text { white-space:pre-line; }
.kwl-toast-title { font-weight:600; margin-bottom:2px; }
.kwl-toast-actions { margin-top:8px; display:flex; gap:8px; flex-wrap:wrap; }
.kwl-toast-dismiss { background:none; border:none; color:var(--mid-gray); font-size:18px; line-height:1; cursor:pointer; padding:0 2px; margin-top:-2px; }
.kwl-toast-dismiss:hover { color:var(--dark-gray); }
.kwl-toast-info    { border-left-color:var(--blue); }
.kwl-toast-info    .kwl-toast-icon { color:var(--blue); }
.kwl-toast-success { border-left-color:var(--green); }
.kwl-toast-success .kwl-toast-icon { color:var(--green); }
.kwl-toast-warning { border-left-color:#f0c14b; background:#fffdf4; }
.kwl-toast-warning .kwl-toast-icon { color:#a07000; }
.kwl-toast-error   { border-left-color:var(--red); background:#fdf6f6; }
.kwl-toast-error   .kwl-toast-icon { color:var(--red); }
.kwl-toast-progress { border-left-color:var(--blue); }
.kwl-toast-progress .kwl-toast-icon { color:var(--blue); }
.kwl-toast-spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--mid-blue); border-top-color:var(--blue); border-radius:50%; animation:kwl-toast-spin 0.8s linear infinite; }
@keyframes kwl-toast-in { from { transform:translateX(20px); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes kwl-toast-spin { to { transform:rotate(360deg); } }
[data-contrast="high"] .kwl-toast { background:#1A1A1A; color:#FFFFFF; border:2px solid #FFFFFF; border-left-width:4px; }
[data-contrast="high"] .kwl-toast-info    { border-left-color:#FFDD00; }
[data-contrast="high"] .kwl-toast-info    .kwl-toast-icon { color:#FFDD00; }
[data-contrast="high"] .kwl-toast-success { border-left-color:#00FF88; }
[data-contrast="high"] .kwl-toast-success .kwl-toast-icon { color:#00FF88; }
[data-contrast="high"] .kwl-toast-warning { border-left-color:#FFAA00; background:#1A1A1A; }
[data-contrast="high"] .kwl-toast-warning .kwl-toast-icon { color:#FFAA00; }
[data-contrast="high"] .kwl-toast-error   { border-left-color:#FF5555; background:#1A1A1A; }
[data-contrast="high"] .kwl-toast-error   .kwl-toast-icon { color:#FF5555; }
[data-contrast="high"] .kwl-toast-progress { border-left-color:#FFDD00; }
[data-contrast="high"] .kwl-toast-progress .kwl-toast-icon { color:#FFDD00; }
[data-contrast="high"] .kwl-toast-spinner { border-color:#444444; border-top-color:#FFDD00; }
[data-contrast="high"] .kwl-toast-dismiss { color:#CCCCCC; }
[data-contrast="high"] .kwl-toast-dismiss:hover { color:#FFDD00; }

/* ─────────────────────────────────────────────────────────────
 * Modal confirm (v4.17.0)
 * Styled replacement for native confirm() / prompt(). Builds on
 * the existing .modal infrastructure (lines 217-224). The toast
 * primitive doesn't share chrome with this; confirms are blocking
 * by design.
 * ───────────────────────────────────────────────────────────── */
.kwl-confirm-body { white-space:pre-wrap; }
.kwl-confirm-body p { margin:0 0 8px 0; }
.kwl-confirm-body p:last-child { margin-bottom:0; }
.kwl-confirm-require { margin-top:14px; padding-top:12px; border-top:1px solid var(--mid-blue); }
.kwl-confirm-require-prompt { font-size:12px; color:var(--mid-gray); margin-bottom:6px; white-space:pre-wrap; }
.kwl-confirm-require input.form-control { font-family:inherit; }
.kwl-confirm-require .checkbox-label { font-size:13px; }
[data-contrast="high"] .kwl-confirm-require { border-top-color:#444444; }
[data-contrast="high"] .kwl-confirm-require-prompt { color:#CCCCCC; }

/* ============================================================================
   v4.26.0 - shared table sort/filter helper + high-contrast fixes
   ========================================================================== */

/* Generic look for grids wired to TableSortFilter via the default hook
   classes (the Picklists and Record Types admin grids). The All Relationships
   and Users grids keep their existing ec-allrel-* / users-* visual classes and
   share only the behaviour, so their appearance is unchanged. */
/* v5.127.98 (findings .97 F8): a sortable heading wraps at its spaces ("Relationship / Friendly Name") rather than setting
   its column's width - one-line headings alone put a nine-column admin grid ~500px past a laptop screen */
th.tsf-sort { cursor:pointer; user-select:none; white-space:normal; }
th.tsf-sort::after { content:'\2195'; display:inline-block; margin-left:6px; opacity:.4; font-size:10px; }
th.tsf-sort:hover::after { opacity:.7; }
th.tsf-sort[data-sort-dir="asc"]::after { content:'\25B2'; opacity:1; }
th.tsf-sort[data-sort-dir="desc"]::after { content:'\25BC'; opacity:1; }
tr.tsf-filter-row th { padding:4px 8px 8px 8px; border-top:2px solid var(--blue); border-bottom:2px solid var(--blue); }
/* v5.127.98 (findings .97 F8): `width:0; min-width:100%` - the filter box fills its column but no longer sets the column's
   width. As `width:100%` a text box still asked for its default ~150px, so every filtered column of an admin table was at
   least that wide and a ten-column grid ran past a laptop screen whatever its contents. */
.tsf-filter { width:0; min-width:100%; box-sizing:border-box; font-size:11px; padding:3px 6px; border:1px solid var(--mid-blue); border-radius:3px; background:var(--white); color:var(--dark-gray); }
tr.tsf-filter-row th:has(> .tsf-filter) { min-width:64px; }
.tsf-filter:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 2px rgba(0,123,255,0.15); }
/* v4.27.0a: high-contrast safety net for the shared helper's own header
   classes, so any grid wired to TableSortFilter reads correctly in contrast
   mode even if its table doesn't carry one of the explicitly-listed table
   classes above. (The Picklists grid - .pl-list-table - was the casualty that
   surfaced this: its sortable headers are th.tsf-sort, but the contrast
   override only listed .data-table/.users-table/.col-table/.views-table. The
   .pl-list-table additions above fix that grid specifically; this rule guards
   the next bespoke-class grid.) */
[data-contrast="high"] th.tsf-sort { background:#000000; color:#FFDD00; }

/* Record Types grid: drag-to-reorder is suppressed while a filter is active
   (a filtered subset has no meaningful manual order). Dimming the handle and
   removing pointer events means a mousedown cannot arm a row drag, so no
   change to the shared drag-arming logic in data_actions.js is needed.
   v4.27.0: generalised to a shared `.tsf-filtered` class so any filter-only
   draggable grid (Record Types, Columns, Mappings) gets the same treatment;
   `.ec-rt-filtered` is kept as an alias for the Record Types grid. */
.ec-rt-filtered td[data-drag-handle],
.tsf-filtered td[data-drag-handle] { pointer-events:none; opacity:.35; cursor:default; }

/* High-contrast fixes (v4.26.0).
   [H] The "System" badge contrast issue is now handled by the canonical
   badge definitions below (v4.27.0); the old cm-badge-system-specific
   override was removed when the two badge families were unified. */

/* v4.27.0: canonical entity badges. Previously two unrelated treatments were
   used for the same semantic thing - a mid-blue/navy `.system-badge` (All
   Relationships, Record Types, Overview, Form Layout) and a navy/white
   `.cm-badge`+`.cm-badge-system` pair on the Columns tab, with different
   padding and divergent (or missing) contrast behaviour. They are unified here
   on the `.system-badge` look, with a matching `.virtual-badge` outline variant,
   both carrying proper high-contrast overrides. Defined in the shared
   stylesheet (not page-local) so every surface renders identically. */
.system-badge,
.virtual-badge {
    display:inline-block; font-size:11px; font-weight:600; line-height:1;
    padding:2px 7px; border-radius:10px; margin-left:6px;
    vertical-align:middle; letter-spacing:.02em;
}
.system-badge  { background:var(--mid-blue); color:var(--navy); }
.virtual-badge { background:transparent; color:var(--navy); border:1px solid var(--navy); }
[data-contrast="high"] .system-badge  { background:rgba(255,221,0,0.2); color:#FFDD00; }
[data-contrast="high"] .virtual-badge { background:transparent; color:#FFDD00; border-color:#FFDD00; }
/* v5.127.35 (form rules 10.2): Built-in - structure protected (cannot be deleted), values edited as usual. The
   System shape, a lighter fill with an outline, so the two kinds read as related but distinct. */
.builtin-badge {
    display:inline-block; font-size:11px; font-weight:600; line-height:1;
    padding:2px 7px; border-radius:10px; margin-left:6px; vertical-align:middle; letter-spacing:.02em;
    background:var(--white); color:var(--navy); border:1px solid var(--mid-blue);
}
[data-contrast="high"] .builtin-badge { background:transparent; color:#FFDD00; border-color:#FFDD00; border-style:dashed; }
/* v5.127.94 (RA1, D16): Calculated - a relationship attribute, calculated from related records. The same pill, told apart
   by SHAPE as well as colour (never colour alone): a dotted outline. The family: System = filled, Built-in = light fill
   with a solid outline (dashed in high contrast), Virtual = solid outline, Calculated = dotted outline. The markup is
   BadgeKit's (assets/js/badge_kit.js, includes/badge_kit.php) - never written by hand. */
.calculated-badge {
    display:inline-block; font-size:11px; font-weight:600; line-height:1;
    padding:2px 7px; border-radius:10px; margin-left:6px; vertical-align:middle; letter-spacing:.02em;
    background:transparent; color:var(--navy); border:1px dotted var(--navy);
}
[data-contrast="high"] .calculated-badge { background:transparent; color:#FFDD00; border-color:#FFDD00; border-style:dotted; }
/* v5.127.35 (form rules 10.4): a record-form section the user can collapse - the chevron is drawn here so the
   header's text stays the section title. */
.rec-section-head::before { content:'\25BE'; display:inline-block; width:12px; font-size:11px; color:var(--soft); }
.rec-section-head[aria-expanded="false"]::before { content:'\25B8'; }
.rec-section-head:focus-visible { outline:2px solid var(--mid-blue); outline-offset:2px; }
/* v5.127.56 (form rules L3): a section set to "Hide when nothing to show" with nothing to show (record_view.js judgeSections) */
.rec-section-nothing { display:none !important; }
/* v5.127.71 (form rules L4a): a section or field a Shown rule does not show (record_view.js applyRules); a Read only
   field an Editable when rule has not unlocked - an input, presented read-only, not display only */
.rec-rule-hidden { display:none !important; }
.rec-rule-locked .rec-field-control { pointer-events:none; }
.rec-rule-locked .rec-field-control input, .rec-rule-locked .rec-field-control select, .rec-rule-locked .rec-field-control textarea { background:var(--silver); color:var(--soft); }

/* v4.30.0: per-row badges in the Import/Export Mappings editor. Display-only
   chips showing each mapping row's import fate (headline) plus nature
   qualifiers. Colour language: green = writable target, blue = key, muted =
   ignored (no write), amber = invalid/health (Align would remove). */
/* v4.129.1: default-flag toggle chips in the Global Views tab. Off = outlined/muted;
   is-on = filled navy (this view holds the flag; one holder per record type). */
.ec-flag-chip { display:inline-block; border:1px solid var(--mid-blue); background:var(--white);
  color:var(--soft); border-radius:10px; padding:1px 8px; margin-right:4px; font-size:10px;
  font-weight:700; line-height:1.7; cursor:pointer; white-space:nowrap; }
.ec-flag-chip:hover { border-color:var(--navy); color:var(--navy); }
.ec-flag-chip.is-on { background:var(--navy); border-color:var(--navy); color:var(--white); }
.ec-flag-chip.is-on:hover { color:var(--white); opacity:.9; }

.ec-badge {
  display:inline-block; border-radius:10px; padding:1px 7px; font-size:10px;
  font-weight:700; white-space:nowrap; line-height:1.6; vertical-align:middle;
}
.ec-badge-ok   { background:var(--green); color:var(--white); }
.ec-badge-key  { background:var(--blue);  color:var(--white); }
.ec-badge-mute { background:var(--silver); color:var(--mid-gray); border:1px solid var(--mid-blue); }
.ec-badge-warn { background:var(--red);   color:var(--white); }
.ec-badge-nat  { background:transparent; color:var(--navy); border:1px solid var(--navy); font-weight:600; }
[data-contrast="high"] .ec-badge-ok   { background:rgba(0,255,136,0.2); color:#00FF88; }
[data-contrast="high"] .ec-badge-key  { background:rgba(255,221,0,0.2); color:#FFDD00; }
[data-contrast="high"] .ec-badge-mute { background:transparent; color:#CCCCCC; border-color:#CCCCCC; }
[data-contrast="high"] .ec-badge-warn { background:rgba(255,85,85,0.2); color:#FF5555; }
[data-contrast="high"] .ec-badge-nat  { background:transparent; color:#FFDD00; border-color:#FFDD00; }

/* v4.30.0a: inactive mapping row - dim only the content cells, never the
   Active-checkbox cell, so the control to reactivate stays clearly live. */
.map-cell-dim { opacity:0.45; }
/* v5.127.86 (brief items 3, 4): a mapping row's heading colours (the swatch and its palette) and its description */
.map-swatch { width:34px; height:24px; border:1px solid var(--mid-blue,#c8d0dc); border-radius:4px; font-weight:700; font-size:12px; cursor:pointer; padding:0; }
.map-swatch-none { background:repeating-linear-gradient(45deg,#fff 0 4px,#eef1f5 4px 8px); color:var(--soft,#667); border-style:dashed; }
.map-desc { width:260px; }
.map-heading-pop { position:absolute; z-index:1060; background:#fff; border:1px solid var(--mid-blue,#c8d0dc); border-radius:6px; box-shadow:0 6px 18px rgba(0,0,0,.18); padding:10px; display:flex; gap:16px; flex-wrap:wrap; max-width:560px; }
.map-pal-sec { display:flex; flex-direction:column; gap:2px; }
.map-pal-label { font-size:11px; font-weight:600; margin-bottom:4px; }
.map-pal-row { display:flex; gap:2px; }
.map-pal-std { margin-top:6px; }
.map-pal { width:18px; height:18px; border:1px solid rgba(0,0,0,.18); padding:0; cursor:pointer; border-radius:2px; }
.map-pal:hover, .map-pal:focus { outline:2px solid var(--blue,#2563eb); outline-offset:1px; }
.map-pal-on { outline:2px solid var(--blue,#2563eb); outline-offset:1px; }
.map-pal-none { margin-top:6px; font-size:11px; }
.map-pal-note { flex-basis:100%; font-size:11px; color:var(--soft,#667); }

/* [I] The audit-rotation table headers ("Month" / "Rows (approx)") are
   styled with a hardcoded near-white background and a soft grey colour in
   system_settings.php, with no contrast override - white-on-white in high
   contrast. Higher specificity here wins over that base rule. */
[data-contrast="high"] .partitions-table th { background:#1A1A1A; color:#FFFFFF; }

/* v4.28.0/tidy: the Audit Log rotation banner uses light backgrounds
   (#fafbfc / #fff8e1 / #fdecec) with dark text. In high contrast the page
   forces white text on descendants (.page-main rule) onto that near-white
   banner background - the whole status line vanishes. Give it a dark
   treatment, with the warn/disabled variants keeping their semantic hue as a
   readable accent. Same "bespoke-class surface the contrast layer didn't
   reach" class of fix as the Picklists header (v4.27.0a). */
[data-contrast="high"] .rotation-banner { background:#1A1A1A; color:#FFFFFF; border:1px solid #444444; }
[data-contrast="high"] .rotation-banner.warn { background:#1A1A1A; border-color:#FFAA00; color:#FFAA00; }
[data-contrast="high"] .rotation-banner.disabled { background:#1A1A1A; border-color:#FF5555; color:#FF5555; }
[data-contrast="high"] .rotation-banner-link { color:#FFDD00; }
[data-contrast="high"] .adv-colfilter-notice { background:#1A1A1A; border-color:#FFAA00; color:#FFAA00; }

/* Effective-permissions views (Phase 2, advisory). Matrix th/td contrast is
   handled by the shared high-contrast th/td lists above; the rules here add the
   base look plus the read-level colours and their contrast variants. */
.perm-modal{max-width:760px;width:92vw}
.perm-deriv{font-size:13px;color:var(--dark-gray);margin-bottom:10px}
.perm-deriv-list{margin:6px 0 0;padding-left:18px}
.perm-deriv-list li{margin:2px 0}
.perm-dim{color:var(--soft)}
.perm-empty{color:var(--soft);font-size:13px;padding:10px 0;text-align:center}
.perm-toggle{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--dark-gray);margin:6px 0 10px;cursor:pointer}
.perm-matrix-wrap{max-height:52vh;overflow:auto;border:1px solid var(--mid-blue);border-radius:6px}
.perm-matrix{width:100%;border-collapse:collapse;font-size:12px}
.perm-matrix th{background:var(--navy);color:var(--white);padding:6px 8px;text-align:left;white-space:nowrap;border-bottom:2px solid var(--mid-blue)}

/* seam 2: redaction chip - shown in place of a value the viewer may not read */
.redaction-chip{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--mid-gray);background:var(--silver);border:1px solid var(--mid-blue);border-radius:10px;padding:0 8px;line-height:1.7;white-space:nowrap;vertical-align:middle}
.redaction-chip .rc-lock{flex-shrink:0;color:var(--mid-gray)}
[data-contrast="high"] .redaction-chip{background:#000000;color:#FFDD00;border-color:#FFDD00}
/* v5.124.0 (unresolved references): the "not found" marker beside a stub - decoration, never part of the value.
   Amber, as the record form's not-found hint (combobox markDangling). */
.kwl-notfound{display:inline-block;margin-left:6px;font-size:10px;font-weight:700;color:var(--orange,#E67E22);border:1px solid var(--orange,#E67E22);border-radius:10px;padding:0 6px;line-height:1.6;white-space:nowrap;vertical-align:middle;text-transform:lowercase}
[data-contrast="high"] .kwl-notfound{color:#FFDD00;border-color:#FFDD00}
[data-contrast="high"] .redaction-chip .rc-lock{color:#FFDD00}
.perm-matrix td{padding:5px 8px;border-bottom:1px solid var(--mid-blue);vertical-align:top}
.perm-rt{font-weight:600;color:var(--navy);white-space:nowrap}
.perm-cell{text-align:center;width:48px}
.perm-yes{color:#1a7f37;font-weight:700}
.perm-no{color:var(--soft)}
.perm-lvl{display:block;font-weight:600}
.perm-src{display:block;color:var(--soft);font-size:10px;line-height:1.3;max-width:220px}
.perm-read-none .perm-lvl{color:var(--soft);font-weight:400}
.perm-read-resolve .perm-lvl{color:#8a6d00}
.perm-read-pick .perm-lvl{color:#0b6bcb}
.perm-read-explore .perm-lvl{color:#1a7f37}
.perm-floor-row{background:#f3f6fb}
.perm-note{font-size:11px;color:var(--soft);margin-top:8px}
[data-contrast="high"] .perm-yes{color:#5CFF8F}
[data-contrast="high"] .perm-no,
[data-contrast="high"] .perm-src,
[data-contrast="high"] .perm-dim,
[data-contrast="high"] .perm-note,
[data-contrast="high"] .perm-empty{color:#CCCCCC}
[data-contrast="high"] .perm-rt{color:#FFDD00}
[data-contrast="high"] .perm-read-none .perm-lvl{color:#AAAAAA}
[data-contrast="high"] .perm-read-resolve .perm-lvl{color:#FFD24D}
[data-contrast="high"] .perm-read-pick .perm-lvl{color:#7FC4FF}
[data-contrast="high"] .perm-read-explore .perm-lvl{color:#5CFF8F}
[data-contrast="high"] .perm-floor-row{background:#1a1a1a}

/* Children region (record surfaces). Shared by the record window, the in-grid
   modal, and later the detail pane, via assets/js/record_children.js. */
.rec-children-h{font-size:13px;font-weight:700;color:var(--navy);margin:0 0 8px}
.rec-children-det{margin:0}
.rec-children-sum{font-size:13px;font-weight:700;color:var(--navy);cursor:pointer;padding:6px 0}
.rec-children-det[open] .rec-children-sum{margin-bottom:8px}
.rec-child-panel{background:var(--white);border:1px solid var(--mid-blue);border-radius:6px;margin-bottom:8px;padding:10px 12px}
.rec-child-panel .rcp-headrow{display:flex;align-items:center;gap:10px}
.rec-child-panel .rcp-rung{flex-shrink:0;display:inline-flex;align-items:center;color:var(--soft)}
.rec-child-panel .rcp-headtext{flex:1;min-width:0}
.rec-child-panel.rcp-expandable .rcp-headrow{cursor:pointer}
.rec-child-panel.rcp-expandable .rcp-headrow:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:4px}
.rec-child-panel .rcp-head{font-size:13px;color:var(--navy);font-weight:600}
.rec-child-panel .rcp-sub{font-size:11px;color:var(--soft)}
.rec-child-panel .rcp-count{font-size:12px;color:var(--navy);background:var(--silver);border-radius:11px;padding:2px 11px;min-width:24px;text-align:center;flex-shrink:0}
.rec-child-panel .rcp-caret{flex-shrink:0;width:8px;height:10px;position:relative}
.rec-child-panel.rcp-expandable .rcp-caret::before{content:"";position:absolute;top:50%;left:0;transform:translateY(-50%);width:0;height:0;border-left:5px solid var(--soft);border-top:4px solid transparent;border-bottom:4px solid transparent;transition:transform .15s ease}
.rec-child-panel.rcp-expandable.rcp-open .rcp-caret::before{transform:translateY(-50%) rotate(90deg)}
.rec-child-panel .rcp-body{margin-top:10px}
.rec-child-panel .rcp-grid-note{font-size:11px;color:var(--soft);padding:4px 0}
.rec-child-panel .rcp-grid-wrap{max-height:50vh;overflow:auto}
.rec-child-panel .rcp-grid{width:auto;min-width:100%;font-size:inherit}
.rec-child-panel .rcp-grid th,
.rec-child-panel .rcp-grid td{padding:6px 8px;vertical-align:top;white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis}
.rec-child-panel .rcp-grid tbody td{border-bottom:1px solid var(--mid-blue)}
.rec-child-panel .rcp-grid tbody tr:last-child td{border-bottom:none}
.rec-child-panel .rcp-grid tbody tr.rcp-grid-row{cursor:pointer}
.rec-child-panel .rcp-grid tbody tr.rcp-grid-row:hover{background:var(--silver)}
/* Tier 3: chromeless pinned grid (entity_pinned.php). No app nav, so the grid height
   subtracts less; the not-pin-scoped or destructive toolbar actions are hidden until
   pin-aware versions land. */
.embed-mode .page-main{padding-top:10px}
/* v4.205.0b: the embed toolbar was set to wrap at narrow widths to avoid a page
   h-scrollbar. In the rail-on record modal the pane is narrow enough that the VIEW
   indicator wrapped to a second row, growing the chrome height and triggering a vertical
   scrollbar (and it worsens once a New button is added). Following the Audit Log pattern,
   keep the toolbar on ONE row and let it overflow horizontally instead: the chrome height
   is stable at every width, so no vertical scrollbar. min-width:0 lets the flex item
   shrink so overflow-x engages; the VIEW indicator is capped tighter in the embed so it
   stays visible before the row needs to scroll. */
.embed-mode .toolbar{flex-wrap:nowrap;overflow-x:auto;min-width:0}
.embed-bare .page-header h1{display:none}   /* railed: the rail head carries the title */
.embed-mode .grid-container{height:calc(100vh - 104px)}
.embed-mode .page-main.has-description .grid-container{height:calc(100vh - 126px)}
/* v4.143.0: Export is allowed in embed mode (rail / pop-out child grids) for
   users with Export on the record type; the server scopes it to the parent pin.
   New / Import / Delete stay hidden in the pinned context. */
/* v4.207.0 (tier-3 pin-aware actions): Delete All stays hidden in the pinned grid (it is
   superuser-only and filter-driven, so it is deferred until it carries the pin server-side).
   New is un-hidden only when the server sets .embed-can-new (create on the child AND Resolve
   on the parent). Delete Selected is un-hidden unconditionally: it acts on explicitly
   selected, pin-scoped rows, and the server gates it on can_delete exactly as the unpinned
   grid does. v5.127.13: Import is no longer hidden here - the page renders it only when a
   mode that names its rows by key (Add/Update) is allowed (gridImportModesAllowed). */
.embed-mode #btnActionDeleteAll{display:none !important}
.embed-mode:not(.embed-can-new) #btnNewRecord{display:none !important}
.embed-pin-badge{display:inline-block;font-size:11px;font-weight:600;color:var(--navy);background:var(--light-blue);border-radius:10px;padding:2px 9px;vertical-align:middle}
.embed-pin-parent{font-size:13px;font-weight:600;color:var(--navy);vertical-align:middle;margin-left:2px}
.embed-pin-type{font-weight:400;color:var(--soft)}
.rcp-fullbar{text-align:right;margin-bottom:6px}
.rcp-full-link{font-size:11px;color:var(--blue);background:none;border:0;cursor:pointer;padding:2px 4px}
.rcp-full-link:hover{text-decoration:underline}

/* ── Compare surface (record surfaces: side-by-side compare, v4.125.0) ──
   A read-only matrix: attributes down a sticky left column, one column per
   record. Columns size so two fit comfortably and three on a wide window; more
   than that scrolls horizontally. Header row and the attribute column are both
   sticky so labels stay visible while scrolling either axis. */
.compare-body { margin: 0; background: var(--bg, #fff); }
.compare-shell { padding: 16px 20px 28px; }
.compare-loading,
.compare-empty { color: var(--soft, #6b7280); font-size: 14px; padding: 24px 4px; }
.compare-note { color: var(--soft, #6b7280); font-size: 12px; margin: 12px 2px 0; }
.compare-topbar { margin: 0 0 12px; }
.compare-title { font-size: 18px; font-weight: 700; color: var(--navy, #1f2a44); margin: 0; }

.compare-scroll { overflow: auto; max-height: calc(100vh - 90px); border: 1px solid var(--silver, #e5e7eb); border-radius: 6px; }
.compare-matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
.compare-matrix th,
.compare-matrix td { padding: 8px 12px; border-bottom: 1px solid var(--silver, #e5e7eb); vertical-align: top; text-align: left; }

/* Record columns: each at least this wide so 2 fit; 3 on a wide window; scroll beyond. */
.compare-rec-head,
.compare-cell { min-width: 240px; max-width: 360px; word-break: break-word; }

/* Sticky attribute column (left) */
.compare-attr,
.compare-corner { position: sticky; left: 0; z-index: 1; background: var(--silver, #f3f4f6); font-weight: 600; color: var(--navy, #1f2a44); min-width: 160px; max-width: 220px; border-right: 1px solid var(--silver, #e5e7eb); }

/* Sticky header row (top) */
.compare-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--mid-blue, #dbe4f0); }
.compare-corner { z-index: 3; }   /* top-left intersection sits above both */

.compare-rec-head { font-weight: 700; }
.compare-rec-link { color: var(--navy, #1f2a44); text-decoration: none; }
.compare-rec-link:hover { text-decoration: underline; }
.compare-empty-cell { color: var(--soft, #9ca3af); }

/* Compare: related-record counts section (slice 2, v4.126.0) */
.compare-section-head {
    background: var(--mid-blue, #dbe4f0);
    color: var(--navy, #1f2a44);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}
.compare-section-cell { background: var(--mid-blue, #dbe4f0); }
.compare-count-cell { font-variant-numeric: tabular-nums; }

/* Compare: difference highlighting + Differences-only filter (slice 3, v4.127.0) */
.compare-topbar { display: flex; align-items: center; gap: 12px; }
.compare-controls { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.compare-diff-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--navy, #1f2a44); cursor: pointer; user-select: none; }
.compare-diff-toggle input[disabled] { cursor: default; }
.compare-diff-toggle:has(input[disabled]) { color: var(--soft, #9ca3af); cursor: default; }
.compare-diff-count { font-size: 12px; color: var(--soft, #6b7280); }
/* Differing rows are accented in both modes: a left bar on the attribute cell and a faint tint on the value cells. */
.compare-row-diff .compare-attr { box-shadow: inset 3px 0 0 var(--blue, #2f6fed); }
.compare-row-diff .compare-cell { background: rgba(47, 111, 237, 0.07); }
[data-contrast="high"] .compare-row-diff .compare-attr { box-shadow: inset 3px 0 0 #FFDD00; }
[data-contrast="high"] .compare-row-diff .compare-cell { background: rgba(255, 221, 0, 0.12); }
/* Differences-only: hide the equal rows (diff and indeterminate rows stay). */
.compare-diffs-only .compare-row-same { display: none; }

/* ── no_access: the no-data landing page (v4.193.0, OIDC Slice C) ──────────
   Full app chrome, a message card where the grid would be. Card colours come
   from the same custom properties as the rest of the app, so the
   [data-contrast=high] overrides below are the only extra rule needed. */
.page-no-access .no-access-card {
  background: var(--white);
  border: 1px solid var(--mid-blue);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 44rem;
  margin-top: 8px;
  line-height: 1.55;
}
.page-no-access .no-access-lead { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.page-no-access .no-access-card p { margin: 0 0 12px; }
.page-no-access .no-access-identity { margin-top: 18px; font-size: 12px; color: var(--soft); }
[data-contrast="high"] .page-no-access .no-access-card { background:#1A1A1A; border:2px solid #FFFFFF; }


/* ── Record form: the per-field gutter (v5.63.0, Part A) ────────────────────────
   A fixed-width column at the right of every field wrapper, holding the ⋮ that
   opens the per-field menu. Top-aligned rather than centred (align-items:
   flex-start), so a three-row textarea, or a control carrying a hint underneath,
   does not leave the glyph floating in the middle of nothing.

   THE WIDTH IS RESERVED BY THE ROW. .rec-field-gutter is an inert span used where
   no glyph is offered (a redacted field), so the control beside it is the same
   width as its neighbours' and nothing shifts between fields. A hidden BUTTON
   would be the wrong tool: still focusable, still in the tab order, still
   announced, which on a read-mode form is one dead tab stop per field.

   min-width:0 on the control column is load bearing. A flex item's default
   min-width is auto, which refuses to shrink below its content, and a long
   unbroken value in an input would otherwise push the gutter off the row.

   THE WIDTH IS --rec-field-gutter, DECLARED ONCE IN :root. It is read by both rules
   below and by nothing else, so it is changed in one place. 24px in v5.63.0, 16px
   from v5.63.0a. */
.rec-field-row{display:flex;align-items:flex-start;gap:0}
.rec-field-control{flex:1 1 auto;min-width:0}
.rec-field-gutter,.rec-field-menu{flex:0 0 var(--rec-field-gutter);width:var(--rec-field-gutter)}
/* CENTRED in its column (v5.63.0b). v5.63.0a pushed the glyph hard left because at 24px,
   centring left the dots equidistant between their own control and the next field along -
   ambiguous on a three-column form. At 16px that argument no longer holds: centred is 8px
   from the control edge and 8px + the 12px row gap = 20px from the next field, so the dots
   still read as belonging to the control on their left, and they no longer look pinned to
   its border.

   THE HEIGHT IS BUILT FROM THE SAME BOX AS .form-control, NOT COPIED FROM IT. v5.63.0a set
   an explicit height:28px against a control that computes to 32px (16px line + 14px padding
   + 2px border, box-sizing:border-box). Tops are flush under align-items:flex-start, so the
   button fell 4px short at the bottom - and because the focus ring is drawn 3px outside the
   button box, it sat 3px PROUD of the input's top while stopping 1px SHORT of its bottom.
   That is the uneven bounding box.

   Declaring the same padding, border and line-height instead of a matching number means the
   two cannot drift: if .form-control's padding or font-size ever moves, the glyph follows.
   The border is transparent rather than absent because a border still occupies its 1px in
   the box, and dropping it would reintroduce the 2px mismatch. font-size is free to differ -
   it sizes the glyph, and line-height fixes the line box regardless. */
/* position:relative + z-index:1 (v5.63.0d) SO THE FOCUS RING IS NOT PAINTED OVER.
   The ring is an outline, drawn OUTSIDE the border box, so its left 2px falls into the
   control column beside it (the row has gap:0, so the two boxes are flush). Combobox
   controls - every editable PICKLIST and RELATIONSHIP field - are wrapped by
   combobox.js in a .kwl-combo-wrap carrying an inline position:relative, and a positioned
   element paints AFTER static siblings in the same stacking context. So the wrap painted
   over the ring's left edge and it vanished, on those fields only. A plain input is not
   positioned and never covered it, which is why a date or a text field looked correct
   and a picklist did not.

   Making the button positioned too puts it in the same paint phase, and z-index:1 settles
   the order explicitly rather than relying on DOM sequence. It moves nothing: position
   relative with no offsets occupies exactly the same box. */
.rec-field-menu{position:relative;z-index:1;
  padding:7px 0;border:1px solid transparent;line-height:16px;font-size:15px;
  text-align:center;background:none;cursor:pointer;
  color:var(--soft);border-radius:var(--radius)}
/* Hover and focus are DECORATIVE ONLY. The button is always present and always
   clickable; raising the contrast is the whole of what they do, so if hover
   behaves oddly over a disabled control the glyph simply stays dim and still
   works. Hovering the field lights it too, which is what makes a column of dots
   read as a rule rather than as a row of controls. */
.rec-field-menu:hover,.rec-field-menu:focus{color:var(--navy);background:var(--silver)}
/* THE FOCUS RING IS var(--blue), NOT var(--mid-blue) (v5.63.0c). The original token was
   picked by eye and never measured, and it failed the 3:1 minimum for a non-text UI
   indicator in BOTH themes:

       --mid-blue #BDD7EE on #FFFFFF   1.49:1     normal
       --mid-blue #444444 on #1A1A1A   1.79:1     high contrast
       --blue     #2E75B6 on #FFFFFF   4.84:1     normal
       --blue     #FFDD00 on #1A1A1A  12.92:1     high contrast

   One token fixes both because [data-contrast="high"] already redefines --blue to
   #FFDD00, so this needs no high-contrast override of its own - and cannot acquire a
   theme where one was forgotten. It is also the same token .form-control:focus uses for
   its focus border, so the two indicators are the same colour on the same form.

   outline-offset stays 0 (v5.63.0b): with the button box the same height as the control,
   the ring sits an even 2px proud top and bottom. The ring GROWING by 2px is deliberate
   and is not a mismatch - a focused .form-control grows by exactly the same 2px through
   its box-shadow spread, so the two behave alike; it only looks larger next to an
   UNFOCUSED field. Owner reviewed the size on staging and chose to leave it. */
.rec-field-menu:focus-visible{outline:2px solid var(--blue);outline-offset:0}
[data-field-wrap]:hover .rec-field-menu{color:var(--navy)}
[data-contrast="high"] .rec-field-menu{color:#BBB}
[data-contrast="high"] .rec-field-menu:hover,[data-contrast="high"] .rec-field-menu:focus{color:#FFF;background:#333}
[data-contrast="high"] [data-field-wrap]:hover .rec-field-menu{color:#FFF}

/* v5.84.4: DISPLAY ONLY - the third field kind. The control is still built and still
   carries data-col, so label resolution (picklists, relationships) and the dirty-only
   save loop are unchanged; this only strips the input chrome so the field reads as a
   value rather than as a box the user might try to type in. It covers the sibling
   display box the read-only relationship and picklist paths insert, which is why the
   rule is on the wrapper rather than on the control. */
.kwl-display-only input,
.kwl-display-only select,
.kwl-display-only textarea {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    color: var(--navy) !important;
    cursor: default;
}
.kwl-display-only label { color: var(--soft); }

/* v5.84.9: THE SCROLLBAR CORNER ON A DISPLAY-ONLY TEXTAREA.
   The rules above strip the textarea's own background and border, but the square where the
   vertical scrollbar meets the bottom edge is a separate UA-painted pseudo-element and keeps
   its fill - so the resize grabber sat in a small box that vanished the moment the field was
   dragged tall enough to lose the scrollbar. On a READ-ONLY textarea it looks right because
   the field still has a border for the corner to sit against; stripped, it has nothing.

   Scoped under .kwl-display-only, which is added in exactly ONE place
   (applyDisplayOnlyPresentation, only when field.kind === 'display'), so a read-only field
   cannot be reached by it.

   THE SCROLLBAR AND THE GRABBER STAY. Both reveal more of a long value, which is what display
   only is for, and both work on a disabled textarea. This removes the leftover paint behind
   them, not the affordances.

   KNOWN RISK, SHIPPED KNOWINGLY: touching any ::-webkit-scrollbar-* pseudo-element can flip
   Chrome into CUSTOM scrollbar rendering for that element, which would change how the
   scrollbar itself looks - squarer and flatter than the native one. It may not fire for the
   corner alone; there is no browser in the build sandbox to check. If the scrollbar's own
   appearance changed, THIS RULE IS THE CAUSE and removing these two lines is the whole
   revert. */
/* v5.84.11: ::-webkit-resizer REMOVED from this rule. Chrome draws the grabber's diagonal
   lines AS ITS BACKGROUND, so `background: transparent` did not clear the box behind the
   grabber - it erased the grabber. The corner alone is the box. */
.kwl-display-only textarea::-webkit-scrollbar-corner { background: transparent; }

/* v5.84.8: THE VALUE AS TEXT, AND THE GLYPH IMMEDIATELY AFTER IT.
   The control host KEEPS flex:1 1 auto - the layout does not truncate. NOTE the authored
   width is only actually honoured because of the min-width:0 rule above (v5.84.11); this
   comment claimed it outright and was wrong until then. What changes is INSIDE it: the value is a span that sizes to
   its text, so the ⋮ that follows sits next to the value rather than at the far right.

   Reverted mechanism, for the record: v5.84.5 shrank the HOST. .form-control is
   width:100%, so a shrink-to-fit host is circular and the browser falls back to the
   control's UA default width. It ignored authored widths and truncated real values.
   Case 10 of _tools/tests/display_only_presentation.js refuses that shape.

   WRAP AT FULL WIDTH, ELLIPSIS EVERYWHERE ELSE (owner, 2026-09-15). Wrapping only costs
   something when a neighbour shares the row; at full width there is none, so a long value
   may take a second line. At half and third the value ellipses instead, and the width the
   author chose is a real decision with a visible consequence.

   NO title ATTRIBUTE for the overflow. title on a form control is RESERVED for a future
   per-field hint, and it is one slot per element - spending it here would silently break
   that the day it is built. Copy value in the field menu is the route to the full text. */
/* v5.84.11: min-width:0 ON THE FIELD WRAPPER, not only on the row inside it.
   The wrapper is a flex ITEM of the form's row container, carrying its authored width as
   `flex: 0 0 calc(33.33% - 8px)` or similar. A flex item's default min-width is AUTO, which
   refuses to shrink below its content - and a nowrap span cannot shrink, so an over-long value
   pushed the wrapper past its basis and a third-width field rendered FULL LENGTH with no
   ellipsis. It never happened before because the old control was an <input> with width:100%,
   which shrinks freely; the span is the first display-only content that cannot.
   The authored width is only honoured once the wrapper is allowed to hold it. */
.kwl-display-only { min-width: 0; }
.kwl-display-only .rec-field-control {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.kwl-display-value {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--navy);
    font-size: 13px;
    /* Matches .form-control's vertical box so a display-only field sits on the same
       baseline as an editable one beside it in the same row. */
    padding: 7px 0;
    line-height: 16px;
}
/* Narrower than full: one line, clipped with an ellipsis. */
[data-field-width="half"]   .kwl-display-value,
[data-field-width="third"]  .kwl-display-value,
[data-field-width="twothird"] .kwl-display-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Full width: wrap, including a long unbroken URL, which would otherwise overflow. */
[data-field-width="full"] .kwl-display-value {
    white-space: normal;
    overflow-wrap: anywhere;
}
/* The glyph follows the value and never gets squeezed out by it. */
.kwl-display-only .rec-field-control .rec-field-menu { flex: 0 0 var(--rec-field-gutter); }

/* v5.84.6: KILL THE UA-DRAWN ARROW ON A <select>. The rules above take away the
   border, background and box-shadow, but a native select's arrow is drawn by the
   user agent and survives all three - so a Boolean display-only field read as a
   stripped box that still offered to drop open. appearance:none is the only thing
   that removes it; the -webkit- prefix is still needed for Safari.

   DELIBERATELY NOT A BLANKET RESET. The textarea's resize grabber and scrollbar are
   UA-drawn too and are KEPT: they reveal more of a long value, which is what
   display only is for, and they work on a disabled textarea (owner-confirmed on a
   real field). The rule is about what an affordance PROMISES, not who drew it. */
.kwl-display-only select {
    appearance: none;
    -webkit-appearance: none;
}
/* v5.84.7: THE SHRINK-TO-CONTENT RULE IS REVERTED. It never did what it claimed.
   v5.84.5 set `flex: 0 1 auto` here so the ⋮ would follow the value instead of sitting
   at the far right of a full-width host. But .form-control is width:100%, and inside a
   shrink-to-fit flex item that is circular, so the browser falls back to the CONTROL'S
   UA DEFAULT WIDTH - about 20 characters for an <input>, 20 columns for a <textarea>.
   It never sized to the text at all.

   Two consequences, both measured on staging:
     - short values kept the dots ~150px away, which is an input's default width
     - AUTHORED WIDTHS WERE IGNORED and long values were TRUNCATED. The wrapper still
       carried flex:0 0 100%, so the FIELD was full width while the control inside it
       was not: "Emergency Generator - Mo|", "https://www.example.com/w|". A display-only
       field hiding the data it exists to show is worse than the gap it was fixing.

   The gap variable went with it - it only ever existed to serve the shrink.

   The original finding (dots trailing a short value by the width of the whole field) is
   OPEN AGAIN and is deliberately not fixed here. It needs the long-value case decided
   first: whether an over-long value wraps or ellipses, and what happens at half width in
   a three-column section. Two guesses at it have now failed. */

/* v5.85.3: the public smart form (public_form.php). It sits on the sign-in card, and the global
   reset above (* { margin:0; padding:0 }) leaves two things tight that the sign-in page never has:
   the form's intro text runs straight into the first question, and a radio question keeps the
   browser's fieldset border with no padding, an unstyled legend, and its options in the bold block
   style meant for field labels. Scoped to .kwl-public-form so nothing else on the card or in the
   app moves. A radio question now reads like every other question: label, then its choices. */
.kwl-public-form-intro { margin:0 0 20px; line-height:1.45; white-space:pre-line; }   /* v5.126.1: an intro's own line breaks show (a listing's Description (Public) is multi-line) */
.kwl-public-form fieldset { border:0; margin:0; padding:0; min-width:0; }
.kwl-public-form legend { display:block; padding:0; margin-bottom:8px; font-weight:600; font-size:13px; }
.kwl-public-form fieldset label { display:flex; align-items:center; gap:8px; margin:0 0 6px; font-weight:400; font-size:14px; }
.kwl-public-form fieldset label:last-child { margin-bottom:0; }
/* v5.94.0 (R3a): the public form's honeypot. Off-screen rather than display:none, because some bots
 * skip fields that are not rendered at all. aria-hidden on the wrapper and tabindex=-1 on the input
 * keep it away from screen readers and keyboards, so no person meets it. */
.kwl-sf-hp { position:absolute; left:-10000px; top:auto; width:1px; height:1px; overflow:hidden; }

/* ─────────────────────────────────────────────────────────────
 * Smart form body and the task form (v5.90.0)
 *
 * .sf-help / .sf-error are the SHARED BODY's own classes (includes/form_body.php), so public and
 * task forms both get them. They replace `.form-note`, which is the login page's centred footnote
 * and put help text centred under a left-aligned label.
 *
 * .kwl-taskform is task_form.php in both modes; body.kwl-taskform-embed is the page inside the
 * task form modal (tasks_menu.js openTaskForm). The modal sits at 860 in the ladder above.
 * ───────────────────────────────────────────────────────────── */
.sf-help  { font-size:12px; color:var(--mid-gray); margin-top:4px; text-align:left; }
/* v5.127.57: a task form's record line - the record's value under its label, read-only text (form_body.php) */
.sf-record-value { margin:2px 0 0; text-align:left; white-space:pre-line; overflow-wrap:anywhere; }
/* v5.127.74 (T1b): a task form on many records - the header line, and a question's "relevant to 6 of 10 records" note */
.sf-many-head { margin:0 0 2px; font-weight:600; }
.sf-help.sf-many-blank { margin:0 0 14px; }
.sf-many-note { font-size:12px; color:var(--mid-gray); margin:2px 0 4px; text-align:left; font-style:italic; }
.sf-error { font-size:12px; color:#b3261e; font-weight:600; margin-top:4px; text-align:left; }
[data-contrast="high"] .sf-error { color:#ff8a80; }
/* v5.96.0 (R3b-2): the shared body's repetitions, item picker and running total. */
.sf-rep       { border-top:1px solid var(--light-gray, #ddd); margin-top:12px; padding-top:8px; text-align:left; }
.sf-rep-title { font-size:15px; margin:4px 0 8px; text-align:left; }
.sf-qty       { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:4px 0; }
.sf-qty select.form-control { width:auto; min-width:4.5em; }
.sf-total     { font-weight:600; text-align:right; margin:12px 0; }
/* v5.111.0: a code box (a discount code) with its Apply button beside it, and the note once it is accepted. */
.sf-code      { display:flex; gap:8px; align-items:center; }
.sf-code .form-control { flex:1 1 auto; min-width:0; text-transform:uppercase; }
.sf-code .btn { flex:0 0 auto; width:auto; }
.sf-code-note { font-size:12px; color:#1b6e2e; font-weight:600; margin-top:4px; text-align:left; }
[data-contrast="high"] .sf-code-note { color:#8be09a; }

.kwl-taskform-overlay { z-index:860; }
.kwl-taskform-modal   { max-width:640px; }
.kwl-taskform-frame   { display:block; width:100%; border:0; height:320px; max-height:calc(90vh - 60px); }

.kwl-taskform              { max-width:640px; padding:16px 20px; }
.kwl-taskform h1           { margin-bottom:12px; }
.kwl-taskform-intro        { margin:0 0 18px; color:var(--dark-gray); }
.kwl-taskform .form-group  { margin-bottom:16px; }
.kwl-taskform-actions      { display:flex; gap:10px; margin-top:8px; }
body.kwl-taskform-embed               { background:var(--white); }
body.kwl-taskform-embed .kwl-taskform  { max-width:none; padding:20px; }
body.kwl-taskform-embed > .alert      { margin:20px 20px 12px; }
body.kwl-taskform-embed > .kwl-taskform-actions { margin:0 20px 20px; }

/* ─────────────────────────────────────────────────────────────
 * A surface being redrawn after a task (v5.91.0)
 *
 * TaskMenu.lockSurface() puts this on the host's surface the instant a task finishes - the grid's
 * record modal, or the record page - and disables its controls, so nobody can edit values the task
 * has just replaced while the fresh record is fetched. The overlay carries the words; the disabled
 * controls stop the keyboard. Released by TaskMenu.unlockSurface() when the record is redrawn.
 * ───────────────────────────────────────────────────────────── */
.kwl-surface-refreshing { position:relative; }
.kwl-surface-refreshing::after {
    content: attr(data-refreshing);
    position:absolute; inset:0; z-index:20;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,0.7); color:var(--navy); font-weight:600; font-size:14px;
    cursor:progress;
}
body.kwl-surface-refreshing::after { position:fixed; }
[data-contrast="high"] .kwl-surface-refreshing::after { background:rgba(0,0,0,0.75); color:#fff; }

/* v5.92.0: a status on the end of a grid's description - the Automation Activity worker heartbeat.
   Inherits the description's size and colour; red, and bold enough to be seen, when stale. */
.page-description-status.is-stale { color:#b3261e; font-weight:600; }
[data-contrast="high"] .page-description-status.is-stale { color:#ff8a80; }


/* v5.100.0: step-by-step smart forms (assets/js/form_steps.js). Steps are shown and hidden with a class,
   never the hidden attribute, which belongs to the conditions; a stepped-away field still submits. */
.sf-step-off { display:none !important; }
.sf-steps-head { margin:0 0 12px; }
.sf-steps-progress { margin:0; font-size:12px; color:var(--soft); }
.sf-steps-title { margin:2px 0 0; font-size:18px; color:var(--navy); }
.sf-steps-nav { display:flex; justify-content:space-between; gap:10px; margin:16px 0 8px; }
.sf-steps-nav .sf-steps-next { margin-left:auto; }
.sf-steps-summary { margin:0 0 14px; }
.sf-steps-sumbox { border:1px solid var(--mid-gray, #ddd); border-radius:6px; padding:8px 10px; margin-bottom:8px; }
.sf-steps-sumhead { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.sf-steps-sumlist { margin:6px 0 0; display:grid; grid-template-columns:minmax(90px, 40%) 1fr; gap:2px 10px; font-size:13px; }
.sf-steps-sumlist dt { color:var(--soft); }
.sf-steps-sumlist dd { margin:0; }
.kwl-public-form.sf-stepped .sf-rep-title { display:none; }
[data-contrast="high"] .sf-steps-title { color:#FFFF00; }
.sf-steps-ask { margin:8px 0; } .sf-steps-ask p { margin:0 0 6px; } .sf-steps-ask .btn { margin-right:6px; }

/* v5.101.1 (owner, 22 September 2026): a tighter smart form, public and task alike.
   - the hint hugs its QUESTION, and the gap falls between the hint and the answers;
   - answers read at body weight, a step below the question, not louder than it;
   - less padding in text boxes and dropdowns on the public page (its login-card inputs were 10px 14px),
     and less space between questions. */
.kwl-public-form legend, .kwl-taskform legend { margin-bottom:3px; }
.form-group label + .sf-help, .kwl-public-form legend + .sf-help, .kwl-taskform legend + .sf-help { margin:-2px 0 6px; }
.kwl-public-form fieldset label, .kwl-taskform fieldset label { font-size:13px; color:var(--dark-gray); margin:0 0 4px; }
.login-card .kwl-public-form .form-control { padding:6px 10px; font-size:14px; }   /* v5.101.2: 14px (owner), was the login card's 15px */
.kwl-public-form .form-group { margin-bottom:12px; }
.sf-steps-err { margin-top:4px; }

/* v5.102.0: the Answers panel under a record's form (assets/js/record_answers.js). */
.rec-answers { margin:18px 0 8px; padding-top:10px; border-top:1px solid var(--mid-gray, #ddd); }
.rec-answers h3 { font-size:13px; font-weight:700; color:var(--navy); margin:0 0 6px; text-transform:uppercase; letter-spacing:0.4px; }
.rec-answers dl { display:grid; grid-template-columns:minmax(120px, 30%) 1fr; gap:3px 12px; margin:0; font-size:13px; }
.rec-answers dt { color:var(--soft); }
.rec-answers dd { margin:0; }
[data-contrast="high"] .rec-answers h3 { color:#FFFF00; }

/* v5.109.0: report pages (module_page.php; Ticketing's Reports). Tables reuse .views-table, so high contrast
   already covers them. Copying a table into Excel or Word takes its cells as they are shown. */
.report-controls { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:0 0 10px; }
.report-controls label { display:flex; gap:8px; align-items:center; font-weight:600; color:var(--navy); }
.report-controls label.report-check { font-weight:400; gap:6px; }
.report-tabs { display:flex; gap:6px; align-items:center; flex-wrap:wrap; border-bottom:2px solid var(--mid-blue); margin:0 0 12px; padding-bottom:6px; }
.report-tab { padding:6px 12px; border-radius:var(--radius); color:var(--navy); text-decoration:none; }
.report-tab.active { background:var(--navy); color:var(--white); }
.report-tabs [data-report-print] { margin-left:auto; }
.report-title { font-size:18px; color:var(--navy); margin:4px 0 2px; }
.report-note { color:var(--soft); margin:0 0 10px; }
.report-section { margin:0 0 20px; }
.report-section h3 { font-size:15px; color:var(--navy); margin:8px 0 6px; }
.report-scroll { overflow-x:auto; max-width:100%; }
.report-table { width:auto; min-width:50%; }
.report-table td.report-withheld { color:var(--soft); font-style:italic; }
.report-table .report-num { text-align:right; font-variant-numeric:tabular-nums; }
.report-table tr.report-total td { font-weight:600; border-top:2px solid var(--navy); }
[data-contrast="high"] .report-tab { color:#FFFFFF; }
[data-contrast="high"] .report-tab.active { background:#FFDD00; color:#000000; }
@media print {
  .app-nav, .report-noprint, .report-tabs { display:none !important; }
  .page-main { padding:0; }
  .report-table { width:100%; font-size:11pt; }
  .report-table th { background:none !important; color:#000 !important; border-bottom:2px solid #000; }
  .report-table td { border-bottom:1px solid #999; background:none !important; }
  .report-table tr.report-total td { border-top:2px solid #000; }
  .report-section { break-after:auto; }
  .report-scroll { overflow:visible; }
}

/* v5.127.0: Users - lock / unlock a selection. The bar shows only while something is ticked. */
.kwl-users-bulk{display:flex;align-items:center;gap:8px;margin:0 0 10px;padding:6px 10px;border:1px solid var(--mid-blue);border-radius:var(--radius);background:var(--silver);font-size:13px}
.kwl-users-bulk[hidden]{display:none}
.users-table th.kwl-users-sel,.users-table td.kwl-users-sel{width:28px;text-align:center;padding-left:6px;padding-right:2px}

/* ===== tab shell (v5.127.67: moved from access.php - the Users / Teams / Roles page and the Call-out Register) ===== */
.ut-tabs{display:flex;gap:4px;border-bottom:2px solid var(--mid-blue);margin:0 0 16px}
.ut-tab{appearance:none;background:none;border:none;border-bottom:3px solid transparent;padding:10px 18px;font-size:14px;font-weight:600;color:var(--soft);cursor:pointer;margin-bottom:-2px}
.ut-tab:hover{color:var(--navy)}
.ut-tab.active{color:var(--navy);border-bottom-color:var(--navy)}
.ut-panel[hidden]{display:none}
[data-contrast="high"] .ut-tabs{border-bottom-color:#FFDD00}
[data-contrast="high"] .ut-tab{color:#CCCCCC}
[data-contrast="high"] .ut-tab:hover{color:#FFFFFF}
[data-contrast="high"] .ut-tab.active{color:#FFDD00;border-bottom-color:#FFDD00}

/* ─────────────────────────────────────────────────────────────
 * v5.127.87: NOTIFICATIONS - the bell and its panel (design proposals/export-enhancements.md section 4; the canvas
 * "System notifications - mock-ups", panel 2D). The bell sits in the navy band, icon only; the panel opens under it.
 * ───────────────────────────────────────────────────────────── */
.nav-bell { position:relative; width:44px; height:40px; border:none; border-radius:4px; background:transparent; color:#fff;
            cursor:pointer; display:inline-flex; align-items:center; justify-content:center; flex:none; margin-right:4px; }
.nav-bell:hover, .nav-bell.nav-bell-open { background:rgba(255,255,255,0.18); }
.nav-bell:focus-visible { outline:2px solid #fff; outline-offset:1px; }
.nav-bell-badge { position:absolute; top:3px; right:3px; min-width:18px; height:18px; padding:0 5px; box-sizing:border-box;
                  border-radius:9px; background:#fff; color:var(--navy,#1B3A5C); font-size:11px; font-weight:700; line-height:14px;
                  text-align:center; border:2px solid var(--env-bg, var(--navy,#1B3A5C)); }
.nav-bell-badge-fail { background:#C0392B; color:#fff; }
.nav-bell-dot { position:absolute; top:6px; right:6px; width:10px; height:10px; border-radius:5px; background:#D5E8F0;
                border:2px solid var(--env-bg, var(--navy,#1B3A5C)); }
.notify-panel { position:fixed; z-index:860; background:#fff; border-radius:4px; box-shadow:0 2px 8px rgba(0,0,0,0.18);
                max-height:calc(100vh - 80px); display:flex; flex-direction:column; overflow:hidden; color:#404040; font-size:13px; }
.notify-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 10px; }
.notify-title { margin:0; font-size:15px; color:var(--navy,#1B3A5C); }
.notify-delete-finished { border:none; background:none; color:#2E75B6; font-size:12px; cursor:pointer; padding:4px; text-decoration:underline; }
.notify-chips { display:flex; gap:6px; padding:0 16px 12px; border-bottom:1px solid #E3E3E3; flex-wrap:wrap; }
.notify-chip { height:30px; padding:0 12px; border-radius:15px; font-size:12px; cursor:pointer; border:1px solid #BDBDBD; background:#fff; color:var(--navy,#1B3A5C); }
.notify-chip-on { background:var(--navy,#1B3A5C); color:#fff; border-color:var(--navy,#1B3A5C); }
.notify-list { overflow-y:auto; }
.notify-empty { padding:18px 16px; margin:0; color:#555; }
.notify-row { display:flex; align-items:flex-start; gap:8px; padding:10px 8px 10px 16px; border-bottom:1px solid #ECECEC; min-height:60px; box-sizing:border-box; }
.notify-main { display:flex; flex-direction:column; gap:5px; flex:1 1 auto; min-width:0; }
.notify-l2 { display:flex; align-items:baseline; gap:7px; min-width:0; }   /* v5.127.88: state, when, time left (was l1, with the title) */
.notify-unread { width:8px; height:8px; border-radius:4px; background:#2E75B6; flex:none; }
.notify-chip-state { font-size:11px; font-weight:700; padding:2px 7px; border-radius:3px; flex:none; background:#ECECEC; color:#404040; }
.notify-state-preparing { background:#D5E8F0; color:var(--navy,#1B3A5C); }
.notify-state-ready { background:#D4EFDF; color:#145A32; }
.notify-state-failed { background:#F6D5D1; color:#922B21; }
.notify-state-message { background:#E8DAEF; color:#4A235A; }
.notify-state-running { background:#D5E8F0; color:var(--navy,#1B3A5C); }   /* v5.127.89: a background job, as Preparing */
.notify-state-finished { background:#D4EFDF; color:#145A32; }   /* v5.127.89: as Ready */
.notify-row-title { font-weight:700; color:#1A1A1A; line-height:1.3; overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow-wrap:anywhere; }   /* v5.127.88: its own line, two before it is cut */
.notify-when { font-size:12px; color:#555; min-width:0; }   /* v5.127.88: wraps - the countdown is never cut */
.notify-sub { font-size:12px; color:#555; overflow-wrap:anywhere; }   /* v5.127.88: wraps (the reason, who stopped it) */
.notify-sub-fail { color:#922B21; }
.notify-bar { height:5px; background:#E3E3E3; border-radius:3px; overflow:hidden; }
.notify-bar-fill { height:5px; background:#2E75B6; }
.notify-btn { width:44px; height:44px; border:none; border-radius:4px; background:transparent; cursor:pointer; color:#2E75B6;
              display:inline-flex; align-items:center; justify-content:center; flex:none; }
.notify-btn:hover { background:#F2F2F2; }
.notify-btn:disabled { opacity:0.4; cursor:default; }
.notify-btn-stop { color:#A93226; }
.notify-btn-del { color:#666; }
.notify-btn-gap { width:44px; flex:none; }
[data-contrast="high"] .notify-panel, [data-contrast="high"] .notify-row-title, [data-contrast="high"] .notify-sub { color:#000; }

/* v5.127.87: the Export dialog's forecast (section 3) and a several-sheet mapping's sheets (section 1) */
.export-sheets { border:1px solid #E3E3E3; border-radius:4px; margin-bottom:10px; }
.export-sheet-row { display:flex; justify-content:space-between; gap:8px; padding:7px 10px; border-bottom:1px solid #F0F0F0; font-size:12px; color:#1A1A1A; }
.export-sheet-row:last-child { border-bottom:none; }
.export-sheet-rows { color:#555; }
.export-sheet-count { font-variant-numeric:tabular-nums; }
.export-forecast { display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border-radius:4px; background:#F4F9FD;
                   border:1px solid #BDD7EE; font-size:13px; color:#1A1A1A; }
.export-forecast svg { flex:none; margin-top:1px; color:var(--navy,#1B3A5C); }
.export-forecast-bg { background:#FEF5E7; border-color:#F3DDB8; }
.export-replaces { font-size:12px; color:#7A4A00; margin:8px 0 0; }

/* v5.127.87: the Mappings tab's Transforms column */
.map-tf-btn { font-size:11px; white-space:nowrap; color:var(--soft,#64748b); }
.map-tf-btn.map-tf-set { color:var(--navy,#1B3A5C); font-weight:600; }
